From 3bbe3db8d392c96ec8396e88c05353ed98659b4a Mon Sep 17 00:00:00 2001 From: Tommmaso Menga Date: Mon, 6 May 2024 17:22:40 +0200 Subject: [PATCH] docs(link, button): udpate stories with 'accessibility-label' --- .../button/common/button-common-stories.ts | 8 +++++++ .../common/button-link-common-stories.ts | 8 +++++++ .../button/common/common-stories.ts | 8 ------- .../link/common/link-common-stories.ts | 24 ++++++++++++------- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/components/button/common/button-common-stories.ts b/src/components/button/common/button-common-stories.ts index 09a0d56b14..8c4bb9cb75 100644 --- a/src/components/button/common/button-common-stories.ts +++ b/src/components/button/common/button-common-stories.ts @@ -66,6 +66,12 @@ const form: InputType = { }, }; +const ariaLabel: InputType = { + control: { + type: 'text', + }, +}; + export const buttonDefaultArgTypes: ArgTypes = { ...commonDefaultArgTypes, type, @@ -73,6 +79,7 @@ export const buttonDefaultArgTypes: ArgTypes = { name, value, form, + 'aria-label': ariaLabel, }; export const buttonDefaultArgs: Args = { @@ -82,6 +89,7 @@ export const buttonDefaultArgs: Args = { name: 'Button Name', value: undefined, form: undefined, + 'aria-label': undefined, }; export const requestSubmit: StoryObj = { diff --git a/src/components/button/common/button-link-common-stories.ts b/src/components/button/common/button-link-common-stories.ts index 811960b338..69dbc86b09 100644 --- a/src/components/button/common/button-link-common-stories.ts +++ b/src/components/button/common/button-link-common-stories.ts @@ -55,6 +55,12 @@ const disabled: InputType = { }, }; +const accessibilityLabel: InputType = { + control: { + type: 'text', + }, +}; + export const buttonLinkDefaultArgTypes: ArgTypes = { ...commonDefaultArgTypes, href, @@ -62,6 +68,7 @@ export const buttonLinkDefaultArgTypes: ArgTypes = { rel, download, disabled, + 'accessibility-label': accessibilityLabel, }; export const buttonLinkDefaultArgs: Args = { @@ -71,4 +78,5 @@ export const buttonLinkDefaultArgs: Args = { rel: 'noopener', download: false, disabled: false, + 'accessibility-label': undefined, }; diff --git a/src/components/button/common/common-stories.ts b/src/components/button/common/common-stories.ts index dc7cbe0015..45bf52f00d 100644 --- a/src/components/button/common/common-stories.ts +++ b/src/components/button/common/common-stories.ts @@ -96,12 +96,6 @@ const iconName: InputType = { }, }; -const ariaLabel: InputType = { - control: { - type: 'text', - }, -}; - const tag: InputType = { control: { type: 'text', @@ -117,7 +111,6 @@ export const commonDefaultArgTypes: ArgTypes = { negative, size, 'icon-name': iconName, - 'aria-label': ariaLabel, }; export const commonDefaultArgs: Args = { @@ -126,7 +119,6 @@ export const commonDefaultArgs: Args = { negative: false, size: size.options![0], 'icon-name': 'arrow-right-small', - 'aria-label': undefined, }; export const primary: StoryObj = { diff --git a/src/components/link/common/link-common-stories.ts b/src/components/link/common/link-common-stories.ts index b5cf1ab084..80f97cdf0d 100644 --- a/src/components/link/common/link-common-stories.ts +++ b/src/components/link/common/link-common-stories.ts @@ -54,12 +54,6 @@ const negative: InputType = { }, }; -const ariaLabel: InputType = { - control: { - type: 'text', - }, -}; - const disabled: InputType = { control: { type: 'boolean', @@ -81,14 +75,12 @@ const tag: InputType = { export const linkCommonDefaultArgTypes: ArgTypes = { text, negative, - 'aria-label': ariaLabel, tag, }; export const linkCommonDefaultArgs: Args = { text: 'Travelcards & tickets', negative: false, - 'aria-label': undefined, tag: 'TBD', }; @@ -177,6 +169,12 @@ const download: InputType = { }, }; +const accessibilityLabel: InputType = { + control: { + type: 'text', + }, +}; + export const linkDefaultArgTypes: ArgTypes = { ...linkCommonDefaultArgTypes, href, @@ -184,6 +182,7 @@ export const linkDefaultArgTypes: ArgTypes = { rel, download, disabled, + 'accessibility-label': accessibilityLabel, }; export const linkDefaultArgs: Args = { @@ -193,6 +192,7 @@ export const linkDefaultArgs: Args = { rel: undefined, download: false, disabled: false, + 'accessibility-label': undefined, }; // link-button params @@ -234,6 +234,12 @@ const form: InputType = { }, }; +const ariaLabel: InputType = { + control: { + type: 'text', + }, +}; + export const linkButtonDefaultArgTypes: ArgTypes = { ...linkCommonDefaultArgTypes, type, @@ -241,6 +247,7 @@ export const linkButtonDefaultArgTypes: ArgTypes = { name, value, form, + 'aria-label': ariaLabel, }; export const linkButtonDefaultArgs: Args = { @@ -250,6 +257,7 @@ export const linkButtonDefaultArgs: Args = { name: 'Button name', value: undefined, form: undefined, + 'aria-label': undefined, }; // Stories