@nypl/design-system-react-components 0.25.13 → 0.26.0
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 +58 -0
- package/README.md +10 -10
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Card/Card.d.ts +11 -9
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +5 -4
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -6
- package/dist/components/Fieldset/Fieldset.d.ts +5 -6
- package/dist/components/Form/Form.d.ts +6 -6
- package/dist/components/Grid/GridTypes.d.ts +7 -7
- package/dist/components/Grid/SimpleGrid.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +9 -8
- package/dist/components/Hero/Hero.d.ts +2 -1
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +2 -10
- package/dist/components/Icons/Icon.d.ts +2 -1
- package/dist/components/Image/Image.d.ts +2 -2
- package/dist/components/Label/Label.d.ts +7 -4
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/List/List.d.ts +11 -11
- package/dist/components/List/ListTypes.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts +2 -1
- package/dist/components/Logo/LogoSvgs.d.ts +2 -0
- package/dist/components/Logo/LogoTypes.d.ts +2 -0
- package/dist/components/Notification/Notification.d.ts +4 -4
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +3 -3
- package/dist/components/Radio/Radio.d.ts +4 -6
- package/dist/components/RadioGroup/RadioGroup.d.ts +12 -6
- package/dist/components/SearchBar/SearchBar.d.ts +4 -4
- package/dist/components/Select/Select.d.ts +10 -6
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
- package/dist/components/Slider/Slider.d.ts +6 -4
- package/dist/components/StatusBadge/StatusBadge.d.ts +5 -1
- package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +4 -3
- package/dist/components/Template/Template.d.ts +4 -3
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +5 -5
- package/dist/components/Toggle/Toggle.d.ts +3 -4
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +1663 -1139
- 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 +1667 -1143
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/hooks/useCarouselStyles.d.ts +3 -2
- package/dist/hooks/useNYPLTheme.d.ts +12 -0
- package/dist/index.d.ts +4 -1
- package/dist/styles.css +1 -1
- package/dist/theme/components/button.d.ts +10 -2
- package/dist/theme/components/card.d.ts +42 -22
- package/dist/theme/components/checkbox.d.ts +5 -4
- package/dist/theme/components/checkboxGroup.d.ts +1 -1
- package/dist/theme/components/componentWrapper.d.ts +2 -2
- package/dist/theme/components/customTable.d.ts +84 -1
- package/dist/theme/components/fieldset.d.ts +4 -14
- package/dist/theme/components/global.d.ts +23 -17
- package/dist/theme/components/heading.d.ts +53 -0
- package/dist/theme/components/helperErrorText.d.ts +1 -0
- package/dist/theme/components/hero.d.ts +20 -14
- package/dist/theme/components/label.d.ts +9 -10
- package/dist/theme/components/list.d.ts +99 -9
- package/dist/theme/components/radio.d.ts +6 -4
- package/dist/theme/components/radioGroup.d.ts +1 -1
- package/dist/theme/components/select.d.ts +34 -5
- package/dist/theme/components/skeletonLoader.d.ts +2 -2
- package/dist/theme/components/slider.d.ts +6 -3
- package/dist/theme/components/structuredContent.d.ts +197 -0
- package/dist/theme/components/textInput.d.ts +18 -6
- package/dist/theme/components/toggle.d.ts +7 -4
- package/dist/theme/foundations/global.d.ts +2 -0
- package/dist/theme/foundations/radii.d.ts +1 -0
- package/dist/theme/foundations/spacing.d.ts +46 -43
- package/package.json +5 -6
- package/src/components/Accordion/Accordion.stories.mdx +9 -9
- package/src/components/Accordion/Accordion.test.tsx +21 -0
- package/src/components/Accordion/Accordion.tsx +13 -9
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +276 -27
- package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -5
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +52 -31
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +8 -7
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +211 -12
- package/src/components/Button/Button.stories.mdx +87 -23
- package/src/components/Button/Button.test.tsx +25 -0
- package/src/components/Button/Button.tsx +18 -7
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +27 -7
- package/src/components/Card/Card.stories.mdx +287 -194
- package/src/components/Card/Card.test.tsx +102 -0
- package/src/components/Card/Card.tsx +73 -32
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +195 -35
- package/src/components/Chakra/Grid.stories.mdx +4 -4
- package/src/components/Checkbox/Checkbox.stories.mdx +62 -10
- package/src/components/Checkbox/Checkbox.test.tsx +32 -9
- package/src/components/Checkbox/Checkbox.tsx +20 -15
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +134 -7
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +65 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +137 -81
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +31 -21
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +332 -97
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +12 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +39 -41
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +47 -34
- package/src/components/DatePicker/DatePicker.stories.mdx +63 -27
- package/src/components/DatePicker/DatePicker.test.tsx +89 -13
- package/src/components/DatePicker/DatePicker.tsx +62 -56
- package/src/components/DatePicker/_DatePicker.scss +71 -13
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +250 -206
- package/src/components/Fieldset/Fieldset.stories.mdx +33 -3
- package/src/components/Fieldset/Fieldset.test.tsx +58 -28
- package/src/components/Fieldset/Fieldset.tsx +35 -30
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +40 -19
- package/src/components/Form/Form.stories.mdx +72 -39
- package/src/components/Form/Form.test.tsx +58 -15
- package/src/components/Form/Form.tsx +89 -67
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +83 -5
- package/src/components/Grid/GridTypes.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +34 -6
- package/src/components/Grid/SimpleGrid.test.tsx +9 -0
- package/src/components/Grid/SimpleGrid.tsx +29 -20
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +16 -1
- package/src/components/Heading/Heading.stories.mdx +36 -3
- package/src/components/Heading/Heading.test.tsx +10 -0
- package/src/components/Heading/Heading.tsx +56 -50
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +26 -7
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +64 -42
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +15 -0
- package/src/components/HelperErrorText/HelperErrorText.tsx +40 -35
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +35 -4
- package/src/components/Hero/Hero.stories.mdx +125 -95
- package/src/components/Hero/Hero.test.tsx +33 -0
- package/src/components/Hero/Hero.tsx +135 -126
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +89 -17
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +26 -4
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +9 -19
- package/src/components/HorizontalRule/HorizontalRule.tsx +9 -26
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +18 -5
- package/src/components/Icons/Icon.stories.mdx +31 -6
- package/src/components/Icons/Icon.test.tsx +38 -0
- package/src/components/Icons/Icon.tsx +93 -76
- package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +129 -0
- package/src/components/Image/Image.stories.mdx +29 -5
- package/src/components/Image/Image.test.tsx +8 -0
- package/src/components/Image/Image.tsx +38 -26
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
- package/src/components/Label/Label.stories.mdx +42 -20
- package/src/components/Label/Label.test.tsx +42 -17
- package/src/components/Label/Label.tsx +22 -13
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +19 -15
- package/src/components/Link/Link.stories.mdx +25 -1
- package/src/components/Link/Link.test.tsx +21 -0
- package/src/components/Link/Link.tsx +8 -8
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +37 -11
- package/src/components/List/List.stories.mdx +75 -40
- package/src/components/List/List.test.tsx +67 -19
- package/src/components/List/List.tsx +38 -25
- package/src/components/List/ListTypes.tsx +1 -1
- package/src/components/List/__snapshots__/List.test.tsx.snap +110 -8
- package/src/components/Logo/Logo.stories.mdx +30 -6
- package/src/components/Logo/Logo.test.tsx +17 -0
- package/src/components/Logo/Logo.tsx +18 -6
- package/src/components/Logo/LogoSvgs.tsx +4 -0
- package/src/components/Logo/LogoTypes.tsx +2 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +73 -2
- package/src/components/Modal/Modal.stories.mdx +13 -0
- package/src/components/Notification/Notification.stories.mdx +25 -1
- package/src/components/Notification/Notification.test.tsx +23 -0
- package/src/components/Notification/Notification.tsx +46 -44
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +158 -29
- package/src/components/Pagination/Pagination.stories.mdx +24 -4
- package/src/components/Pagination/Pagination.test.tsx +25 -0
- package/src/components/Pagination/Pagination.tsx +6 -6
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +244 -27
- package/src/components/Placeholder/Placeholder.tsx +3 -1
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +76 -10
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +81 -11
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -9
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +101 -14
- package/src/components/Radio/Radio.stories.mdx +64 -12
- package/src/components/Radio/Radio.test.tsx +28 -8
- package/src/components/Radio/Radio.tsx +66 -63
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +103 -6
- package/src/components/RadioGroup/RadioGroup.stories.mdx +224 -89
- package/src/components/RadioGroup/RadioGroup.test.tsx +122 -62
- package/src/components/RadioGroup/RadioGroup.tsx +106 -100
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1236 -1020
- package/src/components/SearchBar/SearchBar.stories.mdx +101 -36
- package/src/components/SearchBar/{SearchBar.Test.tsx → SearchBar.test.tsx} +46 -4
- package/src/components/SearchBar/SearchBar.tsx +17 -8
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1039 -0
- package/src/components/Select/Select.stories.mdx +128 -49
- package/src/components/Select/Select.test.tsx +63 -16
- package/src/components/Select/Select.tsx +125 -92
- package/src/components/Select/SelectTypes.tsx +5 -0
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +749 -409
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +42 -10
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +8 -0
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +76 -72
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +169 -10
- package/src/components/Slider/Slider.stories.mdx +91 -42
- package/src/components/Slider/Slider.test.tsx +65 -17
- package/src/components/Slider/Slider.tsx +26 -19
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +403 -226
- package/src/components/StatusBadge/StatusBadge.stories.mdx +19 -1
- package/src/components/StatusBadge/StatusBadge.test.tsx +16 -0
- package/src/components/StatusBadge/StatusBadge.tsx +25 -20
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +22 -3
- package/src/components/StructuredContent/StructuredContent.stories.mdx +131 -12
- package/src/components/StructuredContent/StructuredContent.test.tsx +34 -0
- package/src/components/StructuredContent/StructuredContent.tsx +80 -75
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +102 -17
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +5 -5
- package/src/components/StyleGuide/Breakpoints.stories.mdx +6 -6
- package/src/components/StyleGuide/Buttons.stories.mdx +2 -12
- package/src/components/StyleGuide/ColorCard.tsx +1 -1
- package/src/components/StyleGuide/Colors.stories.mdx +1 -2
- package/src/components/StyleGuide/DesignTokens.stories.mdx +56 -26
- package/src/components/StyleGuide/Forms.stories.mdx +27 -12
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -12
- package/src/components/StyleGuide/Spacing.stories.mdx +80 -41
- package/src/components/StyleGuide/Typography.stories.mdx +30 -21
- package/src/components/Table/Table.stories.mdx +38 -11
- package/src/components/Table/Table.test.tsx +15 -0
- package/src/components/Table/Table.tsx +7 -7
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +408 -5
- package/src/components/Tabs/Tabs.stories.mdx +52 -3
- package/src/components/Tabs/Tabs.test.tsx +16 -0
- package/src/components/Tabs/Tabs.tsx +10 -6
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +394 -5
- package/src/components/Template/Template.stories.mdx +47 -43
- package/src/components/Template/Template.test.tsx +33 -0
- package/src/components/Template/Template.tsx +65 -60
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +191 -20
- package/src/components/Text/Text.stories.mdx +20 -1
- package/src/components/Text/Text.test.tsx +12 -0
- package/src/components/Text/Text.tsx +6 -4
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +21 -4
- package/src/components/TextInput/TextInput.stories.mdx +65 -19
- package/src/components/TextInput/TextInput.test.tsx +42 -28
- package/src/components/TextInput/TextInput.tsx +121 -113
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +96 -73
- package/src/components/Toggle/Toggle.stories.mdx +80 -22
- package/src/components/Toggle/Toggle.test.tsx +27 -9
- package/src/components/Toggle/Toggle.tsx +22 -18
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +128 -5
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +52 -4
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +23 -0
- package/src/components/VideoPlayer/VideoPlayer.tsx +133 -126
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +81 -39
- package/src/docs/Chakra.stories.mdx +50 -9
- package/src/docs/Welcome.stories.mdx +160 -41
- package/src/hooks/useCarouselStyles.stories.mdx +22 -2
- package/src/hooks/useCarouselStyles.ts +3 -2
- package/src/hooks/useNYPLTheme.stories.mdx +101 -0
- package/src/hooks/useNYPLTheme.ts +30 -6
- package/src/hooks/useWindowSize.stories.mdx +23 -0
- package/src/index.ts +4 -1
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/theme/components/button.ts +15 -7
- package/src/theme/components/card.ts +30 -19
- package/src/theme/components/checkbox.ts +10 -8
- package/src/theme/components/checkboxGroup.ts +1 -1
- package/src/theme/components/componentWrapper.ts +2 -2
- package/src/theme/components/customTable.ts +39 -31
- package/src/theme/components/fieldset.ts +1 -2
- package/src/theme/components/global.ts +25 -20
- package/src/theme/components/heading.ts +1 -1
- package/src/theme/components/helperErrorText.ts +1 -0
- package/src/theme/components/hero.ts +13 -15
- package/src/theme/components/label.ts +4 -3
- package/src/theme/components/list.ts +73 -66
- package/src/theme/components/notification.ts +2 -2
- package/src/theme/components/radio.ts +9 -9
- package/src/theme/components/radioGroup.ts +1 -1
- package/src/theme/components/select.ts +35 -22
- package/src/theme/components/skeletonLoader.ts +3 -3
- package/src/theme/components/slider.ts +8 -7
- package/src/theme/components/statusBadge.ts +2 -2
- package/src/theme/components/structuredContent.ts +66 -1
- package/src/theme/components/tabs.ts +2 -2
- package/src/theme/components/template.ts +9 -9
- package/src/theme/components/textInput.ts +13 -12
- package/src/theme/components/toggle.ts +17 -10
- package/src/theme/components/videoPlayer.ts +1 -1
- package/src/theme/foundations/colors.ts +1 -1
- package/src/theme/foundations/radii.ts +1 -0
- package/src/theme/foundations/spacing.ts +70 -22
- package/src/theme/foundations/typography.ts +2 -2
- package/src/utils/componentCategories.ts +1 -2
- package/dist/components/SearchBar/SearchBar.Test.d.ts +0 -1
- package/dist/helpers/generateUUID.d.ts +0 -1
- package/src/helpers/generateUUID.tsx +0 -5
|
@@ -2,30 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`HorizontalRule renders the UI snapshot correctly 1`] = `
|
|
4
4
|
<hr
|
|
5
|
-
className="css-
|
|
5
|
+
className="css-mvtkpx"
|
|
6
6
|
/>
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
exports[`HorizontalRule renders the UI snapshot correctly 2`] = `
|
|
10
10
|
<hr
|
|
11
|
-
className="css-
|
|
11
|
+
className="css-j99tgf"
|
|
12
12
|
/>
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
exports[`HorizontalRule renders the UI snapshot correctly 3`] = `
|
|
16
16
|
<hr
|
|
17
|
-
className="css-
|
|
17
|
+
className="css-21sffo"
|
|
18
18
|
/>
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
exports[`HorizontalRule renders the UI snapshot correctly 4`] = `
|
|
22
22
|
<hr
|
|
23
|
-
className="css-
|
|
23
|
+
className="css-mvtkpx"
|
|
24
24
|
/>
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`HorizontalRule renders the UI snapshot correctly 5`] = `
|
|
28
28
|
<hr
|
|
29
|
-
className="css-
|
|
29
|
+
className="css-mvtkpx"
|
|
30
|
+
/>
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`HorizontalRule renders the UI snapshot correctly 6`] = `
|
|
34
|
+
<hr
|
|
35
|
+
className="css-1pg2j4r"
|
|
36
|
+
/>
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
exports[`HorizontalRule renders the UI snapshot correctly 7`] = `
|
|
40
|
+
<hr
|
|
41
|
+
className="css-mvtkpx"
|
|
42
|
+
data-testid="props"
|
|
30
43
|
/>
|
|
31
44
|
`;
|
|
@@ -91,10 +91,25 @@ export const rotationEnumValues = getStorybookEnumValues(
|
|
|
91
91
|
| Component Version | DS Version |
|
|
92
92
|
| ----------------- | ---------- |
|
|
93
93
|
| Added | `0.0.4` |
|
|
94
|
-
| Latest | `0.
|
|
94
|
+
| Latest | `0.26.0` |
|
|
95
|
+
|
|
96
|
+
## Table of Contents
|
|
97
|
+
|
|
98
|
+
- [Overview](#overview)
|
|
99
|
+
- [Component Props](#component-props)
|
|
100
|
+
- [Accessibility](#accessibility)
|
|
101
|
+
- [Rotation Types](#rotation-types)
|
|
102
|
+
- [IconColors Types](#icon-colors-types)
|
|
103
|
+
- [IconSizes Types](#icon-sizes-types)
|
|
104
|
+
- [All Display Icons](#all-display-icons)
|
|
105
|
+
- [Custom Icons](#custom-icons)
|
|
106
|
+
|
|
107
|
+
## Overview
|
|
95
108
|
|
|
96
109
|
<Description of={Icon} />
|
|
97
110
|
|
|
111
|
+
## Component Props
|
|
112
|
+
|
|
98
113
|
<Canvas withToolbar>
|
|
99
114
|
<Story
|
|
100
115
|
name="Icon with Controls"
|
|
@@ -214,11 +229,21 @@ export const allIconsType = (list) => (
|
|
|
214
229
|
|
|
215
230
|
## Accessibility
|
|
216
231
|
|
|
217
|
-
For accessibility purposes, every DS `Icon` will
|
|
218
|
-
its icon name in the `title` element. The default
|
|
219
|
-
is the icon's code name. Pass in better descriptive
|
|
220
|
-
when using the `Icon` component in your application.
|
|
221
|
-
a better descriptive title for the `svg` graphic.
|
|
232
|
+
For accessibility purposes, every Reservoir Design System (DS) `Icon` will
|
|
233
|
+
render the `svg` element with its icon name in the `title` element. The default
|
|
234
|
+
text in the `title` element is the icon's code name. Pass in better descriptive
|
|
235
|
+
text in the `title` prop when using the `Icon` component in your application.
|
|
236
|
+
This will give screenreaders a better descriptive title for the `svg` graphic.
|
|
237
|
+
|
|
238
|
+
`Icon`s are decorative by default. This means that they are presentational and
|
|
239
|
+
screenreaders will not read them because the `aria-hidden` attribute is set to
|
|
240
|
+
`true`.
|
|
241
|
+
|
|
242
|
+
Resources:
|
|
243
|
+
|
|
244
|
+
- [W3C Design System SVG Icons](https://design-system.w3.org/styles/svg-icons.html)
|
|
245
|
+
- [CSS-Tricks Accessible SVG Icons](https://css-tricks.com/accessible-svg-icons/)
|
|
246
|
+
- [Chakra UI Icon](https://chakra-ui.com/docs/components/media-and-icons/icon)
|
|
222
247
|
|
|
223
248
|
## Rotation Types
|
|
224
249
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { render } from "@testing-library/react";
|
|
3
3
|
import { axe } from "jest-axe";
|
|
4
|
+
import renderer from "react-test-renderer";
|
|
4
5
|
|
|
5
6
|
import Icon from "./Icon";
|
|
6
7
|
import { IconNames } from "./IconTypes";
|
|
@@ -87,4 +88,41 @@ describe("Icon", () => {
|
|
|
87
88
|
);
|
|
88
89
|
expect(container.querySelector("svg")).toBeInTheDocument();
|
|
89
90
|
});
|
|
91
|
+
|
|
92
|
+
it("renders the UI snapshot correctly", () => {
|
|
93
|
+
const basic = renderer
|
|
94
|
+
.create(<Icon id="basic" name={IconNames.Download} />)
|
|
95
|
+
.toJSON();
|
|
96
|
+
const customIcon = renderer
|
|
97
|
+
.create(
|
|
98
|
+
<Icon id="customIcon">
|
|
99
|
+
<svg viewBox="0 0 24 14" xmlns="http://www.w3.org/2000/svg">
|
|
100
|
+
<path
|
|
101
|
+
fillRule="evenodd"
|
|
102
|
+
clipRule="evenodd"
|
|
103
|
+
d="M10.526 12.871L.263 1.676 1.737.324 12 11.52 22.263.324l1.474 1.352L13.474 12.87a2 2 0 01-2.948 0z"
|
|
104
|
+
/>
|
|
105
|
+
</svg>
|
|
106
|
+
</Icon>
|
|
107
|
+
)
|
|
108
|
+
.toJSON();
|
|
109
|
+
const withChakraProps = renderer
|
|
110
|
+
.create(
|
|
111
|
+
<Icon
|
|
112
|
+
id="chakra"
|
|
113
|
+
name={IconNames.Download}
|
|
114
|
+
p="20px"
|
|
115
|
+
color="ui.error.primary"
|
|
116
|
+
/>
|
|
117
|
+
)
|
|
118
|
+
.toJSON();
|
|
119
|
+
const withOtherProps = renderer
|
|
120
|
+
.create(<Icon id="props" name={IconNames.Download} data-testid="props" />)
|
|
121
|
+
.toJSON();
|
|
122
|
+
|
|
123
|
+
expect(basic).toMatchSnapshot();
|
|
124
|
+
expect(customIcon).toMatchSnapshot();
|
|
125
|
+
expect(withChakraProps).toMatchSnapshot();
|
|
126
|
+
expect(withOtherProps).toMatchSnapshot();
|
|
127
|
+
});
|
|
90
128
|
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon as ChakraIcon,
|
|
3
|
+
Box,
|
|
4
|
+
chakra,
|
|
5
|
+
useStyleConfig,
|
|
6
|
+
} from "@chakra-ui/react";
|
|
1
7
|
import * as React from "react";
|
|
2
|
-
import { Icon as ChakraIcon, Box, useStyleConfig } from "@chakra-ui/react";
|
|
3
8
|
|
|
4
|
-
import generateUUID from "../../helpers/generateUUID";
|
|
5
9
|
import {
|
|
6
10
|
IconAlign,
|
|
7
11
|
IconColors,
|
|
@@ -43,82 +47,95 @@ export interface IconProps {
|
|
|
43
47
|
/**
|
|
44
48
|
* Renders SVG-based icons.
|
|
45
49
|
*/
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
export const Icon = chakra(
|
|
51
|
+
(props: React.PropsWithChildren<IconProps>) => {
|
|
52
|
+
const {
|
|
53
|
+
additionalStyles = {},
|
|
54
|
+
align = IconAlign.None,
|
|
55
|
+
children,
|
|
56
|
+
className,
|
|
57
|
+
color = IconColors.UiBlack,
|
|
58
|
+
decorative = true,
|
|
59
|
+
iconRotation = IconRotationTypes.Rotate0,
|
|
60
|
+
id,
|
|
61
|
+
name,
|
|
62
|
+
size = IconSizes.Default,
|
|
63
|
+
title = `${name} icon`,
|
|
64
|
+
type = IconTypes.Default,
|
|
65
|
+
...rest
|
|
66
|
+
} = props;
|
|
67
|
+
const styles = useStyleConfig("Icon", {
|
|
68
|
+
align,
|
|
69
|
+
color,
|
|
70
|
+
iconRotation,
|
|
71
|
+
size,
|
|
72
|
+
variant: type,
|
|
73
|
+
});
|
|
74
|
+
const iconProps = {
|
|
75
|
+
"aria-hidden": decorative,
|
|
76
|
+
className,
|
|
77
|
+
id,
|
|
78
|
+
role: "img",
|
|
79
|
+
title,
|
|
80
|
+
...rest,
|
|
81
|
+
};
|
|
82
|
+
let childSVG = null;
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
// Component prop validation
|
|
85
|
+
if (name && children) {
|
|
86
|
+
console.warn(
|
|
87
|
+
"NYPL Reservoir Icon: Pass in either a `name` prop or an `svg` element " +
|
|
88
|
+
"child. Do not pass both."
|
|
89
|
+
);
|
|
90
|
+
return null;
|
|
91
|
+
} else if (!name && !children) {
|
|
92
|
+
console.warn(
|
|
93
|
+
"NYPL Reservoir Icon: Pass an icon `name` prop or an SVG child to " +
|
|
94
|
+
"ensure an icon appears."
|
|
95
|
+
);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
// The user wants to render an existing icon. Load the icon and render it
|
|
100
|
+
// as a component through Chakra's Icon component. Otherwise, we're going to
|
|
101
|
+
// render the SVG child with NYPL-theme styling.
|
|
102
|
+
if (name) {
|
|
103
|
+
const SvgComponent: any = iconSvgs[name];
|
|
104
|
+
return (
|
|
105
|
+
<ChakraIcon
|
|
106
|
+
as={SvgComponent}
|
|
107
|
+
{...iconProps}
|
|
108
|
+
__css={{ ...styles, ...additionalStyles }}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
// If no `name` prop was passed, we expect a child SVG element to be passed.
|
|
114
|
+
// Apply icon props to the SVG child.
|
|
115
|
+
if (
|
|
116
|
+
(children as JSX.Element).type === "svg" ||
|
|
117
|
+
(children as JSX.Element).props?.type === "svg" ||
|
|
118
|
+
(children as JSX.Element).props?.mdxType === "svg"
|
|
119
|
+
) {
|
|
120
|
+
childSVG = React.cloneElement(children as JSX.Element, {
|
|
121
|
+
...iconProps,
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
console.warn(
|
|
125
|
+
"NYPL Reservoir Icon: An `svg` element must be passed to the `Icon` " +
|
|
126
|
+
"component as its child."
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<Box __css={styles} {...rest}>
|
|
132
|
+
{childSVG}
|
|
133
|
+
</Box>
|
|
120
134
|
);
|
|
121
|
-
}
|
|
135
|
+
},
|
|
136
|
+
// Pass all custom props to Chakra and override, e.g. we want the
|
|
137
|
+
// DS color prop to use the DS enum and not color strings.
|
|
138
|
+
{ shouldForwardProp: () => true }
|
|
139
|
+
);
|
|
122
140
|
|
|
123
|
-
|
|
124
|
-
}
|
|
141
|
+
export default Icon;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Icon renders the UI snapshot correctly 1`] = `
|
|
4
|
+
<svg
|
|
5
|
+
aria-hidden={true}
|
|
6
|
+
className="chakra-icon css-1grhd2q"
|
|
7
|
+
focusable={false}
|
|
8
|
+
id="basic"
|
|
9
|
+
role="img"
|
|
10
|
+
title="download icon"
|
|
11
|
+
viewBox="0 0 24 24"
|
|
12
|
+
>
|
|
13
|
+
<g
|
|
14
|
+
stroke="currentColor"
|
|
15
|
+
strokeWidth="1.5"
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
19
|
+
fill="none"
|
|
20
|
+
strokeLinecap="round"
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
24
|
+
fill="currentColor"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
/>
|
|
27
|
+
<circle
|
|
28
|
+
cx="12"
|
|
29
|
+
cy="12"
|
|
30
|
+
fill="none"
|
|
31
|
+
r="11.25"
|
|
32
|
+
strokeMiterlimit="10"
|
|
33
|
+
/>
|
|
34
|
+
</g>
|
|
35
|
+
</svg>
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
exports[`Icon renders the UI snapshot correctly 2`] = `
|
|
39
|
+
<div
|
|
40
|
+
className="css-0"
|
|
41
|
+
>
|
|
42
|
+
<svg
|
|
43
|
+
aria-hidden={true}
|
|
44
|
+
className="css-0"
|
|
45
|
+
id="customIcon"
|
|
46
|
+
role="img"
|
|
47
|
+
title="undefined icon"
|
|
48
|
+
viewBox="0 0 24 14"
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
>
|
|
51
|
+
<path
|
|
52
|
+
clipRule="evenodd"
|
|
53
|
+
d="M10.526 12.871L.263 1.676 1.737.324 12 11.52 22.263.324l1.474 1.352L13.474 12.87a2 2 0 01-2.948 0z"
|
|
54
|
+
fillRule="evenodd"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
exports[`Icon renders the UI snapshot correctly 3`] = `
|
|
61
|
+
<svg
|
|
62
|
+
aria-hidden={true}
|
|
63
|
+
className="chakra-icon css-7rufou"
|
|
64
|
+
focusable={false}
|
|
65
|
+
id="chakra"
|
|
66
|
+
role="img"
|
|
67
|
+
title="download icon"
|
|
68
|
+
viewBox="0 0 24 24"
|
|
69
|
+
>
|
|
70
|
+
<g
|
|
71
|
+
stroke="currentColor"
|
|
72
|
+
strokeWidth="1.5"
|
|
73
|
+
>
|
|
74
|
+
<path
|
|
75
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
76
|
+
fill="none"
|
|
77
|
+
strokeLinecap="round"
|
|
78
|
+
/>
|
|
79
|
+
<path
|
|
80
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
81
|
+
fill="currentColor"
|
|
82
|
+
strokeLinecap="round"
|
|
83
|
+
/>
|
|
84
|
+
<circle
|
|
85
|
+
cx="12"
|
|
86
|
+
cy="12"
|
|
87
|
+
fill="none"
|
|
88
|
+
r="11.25"
|
|
89
|
+
strokeMiterlimit="10"
|
|
90
|
+
/>
|
|
91
|
+
</g>
|
|
92
|
+
</svg>
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
exports[`Icon renders the UI snapshot correctly 4`] = `
|
|
96
|
+
<svg
|
|
97
|
+
aria-hidden={true}
|
|
98
|
+
className="chakra-icon css-1grhd2q"
|
|
99
|
+
data-testid="props"
|
|
100
|
+
focusable={false}
|
|
101
|
+
id="props"
|
|
102
|
+
role="img"
|
|
103
|
+
title="download icon"
|
|
104
|
+
viewBox="0 0 24 24"
|
|
105
|
+
>
|
|
106
|
+
<g
|
|
107
|
+
stroke="currentColor"
|
|
108
|
+
strokeWidth="1.5"
|
|
109
|
+
>
|
|
110
|
+
<path
|
|
111
|
+
d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
|
|
112
|
+
fill="none"
|
|
113
|
+
strokeLinecap="round"
|
|
114
|
+
/>
|
|
115
|
+
<path
|
|
116
|
+
d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
|
|
117
|
+
fill="currentColor"
|
|
118
|
+
strokeLinecap="round"
|
|
119
|
+
/>
|
|
120
|
+
<circle
|
|
121
|
+
cx="12"
|
|
122
|
+
cy="12"
|
|
123
|
+
fill="none"
|
|
124
|
+
r="11.25"
|
|
125
|
+
strokeMiterlimit="10"
|
|
126
|
+
/>
|
|
127
|
+
</g>
|
|
128
|
+
</svg>
|
|
129
|
+
`;
|
|
@@ -82,14 +82,26 @@ export const imageBlockStyles = {
|
|
|
82
82
|
| Component Version | DS Version |
|
|
83
83
|
| ----------------- | ---------- |
|
|
84
84
|
| Added | `0.0.6` |
|
|
85
|
-
| Latest | `0.
|
|
85
|
+
| Latest | `0.26.0` |
|
|
86
|
+
|
|
87
|
+
## Table of Contents
|
|
88
|
+
|
|
89
|
+
- [Overview](#overview)
|
|
90
|
+
- [Component Props](#component-props)
|
|
91
|
+
- [Accessibility](#accessibility)
|
|
92
|
+
- [Image Figure](#image-figure)
|
|
93
|
+
- [Image Sizes](#image-sizes)
|
|
94
|
+
- [Image Aspect Ratios](#image-aspect-ratios)
|
|
95
|
+
- [Image Types](#image-types)
|
|
96
|
+
|
|
97
|
+
## Overview
|
|
86
98
|
|
|
87
99
|
<Description of={Image} />
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
If you want a simple HTML `img` element then don't pass in values for the
|
|
102
|
+
`aspectRatio` or `size` props.
|
|
103
|
+
|
|
104
|
+
## Component Props
|
|
93
105
|
|
|
94
106
|
<Canvas>
|
|
95
107
|
<Story
|
|
@@ -122,6 +134,18 @@ export const imageBlockStyles = {
|
|
|
122
134
|
|
|
123
135
|
<ArgsTable story="Image with Controls" />
|
|
124
136
|
|
|
137
|
+
## Accessibility
|
|
138
|
+
|
|
139
|
+
All images must have an `alt` attribute, even if it's empty. The `alt` prop should
|
|
140
|
+
be used to concisely describe the image. If the image is decorative, then the
|
|
141
|
+
`alt` prop should be an empty string `""`.
|
|
142
|
+
|
|
143
|
+
Resources:
|
|
144
|
+
|
|
145
|
+
- [W3C WAI Images Tutorial](https://www.w3.org/WAI/tutorials/images/)
|
|
146
|
+
- [WebAIM Accessible Images](https://webaim.org/techniques/images/)
|
|
147
|
+
- [Yale Usability & Web Accessibility](https://usability.yale.edu/web-accessibility/articles/images)
|
|
148
|
+
|
|
125
149
|
## Image Figure
|
|
126
150
|
|
|
127
151
|
By passing in `credit` or `caption`, the `Image` component will
|
|
@@ -139,6 +139,12 @@ describe("Image", () => {
|
|
|
139
139
|
/>
|
|
140
140
|
)
|
|
141
141
|
.toJSON();
|
|
142
|
+
const withChakraProps = renderer
|
|
143
|
+
.create(<Image src="test.png" alt="" p="20px" color="ui.error.primary" />)
|
|
144
|
+
.toJSON();
|
|
145
|
+
const withOtherProps = renderer
|
|
146
|
+
.create(<Image src="test.png" alt="" data-testid="image" />)
|
|
147
|
+
.toJSON();
|
|
142
148
|
|
|
143
149
|
expect(basic).toMatchSnapshot();
|
|
144
150
|
expect(figCaption).toMatchSnapshot();
|
|
@@ -158,5 +164,7 @@ describe("Image", () => {
|
|
|
158
164
|
expect(ratioThreeByTwo).toMatchSnapshot();
|
|
159
165
|
expect(ratioTwoByOne).toMatchSnapshot();
|
|
160
166
|
expect(typeCircle).toMatchSnapshot();
|
|
167
|
+
expect(withChakraProps).toMatchSnapshot();
|
|
168
|
+
expect(withOtherProps).toMatchSnapshot();
|
|
161
169
|
});
|
|
162
170
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box, useMultiStyleConfig } from "@chakra-ui/react";
|
|
1
|
+
import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
import { ImageRatios, ImageSizes, ImageTypes } from "./ImageTypes";
|
|
@@ -55,31 +55,35 @@ export interface ImageProps extends ImageWrapperProps {
|
|
|
55
55
|
src: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
58
|
+
const ImageWrapper = chakra(
|
|
59
|
+
(props: React.PropsWithChildren<ImageWrapperProps>) => {
|
|
60
|
+
const {
|
|
61
|
+
additionalWrapperStyles = {},
|
|
62
|
+
className = "",
|
|
63
|
+
children,
|
|
64
|
+
aspectRatio = ImageRatios.Original,
|
|
65
|
+
size = ImageSizes.Default,
|
|
66
|
+
...rest
|
|
67
|
+
} = props;
|
|
68
|
+
const styles = useMultiStyleConfig("CustomImageWrapper", {
|
|
69
|
+
ratio: aspectRatio,
|
|
70
|
+
size,
|
|
71
|
+
});
|
|
72
|
+
return (
|
|
73
|
+
<Box
|
|
74
|
+
className={`the-wrap ${className}`}
|
|
75
|
+
__css={{ ...styles, ...additionalWrapperStyles }}
|
|
76
|
+
{...rest}
|
|
77
|
+
>
|
|
78
|
+
<Box className="the-crop" __css={styles.crop}>
|
|
79
|
+
{children}
|
|
80
|
+
</Box>
|
|
77
81
|
</Box>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
81
85
|
|
|
82
|
-
export
|
|
86
|
+
export const Image = chakra((props: ImageProps) => {
|
|
83
87
|
const {
|
|
84
88
|
additionalFigureStyles = {},
|
|
85
89
|
additionalImageStyles = {},
|
|
@@ -93,6 +97,7 @@ export default function Image(props: ImageProps) {
|
|
|
93
97
|
imageType = ImageTypes.Default,
|
|
94
98
|
size = ImageSizes.Default,
|
|
95
99
|
src,
|
|
100
|
+
...rest
|
|
96
101
|
} = props;
|
|
97
102
|
const useImageWrapper = aspectRatio !== ImageRatios.Original;
|
|
98
103
|
const styles = useMultiStyleConfig("CustomImage", {
|
|
@@ -122,6 +127,7 @@ export default function Image(props: ImageProps) {
|
|
|
122
127
|
aspectRatio={aspectRatio}
|
|
123
128
|
className={className}
|
|
124
129
|
size={size}
|
|
130
|
+
{...(caption || credit ? {} : rest)}
|
|
125
131
|
>
|
|
126
132
|
{imageComponent}
|
|
127
133
|
</ImageWrapper>
|
|
@@ -130,7 +136,11 @@ export default function Image(props: ImageProps) {
|
|
|
130
136
|
);
|
|
131
137
|
|
|
132
138
|
return caption || credit ? (
|
|
133
|
-
<Box
|
|
139
|
+
<Box
|
|
140
|
+
as="figure"
|
|
141
|
+
__css={{ ...styles.figure, ...additionalFigureStyles }}
|
|
142
|
+
{...rest}
|
|
143
|
+
>
|
|
134
144
|
{finalImage}
|
|
135
145
|
<Box as="figcaption" __css={styles.figcaption}>
|
|
136
146
|
{caption && <Box __css={styles.captionWrappers}>{caption}</Box>}
|
|
@@ -140,4 +150,6 @@ export default function Image(props: ImageProps) {
|
|
|
140
150
|
) : (
|
|
141
151
|
finalImage
|
|
142
152
|
);
|
|
143
|
-
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export default Image;
|