@nypl/design-system-react-components 1.0.2 → 1.0.4
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 +53 -0
- package/README.md +171 -135
- package/dist/__tests__/mediaMatchMock.d.ts +79 -0
- package/dist/components/Card/Card.d.ts +8 -6
- package/dist/components/Heading/Heading.d.ts +6 -0
- package/dist/components/Icons/Icon.d.ts +1 -1
- package/dist/components/Icons/IconSvgs.d.ts +10 -0
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +3 -0
- package/dist/components/Slider/Slider.d.ts +1 -2
- package/dist/components/Table/Table.d.ts +3 -2
- package/dist/components/Text/Text.d.ts +6 -0
- package/dist/components/TextInput/TextInput.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +1700 -878
- 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 +1672 -881
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/hooks/{tests → __tests__}/useCarouselStyles.test.d.ts +0 -0
- package/dist/hooks/__tests__/useNYPLBreakpoints.test.d.ts +1 -0
- package/dist/hooks/useNYPLBreakpoints.d.ts +13 -0
- package/dist/index.d.ts +2 -1
- package/dist/resources.scss +0 -4
- package/dist/styles.css +3 -2
- package/dist/theme/components/button.d.ts +7 -2
- package/dist/theme/components/checkbox.d.ts +1 -0
- package/dist/theme/components/customTable.d.ts +522 -34
- package/dist/theme/components/datePicker.d.ts +1 -0
- package/dist/theme/components/global.d.ts +5 -2
- package/dist/theme/components/heading.d.ts +5 -1
- package/dist/theme/components/image.d.ts +18 -0
- package/dist/theme/components/radio.d.ts +9 -0
- package/dist/theme/components/searchBar.d.ts +6 -0
- package/dist/theme/components/select.d.ts +4 -5
- package/dist/theme/components/structuredContent.d.ts +117 -17
- package/dist/theme/components/template.d.ts +4 -1
- package/dist/theme/components/text.d.ts +5 -1
- package/dist/theme/components/textInput.d.ts +4 -0
- package/dist/theme/components/toggle.d.ts +1 -0
- package/dist/theme/provider.d.ts +2 -1
- package/package.json +16 -16
- package/src/__tests__/fileMock.ts +0 -6
- package/src/__tests__/setup.ts +0 -27
- package/src/__tests__/utils/utils.test.ts +0 -18
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +0 -42
- package/src/components/Accordion/Accordion.stories.mdx +0 -333
- package/src/components/Accordion/Accordion.test.tsx +0 -237
- package/src/components/Accordion/Accordion.tsx +0 -137
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +0 -734
- package/src/components/Autosuggest/Autosuggest.stories.mdx +0 -75
- package/src/components/Autosuggest/Autosuggest.stories.tsx +0 -211
- package/src/components/Autosuggest/_Autosuggest.scss +0 -51
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +0 -231
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +0 -144
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -98
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +0 -695
- package/src/components/Button/Button.stories.mdx +0 -320
- package/src/components/Button/Button.test.tsx +0 -184
- package/src/components/Button/Button.tsx +0 -95
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -106
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +0 -178
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +0 -141
- package/src/components/ButtonGroup/ButtonGroup.tsx +0 -100
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +0 -117
- package/src/components/Card/Card.stories.mdx +0 -1041
- package/src/components/Card/Card.test.tsx +0 -388
- package/src/components/Card/Card.tsx +0 -346
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +0 -568
- package/src/components/Chakra/Box.stories.mdx +0 -52
- package/src/components/Chakra/Center.stories.mdx +0 -96
- package/src/components/Chakra/Flex.stories.mdx +0 -111
- package/src/components/Chakra/Grid.stories.mdx +0 -89
- package/src/components/Chakra/Stack.stories.mdx +0 -109
- package/src/components/Checkbox/Checkbox.stories.mdx +0 -243
- package/src/components/Checkbox/Checkbox.test.tsx +0 -350
- package/src/components/Checkbox/Checkbox.tsx +0 -152
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +0 -661
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +0 -462
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +0 -492
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +0 -173
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -1842
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +0 -163
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +0 -76
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +0 -103
- package/src/components/DatePicker/DatePicker.stories.mdx +0 -452
- package/src/components/DatePicker/DatePicker.test.tsx +0 -940
- package/src/components/DatePicker/DatePicker.tsx +0 -450
- package/src/components/DatePicker/_DatePicker.scss +0 -100
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +0 -908
- package/src/components/Fieldset/Fieldset.stories.mdx +0 -96
- package/src/components/Fieldset/Fieldset.test.tsx +0 -155
- package/src/components/Fieldset/Fieldset.tsx +0 -55
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +0 -89
- package/src/components/Form/Form.stories.mdx +0 -426
- package/src/components/Form/Form.test.tsx +0 -234
- package/src/components/Form/Form.tsx +0 -124
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -115
- package/src/components/Grid/SimpleGrid.stories.mdx +0 -336
- package/src/components/Grid/SimpleGrid.test.tsx +0 -79
- package/src/components/Grid/SimpleGrid.tsx +0 -49
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +0 -23
- package/src/components/Heading/Heading.stories.mdx +0 -187
- package/src/components/Heading/Heading.test.tsx +0 -171
- package/src/components/Heading/Heading.tsx +0 -104
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +0 -90
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +0 -172
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +0 -114
- package/src/components/HelperErrorText/HelperErrorText.tsx +0 -62
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +0 -93
- package/src/components/Hero/Hero.stories.mdx +0 -378
- package/src/components/Hero/Hero.test.tsx +0 -611
- package/src/components/Hero/Hero.tsx +0 -203
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +0 -379
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +0 -73
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +0 -54
- package/src/components/HorizontalRule/HorizontalRule.tsx +0 -27
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +0 -44
- package/src/components/Icons/Icon.stories.mdx +0 -413
- package/src/components/Icons/Icon.test.tsx +0 -120
- package/src/components/Icons/Icon.tsx +0 -187
- package/src/components/Icons/IconSvgs.tsx +0 -64
- package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +0 -129
- package/src/components/Image/Image.stories.mdx +0 -332
- package/src/components/Image/Image.test.tsx +0 -155
- package/src/components/Image/Image.tsx +0 -171
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +0 -269
- package/src/components/Label/Label.stories.mdx +0 -100
- package/src/components/Label/Label.test.tsx +0 -116
- package/src/components/Label/Label.tsx +0 -55
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +0 -45
- package/src/components/Link/Link.stories.mdx +0 -249
- package/src/components/Link/Link.test.tsx +0 -224
- package/src/components/Link/Link.tsx +0 -178
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +0 -286
- package/src/components/List/List.stories.mdx +0 -393
- package/src/components/List/List.test.tsx +0 -265
- package/src/components/List/List.tsx +0 -156
- package/src/components/List/__snapshots__/List.test.tsx.snap +0 -213
- package/src/components/Logo/Logo.stories.mdx +0 -295
- package/src/components/Logo/Logo.test.tsx +0 -116
- package/src/components/Logo/Logo.tsx +0 -151
- package/src/components/Logo/LogoSvgs.tsx +0 -90
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +0 -142
- package/src/components/Modal/Modal.stories.mdx +0 -294
- package/src/components/Modal/Modal.test.tsx +0 -157
- package/src/components/Modal/Modal.tsx +0 -154
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +0 -25
- package/src/components/Notification/Notification.stories.mdx +0 -358
- package/src/components/Notification/Notification.test.tsx +0 -279
- package/src/components/Notification/Notification.tsx +0 -224
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +0 -525
- package/src/components/Pagination/Pagination.stories.mdx +0 -184
- package/src/components/Pagination/Pagination.test.tsx +0 -419
- package/src/components/Pagination/Pagination.tsx +0 -269
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +0 -544
- package/src/components/Placeholder/Placeholder.tsx +0 -19
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +0 -360
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +0 -298
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +0 -132
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -434
- package/src/components/Radio/Radio.stories.mdx +0 -216
- package/src/components/Radio/Radio.test.tsx +0 -247
- package/src/components/Radio/Radio.tsx +0 -119
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +0 -451
- package/src/components/RadioGroup/RadioGroup.stories.mdx +0 -479
- package/src/components/RadioGroup/RadioGroup.test.tsx +0 -471
- package/src/components/RadioGroup/RadioGroup.tsx +0 -171
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +0 -1550
- package/src/components/SearchBar/SearchBar.stories.mdx +0 -518
- package/src/components/SearchBar/SearchBar.test.tsx +0 -435
- package/src/components/SearchBar/SearchBar.tsx +0 -210
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -1049
- package/src/components/Select/Select.stories.mdx +0 -439
- package/src/components/Select/Select.test.tsx +0 -358
- package/src/components/Select/Select.tsx +0 -183
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +0 -895
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +0 -142
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +0 -116
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +0 -123
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +0 -898
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +0 -90
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +0 -63
- package/src/components/SkipNavigation/SkipNavigation.tsx +0 -51
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +0 -130
- package/src/components/Slider/Slider.stories.mdx +0 -628
- package/src/components/Slider/Slider.test.tsx +0 -736
- package/src/components/Slider/Slider.tsx +0 -322
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -2186
- package/src/components/StatusBadge/StatusBadge.stories.mdx +0 -109
- package/src/components/StatusBadge/StatusBadge.test.tsx +0 -70
- package/src/components/StatusBadge/StatusBadge.tsx +0 -35
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +0 -47
- package/src/components/StructuredContent/StructuredContent.stories.mdx +0 -567
- package/src/components/StructuredContent/StructuredContent.test.tsx +0 -435
- package/src/components/StructuredContent/StructuredContent.tsx +0 -139
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +0 -368
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +0 -206
- package/src/components/StyleGuide/Breakpoints.stories.mdx +0 -55
- package/src/components/StyleGuide/Buttons.stories.mdx +0 -194
- package/src/components/StyleGuide/ColorCard.tsx +0 -43
- package/src/components/StyleGuide/Colors.stories.mdx +0 -201
- package/src/components/StyleGuide/DesignTokens.stories.mdx +0 -193
- package/src/components/StyleGuide/Forms.stories.mdx +0 -94
- package/src/components/StyleGuide/Iconography.stories.mdx +0 -142
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -116
- package/src/components/StyleGuide/Typography.stories.mdx +0 -419
- package/src/components/Table/Table.stories.mdx +0 -272
- package/src/components/Table/Table.test.tsx +0 -241
- package/src/components/Table/Table.tsx +0 -152
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +0 -1703
- package/src/components/Tabs/Tabs.stories.mdx +0 -338
- package/src/components/Tabs/Tabs.test.tsx +0 -298
- package/src/components/Tabs/Tabs.tsx +0 -264
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +0 -584
- package/src/components/Template/Template.stories.mdx +0 -695
- package/src/components/Template/Template.test.tsx +0 -309
- package/src/components/Template/Template.tsx +0 -326
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +0 -342
- package/src/components/Text/Text.stories.mdx +0 -103
- package/src/components/Text/Text.test.tsx +0 -63
- package/src/components/Text/Text.tsx +0 -50
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +0 -50
- package/src/components/TextInput/TextInput.stories.mdx +0 -268
- package/src/components/TextInput/TextInput.test.tsx +0 -451
- package/src/components/TextInput/TextInput.tsx +0 -240
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +0 -274
- package/src/components/Toggle/Toggle.stories.mdx +0 -237
- package/src/components/Toggle/Toggle.test.tsx +0 -170
- package/src/components/Toggle/Toggle.tsx +0 -128
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +0 -470
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +0 -212
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +0 -308
- package/src/components/VideoPlayer/VideoPlayer.tsx +0 -188
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +0 -192
- package/src/docs/Chakra.stories.mdx +0 -563
- package/src/docs/Welcome.stories.mdx +0 -148
- package/src/helpers/types.ts +0 -1
- package/src/hooks/tests/useCarouselStyles.test.ts +0 -140
- package/src/hooks/tests/useNYPLTheme.test.tsx +0 -36
- package/src/hooks/useCarouselStyles.stories.mdx +0 -30
- package/src/hooks/useCarouselStyles.ts +0 -35
- package/src/hooks/useNYPLTheme.stories.mdx +0 -98
- package/src/hooks/useNYPLTheme.ts +0 -91
- package/src/hooks/useWindowSize.stories.mdx +0 -23
- package/src/hooks/useWindowSize.ts +0 -40
- package/src/index.ts +0 -136
- package/src/resources.scss +0 -6
- package/src/styles/base/_01-breakpoints.scss +0 -27
- package/src/styles/base/_02-mixins.scss +0 -103
- package/src/styles/base/_place-holder.scss +0 -33
- package/src/styles/space/_space-inline.scss +0 -79
- package/src/styles/space/_space-inset.scss +0 -57
- package/src/styles/space/_space-stack.scss +0 -116
- package/src/styles.scss +0 -23
- package/src/theme/components/accordion.ts +0 -25
- package/src/theme/components/breadcrumb.ts +0 -94
- package/src/theme/components/button.ts +0 -133
- package/src/theme/components/buttonGroup.ts +0 -10
- package/src/theme/components/card.ts +0 -237
- package/src/theme/components/checkbox.ts +0 -110
- package/src/theme/components/checkboxGroup.ts +0 -10
- package/src/theme/components/componentWrapper.ts +0 -14
- package/src/theme/components/customTable.ts +0 -77
- package/src/theme/components/datePicker.ts +0 -17
- package/src/theme/components/fieldset.ts +0 -23
- package/src/theme/components/global.ts +0 -91
- package/src/theme/components/globalMixins.ts +0 -24
- package/src/theme/components/heading.ts +0 -79
- package/src/theme/components/helperErrorText.ts +0 -14
- package/src/theme/components/hero.ts +0 -238
- package/src/theme/components/horizontalRule.ts +0 -17
- package/src/theme/components/icon.ts +0 -88
- package/src/theme/components/image.ts +0 -136
- package/src/theme/components/label.ts +0 -15
- package/src/theme/components/link.ts +0 -63
- package/src/theme/components/list.ts +0 -88
- package/src/theme/components/logo.ts +0 -58
- package/src/theme/components/notification.ts +0 -132
- package/src/theme/components/pagination.ts +0 -17
- package/src/theme/components/progressIndicator.ts +0 -67
- package/src/theme/components/radio.ts +0 -103
- package/src/theme/components/radioGroup.ts +0 -10
- package/src/theme/components/searchBar.ts +0 -19
- package/src/theme/components/select.ts +0 -72
- package/src/theme/components/skeletonLoader.ts +0 -113
- package/src/theme/components/skipNavigation.ts +0 -29
- package/src/theme/components/slider.ts +0 -95
- package/src/theme/components/statusBadge.ts +0 -26
- package/src/theme/components/structuredContent.ts +0 -149
- package/src/theme/components/tabs.ts +0 -109
- package/src/theme/components/template.ts +0 -114
- package/src/theme/components/text.ts +0 -38
- package/src/theme/components/textInput.ts +0 -65
- package/src/theme/components/toggle.ts +0 -109
- package/src/theme/components/videoPlayer.ts +0 -47
- package/src/theme/foundations/breakpoints.ts +0 -24
- package/src/theme/foundations/colors.ts +0 -212
- package/src/theme/foundations/global.ts +0 -43
- package/src/theme/foundations/radii.ts +0 -7
- package/src/theme/foundations/shadows.ts +0 -5
- package/src/theme/foundations/spacing.ts +0 -136
- package/src/theme/foundations/typography.ts +0 -107
- package/src/theme/index.ts +0 -131
- package/src/theme/provider.tsx +0 -9
- package/src/theme/types.ts +0 -1
- package/src/utils/componentCategories.ts +0 -152
- package/src/utils/interfaces.ts +0 -5
- package/src/utils/utils.ts +0 -84
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Link renders the UI snapshot correctly 1`] = `
|
|
4
|
-
<a
|
|
5
|
-
className="css-1xdhyk6"
|
|
6
|
-
href="#passed-in-link"
|
|
7
|
-
id="standard-link"
|
|
8
|
-
rel={null}
|
|
9
|
-
target={null}
|
|
10
|
-
>
|
|
11
|
-
Standard
|
|
12
|
-
</a>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`Link renders the UI snapshot correctly 2`] = `
|
|
16
|
-
<a
|
|
17
|
-
className="css-1xdhyk6"
|
|
18
|
-
href="#passed-in-link"
|
|
19
|
-
id="forwards-link"
|
|
20
|
-
rel={null}
|
|
21
|
-
target={null}
|
|
22
|
-
>
|
|
23
|
-
Forwards
|
|
24
|
-
<svg
|
|
25
|
-
aria-hidden={true}
|
|
26
|
-
className="chakra-icon more-link css-1grhd2q"
|
|
27
|
-
focusable={false}
|
|
28
|
-
id="forwards-link-icon"
|
|
29
|
-
role="img"
|
|
30
|
-
title="arrow icon"
|
|
31
|
-
viewBox="0 0 24 24"
|
|
32
|
-
>
|
|
33
|
-
<g
|
|
34
|
-
stroke="currentColor"
|
|
35
|
-
strokeWidth="1.5"
|
|
36
|
-
>
|
|
37
|
-
<path
|
|
38
|
-
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
39
|
-
fill="none"
|
|
40
|
-
strokeLinecap="round"
|
|
41
|
-
/>
|
|
42
|
-
<path
|
|
43
|
-
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
44
|
-
fill="currentColor"
|
|
45
|
-
strokeLinecap="round"
|
|
46
|
-
/>
|
|
47
|
-
<circle
|
|
48
|
-
cx="12"
|
|
49
|
-
cy="12"
|
|
50
|
-
fill="none"
|
|
51
|
-
r="11.25"
|
|
52
|
-
strokeMiterlimit="10"
|
|
53
|
-
/>
|
|
54
|
-
</g>
|
|
55
|
-
</svg>
|
|
56
|
-
</a>
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
exports[`Link renders the UI snapshot correctly 3`] = `
|
|
60
|
-
<a
|
|
61
|
-
className="css-1xdhyk6"
|
|
62
|
-
href="#passed-in-link"
|
|
63
|
-
id="backwards-link"
|
|
64
|
-
rel={null}
|
|
65
|
-
target={null}
|
|
66
|
-
>
|
|
67
|
-
<svg
|
|
68
|
-
aria-hidden={true}
|
|
69
|
-
className="chakra-icon more-link css-1grhd2q"
|
|
70
|
-
focusable={false}
|
|
71
|
-
id="backwards-link-icon"
|
|
72
|
-
role="img"
|
|
73
|
-
title="arrow icon"
|
|
74
|
-
viewBox="0 0 24 24"
|
|
75
|
-
>
|
|
76
|
-
<g
|
|
77
|
-
stroke="currentColor"
|
|
78
|
-
strokeWidth="1.5"
|
|
79
|
-
>
|
|
80
|
-
<path
|
|
81
|
-
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
82
|
-
fill="none"
|
|
83
|
-
strokeLinecap="round"
|
|
84
|
-
/>
|
|
85
|
-
<path
|
|
86
|
-
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
87
|
-
fill="currentColor"
|
|
88
|
-
strokeLinecap="round"
|
|
89
|
-
/>
|
|
90
|
-
<circle
|
|
91
|
-
cx="12"
|
|
92
|
-
cy="12"
|
|
93
|
-
fill="none"
|
|
94
|
-
r="11.25"
|
|
95
|
-
strokeMiterlimit="10"
|
|
96
|
-
/>
|
|
97
|
-
</g>
|
|
98
|
-
</svg>
|
|
99
|
-
Backwards
|
|
100
|
-
</a>
|
|
101
|
-
`;
|
|
102
|
-
|
|
103
|
-
exports[`Link renders the UI snapshot correctly 4`] = `
|
|
104
|
-
<a
|
|
105
|
-
className="css-1xdhyk6"
|
|
106
|
-
href="#passed-in-link"
|
|
107
|
-
id="external-link"
|
|
108
|
-
rel="nofollow"
|
|
109
|
-
target="_blank"
|
|
110
|
-
>
|
|
111
|
-
External
|
|
112
|
-
<svg
|
|
113
|
-
aria-hidden={true}
|
|
114
|
-
className="chakra-icon more-link css-1grhd2q"
|
|
115
|
-
focusable={false}
|
|
116
|
-
id="external-link-icon"
|
|
117
|
-
role="img"
|
|
118
|
-
title="actionLaunch icon"
|
|
119
|
-
viewBox="0 0 24 24"
|
|
120
|
-
>
|
|
121
|
-
<g
|
|
122
|
-
stroke="currentColor"
|
|
123
|
-
strokeWidth="1.5"
|
|
124
|
-
>
|
|
125
|
-
<path
|
|
126
|
-
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
127
|
-
fill="none"
|
|
128
|
-
strokeLinecap="round"
|
|
129
|
-
/>
|
|
130
|
-
<path
|
|
131
|
-
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
132
|
-
fill="currentColor"
|
|
133
|
-
strokeLinecap="round"
|
|
134
|
-
/>
|
|
135
|
-
<circle
|
|
136
|
-
cx="12"
|
|
137
|
-
cy="12"
|
|
138
|
-
fill="none"
|
|
139
|
-
r="11.25"
|
|
140
|
-
strokeMiterlimit="10"
|
|
141
|
-
/>
|
|
142
|
-
</g>
|
|
143
|
-
</svg>
|
|
144
|
-
</a>
|
|
145
|
-
`;
|
|
146
|
-
|
|
147
|
-
exports[`Link renders the UI snapshot correctly 5`] = `
|
|
148
|
-
<a
|
|
149
|
-
className="css-1xdhyk6"
|
|
150
|
-
href="#passed-in-link"
|
|
151
|
-
id="button-link"
|
|
152
|
-
rel={null}
|
|
153
|
-
target={null}
|
|
154
|
-
>
|
|
155
|
-
Button
|
|
156
|
-
</a>
|
|
157
|
-
`;
|
|
158
|
-
|
|
159
|
-
exports[`Link renders the UI snapshot correctly 6`] = `
|
|
160
|
-
<a
|
|
161
|
-
className="css-1xdhyk6"
|
|
162
|
-
href="#passed-in-link"
|
|
163
|
-
id="icon-link"
|
|
164
|
-
rel={null}
|
|
165
|
-
target={null}
|
|
166
|
-
>
|
|
167
|
-
<svg
|
|
168
|
-
aria-hidden={true}
|
|
169
|
-
className="chakra-icon more-link css-1grhd2q"
|
|
170
|
-
focusable={false}
|
|
171
|
-
id="link-icon"
|
|
172
|
-
role="img"
|
|
173
|
-
title="download icon"
|
|
174
|
-
viewBox="0 0 24 24"
|
|
175
|
-
>
|
|
176
|
-
<g
|
|
177
|
-
stroke="currentColor"
|
|
178
|
-
strokeWidth="1.5"
|
|
179
|
-
>
|
|
180
|
-
<path
|
|
181
|
-
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
182
|
-
fill="none"
|
|
183
|
-
strokeLinecap="round"
|
|
184
|
-
/>
|
|
185
|
-
<path
|
|
186
|
-
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
187
|
-
fill="currentColor"
|
|
188
|
-
strokeLinecap="round"
|
|
189
|
-
/>
|
|
190
|
-
<circle
|
|
191
|
-
cx="12"
|
|
192
|
-
cy="12"
|
|
193
|
-
fill="none"
|
|
194
|
-
r="11.25"
|
|
195
|
-
strokeMiterlimit="10"
|
|
196
|
-
/>
|
|
197
|
-
</g>
|
|
198
|
-
</svg>
|
|
199
|
-
Download
|
|
200
|
-
</a>
|
|
201
|
-
`;
|
|
202
|
-
|
|
203
|
-
exports[`Link renders the UI snapshot correctly 7`] = `
|
|
204
|
-
<span
|
|
205
|
-
className="css-0"
|
|
206
|
-
>
|
|
207
|
-
<a
|
|
208
|
-
className="css-0"
|
|
209
|
-
href="#existing-anchor-tag"
|
|
210
|
-
id="anchor-link"
|
|
211
|
-
rel={null}
|
|
212
|
-
target={null}
|
|
213
|
-
>
|
|
214
|
-
check link
|
|
215
|
-
</a>
|
|
216
|
-
</span>
|
|
217
|
-
`;
|
|
218
|
-
|
|
219
|
-
exports[`Link renders the UI snapshot correctly 8`] = `
|
|
220
|
-
<span
|
|
221
|
-
className="css-0"
|
|
222
|
-
>
|
|
223
|
-
<svg
|
|
224
|
-
aria-hidden={true}
|
|
225
|
-
className="chakra-icon css-1grhd2q"
|
|
226
|
-
focusable={false}
|
|
227
|
-
id="link-icon"
|
|
228
|
-
role="img"
|
|
229
|
-
title="check icon"
|
|
230
|
-
viewBox="0 0 24 24"
|
|
231
|
-
>
|
|
232
|
-
<g
|
|
233
|
-
stroke="currentColor"
|
|
234
|
-
strokeWidth="1.5"
|
|
235
|
-
>
|
|
236
|
-
<path
|
|
237
|
-
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
238
|
-
fill="none"
|
|
239
|
-
strokeLinecap="round"
|
|
240
|
-
/>
|
|
241
|
-
<path
|
|
242
|
-
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
243
|
-
fill="currentColor"
|
|
244
|
-
strokeLinecap="round"
|
|
245
|
-
/>
|
|
246
|
-
<circle
|
|
247
|
-
cx="12"
|
|
248
|
-
cy="12"
|
|
249
|
-
fill="none"
|
|
250
|
-
r="11.25"
|
|
251
|
-
strokeMiterlimit="10"
|
|
252
|
-
/>
|
|
253
|
-
</g>
|
|
254
|
-
</svg>
|
|
255
|
-
<a
|
|
256
|
-
href="#existing-anchor-tag"
|
|
257
|
-
>
|
|
258
|
-
check link
|
|
259
|
-
</a>
|
|
260
|
-
</span>
|
|
261
|
-
`;
|
|
262
|
-
|
|
263
|
-
exports[`Link renders the UI snapshot correctly 9`] = `
|
|
264
|
-
<a
|
|
265
|
-
className="css-kle7zy"
|
|
266
|
-
href="#passed-in-link"
|
|
267
|
-
id="chakra"
|
|
268
|
-
rel={null}
|
|
269
|
-
target={null}
|
|
270
|
-
>
|
|
271
|
-
Standard
|
|
272
|
-
</a>
|
|
273
|
-
`;
|
|
274
|
-
|
|
275
|
-
exports[`Link renders the UI snapshot correctly 10`] = `
|
|
276
|
-
<a
|
|
277
|
-
className="css-1xdhyk6"
|
|
278
|
-
data-testid="props"
|
|
279
|
-
href="#passed-in-link"
|
|
280
|
-
id="props"
|
|
281
|
-
rel={null}
|
|
282
|
-
target={null}
|
|
283
|
-
>
|
|
284
|
-
Standard
|
|
285
|
-
</a>
|
|
286
|
-
`;
|
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ArgsTable,
|
|
3
|
-
Canvas,
|
|
4
|
-
Description,
|
|
5
|
-
Meta,
|
|
6
|
-
Story,
|
|
7
|
-
} from "@storybook/addon-docs";
|
|
8
|
-
import { withDesign } from "storybook-addon-designs";
|
|
9
|
-
|
|
10
|
-
import Heading from "../Heading/Heading";
|
|
11
|
-
import Image from "../Image/Image";
|
|
12
|
-
import Link from "../Link/Link";
|
|
13
|
-
import List from "./List";
|
|
14
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
15
|
-
|
|
16
|
-
<Meta
|
|
17
|
-
title={getCategory("List")}
|
|
18
|
-
component={List}
|
|
19
|
-
decorators={[withDesign]}
|
|
20
|
-
parameters={{
|
|
21
|
-
design: {
|
|
22
|
-
type: "figma",
|
|
23
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=16115%3A304",
|
|
24
|
-
},
|
|
25
|
-
jest: ["List.test.tsx"],
|
|
26
|
-
}}
|
|
27
|
-
argTypes={{
|
|
28
|
-
children: { table: { disable: true } },
|
|
29
|
-
className: { control: false },
|
|
30
|
-
id: { control: false },
|
|
31
|
-
inline: { table: { defaultValue: { summary: false } } },
|
|
32
|
-
listItems: { control: false },
|
|
33
|
-
noStyling: { table: { defaultValue: { summary: false } } },
|
|
34
|
-
type: {
|
|
35
|
-
table: { defaultValue: { summary: "ul" } },
|
|
36
|
-
},
|
|
37
|
-
}}
|
|
38
|
-
/>
|
|
39
|
-
|
|
40
|
-
# List
|
|
41
|
-
|
|
42
|
-
| Component Version | DS Version |
|
|
43
|
-
| ----------------- | ---------- |
|
|
44
|
-
| Added | `0.7.0` |
|
|
45
|
-
| Latest | `0.28.0` |
|
|
46
|
-
|
|
47
|
-
## Table of Contents
|
|
48
|
-
|
|
49
|
-
- [Overview](#overview)
|
|
50
|
-
- [Component Props](#component-props)
|
|
51
|
-
- [Accessibility](#accessibility)
|
|
52
|
-
- [Description List](#description-list)
|
|
53
|
-
- [Description List of Links](#description-list-of-links)
|
|
54
|
-
- [Lists with Data Props](#lists-with-data-props)
|
|
55
|
-
|
|
56
|
-
## Overview
|
|
57
|
-
|
|
58
|
-
<Description of={List} />
|
|
59
|
-
|
|
60
|
-
export const animalCrossingDescriptions = [
|
|
61
|
-
{
|
|
62
|
-
term: "Mahi-mahi",
|
|
63
|
-
description:
|
|
64
|
-
'The mahi-mahi is an ocean fish known for its wide, somewhat-cute face. It can reach over six feet long. It is known by different names including "dolphinfish," even though it has no relation to dolphins. They live in only in warm, tropical waters...which perhaps explains the relaxed, happy look on their faces.',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
term: "Golden trout",
|
|
68
|
-
description: (
|
|
69
|
-
<p>
|
|
70
|
-
The golden trout is a <b>beautifully</b> colored fish that can only live
|
|
71
|
-
in very clean waters. They are difficult to come across since they are
|
|
72
|
-
found only in high mountain streams. As a side note, I find it much
|
|
73
|
-
easier to appreciate fish that aren't such prima donnas about
|
|
74
|
-
everything.
|
|
75
|
-
</p>
|
|
76
|
-
),
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
term: "Rainbowfish",
|
|
80
|
-
description:
|
|
81
|
-
'The rainbowfish is a tropical fish known for its metallic colors and beautiful fins. There are over 50 different species, each unique and pleasing color. I must say, it does make me wish for feathers of a more exciting hue than "underbaked brownie."',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
term: "Suckerfish",
|
|
85
|
-
description: (
|
|
86
|
-
<p>
|
|
87
|
-
The{" "}
|
|
88
|
-
<Link href="https://animalcrossing.fandom.com/wiki/Suckerfish">
|
|
89
|
-
suckerfish
|
|
90
|
-
</Link>{" "}
|
|
91
|
-
is a curious fish that likes to attach itself with its sucker mouth to
|
|
92
|
-
larger marine animals. The benefit to the suckerfish is that it gets to
|
|
93
|
-
eat smaller parasites and dead skin off the host's body. Amusingly, some
|
|
94
|
-
people have used suckerfish on cords to catch large turtles with the
|
|
95
|
-
fish's own suction! I imagine this practice is the cause of some awkward
|
|
96
|
-
conversations between fish and turtle, eh wot?
|
|
97
|
-
</p>
|
|
98
|
-
),
|
|
99
|
-
},
|
|
100
|
-
];
|
|
101
|
-
export const itemGroups = [
|
|
102
|
-
"Art",
|
|
103
|
-
"Bushes",
|
|
104
|
-
"Clothing",
|
|
105
|
-
"DIY Recipes",
|
|
106
|
-
"Flowers",
|
|
107
|
-
"Fossils",
|
|
108
|
-
"Fruits",
|
|
109
|
-
"Furniture",
|
|
110
|
-
"Materials",
|
|
111
|
-
"NPC",
|
|
112
|
-
"Songs",
|
|
113
|
-
"Tools",
|
|
114
|
-
"Villagers",
|
|
115
|
-
];
|
|
116
|
-
export const descriptions = [
|
|
117
|
-
{
|
|
118
|
-
term: "Balrogs",
|
|
119
|
-
description:
|
|
120
|
-
'Demonic creatures of fire and shadow, Balrogs were fallen Maiar, loyal to the first Dark Lord, Morgoth. They participated in the wars of the First Age of Middle-earth but were mostly destroyed during the War of Wrath which ended the Age. By the Third Age, the only remaining Balrog was "Durin\'s Bane," the Balrog of Moria, killed by Gandalf.',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
term: "Dwarves",
|
|
124
|
-
description:
|
|
125
|
-
"The race of Dwarves preferred to live in mountains and caves, settling in places such as Erebor (the Lonely Mountain), the Iron Hills, the Blue Mountains, and Moria (Khazad-dûm) in the Misty Mountains. Aulë the Smith created Dwarves; he also invented the Dwarven language, known as Khuzdul. Dwarves mined and worked precious metals throughout the mountains of Middle-earth. The seven different groups of Dwarf-folk originated in the locations where the Seven Fathers of the Dwarves first awoke before the First Age.",
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
term: "Elves",
|
|
129
|
-
description:
|
|
130
|
-
'The Elves, or Firstborn, were the first of Eru\'s Children to awaken. Born under the stars before the ascension of the Moon and the Sun, they retain a special love for light and an inner spirit endowed with unique gifts. They call themselves the Quendi, or "Speakers", for they were the first to utter words; and, even now, no race understands language and song like the Firstborn. Fair and fine featured, brilliant and proud, immortal and strong, tall and agile, they are the most blessed of the Free Peoples. They can see as well under moon or starlight as a man at the height of day. They cannot become sick or scarred, but if an Elf should die, from violence or losing the will to live from grief, their spirit goes to the halls of Mandos, and as they are bound to Arda and cannot leave until the world is broken and remade. Elven skill and agility is legendary: for instance, walking atop freshly fallen snow without leaving a trace of their passing. On a clear day they can see ten miles with perfect clarity and detail up to 100 miles. These gifts come at great cost, though: they are strongly bound to Fate (see Mandos) and hated by Morgoth. No other race has been blessed and cursed more than the Quendi.',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
term: "Ents",
|
|
134
|
-
description:
|
|
135
|
-
"Ents were an ancient race of tree-like creatures, having become like the trees that they shepherd. They were created by Yavanna and given life by Ilúvatar. By the Third Age, they were a dwindling race, having long ago lost their mates, the Entwives.",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
term: "Hobbits",
|
|
139
|
-
description:
|
|
140
|
-
'Hobbits are a race of Middle-earth, also known as "halflings" on account of their short stature, roughly half the size of men. They are characterized by curly hair on their heads and leathery feet that have furry insteps, for which they did not wear shoes. Many hobbits live in the Shire as well as Bree, and they once lived in the vales of the Anduin. They are fond of an unadventurous life of farming, eating, and socializing. There were three types of Hobbits: The Harfoots were the most numerous. The Stoors had an affinity for water, boats and swimming; the Fallohides were an adventurous people. The origin of hobbits is unclear, but of all the races they have the closest affinity to men, and in the Prologue to The Lord of the Rings Tolkien calls them relatives of men.',
|
|
141
|
-
},
|
|
142
|
-
];
|
|
143
|
-
|
|
144
|
-
<Canvas withToolbar>
|
|
145
|
-
<Story
|
|
146
|
-
name="List with Controls"
|
|
147
|
-
args={{
|
|
148
|
-
className: undefined,
|
|
149
|
-
id: "nypl-list",
|
|
150
|
-
inline: false,
|
|
151
|
-
listItems: undefined,
|
|
152
|
-
noStyling: false,
|
|
153
|
-
title: "Middle-Earth Peoples",
|
|
154
|
-
type: "ul",
|
|
155
|
-
}}
|
|
156
|
-
>
|
|
157
|
-
{(args) => (
|
|
158
|
-
<List {...args}>
|
|
159
|
-
{args.type !== "dl"
|
|
160
|
-
? itemGroups.map((item, i) => <li key={i}>{item}</li>)
|
|
161
|
-
: descriptions.map((item, i) => [
|
|
162
|
-
<dt key={`dt_${i}`}>{item.term}</dt>,
|
|
163
|
-
<dd key={`dd_${i}`}>{item.description}</dd>,
|
|
164
|
-
])}
|
|
165
|
-
</List>
|
|
166
|
-
)}
|
|
167
|
-
</Story>
|
|
168
|
-
</Canvas>
|
|
169
|
-
|
|
170
|
-
<ArgsTable story="List with Controls" />
|
|
171
|
-
|
|
172
|
-
## Accessibility
|
|
173
|
-
|
|
174
|
-
Internally, the `List` component implements native HTML markup for unordered,
|
|
175
|
-
ordered, and description lists. This includes `ul`, `ol`, and `dl` elements.
|
|
176
|
-
When data is passed into the `listItems` data prop, the appropriate children
|
|
177
|
-
HTML elements are used. This includes `li` for unorder and ordered lists, and
|
|
178
|
-
`dt` and `dd` elements for description lists.
|
|
179
|
-
|
|
180
|
-
The description type for the `List` component is wrapped in a `section` element
|
|
181
|
-
with an `h2` header. Keep that in mind when ordering headings on the page.
|
|
182
|
-
|
|
183
|
-
Resources:
|
|
184
|
-
|
|
185
|
-
- [W3C WAI Content Structure](https://www.w3.org/WAI/tutorials/page-structure/content/)
|
|
186
|
-
- [Deque University Appropriate Semantic Markup for Lists](https://dequeuniversity.com/tips/list-markup)
|
|
187
|
-
|
|
188
|
-
## Description List
|
|
189
|
-
|
|
190
|
-
_Note: This element is officially called the "Description List" element in HTML5.
|
|
191
|
-
Before HTML5, it was called the "Definition List" element and some online resources
|
|
192
|
-
may still use this name. In the Reservoir Design System, we will use the
|
|
193
|
-
"Description List" name._
|
|
194
|
-
|
|
195
|
-
- [W3C Using description lists](https://www.w3.org/WAI/WCAG21/Techniques/html/H40.html)
|
|
196
|
-
- [MDN dl: The Description List element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl)
|
|
197
|
-
|
|
198
|
-
To render a description list, pass in `"dl"` to the `type` prop. The optional
|
|
199
|
-
`title` prop will now render above the description list element. This type of
|
|
200
|
-
list renders `dt` and `dd` elements.
|
|
201
|
-
|
|
202
|
-
```jsx
|
|
203
|
-
<List type="dl">
|
|
204
|
-
<dt>Term</dt>
|
|
205
|
-
<dd>Description</dd>
|
|
206
|
-
</List>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
<Canvas>
|
|
210
|
-
<Story
|
|
211
|
-
name="Description List"
|
|
212
|
-
args={{
|
|
213
|
-
id: "nypl-list2",
|
|
214
|
-
noStyling: false,
|
|
215
|
-
title: "Middle-Earth Peoples",
|
|
216
|
-
}}
|
|
217
|
-
argTypes={{
|
|
218
|
-
inline: { control: false },
|
|
219
|
-
noStyling: { control: false },
|
|
220
|
-
type: { control: false },
|
|
221
|
-
}}
|
|
222
|
-
parameters={{
|
|
223
|
-
design: {
|
|
224
|
-
type: "figma",
|
|
225
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A5178",
|
|
226
|
-
},
|
|
227
|
-
}}
|
|
228
|
-
>
|
|
229
|
-
{(args) => (
|
|
230
|
-
<List {...args} type="dl">
|
|
231
|
-
{descriptions.map((item, i) => [
|
|
232
|
-
<dt key={`dt_${i}`}>{item.term}</dt>,
|
|
233
|
-
<dd key={`dd_${i}`}>{item.description}</dd>,
|
|
234
|
-
])}
|
|
235
|
-
</List>
|
|
236
|
-
)}
|
|
237
|
-
</Story>
|
|
238
|
-
</Canvas>
|
|
239
|
-
|
|
240
|
-
## Description List of Links
|
|
241
|
-
|
|
242
|
-
An example with HTML elements inside of the `dd` elements.
|
|
243
|
-
|
|
244
|
-
<Canvas>
|
|
245
|
-
<Story
|
|
246
|
-
name="Description List of Links"
|
|
247
|
-
args={{
|
|
248
|
-
noStyling: false,
|
|
249
|
-
title: "Details",
|
|
250
|
-
}}
|
|
251
|
-
argTypes={{
|
|
252
|
-
inline: { control: false },
|
|
253
|
-
noStyling: { control: false },
|
|
254
|
-
type: { table: { disable: true } },
|
|
255
|
-
}}
|
|
256
|
-
parameters={{
|
|
257
|
-
design: {
|
|
258
|
-
type: "figma",
|
|
259
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=10734%3A5178",
|
|
260
|
-
},
|
|
261
|
-
}}
|
|
262
|
-
>
|
|
263
|
-
{(args) => (
|
|
264
|
-
<List {...args} type="dl">
|
|
265
|
-
<dt>Authors</dt>
|
|
266
|
-
<dd>
|
|
267
|
-
<a href="#">Chirwa, Ephraim Wadonda, author</a>
|
|
268
|
-
<br />
|
|
269
|
-
<a href="#">Dorward, Andrew, author</a>
|
|
270
|
-
</dd>
|
|
271
|
-
<dt>Subjects</dt>
|
|
272
|
-
<dd>
|
|
273
|
-
<a href="#">Ackerbau</a>
|
|
274
|
-
<br />
|
|
275
|
-
<a href="#">Ackerbau.</a>
|
|
276
|
-
<br />
|
|
277
|
-
<a href="#">Africa.</a>
|
|
278
|
-
<br />
|
|
279
|
-
<a href="#">Afrika.</a>
|
|
280
|
-
<br />
|
|
281
|
-
<a href="#">Agrarsubvention</a>
|
|
282
|
-
<br />
|
|
283
|
-
<a href="#">Agrarsubvention.</a>
|
|
284
|
-
<br />
|
|
285
|
-
<a href="#">Agricultura -- Subvencions -- Malawi.</a>
|
|
286
|
-
<br />
|
|
287
|
-
<a href="#">Agricultural economics New.</a>
|
|
288
|
-
<br />
|
|
289
|
-
<a href="#">Agricultural subsidies</a>
|
|
290
|
-
<br />
|
|
291
|
-
<a href="#">Agricultural subsidies -- Developing countries.</a>
|
|
292
|
-
<br />
|
|
293
|
-
<a href="#">Agricultural subsidies -- Malawi.</a>
|
|
294
|
-
<br />
|
|
295
|
-
<a href="#">Agricultural subsidies.</a>
|
|
296
|
-
<br />
|
|
297
|
-
<a href="#">BUSINESS & ECONOMICS -- Industries</a>
|
|
298
|
-
<br />
|
|
299
|
-
</dd>
|
|
300
|
-
</List>
|
|
301
|
-
)}
|
|
302
|
-
</Story>
|
|
303
|
-
</Canvas>
|
|
304
|
-
|
|
305
|
-
## Lists with Data Props
|
|
306
|
-
|
|
307
|
-
If `li` or `dt`/`dd` elements cannot be passed as children to the `List` element,
|
|
308
|
-
an array with data can be passed into the `listItems` prop. Note: either
|
|
309
|
-
children elements or the `listItems` prop should be passed but not both.
|
|
310
|
-
|
|
311
|
-
### Unordered and Ordered
|
|
312
|
-
|
|
313
|
-
For lists of type `"ul"` (unorderd) or `"ol"` (ordered), `li` list item elements
|
|
314
|
-
can be passed as children. If that's not possible but the data to render is
|
|
315
|
-
stored as an array of strings, then that data array can be passed into `listItems`.
|
|
316
|
-
|
|
317
|
-
```jsx
|
|
318
|
-
<!-- With `li` elements -->
|
|
319
|
-
<List type={ul}>
|
|
320
|
-
<li>Mahi-mahi</li>
|
|
321
|
-
<li>Golden trout</li>
|
|
322
|
-
<li>Rainbowfish</li>
|
|
323
|
-
<li>Suckerfish</li>
|
|
324
|
-
</List>
|
|
325
|
-
|
|
326
|
-
<!-- With `itemList` data prop -->
|
|
327
|
-
const fishArray = ["Mahi-mahi", "Golden trout", "Rainbowfish", "Suckerfish"];
|
|
328
|
-
<List type={ul} listItems={fishArray} />
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### Description
|
|
332
|
-
|
|
333
|
-
For lists of type `"dl"` (description), `dt` and `dd` elements can be
|
|
334
|
-
passed as children. If that's not possible but the data to render is stored as
|
|
335
|
-
an array of objects, then that data array can be passed into `listItems`. The
|
|
336
|
-
object must have two keys, `term` and `description`.
|
|
337
|
-
|
|
338
|
-
```jsx
|
|
339
|
-
// With `dt`/`dd` elements
|
|
340
|
-
<List type="dl" title="Animal Crossing Fish">
|
|
341
|
-
<dt>Mahi-mahi</dt>
|
|
342
|
-
<dd>The mahi-mahi is an ocean fish known...</dd>
|
|
343
|
-
<dt>Golden trout</dt>
|
|
344
|
-
<dd>The golden trout is a beautifully colored fish...</dd>
|
|
345
|
-
<dt>Rainbowfish</dt>
|
|
346
|
-
<dd>The rainbowfish is a tropical fish known...</dd>
|
|
347
|
-
<dt>Suckerfish</dt>
|
|
348
|
-
<dd>The suckerfish is a curious fish that...</dd>
|
|
349
|
-
</List>
|
|
350
|
-
|
|
351
|
-
// With `itemList` data prop
|
|
352
|
-
const fishDescriptions = [
|
|
353
|
-
{
|
|
354
|
-
term: "Mahi-mahi",
|
|
355
|
-
description: "The mahi-mahi is an ocean fish known..."
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
term: "Golden trout",
|
|
359
|
-
description: "The golden trout is a beautifully colored fish..."
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
term: "Rainbowfish",
|
|
363
|
-
description: "The rainbowfish is a tropical fish known..."
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
term: "Suckerfish"
|
|
367
|
-
description: "he suckerfish is a curious fish that..."
|
|
368
|
-
}
|
|
369
|
-
];
|
|
370
|
-
<List
|
|
371
|
-
listItems={fishDescriptions}
|
|
372
|
-
title="Animal Crossing Fish"
|
|
373
|
-
type="dl"
|
|
374
|
-
/>
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
<Canvas>
|
|
378
|
-
<Story
|
|
379
|
-
name="List with Data Props"
|
|
380
|
-
args={{
|
|
381
|
-
listItems: animalCrossingDescriptions,
|
|
382
|
-
noStyling: false,
|
|
383
|
-
title: "Animal Crossing Fish",
|
|
384
|
-
}}
|
|
385
|
-
argTypes={{
|
|
386
|
-
inline: { control: false },
|
|
387
|
-
noStyling: { control: false },
|
|
388
|
-
type: { control: false },
|
|
389
|
-
}}
|
|
390
|
-
>
|
|
391
|
-
{(args) => <List {...args} type="dl" />}
|
|
392
|
-
</Story>
|
|
393
|
-
</Canvas>
|