@nypl/design-system-react-components 0.25.3 → 0.25.7
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 +65 -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 -6
- package/dist/components/Button/ButtonTypes.d.ts +2 -1
- package/dist/components/Card/Card.d.ts +0 -25
- package/dist/components/Icons/IconSvgs.d.ts +3 -0
- package/dist/components/Icons/IconTypes.d.ts +3 -0
- package/dist/components/Notification/Notification.d.ts +6 -4
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
- package/dist/components/SearchBar/SearchBar.d.ts +3 -3
- 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 +6 -0
- package/dist/design-system-react-components.cjs.development.js +1022 -455
- 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 +1015 -444
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +8 -3
- 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 +10 -0
- package/dist/theme/components/progressIndicator.d.ts +50 -0
- package/dist/theme/components/slider.d.ts +51 -0
- package/dist/theme/foundations/breakpoints.d.ts +8 -8
- package/dist/theme/foundations/global.d.ts +6 -1
- package/package.json +71 -83
- package/src/__tests__/setup.ts +2 -2
- package/src/components/Accordion/Accordion.stories.mdx +30 -34
- 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 +297 -1
- package/src/components/Button/Button.stories.mdx +8 -6
- package/src/components/Button/Button.test.tsx +20 -0
- package/src/components/Button/Button.tsx +14 -23
- package/src/components/Button/ButtonTypes.tsx +1 -0
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +29 -4
- package/src/components/Card/Card.stories.mdx +1 -1
- package/src/components/Card/Card.tsx +3 -3
- 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/DatePicker/DatePicker.test.tsx +31 -30
- package/src/components/DatePicker/DatePicker.tsx +7 -4
- package/src/components/DatePicker/_DatePicker.scss +4 -4
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +19 -5
- package/src/components/Form/Form.stories.mdx +4 -5
- package/src/components/Grid/SimpleGrid.stories.mdx +1 -0
- package/src/components/Hero/HeroTypes.tsx +1 -0
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +2 -3
- package/src/components/Icons/Icon.stories.mdx +2 -3
- package/src/components/Icons/IconSvgs.tsx +6 -0
- package/src/components/Icons/IconTypes.tsx +3 -0
- package/src/components/Image/Image.stories.mdx +2 -3
- package/src/components/Input/Input.stories.tsx +20 -64
- package/src/components/Input/_Input.scss +23 -14
- 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 -1
- package/src/components/Notification/Notification.tsx +13 -4
- package/src/components/Pagination/Pagination.stories.mdx +3 -2
- package/src/components/Pagination/Pagination.stories.tsx +1 -2
- 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 +2 -3
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +4 -0
- package/src/components/SearchBar/SearchBar.Test.tsx +66 -21
- package/src/components/SearchBar/SearchBar.stories.mdx +110 -11
- package/src/components/SearchBar/SearchBar.tsx +15 -5
- package/src/components/Select/SelectTypes.tsx +1 -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 +9 -2
- package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Template/Template.stories.mdx +6 -6
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +15 -2
- 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 +12 -6
- 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 -44
- package/src/theme/components/breadcrumb.ts +10 -0
- package/src/theme/components/button.ts +10 -2
- package/src/theme/components/card.ts +11 -9
- package/src/theme/components/datePicker.ts +1 -1
- package/src/theme/components/list.ts +2 -2
- package/src/theme/components/notification.ts +5 -3
- package/src/theme/components/progressIndicator.ts +62 -0
- package/src/theme/components/skeletonLoader.ts +1 -1
- package/src/theme/components/slider.ts +79 -0
- package/src/theme/foundations/breakpoints.ts +8 -8
- package/src/theme/foundations/global.ts +6 -1
- package/src/theme/index.ts +4 -0
- package/src/utils/componentCategories.ts +3 -3
- 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/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,70 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 0.25.7 (December 20, 2021)
|
|
12
|
+
|
|
13
|
+
### Fixes
|
|
14
|
+
|
|
15
|
+
- Removes `<=12.22` from node engine in `package.json` to reduce installation issues.
|
|
16
|
+
|
|
17
|
+
## 0.25.6 (December 16, 2021)
|
|
18
|
+
|
|
19
|
+
### Adds
|
|
20
|
+
|
|
21
|
+
- Adds export statements for `ProgressIndicator` and `Slider` components to `index.ts`.
|
|
22
|
+
- Adds `Blogs` variant to `Breadcrumbs` component.
|
|
23
|
+
|
|
24
|
+
### Changes
|
|
25
|
+
|
|
26
|
+
- Adds "(Required)" text to the placeholder in the `SearchBar` component when `isRequired` is true.
|
|
27
|
+
|
|
28
|
+
## 0.25.5 (December 9, 2021)
|
|
29
|
+
|
|
30
|
+
### Fixes
|
|
31
|
+
|
|
32
|
+
- 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`.
|
|
33
|
+
|
|
34
|
+
## 0.25.4 (December 9, 2021)
|
|
35
|
+
|
|
36
|
+
### Adds
|
|
37
|
+
|
|
38
|
+
- Adds the `ProgressIndicator` component.
|
|
39
|
+
- Adds documentation for using `NYPL Design Tokens`.
|
|
40
|
+
- Adds the `ActionHelpDefault`, `ActionHelpOutline` and `ActionLaunch` icons to the `Icon` component.
|
|
41
|
+
- Adds the DS `Slider` component based on the Chakra `Slider` and `RangeSlider` components.
|
|
42
|
+
- Adds the `ButtonTypes.NoBrand` variant to the `Button` component.
|
|
43
|
+
- Adds the `additionalStyles` prop to the `Breadcrumbs` component.
|
|
44
|
+
|
|
45
|
+
### Changes
|
|
46
|
+
|
|
47
|
+
- Updates the organization of SCSS files by deleting some files and combining others.
|
|
48
|
+
- Updates `@chakra-ui/react` to version 1.7.1 and `@chakra-ui/system` to version 1.8.1.
|
|
49
|
+
- Updates the `TextInput` component to now have `defaultValue` and `step` props.
|
|
50
|
+
- Updates `Latest Version` number for `Image`, `Notification` and `Pagination` components.
|
|
51
|
+
- Removes the Storybook "Knobs" addon.
|
|
52
|
+
- Updates the margin for labels in the `DatePicker` component when it is in the "date range" state.
|
|
53
|
+
- Updates the `DatePicker` component to have proper form spacing when in the "date range" state.
|
|
54
|
+
- Updates the `Tabs` component to comply with linting rules -- no functional or visual changes were made.
|
|
55
|
+
- Removes the `alignText` prop from the `Notification` component. Storybook was incorrectly displaying `alignText` as an available prop.
|
|
56
|
+
|
|
57
|
+
### Fixes
|
|
58
|
+
|
|
59
|
+
- Exports components and variables that were initially missed when they were added: `ColorVariants`, `Fieldset`, `IconAlign`, `StatusBadgeTypes`,
|
|
60
|
+
- Fixes `SearchBar` by passing necessary props down to its `TextInput` through the `textInputProps` prop.
|
|
61
|
+
- Fixes `DatePicker` component unit tests.
|
|
62
|
+
- 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.
|
|
63
|
+
|
|
64
|
+
### Breaking Changes
|
|
65
|
+
|
|
66
|
+
- 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.
|
|
67
|
+
- Changes the `Button`'s `disabled` prop to `isDisabled`.
|
|
68
|
+
- 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.
|
|
69
|
+
|
|
70
|
+
### Deprecates
|
|
71
|
+
|
|
72
|
+
- Deprecates the `Input` component. The `Input` component will be removed from the NYPL Design System React Library in the first release of January 2022.
|
|
73
|
+
- Deprecates the `CardEdition` component. The `CardEdition` component will be removed from the NYPL Design System React Library in the first release of January 2022.
|
|
74
|
+
|
|
11
75
|
## 0.25.3 (November 18, 2021)
|
|
12
76
|
|
|
13
77
|
### Adds
|
|
@@ -49,6 +113,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
49
113
|
- 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.
|
|
50
114
|
- 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.
|
|
51
115
|
- 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.
|
|
116
|
+
- Removes deprecated CSS variables. Now the DS repo only uses the CSS variables exposed by Chakra that contain the `--nypl` prefix.
|
|
52
117
|
|
|
53
118
|
## 0.25.2 (October 28, 2021)
|
|
54
119
|
|
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' */
|
|
@@ -12,19 +12,22 @@ interface ButtonProps {
|
|
|
12
12
|
};
|
|
13
13
|
/** The kind of button assigned through the `ButtonTypes` enum */
|
|
14
14
|
buttonType?: ButtonTypes;
|
|
15
|
-
/** Additional className
|
|
15
|
+
/** Additional className to use. */
|
|
16
16
|
className?: string;
|
|
17
|
-
/** Adds 'disabled' property to the button */
|
|
18
|
-
disabled?: boolean;
|
|
19
17
|
/** ID that other components can cross reference for accessibility purposes */
|
|
20
18
|
id?: string;
|
|
21
|
-
/**
|
|
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. */
|
|
22
23
|
mouseDown?: boolean;
|
|
23
24
|
/** The action to perform on the `<button>`'s onClick function */
|
|
24
25
|
onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
25
|
-
/** The
|
|
26
|
+
/** The HTML button type attribute. */
|
|
26
27
|
type?: ButtonElementType;
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Renders a simple `button` element with custom variant styles.
|
|
31
|
+
*/
|
|
29
32
|
declare function Button(props: React.PropsWithChildren<ButtonProps>): JSX.Element;
|
|
30
33
|
export default Button;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CardLayouts } from "./CardTypes";
|
|
3
3
|
import Heading from "../Heading/Heading";
|
|
4
|
-
import { ImageProps } from "../Image/Image";
|
|
5
4
|
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
6
5
|
interface CardBaseProps {
|
|
7
6
|
/** Optional value to control the alignment of the text and elements. */
|
|
@@ -21,10 +20,6 @@ interface CardActionsProps extends CardBaseProps {
|
|
|
21
20
|
* the card actions element */
|
|
22
21
|
topBorder?: boolean;
|
|
23
22
|
}
|
|
24
|
-
interface CardImageProps extends CardBaseProps, ImageProps {
|
|
25
|
-
/** Optional boolean value to control the position of the `CardImage`. */
|
|
26
|
-
imageAtEnd?: boolean;
|
|
27
|
-
}
|
|
28
23
|
export interface CardProps extends CardBaseProps, CardLinkBoxProps {
|
|
29
24
|
/** Optional hex color value used to set the card background color. */
|
|
30
25
|
backgroundColor?: string;
|
|
@@ -52,28 +47,8 @@ export interface CardProps extends CardBaseProps, CardLinkBoxProps {
|
|
|
52
47
|
/** The path to the image displayed within the `Card` component. */
|
|
53
48
|
imageSrc?: string;
|
|
54
49
|
}
|
|
55
|
-
/**
|
|
56
|
-
* The CardImage component is used internally in the `Card` component. It
|
|
57
|
-
* renders an `Image` component but with overriding styles specific to the
|
|
58
|
-
* `Card` component.
|
|
59
|
-
*/
|
|
60
|
-
export declare function CardImage(props: React.ComponentProps<"img"> & CardImageProps): JSX.Element;
|
|
61
50
|
export declare const CardHeading: typeof Heading;
|
|
62
51
|
export declare function CardContent(props: React.PropsWithChildren<{}>): JSX.Element;
|
|
63
52
|
export declare function CardActions(props: React.PropsWithChildren<CardActionsProps>): JSX.Element;
|
|
64
|
-
/**
|
|
65
|
-
* If `mainActionLink` is passed, then this adds Chakra's `LinkBox` wrapper
|
|
66
|
-
* component to the entire `Card` component. This works together with the
|
|
67
|
-
* `CardLinkOverlay` component to provide a clickable overlay.
|
|
68
|
-
*/
|
|
69
|
-
export declare function CardLinkBox({ children, mainActionLink, }: React.PropsWithChildren<CardLinkBoxProps>): JSX.Element;
|
|
70
|
-
/**
|
|
71
|
-
* If `mainActionLink` is passed, then this adds Chakra's `LinkOverlay` around
|
|
72
|
-
* text that should be linked, in this case the `CardHeading` text. This works
|
|
73
|
-
* together with the `CardLinkBox` component to provide a clickable overlay to
|
|
74
|
-
* the `Card` component while still allowing links in the `CardActions` to be
|
|
75
|
-
* clickable.
|
|
76
|
-
*/
|
|
77
|
-
export declare function CardLinkOverlay({ children, mainActionLink, }: React.PropsWithChildren<CardLinkBoxProps>): JSX.Element;
|
|
78
53
|
export default function Card(props: React.PropsWithChildren<CardProps>): JSX.Element;
|
|
79
54
|
export {};
|
|
@@ -44,6 +44,9 @@ export declare enum IconNames {
|
|
|
44
44
|
AccessibilityFull = "accessibility_full",
|
|
45
45
|
AccessibilityPartial = "accessibility_partial",
|
|
46
46
|
ActionCheckCircle = "action_check_circle",
|
|
47
|
+
ActionHelpDefault = "action_help_default",
|
|
48
|
+
ActionHelpOutline = "action_help_outline",
|
|
49
|
+
ActionLaunch = "action_launch",
|
|
47
50
|
Arrow = "arrow",
|
|
48
51
|
Check = "check",
|
|
49
52
|
Clock = "clock",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NotificationTypes } from "./NotificationTypes";
|
|
3
3
|
interface BaseProps {
|
|
4
|
-
/** Optional prop to control text alignment
|
|
4
|
+
/** Optional prop to control text alignment in `NotificationContent` */
|
|
5
5
|
alignText?: boolean;
|
|
6
6
|
/** Optional prop to control horizontal alignment of the `Notification` content */
|
|
7
7
|
centered?: boolean;
|
|
@@ -11,7 +11,9 @@ interface BaseProps {
|
|
|
11
11
|
* visibility of an applicable icon. */
|
|
12
12
|
notificationType?: NotificationTypes;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
declare type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
|
|
15
|
+
declare type BasePropsWithoutCentered = Omit<BaseProps, "centered">;
|
|
16
|
+
export interface NotificationProps extends BasePropsWithoutAlignText {
|
|
15
17
|
/** Additional `className` to add. */
|
|
16
18
|
className?: string;
|
|
17
19
|
/** Optional prop to control whether a `Notification` can be dismissed
|
|
@@ -31,11 +33,11 @@ export interface NotificationProps extends BaseProps {
|
|
|
31
33
|
/**
|
|
32
34
|
* NotificationHeading child-component.
|
|
33
35
|
*/
|
|
34
|
-
export declare function NotificationHeading(props: React.PropsWithChildren<
|
|
36
|
+
export declare function NotificationHeading(props: React.PropsWithChildren<BasePropsWithoutAlignText>): JSX.Element;
|
|
35
37
|
/**
|
|
36
38
|
* NotificationContent child-component.
|
|
37
39
|
*/
|
|
38
|
-
export declare function NotificationContent(props: React.PropsWithChildren<
|
|
40
|
+
export declare function NotificationContent(props: React.PropsWithChildren<BasePropsWithoutCentered>): JSX.Element;
|
|
39
41
|
/**
|
|
40
42
|
* Component used to present users with three different levels of notifications:
|
|
41
43
|
* standard, announcement, and warning.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ProgressIndicatorSizes, ProgressIndicatorTypes } from "./ProgressIndicatorTypes";
|
|
3
|
+
export interface ProgressIndicatorProps {
|
|
4
|
+
/** Flag to render the component in a dark background. */
|
|
5
|
+
darkMode?: boolean;
|
|
6
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Whether the `ProgressIndicator` should be linear or circular. */
|
|
9
|
+
indicatorType?: ProgressIndicatorTypes;
|
|
10
|
+
/** Whether the progress animation should display because the `value` prop is
|
|
11
|
+
* not known. When this is set to `true`, the `value` prop will be ignored. */
|
|
12
|
+
isIndeterminate?: boolean;
|
|
13
|
+
/** The text to display in an HTML `label` element. */
|
|
14
|
+
labelText: string;
|
|
15
|
+
/** Visually show or hide the label text. When set to `false`, then the label
|
|
16
|
+
* text will be added to the parent component as its `aria-label` attribute. */
|
|
17
|
+
showLabel?: boolean;
|
|
18
|
+
/** The size of the linear or circular progress. */
|
|
19
|
+
size?: ProgressIndicatorSizes;
|
|
20
|
+
/** A number between 0 to 100 that defines the progress' value. */
|
|
21
|
+
value?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A component that displays a progress status for any task that takes a long
|
|
25
|
+
* time to complete or consists of multiple steps. Examples include downloading,
|
|
26
|
+
* uploading, or processing.
|
|
27
|
+
*/
|
|
28
|
+
declare const ProgressIndicator: React.FC<ProgressIndicatorProps>;
|
|
29
|
+
export default ProgressIndicator;
|
|
@@ -6,7 +6,10 @@ interface SelectProps {
|
|
|
6
6
|
}
|
|
7
7
|
interface TextInputProps {
|
|
8
8
|
labelText: string;
|
|
9
|
+
name: string;
|
|
10
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
9
11
|
placeholder: string;
|
|
12
|
+
value?: string;
|
|
10
13
|
}
|
|
11
14
|
export interface SearchBarProps {
|
|
12
15
|
/** Adds 'action' property to the `form` element. */
|
|
@@ -36,9 +39,6 @@ export interface SearchBarProps {
|
|
|
36
39
|
onSubmit: (event: React.FormEvent) => void;
|
|
37
40
|
/** Required props to render a `Select` element. */
|
|
38
41
|
selectProps?: SelectProps | undefined;
|
|
39
|
-
/** Will be used to visually display the label text for this
|
|
40
|
-
* `SearchBar` component. False by default. */
|
|
41
|
-
showLabel?: boolean;
|
|
42
42
|
/** Custom input element to render instead of a `TextInput` element. */
|
|
43
43
|
textInputElement?: JSX.Element;
|
|
44
44
|
/** Required props to render a `TextInput` element. */
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SliderProps {
|
|
3
|
+
/** Additional class name for the Slider component. */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** The initial value for the single `Slider` or an array of two number
|
|
6
|
+
* values for the `isRangeSlider` case.
|
|
7
|
+
*/
|
|
8
|
+
defaultValue?: number | number[];
|
|
9
|
+
/** Optional string to populate the HelperErrorText for standard state */
|
|
10
|
+
helperText?: string;
|
|
11
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** Optional string to populate the `HelperErrorText` for the error state
|
|
14
|
+
* when `isInvalid` is true. */
|
|
15
|
+
invalidText?: string;
|
|
16
|
+
/** Adds the 'disabled' state to the slider and text input(s) when true. */
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
/** Adds the 'invalid' state to the slider and text input(s) when true. */
|
|
19
|
+
isInvalid?: boolean;
|
|
20
|
+
/** Offers the ability to render a slider with one value or
|
|
21
|
+
* a range slider with two values. */
|
|
22
|
+
isRangeSlider?: boolean;
|
|
23
|
+
/** Adds the 'required' attribute to the input(s) when true. */
|
|
24
|
+
isRequired?: boolean;
|
|
25
|
+
/** The `Slider`'s label. In the default single slider, this will be linked to
|
|
26
|
+
* the only `TextInput` component. In the range slider, this will be linked to
|
|
27
|
+
* the first `TextInput` component. If `showLabel` is false, then this value
|
|
28
|
+
* will be set in the `Slider`'s `aria-label` attribute. */
|
|
29
|
+
labelText: string;
|
|
30
|
+
/** Maximum value allowed. */
|
|
31
|
+
max?: number;
|
|
32
|
+
/** Minimum value allowed. */
|
|
33
|
+
min?: number;
|
|
34
|
+
/** The name prop indicates into which form this component belongs to. */
|
|
35
|
+
name?: string;
|
|
36
|
+
/** Callback function that gets the value(s) selected. */
|
|
37
|
+
onChange?: (val: number | number[]) => void;
|
|
38
|
+
/** Whether or not to display the "Required"/"Optional" text in the label text. */
|
|
39
|
+
optReqFlag?: boolean;
|
|
40
|
+
/** Offers the ability to hide the `TextInput` boxes. */
|
|
41
|
+
showBoxes?: boolean;
|
|
42
|
+
/** Offers the ability to hide the helper/invalid text. */
|
|
43
|
+
showHelperInvalidText?: boolean;
|
|
44
|
+
/** Offers the ability to show the label onscreen or hide it. Refer
|
|
45
|
+
* to the `labelText` property for more information. */
|
|
46
|
+
showLabel?: boolean;
|
|
47
|
+
/** Offers the ability to hide the static min/max values. */
|
|
48
|
+
showValues?: boolean;
|
|
49
|
+
/** The amount to increase or decrease when using the slider thumb(s). */
|
|
50
|
+
step?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The `Slider` component renders a singular value slider or a range slider
|
|
54
|
+
* with a min and max value. The value(s) can be updated through the slider
|
|
55
|
+
* thumb(s) or through the text input(s) elements.
|
|
56
|
+
*/
|
|
57
|
+
export default function Slider(props: React.PropsWithChildren<SliderProps>): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Tab, TabList, TabPanels, TabPanel } from "@chakra-ui/react";
|
|
3
3
|
export interface TabsContentDataProps {
|
|
4
4
|
label: string;
|
|
5
5
|
content: string | React.ReactNode;
|
|
@@ -11,6 +11,8 @@ export interface InputProps {
|
|
|
11
11
|
};
|
|
12
12
|
/** A class name for the TextInput parent div. */
|
|
13
13
|
className?: string;
|
|
14
|
+
/** The starting value of the input field. */
|
|
15
|
+
defaultValue?: string;
|
|
14
16
|
/** Populates the HelperErrorText for the standard state */
|
|
15
17
|
helperText?: string;
|
|
16
18
|
/** ID that other components can cross reference for accessibility purposes */
|
|
@@ -26,6 +28,8 @@ export interface InputProps {
|
|
|
26
28
|
/** Provides text for a `Label` component if `showLabel` is set to true;
|
|
27
29
|
* populates an `aria-label` attribute if `showLabel` is set to false. */
|
|
28
30
|
labelText: string;
|
|
31
|
+
/** Used to reference the input element in forms. */
|
|
32
|
+
name?: string;
|
|
29
33
|
/** The action to perform on the `input`/`textarea`'s onChange function */
|
|
30
34
|
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
31
35
|
/** Populates the placeholder for the input/textarea elements */
|
|
@@ -38,6 +42,8 @@ export interface InputProps {
|
|
|
38
42
|
/** Offers the ability to show the "Required"/"Optional" label onscreen or
|
|
39
43
|
* hide it. True by default. */
|
|
40
44
|
showOptReqLabel?: boolean;
|
|
45
|
+
/** The amount to increase or decrease when using the number type. */
|
|
46
|
+
step?: number;
|
|
41
47
|
/** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
|
|
42
48
|
type?: TextInputTypes;
|
|
43
49
|
/** Populates the value of the input/textarea elements */
|