@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
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,59 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 1.0.4 (June 23, 2022)
|
|
12
|
+
|
|
13
|
+
### Adds
|
|
14
|
+
|
|
15
|
+
- Adds the `useNYPLBreakpoints` hook. This hook internally uses Chakra's `useMediaQuery` hook to get the current responsive media query breakpoint.
|
|
16
|
+
- Adds `ui.gray.xx-dark` to the color palette.
|
|
17
|
+
- Adds npm packages useful for lazy loading images in the `Image` component.
|
|
18
|
+
- Adds text case styles for `Text` component.
|
|
19
|
+
- Exports `ColorModeScript`, `cookieStorageManager`, `localStorageManager`, `useColorMode`, and `useColorModeValue` from Chakra UI for consuming application usage.
|
|
20
|
+
- Adds a "Color Mode" documentation page in Storybook.
|
|
21
|
+
- Adds `ui.white` as default background color to `Checkbox` and `Radio` components.
|
|
22
|
+
- Adds text case styles for `Heading` component
|
|
23
|
+
|
|
24
|
+
### Updates
|
|
25
|
+
|
|
26
|
+
- Updates the `Logo` component to include a variant for `MLN Color`.
|
|
27
|
+
- Updates the `Icon` component to include variants for `Facebook`, `Instagram`, `Tumblr`, `Twitter` and `YouTube`.
|
|
28
|
+
- Updates the `Icon` component to include variants for `Building`, `Exit`, `Locator`, `Power` and `Settings`.
|
|
29
|
+
- Updates to Storybook version 6.5.
|
|
30
|
+
- Explicitly sets the default color mode value to `"light"`.
|
|
31
|
+
- Updates how the `styles.scss` and `resources.scss` files are organized and compiled so that they can be imported in any tech stack.
|
|
32
|
+
- Updates the docs for the `Table` commponent to remove the example that does not include column headers.
|
|
33
|
+
- Updates the `Button`, `Select` and `TextInput` components to use NYPL standard minimum height in mobile viewport.
|
|
34
|
+
- Updates the `SearchBar` component to change how the width of the internal `Select` component is handled.
|
|
35
|
+
|
|
36
|
+
### Fixes
|
|
37
|
+
|
|
38
|
+
- Fixes the styles for the sub-labels in the `DatePicker` component.
|
|
39
|
+
|
|
40
|
+
## 1.0.3 (June 9, 2022)
|
|
41
|
+
|
|
42
|
+
### Adds
|
|
43
|
+
|
|
44
|
+
- Adds prop validation for the `TextInput` "number" type for the `min` and `max` props.
|
|
45
|
+
- Adds `min` and `max` prop value validation for the `Slider` component, including in the "range" mode.
|
|
46
|
+
|
|
47
|
+
### Updates
|
|
48
|
+
|
|
49
|
+
- Updates the `TemplateAppContainer`'s responsive styles for its sidebar component.
|
|
50
|
+
- Updates how the `Radio`'s label is hidden when the `showLabel` prop is set to "false" to fix the "no label" accessibility issue.
|
|
51
|
+
- Updates the `Logo` component to include new variants for `NYPL Text Only`.
|
|
52
|
+
- Updates the `Card`'s full-click functionality styling for its wrapper element.
|
|
53
|
+
- Updates how the `Card`'s `Image` component is displayed in the mobile view; sizes and aspect ratios are maintained instead of always displaying as 100% width.
|
|
54
|
+
- Updates hover style to add right border color on hover for `Select` element.
|
|
55
|
+
- Updates the `Table` component to be responsive for a mobile viewport.
|
|
56
|
+
- Updates the `Table` component to make the `columnHeaders` prop required.
|
|
57
|
+
|
|
58
|
+
### Fixes
|
|
59
|
+
|
|
60
|
+
- Fixes the border color for the `Accordion` button.
|
|
61
|
+
- Fixes a false warning message logged from the `Table` component.
|
|
62
|
+
- Fixes the background color for the `Toggle` button.
|
|
63
|
+
|
|
11
64
|
## 1.0.2 (June 1, 2022)
|
|
12
65
|
|
|
13
66
|
### Adds
|
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
The Reservoir Design System (DS) is NYPL’s open-source extensible React library for products and experiences with the accessibility as its foundation. It ships functional, stateless components with consistent NYPL styling. You can learn more about the project and its goals [on the project's wiki](https://github.com/NYPL/nypl-design-system/wiki).
|
|
8
8
|
|
|
9
|
-
_Note: This library is still in beta. Until we release the stable `1.0.0` version, we are loosely using semantic versioning._
|
|
10
|
-
|
|
11
9
|
Storybook documentation
|
|
12
10
|
|
|
13
11
|
- [Production - deployed to Github Pages](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/story/welcome--page)
|
|
@@ -15,108 +13,27 @@ Storybook documentation
|
|
|
15
13
|
|
|
16
14
|
| Table of Contents | |
|
|
17
15
|
| ----------------- | ----------------------------------------------------------------------------------- |
|
|
18
|
-
| 1. | [
|
|
19
|
-
| 2. | [
|
|
20
|
-
| 3. | [
|
|
21
|
-
| 4. | [
|
|
22
|
-
| 5. | [
|
|
23
|
-
| 6. | [
|
|
24
|
-
| 7. | [
|
|
25
|
-
| 8. | [
|
|
16
|
+
| 1. | [Using the Design System in Your Product](#using-the-design-system-in-your-product) |
|
|
17
|
+
| 2. | [Using Chakra UI Components](#using-chakra-ui-components) |
|
|
18
|
+
| 3. | [Storybook](#storybook) |
|
|
19
|
+
| 4. | [Accessibility](#accessibility) |
|
|
20
|
+
| 5. | [Contributing Quickstart](#contributing-quickstart) |
|
|
21
|
+
| 6. | [Developing with NPM Link](#developing-with-npm-link) |
|
|
22
|
+
| 7. | [Typescript Usage](#typescript-usage) |
|
|
23
|
+
| 8. | [Unit Testing](#unit-testing) |
|
|
26
24
|
| 9. | [CDN](#cdn) |
|
|
27
25
|
|
|
28
|
-
## Contributing Quickstart
|
|
29
|
-
|
|
30
|
-
Follow these steps to setup a local installation of the project:
|
|
31
|
-
|
|
32
|
-
1. Clone the repo
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
$ git clone https://github.com/NYPL/nypl-design-system.git
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
2. Install all the dependencies
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
$ npm install
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
3. Run the Storybook instance and view it at `http://localhost:6006`
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
$ npm run storybook
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
You can now edit styles or templates in the `src` directory, and they will automatically re-build and update in the Storybook instance. Adding new stories or changing story names will require a page refresh.
|
|
51
|
-
|
|
52
|
-
Information about active maintainers, how we run reviews, and more can be found in our wiki page for [Contributing to the Design System](https://github.com/NYPL/nypl-design-system/wiki/Contributing-to-the-React-Library).
|
|
53
|
-
|
|
54
|
-
Follow the [contribution document](/.github/CONTRIBUTING.md) to follow git branching convetions, component creation and update guidelines, testing methodoly, and documentation guidelines.
|
|
55
|
-
|
|
56
|
-
### Node Version
|
|
57
|
-
|
|
58
|
-
We recommend using Node version 12.22.x since the DS has some issues with versions higher than 12.x. The Github Actions for linting, automated testing, deploying to Github Pages, and releasing to npm are all running on Node 12.x.
|
|
59
|
-
|
|
60
|
-
If you are using `nvm`, the local `.nvmrc` file can be use to set your local Node version with the `nvm use` command (will be set to `12.22.x`).
|
|
61
|
-
|
|
62
|
-
## Developing with NPM Link
|
|
63
|
-
|
|
64
|
-
To develop with a local version of the Design System:
|
|
65
|
-
|
|
66
|
-
1. In the Design System directory, run:
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
$ npm link
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
2. Go to the consuming application directory and run:
|
|
73
|
-
|
|
74
|
-
```sh
|
|
75
|
-
$ npm link @nypl/design-system-react-components
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
3. Go back to the Design System directory and run the following command. It allos the local Design System to be rebuilt and exported automatically:
|
|
79
|
-
|
|
80
|
-
```sh
|
|
81
|
-
$ npm start
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Error Troubleshooting
|
|
85
|
-
|
|
86
|
-
It's possible when running `npm link` that you'll get an `Invalid Hook` issue. If this occurs, it's most likely caused by having two versions of React when trying to run the application while the NYPL DS package is linked. This [Duplicate React](https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react) issue is covered by the React team.
|
|
87
|
-
|
|
88
|
-
To be more specific, you should run the following in your local DS directory, where `[../path/to/application]` is the local directory of the consuming application.
|
|
89
|
-
|
|
90
|
-
```sh
|
|
91
|
-
$ npm link [../path/to/application]/node_modules/react
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Now you should be able to run `npm start` in the DS directory and `npm run dev` (or whatever your application uses) in the application directory and not get an `Invalid Hook` error.
|
|
95
|
-
|
|
96
|
-
### npm Unlink
|
|
97
|
-
|
|
98
|
-
To unlink the DS codebase:
|
|
99
|
-
|
|
100
|
-
1. Run `npm unlink` in the Design System directory.
|
|
101
|
-
2. Run `npm unlink --no-save @nypl/design-system-react-components` in the consuming application.
|
|
102
|
-
|
|
103
26
|
## Using the Design System in Your Product
|
|
104
27
|
|
|
105
|
-
|
|
28
|
+
The Reservoir Design System package is distributed on npm.
|
|
106
29
|
|
|
107
|
-
1. Install the
|
|
30
|
+
1. Install the package in your app's directory:
|
|
108
31
|
|
|
109
32
|
```sh
|
|
110
33
|
$ npm install @nypl/design-system-react-components
|
|
111
34
|
```
|
|
112
35
|
|
|
113
|
-
2. Import the
|
|
114
|
-
|
|
115
|
-
```css
|
|
116
|
-
@import "~@nypl/design-system-react-components/dist/styles.css";
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
3. Import the `DSProvider` component
|
|
36
|
+
2. Import the `DSProvider` component
|
|
120
37
|
|
|
121
38
|
In order to use DS components in a consuming application, there is a necessary step that must be done for component styles to properly render. Consuming applications need to wrap all the DS components with a simple provider component. Fortunately, this only needs to be done once at the top level of the consuming application.
|
|
122
39
|
|
|
@@ -140,7 +57,59 @@ const ApplicationContainer = (props) => {
|
|
|
140
57
|
};
|
|
141
58
|
```
|
|
142
59
|
|
|
143
|
-
|
|
60
|
+
3. Import the minified styles `@nypl/design-system-react-components/dist/styles.css` file in your app.
|
|
61
|
+
|
|
62
|
+
This file contains normalized reset CSS rules, system fonts, the `react-datepicker`'s styles, breakpoint CSS variables, and overriding styles for a few components.
|
|
63
|
+
|
|
64
|
+
Importing this file varies on the stack of the application. For Nextjs apps, the file can be imported in the `_app.tsx` file:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
// _app.tsx
|
|
68
|
+
@import "@nypl/design-system-react-components/dist/styles.css";
|
|
69
|
+
|
|
70
|
+
import {
|
|
71
|
+
DSProvider,
|
|
72
|
+
TemplateAppContainer,
|
|
73
|
+
} from "@nypl/design-system-react-components";
|
|
74
|
+
...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Otherwise, it can be imported in the app's main SCSS file:
|
|
78
|
+
|
|
79
|
+
```scss
|
|
80
|
+
// main.scss (for example)
|
|
81
|
+
@import "@nypl/design-system-react-components/dist/styles.css";
|
|
82
|
+
|
|
83
|
+
body {
|
|
84
|
+
....
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Note: Using tilde to import scss/css is no longer a best practice for apps using _recent_ versions of webpack or parcel.
|
|
89
|
+
|
|
90
|
+
```scss
|
|
91
|
+
// No longer a best practice:
|
|
92
|
+
@import "~@nypl/design-system-react-components/dist/styles.css";
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For apps using parcel, prepend the string import with `npm:` such as :
|
|
96
|
+
|
|
97
|
+
```scss
|
|
98
|
+
@import "npm:@nypl/design-system-react-components/dist/styles.css";
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
4. Optionally import the `@nypl/design-system-react-components/dist/resources.scss` file in your main _scss_ file. This file contains useful SCSS mixins that can be used for global or component style rules.
|
|
102
|
+
|
|
103
|
+
```scss
|
|
104
|
+
@import "@nypl/design-system-react-components/dist/resources.scss";
|
|
105
|
+
|
|
106
|
+
// `screenreader-only` is one example of a mixing from `resources.scss`:
|
|
107
|
+
legend {
|
|
108
|
+
@include screenreader-only;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
5. Use DS components!
|
|
144
113
|
|
|
145
114
|
Consult Storybook for the list of available components and props that they require.
|
|
146
115
|
|
|
@@ -198,22 +167,6 @@ Find more information about the Design System's internal use of Chakra to create
|
|
|
198
167
|
|
|
199
168
|
Chakra was integrated into the Design System in version `0.25.0`. For those looking to update to a version greater than or equal `0.25.0`, check out our [Chakra Migration Guide](/CHAKRA_MIGRATION_GUIDE.md).
|
|
200
169
|
|
|
201
|
-
## CDN
|
|
202
|
-
|
|
203
|
-
You can also use the Design System styles in your project through the `unpkg` CDN:
|
|
204
|
-
|
|
205
|
-
```jsx
|
|
206
|
-
<link href="https://unpkg.com/@nypl/design-system-react-components/dist/styles.css">
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
If you need to reference a particular version you can do do by including the version number in the URL:
|
|
210
|
-
|
|
211
|
-
```jsx
|
|
212
|
-
<link href="https://unpkg.com/@nypl/design-system-react-components@0.9.1/dist/styles.css">
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
You can check out a working Codepen with unpkg [here](https://codepen.io/edwinguzman/pen/ExmXGKx).
|
|
216
|
-
|
|
217
170
|
## Storybook
|
|
218
171
|
|
|
219
172
|
The Reservoir Design System leverages Storybook to document all the React components and style guidelines. The Storybook documentation can be found [here](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/story/welcome--page). For your convenience, the Reservoir Design System components have been organized into logical categories based on both form and function. Please refer to the COMPONENTS section in the Storybook sidebar.
|
|
@@ -269,6 +222,101 @@ $ npm run build-storybook:v1
|
|
|
269
222
|
|
|
270
223
|
You can then view `/reservoir/v1/index.html` in your browser. _Make sure not to commit this directory_.
|
|
271
224
|
|
|
225
|
+
## Accessibility
|
|
226
|
+
|
|
227
|
+
### Development and Storybook
|
|
228
|
+
|
|
229
|
+
The Reservoir Design System is built with accessibility in mind. By using Chakra UI as our foundational base, the custom DS components built with Chakra have accessibility concerns already implemented. On top of built-in accessible elements, DS components internally work to link labels with input elements, to add correct `aria-*` attributes, to visually hide text but still associate it with the correct element for titles and descriptions, and much more.
|
|
230
|
+
|
|
231
|
+
We make use of:
|
|
232
|
+
|
|
233
|
+
- `eslint-plugin-jsx-a11y` for finding accessibility errors through linting and through IDE environments.
|
|
234
|
+
- `jest-axe` for running [`axe-core`](https://github.com/dequelabs/axe-core) on _every_ component's unit test file. This is part of the automated tests that run in Github Actions through the `npm test` command.
|
|
235
|
+
- `@storybook/addon-a11y` for real-time accessibility testing in the browser through Storybook. _Every_ component has a tab that displays violations, passes, and incomplete checks performed by `axe-core`.
|
|
236
|
+
|
|
237
|
+
If applicable, DS components have section(s) on accessibility in their Storybook documentation. For example, in the `Slider`'s [Storybook file](/src/components/Slider/Slider.stories.mdx), there are two "Accessibility" sections for each of the two `Slider` types, "single" and "range". This gives an explanation on additional changes we made to make the combination of elements in the `Slider` component accessible.
|
|
238
|
+
|
|
239
|
+
### Product Requirements
|
|
240
|
+
|
|
241
|
+
The Reservoir Design System provides accessible stories, but real data can necessitate additional accessibility requirements beyond what we're committed to in our generic, extensible components. To ensure your products' final result is accessible, please adhere to the accessibility requirements put together by NYPL's accessibility coordinator on [Metronome](http://themetronome.co/).
|
|
242
|
+
|
|
243
|
+
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
244
|
+
|
|
245
|
+
## Contributing Quickstart
|
|
246
|
+
|
|
247
|
+
Follow these steps to setup a local installation of the project:
|
|
248
|
+
|
|
249
|
+
1. Clone the repo
|
|
250
|
+
|
|
251
|
+
```sh
|
|
252
|
+
$ git clone https://github.com/NYPL/nypl-design-system.git
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
2. Install all the dependencies
|
|
256
|
+
|
|
257
|
+
```sh
|
|
258
|
+
$ npm install
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
3. Run the Storybook instance and view it at `http://localhost:6006`
|
|
262
|
+
|
|
263
|
+
```sh
|
|
264
|
+
$ npm run storybook
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
You can now edit styles or templates in the `src` directory, and they will automatically re-build and update in the Storybook instance. Adding new stories or changing story names will require a page refresh.
|
|
268
|
+
|
|
269
|
+
Information about active maintainers, how we run reviews, and more can be found in our wiki page for [Contributing to the Design System](https://github.com/NYPL/nypl-design-system/wiki/Contributing-to-the-React-Library).
|
|
270
|
+
|
|
271
|
+
Follow the [contribution document](/.github/CONTRIBUTING.md) to follow git branching convetions, component creation and update guidelines, testing methodoly, and documentation guidelines.
|
|
272
|
+
|
|
273
|
+
### Node Version
|
|
274
|
+
|
|
275
|
+
We recommend using Node version 12.22.x since the DS has some issues with versions higher than 12.x. The Github Actions for linting, automated testing, deploying to Github Pages, and releasing to npm are all running on Node 12.x.
|
|
276
|
+
|
|
277
|
+
If you are using `nvm`, the local `.nvmrc` file can be use to set your local Node version with the `nvm use` command (will be set to `12.22.x`).
|
|
278
|
+
|
|
279
|
+
## Developing with NPM Link
|
|
280
|
+
|
|
281
|
+
To develop with a local version of the Design System:
|
|
282
|
+
|
|
283
|
+
1. In the Design System directory, run:
|
|
284
|
+
|
|
285
|
+
```sh
|
|
286
|
+
$ npm link
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
2. Go to the consuming application directory and run:
|
|
290
|
+
|
|
291
|
+
```sh
|
|
292
|
+
$ npm link @nypl/design-system-react-components
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
3. Go back to the Design System directory and run the following command. It allos the local Design System to be rebuilt and exported automatically:
|
|
296
|
+
|
|
297
|
+
```sh
|
|
298
|
+
$ npm start
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Error Troubleshooting
|
|
302
|
+
|
|
303
|
+
It's possible when running `npm link` that you'll get an `Invalid Hook` issue. If this occurs, it's most likely caused by having two versions of React when trying to run the application while the NYPL DS package is linked. This [Duplicate React](https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react) issue is covered by the React team.
|
|
304
|
+
|
|
305
|
+
To be more specific, you should run the following in your local DS directory, where `[../path/to/application]` is the local directory of the consuming application.
|
|
306
|
+
|
|
307
|
+
```sh
|
|
308
|
+
$ npm link [../path/to/application]/node_modules/react
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Now you should be able to run `npm start` in the DS directory and `npm run dev` (or whatever your application uses) in the application directory and not get an `Invalid Hook` error.
|
|
312
|
+
|
|
313
|
+
### npm Unlink
|
|
314
|
+
|
|
315
|
+
To unlink the DS codebase:
|
|
316
|
+
|
|
317
|
+
1. Run `npm unlink` in the Design System directory.
|
|
318
|
+
2. Run `npm unlink --no-save @nypl/design-system-react-components` in the consuming application.
|
|
319
|
+
|
|
272
320
|
## Typescript Usage
|
|
273
321
|
|
|
274
322
|
The Reservoir Design System is built with Typescript. Check out the Design System's [Typescript documentation](/TYPESCRIPT.md) for more information on why we chose to build React components in Typescript and the benefits and the gotchas we encountered.
|
|
@@ -355,38 +403,26 @@ Through the [`@storybook/addon-jest`](https://www.npmjs.com/package/@storybook/a
|
|
|
355
403
|
|
|
356
404
|
After writing new tests, run `npm run test:generate-output` to create a new JSON file that is used by Storybook. This JSON file contains all the test suites for all the components and Storybook picks this up and automatically combines a component with its relevant unit tests. Make sure to commit this file although new builds on Github Pages will recreate this file for the production Storybook instance.
|
|
357
405
|
|
|
358
|
-
## Accessibility
|
|
359
|
-
|
|
360
|
-
### Development and Storybook
|
|
361
|
-
|
|
362
|
-
The Reservoir Design System is built with accessibility in mind. By using Chakra UI as our foundational base, the custom DS components built with Chakra have accessibility concerns already implemented. On top of built-in accessible elements, DS components internally work to link labels with input elements, to add correct `aria-*` attributes, to visually hide text but still associate it with the correct element for titles and descriptions, to auto-generate a random `id` attribute if none was passed, and much more.
|
|
363
|
-
|
|
364
|
-
We make use of:
|
|
365
|
-
|
|
366
|
-
- `eslint-plugin-jsx-a11y` for finding accessibility errors through linting and through IDE environments.
|
|
367
|
-
- `jest-axe` for running [`axe-core`](https://github.com/dequelabs/axe-core) on _every_ component's unit test file. This is part of the automated tests that run in Github Actions through the `npm test` command.
|
|
368
|
-
- `@storybook/addon-a11y` for real-time accessibility testing in the browser through Storybook. _Every_ component has a tab that displays violations, passes, and incomplete checks performed by `axe-core`.
|
|
369
|
-
|
|
370
|
-
If applicable, DS components have section(s) on accessibility in their Storybook documentation. For example, in the `Slider`'s [Storybook file](/src/components/Slider/Slider.stories.mdx), there are two "Accessibility" sections for each of the two `Slider` types, "single" and "range". This gives an explanation on additional changes we made to make the combination of elements in the `Slider` component accessible.
|
|
371
|
-
|
|
372
|
-
### Product Requirements
|
|
373
|
-
|
|
374
|
-
The Reservoir Design System provides accessible stories, but real live data can necessitate additional accessibility requirements beyond what we're committed to in our generic, extensible components. To ensure your products' final result is accessible, please adhere to the accessibility requirements put together by NYPL's accessibility coordinator on [Metronome](http://themetronome.co/).
|
|
375
|
-
|
|
376
|
-
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
377
|
-
|
|
378
406
|
## CDN
|
|
379
407
|
|
|
380
408
|
You can also use the Design System styles in your project through the `unpkg` CDN:
|
|
381
409
|
|
|
382
|
-
```
|
|
383
|
-
<link
|
|
410
|
+
```html
|
|
411
|
+
<link
|
|
412
|
+
href="https://unpkg.com/@nypl/design-system-react-components/dist/styles.css"
|
|
413
|
+
/>
|
|
414
|
+
<script src="https://unpkg.com/@nypl/design-system-react-components/dist/design-system-react-components.cjs.production.min.js" />
|
|
415
|
+
<script src="https://unpkg.com/@nypl/design-system-react-components/dist/design-system-react-components.esm.js" />
|
|
384
416
|
```
|
|
385
417
|
|
|
386
418
|
If you need to reference a particular version you can do do by including the version number in the URL:
|
|
387
419
|
|
|
388
|
-
```
|
|
389
|
-
<link
|
|
420
|
+
```html
|
|
421
|
+
<link
|
|
422
|
+
href="https://unpkg.com/@nypl/design-system-react-components@1.0.0/dist/styles.css"
|
|
423
|
+
/>
|
|
424
|
+
<script src="https://unpkg.com/@nypl/design-system-react-components@1.0.0/dist/design-system-react-components.cjs.production.min.js" />
|
|
425
|
+
<script src="https://unpkg.com/@nypl/design-system-react-components@1.0.0/dist/design-system-react-components.esm.js" />
|
|
390
426
|
```
|
|
391
427
|
|
|
392
428
|
You can check out a working Codepen with unpkg [here](https://codepen.io/edwinguzman/pen/ExmXGKx).
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NYPL Note:
|
|
3
|
+
* This file is directly taken from Chakra:
|
|
4
|
+
* https://github.com/chakra-ui/chakra-ui/blob/main/packages/media-query/tests/matchmedia-mock-plus.ts
|
|
5
|
+
*
|
|
6
|
+
* We need this to test the `useNYPLBreakpoints` hook and, unfortunately,
|
|
7
|
+
* this function is not exported by Chakra.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* This mock is a combination of jest-matchmedia-mock
|
|
11
|
+
* https://github.com/dyakovk/jest-matchmedia-mock and
|
|
12
|
+
* mq-polyfill https://github.com/bigslycat/mq-polyfill.
|
|
13
|
+
*
|
|
14
|
+
* A solution which allowed resizing and a more realistic implementation of
|
|
15
|
+
* matchMedia was the reason for its creation. Neither project provided a good
|
|
16
|
+
* solution. Combining their strong points does. The class will listen for a
|
|
17
|
+
* resize event which is provided by a resizeTo function defined in the test:
|
|
18
|
+
*
|
|
19
|
+
* window.resizeTo = function resizeTo(width, height) {
|
|
20
|
+
* Object.assign(this, {
|
|
21
|
+
* innerWidth: width,
|
|
22
|
+
* innerHeight: height,
|
|
23
|
+
* outerWidth: width,
|
|
24
|
+
* outerHeight: height,
|
|
25
|
+
* }).dispatchEvent(new this.Event('resize'))
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* Listeners are only called if there has been a change in the match
|
|
29
|
+
* status for their media query.
|
|
30
|
+
*/
|
|
31
|
+
declare type MediaQueryListener = (this: MediaQueryList) => void;
|
|
32
|
+
interface MediaQueryList {
|
|
33
|
+
readonly matches: boolean;
|
|
34
|
+
readonly media: string;
|
|
35
|
+
onchange: MediaQueryListener | null;
|
|
36
|
+
addListener(listener: MediaQueryListener): void;
|
|
37
|
+
removeListener(listener: MediaQueryListener): void;
|
|
38
|
+
addEventListener(type: "change", listener: MediaQueryListener): void;
|
|
39
|
+
removeEventListener(type: "change", listener: MediaQueryListener): void;
|
|
40
|
+
dispatchEvent(event: Event): boolean;
|
|
41
|
+
}
|
|
42
|
+
export default class MatchMedia {
|
|
43
|
+
private mediaQueries;
|
|
44
|
+
private prevMatchMap;
|
|
45
|
+
private mediaQueryList;
|
|
46
|
+
constructor();
|
|
47
|
+
private compileQuery;
|
|
48
|
+
private evalQuery;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* Adds a listener function for the window resize event
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
private handleResize;
|
|
55
|
+
private addListener;
|
|
56
|
+
private removeListener;
|
|
57
|
+
/**
|
|
58
|
+
* Returns an array listing the media queries for which the matchMedia has registered listeners
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
getMediaQueries(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Returns a copy of the array of listeners for the specified media query
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
getListeners(mediaQuery: string): MediaQueryListener[];
|
|
67
|
+
/**
|
|
68
|
+
* Clears all registered media queries and their listeners
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
clear(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Clears all registered media queries and their listeners,
|
|
74
|
+
* and destroys the implementation of `window.matchMedia`
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -8,9 +8,15 @@ interface CardBaseProps {
|
|
|
8
8
|
* Default is `"column"`. */
|
|
9
9
|
layout?: LayoutTypes;
|
|
10
10
|
}
|
|
11
|
-
interface
|
|
11
|
+
interface CardWrapperProps {
|
|
12
|
+
/** Optional CSS class name to add. */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
15
|
+
id?: string;
|
|
12
16
|
/** Main link to use when the full `Card` component should be clickable. */
|
|
13
17
|
mainActionLink?: string;
|
|
18
|
+
/** Additional object for styling the `Card`'s `div` wrapper. */
|
|
19
|
+
styles?: any;
|
|
14
20
|
}
|
|
15
21
|
interface CardImageProps extends ComponentImageProps {
|
|
16
22
|
/** Optional boolean value to control the position of the `CardImage`. */
|
|
@@ -24,15 +30,11 @@ interface CardActionsProps extends CardBaseProps {
|
|
|
24
30
|
* the card actions element */
|
|
25
31
|
topBorder?: boolean;
|
|
26
32
|
}
|
|
27
|
-
export interface CardProps extends CardBaseProps,
|
|
33
|
+
export interface CardProps extends CardBaseProps, CardWrapperProps {
|
|
28
34
|
/** Optional hex color value used to set the card background color. */
|
|
29
35
|
backgroundColor?: string;
|
|
30
|
-
/** Optional CSS class name to add. */
|
|
31
|
-
className?: string;
|
|
32
36
|
/** Optional hex color value used to override the default text color. */
|
|
33
37
|
foregroundColor?: string;
|
|
34
|
-
/** ID that other components can cross reference for accessibility purposes. */
|
|
35
|
-
id?: string;
|
|
36
38
|
/** Optional boolean value to control the visibility of a border around
|
|
37
39
|
* the card. */
|
|
38
40
|
isBordered?: boolean;
|
|
@@ -6,6 +6,12 @@ export interface HeadingProps {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
/** Optional ID that other components can cross reference for accessibility purposes */
|
|
8
8
|
id?: string;
|
|
9
|
+
/** Optional prop used to show capitalized text */
|
|
10
|
+
isCapitalized?: boolean;
|
|
11
|
+
/** Optional prop used to show upper case text */
|
|
12
|
+
isUppercase?: boolean;
|
|
13
|
+
/** Optional prop used to show lower case text */
|
|
14
|
+
isLowercase?: boolean;
|
|
9
15
|
/** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed,
|
|
10
16
|
* `Heading` will default to `<h2>` */
|
|
11
17
|
level?: HeadingLevels;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export declare type IconAlign = "left" | "right" | "none";
|
|
3
3
|
export declare type IconColors = "ui.black" | "ui.white" | "brand.primary" | "brand.secondary" | "section.blogs.primary" | "section.blogs.secondary" | "section.books-and-more.primary" | "section.books-and-more.secondary" | "section.education.primary" | "section.education.secondary" | "section.locations.primary" | "section.locations.secondary" | "section.research.primary" | "section.research.secondary" | "section.research-library.lpa" | "section.research-library.schomburg" | "section.research-library.schwartzman" | "section.whats-on.primary" | "section.whats-on.secondary";
|
|
4
|
-
export declare type IconNames = "accessibilityFull" | "accessibilityPartial" | "actionCheckCircle" | "actionHelpDefault" | "actionHelpOutline" | "actionLaunch" | "alertNotificationImportant" | "arrow" | "check" | "clock" | "close" | "download" | "errorFilled" | "errorOutline" | "fileTypeAudio" | "fileTypeDoc" | "fileTypeGenericDoc" | "fileTypeImage" | "fileTypePdf" | "fileTypeSpreadsheet" | "fileTypeVideo" | "headset" | "minus" | "plus" | "search" | "speakerNotes" | "utilityAccountFilled" | "utilityAccountUnfilled" | "utilityHamburger" | "utilitySearch";
|
|
4
|
+
export declare type IconNames = "accessibilityFull" | "accessibilityPartial" | "actionCheckCircle" | "actionExit" | "actionHelpDefault" | "actionHelpOutline" | "actionLaunch" | "actionPower" | "actionSettings" | "alertNotificationImportant" | "arrow" | "building" | "check" | "clock" | "close" | "download" | "errorFilled" | "errorOutline" | "fileTypeAudio" | "fileTypeDoc" | "fileTypeGenericDoc" | "fileTypeImage" | "fileTypePdf" | "fileTypeSpreadsheet" | "fileTypeVideo" | "headset" | "locator" | "minus" | "plus" | "search" | "socialFacebook" | "socialInstagram" | "socialTumblr" | "socialTwitter" | "socialYoutube" | "speakerNotes" | "utilityAccountFilled" | "utilityAccountUnfilled" | "utilityHamburger" | "utilitySearch";
|
|
5
5
|
export declare type IconRotationTypes = "rotate0" | "rotate90" | "rotate180" | "rotate270";
|
|
6
6
|
export declare type IconSizes = "default" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
7
7
|
export declare type IconTypes = "default" | "breadcrumbs";
|
|
@@ -2,11 +2,15 @@ declare const _default: {
|
|
|
2
2
|
accessibilityFull: string;
|
|
3
3
|
accessibilityPartial: string;
|
|
4
4
|
actionCheckCircle: string;
|
|
5
|
+
actionExit: string;
|
|
5
6
|
actionHelpDefault: string;
|
|
6
7
|
actionHelpOutline: string;
|
|
7
8
|
actionLaunch: string;
|
|
9
|
+
actionPower: string;
|
|
10
|
+
actionSettings: string;
|
|
8
11
|
alertNotificationImportant: string;
|
|
9
12
|
arrow: string;
|
|
13
|
+
building: string;
|
|
10
14
|
check: string;
|
|
11
15
|
clock: string;
|
|
12
16
|
close: string;
|
|
@@ -21,9 +25,15 @@ declare const _default: {
|
|
|
21
25
|
fileTypeSpreadsheet: string;
|
|
22
26
|
fileTypeVideo: string;
|
|
23
27
|
headset: string;
|
|
28
|
+
locator: string;
|
|
24
29
|
minus: string;
|
|
25
30
|
plus: string;
|
|
26
31
|
search: string;
|
|
32
|
+
socialFacebook: string;
|
|
33
|
+
socialInstagram: string;
|
|
34
|
+
socialTumblr: string;
|
|
35
|
+
socialTwitter: string;
|
|
36
|
+
socialYoutube: string;
|
|
27
37
|
speakerNotes: string;
|
|
28
38
|
utilityAccountFilled: string;
|
|
29
39
|
utilityAccountUnfilled: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export declare type LogoNames = "appleAppStoreBlack" | "appleAppStoreWhite" | "bplBlack" | "bplWhite" | "cleverBadgeColor" | "cleverColor" | "cleverWhite" | "firstbookColor" | "firstbookColorNegative" | "googlePlayBlack" | "lpaBlack" | "lpaColor" | "lpaWhite" | "mlnBlack" | "mlnWhite" | "nyplFullBlack" | "nyplFullWhite" | "nyplLionBlack" | "nyplLionWhite" | "openebooksColor" | "openebooksNegative" | "openebooksWithTextColor" | "openebooksWithTextNegative" | "qplAltBlack" | "qplAltWhite" | "qplBlack" | "qplColor" | "qplWhite" | "reservoirIconColor" | "reservoirVerticalColor" | "schomburgBlack" | "schomburgCircleBlack" | "schomburgCircleColor" | "schomburgCircleWhite" | "schomburgColor" | "schomburgWhite" | "simplyeBlack" | "simplyeWhite" | "simplyeColor" | "snflBlack" | "snflWhite" | "treasuresColor" | "treasuresColorNegative";
|
|
2
|
+
export declare type LogoNames = "appleAppStoreBlack" | "appleAppStoreWhite" | "bplBlack" | "bplWhite" | "cleverBadgeColor" | "cleverColor" | "cleverWhite" | "firstbookColor" | "firstbookColorNegative" | "googlePlayBlack" | "lpaBlack" | "lpaColor" | "lpaWhite" | "mlnBlack" | "mlnColor" | "mlnWhite" | "nyplFullBlack" | "nyplFullWhite" | "nyplLionBlack" | "nyplLionWhite" | "nyplTextBlack" | "nyplTextWhite" | "openebooksColor" | "openebooksNegative" | "openebooksWithTextColor" | "openebooksWithTextNegative" | "qplAltBlack" | "qplAltWhite" | "qplBlack" | "qplColor" | "qplWhite" | "reservoirIconColor" | "reservoirVerticalColor" | "schomburgBlack" | "schomburgCircleBlack" | "schomburgCircleColor" | "schomburgCircleWhite" | "schomburgColor" | "schomburgWhite" | "simplyeBlack" | "simplyeWhite" | "simplyeColor" | "snflBlack" | "snflWhite" | "treasuresColor" | "treasuresColorNegative";
|
|
3
3
|
export declare type LogoSizes = "default" | "xxsmall" | "xsmall" | "small" | "medium" | "large";
|
|
4
4
|
export interface LogoProps {
|
|
5
5
|
/** Optional className that will be added to the parent element */
|
|
@@ -13,11 +13,14 @@ declare const _default: {
|
|
|
13
13
|
lpaColor: string;
|
|
14
14
|
lpaWhite: string;
|
|
15
15
|
mlnBlack: string;
|
|
16
|
+
mlnColor: string;
|
|
16
17
|
mlnWhite: string;
|
|
17
18
|
nyplFullBlack: string;
|
|
18
19
|
nyplFullWhite: string;
|
|
19
20
|
nyplLionBlack: string;
|
|
20
21
|
nyplLionWhite: string;
|
|
22
|
+
nyplTextBlack: string;
|
|
23
|
+
nyplTextWhite: string;
|
|
21
24
|
openebooksColor: string;
|
|
22
25
|
openebooksNegative: string;
|
|
23
26
|
openebooksWithTextColor: string;
|
|
@@ -4,8 +4,7 @@ export interface SliderProps {
|
|
|
4
4
|
/** Additional class name for the Slider component. */
|
|
5
5
|
className?: string;
|
|
6
6
|
/** The initial value for the single `Slider` or an array of two number
|
|
7
|
-
* values for the `isRangeSlider` case.
|
|
8
|
-
*/
|
|
7
|
+
* values for the `isRangeSlider` case. */
|
|
9
8
|
defaultValue?: number | number[];
|
|
10
9
|
/** Optional string to populate the HelperErrorText for standard state */
|
|
11
10
|
helperText?: HelperErrorTextType;
|
|
@@ -2,8 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
export interface TableProps {
|
|
3
3
|
/** Additional class name for the `Table` component. */
|
|
4
4
|
className?: string;
|
|
5
|
-
/** Array of string values used to populate the `Table` column headers.
|
|
6
|
-
|
|
5
|
+
/** Array of string values used to populate the `Table` column headers.
|
|
6
|
+
* For improved accessibility, column headers are required. */
|
|
7
|
+
columnHeaders: string[];
|
|
7
8
|
/** Hex value to set the background color of the column headers. */
|
|
8
9
|
columnHeadersBackgroundColor?: string;
|
|
9
10
|
/** Hex value to set the text color of the column headers. */
|