@nypl/design-system-react-components 0.25.12 → 0.25.13
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 +63 -1
- package/dist/components/Accordion/Accordion.d.ts +5 -3
- package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +11 -20
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -2
- package/dist/components/Heading/Heading.d.ts +4 -4
- package/dist/components/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/Hero/Hero.d.ts +7 -4
- package/dist/components/Icons/IconTypes.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +25 -7
- package/dist/components/Image/ImageTypes.d.ts +4 -4
- package/dist/components/Logo/LogoTypes.d.ts +2 -2
- package/dist/components/Notification/Notification.d.ts +4 -4
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
- package/dist/components/StructuredContent/StructuredContent.d.ts +9 -22
- package/dist/components/Tabs/Tabs.d.ts +3 -3
- package/dist/components/Template/Template.d.ts +13 -5
- package/dist/components/Text/Text.d.ts +3 -3
- package/dist/components/Text/TextTypes.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +2 -2
- package/dist/components/Toggle/Toggle.d.ts +6 -7
- package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
- package/dist/design-system-react-components.cjs.development.js +505 -422
- 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 +514 -435
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/enums.d.ts +4 -0
- package/dist/index.d.ts +7 -8
- package/dist/theme/components/accordion.d.ts +7 -12
- package/dist/theme/components/breadcrumb.d.ts +3 -0
- package/dist/theme/components/card.d.ts +4 -4
- package/dist/theme/components/checkbox.d.ts +1 -0
- package/dist/theme/components/checkboxGroup.d.ts +3 -1
- package/dist/theme/components/global.d.ts +2 -1
- package/dist/theme/components/hero.d.ts +1 -1
- package/dist/theme/components/image.d.ts +1 -1
- package/dist/theme/components/notification.d.ts +4 -4
- package/dist/theme/components/pagination.d.ts +2 -5
- package/dist/theme/components/radio.d.ts +1 -0
- package/dist/theme/components/radioGroup.d.ts +3 -1
- package/dist/theme/components/select.d.ts +3 -0
- package/dist/theme/components/toggle.d.ts +13 -1
- package/package.json +1 -1
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
- package/src/components/Accordion/Accordion.stories.mdx +150 -66
- package/src/components/Accordion/Accordion.test.tsx +44 -17
- package/src/components/Accordion/Accordion.tsx +50 -20
- package/src/components/Accordion/AccordionTypes.tsx +5 -0
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +244 -2
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +17 -15
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +6 -6
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +6 -6
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
- package/src/components/Card/Card.stories.mdx +236 -165
- package/src/components/Card/Card.test.tsx +36 -18
- package/src/components/Card/Card.tsx +84 -59
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +25 -65
- package/src/components/Chakra/Center.stories.mdx +2 -2
- package/src/components/Checkbox/Checkbox.stories.mdx +13 -1
- package/src/components/Checkbox/Checkbox.test.tsx +58 -2
- package/src/components/Checkbox/Checkbox.tsx +6 -1
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +76 -0
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +73 -9
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +79 -9
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +10 -7
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +169 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +1 -1
- package/src/components/DatePicker/DatePicker.test.tsx +5 -2
- package/src/components/DatePicker/DatePicker.tsx +5 -2
- package/src/components/Form/Form.stories.mdx +47 -9
- package/src/components/Form/Form.test.tsx +1 -1
- package/src/components/Form/Form.tsx +3 -1
- package/src/components/Grid/SimpleGrid.stories.mdx +53 -35
- package/src/components/Grid/SimpleGrid.test.tsx +15 -9
- package/src/components/Heading/Heading.stories.mdx +21 -23
- package/src/components/Heading/Heading.test.tsx +7 -7
- package/src/components/Heading/Heading.tsx +10 -14
- package/src/components/Heading/HeadingTypes.tsx +1 -1
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +1 -1
- package/src/components/Hero/Hero.stories.mdx +27 -27
- package/src/components/Hero/Hero.test.tsx +113 -58
- package/src/components/Hero/Hero.tsx +43 -20
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +6 -4
- package/src/components/HorizontalRule/HorizontalRule.tsx +3 -2
- package/src/components/Icons/Icon.stories.mdx +50 -18
- package/src/components/Icons/Icon.test.tsx +13 -2
- package/src/components/Icons/Icon.tsx +11 -6
- package/src/components/Icons/IconTypes.tsx +1 -0
- package/src/components/Image/Image.stories.mdx +133 -68
- package/src/components/Image/Image.test.tsx +32 -48
- package/src/components/Image/Image.tsx +46 -26
- package/src/components/Image/ImageTypes.ts +4 -4
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +60 -13
- package/src/components/Link/Link.tsx +8 -1
- package/src/components/List/List.stories.mdx +1 -1
- package/src/components/List/List.test.tsx +7 -4
- package/src/components/List/List.tsx +7 -4
- package/src/components/Logo/Logo.stories.mdx +13 -13
- package/src/components/Logo/Logo.test.tsx +12 -2
- package/src/components/Logo/Logo.tsx +10 -5
- package/src/components/Logo/LogoTypes.tsx +1 -1
- package/src/components/Notification/Notification.stories.mdx +5 -5
- package/src/components/Notification/Notification.tsx +10 -10
- package/src/components/Pagination/Pagination.stories.mdx +4 -3
- package/src/components/Pagination/Pagination.test.tsx +30 -2
- package/src/components/Pagination/Pagination.tsx +6 -3
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +1 -1
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +6 -2
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +3 -1
- package/src/components/Radio/Radio.stories.mdx +13 -1
- package/src/components/Radio/Radio.test.tsx +56 -2
- package/src/components/Radio/Radio.tsx +6 -1
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +61 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +73 -9
- package/src/components/RadioGroup/RadioGroup.test.tsx +72 -7
- package/src/components/RadioGroup/RadioGroup.tsx +10 -7
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +140 -0
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +3 -3
- package/src/components/Select/Select.stories.mdx +26 -16
- package/src/components/Select/Select.test.tsx +1 -36
- package/src/components/Select/Select.tsx +4 -16
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +12 -14
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +6 -8
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +5 -7
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/Slider/Slider.stories.mdx +41 -8
- package/src/components/Slider/Slider.tsx +4 -4
- package/src/components/StatusBadge/StatusBadge.test.tsx +3 -1
- package/src/components/StatusBadge/StatusBadge.tsx +1 -1
- package/src/components/StructuredContent/StructuredContent.stories.mdx +103 -54
- package/src/components/StructuredContent/StructuredContent.test.tsx +129 -102
- package/src/components/StructuredContent/StructuredContent.tsx +43 -53
- package/src/components/StyleGuide/ColorCard.tsx +3 -3
- package/src/components/StyleGuide/Typography.stories.mdx +17 -12
- package/src/components/Table/Table.test.tsx +1 -1
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/Tabs/Tabs.stories.mdx +8 -8
- package/src/components/Tabs/Tabs.test.tsx +13 -11
- package/src/components/Tabs/Tabs.tsx +18 -15
- package/src/components/Template/Template.stories.mdx +62 -25
- package/src/components/Template/Template.test.tsx +35 -5
- package/src/components/Template/Template.tsx +26 -13
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +4 -2
- package/src/components/Text/Text.stories.mdx +13 -15
- package/src/components/Text/Text.test.tsx +6 -15
- package/src/components/Text/Text.tsx +7 -12
- package/src/components/Text/TextTypes.tsx +1 -1
- package/src/components/TextInput/TextInput.stories.mdx +9 -9
- package/src/components/TextInput/TextInput.test.tsx +28 -27
- package/src/components/TextInput/TextInput.tsx +4 -4
- package/src/components/Toggle/Toggle.stories.mdx +12 -22
- package/src/components/Toggle/Toggle.test.tsx +15 -2
- package/src/components/Toggle/Toggle.tsx +8 -9
- package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +64 -0
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -6
- package/src/components/VideoPlayer/VideoPlayer.tsx +14 -7
- package/src/docs/{Intro.stories.mdx → Welcome.stories.mdx} +5 -9
- package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useCarouselStyles.stories.mdx +10 -0
- package/src/hooks/useNYPLTheme.ts +1 -1
- package/src/index.ts +7 -14
- package/src/theme/components/accordion.ts +7 -12
- package/src/theme/components/breadcrumb.ts +3 -0
- package/src/theme/components/card.ts +29 -20
- package/src/theme/components/checkboxGroup.ts +3 -1
- package/src/theme/components/global.ts +4 -3
- package/src/theme/components/hero.ts +1 -1
- package/src/theme/components/icon.ts +5 -2
- package/src/theme/components/image.ts +1 -1
- package/src/theme/components/list.ts +1 -1
- package/src/theme/components/notification.ts +5 -5
- package/src/theme/components/pagination.ts +2 -5
- package/src/theme/components/progressIndicator.ts +3 -3
- package/src/theme/components/radioGroup.ts +3 -1
- package/src/theme/components/select.ts +6 -0
- package/src/theme/components/toggle.ts +26 -3
- package/src/utils/componentCategories.ts +27 -19
- package/dist/components/Card/CardTypes.d.ts +0 -4
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
|
@@ -11,7 +11,7 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
|
|
|
11
11
|
<button
|
|
12
12
|
aria-controls="accordion-panel-accordian-item-0"
|
|
13
13
|
aria-expanded={false}
|
|
14
|
-
className="chakra-accordion__button css-
|
|
14
|
+
className="chakra-accordion__button css-1ivt2zz"
|
|
15
15
|
disabled={false}
|
|
16
16
|
id="accordion-button-accordian-item-0"
|
|
17
17
|
onClick={[Function]}
|
|
@@ -132,7 +132,249 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
|
|
|
132
132
|
<button
|
|
133
133
|
aria-controls="accordion-panel-accordian-item-0"
|
|
134
134
|
aria-expanded={false}
|
|
135
|
-
className="chakra-accordion__button css-
|
|
135
|
+
className="chakra-accordion__button css-1ivt2zz"
|
|
136
|
+
disabled={false}
|
|
137
|
+
id="accordion-button-accordian-item-0"
|
|
138
|
+
onClick={[Function]}
|
|
139
|
+
onFocus={[Function]}
|
|
140
|
+
onKeyDown={[Function]}
|
|
141
|
+
type="button"
|
|
142
|
+
>
|
|
143
|
+
<div
|
|
144
|
+
className="css-1eziwv"
|
|
145
|
+
>
|
|
146
|
+
Gerry Kellman
|
|
147
|
+
</div>
|
|
148
|
+
<svg
|
|
149
|
+
aria-hidden={true}
|
|
150
|
+
className="chakra-icon css-onkibi"
|
|
151
|
+
focusable={false}
|
|
152
|
+
id="accordion-accordian-icon-0"
|
|
153
|
+
role="img"
|
|
154
|
+
title="plus icon"
|
|
155
|
+
viewBox="0 0 24 24"
|
|
156
|
+
>
|
|
157
|
+
<g
|
|
158
|
+
stroke="currentColor"
|
|
159
|
+
strokeWidth="1.5"
|
|
160
|
+
>
|
|
161
|
+
<path
|
|
162
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
163
|
+
fill="none"
|
|
164
|
+
strokeLinecap="round"
|
|
165
|
+
/>
|
|
166
|
+
<path
|
|
167
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
168
|
+
fill="currentColor"
|
|
169
|
+
strokeLinecap="round"
|
|
170
|
+
/>
|
|
171
|
+
<circle
|
|
172
|
+
cx="12"
|
|
173
|
+
cy="12"
|
|
174
|
+
fill="none"
|
|
175
|
+
r="11.25"
|
|
176
|
+
strokeMiterlimit="10"
|
|
177
|
+
/>
|
|
178
|
+
</g>
|
|
179
|
+
</svg>
|
|
180
|
+
</button>
|
|
181
|
+
<div
|
|
182
|
+
className="chakra-collapse"
|
|
183
|
+
style={
|
|
184
|
+
Object {
|
|
185
|
+
"display": "none",
|
|
186
|
+
"height": "0px",
|
|
187
|
+
"opacity": 0,
|
|
188
|
+
"overflow": "hidden",
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
>
|
|
192
|
+
<div
|
|
193
|
+
aria-labelledby="accordion-button-accordian-item-0"
|
|
194
|
+
className="chakra-accordion__panel css-0"
|
|
195
|
+
id="accordion-panel-accordian-item-0"
|
|
196
|
+
role="region"
|
|
197
|
+
>
|
|
198
|
+
<div
|
|
199
|
+
className="css-0"
|
|
200
|
+
id="card"
|
|
201
|
+
>
|
|
202
|
+
<div
|
|
203
|
+
className="css-0"
|
|
204
|
+
>
|
|
205
|
+
<div
|
|
206
|
+
className="the-wrap css-0"
|
|
207
|
+
>
|
|
208
|
+
<div
|
|
209
|
+
className="the-crop css-0"
|
|
210
|
+
>
|
|
211
|
+
<img
|
|
212
|
+
alt="Alt text"
|
|
213
|
+
className="css-0"
|
|
214
|
+
src="https://cdn.onebauer.media/one/media/6176/76fd/405b/ab5f/f20f/2d52/gerri-1500-1.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit"
|
|
215
|
+
/>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
<div
|
|
220
|
+
className="card-body css-0"
|
|
221
|
+
>
|
|
222
|
+
<h4
|
|
223
|
+
className="chakra-heading css-0"
|
|
224
|
+
id="heading1"
|
|
225
|
+
>
|
|
226
|
+
Gerry Kellman
|
|
227
|
+
</h4>
|
|
228
|
+
<div
|
|
229
|
+
className="css-0"
|
|
230
|
+
>
|
|
231
|
+
Gerri is
|
|
232
|
+
<b>
|
|
233
|
+
one of Logan's most trusted confidantes
|
|
234
|
+
</b>
|
|
235
|
+
, one who serves many roles within the company. She's one of the most powerful people at Waystar Royco outside of the family itself.
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`;
|
|
244
|
+
|
|
245
|
+
exports[`Accordion Renders the UI snapshot correctly 3`] = `
|
|
246
|
+
<div
|
|
247
|
+
className="chakra-accordion css-0"
|
|
248
|
+
id="accordian"
|
|
249
|
+
>
|
|
250
|
+
<div
|
|
251
|
+
className="chakra-accordion__item css-1fsnuue"
|
|
252
|
+
>
|
|
253
|
+
<button
|
|
254
|
+
aria-controls="accordion-panel-accordian-item-0"
|
|
255
|
+
aria-expanded={false}
|
|
256
|
+
className="chakra-accordion__button css-1m4sr3t"
|
|
257
|
+
disabled={false}
|
|
258
|
+
id="accordion-button-accordian-item-0"
|
|
259
|
+
onClick={[Function]}
|
|
260
|
+
onFocus={[Function]}
|
|
261
|
+
onKeyDown={[Function]}
|
|
262
|
+
type="button"
|
|
263
|
+
>
|
|
264
|
+
<div
|
|
265
|
+
className="css-1eziwv"
|
|
266
|
+
>
|
|
267
|
+
Gerry Kellman
|
|
268
|
+
</div>
|
|
269
|
+
<svg
|
|
270
|
+
aria-hidden={true}
|
|
271
|
+
className="chakra-icon css-onkibi"
|
|
272
|
+
focusable={false}
|
|
273
|
+
id="accordion-accordian-icon-0"
|
|
274
|
+
role="img"
|
|
275
|
+
title="plus icon"
|
|
276
|
+
viewBox="0 0 24 24"
|
|
277
|
+
>
|
|
278
|
+
<g
|
|
279
|
+
stroke="currentColor"
|
|
280
|
+
strokeWidth="1.5"
|
|
281
|
+
>
|
|
282
|
+
<path
|
|
283
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
284
|
+
fill="none"
|
|
285
|
+
strokeLinecap="round"
|
|
286
|
+
/>
|
|
287
|
+
<path
|
|
288
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
289
|
+
fill="currentColor"
|
|
290
|
+
strokeLinecap="round"
|
|
291
|
+
/>
|
|
292
|
+
<circle
|
|
293
|
+
cx="12"
|
|
294
|
+
cy="12"
|
|
295
|
+
fill="none"
|
|
296
|
+
r="11.25"
|
|
297
|
+
strokeMiterlimit="10"
|
|
298
|
+
/>
|
|
299
|
+
</g>
|
|
300
|
+
</svg>
|
|
301
|
+
</button>
|
|
302
|
+
<div
|
|
303
|
+
className="chakra-collapse"
|
|
304
|
+
style={
|
|
305
|
+
Object {
|
|
306
|
+
"display": "none",
|
|
307
|
+
"height": "0px",
|
|
308
|
+
"opacity": 0,
|
|
309
|
+
"overflow": "hidden",
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
>
|
|
313
|
+
<div
|
|
314
|
+
aria-labelledby="accordion-button-accordian-item-0"
|
|
315
|
+
className="chakra-accordion__panel css-0"
|
|
316
|
+
id="accordion-panel-accordian-item-0"
|
|
317
|
+
role="region"
|
|
318
|
+
>
|
|
319
|
+
<div
|
|
320
|
+
className="css-0"
|
|
321
|
+
id="card"
|
|
322
|
+
>
|
|
323
|
+
<div
|
|
324
|
+
className="css-0"
|
|
325
|
+
>
|
|
326
|
+
<div
|
|
327
|
+
className="the-wrap css-0"
|
|
328
|
+
>
|
|
329
|
+
<div
|
|
330
|
+
className="the-crop css-0"
|
|
331
|
+
>
|
|
332
|
+
<img
|
|
333
|
+
alt="Alt text"
|
|
334
|
+
className="css-0"
|
|
335
|
+
src="https://cdn.onebauer.media/one/media/6176/76fd/405b/ab5f/f20f/2d52/gerri-1500-1.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit"
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</div>
|
|
340
|
+
<div
|
|
341
|
+
className="card-body css-0"
|
|
342
|
+
>
|
|
343
|
+
<h4
|
|
344
|
+
className="chakra-heading css-0"
|
|
345
|
+
id="heading1"
|
|
346
|
+
>
|
|
347
|
+
Gerry Kellman
|
|
348
|
+
</h4>
|
|
349
|
+
<div
|
|
350
|
+
className="css-0"
|
|
351
|
+
>
|
|
352
|
+
Gerri is
|
|
353
|
+
<b>
|
|
354
|
+
one of Logan's most trusted confidantes
|
|
355
|
+
</b>
|
|
356
|
+
, one who serves many roles within the company. She's one of the most powerful people at Waystar Royco outside of the family itself.
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
`;
|
|
365
|
+
|
|
366
|
+
exports[`Accordion Renders the UI snapshot correctly 4`] = `
|
|
367
|
+
<div
|
|
368
|
+
className="chakra-accordion css-0"
|
|
369
|
+
id="accordian"
|
|
370
|
+
>
|
|
371
|
+
<div
|
|
372
|
+
className="chakra-accordion__item css-1fsnuue"
|
|
373
|
+
>
|
|
374
|
+
<button
|
|
375
|
+
aria-controls="accordion-panel-accordian-item-0"
|
|
376
|
+
aria-expanded={false}
|
|
377
|
+
className="chakra-accordion__button css-x43iy9"
|
|
136
378
|
disabled={false}
|
|
137
379
|
id="accordion-button-accordian-item-0"
|
|
138
380
|
onClick={[Function]}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { withDesign } from "storybook-addon-designs";
|
|
9
9
|
|
|
10
10
|
import Breadcrumbs from "./Breadcrumbs";
|
|
11
|
-
import {
|
|
11
|
+
import { BreadcrumbsTypes } from "./BreadcrumbsTypes";
|
|
12
12
|
import Heading from "../Heading/Heading";
|
|
13
13
|
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
14
14
|
import Link from "../Link/Link";
|
|
@@ -17,8 +17,8 @@ import DSProvider from "../../theme/provider";
|
|
|
17
17
|
import { getStorybookEnumValues } from "../../utils/utils";
|
|
18
18
|
|
|
19
19
|
export const enumValues = getStorybookEnumValues(
|
|
20
|
-
|
|
21
|
-
"
|
|
20
|
+
BreadcrumbsTypes,
|
|
21
|
+
"BreadcrumbsTypes"
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
<Meta
|
|
@@ -36,7 +36,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
36
36
|
additionalStyles: { control: false },
|
|
37
37
|
breadcrumbsData: { control: false },
|
|
38
38
|
className: { control: false },
|
|
39
|
-
|
|
39
|
+
breadcrumbsType: {
|
|
40
40
|
control: { type: "select" },
|
|
41
41
|
options: enumValues.options,
|
|
42
42
|
},
|
|
@@ -49,7 +49,7 @@ export const enumValues = getStorybookEnumValues(
|
|
|
49
49
|
| Component Version | DS Version |
|
|
50
50
|
| ----------------- | ---------- |
|
|
51
51
|
| Added | `0.0.3` |
|
|
52
|
-
| Latest | `0.25.
|
|
52
|
+
| Latest | `0.25.13` |
|
|
53
53
|
|
|
54
54
|
<Description of={Breadcrumbs} />
|
|
55
55
|
|
|
@@ -68,14 +68,14 @@ available in the breadcrumb hierarchy.
|
|
|
68
68
|
{ url: "#", text: "Grandchild" },
|
|
69
69
|
],
|
|
70
70
|
className: undefined,
|
|
71
|
-
|
|
71
|
+
breadcrumbsType: undefined,
|
|
72
72
|
id: "breadcrumbs-id",
|
|
73
73
|
}}
|
|
74
74
|
>
|
|
75
75
|
{(args) => (
|
|
76
76
|
<Breadcrumbs
|
|
77
77
|
{...args}
|
|
78
|
-
|
|
78
|
+
breadcrumbsType={enumValues.getValue(args.breadcrumbsType)}
|
|
79
79
|
/>
|
|
80
80
|
)}
|
|
81
81
|
</Story>
|
|
@@ -115,13 +115,15 @@ so only one component must be rendered on a page.
|
|
|
115
115
|
|
|
116
116
|
## Color Variations
|
|
117
117
|
|
|
118
|
-
The `Breadcrumbs` component background color can be set using the `
|
|
118
|
+
The `Breadcrumbs` component background color can be set using the `breadcrumbsType`
|
|
119
|
+
prop and the `BreadcrumbsTypes` enum. If the `breadcrumbsType` prop is omitted,
|
|
120
|
+
the default background color is `black`.
|
|
119
121
|
|
|
120
122
|
<Canvas>
|
|
121
123
|
<Story
|
|
122
124
|
name="Color Variations"
|
|
123
125
|
args={{
|
|
124
|
-
|
|
126
|
+
breadcrumbsType: BreadcrumbsTypes.Blogs,
|
|
125
127
|
}}
|
|
126
128
|
>
|
|
127
129
|
{(args) => (
|
|
@@ -136,7 +138,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
136
138
|
text: "Grandchild",
|
|
137
139
|
},
|
|
138
140
|
]}
|
|
139
|
-
|
|
141
|
+
breadcrumbsType={args.breadcrumbsType}
|
|
140
142
|
/>
|
|
141
143
|
</>
|
|
142
144
|
)}
|
|
@@ -155,7 +157,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
155
157
|
text: "Grandchild",
|
|
156
158
|
},
|
|
157
159
|
]}
|
|
158
|
-
|
|
160
|
+
breadcrumbsType={BreadcrumbsTypes.BooksAndMore}
|
|
159
161
|
/>
|
|
160
162
|
</DSProvider>
|
|
161
163
|
</Canvas>
|
|
@@ -172,7 +174,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
172
174
|
text: "Grandchild",
|
|
173
175
|
},
|
|
174
176
|
]}
|
|
175
|
-
|
|
177
|
+
breadcrumbsType={BreadcrumbsTypes.Education}
|
|
176
178
|
/>
|
|
177
179
|
</DSProvider>
|
|
178
180
|
</Canvas>
|
|
@@ -189,7 +191,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
189
191
|
text: "Grandchild",
|
|
190
192
|
},
|
|
191
193
|
]}
|
|
192
|
-
|
|
194
|
+
breadcrumbsType={BreadcrumbsTypes.Locations}
|
|
193
195
|
/>
|
|
194
196
|
</DSProvider>
|
|
195
197
|
</Canvas>
|
|
@@ -206,7 +208,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
206
208
|
text: "Grandchild",
|
|
207
209
|
},
|
|
208
210
|
]}
|
|
209
|
-
|
|
211
|
+
breadcrumbsType={BreadcrumbsTypes.Research}
|
|
210
212
|
/>
|
|
211
213
|
</DSProvider>
|
|
212
214
|
</Canvas>
|
|
@@ -223,7 +225,7 @@ The `Breadcrumbs` component background color can be set using the `colorVariant`
|
|
|
223
225
|
text: "Grandchild",
|
|
224
226
|
},
|
|
225
227
|
]}
|
|
226
|
-
|
|
228
|
+
breadcrumbsType={BreadcrumbsTypes.WhatsOn}
|
|
227
229
|
/>
|
|
228
230
|
</DSProvider>
|
|
229
231
|
</Canvas>
|
|
@@ -4,7 +4,7 @@ import renderer from "react-test-renderer";
|
|
|
4
4
|
import { axe } from "jest-axe";
|
|
5
5
|
|
|
6
6
|
import Breadcrumbs from "./Breadcrumbs";
|
|
7
|
-
import {
|
|
7
|
+
import { BreadcrumbsTypes } from "./BreadcrumbsTypes";
|
|
8
8
|
|
|
9
9
|
describe("Breadcrumbs Accessibility", () => {
|
|
10
10
|
const breadcrumbsData = [
|
|
@@ -51,7 +51,7 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
51
51
|
.create(
|
|
52
52
|
<Breadcrumbs
|
|
53
53
|
breadcrumbsData={breadcrumbsData}
|
|
54
|
-
|
|
54
|
+
breadcrumbsType={BreadcrumbsTypes.BooksAndMore}
|
|
55
55
|
id="breadcrumbs-test"
|
|
56
56
|
/>
|
|
57
57
|
)
|
|
@@ -60,7 +60,7 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
60
60
|
.create(
|
|
61
61
|
<Breadcrumbs
|
|
62
62
|
breadcrumbsData={breadcrumbsData}
|
|
63
|
-
|
|
63
|
+
breadcrumbsType={BreadcrumbsTypes.Blogs}
|
|
64
64
|
id="breadcrumbs-test"
|
|
65
65
|
/>
|
|
66
66
|
)
|
|
@@ -69,7 +69,7 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
69
69
|
.create(
|
|
70
70
|
<Breadcrumbs
|
|
71
71
|
breadcrumbsData={breadcrumbsData}
|
|
72
|
-
|
|
72
|
+
breadcrumbsType={BreadcrumbsTypes.Blogs}
|
|
73
73
|
id="breadcrumbs-test"
|
|
74
74
|
/>
|
|
75
75
|
)
|
|
@@ -78,7 +78,7 @@ describe("Breadcrumbs Snapshot", () => {
|
|
|
78
78
|
.create(
|
|
79
79
|
<Breadcrumbs
|
|
80
80
|
breadcrumbsData={breadcrumbsData}
|
|
81
|
-
|
|
81
|
+
breadcrumbsType={BreadcrumbsTypes.Education}
|
|
82
82
|
id="breadcrumbs-test"
|
|
83
83
|
/>
|
|
84
84
|
)
|
|
@@ -130,7 +130,7 @@ describe("Breadcrumbs Testing", () => {
|
|
|
130
130
|
|
|
131
131
|
it("Throws error when nothing is passed into Breadcrumb", () => {
|
|
132
132
|
expect(() => render(<Breadcrumbs breadcrumbsData={[]} />)).toThrowError(
|
|
133
|
-
"
|
|
133
|
+
"NYPL Reservoir Breadcrumbs: No data was passed to the `breadcrumbsData` prop."
|
|
134
134
|
);
|
|
135
135
|
});
|
|
136
136
|
});
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
IconTypes,
|
|
15
15
|
} from "../Icons/IconTypes";
|
|
16
16
|
import generateUUID from "../../helpers/generateUUID";
|
|
17
|
-
import {
|
|
17
|
+
import { BreadcrumbsTypes } from "./BreadcrumbsTypes";
|
|
18
18
|
import { getVariant } from "../../utils/utils";
|
|
19
19
|
|
|
20
20
|
export interface BreadcrumbsDataProps {
|
|
@@ -27,12 +27,12 @@ export interface BreadcrumbProps {
|
|
|
27
27
|
additionalStyles?: { [key: string]: any };
|
|
28
28
|
/** Breadcrumb links as an array */
|
|
29
29
|
breadcrumbsData: BreadcrumbsDataProps[];
|
|
30
|
+
/** Used to control how the `Hero` component will be rendered. */
|
|
31
|
+
breadcrumbsType?: BreadcrumbsTypes;
|
|
30
32
|
/** className you can add in addition to 'input' */
|
|
31
33
|
className?: string;
|
|
32
34
|
/** ID that other components can cross reference for accessibility purposes */
|
|
33
35
|
id?: string;
|
|
34
|
-
/** Used to control how the `Hero` component will be rendered. */
|
|
35
|
-
colorVariant?: ColorVariants;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const getElementsFromData = (data, breadcrumbsID) => {
|
|
@@ -68,15 +68,15 @@ function Breadcrumbs(props: React.PropsWithChildren<BreadcrumbProps>) {
|
|
|
68
68
|
const {
|
|
69
69
|
additionalStyles = {},
|
|
70
70
|
breadcrumbsData,
|
|
71
|
+
breadcrumbsType,
|
|
71
72
|
className,
|
|
72
|
-
colorVariant,
|
|
73
73
|
id = generateUUID(),
|
|
74
74
|
} = props;
|
|
75
|
-
const variant = getVariant(
|
|
75
|
+
const variant = getVariant(breadcrumbsType, BreadcrumbsTypes);
|
|
76
76
|
|
|
77
77
|
if (!breadcrumbsData || breadcrumbsData.length === 0) {
|
|
78
78
|
throw new Error(
|
|
79
|
-
"
|
|
79
|
+
"NYPL Reservoir Breadcrumbs: No data was passed to the `breadcrumbsData` prop."
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
|