Skip to content

Commit 914678e

Browse files
Fix accessibility errors from markdown stories
1 parent 35dd260 commit 914678e

File tree

14 files changed

+141
-135
lines changed

14 files changed

+141
-135
lines changed

.storybook/test-runner.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module.exports = {
2323
axeOptions: {
2424
rules: {
2525
// TODO: enable this rule again once all color contrast issues are fixed
26-
"color-contrast": {
27-
enabled: false
28-
}
26+
'color-contrast': {
27+
enabled: false,
28+
},
2929
},
3030
},
3131
detailedReport: true,

scss/bitstyles/atoms/dropdown/dropdown.stories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const menu = `
6262
colorVariant: ['transparent'],
6363
shapeVariant: ['menu'],
6464
children: 'Settings',
65-
element: 'a',
65+
classname: ['u-width-full'],
6666
}).outerHTML
6767
}
6868
</li>
@@ -72,7 +72,7 @@ const menu = `
7272
colorVariant: ['transparent'],
7373
shapeVariant: ['menu'],
7474
children: 'Help',
75-
element: 'a',
75+
classname: ['u-width-full'],
7676
}).outerHTML
7777
}
7878
</li>
@@ -82,7 +82,7 @@ const menu = `
8282
colorVariant: ['transparent'],
8383
shapeVariant: ['menu'],
8484
children: 'Privacy',
85-
element: 'a',
85+
classname: ['u-width-full'],
8686
}).outerHTML
8787
}
8888
</li>
@@ -92,7 +92,7 @@ const menu = `
9292
colorVariant: ['transparent'],
9393
shapeVariant: ['menu'],
9494
children: 'Sign out',
95-
element: 'a',
95+
classname: ['u-width-full'],
9696
}).outerHTML
9797
}
9898
</li>

