From 788505c0f87c4b9707a88d1885455bcf65e98bc9 Mon Sep 17 00:00:00 2001 From: evgenitsn Date: Wed, 6 Jul 2022 10:13:46 +0300 Subject: [PATCH] feat(PPDSC-2248): update noIcon to hideIcon --- site/pages/components/structured-list.tsx | 2 +- .../structured-list.test.tsx.snap | 6 ++--- .../__tests__/structured-list.stories.tsx | 22 +++++++++---------- .../__tests__/structured-list.test.tsx | 12 +++++----- src/structured-list/structured-list-item.tsx | 6 ++--- src/structured-list/types.ts | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/site/pages/components/structured-list.tsx b/site/pages/components/structured-list.tsx index c676ee1ec5..4ac07cd8b3 100644 --- a/site/pages/components/structured-list.tsx +++ b/site/pages/components/structured-list.tsx @@ -465,7 +465,7 @@ const StructuredListComponent = (layoutProps: LayoutProps) => ( 'Vertically align the Icon when the StructuredListItem is Link', }, { - name: 'noIcon', + name: 'hideIcon', type: 'boolean', default: 'false', description: diff --git a/src/structured-list/__tests__/__snapshots__/structured-list.test.tsx.snap b/src/structured-list/__tests__/__snapshots__/structured-list.test.tsx.snap index 08c36d4c7c..e0bb535700 100644 --- a/src/structured-list/__tests__/__snapshots__/structured-list.test.tsx.snap +++ b/src/structured-list/__tests__/__snapshots__/structured-list.test.tsx.snap @@ -63,7 +63,7 @@ exports[`StructuredList with href renders four cells with href 1`] = ` `; -exports[`StructuredList with href renders one cell with disabled link and no icon 1`] = ` +exports[`StructuredList with href renders one cell with disabled link and hidden icon 1`] = ` .emotion-0 { list-style: none; @@ -308,7 +308,7 @@ exports[`StructuredList with href renders one cell with disabled link and no ico `; -exports[`StructuredList with href renders one cell with external link and no icon 1`] = ` +exports[`StructuredList with href renders one cell with external link and hidden icon 1`] = ` .emotion-0 { list-style: none; @@ -959,7 +959,7 @@ exports[`StructuredList with href renders one cell with external link icon 1`] = `; -exports[`StructuredList with href renders one cell with internal link and no icon 1`] = ` +exports[`StructuredList with href renders one cell with internal link and hidden icon 1`] = ` .emotion-0 { list-style: none; diff --git a/src/structured-list/__tests__/structured-list.stories.tsx b/src/structured-list/__tests__/structured-list.stories.tsx index 466d00d70a..d0b03d1bd0 100644 --- a/src/structured-list/__tests__/structured-list.stories.tsx +++ b/src/structured-list/__tests__/structured-list.stories.tsx @@ -247,12 +247,12 @@ export const StoryStructuredListInteractive = () => ( ); StoryStructuredListInteractive.storyName = 'structured-list-interactive'; -export const StoryStructuredListInteractiveNoIcon = () => ( +export const StoryStructuredListInteractiveHideIcon = () => ( <> StructuredList - with internal link (no icon) + with internal link (hide icon) - + Label @@ -260,16 +260,16 @@ export const StoryStructuredListInteractiveNoIcon = () => ( A short description of the label - + Label - with external link (no icon) + with external link (hide icon) - + Label @@ -277,15 +277,15 @@ export const StoryStructuredListInteractiveNoIcon = () => ( A short description of the label - + Label - with disabled link (no icon) + with disabled link (hide icon) - + Label @@ -296,8 +296,8 @@ export const StoryStructuredListInteractiveNoIcon = () => ( ); -StoryStructuredListInteractiveNoIcon.storyName = - 'structured-list-interactive-no-icon'; +StoryStructuredListInteractiveHideIcon.storyName = + 'structured-list-interactive-hide-icon'; export const StoryStructuredListCombined = () => ( <> diff --git a/src/structured-list/__tests__/structured-list.test.tsx b/src/structured-list/__tests__/structured-list.test.tsx index 7783f3fb7b..f676e91d58 100644 --- a/src/structured-list/__tests__/structured-list.test.tsx +++ b/src/structured-list/__tests__/structured-list.test.tsx @@ -334,30 +334,30 @@ describe('StructuredList', () => { ); }); - test('renders one cell with internal link and no icon', () => { + test('renders one cell with internal link and hidden icon', () => { const props: StructuredListItemProps = { children: OneCellDefault, - noIcon: true, + hideIcon: true, }; const fragment = renderToFragmentWithTheme(renderWithInternalLink, props); expect(fragment).toMatchSnapshot(); }); - test('renders one cell with external link and no icon', () => { + test('renders one cell with external link and hidden icon', () => { const props: StructuredListItemProps = { children: OneCellDefault, - noIcon: true, + hideIcon: true, }; const fragment = renderToFragmentWithTheme(renderWithExternalLink, props); expect(fragment).toMatchSnapshot(); }); - test('renders one cell with disabled link and no icon', () => { + test('renders one cell with disabled link and hidden icon', () => { const props: StructuredListItemProps = { children: OneCellDefault, - noIcon: true, + hideIcon: true, }; const fragment = renderToFragmentWithTheme(renderWithDisabledLink, props); diff --git a/src/structured-list/structured-list-item.tsx b/src/structured-list/structured-list-item.tsx index 324d51c658..c4470266b6 100644 --- a/src/structured-list/structured-list-item.tsx +++ b/src/structured-list/structured-list-item.tsx @@ -31,7 +31,7 @@ const ThemelessStructuredListItem = React.forwardRef< disabled, overrides, href, - noIcon, + hideIcon, linkIconAlign, eventContext, eventOriginator = 'list item', @@ -47,7 +47,7 @@ const ThemelessStructuredListItem = React.forwardRef< hasHref && childrenArray.length === 2 && !getPullRight(childrenArray[1]) && - !noIcon + !hideIcon ) { childrenArray.push( @@ -55,7 +55,7 @@ const ThemelessStructuredListItem = React.forwardRef< , ); } - if (hasHref && childrenArray.length === 1 && !noIcon) { + if (hasHref && childrenArray.length === 1 && !hideIcon) { childrenArray.push( diff --git a/src/structured-list/types.ts b/src/structured-list/types.ts index 072f38149b..82819a5260 100644 --- a/src/structured-list/types.ts +++ b/src/structured-list/types.ts @@ -28,7 +28,7 @@ export interface StructuredListItemProps ariaLabel?: string; disabled?: boolean; href?: string; - noIcon?: boolean; + hideIcon?: boolean; linkIconAlign?: StructuredListCellAlign; overrides?: { stylePreset?: MQ;