@nypl/design-system-react-components 0.25.9 → 0.25.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +4 -16
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +1 -3
- package/dist/components/Form/Form.d.ts +13 -12
- package/dist/components/Form/FormTypes.d.ts +2 -2
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +1 -1
- package/dist/components/Icons/IconTypes.d.ts +9 -7
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +23 -1
- package/dist/components/Logo/LogoTypes.d.ts +23 -1
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +6 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -3
- package/dist/components/SearchBar/SearchBar.d.ts +6 -6
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Table/Table.d.ts +9 -3
- package/dist/components/Template/Template.d.ts +24 -5
- package/dist/design-system-react-components.cjs.development.js +2063 -548
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +2056 -554
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/resources.scss +0 -2
- package/dist/styles.css +1 -1
- package/dist/theme/components/breadcrumb.d.ts +4 -1
- package/dist/theme/components/checkbox.d.ts +0 -2
- package/dist/theme/components/customTable.d.ts +12 -3
- package/dist/theme/components/fieldset.d.ts +2 -0
- package/dist/theme/components/global.d.ts +15 -14
- package/dist/theme/components/globalMixins.d.ts +8 -8
- package/dist/theme/components/list.d.ts +6 -0
- package/dist/theme/components/notification.d.ts +16 -4
- package/dist/theme/components/radio.d.ts +3 -2
- package/dist/theme/components/searchBar.d.ts +4 -0
- package/dist/theme/components/select.d.ts +2 -9
- package/dist/theme/components/slider.d.ts +8 -4
- package/dist/theme/components/structuredContent.d.ts +9 -9
- package/dist/theme/components/textInput.d.ts +10 -12
- package/dist/theme/components/toggle.d.ts +6 -2
- package/dist/theme/foundations/global.d.ts +31 -3
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +40 -36
- package/src/components/Accordion/Accordion.stories.mdx +1 -1
- package/src/components/Accordion/Accordion.test.tsx +45 -1
- package/src/components/Accordion/Accordion.tsx +20 -8
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +243 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +30 -2
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +25 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -3
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +104 -5
- package/src/components/Card/Card.stories.mdx +1 -1
- package/src/components/Card/Card.tsx +4 -1
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +1 -1
- package/src/components/Chakra/Flex.stories.mdx +113 -0
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -0
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +6 -6
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +18 -18
- package/src/components/DatePicker/DatePicker.stories.mdx +1 -1
- package/src/components/DatePicker/DatePicker.test.tsx +6 -6
- package/src/components/DatePicker/DatePicker.tsx +12 -10
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +28 -20
- package/src/components/Fieldset/Fieldset.stories.mdx +1 -1
- package/src/components/Fieldset/Fieldset.tsx +2 -4
- package/src/components/Form/Form.stories.mdx +34 -16
- package/src/components/Form/Form.test.tsx +92 -3
- package/src/components/Form/Form.tsx +25 -21
- package/src/components/Form/FormTypes.tsx +2 -2
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -1
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
- package/src/components/Hero/Hero.stories.mdx +1 -1
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +3 -2
- package/src/components/HorizontalRule/HorizontalRule.tsx +2 -2
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +4 -4
- package/src/components/Icons/Icon.stories.mdx +1 -1
- package/src/components/Icons/Icon.test.tsx +1 -1
- package/src/components/Icons/Icon.tsx +1 -1
- package/src/components/Icons/IconTypes.tsx +8 -6
- package/src/components/List/List.stories.mdx +24 -5
- package/src/components/List/List.test.tsx +1 -1
- package/src/components/List/List.tsx +2 -2
- package/src/components/List/__snapshots__/List.test.tsx.snap +3 -1
- package/src/components/Logo/Logo.stories.mdx +7 -5
- package/src/components/Logo/LogoSvgs.tsx +45 -1
- package/src/components/Logo/LogoTypes.tsx +22 -0
- package/src/components/Notification/Notification.stories.mdx +73 -1
- package/src/components/Notification/Notification.test.tsx +64 -5
- package/src/components/Notification/Notification.tsx +21 -11
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +103 -8
- package/src/components/Pagination/Pagination.stories.mdx +54 -12
- package/src/components/Pagination/Pagination.test.tsx +63 -5
- package/src/components/Pagination/Pagination.tsx +46 -24
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +3 -3
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +1 -0
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +5 -5
- package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/components/RadioGroup/RadioGroup.test.tsx +13 -11
- package/src/components/RadioGroup/RadioGroup.tsx +88 -89
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +18 -18
- package/src/components/SearchBar/SearchBar.Test.tsx +124 -28
- package/src/components/SearchBar/SearchBar.stories.mdx +9 -6
- package/src/components/SearchBar/SearchBar.tsx +24 -23
- package/src/components/Select/Select.stories.mdx +1 -1
- package/src/components/Select/Select.test.tsx +89 -0
- package/src/components/Select/Select.tsx +11 -2
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +545 -0
- package/src/components/Slider/Slider.stories.mdx +1 -1
- package/src/components/Slider/Slider.tsx +4 -1
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +7 -0
- package/src/components/StructuredContent/StructuredContent.stories.mdx +1 -1
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +4 -4
- package/src/components/StyleGuide/Colors.stories.mdx +33 -18
- package/src/components/Table/Table.stories.mdx +118 -19
- package/src/components/Table/Table.test.tsx +80 -3
- package/src/components/Table/Table.tsx +26 -16
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +1179 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +21 -5
- package/src/components/Tabs/Tabs.tsx +35 -20
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +195 -0
- package/src/components/Template/Template.stories.mdx +79 -4
- package/src/components/Template/Template.test.tsx +65 -3
- package/src/components/Template/Template.tsx +60 -14
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +94 -1
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.tsx +2 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +4 -4
- package/src/docs/Chakra.stories.mdx +1 -1
- package/src/index.ts +8 -2
- package/src/styles/base/_place-holder.scss +2 -0
- package/src/styles.scss +0 -2
- package/src/theme/components/breadcrumb.ts +5 -1
- package/src/theme/components/checkbox.ts +3 -7
- package/src/theme/components/customTable.ts +16 -3
- package/src/theme/components/fieldset.ts +2 -0
- package/src/theme/components/global.ts +19 -16
- package/src/theme/components/globalMixins.ts +8 -8
- package/src/theme/components/list.ts +6 -2
- package/src/theme/components/notification.ts +21 -8
- package/src/theme/components/radio.ts +3 -6
- package/src/theme/components/searchBar.ts +4 -0
- package/src/theme/components/select.ts +3 -3
- package/src/theme/components/slider.ts +12 -9
- package/src/theme/components/structuredContent.ts +26 -6
- package/src/theme/components/textInput.ts +3 -2
- package/src/theme/components/toggle.ts +42 -38
- package/src/theme/foundations/colors.ts +19 -12
- package/src/theme/foundations/global.ts +17 -5
- package/src/theme/foundations/typography.ts +2 -2
- package/src/utils/componentCategories.ts +2 -1
- package/src/utils/utils.ts +28 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -13
- package/src/components/Pagination/Pagination.stories.tsx +0 -54
- package/src/styles/base/_03-base.scss +0 -25
- package/src/styles/base/_04-focus.scss +0 -22
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Select Renders the UI snapshot correctly 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="css-0"
|
|
6
|
+
>
|
|
7
|
+
<label
|
|
8
|
+
className="css-0"
|
|
9
|
+
htmlFor="select"
|
|
10
|
+
id="select-label"
|
|
11
|
+
>
|
|
12
|
+
Which Succession sibling are you?
|
|
13
|
+
<div
|
|
14
|
+
className="css-0"
|
|
15
|
+
>
|
|
16
|
+
Optional
|
|
17
|
+
</div>
|
|
18
|
+
</label>
|
|
19
|
+
<div
|
|
20
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
21
|
+
>
|
|
22
|
+
<select
|
|
23
|
+
className="chakra-select css-1ik61og"
|
|
24
|
+
disabled={false}
|
|
25
|
+
id="select"
|
|
26
|
+
name="succession-sibling"
|
|
27
|
+
onBlur={[Function]}
|
|
28
|
+
onFocus={[Function]}
|
|
29
|
+
required={false}
|
|
30
|
+
>
|
|
31
|
+
<option>
|
|
32
|
+
Kendall
|
|
33
|
+
</option>
|
|
34
|
+
<option>
|
|
35
|
+
Shiv
|
|
36
|
+
</option>
|
|
37
|
+
<option>
|
|
38
|
+
Connor
|
|
39
|
+
</option>
|
|
40
|
+
<option>
|
|
41
|
+
Roman
|
|
42
|
+
</option>
|
|
43
|
+
<option>
|
|
44
|
+
Tom
|
|
45
|
+
</option>
|
|
46
|
+
</select>
|
|
47
|
+
<div
|
|
48
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
49
|
+
>
|
|
50
|
+
<svg
|
|
51
|
+
aria-hidden={true}
|
|
52
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
53
|
+
focusable={false}
|
|
54
|
+
id="select-icon"
|
|
55
|
+
role="img"
|
|
56
|
+
title="arrow icon"
|
|
57
|
+
viewBox="0 0 24 24"
|
|
58
|
+
>
|
|
59
|
+
<g
|
|
60
|
+
stroke="currentColor"
|
|
61
|
+
strokeWidth="1.5"
|
|
62
|
+
>
|
|
63
|
+
<path
|
|
64
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
65
|
+
fill="none"
|
|
66
|
+
strokeLinecap="round"
|
|
67
|
+
/>
|
|
68
|
+
<path
|
|
69
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
70
|
+
fill="currentColor"
|
|
71
|
+
strokeLinecap="round"
|
|
72
|
+
/>
|
|
73
|
+
<circle
|
|
74
|
+
cx="12"
|
|
75
|
+
cy="12"
|
|
76
|
+
fill="none"
|
|
77
|
+
r="11.25"
|
|
78
|
+
strokeMiterlimit="10"
|
|
79
|
+
/>
|
|
80
|
+
</g>
|
|
81
|
+
</svg>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
exports[`Select Renders the UI snapshot correctly 2`] = `
|
|
88
|
+
<div
|
|
89
|
+
className="css-0"
|
|
90
|
+
>
|
|
91
|
+
<label
|
|
92
|
+
className="css-0"
|
|
93
|
+
htmlFor="select"
|
|
94
|
+
id="select-label"
|
|
95
|
+
>
|
|
96
|
+
Which Succession sibling are you?
|
|
97
|
+
<div
|
|
98
|
+
className="css-0"
|
|
99
|
+
>
|
|
100
|
+
Optional
|
|
101
|
+
</div>
|
|
102
|
+
</label>
|
|
103
|
+
<div
|
|
104
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
105
|
+
>
|
|
106
|
+
<select
|
|
107
|
+
className="chakra-select css-1ik61og"
|
|
108
|
+
disabled={true}
|
|
109
|
+
id="select"
|
|
110
|
+
name="succession-sibling"
|
|
111
|
+
onBlur={[Function]}
|
|
112
|
+
onFocus={[Function]}
|
|
113
|
+
required={false}
|
|
114
|
+
>
|
|
115
|
+
<option>
|
|
116
|
+
Kendall
|
|
117
|
+
</option>
|
|
118
|
+
<option>
|
|
119
|
+
Shiv
|
|
120
|
+
</option>
|
|
121
|
+
<option>
|
|
122
|
+
Connor
|
|
123
|
+
</option>
|
|
124
|
+
<option>
|
|
125
|
+
Roman
|
|
126
|
+
</option>
|
|
127
|
+
<option>
|
|
128
|
+
Tom
|
|
129
|
+
</option>
|
|
130
|
+
</select>
|
|
131
|
+
<div
|
|
132
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
133
|
+
data-disabled=""
|
|
134
|
+
>
|
|
135
|
+
<svg
|
|
136
|
+
aria-hidden={true}
|
|
137
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
138
|
+
focusable={false}
|
|
139
|
+
id="select-icon"
|
|
140
|
+
role="img"
|
|
141
|
+
title="arrow icon"
|
|
142
|
+
viewBox="0 0 24 24"
|
|
143
|
+
>
|
|
144
|
+
<g
|
|
145
|
+
stroke="currentColor"
|
|
146
|
+
strokeWidth="1.5"
|
|
147
|
+
>
|
|
148
|
+
<path
|
|
149
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
150
|
+
fill="none"
|
|
151
|
+
strokeLinecap="round"
|
|
152
|
+
/>
|
|
153
|
+
<path
|
|
154
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
155
|
+
fill="currentColor"
|
|
156
|
+
strokeLinecap="round"
|
|
157
|
+
/>
|
|
158
|
+
<circle
|
|
159
|
+
cx="12"
|
|
160
|
+
cy="12"
|
|
161
|
+
fill="none"
|
|
162
|
+
r="11.25"
|
|
163
|
+
strokeMiterlimit="10"
|
|
164
|
+
/>
|
|
165
|
+
</g>
|
|
166
|
+
</svg>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
exports[`Select Renders the UI snapshot correctly 3`] = `
|
|
173
|
+
<div
|
|
174
|
+
className="css-0"
|
|
175
|
+
>
|
|
176
|
+
<label
|
|
177
|
+
className="css-0"
|
|
178
|
+
htmlFor="select"
|
|
179
|
+
id="select-label"
|
|
180
|
+
>
|
|
181
|
+
Which Succession sibling are you?
|
|
182
|
+
<div
|
|
183
|
+
className="css-0"
|
|
184
|
+
>
|
|
185
|
+
Optional
|
|
186
|
+
</div>
|
|
187
|
+
</label>
|
|
188
|
+
<div
|
|
189
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
190
|
+
>
|
|
191
|
+
<select
|
|
192
|
+
aria-invalid={true}
|
|
193
|
+
className="chakra-select css-1ik61og"
|
|
194
|
+
disabled={false}
|
|
195
|
+
id="select"
|
|
196
|
+
name="succession-sibling"
|
|
197
|
+
onBlur={[Function]}
|
|
198
|
+
onFocus={[Function]}
|
|
199
|
+
required={false}
|
|
200
|
+
>
|
|
201
|
+
<option>
|
|
202
|
+
Kendall
|
|
203
|
+
</option>
|
|
204
|
+
<option>
|
|
205
|
+
Shiv
|
|
206
|
+
</option>
|
|
207
|
+
<option>
|
|
208
|
+
Connor
|
|
209
|
+
</option>
|
|
210
|
+
<option>
|
|
211
|
+
Roman
|
|
212
|
+
</option>
|
|
213
|
+
<option>
|
|
214
|
+
Tom
|
|
215
|
+
</option>
|
|
216
|
+
</select>
|
|
217
|
+
<div
|
|
218
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
219
|
+
>
|
|
220
|
+
<svg
|
|
221
|
+
aria-hidden={true}
|
|
222
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
223
|
+
focusable={false}
|
|
224
|
+
id="select-icon"
|
|
225
|
+
role="img"
|
|
226
|
+
title="arrow icon"
|
|
227
|
+
viewBox="0 0 24 24"
|
|
228
|
+
>
|
|
229
|
+
<g
|
|
230
|
+
stroke="currentColor"
|
|
231
|
+
strokeWidth="1.5"
|
|
232
|
+
>
|
|
233
|
+
<path
|
|
234
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
235
|
+
fill="none"
|
|
236
|
+
strokeLinecap="round"
|
|
237
|
+
/>
|
|
238
|
+
<path
|
|
239
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
240
|
+
fill="currentColor"
|
|
241
|
+
strokeLinecap="round"
|
|
242
|
+
/>
|
|
243
|
+
<circle
|
|
244
|
+
cx="12"
|
|
245
|
+
cy="12"
|
|
246
|
+
fill="none"
|
|
247
|
+
r="11.25"
|
|
248
|
+
strokeMiterlimit="10"
|
|
249
|
+
/>
|
|
250
|
+
</g>
|
|
251
|
+
</svg>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
<div
|
|
255
|
+
aria-disabled={false}
|
|
256
|
+
className="css-0"
|
|
257
|
+
>
|
|
258
|
+
<div
|
|
259
|
+
aria-atomic={true}
|
|
260
|
+
aria-live="polite"
|
|
261
|
+
className=" css-0"
|
|
262
|
+
dangerouslySetInnerHTML={
|
|
263
|
+
Object {
|
|
264
|
+
"__html": "Tom doesn't count as a sibling :(.",
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
data-isinvalid={true}
|
|
268
|
+
id="select-helperText"
|
|
269
|
+
/>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
`;
|
|
273
|
+
|
|
274
|
+
exports[`Select Renders the UI snapshot correctly 4`] = `
|
|
275
|
+
<div
|
|
276
|
+
className="css-0"
|
|
277
|
+
>
|
|
278
|
+
<label
|
|
279
|
+
className="css-0"
|
|
280
|
+
htmlFor="select"
|
|
281
|
+
id="select-label"
|
|
282
|
+
>
|
|
283
|
+
Which Succession sibling are you?
|
|
284
|
+
<div
|
|
285
|
+
className="css-0"
|
|
286
|
+
>
|
|
287
|
+
Optional
|
|
288
|
+
</div>
|
|
289
|
+
</label>
|
|
290
|
+
<div
|
|
291
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
292
|
+
>
|
|
293
|
+
<select
|
|
294
|
+
aria-describedby="select-helperText"
|
|
295
|
+
className="chakra-select css-1ik61og"
|
|
296
|
+
disabled={false}
|
|
297
|
+
id="select"
|
|
298
|
+
name="succession-sibling"
|
|
299
|
+
onBlur={[Function]}
|
|
300
|
+
onFocus={[Function]}
|
|
301
|
+
required={false}
|
|
302
|
+
>
|
|
303
|
+
<option>
|
|
304
|
+
Kendall
|
|
305
|
+
</option>
|
|
306
|
+
<option>
|
|
307
|
+
Shiv
|
|
308
|
+
</option>
|
|
309
|
+
<option>
|
|
310
|
+
Connor
|
|
311
|
+
</option>
|
|
312
|
+
<option>
|
|
313
|
+
Roman
|
|
314
|
+
</option>
|
|
315
|
+
<option>
|
|
316
|
+
Tom
|
|
317
|
+
</option>
|
|
318
|
+
</select>
|
|
319
|
+
<div
|
|
320
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
321
|
+
>
|
|
322
|
+
<svg
|
|
323
|
+
aria-hidden={true}
|
|
324
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
325
|
+
focusable={false}
|
|
326
|
+
id="select-icon"
|
|
327
|
+
role="img"
|
|
328
|
+
title="arrow icon"
|
|
329
|
+
viewBox="0 0 24 24"
|
|
330
|
+
>
|
|
331
|
+
<g
|
|
332
|
+
stroke="currentColor"
|
|
333
|
+
strokeWidth="1.5"
|
|
334
|
+
>
|
|
335
|
+
<path
|
|
336
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
337
|
+
fill="none"
|
|
338
|
+
strokeLinecap="round"
|
|
339
|
+
/>
|
|
340
|
+
<path
|
|
341
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
342
|
+
fill="currentColor"
|
|
343
|
+
strokeLinecap="round"
|
|
344
|
+
/>
|
|
345
|
+
<circle
|
|
346
|
+
cx="12"
|
|
347
|
+
cy="12"
|
|
348
|
+
fill="none"
|
|
349
|
+
r="11.25"
|
|
350
|
+
strokeMiterlimit="10"
|
|
351
|
+
/>
|
|
352
|
+
</g>
|
|
353
|
+
</svg>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
<div
|
|
357
|
+
aria-disabled={false}
|
|
358
|
+
className="css-0"
|
|
359
|
+
>
|
|
360
|
+
<div
|
|
361
|
+
aria-atomic={true}
|
|
362
|
+
aria-live="off"
|
|
363
|
+
className=" css-0"
|
|
364
|
+
dangerouslySetInnerHTML={
|
|
365
|
+
Object {
|
|
366
|
+
"__html": "Remember, Logan will judge you no matter who you pick.",
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
data-isinvalid={false}
|
|
370
|
+
id="select-helperText"
|
|
371
|
+
/>
|
|
372
|
+
</div>
|
|
373
|
+
</div>
|
|
374
|
+
`;
|
|
375
|
+
|
|
376
|
+
exports[`Select Renders the UI snapshot correctly 5`] = `
|
|
377
|
+
<div
|
|
378
|
+
className="css-0"
|
|
379
|
+
>
|
|
380
|
+
<label
|
|
381
|
+
className="css-0"
|
|
382
|
+
htmlFor="select"
|
|
383
|
+
id="select-label"
|
|
384
|
+
>
|
|
385
|
+
Which Succession sibling are you?
|
|
386
|
+
<div
|
|
387
|
+
className="css-0"
|
|
388
|
+
>
|
|
389
|
+
Required
|
|
390
|
+
</div>
|
|
391
|
+
</label>
|
|
392
|
+
<div
|
|
393
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
394
|
+
>
|
|
395
|
+
<select
|
|
396
|
+
aria-required={true}
|
|
397
|
+
className="chakra-select css-1ik61og"
|
|
398
|
+
disabled={false}
|
|
399
|
+
id="select"
|
|
400
|
+
name="succession-sibling"
|
|
401
|
+
onBlur={[Function]}
|
|
402
|
+
onFocus={[Function]}
|
|
403
|
+
required={true}
|
|
404
|
+
>
|
|
405
|
+
<option>
|
|
406
|
+
Kendall
|
|
407
|
+
</option>
|
|
408
|
+
<option>
|
|
409
|
+
Shiv
|
|
410
|
+
</option>
|
|
411
|
+
<option>
|
|
412
|
+
Connor
|
|
413
|
+
</option>
|
|
414
|
+
<option>
|
|
415
|
+
Roman
|
|
416
|
+
</option>
|
|
417
|
+
<option>
|
|
418
|
+
Tom
|
|
419
|
+
</option>
|
|
420
|
+
</select>
|
|
421
|
+
<div
|
|
422
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
423
|
+
>
|
|
424
|
+
<svg
|
|
425
|
+
aria-hidden={true}
|
|
426
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
427
|
+
focusable={false}
|
|
428
|
+
id="select-icon"
|
|
429
|
+
role="img"
|
|
430
|
+
title="arrow icon"
|
|
431
|
+
viewBox="0 0 24 24"
|
|
432
|
+
>
|
|
433
|
+
<g
|
|
434
|
+
stroke="currentColor"
|
|
435
|
+
strokeWidth="1.5"
|
|
436
|
+
>
|
|
437
|
+
<path
|
|
438
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
439
|
+
fill="none"
|
|
440
|
+
strokeLinecap="round"
|
|
441
|
+
/>
|
|
442
|
+
<path
|
|
443
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
444
|
+
fill="currentColor"
|
|
445
|
+
strokeLinecap="round"
|
|
446
|
+
/>
|
|
447
|
+
<circle
|
|
448
|
+
cx="12"
|
|
449
|
+
cy="12"
|
|
450
|
+
fill="none"
|
|
451
|
+
r="11.25"
|
|
452
|
+
strokeMiterlimit="10"
|
|
453
|
+
/>
|
|
454
|
+
</g>
|
|
455
|
+
</svg>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
`;
|
|
460
|
+
|
|
461
|
+
exports[`Select Renders the UI snapshot correctly 6`] = `
|
|
462
|
+
<div
|
|
463
|
+
className="css-0"
|
|
464
|
+
>
|
|
465
|
+
<label
|
|
466
|
+
className="css-0"
|
|
467
|
+
htmlFor="select"
|
|
468
|
+
id="select-label"
|
|
469
|
+
>
|
|
470
|
+
Which Succession sibling are you?
|
|
471
|
+
<div
|
|
472
|
+
className="css-0"
|
|
473
|
+
>
|
|
474
|
+
Optional
|
|
475
|
+
</div>
|
|
476
|
+
</label>
|
|
477
|
+
<div
|
|
478
|
+
className="chakra-select__wrapper css-42b2qy"
|
|
479
|
+
>
|
|
480
|
+
<select
|
|
481
|
+
className="chakra-select css-1ik61og"
|
|
482
|
+
disabled={false}
|
|
483
|
+
id="select"
|
|
484
|
+
name="succession-sibling"
|
|
485
|
+
onBlur={[Function]}
|
|
486
|
+
onChange={[MockFunction]}
|
|
487
|
+
onFocus={[Function]}
|
|
488
|
+
required={false}
|
|
489
|
+
value=""
|
|
490
|
+
>
|
|
491
|
+
<option>
|
|
492
|
+
Kendall
|
|
493
|
+
</option>
|
|
494
|
+
<option>
|
|
495
|
+
Shiv
|
|
496
|
+
</option>
|
|
497
|
+
<option>
|
|
498
|
+
Connor
|
|
499
|
+
</option>
|
|
500
|
+
<option>
|
|
501
|
+
Roman
|
|
502
|
+
</option>
|
|
503
|
+
<option>
|
|
504
|
+
Tom
|
|
505
|
+
</option>
|
|
506
|
+
</select>
|
|
507
|
+
<div
|
|
508
|
+
className="chakra-select__icon-wrapper css-162mkon"
|
|
509
|
+
>
|
|
510
|
+
<svg
|
|
511
|
+
aria-hidden={true}
|
|
512
|
+
className="chakra-icon chakra-select__icon css-onkibi"
|
|
513
|
+
focusable={false}
|
|
514
|
+
id="select-icon"
|
|
515
|
+
role="img"
|
|
516
|
+
title="arrow icon"
|
|
517
|
+
viewBox="0 0 24 24"
|
|
518
|
+
>
|
|
519
|
+
<g
|
|
520
|
+
stroke="currentColor"
|
|
521
|
+
strokeWidth="1.5"
|
|
522
|
+
>
|
|
523
|
+
<path
|
|
524
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
525
|
+
fill="none"
|
|
526
|
+
strokeLinecap="round"
|
|
527
|
+
/>
|
|
528
|
+
<path
|
|
529
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
530
|
+
fill="currentColor"
|
|
531
|
+
strokeLinecap="round"
|
|
532
|
+
/>
|
|
533
|
+
<circle
|
|
534
|
+
cx="12"
|
|
535
|
+
cy="12"
|
|
536
|
+
fill="none"
|
|
537
|
+
r="11.25"
|
|
538
|
+
strokeMiterlimit="10"
|
|
539
|
+
/>
|
|
540
|
+
</g>
|
|
541
|
+
</svg>
|
|
542
|
+
</div>
|
|
543
|
+
</div>
|
|
544
|
+
</div>
|
|
545
|
+
`;
|
|
@@ -120,8 +120,8 @@ export default function Slider(props: React.PropsWithChildren<SliderProps>) {
|
|
|
120
120
|
const styles = useMultiStyleConfig("CustomSlider", {
|
|
121
121
|
isDisabled,
|
|
122
122
|
isInvalid: finalIsInvalid,
|
|
123
|
-
isRangeSlider,
|
|
124
123
|
showBoxes,
|
|
124
|
+
showValues,
|
|
125
125
|
});
|
|
126
126
|
// Props that the `Slider` and `RangeSlider` Chakra
|
|
127
127
|
// components both use.
|
|
@@ -138,6 +138,9 @@ export default function Slider(props: React.PropsWithChildren<SliderProps>) {
|
|
|
138
138
|
// *final* value once a user stops dragging the slider.
|
|
139
139
|
onChangeEnd: (val) => onChange && onChange(val),
|
|
140
140
|
step,
|
|
141
|
+
// Additional margins so slider thumbs don't overflow past the
|
|
142
|
+
// edge when the value boxes or min/max values are hidden.
|
|
143
|
+
sx: styles.sliderContainer,
|
|
141
144
|
};
|
|
142
145
|
// Props that the two `TextInput` components use.
|
|
143
146
|
const textInputSharedProps = {
|
|
@@ -61,6 +61,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 1`] = `
|
|
|
61
61
|
>
|
|
62
62
|
<div
|
|
63
63
|
className="chakra-slider__track css-0"
|
|
64
|
+
data-testid="chakra-range-slider-track"
|
|
64
65
|
id="slider-track-defaultRangeSlider"
|
|
65
66
|
style={
|
|
66
67
|
Object {
|
|
@@ -242,6 +243,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 2`] = `
|
|
|
242
243
|
>
|
|
243
244
|
<div
|
|
244
245
|
className="chakra-slider__track css-0"
|
|
246
|
+
data-testid="chakra-range-slider-track"
|
|
245
247
|
id="slider-track-errored"
|
|
246
248
|
style={
|
|
247
249
|
Object {
|
|
@@ -424,6 +426,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 3`] = `
|
|
|
424
426
|
>
|
|
425
427
|
<div
|
|
426
428
|
className="chakra-slider__track css-0"
|
|
429
|
+
data-testid="chakra-range-slider-track"
|
|
427
430
|
id="slider-track-required"
|
|
428
431
|
style={
|
|
429
432
|
Object {
|
|
@@ -607,6 +610,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 4`] = `
|
|
|
607
610
|
<div
|
|
608
611
|
className="chakra-slider__track css-0"
|
|
609
612
|
data-disabled=""
|
|
613
|
+
data-testid="chakra-range-slider-track"
|
|
610
614
|
id="slider-track-disabled"
|
|
611
615
|
style={
|
|
612
616
|
Object {
|
|
@@ -775,6 +779,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 5`] = `
|
|
|
775
779
|
>
|
|
776
780
|
<div
|
|
777
781
|
className="chakra-slider__track css-0"
|
|
782
|
+
data-testid="chakra-range-slider-track"
|
|
778
783
|
id="slider-track-noLabels"
|
|
779
784
|
style={
|
|
780
785
|
Object {
|
|
@@ -915,6 +920,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 6`] = `
|
|
|
915
920
|
>
|
|
916
921
|
<div
|
|
917
922
|
className="chakra-slider__track css-0"
|
|
923
|
+
data-testid="chakra-range-slider-track"
|
|
918
924
|
id="slider-track-noVisibleValues"
|
|
919
925
|
style={
|
|
920
926
|
Object {
|
|
@@ -1035,6 +1041,7 @@ exports[`Slider Range Slider renders the UI snapshot correctly 7`] = `
|
|
|
1035
1041
|
>
|
|
1036
1042
|
<div
|
|
1037
1043
|
className="chakra-slider__track css-0"
|
|
1044
|
+
data-testid="chakra-range-slider-track"
|
|
1038
1045
|
id="slider-track-onlySlider"
|
|
1039
1046
|
style={
|
|
1040
1047
|
Object {
|
|
@@ -51,11 +51,11 @@ implementation is `dir="rtl"`.
|
|
|
51
51
|
|
|
52
52
|
The placement of this attribute can be added at the root `<html>` element but can
|
|
53
53
|
also be placed in specific DOM elements within a page to target specific page sections.
|
|
54
|
-
For example, if you only want to target NYPL DS components within
|
|
55
|
-
the `dir` attribute can be added to that element:
|
|
54
|
+
For example, if you only want to target NYPL DS components within your top-level
|
|
55
|
+
`app` class, the `dir` attribute can be added to that element:
|
|
56
56
|
|
|
57
57
|
```jsx
|
|
58
|
-
<div className="app
|
|
58
|
+
<div className="app" dir="rtl">
|
|
59
59
|
...
|
|
60
60
|
</div>
|
|
61
61
|
```
|
|
@@ -66,7 +66,7 @@ do the following:
|
|
|
66
66
|
|
|
67
67
|
```jsx
|
|
68
68
|
// don't do this
|
|
69
|
-
<div className="app
|
|
69
|
+
<div className="app" dir="rtl">
|
|
70
70
|
<div dir="rtl">
|
|
71
71
|
<p dir="rtl">
|
|
72
72
|
Some text <button dir="rtl">Button</button>
|