@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
|
@@ -104,6 +104,7 @@ declare const CustomImage: {
|
|
|
104
104
|
baseStyle: ({ size }: CustomImageBaseStyle) => {
|
|
105
105
|
figure: {
|
|
106
106
|
img: {
|
|
107
|
+
backgroundColor: string;
|
|
107
108
|
marginBottom: string;
|
|
108
109
|
};
|
|
109
110
|
maxWidth: string;
|
|
@@ -111,6 +112,7 @@ declare const CustomImage: {
|
|
|
111
112
|
width: string;
|
|
112
113
|
} | {
|
|
113
114
|
img: {
|
|
115
|
+
backgroundColor: string;
|
|
114
116
|
marginBottom: string;
|
|
115
117
|
};
|
|
116
118
|
maxWidth: string;
|
|
@@ -120,6 +122,7 @@ declare const CustomImage: {
|
|
|
120
122
|
width: string;
|
|
121
123
|
} | {
|
|
122
124
|
img: {
|
|
125
|
+
backgroundColor: string;
|
|
123
126
|
marginBottom: string;
|
|
124
127
|
};
|
|
125
128
|
maxWidth: string;
|
|
@@ -129,6 +132,7 @@ declare const CustomImage: {
|
|
|
129
132
|
width: string;
|
|
130
133
|
} | {
|
|
131
134
|
img: {
|
|
135
|
+
backgroundColor: string;
|
|
132
136
|
marginBottom: string;
|
|
133
137
|
};
|
|
134
138
|
maxWidth: string;
|
|
@@ -138,6 +142,7 @@ declare const CustomImage: {
|
|
|
138
142
|
width: string;
|
|
139
143
|
} | {
|
|
140
144
|
img: {
|
|
145
|
+
backgroundColor: string;
|
|
141
146
|
marginBottom: string;
|
|
142
147
|
};
|
|
143
148
|
maxWidth: string;
|
|
@@ -147,6 +152,7 @@ declare const CustomImage: {
|
|
|
147
152
|
width: string;
|
|
148
153
|
} | {
|
|
149
154
|
img: {
|
|
155
|
+
backgroundColor: string;
|
|
150
156
|
marginBottom: string;
|
|
151
157
|
};
|
|
152
158
|
maxWidth: string;
|
|
@@ -162,6 +168,7 @@ declare const CustomImage: {
|
|
|
162
168
|
img: {
|
|
163
169
|
maxWidth: string;
|
|
164
170
|
display: string;
|
|
171
|
+
backgroundColor: string;
|
|
165
172
|
boxSizing: string;
|
|
166
173
|
objectFit: string;
|
|
167
174
|
position: string;
|
|
@@ -171,6 +178,7 @@ declare const CustomImage: {
|
|
|
171
178
|
marginLeft: string;
|
|
172
179
|
marginRight: string;
|
|
173
180
|
display: string;
|
|
181
|
+
backgroundColor: string;
|
|
174
182
|
boxSizing: string;
|
|
175
183
|
objectFit: string;
|
|
176
184
|
position: string;
|
|
@@ -180,6 +188,7 @@ declare const CustomImage: {
|
|
|
180
188
|
marginLeft: string;
|
|
181
189
|
marginRight: string;
|
|
182
190
|
display: string;
|
|
191
|
+
backgroundColor: string;
|
|
183
192
|
boxSizing: string;
|
|
184
193
|
objectFit: string;
|
|
185
194
|
position: string;
|
|
@@ -189,6 +198,7 @@ declare const CustomImage: {
|
|
|
189
198
|
marginLeft: string;
|
|
190
199
|
marginRight: string;
|
|
191
200
|
display: string;
|
|
201
|
+
backgroundColor: string;
|
|
192
202
|
boxSizing: string;
|
|
193
203
|
objectFit: string;
|
|
194
204
|
position: string;
|
|
@@ -198,6 +208,7 @@ declare const CustomImage: {
|
|
|
198
208
|
marginLeft: string;
|
|
199
209
|
marginRight: string;
|
|
200
210
|
display: string;
|
|
211
|
+
backgroundColor: string;
|
|
201
212
|
boxSizing: string;
|
|
202
213
|
objectFit: string;
|
|
203
214
|
position: string;
|
|
@@ -207,6 +218,7 @@ declare const CustomImage: {
|
|
|
207
218
|
marginLeft: string;
|
|
208
219
|
marginRight: string;
|
|
209
220
|
display: string;
|
|
221
|
+
backgroundColor: string;
|
|
210
222
|
boxSizing: string;
|
|
211
223
|
objectFit: string;
|
|
212
224
|
position: string;
|
|
@@ -269,6 +281,7 @@ declare const CustomImageWrapper: {
|
|
|
269
281
|
overflow: string;
|
|
270
282
|
};
|
|
271
283
|
img: {
|
|
284
|
+
backgroundColor: string;
|
|
272
285
|
height: string;
|
|
273
286
|
left: string;
|
|
274
287
|
maxWidth: string;
|
|
@@ -330,6 +343,7 @@ declare const CustomImageWrapper: {
|
|
|
330
343
|
overflow: string;
|
|
331
344
|
};
|
|
332
345
|
img: {
|
|
346
|
+
backgroundColor: string;
|
|
333
347
|
height: string;
|
|
334
348
|
left: string;
|
|
335
349
|
maxWidth: string;
|
|
@@ -391,6 +405,7 @@ declare const CustomImageWrapper: {
|
|
|
391
405
|
overflow: string;
|
|
392
406
|
};
|
|
393
407
|
img: {
|
|
408
|
+
backgroundColor: string;
|
|
394
409
|
height: string;
|
|
395
410
|
left: string;
|
|
396
411
|
maxWidth: string;
|
|
@@ -452,6 +467,7 @@ declare const CustomImageWrapper: {
|
|
|
452
467
|
overflow: string;
|
|
453
468
|
};
|
|
454
469
|
img: {
|
|
470
|
+
backgroundColor: string;
|
|
455
471
|
height: string;
|
|
456
472
|
left: string;
|
|
457
473
|
maxWidth: string;
|
|
@@ -513,6 +529,7 @@ declare const CustomImageWrapper: {
|
|
|
513
529
|
overflow: string;
|
|
514
530
|
};
|
|
515
531
|
img: {
|
|
532
|
+
backgroundColor: string;
|
|
516
533
|
height: string;
|
|
517
534
|
left: string;
|
|
518
535
|
maxWidth: string;
|
|
@@ -574,6 +591,7 @@ declare const CustomImageWrapper: {
|
|
|
574
591
|
overflow: string;
|
|
575
592
|
};
|
|
576
593
|
img: {
|
|
594
|
+
backgroundColor: string;
|
|
577
595
|
height: string;
|
|
578
596
|
left: string;
|
|
579
597
|
maxWidth: string;
|
|
@@ -8,6 +8,7 @@ declare const Radio: {
|
|
|
8
8
|
border: string;
|
|
9
9
|
borderRadius: string;
|
|
10
10
|
borderColor: string;
|
|
11
|
+
backgroundColor: string;
|
|
11
12
|
color: string;
|
|
12
13
|
outline: string;
|
|
13
14
|
_checked: {
|
|
@@ -80,6 +81,14 @@ declare const Radio: {
|
|
|
80
81
|
fontStyle: string;
|
|
81
82
|
};
|
|
82
83
|
};
|
|
84
|
+
hiddenLabel: {
|
|
85
|
+
clip: string;
|
|
86
|
+
height: string;
|
|
87
|
+
overflow: string;
|
|
88
|
+
position: string;
|
|
89
|
+
width: string;
|
|
90
|
+
wordWrap: string;
|
|
91
|
+
};
|
|
83
92
|
};
|
|
84
93
|
sizes: {
|
|
85
94
|
md: {
|
|
@@ -26,6 +26,10 @@ declare const Select: {
|
|
|
26
26
|
borderRadius: string;
|
|
27
27
|
borderColor: string;
|
|
28
28
|
fontSize: string;
|
|
29
|
+
minHeight: {
|
|
30
|
+
base: string;
|
|
31
|
+
md: string;
|
|
32
|
+
};
|
|
29
33
|
paddingTop: string;
|
|
30
34
|
paddingRight: string;
|
|
31
35
|
paddingBottom: string;
|
|
@@ -72,11 +76,6 @@ declare const Select: {
|
|
|
72
76
|
borderRightRadius: {
|
|
73
77
|
md: string;
|
|
74
78
|
};
|
|
75
|
-
_hover: {
|
|
76
|
-
borderRightColor: {
|
|
77
|
-
md: string;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
79
|
};
|
|
81
80
|
};
|
|
82
81
|
};
|
|
@@ -179,46 +179,146 @@ declare const StructuredContent: {
|
|
|
179
179
|
table: {
|
|
180
180
|
width: string;
|
|
181
181
|
th: {
|
|
182
|
-
border: string;
|
|
183
|
-
borderBottom: string;
|
|
184
182
|
color: string;
|
|
185
|
-
fontSize: string;
|
|
186
183
|
fontWeight: string;
|
|
187
|
-
letterSpacing: string;
|
|
188
|
-
paddingLeft: number;
|
|
189
|
-
paddingRight: string;
|
|
190
184
|
textTransform: string;
|
|
191
185
|
_first: {
|
|
192
|
-
paddingLeft:
|
|
186
|
+
paddingLeft: {
|
|
187
|
+
base: string;
|
|
188
|
+
md: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
border: string;
|
|
192
|
+
borderBottom: string;
|
|
193
|
+
borderColor: {
|
|
194
|
+
base: string;
|
|
195
|
+
md: string;
|
|
196
|
+
};
|
|
197
|
+
display: {
|
|
198
|
+
base: string;
|
|
199
|
+
md: string;
|
|
200
|
+
};
|
|
201
|
+
fontSize: {
|
|
202
|
+
base: string;
|
|
203
|
+
lg: string;
|
|
204
|
+
};
|
|
205
|
+
gap: string;
|
|
206
|
+
letterSpacing: string;
|
|
207
|
+
lineHeight: number;
|
|
208
|
+
paddingBottom: {
|
|
209
|
+
base: string;
|
|
210
|
+
md: string;
|
|
211
|
+
};
|
|
212
|
+
paddingLeft: number;
|
|
213
|
+
paddingRight: {
|
|
214
|
+
base: string;
|
|
215
|
+
md: string;
|
|
216
|
+
};
|
|
217
|
+
paddingTop: {
|
|
218
|
+
base: string;
|
|
219
|
+
md: string;
|
|
193
220
|
};
|
|
194
221
|
_last: {
|
|
222
|
+
paddingRight: {
|
|
223
|
+
base: string;
|
|
224
|
+
md: string;
|
|
225
|
+
};
|
|
226
|
+
borderBottom: string;
|
|
227
|
+
borderColor: {
|
|
228
|
+
base: string;
|
|
229
|
+
md: string;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
"> span": {
|
|
233
|
+
flexBasis: string;
|
|
234
|
+
paddingBottom: {
|
|
235
|
+
base: string;
|
|
236
|
+
md: string;
|
|
237
|
+
};
|
|
195
238
|
paddingRight: string;
|
|
239
|
+
paddingTop: {
|
|
240
|
+
base: string;
|
|
241
|
+
md: string;
|
|
242
|
+
};
|
|
243
|
+
_first: {
|
|
244
|
+
bg: string;
|
|
245
|
+
color: string;
|
|
246
|
+
fontWeight: string;
|
|
247
|
+
paddingLeft: string;
|
|
248
|
+
};
|
|
196
249
|
};
|
|
197
250
|
textAlign: string;
|
|
198
251
|
paddingInlineStart: string;
|
|
199
252
|
paddingInlineEnd: string;
|
|
200
|
-
paddingTop: string;
|
|
201
|
-
paddingBottom: string;
|
|
202
|
-
lineHeight: string;
|
|
203
253
|
};
|
|
204
254
|
td: {
|
|
255
|
+
_first: {
|
|
256
|
+
paddingLeft: {
|
|
257
|
+
base: string;
|
|
258
|
+
md: string;
|
|
259
|
+
};
|
|
260
|
+
};
|
|
261
|
+
_last: {
|
|
262
|
+
borderBottom: {
|
|
263
|
+
base: number;
|
|
264
|
+
md: string;
|
|
265
|
+
};
|
|
266
|
+
borderColor: {
|
|
267
|
+
base: string;
|
|
268
|
+
md: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
205
271
|
border: string;
|
|
206
272
|
borderBottom: string;
|
|
273
|
+
borderColor: {
|
|
274
|
+
base: string;
|
|
275
|
+
md: string;
|
|
276
|
+
};
|
|
277
|
+
display: {
|
|
278
|
+
base: string;
|
|
279
|
+
md: string;
|
|
280
|
+
};
|
|
281
|
+
fontSize: {
|
|
282
|
+
base: string;
|
|
283
|
+
lg: string;
|
|
284
|
+
};
|
|
285
|
+
gap: string;
|
|
207
286
|
letterSpacing: string;
|
|
287
|
+
lineHeight: number;
|
|
288
|
+
paddingBottom: {
|
|
289
|
+
base: string;
|
|
290
|
+
md: string;
|
|
291
|
+
};
|
|
208
292
|
paddingLeft: number;
|
|
209
|
-
paddingRight:
|
|
210
|
-
|
|
211
|
-
|
|
293
|
+
paddingRight: {
|
|
294
|
+
base: string;
|
|
295
|
+
md: string;
|
|
212
296
|
};
|
|
213
|
-
|
|
297
|
+
paddingTop: {
|
|
298
|
+
base: string;
|
|
299
|
+
md: string;
|
|
300
|
+
};
|
|
301
|
+
"> span": {
|
|
302
|
+
flexBasis: string;
|
|
303
|
+
paddingBottom: {
|
|
304
|
+
base: string;
|
|
305
|
+
md: string;
|
|
306
|
+
};
|
|
214
307
|
paddingRight: string;
|
|
308
|
+
paddingTop: {
|
|
309
|
+
base: string;
|
|
310
|
+
md: string;
|
|
311
|
+
};
|
|
312
|
+
_first: {
|
|
313
|
+
bg: string;
|
|
314
|
+
color: string;
|
|
315
|
+
fontWeight: string;
|
|
316
|
+
paddingLeft: string;
|
|
317
|
+
};
|
|
215
318
|
};
|
|
216
319
|
textAlign: string;
|
|
217
320
|
paddingInlineStart: string;
|
|
218
321
|
paddingInlineEnd: string;
|
|
219
|
-
paddingTop: string;
|
|
220
|
-
paddingBottom: string;
|
|
221
|
-
lineHeight: string;
|
|
222
322
|
};
|
|
223
323
|
};
|
|
224
324
|
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
interface TextBaseStyle {
|
|
2
2
|
isBold: boolean;
|
|
3
3
|
isItalic: boolean;
|
|
4
|
+
isCapitalized: boolean;
|
|
5
|
+
isUppercase: boolean;
|
|
6
|
+
isLowercase: boolean;
|
|
4
7
|
noSpace: boolean;
|
|
5
8
|
variant: string;
|
|
6
9
|
}
|
|
7
10
|
declare const Text: {
|
|
8
|
-
baseStyle: ({ isBold, isItalic, noSpace, variant }: TextBaseStyle) => {
|
|
11
|
+
baseStyle: ({ isBold, isItalic, isCapitalized, isUppercase, isLowercase, noSpace, variant, }: TextBaseStyle) => {
|
|
9
12
|
fontStyle: string;
|
|
10
13
|
fontWeight: string;
|
|
14
|
+
textTransform: string;
|
|
11
15
|
marginBottom: string;
|
|
12
16
|
};
|
|
13
17
|
variants: {
|
package/dist/theme/provider.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { ChakraProviderProps } from "@chakra-ui/react";
|
|
3
|
+
declare const DSProvider: ({ children, colorModeManager, }: React.PropsWithChildren<ChakraProviderProps>) => JSX.Element;
|
|
3
4
|
export default DSProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nypl/design-system-react-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "NYPL Reservoir Design System React Components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"module": "dist/design-system-react-components.esm.js",
|
|
12
12
|
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
"src"
|
|
13
|
+
"dist"
|
|
15
14
|
],
|
|
16
15
|
"engines": {
|
|
17
16
|
"node": ">10"
|
|
@@ -59,13 +58,14 @@
|
|
|
59
58
|
"dependencies": {
|
|
60
59
|
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
|
|
61
60
|
"@chakra-ui/system": ">=1.11.0 <=1.12.1",
|
|
61
|
+
"@charlietango/use-native-lazy-loading": "1.10.0",
|
|
62
62
|
"@emotion/react": ">=11.4.1",
|
|
63
63
|
"@emotion/styled": ">=11.3.0",
|
|
64
64
|
"framer-motion": "^4.1.17",
|
|
65
|
-
"he": "1.2.0",
|
|
66
65
|
"react-datepicker": "4.1.1",
|
|
66
|
+
"react-intersection-observer": "9.2.2",
|
|
67
67
|
"system-font-css": "2.0.2",
|
|
68
|
-
"typescript": "
|
|
68
|
+
"typescript": "*"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
|
|
@@ -74,21 +74,22 @@
|
|
|
74
74
|
"@emotion/styled": ">=11.3.0",
|
|
75
75
|
"framer-motion": "^4.1.17",
|
|
76
76
|
"react": ">=16.13.0",
|
|
77
|
-
"react-dom": ">=16.13.0"
|
|
77
|
+
"react-dom": ">=16.13.0",
|
|
78
|
+
"typescript": "*"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
81
|
"@babel/core": "7.14.6",
|
|
81
82
|
"@chakra-ui/storybook-addon": "1.0.3",
|
|
82
83
|
"@mdx-js/react": "1.6.22",
|
|
83
84
|
"@size-limit/preset-small-lib": "5.0.1",
|
|
84
|
-
"@storybook/addon-a11y": "6.
|
|
85
|
-
"@storybook/addon-actions": "6.
|
|
86
|
-
"@storybook/addon-docs": "6.
|
|
87
|
-
"@storybook/addon-essentials": "6.
|
|
88
|
-
"@storybook/addon-jest": "6.
|
|
89
|
-
"@storybook/addon-links": "6.
|
|
90
|
-
"@storybook/addons": "6.
|
|
91
|
-
"@storybook/react": "6.
|
|
85
|
+
"@storybook/addon-a11y": "6.5.7",
|
|
86
|
+
"@storybook/addon-actions": "6.5.7",
|
|
87
|
+
"@storybook/addon-docs": "6.5.7",
|
|
88
|
+
"@storybook/addon-essentials": "6.5.7",
|
|
89
|
+
"@storybook/addon-jest": "6.5.7",
|
|
90
|
+
"@storybook/addon-links": "6.5.7",
|
|
91
|
+
"@storybook/addons": "6.5.7",
|
|
92
|
+
"@storybook/react": "6.5.7",
|
|
92
93
|
"@svgr/rollup": "5.5.0",
|
|
93
94
|
"@svgr/webpack": "5.5.0",
|
|
94
95
|
"@testing-library/jest-dom": "5.14.1",
|
|
@@ -112,7 +113,7 @@
|
|
|
112
113
|
"eslint-config-react-app": "6.0.0",
|
|
113
114
|
"eslint-plugin-flowtype": "5.8.2",
|
|
114
115
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
115
|
-
"eslint-plugin-storybook": "
|
|
116
|
+
"eslint-plugin-storybook": "0.5.12",
|
|
116
117
|
"gulp": "4.0.2",
|
|
117
118
|
"gulp-concat": "^2.6.1",
|
|
118
119
|
"husky": "^7.0.4",
|
|
@@ -133,7 +134,6 @@
|
|
|
133
134
|
"rollup-plugin-svg": "2.0.0",
|
|
134
135
|
"sass": "1.35.1",
|
|
135
136
|
"sass-loader": "10.0.0",
|
|
136
|
-
"semantic-release-slack-bot": "2.1.0",
|
|
137
137
|
"size-limit": "5.0.1",
|
|
138
138
|
"storybook-addon-designs": "6.2.1",
|
|
139
139
|
"style-loader": "2.0.0",
|
package/src/__tests__/setup.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
import "@testing-library/jest-dom";
|
|
3
|
-
// Import this to be able to call this jest-axe assertion for all test files:
|
|
4
|
-
// expect(...).toHaveNoViolations();
|
|
5
|
-
import "jest-axe/extend-expect";
|
|
6
|
-
|
|
7
|
-
const { JSDOM } = require("jsdom");
|
|
8
|
-
|
|
9
|
-
const jsdom = new JSDOM("<!doctype html><html><body></body></html>", {
|
|
10
|
-
url: "http://localhost",
|
|
11
|
-
});
|
|
12
|
-
const { window } = jsdom;
|
|
13
|
-
const exposedProperties = ["window", "navigator", "document"];
|
|
14
|
-
|
|
15
|
-
(global as any).window = window;
|
|
16
|
-
(global as any).document = window.document;
|
|
17
|
-
Object.keys((document as Document).defaultView).forEach((property) => {
|
|
18
|
-
if (typeof (global as any)[property] === "undefined") {
|
|
19
|
-
exposedProperties.push(property);
|
|
20
|
-
(global as any)[property] = (document as any).defaultView[property];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// We expect an error to be thrown and we do catch, but it still gets
|
|
25
|
-
// logged and we don't want to see expected errors while we test.
|
|
26
|
-
jest.spyOn(global.console, "error").mockImplementation(() => jest.fn());
|
|
27
|
-
jest.spyOn(global.console, "warn").mockImplementation(() => jest.fn());
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { range } from "../../utils/utils";
|
|
2
|
-
|
|
3
|
-
describe("range", () => {
|
|
4
|
-
it("returns an array of values not including the stop argument", () => {
|
|
5
|
-
expect(range(1, 2)).toEqual([1]);
|
|
6
|
-
expect(range(4, 7)).toEqual([4, 5, 6]);
|
|
7
|
-
expect(range(2, 9)).toEqual([2, 3, 4, 5, 6, 7, 8]);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("returns an array of values skipping by the step argument", () => {
|
|
11
|
-
expect(range(1, 10, 2)).toEqual([1, 3, 5, 7, 9]);
|
|
12
|
-
expect(range(4, 8, 3)).toEqual([4, 7]);
|
|
13
|
-
expect(range(2, 20, 2)).toEqual([2, 4, 6, 8, 10, 12, 14, 16, 18]);
|
|
14
|
-
expect(range(2, 20, 4)).toEqual([2, 6, 10, 14, 18]);
|
|
15
|
-
expect(range(2, 6, 2)).toEqual([2, 4]);
|
|
16
|
-
expect(range(2, 20, 5)).toEqual([2, 7, 12, 17]);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Meta } from "@storybook/addon-docs";
|
|
2
|
-
|
|
3
|
-
import { getCategory } from "../../utils/componentCategories";
|
|
4
|
-
|
|
5
|
-
<Meta title={getCategory("Skip Navigation")} />
|
|
6
|
-
|
|
7
|
-
# Skip Navigation
|
|
8
|
-
|
|
9
|
-
| Table of Contents |
|
|
10
|
-
| ---------------------------------------------- |
|
|
11
|
-
| 1. [General Information](#general-information) |
|
|
12
|
-
| 2. [Resources](#resources) |
|
|
13
|
-
|
|
14
|
-
## General Information
|
|
15
|
-
|
|
16
|
-
An application's "skip navigation" is used to skip to the primary or main
|
|
17
|
-
content of a page. This component usually contains one link that is located at
|
|
18
|
-
the top of the page and is visually hidden until a user focuses on the link.
|
|
19
|
-
In the case of NYPL applications, the skip navigation contains two links; the
|
|
20
|
-
first link points to the main content of the page and the second link points to
|
|
21
|
-
accessibility information on [NYPL.org/accessibility](https://nypl.org/accessibility).
|
|
22
|
-
For most digitial applications on the NYPL.org platform, the [NYPL Header](https://github.com/NYPL/dgx-header-component)
|
|
23
|
-
is used and this component already renders a skip navigation area with links.
|
|
24
|
-
|
|
25
|
-
In the Reservoir Design System (DS), the `SkipNavigation` component renders two
|
|
26
|
-
links.
|
|
27
|
-
|
|
28
|
-
The first link points to the `"#mainContent"` anchor which an NYPL page
|
|
29
|
-
is expected to have. The `TemplateAppContainer` component renders as a `main`
|
|
30
|
-
HTML element with a default `id` of `"mainContent"`. While it's possible to
|
|
31
|
-
update the target of the skip link and the id of the `<main>` element, this is
|
|
32
|
-
not recommended. When using the DS' `SkipNavigation` and `TemplateAppContainer`
|
|
33
|
-
components, this accessibility combination is automatically handled. When not
|
|
34
|
-
using the `TemplateAppContainer` component, make sure to render a `main` HTML
|
|
35
|
-
element with an `id` of `"mainContent"`.
|
|
36
|
-
|
|
37
|
-
The second link points to additional accessibility information on [NYPL.org/accessibility](https://nypl.org/accessibility).
|
|
38
|
-
|
|
39
|
-
## Resources
|
|
40
|
-
|
|
41
|
-
- [WebAim Skip Navigation Link](https://webaim.org/techniques/skipnav/)
|
|
42
|
-
- [A11ymatters Skip Navigation Link](https://www.a11ymatters.com/pattern/skip-link/)
|