From 9eeb49155e2e74df4d5cb2833da20669b85fafe5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 4 Oct 2023 14:21:24 +0200 Subject: feat(components): add a Help icon shape --- src/components/atoms/images/icons/icon.stories.tsx | 9 +++++++++ src/components/atoms/images/icons/icon.test.tsx | 8 ++++++++ src/components/atoms/images/icons/icon.tsx | 6 +++++- .../svg-paths/icons-paths/help-icon-paths.module.scss | 3 +++ .../icons/svg-paths/icons-paths/help-icon-paths.tsx | 15 +++++++++++++++ .../atoms/images/icons/svg-paths/icons-paths/index.ts | 1 + src/components/atoms/images/icons/svg-paths/svg-paths.tsx | 4 ++++ 7 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.module.scss create mode 100644 src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.tsx (limited to 'src/components/atoms/images') diff --git a/src/components/atoms/images/icons/icon.stories.tsx b/src/components/atoms/images/icons/icon.stories.tsx index fa8d2b5..0da568a 100644 --- a/src/components/atoms/images/icons/icon.stories.tsx +++ b/src/components/atoms/images/icons/icon.stories.tsx @@ -22,6 +22,7 @@ export default { 'envelop', 'feed', 'hamburger', + 'help', 'home', 'magnifying-glass', 'minus', @@ -144,6 +145,14 @@ Hamburger.args = { shape: 'hamburger', }; +/** + * Icon Stories - Help + */ +export const Help = Template.bind({}); +Help.args = { + shape: 'help', +}; + /** * Icon Stories - Home */ diff --git a/src/components/atoms/images/icons/icon.test.tsx b/src/components/atoms/images/icons/icon.test.tsx index d80edd7..103b34c 100644 --- a/src/components/atoms/images/icons/icon.test.tsx +++ b/src/components/atoms/images/icons/icon.test.tsx @@ -116,6 +116,14 @@ describe('Icon', () => { expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument(); }); + it('render an icon with help shape', () => { + const heading = 'quidem'; + + render(); + + expect(rtlScreen.getByRole('img', { name: heading })).toBeInTheDocument(); + }); + it('render an icon with home shape', () => { const heading = 'aut'; diff --git a/src/components/atoms/images/icons/icon.tsx b/src/components/atoms/images/icons/icon.tsx index 23170d9..c694abf 100644 --- a/src/components/atoms/images/icons/icon.tsx +++ b/src/components/atoms/images/icons/icon.tsx @@ -8,7 +8,11 @@ import { } from './plus-minus-icon'; import { type SVGIconShape, SVGPaths, type SVGPathsProps } from './svg-paths'; -export type IconShape = SVGIconShape | PlusMinusIconShape | 'hamburger'; +export type IconShape = + | SVGIconShape + | PlusMinusIconShape + | 'hamburger' + | 'help'; export type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; diff --git a/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.module.scss b/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.module.scss new file mode 100644 index 0000000..477cd53 --- /dev/null +++ b/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.module.scss @@ -0,0 +1,3 @@ +.icon { + fill: var(--color-primary); +} diff --git a/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.tsx b/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.tsx new file mode 100644 index 0000000..dae2190 --- /dev/null +++ b/src/components/atoms/images/icons/svg-paths/icons-paths/help-icon-paths.tsx @@ -0,0 +1,15 @@ +/* eslint-disable react/jsx-no-literals */ +import type { FC } from 'react'; +import styles from './help-icon-paths.module.scss'; + +/** + * HelpIconPaths + * + * Render the svg paths to make a help icon. + */ +export const HelpIconPaths: FC = () => ( + +); diff --git a/src/components/atoms/images/icons/svg-paths/icons-paths/index.ts b/src/components/atoms/images/icons/svg-paths/icons-paths/index.ts index 43927ae..ed82fc1 100644 --- a/src/components/atoms/images/icons/svg-paths/icons-paths/index.ts +++ b/src/components/atoms/images/icons/svg-paths/icons-paths/index.ts @@ -6,6 +6,7 @@ export * from './computer-icon-paths'; export * from './cross-icon-paths'; export * from './envelop-icon-paths'; export * from './feed-icon-paths'; +export * from './help-icon-paths'; export * from './home-icon-paths'; export * from './magnifying-glass-icon-paths'; export * from './moon-icon-paths'; diff --git a/src/components/atoms/images/icons/svg-paths/svg-paths.tsx b/src/components/atoms/images/icons/svg-paths/svg-paths.tsx index 0f5be6e..88de5ef 100644 --- a/src/components/atoms/images/icons/svg-paths/svg-paths.tsx +++ b/src/components/atoms/images/icons/svg-paths/svg-paths.tsx @@ -14,6 +14,7 @@ import { PostsStackIconPaths, SunIconPaths, CrossIconPaths, + HelpIconPaths, } from './icons-paths'; export type SVGIconOrientation = ArrowOrientation; @@ -27,6 +28,7 @@ export type SVGIconShape = | 'cross' | 'envelop' | 'feed' + | 'help' | 'home' | 'magnifying-glass' | 'moon' @@ -67,6 +69,8 @@ export const SVGPaths: FC = ({ return ; case 'feed': return ; + case 'help': + return ; case 'home': return ; case 'magnifying-glass': -- cgit v1.2.3