Skip to content

Commit

Permalink
chore: Update Switch docs (#1527)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Smedinga <[email protected]>
  • Loading branch information
alimpens and VincentSmedinga authored Aug 24, 2024
1 parent 449dcb8 commit 274a916
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/css/src/components/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ It is written in the first person when asking the user to agree to the terms and

- [WCAG 1.3.5](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html): It is clear for both users and programmatically what the purpose of a form field is.

Checkbox is an interactive element; therefore, [the general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
Checkbox is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
2 changes: 1 addition & 1 deletion packages/css/src/components/page-menu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Check out the [developer guide](/docs/docs-developer-guide-routing-libraries--do

- [Consistent Navigation (Level AA)](https://www.w3.org/WAI/WCAG21/Understanding/consistent-navigation.html)

PageMenu is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
Page Menu is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
2 changes: 1 addition & 1 deletion packages/css/src/components/search-field/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ These features can be disruptive for a user searching for part of a word, and `a
- [WCAG 1.3.5](https://www.w3.org/TR/WCAG22/#identify-input-purpose): It is clear both to the user and programmatically what the purpose of a form field is.
- [WCAG 2.4.6](https://www.w3.org/TR/WCAG22/#headings-and-labels): There is a label describing the purpose of the input.

Search Field is an interactive element; therefore, [the general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
Search Field is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.
4 changes: 2 additions & 2 deletions packages/css/src/components/switch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ A switch applies to a page or the entire system, such as an on/off switch.

## Guidelines

- A Switch must have a label, and in most cases, this label should be visible.
- Switch only between two different states.
It is a binary action.
- Use labels with a switch to make the action clear.
- The action takes place immediately when the user operates the switch.

## Relevant WCAG requirements

- [WCAG 1.3.5](https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html): it is both clear for a user and programmatically what the purpose of a form field is.

Switch is an interactive element; general requirements and guidelines for interactivity apply [here](/docs/docs-developer-guide-interactivity--docs).
Switch is an interactive element, and the [general requirements and guidelines for interactivity](/docs/docs-developer-guide-interactivity--docs) apply.

## References

Expand Down
4 changes: 0 additions & 4 deletions storybook/src/components/Switch/Switch.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import README from "../../../../packages/css/src/components/switch/README.md?raw

<Markdown>{README}</Markdown>

It can be used as a standalone component or as a form control element.
When used as a standalone component provide an `aria-label` or `aria-labelledby` prop to keep it accessible.
When used as a formcontrol, make sure to add the associated `<Label>` component.

<Primary />

<Controls />
Expand Down
9 changes: 1 addition & 8 deletions storybook/src/components/Switch/Switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ const meta = {
disabled: false,
},
argTypes: {
'aria-label': {
description: 'Describes the control.',
},
checked: {
description: 'Whether the control is initially checked.',
},
Expand All @@ -45,11 +42,7 @@ export default meta

type Story = StoryObj<typeof meta>

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

export const WithLabel: Story = {
decorators: [
Expand Down

0 comments on commit 274a916

Please sign in to comment.