@nypl/design-system-react-components 0.25.12 → 0.26.1
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 +131 -1
- package/README.md +10 -10
- 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 +1 -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 +1 -0
- 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 +2 -0
- package/dist/components/Logo/LogoTypes.d.ts +4 -2
- package/dist/components/Notification/Notification.d.ts +7 -7
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +3 -3
- package/dist/components/Radio/Radio.d.ts +5 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -8
- package/dist/components/SearchBar/SearchBar.d.ts +4 -4
- 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 +17 -8
- 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 +2075 -1468
- 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 +2086 -1483
- 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 +3 -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 -4
- 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 +4 -14
- package/dist/theme/components/global.d.ts +25 -18
- 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 +99 -9
- package/dist/theme/components/notification.d.ts +4 -4
- package/dist/theme/components/pagination.d.ts +2 -5
- package/dist/theme/components/radio.d.ts +7 -4
- package/dist/theme/components/radioGroup.d.ts +4 -2
- package/dist/theme/components/select.d.ts +37 -5
- package/dist/theme/components/skeletonLoader.d.ts +2 -2
- package/dist/theme/components/slider.d.ts +6 -3
- package/dist/theme/components/structuredContent.d.ts +197 -0
- package/dist/theme/components/textInput.d.ts +18 -6
- package/dist/theme/components/toggle.d.ts +20 -5
- package/dist/theme/foundations/global.d.ts +2 -0
- package/dist/theme/foundations/radii.d.ts +1 -0
- package/dist/theme/foundations/spacing.d.ts +46 -43
- package/package.json +5 -6
- package/src/components/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 +37 -19
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +57 -36
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +14 -13
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +211 -12
- package/src/components/Button/Button.stories.mdx +87 -23
- package/src/components/Button/Button.test.tsx +25 -0
- package/src/components/Button/Button.tsx +18 -7
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +27 -7
- package/src/components/Card/Card.stories.mdx +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 +221 -101
- 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 +26 -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 +1 -0
- 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 +4 -0
- package/src/components/Logo/LogoTypes.tsx +3 -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 +29 -5
- package/src/components/Notification/Notification.test.tsx +23 -0
- package/src/components/Notification/Notification.tsx +53 -51
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +158 -29
- package/src/components/Pagination/Pagination.stories.mdx +27 -6
- package/src/components/Pagination/Pagination.test.tsx +55 -2
- package/src/components/Pagination/Pagination.tsx +12 -9
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +244 -27
- package/src/components/Placeholder/Placeholder.tsx +3 -1
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +76 -10
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +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 -62
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +163 -5
- 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 +101 -36
- package/src/components/SearchBar/{SearchBar.Test.tsx → SearchBar.test.tsx} +46 -4
- package/src/components/SearchBar/SearchBar.tsx +20 -11
- 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 +30 -23
- 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 +5 -5
- package/src/components/StyleGuide/Breakpoints.stories.mdx +6 -6
- package/src/components/StyleGuide/Buttons.stories.mdx +2 -12
- package/src/components/StyleGuide/ColorCard.tsx +4 -4
- package/src/components/StyleGuide/Colors.stories.mdx +1 -2
- package/src/components/StyleGuide/DesignTokens.stories.mdx +56 -26
- package/src/components/StyleGuide/Forms.stories.mdx +27 -12
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -12
- package/src/components/StyleGuide/Spacing.stories.mdx +80 -41
- package/src/components/StyleGuide/Typography.stories.mdx +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 +89 -71
- 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 +29 -26
- package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +191 -4
- 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 +50 -9
- 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 +1 -1
- package/src/theme/components/accordion.ts +7 -12
- package/src/theme/components/breadcrumb.ts +3 -0
- package/src/theme/components/button.ts +15 -7
- package/src/theme/components/card.ts +56 -36
- package/src/theme/components/checkbox.ts +10 -8
- 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 +1 -2
- package/src/theme/components/global.ts +29 -23
- 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 +73 -66
- package/src/theme/components/notification.ts +7 -7
- package/src/theme/components/pagination.ts +2 -5
- package/src/theme/components/progressIndicator.ts +3 -3
- package/src/theme/components/radio.ts +9 -9
- package/src/theme/components/radioGroup.ts +4 -2
- package/src/theme/components/select.ts +35 -16
- package/src/theme/components/skeletonLoader.ts +3 -3
- package/src/theme/components/slider.ts +8 -7
- package/src/theme/components/statusBadge.ts +2 -2
- package/src/theme/components/structuredContent.ts +66 -1
- package/src/theme/components/tabs.ts +2 -2
- package/src/theme/components/template.ts +9 -9
- package/src/theme/components/textInput.ts +13 -12
- package/src/theme/components/toggle.ts +43 -13
- package/src/theme/components/videoPlayer.ts +1 -1
- package/src/theme/foundations/colors.ts +1 -1
- package/src/theme/foundations/radii.ts +1 -0
- package/src/theme/foundations/spacing.ts +70 -22
- package/src/theme/foundations/typography.ts +2 -2
- package/src/utils/componentCategories.ts +28 -21
- package/dist/components/Card/CardTypes.d.ts +0 -4
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
- 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/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
- package/src/docs/Intro.stories.mdx +0 -53
- package/src/helpers/generateUUID.tsx +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,9 +8,139 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 0.26.1 (April 22, 2022)
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Updates storybook URL from /reservoir/v0_26 to /reservoir/v0.
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- Adds updated package-lock file to fix bad installations.
|
|
20
|
+
|
|
21
|
+
## 0.26.0 (April 22, 2022)
|
|
22
|
+
|
|
23
|
+
### Adds
|
|
24
|
+
|
|
25
|
+
- Exports the `useCarouselStyles` and `useWindowSize` hooks and adds documentation for all hooks in Storybook.
|
|
26
|
+
- Adds additional semantic design tokens from `fontWeights` and `fontSizes` to the `useNYPLTheme` hook.
|
|
27
|
+
- 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`.
|
|
28
|
+
- Adds the `isRequired` prop to the `Label` component.
|
|
29
|
+
- Adds the `labelPosition` prop to the `Select` component, so that the label can be styled inline with the select input.
|
|
30
|
+
- 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.
|
|
31
|
+
- Adds the functionality to pass all valid HTML attributes to a Reservoir component, such as `data-*` props.
|
|
32
|
+
- Adds semantic design tokens for `spacing` theme object.
|
|
33
|
+
- 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.
|
|
34
|
+
- Adds styles to target native HTML basic elements inside the `StructuredContent` component.
|
|
35
|
+
- Adds `Reservoir` branding to Storybook.
|
|
36
|
+
|
|
37
|
+
### Changes
|
|
38
|
+
|
|
39
|
+
- Updates the hex color value for `ui.gray.light-cool`, `ui.disabled.primary` and `section.blogs.primary`.
|
|
40
|
+
- Updates the default background color used in the `Accordion` component.
|
|
41
|
+
- Updates the default background color used in the `Hero` component.
|
|
42
|
+
- Updates the background color used in the `SkeletonLoader` component.
|
|
43
|
+
- Updates the background color used in the `VideoPlayer` component.
|
|
44
|
+
- Updates the background colors used in the `Tabs` component.
|
|
45
|
+
- Updates the colors for "secondary" and "pill" variants of the `Button` component.
|
|
46
|
+
- Updates the color values used in the `disabled` state for the `Checkbox`, `Radio`, `Select`, `Slider`, `TextInput` and `Toggle` components.
|
|
47
|
+
- Updates the `Checkbox` component to use "3px" for the border radius.
|
|
48
|
+
- Makes the id prop required for all "Form Elements".
|
|
49
|
+
- 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)`.
|
|
50
|
+
- Renames the `optReqFlag` prop to `showRequiredLabel` in the `CheckboxGroup`, `Fieldset`, `RadioGroup`, and `Slider` components.
|
|
51
|
+
- Renames the `showOptReqLabel` prop to `showRequiredLabel` in the `DatePicker`, `Select`, and `TextInput` components.
|
|
52
|
+
- Uses the design token "text.caption" variable for the `Notification`'s font size.
|
|
53
|
+
- Updates the styling for the `HelperErrorText` to be consistent for all components that use it
|
|
54
|
+
- Refactors the `Checkbox`, `CheckboxGroup`, `ComponentWrapper`, `DatePicker`, `Fieldset`, `Label`, `Radio`, `RadioGroup`, `Select`, `Slider`, `TextInput`, and `Toggle` to better use the updated `HelperErrorText` styling.
|
|
55
|
+
- Renames the `Card`'s `center` prop to `isCentered` and `border` prop to `isBordered`.
|
|
56
|
+
- Renames the `SkeletonLoader` component's `border` prop to `isBordered`.
|
|
57
|
+
- 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.
|
|
58
|
+
- Updates the `Fieldset` component to render the "Optional"/"Required" text in the `legend` element as pseudo CSS in the `::after` rule.
|
|
59
|
+
- Passes the `isRequired` prop in the `RadioGroup` and `CheckboxGroup` to the `Fieldset` wrapper component.
|
|
60
|
+
- Updates the `focus` styles for the `Radio`, `Select` and `TextInput` components.
|
|
61
|
+
- 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.
|
|
62
|
+
- Updates styles for `React Datepicker`'s calendar popup in the `DatePicker` component.
|
|
63
|
+
- Updates storybook URL from /storybook-static/ to /reservoir/v0_26.
|
|
64
|
+
- Updates all references to "design system" in the Storybook documentation to include "Reservoir" in the name of the design system.
|
|
65
|
+
- Updates language on the `Welcome` page.
|
|
66
|
+
|
|
67
|
+
### Removals
|
|
68
|
+
|
|
69
|
+
- Removes the default `Optional` text displayed in the `Label` and `Fieldset` components.
|
|
70
|
+
- Removes the `optReqFlag` prop in the `Label` component.
|
|
71
|
+
- Removes the default autogenerated id for all components, as well as the `uuid` package.
|
|
72
|
+
- 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`.
|
|
73
|
+
|
|
74
|
+
### Fixes
|
|
75
|
+
|
|
76
|
+
- Fixes how the `Button` component gets rendered inside the `Form` and `FormField` component layout.
|
|
77
|
+
- Fixes how the `Select` component is controlled in the `SearchBar` component.
|
|
78
|
+
|
|
79
|
+
## 0.25.13 (April 1, 2022)
|
|
80
|
+
|
|
81
|
+
### Adds
|
|
82
|
+
|
|
83
|
+
- 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.
|
|
84
|
+
- Adds an `Accessibility Guide` section to Storybook with a "Skip Navigation" page.
|
|
85
|
+
- 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.
|
|
86
|
+
- Adds an optional key – `accordionType` to the `Accordion`'s `contentData` prop, which allows users to switch the background color of the `Accordion`'s button.
|
|
87
|
+
- Created new `LayoutTypes` enum for row and column layouts.
|
|
88
|
+
- Adds the value "Default" to the `IconSizes` enum.
|
|
89
|
+
|
|
90
|
+
### Changes
|
|
91
|
+
|
|
92
|
+
- Updates Storybook's sidebar categories and documentation.
|
|
93
|
+
- Updates the `Image`'s caption font size to "12px" (`text.tag`).
|
|
94
|
+
- Updates the `Checkbox`'s and `Radio`'s `labelText` prop to accept strings and JSX Elements.
|
|
95
|
+
- Updates the `Toggle`'s internal styling for the default and small sizes.
|
|
96
|
+
- Updates the `Accordion` button's background color when expanded, adds a border color when hovered over, and adjusts the padding.
|
|
97
|
+
- Updates the `CardImage`'s margin bottom in the row and column layouts for mobile to be the same.
|
|
98
|
+
- Updates the `CardImage` to have width 100% on mobile regardless of size.
|
|
99
|
+
- Updates all the console warnings with consistent NYPL branding prefix label.
|
|
100
|
+
- Renames the `Accordion` prop `contentData` to `accordionData`.
|
|
101
|
+
- Renames the `Breadcrumbs` prop `colorVariant` to `breadcrumbsType`.
|
|
102
|
+
- Renames the `Card` prop `center` to `isCentered`.
|
|
103
|
+
- Updates the `Card` prop `layout` to use the `LayoutTypes` enum instead of `CardLayouts`.
|
|
104
|
+
- Updates the `CheckboxGroup` prop `layout` to use the `LayoutTypes` enum instead of `CheckboxGroupLayoutTypes`.
|
|
105
|
+
- Renames the `Heading` prop `displaySize` to `size.
|
|
106
|
+
- Renames the `HeadingDisplaySizes` enum to `HeadingSizes.
|
|
107
|
+
- Renames the `Hero` prop `image` to `imageComponent`.
|
|
108
|
+
- Renames the `Image` prop `imageSize` to `size`.
|
|
109
|
+
- Renames the `Notification` prop `centered` to `isCentered`.
|
|
110
|
+
- Updates the `RadioGroup` prop `layout` to use the `LayoutTypes` enum instead of `RadioGroupLayoutTypes`.
|
|
111
|
+
- Internal updates to the `SearchBar` component based on updates from the `Select` and `TextInput` components.
|
|
112
|
+
- Renames the `Select` prop `type` to `selectType`.
|
|
113
|
+
- Updates the `SkeletonLoader` prop `layout` to use the `LayoutTypes` enum instead of `SkeletonLoaderLayouts`.
|
|
114
|
+
- Renames the `StructuredContentImage` prop `imageSize` to `size` (this component is based on the `Image` component).
|
|
115
|
+
- Internal updates to the `StructuredContent` component based on updates from the `Image` and `Heading` components.
|
|
116
|
+
- Renames the `Tabs` prop `contentData` to `tabsData`.
|
|
117
|
+
- Renames the `Text` prop `displaySize` to `size`.
|
|
118
|
+
- Renames the `TextInput` prop `variant` to `textInputType`.
|
|
119
|
+
- 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.
|
|
120
|
+
- Updates the `Hero` prop `image` to `imageAlt` and `imageSrc`. Internally, an `Image` component is created.
|
|
121
|
+
- Renames the `Image` component props `imageAspectRatio` to `aspectRatio`, `imageCaption` to `caption`, and `imageCredit` to `credit`.
|
|
122
|
+
- 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.
|
|
123
|
+
- Renames the `ToggleSizes.tsx` file to `ToggleTypes.tsx`. Updates the values from `Large` and `Small` to `Default` and `Small`.
|
|
124
|
+
- Minor update to the logic for the `ProgressIndicator` sizing prop and styles.
|
|
125
|
+
|
|
126
|
+
### Fixes
|
|
127
|
+
|
|
128
|
+
- Fixes bug where the Next button in `Pagination` would navigate to the previous page.
|
|
129
|
+
- Fixes the alignment of the first link in the `Pagination` component.
|
|
130
|
+
- Fixes the `Breadcrumbs`' SVG arrow icon fill color for the "Blogs" variant.
|
|
131
|
+
- Fixes the margin right value for list items in the `List` component for the inline style.
|
|
132
|
+
- Fixes bug in the `Select` component where the SVG arrow hides when the component is focused.
|
|
133
|
+
- Fixes the extra bottom spacing in the `HeroTypes.Campaign` `Hero` variant for the mobile view.
|
|
134
|
+
- 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.
|
|
135
|
+
|
|
136
|
+
### Removals
|
|
137
|
+
|
|
138
|
+
- Removes the `CardLayouts`, `CheckboxGroupLayoutTypes`, `RadioGroupLayoutTypes`, and `SkeletonLoaderLayouts` enums.
|
|
139
|
+
- Removes the `CardTypes.tsx`,` CheckboxGroupLayoutTypes.tsx`, and `RadioGroupLayoutTypes.tsx` files.
|
|
140
|
+
|
|
11
141
|
## 0.25.12 (March 18, 2022)
|
|
12
142
|
|
|
13
|
-
|
|
143
|
+
### Adds
|
|
14
144
|
|
|
15
145
|
- Adds `Education` section colors to the color palette theme object.
|
|
16
146
|
- Adds a `currentPage` prop to the `Pagination` component, a value that updates the selected page programmatically without the user explicitly requesting it.
|
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
|
|
|
@@ -185,7 +185,7 @@ function NewComponent(props) {
|
|
|
185
185
|
|
|
186
186
|
## Using Chakra UI Components
|
|
187
187
|
|
|
188
|
-
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.
|
|
189
189
|
|
|
190
190
|
The list of re-exported Chakra components can be found in the main [index.ts](/src/index.ts) file. They include:
|
|
191
191
|
|
|
@@ -216,15 +216,15 @@ You can check out a working Codepen with unpkg [here](https://codepen.io/edwingu
|
|
|
216
216
|
|
|
217
217
|
## Storybook
|
|
218
218
|
|
|
219
|
-
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.
|
|
220
220
|
|
|
221
221
|
### Documentation Instances
|
|
222
222
|
|
|
223
|
-
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.
|
|
224
224
|
|
|
225
225
|
**Production**
|
|
226
226
|
|
|
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
|
|
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.
|
|
228
228
|
|
|
229
229
|
As of July, 2021, the Github Pages production site gets deployed every two weeks on the same schedule as npm releases.
|
|
230
230
|
|
|
@@ -271,11 +271,11 @@ You can then view `/storybook-static/index.html` in your browser. _Make sure not
|
|
|
271
271
|
|
|
272
272
|
## Typescript Usage
|
|
273
273
|
|
|
274
|
-
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.
|
|
275
275
|
|
|
276
276
|
## Unit Testing
|
|
277
277
|
|
|
278
|
-
The
|
|
278
|
+
The Reservoir Design System runs unit tests with Jest and React Testing Library.
|
|
279
279
|
|
|
280
280
|
To run all tests once:
|
|
281
281
|
|
|
@@ -359,7 +359,7 @@ After writing new tests, run `npm run test:generate-output` to create a new JSON
|
|
|
359
359
|
|
|
360
360
|
### Development and Storybook
|
|
361
361
|
|
|
362
|
-
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.
|
|
363
363
|
|
|
364
364
|
We make use of:
|
|
365
365
|
|
|
@@ -371,7 +371,7 @@ If applicable, DS components have section(s) on accessibility in their Storybook
|
|
|
371
371
|
|
|
372
372
|
### Product Requirements
|
|
373
373
|
|
|
374
|
-
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/).
|
|
375
375
|
|
|
376
376
|
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
377
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
|
}
|
|
@@ -10,5 +10,5 @@ export interface SimpleGridProps {
|
|
|
10
10
|
/** ID that other components can cross reference for accessibility purposes */
|
|
11
11
|
id?: string;
|
|
12
12
|
}
|
|
13
|
-
declare
|
|
13
|
+
export declare const SimpleGrid: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<SimpleGridProps>) => JSX.Element, {}>;
|
|
14
14
|
export default SimpleGrid;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { HeadingSizes, HeadingLevels } from "./HeadingTypes";
|
|
3
3
|
export interface HeadingProps {
|
|
4
4
|
/** Optionally pass in additional Chakra-based styles. */
|
|
5
5
|
additionalStyles?: {
|
|
@@ -7,14 +7,14 @@ export interface HeadingProps {
|
|
|
7
7
|
};
|
|
8
8
|
/** Optional className that appears in addition to `heading` */
|
|
9
9
|
className?: string;
|
|
10
|
-
/** Optional size used to override the default styles of the semantic HTM
|
|
11
|
-
* `<h>` elements */
|
|
12
|
-
displaySize?: HeadingDisplaySizes;
|
|
13
10
|
/** Optional ID that other components can cross reference for accessibility purposes */
|
|
14
11
|
id?: string;
|
|
15
12
|
/** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed,
|
|
16
13
|
* `Heading` will default to `<h2>` */
|
|
17
14
|
level?: HeadingLevels;
|
|
15
|
+
/** Optional size used to override the default styles of the semantic HTM
|
|
16
|
+
* `<h>` elements */
|
|
17
|
+
size?: HeadingSizes;
|
|
18
18
|
/** Inner text of the `<h*>` element */
|
|
19
19
|
text?: string;
|
|
20
20
|
/** Optional URL that header points to; when `url` prop is passed to
|
|
@@ -24,5 +24,5 @@ export interface HeadingProps {
|
|
|
24
24
|
/** Optional className for the URL when the `url` prop is passed */
|
|
25
25
|
urlClass?: string;
|
|
26
26
|
}
|
|
27
|
-
declare
|
|
27
|
+
export declare const Heading: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<HeadingProps>) => JSX.Element, {}>;
|
|
28
28
|
export default Heading;
|