Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export const Default: Story = {
args: {
items: URLS,
children: [
<Autocomplete.Input placeholder="Enter a URL" key="input" />,
<Autocomplete.Input
aria-label="URL"
placeholder="Enter a URL"
key="input"
/>,
<Autocomplete.Popup key="popup">
<Autocomplete.Empty>No matching items.</Autocomplete.Empty>
<Autocomplete.List>
Expand Down Expand Up @@ -109,7 +113,10 @@ export const OpenOnlyOnMatch: Story = {
} }
filteredItems={ filteredItems }
>
<Autocomplete.Input placeholder="Enter a URL" />
<Autocomplete.Input
aria-label="URL"
placeholder="Enter a URL"
/>
<Autocomplete.Popup>
<Autocomplete.List>
<Autocomplete.ListBody>
Expand Down Expand Up @@ -217,7 +224,7 @@ function AsyncItemsTemplate( {
}, 500 );
} }
>
<Autocomplete.Input placeholder="Enter a URL" />
<Autocomplete.Input aria-label="URL" placeholder="Enter a URL" />
<Autocomplete.Popup>
<AsyncStatus
loading={ loading }
Expand Down Expand Up @@ -294,7 +301,10 @@ export const Inline: Story = {
value={ value }
onValueChange={ setValue }
>
<Autocomplete.Input placeholder="Type a command" />
<Autocomplete.Input
aria-label="Command"
placeholder="Type a command"
/>
<div
style={ {
minHeight: '200px',
Expand Down Expand Up @@ -328,6 +338,7 @@ export const WithSearchIconAndClearButton: Story = {
children: [
<Autocomplete.InputGroup key="inputGroup">
<Autocomplete.Input
aria-label="Search URLs"
placeholder="Search URLs"
render={
<Input
Expand Down Expand Up @@ -470,6 +481,7 @@ export const InlineMentionAutocomplete: Story = {
>
<Autocomplete.Input
ref={ inputRef }
aria-label="Comment"
placeholder="Type @ to mention someone"
/>

Expand Down Expand Up @@ -515,7 +527,11 @@ export const WithCustomZIndex: Story = {
args: {
items: URLS,
children: [
<Autocomplete.Input placeholder="Enter a URL" key="input" />,
<Autocomplete.Input
aria-label="URL"
placeholder="Enter a URL"
key="input"
/>,
<Autocomplete.Popup
portal={
<Autocomplete.Portal
Expand Down Expand Up @@ -551,7 +567,11 @@ export const Grouped: Story = {
args: {
items: GROUPED_COMMANDS,
children: [
<Autocomplete.Input placeholder="Type a command" key="input" />,
<Autocomplete.Input
aria-label="Command"
placeholder="Type a command"
key="input"
/>,
<Autocomplete.Popup key="popup">
<Autocomplete.Empty>No matching items.</Autocomplete.Empty>
<Autocomplete.List>
Expand Down Expand Up @@ -636,7 +656,10 @@ export const Grid: Story = {
render: function Template( args ) {
return (
<Autocomplete.Root { ...args }>
<Autocomplete.Input placeholder="Search emojis" />
<Autocomplete.Input
aria-label="Search emojis"
placeholder="Search emojis"
/>
<div
style={ {
marginTop: 'var(--wpds-dimension-gap-sm)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const meta: Meta< typeof Checkbox > = {
title: 'Design System/Components/Form/Primitives/Checkbox',
component: Checkbox,
parameters: {
// FIXME: Stories show the checkbox primitive without a visible label (aria-toggle-field-name).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
componentStatus: {
status: 'use-with-caution',
whereUsed: 'global',
Expand All @@ -21,29 +18,35 @@ export default meta;
type Story = StoryObj< typeof Checkbox >;

export const Default: Story = {
args: {},
args: {
'aria-label': 'Option',
},
};

export const Checked: Story = {
args: {
...Default.args,
defaultChecked: true,
},
};

export const Indeterminate: Story = {
args: {
...Default.args,
indeterminate: true,
},
};

export const Disabled: Story = {
args: {
...Default.args,
disabled: true,
},
};

export const DisabledChecked: Story = {
args: {
...Default.args,
disabled: true,
defaultChecked: true,
},
Expand Down
42 changes: 21 additions & 21 deletions packages/ui/src/form/primitives/combobox/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const meta: Meta< typeof Combobox.Root > = {
'Combobox.Clear': Combobox.Clear,
},
parameters: {
// FIXME: The trigger has no visible label and relies on aria-label
// (button-name).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
componentStatus: {
status: 'use-with-caution',
whereUsed: 'global',
Expand All @@ -61,10 +57,10 @@ export const Default: Story = {
args: {
items: ITEMS,
children: [
<Combobox.Trigger key="trigger" />,
<Combobox.Trigger aria-label="Fruit" key="trigger" />,
<Combobox.Popup key="popup">
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<Combobox.Empty>No results found.</Combobox.Empty>
<Combobox.List>
Expand All @@ -91,10 +87,14 @@ export const Compact: Story = {
defaultValue: ITEMS[ 0 ],
items: ITEMS,
children: [
<Combobox.Trigger size="compact" key="trigger" />,
<Combobox.Trigger
size="compact"
aria-label="Fruit"
key="trigger"
/>,
<Combobox.Popup key="popup">
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<Combobox.Empty>No results found.</Combobox.Empty>
<Combobox.List>
Expand Down Expand Up @@ -128,9 +128,6 @@ export const DetachedInline: Story = {
// The input keeps focus and arrow keys move through the options, so
// the scrollable list is reachable by keyboard.
a11y: {
// Storybook merges parameters, so `test` must be set here to
// override the warning-only default from `meta`.
test: 'error',
config: {
rules: [
{ id: 'scrollable-region-focusable', enabled: false },
Expand Down Expand Up @@ -210,10 +207,13 @@ export const Creatable: Story = {
: ITEMS
}
>
<Combobox.Trigger />
<Combobox.Trigger aria-label="Fruit" />
<Combobox.Popup>
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input
aria-label="Search"
placeholder="Search"
/>
</div>
<Combobox.Empty>No results found.</Combobox.Empty>
<Combobox.List>
Expand Down Expand Up @@ -339,10 +339,10 @@ function AsyncItemsTemplate( {
}, 500 );
} }
>
<Combobox.Trigger />
<Combobox.Trigger aria-label="Fruit" />
<Combobox.Popup>
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<AsyncStatus
loading={ loading }
Expand Down Expand Up @@ -401,7 +401,7 @@ export const WithCustomTriggerAndItem: Story = {
items: ITEMS,
defaultValue: ITEMS[ 0 ],
children: [
<Combobox.Trigger key="trigger">
<Combobox.Trigger aria-label="Fruit" key="trigger">
{ ( item: FixtureItem ) => (
<span
style={ {
Expand All @@ -425,7 +425,7 @@ export const WithCustomTriggerAndItem: Story = {
</Combobox.Trigger>,
<Combobox.Popup key="popup">
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<Combobox.List>
<Combobox.ListBody>
Expand Down Expand Up @@ -470,10 +470,10 @@ export const Grouped: Story = {
args: {
items: GROUPED_ITEMS,
children: [
<Combobox.Trigger key="trigger" />,
<Combobox.Trigger aria-label="Fruit" key="trigger" />,
<Combobox.Popup key="popup">
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<Combobox.Empty>No results found.</Combobox.Empty>
<Combobox.List>
Expand Down Expand Up @@ -527,7 +527,7 @@ export const WithCustomZIndex: Story = {
defaultValue: ITEMS[ 0 ],
items: ITEMS,
children: [
<Combobox.Trigger key="trigger" />,
<Combobox.Trigger aria-label="Fruit" key="trigger" />,
<Combobox.Popup
positioner={
<Combobox.Positioner
Expand All @@ -539,7 +539,7 @@ export const WithCustomZIndex: Story = {
key="popup"
>
<div style={ inputWrapperStyle }>
<Combobox.Input placeholder="Search" />
<Combobox.Input aria-label="Search" placeholder="Search" />
</div>
<Combobox.List>
<Combobox.ListBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Story = StoryObj< typeof Input >;
export const Default: Story = {
args: {
placeholder: 'Placeholder',
'aria-label': 'Value',
},
};

Expand All @@ -42,19 +43,16 @@ export const Default: Story = {
export const WithPrefix: Story = {
args: {
placeholder: 'username',
'aria-label': 'Username',
prefix: <InputLayout.Slot>@</InputLayout.Slot>,
},
};

export const WithSuffixControl: Story = {
args: {
'aria-label': 'Value',
suffix: InputLayoutWithSuffixControl.args?.suffix,
},
parameters: {
// FIXME: Story shows Input without a visible label (label).
// See: https://github.com/WordPress/gutenberg/issues/81596
a11y: { test: 'todo' },
},
};

export const Disabled: Story = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const Default: Story = {
args: {
defaultValue: [ ITEMS[ 0 ], ITEMS[ 1 ] ],
items: ITEMS,
'aria-label': 'Fruit',
},
};

Expand Down Expand Up @@ -100,6 +101,7 @@ export const WithCustomEmptyContent: Story = {
*/
export const Grouped: Story = {
args: {
'aria-label': 'Fruit',
items: GROUPED_ITEMS,
children: ( group: FixtureGroup ) => (
<SearchableChipSelect.Group
Expand Down
Loading
Loading