From 9811d3d2777dcca9b74d15ce4f6126fb90b579bb Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 1 Apr 2022 11:23:30 +0200 Subject: chore: add a Close icon component --- src/components/atoms/icons/close.module.scss | 12 ++++++++++++ src/components/atoms/icons/close.stories.tsx | 13 +++++++++++++ src/components/atoms/icons/close.test.tsx | 9 +++++++++ src/components/atoms/icons/close.tsx | 28 ++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 src/components/atoms/icons/close.module.scss create mode 100644 src/components/atoms/icons/close.stories.tsx create mode 100644 src/components/atoms/icons/close.test.tsx create mode 100644 src/components/atoms/icons/close.tsx (limited to 'src') diff --git a/src/components/atoms/icons/close.module.scss b/src/components/atoms/icons/close.module.scss new file mode 100644 index 0000000..4a5d18d --- /dev/null +++ b/src/components/atoms/icons/close.module.scss @@ -0,0 +1,12 @@ +@use "@styles/abstracts/functions" as fun; + +.icon { + display: block; + width: var(--icon-size, #{fun.convert-px(40)}); +} + +.line { + fill: var(--color-primary-lighter); + stroke: var(--color-primary-darker); + stroke-width: 3; +} diff --git a/src/components/atoms/icons/close.stories.tsx b/src/components/atoms/icons/close.stories.tsx new file mode 100644 index 0000000..265df7a --- /dev/null +++ b/src/components/atoms/icons/close.stories.tsx @@ -0,0 +1,13 @@ +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import CloseIcon from './close'; + +export default { + title: 'Atoms/Icons', + component: CloseIcon, +} as ComponentMeta; + +const Template: ComponentStory = (args) => ( + +); + +export const Close = Template.bind({}); diff --git a/src/components/atoms/icons/close.test.tsx b/src/components/atoms/icons/close.test.tsx new file mode 100644 index 0000000..0357bec --- /dev/null +++ b/src/components/atoms/icons/close.test.tsx @@ -0,0 +1,9 @@ +import { render } from '@test-utils'; +import Close from './close'; + +describe('Close', () => { + it('renders a Close icon', () => { + const { container } = render(); + expect(container).toBeDefined(); + }); +}); diff --git a/src/components/atoms/icons/close.tsx b/src/components/atoms/icons/close.tsx new file mode 100644 index 0000000..80d904e --- /dev/null +++ b/src/components/atoms/icons/close.tsx @@ -0,0 +1,28 @@ +import { FC } from 'react'; +import styles from './close.module.scss'; + +/** + * Close component + * + * Render a close svg icon. + */ +const Close: FC = () => { + return ( + + + + + ); +}; + +export default Close; -- cgit v1.2.3