scss/bitstyles/base/forms/forms.stories.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ This includes all standard `type="text"` inputs, plus all the text-based inputs
143143
<Story name="Select and label (invalid)">
144144
{`
145145
<label for="input_d2">Invalid select</label>
146-
<select required>
146+
<select id="input_d2" required>
147147
<option value="" disabled hidden selected>Please select</option>
148148
<option value="value2">Value 2</option>
149149
<option value="value3">Value 3</option>

scss/bitstyles/base/forms/inputs.stories.mdx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
3232
<Canvas isColumn>
3333
<Story name="Input - color">
3434
{`
35-
<input type="color">
35+
<label><input type="color"> label</label>
3636
`}
3737
</Story>
3838
<Story name="Input - color (disabled)">
3939
{`
40-
<input type="color" disabled>
40+
<label><input type="color" disabled> label</label>
4141
`}
4242
</Story>
4343
</Canvas>
@@ -47,12 +47,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
4747
<Canvas isColumn>
4848
<Story name="Input - date">
4949
{`
50-
<input type="date">
50+
<label>label <input type="date"></label>
5151
`}
5252
</Story>
5353
<Story name="Input - date (disabled)">
5454
{`
55-
<input type="date" disabled>
55+
<label>label <input type="date" disabled></label>
5656
`}
5757
</Story>
5858
</Canvas>
@@ -62,12 +62,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
6262
<Canvas isColumn>
6363
<Story name="Input - datetime-local">
6464
{`
65-
<input type="datetime-local">
65+
<label>label <input type="datetime-local"></label>
6666
`}
6767
</Story>
6868
<Story name="Input - datetime-local (disabled)">
6969
{`
70-
<input type="datetime-local" disabled>
70+
<label>label <input type="datetime-local" disabled></label>
7171
`}
7272
</Story>
7373
</Canvas>
@@ -77,12 +77,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
7777
<Canvas isColumn>
7878
<Story name="Input - file">
7979
{`
80-
<input type="file">
80+
<label>label <input type="file"></label>
8181
`}
8282
</Story>
8383
<Story name="Input - file (disabled)">
8484
{`
85-
<input type="file" disabled>
85+
<label>label <input type="file" disabled></label>
8686
`}
8787
</Story>
8888
</Canvas>
@@ -107,12 +107,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
107107
<Canvas isColumn>
108108
<Story name="Input - month">
109109
{`
110-
<input type="month">
110+
<label>label <input type="month"></label>
111111
`}
112112
</Story>
113113
<Story name="Input - month (disabled)">
114114
{`
115-
<input type="month" disabled>
115+
<label>label <input type="month" disabled></label>
116116
`}
117117
</Story>
118118
</Canvas>
@@ -122,12 +122,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
122122
<Canvas isColumn>
123123
<Story name="Input - week">
124124
{`
125-
<input type="week">
125+
<label>label <input type="week"></label>
126126
`}
127127
</Story>
128128
<Story name="Input - week (disabled)">
129129
{`
130-
<input type="week" disabled>
130+
<label>label <input type="week" disabled></label>
131131
`}
132132
</Story>
133133
</Canvas>
@@ -137,12 +137,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
137137
<Canvas isColumn>
138138
<Story name="Input - password">
139139
{`
140-
<input type="password" value="Password">
140+
<label>label <input type="password" value="Password"></label>
141141
`}
142142
</Story>
143143
<Story name="Input - password (disabled)">
144144
{`
145-
<input type="password" value="Password" disabled>
145+
<label>label <input type="password" value="Password" disabled></label>
146146
`}
147147
</Story>
148148
</Canvas>
@@ -167,12 +167,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
167167
<Canvas isColumn>
168168
<Story name="Input - search">
169169
{`
170-
<input type="search">
170+
<label>label <input type="search"></label>
171171
`}
172172
</Story>
173173
<Story name="Input - search (disabled)">
174174
{`
175-
<input type="search" (disabled)>
175+
<label>label <input type="search" (disabled)></label>
176176
`}
177177
</Story>
178178
</Canvas>
@@ -197,12 +197,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
197197
<Canvas isColumn>
198198
<Story name="Input - tel">
199199
{`
200-
<input type="tel">
200+
<label>label <input type="tel"></label>
201201
`}
202202
</Story>
203203
<Story name="Input - tel (disabled)">
204204
{`
205-
<input type="tel" disabled>
205+
<label>label <input type="tel" disabled></label>
206206
`}
207207
</Story>
208208
</Canvas>
@@ -212,12 +212,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
212212
<Canvas isColumn>
213213
<Story name="Input - time">
214214
{`
215-
<input type="time">
215+
<label>label <input type="time"></label>
216216
`}
217217
</Story>
218218
<Story name="Input - time (disabled)">
219219
{`
220-
<input type="time" disabled>
220+
<label>label <input type="time" disabled></label>
221221
`}
222222
</Story>
223223
</Canvas>
@@ -227,12 +227,12 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
227227
<Canvas isColumn>
228228
<Story name="Input - url">
229229
{`
230-
<input type="url">
230+
<label>label <input type="url"></label>
231231
`}
232232
</Story>
233233
<Story name="Input - url (disabled)">
234234
{`
235-
<input type="url" disabled>
235+
<label>label <input type="url" disabled></label>
236236
`}
237237
</Story>
238238
</Canvas>

scss/bitstyles/base/input-checkbox/input-checkbox.stories.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
77
<Canvas isColumn>
88
<Story name="Input - checkbox">
99
{`
10-
<input type="checkbox">
10+
<label><input type="checkbox"> label</label>
1111
`}
1212
</Story>
1313
<Story name="Input - checkbox (disabled)">
1414
{`
15-
<input type="checkbox" disabled>
15+
<label><input type="checkbox" disabled> label</label>
1616
`}
1717
</Story>
1818
<Story name="Input - checkbox (checked)">
1919
{`
20-
<input type="checkbox" checked>
20+
<label><input type="checkbox" checked> label</label>
2121
`}
2222
</Story>
2323
<Story name="Input - checkbox (checked, disabled">
2424
{`
25-
<input type="checkbox" checked disabled>
25+
<label><input type="checkbox" checked disabled> label</label>
2626
`}
2727
</Story>
2828
</Canvas>

scss/bitstyles/base/input-radio/input-radio.stories.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import { Canvas, Meta, Story } from '@storybook/addon-docs';
77
<Canvas isColumn>
88
<Story name="Input - radio">
99
{`
10-
<input type="radio">
10+
<label><input type="radio"> label</label>
1111
`}
1212
</Story>
1313
<Story name="Input - radio (disabled)">
1414
{`
15-
<input type="radio" disabled>
15+
<label><input type="radio" disabled> label</label>
1616
`}
1717
</Story>
1818
<Story name="Input - radio (checked)">
1919
{`
20-
<input type="radio" checked>
20+
<label><input type="radio" checked> label</label>
2121
`}
2222
</Story>
2323
<Story name="Input - radio (checked, disabled)">
2424
{`
25-
<input type="radio" checked disabled>
25+
<label><input type="radio" checked disabled> label</label>
2626
`}
2727
</Story>
2828
</Canvas>

scss/bitstyles/base/input-text/input-text.stories.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ You may find [Base/Forms](/docs/base-forms--fieldset) more informative.
1313
<Canvas isColumn>
1414
<Story name="Input - text">
1515
{`
16-
<input type="text" placeholder="Jelly cake marshmallow">
16+
<label>label <input type="text" placeholder="Jelly cake marshmallow"></label>
1717
`}
1818
</Story>
1919
<Story name="Input - text (disabled)">
2020
{`
21-
<input type="text" placeholder="Jelly cake marshmallow" disabled>
21+
<label>label <input type="text" placeholder="Jelly cake marshmallow" disabled></label>
2222
`}
2323
</Story>
2424
</Canvas>
@@ -28,12 +28,12 @@ You may find [Base/Forms](/docs/base-forms--fieldset) more informative.
2828
<Canvas isColumn>
2929
<Story name="Input - email">
3030
{`
31-
<input type="email" placeholder="jellycake@marshmallow.com">
31+
<label>label <input type="email" placeholder="jellycake@marshmallow.com"></label>
3232
`}
3333
</Story>
3434
<Story name="Input - email (disabled)">
3535
{`
36-
<input type="email" placeholder="jellycake@marshmallow.com" disabled>
36+
<label>label <input type="email" placeholder="jellycake@marshmallow.com" disabled></label>
3737
`}
3838
</Story>
3939
</Canvas>
@@ -43,12 +43,12 @@ You may find [Base/Forms](/docs/base-forms--fieldset) more informative.
4343
<Canvas isColumn>
4444
<Story name="Input - number">
4545
{`
46-
<input type="number" placeholder="123456789">
46+
<label>label <input type="number" placeholder="123456789"></label>
4747
`}
4848
</Story>
4949
<Story name="Input - number (disabled)">
5050
{`
51-
<input type="number" placeholder="123456789" disabled>
51+
<label>label <input type="number" placeholder="123456789" disabled></label>
5252
`}
5353
</Story>
5454
</Canvas>
@@ -58,12 +58,12 @@ You may find [Base/Forms](/docs/base-forms--fieldset) more informative.
5858
<Canvas isColumn>
5959
<Story name="Input - range">
6060
{`
61-
<input type="range" min="0" max="10" step="1">
61+
<label>label <input type="range" min="0" max="10" step="1"></label>
6262
`}
6363
</Story>
6464
<Story name="Input - range (disabled)">
6565
{`
66-
<input type="range" min="0" max="10" step="1" disabled>
66+
<label>label <input type="range" min="0" max="10" step="1" disabled></label>
6767
`}
6868
</Story>
6969
</Canvas>
@@ -73,12 +73,12 @@ You may find [Base/Forms](/docs/base-forms--fieldset) more informative.
7373
<Canvas isColumn>
7474
<Story name="Textarea">
7575
{`
76-
<textarea rows="5" cols="30" placeholder="Placeholder text">Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</textarea>
76+
<label>label <textarea rows="5" cols="30" placeholder="Placeholder text">Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</textarea></label>
7777
`}
7878
</Story>
7979
<Story name="Textarea (disabled)">
8080
{`
81-
<textarea rows="5" cols="30" placeholder="Placeholder text" disabled>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</textarea>
81+
<label>label <textarea rows="5" cols="30" placeholder="Placeholder text" disabled>Jelly cake marshmallow. Pie cotton candy chupa chups marzipan liquorice cheesecake wafer.</textarea></label>
8282
`}
8383
</Story>
8484
</Canvas>

0 commit comments

Comments
 (0)