@nypl/design-system-react-components 0.25.2 → 0.25.6
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 +101 -0
- package/README.md +47 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +9 -8
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +36 -52
- package/dist/components/Card/CardTypes.d.ts +0 -15
- package/dist/components/Checkbox/Checkbox.d.ts +8 -9
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts +36 -36
- package/dist/components/Fieldset/Fieldset.d.ts +25 -0
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +4 -0
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +10 -3
- package/dist/components/Icons/Icon.d.ts +4 -0
- package/dist/components/Icons/IconSvgs.d.ts +11 -0
- package/dist/components/Icons/IconTypes.d.ts +11 -0
- package/dist/components/Image/Image.d.ts +19 -9
- package/dist/components/Image/ImageTypes.d.ts +20 -0
- package/dist/components/Link/Link.d.ts +4 -0
- package/dist/components/List/List.d.ts +7 -1
- package/dist/components/Notification/Notification.d.ts +6 -4
- package/dist/components/Pagination/Pagination.d.ts +16 -13
- package/dist/components/Pagination/Pagination.stories.d.ts +2 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
- package/dist/components/SearchBar/SearchBar.d.ts +3 -3
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +18 -14
- package/dist/components/Slider/Slider.d.ts +57 -0
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +10 -0
- package/dist/design-system-react-components.cjs.development.js +3058 -936
- 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 +3049 -921
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +12 -6
- package/dist/resources.scss +180 -170
- package/dist/styles.css +1 -1
- package/dist/theme/components/breadcrumb.d.ts +9 -0
- package/dist/theme/components/button.d.ts +22 -8
- package/dist/theme/components/card.d.ts +168 -0
- package/dist/theme/components/checkbox.d.ts +5 -1
- package/dist/theme/components/checkboxGroup.d.ts +12 -0
- package/dist/theme/components/datePicker.d.ts +16 -0
- package/dist/theme/components/fieldset.d.ts +27 -0
- package/dist/theme/components/global.d.ts +23 -13
- package/dist/theme/components/globalMixins.d.ts +9 -1
- package/dist/theme/components/heading.d.ts +5 -0
- package/dist/theme/components/image.d.ts +31 -0
- package/dist/theme/components/label.d.ts +5 -3
- package/dist/theme/components/link.d.ts +4 -0
- package/dist/theme/components/list.d.ts +5 -1
- package/dist/theme/components/notification.d.ts +4 -14
- package/dist/theme/components/pagination.d.ts +19 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/radioGroup.d.ts +12 -0
- package/dist/theme/components/select.d.ts +11 -2
- package/dist/theme/components/skeletonLoader.d.ts +98 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/components/textInput.d.ts +8 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +6 -1
- package/package.json +72 -84
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +39 -42
- package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
- package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -0
- package/src/components/Autosuggest/_Autosuggest.scss +5 -5
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +24 -8
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +33 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +298 -1
- package/src/components/Button/Button.stories.mdx +15 -10
- package/src/components/Button/Button.test.tsx +21 -7
- package/src/components/Button/Button.tsx +18 -33
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +41 -10
- package/src/components/Card/Card.stories.mdx +296 -259
- package/src/components/Card/Card.test.tsx +156 -84
- package/src/components/Card/Card.tsx +195 -145
- package/src/components/Card/CardTypes.tsx +0 -17
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +410 -0
- package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
- package/src/components/CardEdition/_CardEdition.scss +22 -23
- package/src/components/Chakra/Box.stories.mdx +14 -15
- package/src/components/Chakra/Center.stories.mdx +15 -8
- package/src/components/Chakra/Grid.stories.mdx +16 -7
- package/src/components/Chakra/Stack.stories.mdx +35 -18
- package/src/components/Checkbox/Checkbox.stories.mdx +33 -11
- package/src/components/Checkbox/Checkbox.test.tsx +30 -3
- package/src/components/Checkbox/Checkbox.tsx +27 -27
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +90 -2
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +82 -2
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +14 -15
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +44 -80
- package/src/components/DatePicker/DatePicker.stories.mdx +163 -62
- package/src/components/DatePicker/DatePicker.test.tsx +248 -65
- package/src/components/DatePicker/DatePicker.tsx +158 -130
- package/src/components/DatePicker/_DatePicker.scss +33 -67
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +818 -0
- package/src/components/Fieldset/Fieldset.stories.mdx +55 -0
- package/src/components/Fieldset/Fieldset.test.tsx +125 -0
- package/src/components/Fieldset/Fieldset.tsx +52 -0
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +68 -0
- package/src/components/Form/Form.stories.mdx +4 -5
- package/src/components/Form/Form.tsx +1 -0
- package/src/components/Grid/SimpleGrid.stories.mdx +32 -39
- package/src/components/Grid/SimpleGrid.test.tsx +4 -4
- package/src/components/Heading/Heading.stories.mdx +3 -4
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
- package/src/components/HelperErrorText/HelperErrorText.tsx +5 -1
- package/src/components/Hero/HeroTypes.tsx +1 -0
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +7 -7
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -5
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +17 -0
- package/src/components/HorizontalRule/HorizontalRule.tsx +21 -4
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +5 -5
- package/src/components/Icons/Icon.stories.mdx +11 -3
- package/src/components/Icons/Icon.test.tsx +18 -0
- package/src/components/Icons/Icon.tsx +6 -0
- package/src/components/Icons/IconSvgs.tsx +22 -0
- package/src/components/Icons/IconTypes.tsx +11 -0
- package/src/components/Image/Image.stories.mdx +220 -0
- package/src/components/Image/Image.test.tsx +131 -29
- package/src/components/Image/Image.tsx +84 -56
- package/src/components/Image/ImageTypes.ts +22 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +190 -0
- package/src/components/Input/Input.stories.tsx +20 -64
- package/src/components/Input/_Input.scss +23 -14
- package/src/components/Link/Link.tsx +4 -1
- package/src/components/List/List.stories.mdx +1 -1
- package/src/components/List/List.tsx +11 -4
- package/src/components/Modal/Modal.stories.mdx +3 -3
- package/src/components/Modal/_Modal.scss +2 -2
- package/src/components/Notification/Notification.stories.mdx +1 -3
- package/src/components/Notification/Notification.tsx +24 -9
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +2 -0
- package/src/components/Pagination/Pagination.stories.mdx +26 -27
- package/src/components/Pagination/Pagination.stories.tsx +11 -16
- package/src/components/Pagination/Pagination.test.tsx +276 -146
- package/src/components/Pagination/Pagination.tsx +174 -154
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +285 -0
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
- package/src/components/RadioGroup/RadioGroup.stories.mdx +3 -4
- package/src/components/RadioGroup/RadioGroup.tsx +11 -16
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +39 -71
- package/src/components/SearchBar/SearchBar.Test.tsx +66 -21
- package/src/components/SearchBar/SearchBar.stories.mdx +114 -10
- package/src/components/SearchBar/SearchBar.tsx +15 -5
- package/src/components/Select/SelectTypes.tsx +1 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +28 -59
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +97 -177
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +74 -71
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +739 -0
- package/src/components/Slider/Slider.stories.mdx +529 -0
- package/src/components/Slider/Slider.test.tsx +653 -0
- package/src/components/Slider/Slider.tsx +303 -0
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
- package/src/components/StyleGuide/Breakpoints.stories.mdx +21 -7
- package/src/components/StyleGuide/Buttons.stories.mdx +69 -15
- package/src/components/StyleGuide/ColorCard.tsx +0 -1
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/StyleGuide/Iconography.stories.mdx +51 -62
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Template/Template.stories.mdx +11 -16
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +23 -6
- package/src/components/TextInput/TextInputTypes.tsx +2 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -3
- package/src/docs/Chakra.stories.mdx +2 -2
- package/src/index.ts +20 -12
- package/src/resources.scss +5 -5
- package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
- package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
- package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
- package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
- package/src/styles/base/_place-holder.scss +14 -3
- package/src/styles/{03-space → space}/_space-inline.scss +14 -14
- package/src/styles/{03-space → space}/_space-inset.scss +10 -10
- package/src/styles/space/_space-stack.scss +116 -0
- package/src/styles.scss +13 -55
- package/src/theme/components/breadcrumb.ts +10 -0
- package/src/theme/components/button.ts +18 -12
- package/src/theme/components/card.ts +174 -0
- package/src/theme/components/checkbox.ts +7 -2
- package/src/theme/components/checkboxGroup.ts +8 -0
- package/src/theme/components/datePicker.ts +17 -0
- package/src/theme/components/fieldset.ts +18 -0
- package/src/theme/components/global.ts +26 -15
- package/src/theme/components/globalMixins.ts +9 -1
- package/src/theme/components/heading.ts +5 -0
- package/src/theme/components/image.ts +116 -0
- package/src/theme/components/label.ts +3 -10
- package/src/theme/components/link.ts +4 -0
- package/src/theme/components/list.ts +6 -3
- package/src/theme/components/notification.ts +12 -14
- package/src/theme/components/pagination.ts +20 -0
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/radioGroup.ts +8 -0
- package/src/theme/components/select.ts +5 -2
- package/src/theme/components/skeletonLoader.ts +107 -0
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/components/textInput.ts +2 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/global.ts +6 -1
- package/src/theme/index.ts +22 -4
- package/src/utils/componentCategories.ts +4 -3
- package/dist/components/Image/Image.stories.d.ts +0 -18
- package/dist/theme/components/customCheckboxGroup.d.ts +0 -18
- package/dist/theme/components/customRadioGroup.d.ts +0 -18
- package/src/components/Button/_Button.scss +0 -32
- package/src/components/Card/_Card.scss +0 -308
- package/src/components/Image/Image.stories.tsx +0 -54
- package/src/components/Image/_Image.scss +0 -38
- package/src/components/Pagination/_Pagination.scss +0 -40
- package/src/components/SkeletonLoader/_SkeletonLoader.scss +0 -142
- package/src/styles/01-colors/_colors-brand.scss +0 -62
- package/src/styles/01-colors/_colors-utility.scss +0 -67
- package/src/styles/02-typography/_type-scale.css +0 -11
- package/src/styles/02-typography/_type-weight.css +0 -7
- package/src/styles/02-typography/_typefaces.css +0 -4
- package/src/styles/03-space/_space-stack.scss +0 -116
- package/src/styles/03-space/_space.css +0 -30
- package/src/styles/base/_card-grid.scss +0 -77
- package/src/styles/base/_typography.scss +0 -11
- package/src/theme/components/customCheckboxGroup.ts +0 -12
- package/src/theme/components/customRadioGroup.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,107 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 0.25.6 (December 16, 2021)
|
|
12
|
+
|
|
13
|
+
### Adds
|
|
14
|
+
|
|
15
|
+
- Adds export statements for `ProgressIndicator` and `Slider` components to `index.ts`.
|
|
16
|
+
- Adds `Blogs` variant to `Breadcrumbs` component.
|
|
17
|
+
|
|
18
|
+
### Changes
|
|
19
|
+
|
|
20
|
+
- Adds "(Required)" text to the placeholder in the `SearchBar` component when `isRequired` is true.
|
|
21
|
+
|
|
22
|
+
## 0.25.5 (December 9, 2021)
|
|
23
|
+
|
|
24
|
+
### Fixes
|
|
25
|
+
|
|
26
|
+
- Updates the Github Action for the Github Pages deployment to use node 12 instead of the default node 16. This caused issues since we now set the node engine to `<=12.22`.
|
|
27
|
+
|
|
28
|
+
## 0.25.4 (December 9, 2021)
|
|
29
|
+
|
|
30
|
+
### Adds
|
|
31
|
+
|
|
32
|
+
- Adds the `ProgressIndicator` component.
|
|
33
|
+
- Adds documentation for using `NYPL Design Tokens`.
|
|
34
|
+
- Adds the `ActionHelpDefault`, `ActionHelpOutline` and `ActionLaunch` icons to the `Icon` component.
|
|
35
|
+
- Adds the DS `Slider` component based on the Chakra `Slider` and `RangeSlider` components.
|
|
36
|
+
- Adds the `ButtonTypes.NoBrand` variant to the `Button` component.
|
|
37
|
+
- Adds the `additionalStyles` prop to the `Breadcrumbs` component.
|
|
38
|
+
|
|
39
|
+
### Changes
|
|
40
|
+
|
|
41
|
+
- Updates the organization of SCSS files by deleting some files and combining others.
|
|
42
|
+
- Updates `@chakra-ui/react` to version 1.7.1 and `@chakra-ui/system` to version 1.8.1.
|
|
43
|
+
- Updates the `TextInput` component to now have `defaultValue` and `step` props.
|
|
44
|
+
- Updates `Latest Version` number for `Image`, `Notification` and `Pagination` components.
|
|
45
|
+
- Removes the Storybook "Knobs" addon.
|
|
46
|
+
- Updates the margin for labels in the `DatePicker` component when it is in the "date range" state.
|
|
47
|
+
- Updates the `DatePicker` component to have proper form spacing when in the "date range" state.
|
|
48
|
+
- Updates the `Tabs` component to comply with linting rules -- no functional or visual changes were made.
|
|
49
|
+
- Removes the `alignText` prop from the `Notification` component. Storybook was incorrectly displaying `alignText` as an available prop.
|
|
50
|
+
|
|
51
|
+
### Fixes
|
|
52
|
+
|
|
53
|
+
- Exports components and variables that were initially missed when they were added: `ColorVariants`, `Fieldset`, `IconAlign`, `StatusBadgeTypes`,
|
|
54
|
+
- Fixes `SearchBar` by passing necessary props down to its `TextInput` through the `textInputProps` prop.
|
|
55
|
+
- Fixes `DatePicker` component unit tests.
|
|
56
|
+
- Removes the `showLabel` prop from the `SearchBar` component to prevent confusion. Labels for the `Select` and `TextInput` components are never shown but are added through the `aria-label` attribute.
|
|
57
|
+
|
|
58
|
+
### Breaking Changes
|
|
59
|
+
|
|
60
|
+
- Updates the breakpoint CSS variable names by adding the `--nypl` prefix and the SCSS variables by adding the `$nypl` prefix. Updates references throughout the codebase.
|
|
61
|
+
- Changes the `Button`'s `disabled` prop to `isDisabled`.
|
|
62
|
+
- Updates npm packages in `package.json`. Removes `cpy-cli`, `react-uid`, `react-is`, `stylelint` and related packages, and `ts-loader` (already added through TSDX). Updates other packages such as `sass-loader`, `prettier`, `jest`, `jest-axe`, and the majority of Storybook addon packages.
|
|
63
|
+
|
|
64
|
+
### Deprecates
|
|
65
|
+
|
|
66
|
+
- Deprecates the `Input` component. The `Input` component will be removed from the NYPL Design System React Library in the first release of January 2022.
|
|
67
|
+
- Deprecates the `CardEdition` component. The `CardEdition` component will be removed from the NYPL Design System React Library in the first release of January 2022.
|
|
68
|
+
|
|
69
|
+
## 0.25.3 (November 18, 2021)
|
|
70
|
+
|
|
71
|
+
### Adds
|
|
72
|
+
|
|
73
|
+
- Adds the `ImageRatios`, `ImageSizes`, and `ImageTypes` enums.
|
|
74
|
+
- Composes the DS `Fieldset` component with Chakra. This always renders a `legend` element as its first child but it can be optionally hidden from the screen.
|
|
75
|
+
- Adds the ability to make an entire `Card` component clickable with Chakra's `LinkBox` and `LinkOverlay` components. Links in the `CardActions` component can still be accessed in this state by clicking with the mouse or tabbing and pressing "enter".
|
|
76
|
+
- Adds new file type SVG files to use in the `Icon` component: Audio, Doc, GenericDoc, Image, PDF, Spreadsheet, Video.
|
|
77
|
+
- Adds `ActionCheckCircle` SVG file to use in the `Icon` component.
|
|
78
|
+
|
|
79
|
+
### Changes
|
|
80
|
+
|
|
81
|
+
- Updates the Github Action for the changelog reminder.
|
|
82
|
+
- Updates the `Checkbox` component with an "indeterminate" state through the `isIndeterminate` prop.
|
|
83
|
+
- Updates the `CheckboxGroup` component story with an "indeterminate" state example.
|
|
84
|
+
- Updates the `CheckboxGroup` and `RadioGroup` components to use the `Fieldset` component.
|
|
85
|
+
- Updates the `HelperErrorText` and `TextInput` components with added `additionalStyles` prop.
|
|
86
|
+
- Updates the `Button` Style Guide documentation.
|
|
87
|
+
- Updates the `Iconography` Style Guide story documentation.
|
|
88
|
+
- Updates the `Button` font weight to "regular".
|
|
89
|
+
|
|
90
|
+
### Fixes
|
|
91
|
+
|
|
92
|
+
- Fixes nondeterministic unit test in the `DatePicker` component.
|
|
93
|
+
- Version of latest `List` component release in its storybook page.
|
|
94
|
+
- Adds validation to the `height` prop in the `HorizontalRule` so percentage values are not used. If a percentage value is used, the default "2px" value is set.
|
|
95
|
+
- Fixes styling issues for the `Notification` dismissible button.
|
|
96
|
+
- Fixes `SearchBar` mobile styling for the `Select`, `TextInput`, and `Button` components.
|
|
97
|
+
- Fixes `SearchBar` focus flicker when the `Select` component is selected.
|
|
98
|
+
|
|
99
|
+
### Breaking Changes
|
|
100
|
+
|
|
101
|
+
- Updates the `Notification` component to fix the custom icon alignment.
|
|
102
|
+
- Adds the `title` prop to the `Icon` component to render a `title` HTML element for accessible SVG icons.
|
|
103
|
+
- Updates the default font size of the `Button` component to `"-1"` (14px) for all variants except the `Link` variant. Removes the `bem` function from internal use and makes it clearer that the `ButtonGroup` Chakra component is exported in the Design System.
|
|
104
|
+
- Updates the `errorText` prop to `invalidText` for the `Checkbox` component.
|
|
105
|
+
- Composes the DS `Pagination` component with Chakra. Removes the BEM-related props and updates the `currentPage` prop to `initialPage`. The current selected page is now kept in state inside the `Pagination` component and returned to the user through `getPageHref` or `onPageChange`. This also adds better aria attributes to the list inside the `Pagination` component.
|
|
106
|
+
- Composes the DS `Image` component with Chakra styling and updates all `Image` references in other DS components. The `attributes` prop and the BEM related props `blockname` and `modifiers` have been removed. Adds the following new props: `additionalStyles`, `component`, `imageAspectRatio`, `imageSize`, `imageType`.
|
|
107
|
+
- Composes the DS `Card` component with Chakra. BEM related props `modifiers` and `blockname` have been removed. Replaces the `CardImageRatios` with `ImageRatios`. Removes the `CardImageSizes` enum.
|
|
108
|
+
- Composes the DS `DatePicker` component with Chakra. Adds more tests, documentation, and examples. This component now uses the `Fieldset` component for the date range type, and better `Form` components for layout. Prop name changes: `dateRange` is now `isDateRange` and `required` is now `isRequired`. BEM related props `modifiers` and `blockname` have been removed. The "Required"/"Optional" text in the date range legend can now be hidden with the `showOptReqLabel` prop.
|
|
109
|
+
- Composes the DS `SkeletonLoader` with Chakra's `Skeleton` component. BEM related prop `modifiers` has been removed. Chakra's default `Skeleton` styles have been updated with NYPL's theme.
|
|
110
|
+
- Removes deprecated CSS variables. Now the DS repo only uses the CSS variables exposed by Chakra that contain the `--nypl` prefix.
|
|
111
|
+
|
|
11
112
|
## 0.25.2 (October 28, 2021)
|
|
12
113
|
|
|
13
114
|
### Adds
|
package/README.md
CHANGED
|
@@ -19,11 +19,11 @@ Storybook documentation
|
|
|
19
19
|
| 2. | [Developing with NPM Link](#developing-with-npm-link) |
|
|
20
20
|
| 3. | [Using the Design System in Your Product](#using-the-design-system-in-your-product) |
|
|
21
21
|
| 4. | [Using Chakra UI Components](#using-chakra-ui-components) |
|
|
22
|
-
| 5. | [
|
|
23
|
-
| 6. | [
|
|
24
|
-
| 7. | [
|
|
25
|
-
| 8. | [
|
|
26
|
-
| 9. | [
|
|
22
|
+
| 5. | [Storybook](#storybook) |
|
|
23
|
+
| 6. | [Typescript Usage](#typescript-usage) |
|
|
24
|
+
| 7. | [Unit Testing](#unit-testing) |
|
|
25
|
+
| 8. | [Accessibility](#accessibility) |
|
|
26
|
+
| 9. | [CDN](#cdn) |
|
|
27
27
|
|
|
28
28
|
## Contributing Quickstart
|
|
29
29
|
|
|
@@ -53,6 +53,12 @@ Information about active maintainers, how we run reviews, and more can be found
|
|
|
53
53
|
|
|
54
54
|
Follow the [contribution document](/.github/CONTRIBUTING.md) to follow git branching convetions, component creation and update guidelines, testing methodoly, and documentation guidelines.
|
|
55
55
|
|
|
56
|
+
### Node Version
|
|
57
|
+
|
|
58
|
+
We recommend using Node version 12.22.x since the DS has some issues with versions higher than 12.x. The Github Actions for linting, automated testing, deploying to Github Pages, and releasing to npm are all running on Node 12.x.
|
|
59
|
+
|
|
60
|
+
If you are using `nvm`, the local `.nvmrc` file can be use to set your local Node version with the `nvm use` command (will be set to `12.22.x`).
|
|
61
|
+
|
|
56
62
|
## Developing with NPM Link
|
|
57
63
|
|
|
58
64
|
To develop with a local version of the Design System:
|
|
@@ -220,12 +226,6 @@ If you need to reference a particular version you can do do by including the ver
|
|
|
220
226
|
|
|
221
227
|
You can check out a working Codepen with unpkg [here](https://codepen.io/edwinguzman/pen/ExmXGKx).
|
|
222
228
|
|
|
223
|
-
## Accessibility Product Requirements
|
|
224
|
-
|
|
225
|
-
The NYPL 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/).
|
|
226
|
-
|
|
227
|
-
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
228
|
-
|
|
229
229
|
## Storybook
|
|
230
230
|
|
|
231
231
|
The NYPL 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 NYPL 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.
|
|
@@ -366,3 +366,39 @@ Each snapshot file also includes a link to its [Jest Snapshot documentation](htt
|
|
|
366
366
|
Through the [`@storybook/addon-jest`](https://www.npmjs.com/package/@storybook/addon-jest) plugin, we can see a component's suite of unit tests right Storybook. In the "Addons" panel, a "Test" tab will display all the tests for the current component and whether they pass or fail.
|
|
367
367
|
|
|
368
368
|
After writing new tests, run `npm run test:generate-output` to create a new JSON file that is used by Storybook. This JSON file contains all the test suites for all the components and Storybook picks this up and automatically combines a component with its relevant unit tests. Make sure to commit this file although new builds on Github Pages will recreate this file for the production Storybook instance.
|
|
369
|
+
|
|
370
|
+
## Accessibility
|
|
371
|
+
|
|
372
|
+
### Development and Storybook
|
|
373
|
+
|
|
374
|
+
The NYPL 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
|
+
|
|
376
|
+
We make use of:
|
|
377
|
+
|
|
378
|
+
- `eslint-plugin-jsx-a11y` for finding accessibility errors through linting and through IDE environments.
|
|
379
|
+
- `jest-axe` for running [`axe-core`](https://github.com/dequelabs/axe-core) on _every_ component's unit test file. This is part of the automated tests that run in Github Actions through the `npm test` command.
|
|
380
|
+
- `@storybook/addon-a11y` for real-time accessibility testing in the browser through Storybook. _Every_ component has a tab that displays violations, passes, and incomplete checks performed by `axe-core`.
|
|
381
|
+
|
|
382
|
+
If applicable, DS components have section(s) on accessibility in their Storybook documentation. For example, in the `Slider`'s [Storybook file](/src/components/Slider/Slider.stories.mdx), there are two "Accessibility" sections for each of the two `Slider` types, "single" and "range". This gives an explanation on additional changes we made to make the combination of elements in the `Slider` component accessible.
|
|
383
|
+
|
|
384
|
+
### Product Requirements
|
|
385
|
+
|
|
386
|
+
The NYPL 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
|
+
|
|
388
|
+
NYPL's Metronome instance is currently password protected. For access to Metronome, please contact NYPL's UX team or Design System team.
|
|
389
|
+
|
|
390
|
+
## CDN
|
|
391
|
+
|
|
392
|
+
You can also use the Design System styles in your project through the `unpkg` CDN:
|
|
393
|
+
|
|
394
|
+
```jsx
|
|
395
|
+
<link href="https://unpkg.com/@nypl/design-system-react-components/dist/styles.css">
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
If you need to reference a particular version you can do do by including the version number in the URL:
|
|
399
|
+
|
|
400
|
+
```jsx
|
|
401
|
+
<link href="https://unpkg.com/@nypl/design-system-react-components@0.9.1/dist/styles.css">
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
You can check out a working Codepen with unpkg [here](https://codepen.io/edwinguzman/pen/ExmXGKx).
|
|
@@ -5,6 +5,10 @@ export interface BreadcrumbsDataProps {
|
|
|
5
5
|
text: string | React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export interface BreadcrumbProps {
|
|
8
|
+
/** Optionally pass in additional Chakra-based styles. */
|
|
9
|
+
additionalStyles?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
8
12
|
/** Breadcrumb links as an array */
|
|
9
13
|
breadcrumbsData: BreadcrumbsDataProps[];
|
|
10
14
|
/** className you can add in addition to 'input' */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { ButtonGroup } from "@chakra-ui/react";
|
|
3
2
|
import { ButtonTypes } from "./ButtonTypes";
|
|
4
3
|
declare type ButtonElementType = "submit" | "button" | "reset";
|
|
5
4
|
interface ButtonProps {
|
|
@@ -13,20 +12,22 @@ interface ButtonProps {
|
|
|
13
12
|
};
|
|
14
13
|
/** The kind of button assigned through the `ButtonTypes` enum */
|
|
15
14
|
buttonType?: ButtonTypes;
|
|
16
|
-
/** Additional className
|
|
15
|
+
/** Additional className to use. */
|
|
17
16
|
className?: string;
|
|
18
|
-
/** Adds 'disabled' property to the button */
|
|
19
|
-
disabled?: boolean;
|
|
20
17
|
/** ID that other components can cross reference for accessibility purposes */
|
|
21
18
|
id?: string;
|
|
22
|
-
/**
|
|
19
|
+
/** Adds 'disabled' property to the button */
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
/** Trigger the Button's action through the `mouseDown` event handler instead
|
|
22
|
+
* of `onClick`. `false` by default. */
|
|
23
23
|
mouseDown?: boolean;
|
|
24
24
|
/** The action to perform on the `<button>`'s onClick function */
|
|
25
25
|
onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
26
|
-
/** The
|
|
26
|
+
/** The HTML button type attribute. */
|
|
27
27
|
type?: ButtonElementType;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Renders a simple `button` element with custom variant styles.
|
|
31
|
+
*/
|
|
30
32
|
declare function Button(props: React.PropsWithChildren<ButtonProps>): JSX.Element;
|
|
31
|
-
export { ButtonGroup };
|
|
32
33
|
export default Button;
|
|
@@ -1,70 +1,54 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/** Optional value to control the aspect ratio of the cartd image; default value is `square` */
|
|
11
|
-
imageAspectRatio?: CardImageRatios;
|
|
12
|
-
/** Optional value to control the size of the card image */
|
|
13
|
-
imageSize?: CardImageSizes;
|
|
14
|
-
/** The src attribute is required, and contains the path to the image you want to embed. */
|
|
15
|
-
src: string;
|
|
2
|
+
import { CardLayouts } from "./CardTypes";
|
|
3
|
+
import Heading from "../Heading/Heading";
|
|
4
|
+
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
5
|
+
interface CardBaseProps {
|
|
6
|
+
/** Optional value to control the alignment of the text and elements. */
|
|
7
|
+
center?: boolean;
|
|
8
|
+
/** Optional value to render the layout in a row or column (default). */
|
|
9
|
+
layout?: CardLayouts;
|
|
16
10
|
}
|
|
17
|
-
interface
|
|
18
|
-
/**
|
|
19
|
-
|
|
11
|
+
interface CardLinkBoxProps {
|
|
12
|
+
/** Main link to use when the full `Card` component should be clickable. */
|
|
13
|
+
mainActionLink?: string;
|
|
20
14
|
}
|
|
21
|
-
interface CardActionsProps {
|
|
22
|
-
/** Optional boolean value to control visibility of border on the bottom edge
|
|
15
|
+
interface CardActionsProps extends CardBaseProps {
|
|
16
|
+
/** Optional boolean value to control visibility of border on the bottom edge
|
|
17
|
+
* of the card actions element */
|
|
23
18
|
bottomBorder?: boolean;
|
|
24
|
-
/** Optional
|
|
25
|
-
|
|
26
|
-
/** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
27
|
-
modifiers?: string[];
|
|
28
|
-
/** Optional boolean value to control visibility of border on the top edge of the card actions element */
|
|
19
|
+
/** Optional boolean value to control visibility of border on the top edge of
|
|
20
|
+
* the card actions element */
|
|
29
21
|
topBorder?: boolean;
|
|
30
22
|
}
|
|
31
|
-
export interface CardProps {
|
|
32
|
-
/** Optional hex color value used to set the card background color */
|
|
23
|
+
export interface CardProps extends CardBaseProps, CardLinkBoxProps {
|
|
24
|
+
/** Optional hex color value used to set the card background color. */
|
|
33
25
|
backgroundColor?: string;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
/** Optional boolean value to control the visibility of a border around the card */
|
|
26
|
+
/** Optional boolean value to control the visibility of a border around
|
|
27
|
+
* the card. */
|
|
37
28
|
border?: boolean;
|
|
38
|
-
/** Optional
|
|
39
|
-
center?: boolean;
|
|
40
|
-
/** ClassName that appears in addition to "card" */
|
|
29
|
+
/** Optional CSS class name to add. */
|
|
41
30
|
className?: string;
|
|
42
|
-
/** Optional hex color value used to override the default text color */
|
|
31
|
+
/** Optional hex color value used to override the default text color. */
|
|
43
32
|
foregroundColor?: string;
|
|
44
|
-
/** ID that other components can cross reference for accessibility purposes */
|
|
33
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
45
34
|
id?: string;
|
|
46
|
-
/** Text description of the image; to follow best practices for accessibility,
|
|
35
|
+
/** Text description of the image; to follow best practices for accessibility,
|
|
36
|
+
* this prop should not be left blank if `imageSrc` is passed. */
|
|
47
37
|
imageAlt?: string;
|
|
48
|
-
/** Optional value to control the aspect ratio of the
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
/** Optional value to control the aspect ratio of the `CardIage`; default
|
|
39
|
+
* value is `square`. */
|
|
40
|
+
imageAspectRatio?: ImageRatios;
|
|
41
|
+
/** Optional boolean value to control the position of the `CardImage`. */
|
|
51
42
|
imageAtEnd?: boolean;
|
|
52
|
-
/** Custom image component used in place of DS `Image` component */
|
|
53
|
-
imageComponent?:
|
|
54
|
-
/** Optional value to control the size of the
|
|
55
|
-
imageSize?:
|
|
56
|
-
/** The path to the image displayed
|
|
43
|
+
/** Custom image component used in place of DS `Image` component. */
|
|
44
|
+
imageComponent?: JSX.Element;
|
|
45
|
+
/** Optional value to control the size of the `CardImage`. */
|
|
46
|
+
imageSize?: ImageSizes;
|
|
47
|
+
/** The path to the image displayed within the `Card` component. */
|
|
57
48
|
imageSrc?: string;
|
|
58
|
-
/** Optional value to control the position of the image placeholder; default value is `column` */
|
|
59
|
-
layout?: CardLayouts;
|
|
60
|
-
/** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
|
|
61
|
-
modifiers?: string[];
|
|
62
|
-
/** Optional padding value. This value should be entered with the same formatting as a CSS padding attribute (ex. `5%`, `20px`, `2rem`). If omitted, the Card will use the default padding. */
|
|
63
|
-
padding?: string;
|
|
64
49
|
}
|
|
65
|
-
export declare
|
|
66
|
-
export declare
|
|
67
|
-
export declare function CardContent(props: React.PropsWithChildren<CardContentProps>): JSX.Element;
|
|
50
|
+
export declare const CardHeading: typeof Heading;
|
|
51
|
+
export declare function CardContent(props: React.PropsWithChildren<{}>): JSX.Element;
|
|
68
52
|
export declare function CardActions(props: React.PropsWithChildren<CardActionsProps>): JSX.Element;
|
|
69
53
|
export default function Card(props: React.PropsWithChildren<CardProps>): JSX.Element;
|
|
70
54
|
export {};
|
|
@@ -2,18 +2,3 @@ export declare enum CardLayouts {
|
|
|
2
2
|
Row = "row",
|
|
3
3
|
Column = "column"
|
|
4
4
|
}
|
|
5
|
-
export declare enum CardImageRatios {
|
|
6
|
-
FourByThree = "four-by-three",
|
|
7
|
-
OneByTwo = "one-by-two",
|
|
8
|
-
Original = "original",
|
|
9
|
-
SixteenByNine = "sixteen-by-nine",
|
|
10
|
-
Square = "square",
|
|
11
|
-
ThreeByFour = "three-by-four",
|
|
12
|
-
ThreeByTwo = "three-by-two",
|
|
13
|
-
TwoByOne = "two-by-one"
|
|
14
|
-
}
|
|
15
|
-
export declare enum CardImageSizes {
|
|
16
|
-
Large = "large",
|
|
17
|
-
Medium = "medium",
|
|
18
|
-
Small = "small"
|
|
19
|
-
}
|
|
@@ -2,26 +2,25 @@ import * as React from "react";
|
|
|
2
2
|
export interface CheckboxProps {
|
|
3
3
|
/** className you can add in addition to 'input' */
|
|
4
4
|
className?: string;
|
|
5
|
-
/** Optional string to populate the HelperErrorText for the error state
|
|
6
|
-
* when `isInvalid` is true.
|
|
7
|
-
*/
|
|
8
|
-
errorText?: string;
|
|
9
5
|
/** Optional string to populate the HelperErrorText for standard state */
|
|
10
6
|
helperText?: string;
|
|
11
7
|
/** ID that other components can cross reference for accessibility purposes */
|
|
12
8
|
id?: string;
|
|
9
|
+
/** Optional string to populate the HelperErrorText for the error state
|
|
10
|
+
* when `isInvalid` is true. */
|
|
11
|
+
invalidText?: string;
|
|
13
12
|
/** When using the Checkbox as a "controlled" form element, you can specify
|
|
14
13
|
* the Checkbox's checked state using this prop.
|
|
15
14
|
* Learn more about controlled and uncontrolled form fields:
|
|
16
15
|
* https://goshakkk.name/controlled-vs-uncontrolled-inputs-react/ */
|
|
17
16
|
isChecked?: boolean;
|
|
18
17
|
/** Adds the 'disabled' and `aria-disabled` attributes to the input when true.
|
|
19
|
-
* This also makes the text italic and color scheme gray.
|
|
20
|
-
*/
|
|
18
|
+
* This also makes the text italic and color scheme gray. */
|
|
21
19
|
isDisabled?: boolean;
|
|
20
|
+
/** Adds the indeterminate state to the `Checkbox`. */
|
|
21
|
+
isIndeterminate?: boolean;
|
|
22
22
|
/** Adds the 'aria-invalid' attribute to the input when true. This also makes
|
|
23
|
-
* the color theme "NYPL error" red for the button and text.
|
|
24
|
-
*/
|
|
23
|
+
* the color theme "NYPL error" red for the button and text. */
|
|
25
24
|
isInvalid?: boolean;
|
|
26
25
|
/** Adds the 'required' attribute to the input when true. */
|
|
27
26
|
isRequired?: boolean;
|
|
@@ -29,7 +28,7 @@ export interface CheckboxProps {
|
|
|
29
28
|
* element if `showlabel` is true, or an "aria-label" if `showLabel` is false. */
|
|
30
29
|
labelText: string;
|
|
31
30
|
/** The name prop indicates into which group of checkboxes this checkbox
|
|
32
|
-
* belongs.
|
|
31
|
+
* belongs. If none is specified, 'default' will be used */
|
|
33
32
|
name?: string;
|
|
34
33
|
/** The action to perform on the `<input>`'s onChange function */
|
|
35
34
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -5,12 +5,12 @@ export interface CheckboxGroupProps {
|
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
/** Populates the initial value of the input */
|
|
7
7
|
defaultValue?: string[];
|
|
8
|
-
/** Optional string to populate the HelperErrorText for error state */
|
|
9
|
-
invalidText?: string;
|
|
10
8
|
/** Optional string to populate the HelperErrorText for standard state */
|
|
11
9
|
helperText?: string;
|
|
12
10
|
/** ID that other components can cross reference for accessibility purposes */
|
|
13
11
|
id?: string;
|
|
12
|
+
/** Optional string to populate the HelperErrorText for error state */
|
|
13
|
+
invalidText?: string;
|
|
14
14
|
/** Adds the 'disabled' prop to the input when true. */
|
|
15
15
|
isDisabled?: boolean;
|
|
16
16
|
/** A`dds the 'aria-invalid' attribute to the input and
|
|
@@ -2,29 +2,36 @@ import React from "react";
|
|
|
2
2
|
import { DatePickerTypes } from "./DatePickerTypes";
|
|
3
3
|
import { TextInputRefType } from "../TextInput/TextInput";
|
|
4
4
|
interface FullDateType {
|
|
5
|
-
|
|
5
|
+
/** Date object that gets returned for the onChange
|
|
6
|
+
* function only for date ranges. */
|
|
6
7
|
endDate?: Date;
|
|
8
|
+
/** Date object that gets returned for the onChange function. */
|
|
9
|
+
startDate: Date;
|
|
7
10
|
}
|
|
8
11
|
interface DateRangeRowProps {
|
|
12
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
13
|
+
id?: string;
|
|
9
14
|
/** Whether to render a single date input or two for a range of two dates. */
|
|
10
|
-
|
|
15
|
+
isDateRange?: boolean;
|
|
11
16
|
}
|
|
12
17
|
interface DatePickerWrapperProps extends DateRangeRowProps {
|
|
13
|
-
/**
|
|
14
|
-
|
|
18
|
+
/** Additional className. */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Adds the 'required' property to the input element(s). */
|
|
21
|
+
isRequired?: boolean;
|
|
15
22
|
/** Passed to the `TextInput` component to render a label associated with an input field. */
|
|
16
23
|
labelText: string;
|
|
17
24
|
/** Offers the ability to show the label onscreen or hide it. */
|
|
18
25
|
showLabel?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
className?: string;
|
|
26
|
+
/** Whether or not to display the "Required"/"Optional" text in the label text. */
|
|
27
|
+
showOptReqLabel?: boolean;
|
|
22
28
|
}
|
|
23
29
|
export interface DatePickerProps extends DatePickerWrapperProps {
|
|
30
|
+
/** The date format to display. Defaults to "yyyy-MM-dd".
|
|
31
|
+
* Must be in ISO-8601 format. */
|
|
32
|
+
dateFormat?: string;
|
|
24
33
|
/** DatePicker date types that can be rendered. */
|
|
25
34
|
dateType?: DatePickerTypes;
|
|
26
|
-
/** The date format to display. Defaults to "yyyy-MM-dd". */
|
|
27
|
-
dateFormat?: string;
|
|
28
35
|
/** Populates the `HelperErrorText` component in this component. */
|
|
29
36
|
helperText?: string;
|
|
30
37
|
/** Populates the `HelperErrorText` component in the "From" `TextInput` component. */
|
|
@@ -34,45 +41,38 @@ export interface DatePickerProps extends DatePickerWrapperProps {
|
|
|
34
41
|
/** The initial date value. This must be in the mm/dd/yyyy format. */
|
|
35
42
|
initialDate?: string;
|
|
36
43
|
/** The initialTo date value used for date ranges.
|
|
37
|
-
* This must be in the mm/dd/yyyy format.
|
|
38
|
-
*/
|
|
44
|
+
* This must be in the mm/dd/yyyy format. */
|
|
39
45
|
initialDateTo?: string;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
*/
|
|
43
|
-
minDate?: string;
|
|
44
|
-
/** The maximum date value that applies to both input fields.
|
|
45
|
-
* This must be in the mm/dd/yyyy format.
|
|
46
|
-
*/
|
|
47
|
-
maxDate?: string;
|
|
48
|
-
/** Populates the `HelperErrorText` error state for both "From" and "To" input components. */
|
|
46
|
+
/** Populates the `HelperErrorText` error state for both "From"
|
|
47
|
+
* and "To" input components. */
|
|
49
48
|
invalidText?: string;
|
|
50
|
-
/** Helper for modifiers array; adds 'isInvalid' styling. */
|
|
51
|
-
isInvalid?: boolean;
|
|
52
|
-
/** Adds the 'required' property to the input element(s). */
|
|
53
|
-
required?: boolean;
|
|
54
|
-
/** Offers the ability to hide the helper/invalid text. */
|
|
55
|
-
showHelperInvalidText?: boolean;
|
|
56
|
-
/** Whether or not to display the "Required"/"Optional" text in the label text. */
|
|
57
|
-
showOptReqLabel?: boolean;
|
|
58
49
|
/** Adds the 'disabled' property to the input element(s). */
|
|
59
50
|
isDisabled?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
/** Adds 'isInvalid' styling. */
|
|
52
|
+
isInvalid?: boolean;
|
|
53
|
+
/** Adds the 'required' property to the input element(s). */
|
|
54
|
+
isRequired?: boolean;
|
|
55
|
+
/** The maximum date value that applies to both input fields.
|
|
56
|
+
* This must be in the mm/dd/yyyy format. */
|
|
57
|
+
maxDate?: string;
|
|
58
|
+
/** The minimum date value that applies to both input fields.
|
|
59
|
+
* This must be in the mm/dd/yyyy format. */
|
|
60
|
+
minDate?: string;
|
|
66
61
|
/** Value name for the single input field or the "From" input field in a date range. */
|
|
67
62
|
nameFrom?: string;
|
|
68
63
|
/** Value name for the "To" input field */
|
|
69
64
|
nameTo?: string;
|
|
70
|
-
/** An additional explicit React ref passed for a date range's "From" input field. */
|
|
71
|
-
refTo?: React.Ref<TextInputRefType>;
|
|
72
65
|
/** The action to perform on the `input`'s onChange function for both fields.
|
|
73
66
|
* This will return the data in an object with `startDate` and `endDate` keys.
|
|
74
67
|
*/
|
|
75
68
|
onChange?: (data: FullDateType) => void;
|
|
69
|
+
/** An additional explicit React ref passed for a date range's "To"
|
|
70
|
+
* input field. Note that the "From" input takes the initial "ref" value. */
|
|
71
|
+
refTo?: React.Ref<TextInputRefType>;
|
|
72
|
+
/** Offers the ability to hide the helper/invalid text. */
|
|
73
|
+
showHelperInvalidText?: boolean;
|
|
74
|
+
/** Whether or not to display the "Required"/"Optional" text in the label text. */
|
|
75
|
+
showOptReqLabel?: boolean;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Returns a single date input field or two date input fields for a date range.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface FieldsetProps {
|
|
3
|
+
/** Children to render. Typically form-related components are used. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Additional class name to add. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** ID that other components can cross reference for accessibility purposes */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Flag to show or hide the text in the `legend` element. False by default. */
|
|
10
|
+
isLegendHidden?: boolean;
|
|
11
|
+
/** Flag to render "Required" or "Optional" in the `legend`.
|
|
12
|
+
* False/"Optional" by default. */
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
/** Text to display in the `legend` element. */
|
|
15
|
+
legendText?: string;
|
|
16
|
+
/** Flag to show or hide the "Required"/"Optional" text in the `legend`.
|
|
17
|
+
* True by default. */
|
|
18
|
+
optReqFlag?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A wrapper component that renders a `fieldset` element along with a `legend`
|
|
22
|
+
* element as its first child. Commonly used to wrap form components.
|
|
23
|
+
*/
|
|
24
|
+
declare const Fieldset: React.FC<FieldsetProps>;
|
|
25
|
+
export default Fieldset;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export declare type AriaLiveValues = "assertive" | "off" | "polite";
|
|
3
3
|
interface HelperErrorTextProps {
|
|
4
|
+
/** Optionally pass in additional Chakra-based styles. */
|
|
5
|
+
additionalStyles?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
4
8
|
/** Aria attribute. When true, assistive technologies will
|
|
5
9
|
* read the entire DOM element. When false, only changes (additionals or
|
|
6
10
|
* removals) will be read. True by default. */
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export interface HorizontalRuleProps {
|
|
3
|
-
/** Optional alignment value to align the horizontal rule to one side or the
|
|
3
|
+
/** Optional alignment value to align the horizontal rule to one side or the
|
|
4
|
+
* other when the width is less than 100%. If omitted, the horizontal rule
|
|
5
|
+
* will have a default center alignment. */
|
|
4
6
|
align?: "left" | "right";
|
|
5
7
|
/** ClassName you can add in addition to `horizontal-rule` */
|
|
6
8
|
className?: string;
|
|
7
|
-
/** Optional height value.
|
|
9
|
+
/** Optional height value. This value should be entered with the same
|
|
10
|
+
* formatting as a CSS height attribute except for percent values (ex. `2`,
|
|
11
|
+
* `5px`, `1.5rem`). If this prop is omitted or a percent value is used, the
|
|
12
|
+
* horizontal rule will have a default height of 2px. */
|
|
8
13
|
height?: string;
|
|
9
|
-
/** Optional width value.
|
|
14
|
+
/** Optional width value. This value should be entered with the same
|
|
15
|
+
* formatting as a CSS width attribute (ex. `50%`, `640px`, `20rem`). If
|
|
16
|
+
* omitted, the horizontal rule will have a default width of "auto". */
|
|
10
17
|
width?: string;
|
|
11
18
|
}
|
|
12
19
|
export default function HorizontalRule(props: React.ComponentProps<"hr"> & HorizontalRuleProps): JSX.Element;
|
|
@@ -22,6 +22,10 @@ export interface IconProps {
|
|
|
22
22
|
name?: IconNames | LogoNames;
|
|
23
23
|
/** Sets the icon size. */
|
|
24
24
|
size?: IconSizes;
|
|
25
|
+
/** For accessibility purposes, the text passed in the `title` prop gets
|
|
26
|
+
* rendered in a `title` element in the SVG. This descriptive text is not
|
|
27
|
+
* visible but is needed for screenreaders to describe the graphic. */
|
|
28
|
+
title?: string;
|
|
25
29
|
/** Sets the icon variant type. */
|
|
26
30
|
type?: IconTypes;
|
|
27
31
|
}
|