Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Toggle labels #17315

Merged
merged 2 commits into from
Sep 4, 2024
Merged
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
17 changes: 12 additions & 5 deletions packages/react/src/components/Toggle/Toggle.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {

export const Default = () => (
<Toggle
labelText="Toggle element label"
labelText="Label"
labelA="Off"
labelB="On"
defaultToggled
Expand All @@ -28,7 +28,7 @@ export const Default = () => (
export const SmallToggle = () => (
<Toggle
size="sm"
labelText="Toggle element label"
labelText="Label"
labelA="Off"
labelB="On"
defaultToggled
Expand All @@ -37,7 +37,14 @@ export const SmallToggle = () => (
);

export const Playground = (args) => (
<Toggle labelA="Off" labelB="On" defaultToggled id="toggle-3" {...args} />
<Toggle
labelText="Label"
labelA="Off"
labelB="On"
defaultToggled
id="toggle-3"
{...args}
/>
);

Playground.argTypes = {
Expand Down Expand Up @@ -85,9 +92,9 @@ Playground.argTypes = {

export const WithAccessibleLabels = () => (
<VStack gap={7}>
<Toggle id="toggle-4" labelText="Toggle label" />
<Toggle id="toggle-4" labelText="Label" />

<Toggle id="toggle-5" labelText="Toggle label" hideLabel />
<Toggle id="toggle-5" labelText="Label" hideLabel />

<div>
<div id="toggle-6-label" style={{ marginBlockEnd: '0.5rem' }}>
Expand Down
Loading