Skip to content

Commit

Permalink
docs(react): update form story to fix or remove accessibility violati…
Browse files Browse the repository at this point in the history
…ons (#11486)

* fix(react): update story to fix or remove accessibility violations

* chore(react): add back hasMargin

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
abbeyhrt and kodiakhq[bot] committed May 31, 2022
1 parent 1f1b70a commit d20b95d
Showing 1 changed file with 32 additions and 54 deletions.
86 changes: 32 additions & 54 deletions packages/react/src/components/Form/next/Form.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import Select from '../../Select';
import SelectItem from '../../SelectItem';
import TextArea from '../../TextArea';
import TextInput from '../../TextInput';
import Toggle from '../../Toggle';
import { Stack } from '../../Stack';

const checkboxEvents = {
Expand All @@ -40,16 +39,7 @@ const numberInputProps = {
max: 100,
value: 50,
step: 10,
};

const toggleProps = {
className: 'some-class',
hideLabel: true,
};

const fieldsetToggleProps = {
className: 'some-class',
legendText: 'Toggle heading',
iconDescription: 'Add/decrement number',
};

const fileUploaderEvents = {
Expand All @@ -66,11 +56,6 @@ const radioProps = {
className: 'some-class',
};

const fieldsetRadioProps = {
className: 'some-class',
legendText: 'Radio Button heading',
};

const searchProps = {
className: 'some-class',
size: 'md',
Expand Down Expand Up @@ -136,52 +121,45 @@ export const Default = () => (

<NumberInput {...numberInputProps} />

<FormGroup {...fieldsetToggleProps}>
<Stack gap={3}>
<Toggle {...toggleProps} id="toggle-1" />
<Toggle disabled {...toggleProps} id="toggle-2" />
</Stack>
</FormGroup>

<FormGroup {...fieldsetFileUploaderProps}>
<FileUploader
{...fileUploaderEvents}
id="file-1"
labelDescription="Choose Files..."
iconDescription="Dismiss file"
/>
</FormGroup>

<FormGroup {...fieldsetRadioProps}>
<RadioButtonGroup
name="radio-button-group"
defaultSelected="default-selected">
<RadioButton
value="standard"
id="radio-1"
labelText="Standard Radio Button"
{...radioProps}
/>
<RadioButton
value="default-selected"
labelText="Default Selected Radio Button"
id="radio-2"
{...radioProps}
/>
<RadioButton
value="blue"
labelText="Standard Radio Button"
id="radio-3"
{...radioProps}
/>
<RadioButton
value="disabled"
labelText="Disabled Radio Button"
id="radio-4"
disabled
{...radioProps}
/>
</RadioButtonGroup>
</FormGroup>
<RadioButtonGroup
name="radio-button-group"
defaultSelected="default-selected"
legendText="Radio Button heading">
<RadioButton
value="standard"
id="radio-1"
labelText="Standard Radio Button"
{...radioProps}
/>
<RadioButton
value="default-selected"
labelText="Default Selected Radio Button"
id="radio-2"
{...radioProps}
/>
<RadioButton
value="blue"
labelText="Standard Radio Button"
id="radio-3"
{...radioProps}
/>
<RadioButton
value="disabled"
labelText="Disabled Radio Button"
id="radio-4"
disabled
{...radioProps}
/>
</RadioButtonGroup>

<FormGroup {...fieldsetSearchProps}>
<Search
Expand Down

0 comments on commit d20b95d

Please sign in to comment.