@nypl/design-system-react-components 0.25.11 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -0
- package/README.md +14 -26
- package/dist/components/Accordion/Accordion.d.ts +6 -4
- package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +2 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Card/Card.d.ts +22 -29
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +9 -6
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -6
- package/dist/components/Fieldset/Fieldset.d.ts +5 -6
- package/dist/components/Form/Form.d.ts +6 -6
- package/dist/components/Grid/GridTypes.d.ts +7 -7
- package/dist/components/Grid/SimpleGrid.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +5 -5
- package/dist/components/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +9 -8
- package/dist/components/Hero/Hero.d.ts +9 -5
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +2 -10
- package/dist/components/Icons/Icon.d.ts +2 -1
- package/dist/components/Icons/IconTypes.d.ts +10 -7
- package/dist/components/Image/Image.d.ts +27 -9
- package/dist/components/Image/ImageTypes.d.ts +4 -4
- package/dist/components/Label/Label.d.ts +7 -4
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/List/List.d.ts +11 -11
- package/dist/components/List/ListTypes.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts +2 -1
- package/dist/components/Logo/LogoSvgs.d.ts +8 -0
- package/dist/components/Logo/LogoTypes.d.ts +10 -2
- package/dist/components/Notification/Notification.d.ts +7 -7
- package/dist/components/Pagination/Pagination.d.ts +8 -4
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +3 -3
- package/dist/components/Radio/Radio.d.ts +5 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -8
- package/dist/components/SearchBar/SearchBar.d.ts +5 -5
- package/dist/components/Select/Select.d.ts +12 -8
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +8 -6
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
- package/dist/components/Slider/Slider.d.ts +6 -4
- package/dist/components/StatusBadge/StatusBadge.d.ts +5 -1
- package/dist/components/StructuredContent/StructuredContent.d.ts +10 -23
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +7 -6
- package/dist/components/Template/Template.d.ts +18 -9
- package/dist/components/Text/Text.d.ts +4 -4
- package/dist/components/Text/TextTypes.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +7 -7
- package/dist/components/Toggle/Toggle.d.ts +8 -10
- package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +2802 -1686
- 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 +2811 -1699
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/enums.d.ts +4 -0
- package/dist/hooks/useCarouselStyles.d.ts +3 -2
- package/dist/hooks/useNYPLTheme.d.ts +12 -0
- package/dist/index.d.ts +11 -9
- package/dist/styles.css +1 -1
- package/dist/theme/components/accordion.d.ts +7 -12
- package/dist/theme/components/breadcrumb.d.ts +6 -0
- package/dist/theme/components/button.d.ts +10 -2
- package/dist/theme/components/card.d.ts +44 -24
- package/dist/theme/components/checkbox.d.ts +6 -6
- package/dist/theme/components/checkboxGroup.d.ts +4 -2
- package/dist/theme/components/componentWrapper.d.ts +2 -2
- package/dist/theme/components/customTable.d.ts +84 -1
- package/dist/theme/components/fieldset.d.ts +6 -14
- package/dist/theme/components/global.d.ts +37 -29
- package/dist/theme/components/globalMixins.d.ts +8 -8
- package/dist/theme/components/heading.d.ts +53 -0
- package/dist/theme/components/helperErrorText.d.ts +1 -0
- package/dist/theme/components/hero.d.ts +21 -15
- package/dist/theme/components/image.d.ts +1 -1
- package/dist/theme/components/label.d.ts +9 -10
- package/dist/theme/components/list.d.ts +105 -9
- package/dist/theme/components/notification.d.ts +7 -4
- package/dist/theme/components/pagination.d.ts +2 -5
- package/dist/theme/components/radio.d.ts +10 -6
- package/dist/theme/components/radioGroup.d.ts +4 -2
- package/dist/theme/components/select.d.ts +38 -13
- package/dist/theme/components/skeletonLoader.d.ts +2 -2
- package/dist/theme/components/slider.d.ts +14 -7
- package/dist/theme/components/structuredContent.d.ts +197 -0
- package/dist/theme/components/textInput.d.ts +22 -14
- package/dist/theme/components/toggle.d.ts +25 -6
- package/dist/theme/foundations/global.d.ts +33 -3
- package/dist/theme/foundations/radii.d.ts +1 -0
- package/dist/theme/foundations/spacing.d.ts +46 -43
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +5 -6
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
- package/src/components/Accordion/Accordion.stories.mdx +150 -66
- package/src/components/Accordion/Accordion.test.tsx +65 -17
- package/src/components/Accordion/Accordion.tsx +61 -27
- package/src/components/Accordion/AccordionTypes.tsx +5 -0
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +505 -14
- package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +53 -18
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +66 -35
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +14 -13
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +2 -1
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +308 -10
- package/src/components/Button/Button.stories.mdx +87 -23
- package/src/components/Button/Button.test.tsx +25 -0
- package/src/components/Button/Button.tsx +18 -7
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +27 -7
- package/src/components/Card/Card.stories.mdx +493 -329
- package/src/components/Card/Card.test.tsx +138 -18
- package/src/components/Card/Card.tsx +151 -85
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +220 -100
- package/src/components/Chakra/Center.stories.mdx +2 -2
- package/src/components/Chakra/Grid.stories.mdx +4 -4
- package/src/components/Checkbox/Checkbox.stories.mdx +73 -9
- package/src/components/Checkbox/Checkbox.test.tsx +89 -10
- package/src/components/Checkbox/Checkbox.tsx +27 -16
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +209 -6
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +135 -23
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +216 -90
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +39 -26
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +493 -89
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +12 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +39 -41
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +47 -34
- package/src/components/DatePicker/DatePicker.stories.mdx +63 -27
- package/src/components/DatePicker/DatePicker.test.tsx +94 -15
- package/src/components/DatePicker/DatePicker.tsx +67 -58
- package/src/components/DatePicker/_DatePicker.scss +71 -13
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +250 -206
- package/src/components/Fieldset/Fieldset.stories.mdx +33 -3
- package/src/components/Fieldset/Fieldset.test.tsx +58 -28
- package/src/components/Fieldset/Fieldset.tsx +35 -30
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +40 -19
- package/src/components/Form/Form.stories.mdx +118 -47
- package/src/components/Form/Form.test.tsx +59 -16
- package/src/components/Form/Form.tsx +89 -65
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +83 -5
- package/src/components/Grid/GridTypes.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +87 -41
- package/src/components/Grid/SimpleGrid.test.tsx +24 -9
- package/src/components/Grid/SimpleGrid.tsx +29 -20
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +16 -1
- package/src/components/Heading/Heading.stories.mdx +56 -25
- package/src/components/Heading/Heading.test.tsx +17 -7
- package/src/components/Heading/Heading.tsx +60 -58
- package/src/components/Heading/HeadingTypes.tsx +1 -1
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +27 -8
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +64 -42
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +15 -0
- package/src/components/HelperErrorText/HelperErrorText.tsx +40 -35
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +35 -4
- package/src/components/Hero/Hero.stories.mdx +143 -113
- package/src/components/Hero/Hero.test.tsx +146 -58
- package/src/components/Hero/Hero.tsx +144 -112
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +89 -17
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +26 -4
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +9 -17
- package/src/components/HorizontalRule/HorizontalRule.tsx +9 -25
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +18 -5
- package/src/components/Icons/Icon.stories.mdx +80 -23
- package/src/components/Icons/Icon.test.tsx +51 -2
- package/src/components/Icons/Icon.tsx +93 -71
- package/src/components/Icons/IconTypes.tsx +9 -6
- package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +129 -0
- package/src/components/Image/Image.stories.mdx +160 -71
- package/src/components/Image/Image.test.tsx +40 -48
- package/src/components/Image/Image.tsx +80 -48
- package/src/components/Image/ImageTypes.ts +4 -4
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +84 -21
- package/src/components/Label/Label.stories.mdx +42 -20
- package/src/components/Label/Label.test.tsx +42 -17
- package/src/components/Label/Label.tsx +22 -13
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +19 -15
- package/src/components/Link/Link.stories.mdx +25 -1
- package/src/components/Link/Link.test.tsx +21 -0
- package/src/components/Link/Link.tsx +16 -9
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +37 -11
- package/src/components/List/List.stories.mdx +75 -40
- package/src/components/List/List.test.tsx +73 -22
- package/src/components/List/List.tsx +44 -28
- package/src/components/List/ListTypes.tsx +1 -1
- package/src/components/List/__snapshots__/List.test.tsx.snap +110 -8
- package/src/components/Logo/Logo.stories.mdx +40 -16
- package/src/components/Logo/Logo.test.tsx +29 -2
- package/src/components/Logo/Logo.tsx +28 -11
- package/src/components/Logo/LogoSvgs.tsx +16 -0
- package/src/components/Logo/LogoTypes.tsx +9 -1
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +73 -2
- package/src/components/Modal/Modal.stories.mdx +13 -0
- package/src/components/Notification/Notification.stories.mdx +34 -5
- package/src/components/Notification/Notification.test.tsx +43 -9
- package/src/components/Notification/Notification.tsx +59 -55
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +256 -32
- package/src/components/Pagination/Pagination.stories.mdx +76 -13
- package/src/components/Pagination/Pagination.test.tsx +116 -5
- package/src/components/Pagination/Pagination.tsx +54 -29
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +247 -30
- package/src/components/Placeholder/Placeholder.tsx +3 -1
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +76 -10
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +87 -13
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +20 -10
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +101 -14
- package/src/components/Radio/Radio.stories.mdx +75 -11
- package/src/components/Radio/Radio.test.tsx +83 -9
- package/src/components/Radio/Radio.tsx +70 -61
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +168 -10
- package/src/components/RadioGroup/RadioGroup.stories.mdx +293 -94
- package/src/components/RadioGroup/RadioGroup.test.tsx +193 -68
- package/src/components/RadioGroup/RadioGroup.tsx +110 -101
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1258 -902
- package/src/components/SearchBar/SearchBar.stories.mdx +104 -39
- package/src/components/SearchBar/{SearchBar.Test.tsx → SearchBar.test.tsx} +66 -6
- package/src/components/SearchBar/SearchBar.tsx +23 -13
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1039 -0
- package/src/components/Select/Select.stories.mdx +151 -62
- package/src/components/Select/Select.test.tsx +56 -44
- package/src/components/Select/Select.tsx +125 -104
- package/src/components/Select/SelectTypes.tsx +5 -0
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +749 -409
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +53 -23
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +14 -8
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +80 -78
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +169 -10
- package/src/components/Slider/Slider.stories.mdx +123 -41
- package/src/components/Slider/Slider.test.tsx +65 -17
- package/src/components/Slider/Slider.tsx +34 -24
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +403 -226
- package/src/components/StatusBadge/StatusBadge.stories.mdx +19 -1
- package/src/components/StatusBadge/StatusBadge.test.tsx +19 -1
- package/src/components/StatusBadge/StatusBadge.tsx +25 -20
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +22 -3
- package/src/components/StructuredContent/StructuredContent.stories.mdx +229 -61
- package/src/components/StructuredContent/StructuredContent.test.tsx +162 -101
- package/src/components/StructuredContent/StructuredContent.tsx +98 -103
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +102 -17
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -9
- package/src/components/StyleGuide/Breakpoints.stories.mdx +6 -6
- package/src/components/StyleGuide/Buttons.stories.mdx +2 -12
- package/src/components/StyleGuide/ColorCard.tsx +4 -4
- package/src/components/StyleGuide/Colors.stories.mdx +34 -20
- package/src/components/StyleGuide/DesignTokens.stories.mdx +56 -26
- package/src/components/StyleGuide/Forms.stories.mdx +27 -12
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -12
- package/src/components/StyleGuide/Spacing.stories.mdx +80 -41
- package/src/components/StyleGuide/Typography.stories.mdx +47 -33
- package/src/components/Table/Table.stories.mdx +38 -11
- package/src/components/Table/Table.test.tsx +16 -1
- package/src/components/Table/Table.tsx +10 -8
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +408 -5
- package/src/components/Tabs/Tabs.stories.mdx +59 -10
- package/src/components/Tabs/Tabs.test.tsx +29 -11
- package/src/components/Tabs/Tabs.tsx +28 -21
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +394 -5
- package/src/components/Template/Template.stories.mdx +73 -32
- package/src/components/Template/Template.test.tsx +68 -5
- package/src/components/Template/Template.tsx +86 -72
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +195 -22
- package/src/components/Text/Text.stories.mdx +32 -15
- package/src/components/Text/Text.test.tsx +14 -11
- package/src/components/Text/Text.tsx +13 -16
- package/src/components/Text/TextTypes.tsx +1 -1
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +21 -4
- package/src/components/TextInput/TextInput.stories.mdx +73 -27
- package/src/components/TextInput/TextInput.test.tsx +65 -50
- package/src/components/TextInput/TextInput.tsx +123 -115
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +96 -73
- package/src/components/Toggle/Toggle.stories.mdx +74 -26
- package/src/components/Toggle/Toggle.test.tsx +41 -10
- package/src/components/Toggle/Toggle.tsx +31 -27
- package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +195 -8
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +52 -4
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +41 -6
- package/src/components/VideoPlayer/VideoPlayer.tsx +134 -120
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +81 -39
- package/src/docs/Chakra.stories.mdx +51 -10
- package/src/docs/Welcome.stories.mdx +168 -0
- package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useCarouselStyles.stories.mdx +30 -0
- package/src/hooks/useCarouselStyles.ts +3 -2
- package/src/hooks/useNYPLTheme.stories.mdx +101 -0
- package/src/hooks/useNYPLTheme.ts +31 -7
- package/src/hooks/useWindowSize.stories.mdx +23 -0
- package/src/index.ts +11 -15
- package/src/styles/base/_place-holder.scss +3 -1
- package/src/styles.scss +0 -2
- package/src/theme/components/accordion.ts +7 -12
- package/src/theme/components/breadcrumb.ts +7 -0
- package/src/theme/components/button.ts +15 -7
- package/src/theme/components/card.ts +56 -36
- package/src/theme/components/checkbox.ts +12 -14
- package/src/theme/components/checkboxGroup.ts +4 -2
- package/src/theme/components/componentWrapper.ts +2 -2
- package/src/theme/components/customTable.ts +39 -31
- package/src/theme/components/fieldset.ts +3 -2
- package/src/theme/components/global.ts +42 -33
- package/src/theme/components/globalMixins.ts +8 -8
- package/src/theme/components/heading.ts +1 -1
- package/src/theme/components/helperErrorText.ts +1 -0
- package/src/theme/components/hero.ts +14 -16
- package/src/theme/components/icon.ts +5 -2
- package/src/theme/components/image.ts +1 -1
- package/src/theme/components/label.ts +4 -3
- package/src/theme/components/list.ts +76 -65
- package/src/theme/components/notification.ts +10 -7
- package/src/theme/components/pagination.ts +2 -5
- package/src/theme/components/progressIndicator.ts +3 -3
- package/src/theme/components/radio.ts +11 -14
- package/src/theme/components/radioGroup.ts +4 -2
- package/src/theme/components/select.ts +37 -18
- package/src/theme/components/skeletonLoader.ts +3 -3
- package/src/theme/components/slider.ts +19 -15
- package/src/theme/components/statusBadge.ts +2 -2
- package/src/theme/components/structuredContent.ts +66 -1
- package/src/theme/components/tabs.ts +2 -2
- package/src/theme/components/template.ts +9 -9
- package/src/theme/components/textInput.ts +13 -12
- package/src/theme/components/toggle.ts +76 -42
- package/src/theme/components/videoPlayer.ts +1 -1
- package/src/theme/foundations/colors.ts +20 -13
- package/src/theme/foundations/global.ts +17 -5
- package/src/theme/foundations/radii.ts +1 -0
- package/src/theme/foundations/spacing.ts +70 -22
- package/src/theme/foundations/typography.ts +3 -3
- package/src/utils/componentCategories.ts +28 -21
- package/src/utils/utils.ts +28 -0
- package/dist/components/Card/CardTypes.d.ts +0 -4
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -13
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
- package/dist/components/SearchBar/SearchBar.Test.d.ts +0 -1
- package/dist/helpers/generateUUID.d.ts +0 -1
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
- package/src/components/Pagination/Pagination.stories.tsx +0 -54
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
- package/src/docs/Intro.stories.mdx +0 -53
- package/src/helpers/generateUUID.tsx +0 -5
- package/src/styles/base/_03-base.scss +0 -25
- package/src/styles/base/_04-focus.scss +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,157 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 0.26.0 (April 22, 2022)
|
|
12
|
+
|
|
13
|
+
### Adds
|
|
14
|
+
|
|
15
|
+
- Exports the `useCarouselStyles` and `useWindowSize` hooks and adds documentation for all hooks in Storybook.
|
|
16
|
+
- Adds additional semantic design tokens from `fontWeights` and `fontSizes` to the `useNYPLTheme` hook.
|
|
17
|
+
- Adds a warning if a required `id` prop is not passed to one of the "Form Elements": `Button`, `Checkbox`, `CheckboxGroup`, `DatePicker`, `Fieldset`, `Form`, `Label`, `ProgressIndicator`, `Radio`, `RadioGroup`, `SearchBar`, `Select`, `Slider`, `TextInput`, `Toggle`.
|
|
18
|
+
- Adds the `isRequired` prop to the `Label` component.
|
|
19
|
+
- Adds the `labelPosition` prop to the `Select` component, so that the label can be styled inline with the select input.
|
|
20
|
+
- Adds Chakra's "Style Props" functionality to every Reservoir component. For composed components, such as the `SearchBar` component, these style props are passed to wrapper element. This update also updates the snapshot tests for every component.
|
|
21
|
+
- Adds the functionality to pass all valid HTML attributes to a Reservoir component, such as `data-*` props.
|
|
22
|
+
- Adds semantic design tokens for `spacing` theme object.
|
|
23
|
+
- Adds the `isAlignedRightActions` prop to the `Card` component to render `CardActions` components to the right of the main content area. This only works for the `Card`'s row layout.
|
|
24
|
+
- Adds styles to target native HTML basic elements inside the `StructuredContent` component.
|
|
25
|
+
- Adds `Reservoir` branding to Storybook.
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- Updates the hex color value for `ui.gray.light-cool`, `ui.disabled.primary` and `section.blogs.primary`.
|
|
30
|
+
- Updates the default background color used in the `Accordion` component.
|
|
31
|
+
- Updates the default background color used in the `Hero` component.
|
|
32
|
+
- Updates the background color used in the `SkeletonLoader` component.
|
|
33
|
+
- Updates the background color used in the `VideoPlayer` component.
|
|
34
|
+
- Updates the background colors used in the `Tabs` component.
|
|
35
|
+
- Updates the colors for "secondary" and "pill" variants of the `Button` component.
|
|
36
|
+
- Updates the color values used in the `disabled` state for the `Checkbox`, `Radio`, `Select`, `Slider`, `TextInput` and `Toggle` components.
|
|
37
|
+
- Updates the `Checkbox` component to use "3px" for the border radius.
|
|
38
|
+
- Makes the id prop required for all "Form Elements".
|
|
39
|
+
- Updates how the `Required` text in the `Label` and `Fieldset` components is displayed. Instead of floating to the right of the label and legend elements, it is now displayed inlined as `(Required)`.
|
|
40
|
+
- Renames the `optReqFlag` prop to `showRequiredLabel` in the `CheckboxGroup`, `Fieldset`, `RadioGroup`, and `Slider` components.
|
|
41
|
+
- Renames the `showOptReqLabel` prop to `showRequiredLabel` in the `DatePicker`, `Select`, and `TextInput` components.
|
|
42
|
+
- Uses the design token "text.caption" variable for the `Notification`'s font size.
|
|
43
|
+
- Updates the styling for the `HelperErrorText` to be consistent for all components that use it
|
|
44
|
+
- Refactors the `Checkbox`, `CheckboxGroup`, `ComponentWrapper`, `DatePicker`, `Fieldset`, `Label`, `Radio`, `RadioGroup`, `Select`, `Slider`, `TextInput`, and `Toggle` to better use the updated `HelperErrorText` styling.
|
|
45
|
+
- Renames the `Card`'s `center` prop to `isCentered` and `border` prop to `isBordered`.
|
|
46
|
+
- Renames the `SkeletonLoader` component's `border` prop to `isBordered`.
|
|
47
|
+
- Refactors the DS `RadioGroup` component so it internally implements Chakra's `RadioGroup` component rather than the `useRadioGroup` hook. The "uncontrolled" version of Chakra's `RadioGroup` is not working and will be investigated in the future. It is recommended to use the controlled component pattern.
|
|
48
|
+
- Updates the `Fieldset` component to render the "Optional"/"Required" text in the `legend` element as pseudo CSS in the `::after` rule.
|
|
49
|
+
- Passes the `isRequired` prop in the `RadioGroup` and `CheckboxGroup` to the `Fieldset` wrapper component.
|
|
50
|
+
- Updates the `focus` styles for the `Radio`, `Select` and `TextInput` components.
|
|
51
|
+
- Updates the references of the `<dl>` element from "Definition" to "Description", as that's the official name in HTML5. This affects the `List` element and its `ListTypes.Description` enum value.
|
|
52
|
+
- Updates styles for `React Datepicker`'s calendar popup in the `DatePicker` component.
|
|
53
|
+
- Updates storybook URL from /storybook-static/ to /reservoir/v0_26.
|
|
54
|
+
- Updates all references to "design system" in the Storybook documentation to include "Reservoir" in the name of the design system.
|
|
55
|
+
- Updates language on the `Welcome` page.
|
|
56
|
+
|
|
57
|
+
### Removals
|
|
58
|
+
|
|
59
|
+
- Removes the default `Optional` text displayed in the `Label` and `Fieldset` components.
|
|
60
|
+
- Removes the `optReqFlag` prop in the `Label` component.
|
|
61
|
+
- Removes the default autogenerated id for all components, as well as the `uuid` package.
|
|
62
|
+
- Removes the `HorizontalRule`'s `height` and `width` props from its prop interface in favor of Chakra's style props; the default values are still set for `height` and `width`.
|
|
63
|
+
|
|
64
|
+
### Fixes
|
|
65
|
+
|
|
66
|
+
- Fixes how the `Button` component gets rendered inside the `Form` and `FormField` component layout.
|
|
67
|
+
- Fixes how the `Select` component is controlled in the `SearchBar` component.
|
|
68
|
+
|
|
69
|
+
## 0.25.13 (April 1, 2022)
|
|
70
|
+
|
|
71
|
+
### Adds
|
|
72
|
+
|
|
73
|
+
- Adds a `contentId` prop to the `TemplateAppContainer` component and adds an `id` prop to the `TemplateContent` component. The default value of these `id`s are both set to "mainContent" and it will render as an attribute on the `main` HTML element. This is used as the target for the skip navigation link in consuming applications.
|
|
74
|
+
- Adds an `Accessibility Guide` section to Storybook with a "Skip Navigation" page.
|
|
75
|
+
- Adds the `isFullWidth` prop to the `CheckboxGroup` and `RadioGroup` components. This sets the wrapper element to be full width for labels that need to span its container.
|
|
76
|
+
- Adds an optional key – `accordionType` to the `Accordion`'s `contentData` prop, which allows users to switch the background color of the `Accordion`'s button.
|
|
77
|
+
- Created new `LayoutTypes` enum for row and column layouts.
|
|
78
|
+
- Adds the value "Default" to the `IconSizes` enum.
|
|
79
|
+
|
|
80
|
+
### Changes
|
|
81
|
+
|
|
82
|
+
- Updates Storybook's sidebar categories and documentation.
|
|
83
|
+
- Updates the `Image`'s caption font size to "12px" (`text.tag`).
|
|
84
|
+
- Updates the `Checkbox`'s and `Radio`'s `labelText` prop to accept strings and JSX Elements.
|
|
85
|
+
- Updates the `Toggle`'s internal styling for the default and small sizes.
|
|
86
|
+
- Updates the `Accordion` button's background color when expanded, adds a border color when hovered over, and adjusts the padding.
|
|
87
|
+
- Updates the `CardImage`'s margin bottom in the row and column layouts for mobile to be the same.
|
|
88
|
+
- Updates the `CardImage` to have width 100% on mobile regardless of size.
|
|
89
|
+
- Updates all the console warnings with consistent NYPL branding prefix label.
|
|
90
|
+
- Renames the `Accordion` prop `contentData` to `accordionData`.
|
|
91
|
+
- Renames the `Breadcrumbs` prop `colorVariant` to `breadcrumbsType`.
|
|
92
|
+
- Renames the `Card` prop `center` to `isCentered`.
|
|
93
|
+
- Updates the `Card` prop `layout` to use the `LayoutTypes` enum instead of `CardLayouts`.
|
|
94
|
+
- Updates the `CheckboxGroup` prop `layout` to use the `LayoutTypes` enum instead of `CheckboxGroupLayoutTypes`.
|
|
95
|
+
- Renames the `Heading` prop `displaySize` to `size.
|
|
96
|
+
- Renames the `HeadingDisplaySizes` enum to `HeadingSizes.
|
|
97
|
+
- Renames the `Hero` prop `image` to `imageComponent`.
|
|
98
|
+
- Renames the `Image` prop `imageSize` to `size`.
|
|
99
|
+
- Renames the `Notification` prop `centered` to `isCentered`.
|
|
100
|
+
- Updates the `RadioGroup` prop `layout` to use the `LayoutTypes` enum instead of `RadioGroupLayoutTypes`.
|
|
101
|
+
- Internal updates to the `SearchBar` component based on updates from the `Select` and `TextInput` components.
|
|
102
|
+
- Renames the `Select` prop `type` to `selectType`.
|
|
103
|
+
- Updates the `SkeletonLoader` prop `layout` to use the `LayoutTypes` enum instead of `SkeletonLoaderLayouts`.
|
|
104
|
+
- Renames the `StructuredContentImage` prop `imageSize` to `size` (this component is based on the `Image` component).
|
|
105
|
+
- Internal updates to the `StructuredContent` component based on updates from the `Image` and `Heading` components.
|
|
106
|
+
- Renames the `Tabs` prop `contentData` to `tabsData`.
|
|
107
|
+
- Renames the `Text` prop `displaySize` to `size`.
|
|
108
|
+
- Renames the `TextInput` prop `variant` to `textInputType`.
|
|
109
|
+
- Updates the `Card` image-related props into one main prop named `imageProps`. This new prop contains the following properties: alt, aspectRatio, caption, component, credit, isAtEnd, size, and src.
|
|
110
|
+
- Updates the `Hero` prop `image` to `imageAlt` and `imageSrc`. Internally, an `Image` component is created.
|
|
111
|
+
- Renames the `Image` component props `imageAspectRatio` to `aspectRatio`, `imageCaption` to `caption`, and `imageCredit` to `credit`.
|
|
112
|
+
- Updates the `StructuredContent` image-related props into one main prop named `imageProps`. This new prop contains the following properties: alt, aspectRatio, caption, component, credit, position, size, and src.
|
|
113
|
+
- Renames the `ToggleSizes.tsx` file to `ToggleTypes.tsx`. Updates the values from `Large` and `Small` to `Default` and `Small`.
|
|
114
|
+
- Minor update to the logic for the `ProgressIndicator` sizing prop and styles.
|
|
115
|
+
|
|
116
|
+
### Fixes
|
|
117
|
+
|
|
118
|
+
- Fixes bug where the Next button in `Pagination` would navigate to the previous page.
|
|
119
|
+
- Fixes the alignment of the first link in the `Pagination` component.
|
|
120
|
+
- Fixes the `Breadcrumbs`' SVG arrow icon fill color for the "Blogs" variant.
|
|
121
|
+
- Fixes the margin right value for list items in the `List` component for the inline style.
|
|
122
|
+
- Fixes bug in the `Select` component where the SVG arrow hides when the component is focused.
|
|
123
|
+
- Fixes the extra bottom spacing in the `HeroTypes.Campaign` `Hero` variant for the mobile view.
|
|
124
|
+
- Fixes the `Slider` component so it doesn't cause a stack overflow client-side issue when updating the slider thumbs through the keyboard arrows. The values are now returned through Chakra's `onChange` callback instead of the `onChangeEnd` callback.
|
|
125
|
+
|
|
126
|
+
### Removals
|
|
127
|
+
|
|
128
|
+
- Removes the `CardLayouts`, `CheckboxGroupLayoutTypes`, `RadioGroupLayoutTypes`, and `SkeletonLoaderLayouts` enums.
|
|
129
|
+
- Removes the `CardTypes.tsx`,` CheckboxGroupLayoutTypes.tsx`, and `RadioGroupLayoutTypes.tsx` files.
|
|
130
|
+
|
|
131
|
+
## 0.25.12 (March 18, 2022)
|
|
132
|
+
|
|
133
|
+
### Adds
|
|
134
|
+
|
|
135
|
+
- Adds `Education` section colors to the color palette theme object.
|
|
136
|
+
- Adds a `currentPage` prop to the `Pagination` component, a value that updates the selected page programmatically without the user explicitly requesting it.
|
|
137
|
+
|
|
138
|
+
### Changes
|
|
139
|
+
|
|
140
|
+
- Removes the margin from the global `.nypl p` CSS rule.
|
|
141
|
+
- Updates the top and bottom margin of the `List`'s `Unordered` and `Ordered` types.
|
|
142
|
+
- Updates the `Notification`'s icons to be decorative by default.
|
|
143
|
+
- Updates the default placeholder value for the `SearchBar`'s `TextInput` component.
|
|
144
|
+
- Updates the `SearchBar`'s `textInputProps` prop object to not require the `placeholder` property.
|
|
145
|
+
- Updates the `Logo` component to include new variants for `FirstBook` and `Open eBooks`.
|
|
146
|
+
- Updates the border and text styles for the `Select` component.
|
|
147
|
+
- Updates the `Breadcrumbs` component to inlcude an `Education` color variant.
|
|
148
|
+
- Updates the `Icon` component to include the `Education` color values.
|
|
149
|
+
- Updates the default font stack to fix a typo that was disabling `sans-serif` in the stack.
|
|
150
|
+
- Removes the `.nypl-ds` CSS class from the base SCSS file, from the `TemplateAppContainer` component, from the Storybook configuration, and from the entire repo.
|
|
151
|
+
- Moves the base styles from the SCSS global file to the Chakra theme global JS object.
|
|
152
|
+
- Updates the label font size for the `Radio` and `Checkbox` components to be "label.default".
|
|
153
|
+
|
|
154
|
+
### Fixes
|
|
155
|
+
|
|
156
|
+
- Fixes the styles for the `Slider` to better accomodate the slider thumbs and the width of the container.
|
|
157
|
+
- Updates the alignment of the `Notifications`'s dismissible icon.
|
|
158
|
+
- Fixes the border and padding from the `fieldset` HTML element by removing it.
|
|
159
|
+
- Fixes alignment for long labels in the `Checkbox` and `Radio` components.
|
|
160
|
+
- Fixes the line height for long labels in the `Toggle` component.
|
|
161
|
+
|
|
11
162
|
## 0.25.11 (March 3, 2022)
|
|
12
163
|
|
|
13
164
|
### Updates
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Reservoir Design System
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/%40nypl%2Fdesign-system-react-components)
|
|
6
6
|
|
|
7
|
-
The
|
|
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
9
|
_Note: This library is still in beta. Until we release the stable `1.0.0` version, we are loosely using semantic versioning._
|
|
10
10
|
|
|
@@ -116,17 +116,7 @@ $ npm install @nypl/design-system-react-components
|
|
|
116
116
|
@import "~@nypl/design-system-react-components/dist/styles.css";
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
3.
|
|
120
|
-
|
|
121
|
-
Some CSS rules in the Design System, such as the universal focus styling and the box-model, are namespaced to the `.nypl-ds` class. To include those in your app, add `.nypl-ds` to whichever wrapper tag makes sense in your application (e.g., `<div class="app">` or `<div class="container">`).
|
|
122
|
-
|
|
123
|
-
```jsx
|
|
124
|
-
<div class="app nypl-ds">
|
|
125
|
-
<!-- your code here -->
|
|
126
|
-
</div>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
4. Import the `DSProvider` component
|
|
119
|
+
3. Import the `DSProvider` component
|
|
130
120
|
|
|
131
121
|
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.
|
|
132
122
|
|
|
@@ -141,7 +131,7 @@ const ApplicationContainer = (props) => {
|
|
|
141
131
|
// ...
|
|
142
132
|
return (
|
|
143
133
|
<DSProvider>
|
|
144
|
-
<div className="my-app
|
|
134
|
+
<div className="my-app">
|
|
145
135
|
// ...
|
|
146
136
|
{children}
|
|
147
137
|
</div>
|
|
@@ -150,7 +140,7 @@ const ApplicationContainer = (props) => {
|
|
|
150
140
|
};
|
|
151
141
|
```
|
|
152
142
|
|
|
153
|
-
|
|
143
|
+
4. Use DS components!
|
|
154
144
|
|
|
155
145
|
Consult Storybook for the list of available components and props that they require.
|
|
156
146
|
|
|
@@ -181,13 +171,11 @@ function NewComponent(props) {
|
|
|
181
171
|
|
|
182
172
|
### NYPL DS, NYPL Header, and NYPL Footer
|
|
183
173
|
|
|
184
|
-
Please note that, if used, the NYPL Header and Footer components should be _outside_ of the `.nypl-ds` wrapper class.
|
|
185
|
-
|
|
186
174
|
```jsx
|
|
187
175
|
<body>
|
|
188
176
|
<NYPLHeader />
|
|
189
177
|
|
|
190
|
-
<div class="app
|
|
178
|
+
<div class="app">
|
|
191
179
|
<!-- your code here -->
|
|
192
180
|
</div>
|
|
193
181
|
|
|
@@ -197,7 +185,7 @@ Please note that, if used, the NYPL Header and Footer components should be _outs
|
|
|
197
185
|
|
|
198
186
|
## Using Chakra UI Components
|
|
199
187
|
|
|
200
|
-
The Chakra UI component library has been integrated into the
|
|
188
|
+
The Chakra UI component library has been integrated into the Reservoir Design System. We are still progressing towards using Chakra components and patterns to build DS components, and therefore documentation and features are expected to change. While the implementation details of DS components will use Chakra, the DS package itself will export _some_ Chakra components.
|
|
201
189
|
|
|
202
190
|
The list of re-exported Chakra components can be found in the main [index.ts](/src/index.ts) file. They include:
|
|
203
191
|
|
|
@@ -228,15 +216,15 @@ You can check out a working Codepen with unpkg [here](https://codepen.io/edwingu
|
|
|
228
216
|
|
|
229
217
|
## Storybook
|
|
230
218
|
|
|
231
|
-
The
|
|
219
|
+
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/storybook-static/?path=/story/introduction--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.
|
|
232
220
|
|
|
233
221
|
### Documentation Instances
|
|
234
222
|
|
|
235
|
-
There are currently two main instances of the
|
|
223
|
+
There are currently two main instances of the Reservoir Design System Storybook documentation. There are also "preview" sites that are used to quickly and easily view pull request changes.
|
|
236
224
|
|
|
237
225
|
**Production**
|
|
238
226
|
|
|
239
|
-
The production Storybook documentation is deployed to [Github Pages](https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/introduction--page). This is the main instance we use to share the latest stable release of the
|
|
227
|
+
The production Storybook documentation is deployed to [Github Pages](https://nypl.github.io/nypl-design-system/storybook-static/?path=/story/introduction--page). This is the main instance we use to share the latest stable release of the Reservoir Design System. This documentation site is deployed through [Github Actions](/.github/workflows/gh-pages.yml) only on merges to the `release` branch.
|
|
240
228
|
|
|
241
229
|
As of July, 2021, the Github Pages production site gets deployed every two weeks on the same schedule as npm releases.
|
|
242
230
|
|
|
@@ -283,11 +271,11 @@ You can then view `/storybook-static/index.html` in your browser. _Make sure not
|
|
|
283
271
|
|
|
284
272
|
## Typescript Usage
|
|
285
273
|
|
|
286
|
-
The
|
|
274
|
+
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.
|
|
287
275
|
|
|
288
276
|
## Unit Testing
|
|
289
277
|
|
|
290
|
-
The
|
|
278
|
+
The Reservoir Design System runs unit tests with Jest and React Testing Library.
|
|
291
279
|
|
|
292
280
|
To run all tests once:
|
|
293
281
|
|
|
@@ -371,7 +359,7 @@ After writing new tests, run `npm run test:generate-output` to create a new JSON
|
|
|
371
359
|
|
|
372
360
|
### Development and Storybook
|
|
373
361
|
|
|
374
|
-
The
|
|
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.
|
|
375
363
|
|
|
376
364
|
We make use of:
|
|
377
365
|
|
|
@@ -383,7 +371,7 @@ If applicable, DS components have section(s) on accessibility in their Storybook
|
|
|
383
371
|
|
|
384
372
|
### Product Requirements
|
|
385
373
|
|
|
386
|
-
The
|
|
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/).
|
|
387
375
|
|
|
388
376
|
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
389
377
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { AccordionTypes } from "./AccordionTypes";
|
|
3
|
+
export interface AccordionDataProps {
|
|
4
|
+
accordionType?: AccordionTypes;
|
|
3
5
|
label: string;
|
|
4
6
|
panel: string | React.ReactNode;
|
|
5
7
|
}
|
|
6
8
|
export interface AccordionProps {
|
|
7
|
-
/** Array of data to display */
|
|
8
|
-
|
|
9
|
+
/** Array of data to display, and an optional accordionType */
|
|
10
|
+
accordionData: AccordionDataProps[];
|
|
9
11
|
/** ID that other components can cross reference for accessibility purposes */
|
|
10
12
|
id?: string;
|
|
11
13
|
/** Whether the accordion is open by default only on its initial rendering */
|
|
@@ -15,5 +17,5 @@ export interface AccordionProps {
|
|
|
15
17
|
* Accordion component that shows content on toggle. Can be used to display
|
|
16
18
|
* multiple accordion items together.
|
|
17
19
|
*/
|
|
18
|
-
declare
|
|
20
|
+
export declare const Accordion: import("@chakra-ui/react").ChakraComponent<(props: AccordionProps) => JSX.Element, {}>;
|
|
19
21
|
export default Accordion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { BreadcrumbsTypes } from "./BreadcrumbsTypes";
|
|
3
3
|
export interface BreadcrumbsDataProps {
|
|
4
4
|
url: string;
|
|
5
5
|
text: string | React.ReactNode;
|
|
@@ -11,12 +11,12 @@ export interface BreadcrumbProps {
|
|
|
11
11
|
};
|
|
12
12
|
/** Breadcrumb links as an array */
|
|
13
13
|
breadcrumbsData: BreadcrumbsDataProps[];
|
|
14
|
+
/** Used to control how the `Hero` component will be rendered. */
|
|
15
|
+
breadcrumbsType?: BreadcrumbsTypes;
|
|
14
16
|
/** className you can add in addition to 'input' */
|
|
15
17
|
className?: string;
|
|
16
18
|
/** ID that other components can cross reference for accessibility purposes */
|
|
17
19
|
id?: string;
|
|
18
|
-
/** Used to control how the `Hero` component will be rendered. */
|
|
19
|
-
colorVariant?: ColorVariants;
|
|
20
20
|
}
|
|
21
|
-
declare
|
|
21
|
+
export declare const Breadcrumbs: import("@chakra-ui/react").ChakraComponent<(props: BreadcrumbProps) => JSX.Element, {}>;
|
|
22
22
|
export default Breadcrumbs;
|
|
@@ -15,7 +15,7 @@ interface ButtonProps {
|
|
|
15
15
|
/** Additional className to use. */
|
|
16
16
|
className?: string;
|
|
17
17
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
18
|
-
id
|
|
18
|
+
id: string;
|
|
19
19
|
/** Adds 'disabled' property to the button. */
|
|
20
20
|
isDisabled?: boolean;
|
|
21
21
|
/** Trigger the Button's action through the `mouseDown` event handler instead
|
|
@@ -29,5 +29,5 @@ interface ButtonProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Renders a simple `button` element with custom variant styles.
|
|
31
31
|
*/
|
|
32
|
-
declare
|
|
32
|
+
export declare const Button: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<ButtonProps>) => JSX.Element, {}>;
|
|
33
33
|
export default Button;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
2
|
+
import { LayoutTypes } from "../../helpers/enums";
|
|
3
|
+
import { ComponentImageProps } from "../Image/Image";
|
|
5
4
|
interface CardBaseProps {
|
|
6
5
|
/** Optional value to control the alignment of the text and elements. */
|
|
7
|
-
|
|
6
|
+
isCentered?: boolean;
|
|
8
7
|
/** Optional value to render the layout in a row or column.
|
|
9
|
-
* Default is `
|
|
10
|
-
layout?:
|
|
8
|
+
* Default is `LayoutTypes.Column`. */
|
|
9
|
+
layout?: LayoutTypes;
|
|
11
10
|
}
|
|
12
11
|
interface CardLinkBoxProps {
|
|
13
12
|
/** Main link to use when the full `Card` component should be clickable. */
|
|
14
13
|
mainActionLink?: string;
|
|
15
14
|
}
|
|
15
|
+
interface CardImageProps extends ComponentImageProps {
|
|
16
|
+
/** Optional boolean value to control the position of the `CardImage`. */
|
|
17
|
+
isAtEnd?: boolean;
|
|
18
|
+
}
|
|
16
19
|
interface CardActionsProps extends CardBaseProps {
|
|
17
20
|
/** Optional boolean value to control visibility of border on the bottom edge
|
|
18
21
|
* of the card actions element */
|
|
@@ -24,33 +27,23 @@ interface CardActionsProps extends CardBaseProps {
|
|
|
24
27
|
export interface CardProps extends CardBaseProps, CardLinkBoxProps {
|
|
25
28
|
/** Optional hex color value used to set the card background color. */
|
|
26
29
|
backgroundColor?: string;
|
|
27
|
-
/** Optional boolean value to control the visibility of a border around
|
|
28
|
-
* the card. */
|
|
29
|
-
border?: boolean;
|
|
30
30
|
/** Optional CSS class name to add. */
|
|
31
31
|
className?: string;
|
|
32
32
|
/** Optional hex color value used to override the default text color. */
|
|
33
33
|
foregroundColor?: string;
|
|
34
34
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
35
35
|
id?: string;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/** Custom image component used in place of DS `Image` component. */
|
|
45
|
-
imageComponent?: JSX.Element;
|
|
46
|
-
/** Optional value to control the size of the `CardImage`. Default value is
|
|
47
|
-
* `ImageSizes.Default`. */
|
|
48
|
-
imageSize?: ImageSizes;
|
|
49
|
-
/** The path to the image displayed within the `Card` component. */
|
|
50
|
-
imageSrc?: string;
|
|
36
|
+
/** Optional boolean value to control the visibility of a border around
|
|
37
|
+
* the card. */
|
|
38
|
+
isBordered?: boolean;
|
|
39
|
+
/** Object used to create and render the `Image` component. */
|
|
40
|
+
imageProps?: CardImageProps;
|
|
41
|
+
/** Set CardActions to the right content side. This only works in
|
|
42
|
+
* the row layout. */
|
|
43
|
+
isAlignedRightActions?: boolean;
|
|
51
44
|
}
|
|
52
|
-
export declare const CardHeading:
|
|
53
|
-
export declare
|
|
54
|
-
export declare
|
|
55
|
-
export
|
|
56
|
-
export
|
|
45
|
+
export declare const CardHeading: import("@chakra-ui/react").ChakraComponent<import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<import("../Heading/Heading").HeadingProps>) => JSX.Element, {}>, {}>;
|
|
46
|
+
export declare const CardContent: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<{}>) => JSX.Element, {}>;
|
|
47
|
+
export declare const CardActions: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<CardActionsProps>) => JSX.Element, {}>;
|
|
48
|
+
export declare const Card: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<CardProps>) => JSX.Element, {}>;
|
|
49
|
+
export default Card;
|
|
@@ -6,7 +6,7 @@ export interface CheckboxProps {
|
|
|
6
6
|
/** Optional string to populate the HelperErrorText for standard state */
|
|
7
7
|
helperText?: HelperErrorTextType;
|
|
8
8
|
/** ID that other components can cross reference for accessibility purposes */
|
|
9
|
-
id
|
|
9
|
+
id: string;
|
|
10
10
|
/** Optional string to populate the HelperErrorText for the error state
|
|
11
11
|
* when `isInvalid` is true. */
|
|
12
12
|
invalidText?: HelperErrorTextType;
|
|
@@ -27,7 +27,7 @@ export interface CheckboxProps {
|
|
|
27
27
|
isRequired?: boolean;
|
|
28
28
|
/** The checkbox's label. This will serve as the text content for a `<label>`
|
|
29
29
|
* element if `showlabel` is true, or an "aria-label" if `showLabel` is false. */
|
|
30
|
-
labelText: string;
|
|
30
|
+
labelText: string | JSX.Element;
|
|
31
31
|
/** The name prop indicates into which group of checkboxes this checkbox
|
|
32
32
|
* belongs. If none is specified, 'default' will be used */
|
|
33
33
|
name?: string;
|
|
@@ -42,5 +42,5 @@ export interface CheckboxProps {
|
|
|
42
42
|
value?: string;
|
|
43
43
|
}
|
|
44
44
|
export declare const onChangeDefault: () => void;
|
|
45
|
-
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement
|
|
45
|
+
export declare const Checkbox: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>, {}>;
|
|
46
46
|
export default Checkbox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { CheckboxGroupLayoutTypes } from "./CheckboxGroupLayoutTypes";
|
|
3
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
+
import { LayoutTypes } from "../../helpers/enums";
|
|
4
4
|
export interface CheckboxGroupProps {
|
|
5
5
|
/** Any child node passed to the component. */
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -9,11 +9,13 @@ export interface CheckboxGroupProps {
|
|
|
9
9
|
/** Optional string to populate the HelperErrorText for standard state */
|
|
10
10
|
helperText?: HelperErrorTextType;
|
|
11
11
|
/** ID that other components can cross reference for accessibility purposes */
|
|
12
|
-
id
|
|
12
|
+
id: string;
|
|
13
13
|
/** Optional string to populate the HelperErrorText for error state */
|
|
14
14
|
invalidText?: HelperErrorTextType;
|
|
15
15
|
/** Adds the 'disabled' prop to the input when true. */
|
|
16
16
|
isDisabled?: boolean;
|
|
17
|
+
/** Set's the `Checkbox`s' wrapper to be full width. */
|
|
18
|
+
isFullWidth?: boolean;
|
|
17
19
|
/** A`dds the 'aria-invalid' attribute to the input and
|
|
18
20
|
* sets the error state when true. */
|
|
19
21
|
isInvalid?: boolean;
|
|
@@ -23,18 +25,19 @@ export interface CheckboxGroupProps {
|
|
|
23
25
|
* true, or an "aria-label" if `showLabel` is false. */
|
|
24
26
|
labelText: string;
|
|
25
27
|
/** Renders the checkbox buttons in a row or column (default). */
|
|
26
|
-
layout?:
|
|
28
|
+
layout?: LayoutTypes;
|
|
27
29
|
/** The `name` prop indicates the form group for all the `Checkbox` children. */
|
|
28
30
|
name: string;
|
|
29
31
|
/** The action to perform on the `<input>`'s onChange function */
|
|
30
32
|
onChange?: (value: string[]) => void;
|
|
31
|
-
/** Whether or not to display "Required"/"Optional" in the label text. */
|
|
32
|
-
optReqFlag?: boolean;
|
|
33
33
|
/** Offers the ability to hide the helper/invalid text. */
|
|
34
34
|
showHelperInvalidText?: boolean;
|
|
35
35
|
/** Offers the ability to show the group's legend onscreen or hide it. Refer
|
|
36
36
|
* to the `labelText` property for more information. */
|
|
37
37
|
showLabel?: boolean;
|
|
38
|
+
/** Whether or not to display the "(Required)" text in the label text.
|
|
39
|
+
* True by default. */
|
|
40
|
+
showRequiredLabel?: boolean;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Wrapper component to wrap `Checkbox` components. Can be displayed in a
|
|
@@ -42,5 +45,5 @@ export interface CheckboxGroupProps {
|
|
|
42
45
|
* wrapping and associated text elements, but the checkbox input elements
|
|
43
46
|
* _need_ to be child `Checkbox` components from the NYPL Design System.
|
|
44
47
|
*/
|
|
45
|
-
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLInputElement
|
|
48
|
+
export declare const CheckboxGroup: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLInputElement>>, {}>;
|
|
46
49
|
export default CheckboxGroup;
|
|
@@ -17,5 +17,5 @@ export interface ComponentWrapperProps {
|
|
|
17
17
|
/** Sets invalid text in the error state. */
|
|
18
18
|
isInvalid?: boolean;
|
|
19
19
|
}
|
|
20
|
-
declare
|
|
20
|
+
export declare const ComponentWrapper: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<ComponentWrapperProps>) => JSX.Element, {}>;
|
|
21
21
|
export default ComponentWrapper;
|
|
@@ -11,7 +11,7 @@ export interface FullDateType {
|
|
|
11
11
|
}
|
|
12
12
|
interface DateRangeRowProps {
|
|
13
13
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
14
|
-
id
|
|
14
|
+
id: string;
|
|
15
15
|
/** Whether to render a single date input or two for a range of two dates. */
|
|
16
16
|
isDateRange?: boolean;
|
|
17
17
|
}
|
|
@@ -24,8 +24,9 @@ interface DatePickerWrapperProps extends DateRangeRowProps {
|
|
|
24
24
|
labelText: string;
|
|
25
25
|
/** Offers the ability to show the label onscreen or hide it. */
|
|
26
26
|
showLabel?: boolean;
|
|
27
|
-
/** Whether or not to display the "Required"
|
|
28
|
-
|
|
27
|
+
/** Whether or not to display the "(Required)" text in the label text.
|
|
28
|
+
* True by default. */
|
|
29
|
+
showRequiredLabel?: boolean;
|
|
29
30
|
}
|
|
30
31
|
export interface DatePickerProps extends DatePickerWrapperProps {
|
|
31
32
|
/** The date format to display. Defaults to "yyyy-MM-dd".
|
|
@@ -72,11 +73,9 @@ export interface DatePickerProps extends DatePickerWrapperProps {
|
|
|
72
73
|
refTo?: React.Ref<TextInputRefType>;
|
|
73
74
|
/** Offers the ability to hide the helper/invalid text. */
|
|
74
75
|
showHelperInvalidText?: boolean;
|
|
75
|
-
/** Whether or not to display the "Required"/"Optional" text in the label text. */
|
|
76
|
-
showOptReqLabel?: boolean;
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
79
78
|
* Returns a single date input field or two date input fields for a date range.
|
|
80
79
|
*/
|
|
81
|
-
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<TextInputRefType
|
|
80
|
+
export declare const DatePicker: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<TextInputRefType>>, {}>;
|
|
82
81
|
export default DatePicker;
|
|
@@ -3,21 +3,20 @@ interface FieldsetProps {
|
|
|
3
3
|
/** Additional class name to add. */
|
|
4
4
|
className?: string;
|
|
5
5
|
/** ID that other components can cross reference for accessibility purposes */
|
|
6
|
-
id
|
|
6
|
+
id: string;
|
|
7
7
|
/** Flag to show or hide the text in the `legend` element. False by default. */
|
|
8
8
|
isLegendHidden?: boolean;
|
|
9
|
-
/** Flag to render "Required"
|
|
10
|
-
* False/"Optional" by default. */
|
|
9
|
+
/** Flag to render "Required" in the `legend`. True by default. */
|
|
11
10
|
isRequired?: boolean;
|
|
12
11
|
/** Text to display in the `legend` element. */
|
|
13
12
|
legendText?: string;
|
|
14
|
-
/**
|
|
13
|
+
/** Whether or not to display the "(Required)" text in the `legend` text.
|
|
15
14
|
* True by default. */
|
|
16
|
-
|
|
15
|
+
showRequiredLabel?: boolean;
|
|
17
16
|
}
|
|
18
17
|
/**
|
|
19
18
|
* A wrapper component that renders a `fieldset` element along with a `legend`
|
|
20
19
|
* element as its first child. Commonly used to wrap form components.
|
|
21
20
|
*/
|
|
22
|
-
declare const Fieldset: ({ children, className, id, isLegendHidden, isRequired, legendText,
|
|
21
|
+
export declare const Fieldset: import("@chakra-ui/react").ChakraComponent<({ children, className, id, isLegendHidden, isRequired, legendText, showRequiredLabel, ...rest }: React.PropsWithChildren<FieldsetProps>) => JSX.Element, {}>;
|
|
23
22
|
export default Fieldset;
|
|
@@ -8,9 +8,9 @@ interface FormBaseProps {
|
|
|
8
8
|
* should not be used``` */
|
|
9
9
|
gap?: FormGaps;
|
|
10
10
|
/** ID that other components can cross reference (internal use) */
|
|
11
|
-
id
|
|
11
|
+
id: string;
|
|
12
12
|
}
|
|
13
|
-
export interface FormChildProps extends FormBaseProps {
|
|
13
|
+
export interface FormChildProps extends Partial<FormBaseProps> {
|
|
14
14
|
}
|
|
15
15
|
export interface FormProps extends FormBaseProps {
|
|
16
16
|
/** Optional form `action` attribute */
|
|
@@ -21,9 +21,9 @@ export interface FormProps extends FormBaseProps {
|
|
|
21
21
|
onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
22
22
|
}
|
|
23
23
|
/** FormRow child-component */
|
|
24
|
-
export declare
|
|
24
|
+
export declare const FormRow: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormChildProps>) => JSX.Element, {}>;
|
|
25
25
|
/** FormField child-component */
|
|
26
|
-
export declare
|
|
26
|
+
export declare const FormField: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormChildProps>) => JSX.Element, {}>;
|
|
27
27
|
/** Main Form component */
|
|
28
|
-
export
|
|
29
|
-
export
|
|
28
|
+
export declare const Form: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormProps>) => JSX.Element, {}>;
|
|
29
|
+
export default Form;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare enum GridGaps {
|
|
2
|
-
ExtraExtraSmall = "xxs",
|
|
3
|
-
ExtraSmall = "xs",
|
|
4
|
-
Small = "s",
|
|
5
|
-
Medium = "m",
|
|
6
|
-
Large = "l",
|
|
7
|
-
ExtraLarge = "xl",
|
|
8
|
-
ExtraExtraLarge = "xxl"
|
|
2
|
+
ExtraExtraSmall = "grid.xxs",
|
|
3
|
+
ExtraSmall = "grid.xs",
|
|
4
|
+
Small = "grid.s",
|
|
5
|
+
Medium = "grid.m",
|
|
6
|
+
Large = "grid.l",
|
|
7
|
+
ExtraLarge = "grid.xl",
|
|
8
|
+
ExtraExtraLarge = "grid.xxl"
|
|
9
9
|
}
|