Skip to content

Commit

Permalink
docs(link, button): udpate stories with 'accessibility-label'
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMenga committed May 6, 2024
1 parent 75c0e33 commit 3bbe3db
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
8 changes: 8 additions & 0 deletions src/components/button/common/button-common-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ const form: InputType = {
},
};

const ariaLabel: InputType = {
control: {
type: 'text',
},
};

export const buttonDefaultArgTypes: ArgTypes = {
...commonDefaultArgTypes,
type,
disabled,
name,
value,
form,
'aria-label': ariaLabel,
};

export const buttonDefaultArgs: Args = {
Expand All @@ -82,6 +89,7 @@ export const buttonDefaultArgs: Args = {
name: 'Button Name',
value: undefined,
form: undefined,
'aria-label': undefined,
};

export const requestSubmit: StoryObj = {
Expand Down
8 changes: 8 additions & 0 deletions src/components/button/common/button-link-common-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,20 @@ const disabled: InputType = {
},
};

const accessibilityLabel: InputType = {
control: {
type: 'text',
},
};

export const buttonLinkDefaultArgTypes: ArgTypes = {
...commonDefaultArgTypes,
href,
target,
rel,
download,
disabled,
'accessibility-label': accessibilityLabel,
};

export const buttonLinkDefaultArgs: Args = {
Expand All @@ -71,4 +78,5 @@ export const buttonLinkDefaultArgs: Args = {
rel: 'noopener',
download: false,
disabled: false,
'accessibility-label': undefined,
};
8 changes: 0 additions & 8 deletions src/components/button/common/common-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ const iconName: InputType = {
},
};

const ariaLabel: InputType = {
control: {
type: 'text',
},
};

const tag: InputType = {
control: {
type: 'text',
Expand All @@ -117,7 +111,6 @@ export const commonDefaultArgTypes: ArgTypes = {
negative,
size,
'icon-name': iconName,
'aria-label': ariaLabel,
};

export const commonDefaultArgs: Args = {
Expand All @@ -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 = {
Expand Down
24 changes: 16 additions & 8 deletions src/components/link/common/link-common-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ const negative: InputType = {
},
};

const ariaLabel: InputType = {
control: {
type: 'text',
},
};

const disabled: InputType = {
control: {
type: 'boolean',
Expand All @@ -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',
};

Expand Down Expand Up @@ -177,13 +169,20 @@ const download: InputType = {
},
};

const accessibilityLabel: InputType = {
control: {
type: 'text',
},
};

export const linkDefaultArgTypes: ArgTypes = {
...linkCommonDefaultArgTypes,
href,
target,
rel,
download,
disabled,
'accessibility-label': accessibilityLabel,
};

export const linkDefaultArgs: Args = {
Expand All @@ -193,6 +192,7 @@ export const linkDefaultArgs: Args = {
rel: undefined,
download: false,
disabled: false,
'accessibility-label': undefined,
};

// link-button params
Expand Down Expand Up @@ -234,13 +234,20 @@ const form: InputType = {
},
};

const ariaLabel: InputType = {
control: {
type: 'text',
},
};

export const linkButtonDefaultArgTypes: ArgTypes = {
...linkCommonDefaultArgTypes,
type,
disabled,
name,
value,
form,
'aria-label': ariaLabel,
};

export const linkButtonDefaultArgs: Args = {
Expand All @@ -250,6 +257,7 @@ export const linkButtonDefaultArgs: Args = {
name: 'Button name',
value: undefined,
form: undefined,
'aria-label': undefined,
};

// Stories
Expand Down

0 comments on commit 3bbe3db

Please sign in to comment.