@nypl/design-system-react-components 0.25.9 → 0.25.12
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 +96 -0
- package/README.md +4 -16
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Fieldset/Fieldset.d.ts +1 -3
- package/dist/components/Form/Form.d.ts +13 -12
- package/dist/components/Form/FormTypes.d.ts +2 -2
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +1 -1
- package/dist/components/Icons/IconTypes.d.ts +9 -7
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +23 -1
- package/dist/components/Logo/LogoTypes.d.ts +23 -1
- package/dist/components/Notification/Notification.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +6 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -3
- package/dist/components/SearchBar/SearchBar.d.ts +6 -6
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Table/Table.d.ts +9 -3
- package/dist/components/Template/Template.d.ts +24 -5
- package/dist/design-system-react-components.cjs.development.js +2063 -548
- 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 +2056 -554
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/resources.scss +0 -2
- package/dist/styles.css +1 -1
- package/dist/theme/components/breadcrumb.d.ts +4 -1
- package/dist/theme/components/checkbox.d.ts +0 -2
- package/dist/theme/components/customTable.d.ts +12 -3
- package/dist/theme/components/fieldset.d.ts +2 -0
- package/dist/theme/components/global.d.ts +15 -14
- package/dist/theme/components/globalMixins.d.ts +8 -8
- package/dist/theme/components/list.d.ts +6 -0
- package/dist/theme/components/notification.d.ts +16 -4
- package/dist/theme/components/radio.d.ts +3 -2
- package/dist/theme/components/searchBar.d.ts +4 -0
- package/dist/theme/components/select.d.ts +2 -9
- package/dist/theme/components/slider.d.ts +8 -4
- package/dist/theme/components/structuredContent.d.ts +9 -9
- package/dist/theme/components/textInput.d.ts +10 -12
- package/dist/theme/components/toggle.d.ts +6 -2
- package/dist/theme/foundations/global.d.ts +31 -3
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +40 -36
- package/src/components/Accordion/Accordion.stories.mdx +1 -1
- package/src/components/Accordion/Accordion.test.tsx +45 -1
- package/src/components/Accordion/Accordion.tsx +20 -8
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +243 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +30 -2
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +25 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -3
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +104 -5
- package/src/components/Card/Card.stories.mdx +1 -1
- package/src/components/Card/Card.tsx +4 -1
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +1 -1
- package/src/components/Chakra/Flex.stories.mdx +113 -0
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -0
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +6 -6
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +18 -18
- package/src/components/DatePicker/DatePicker.stories.mdx +1 -1
- package/src/components/DatePicker/DatePicker.test.tsx +6 -6
- package/src/components/DatePicker/DatePicker.tsx +12 -10
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +28 -20
- package/src/components/Fieldset/Fieldset.stories.mdx +1 -1
- package/src/components/Fieldset/Fieldset.tsx +2 -4
- package/src/components/Form/Form.stories.mdx +34 -16
- package/src/components/Form/Form.test.tsx +92 -3
- package/src/components/Form/Form.tsx +25 -21
- package/src/components/Form/FormTypes.tsx +2 -2
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -1
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
- package/src/components/Hero/Hero.stories.mdx +1 -1
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +3 -2
- package/src/components/HorizontalRule/HorizontalRule.tsx +2 -2
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +4 -4
- package/src/components/Icons/Icon.stories.mdx +1 -1
- package/src/components/Icons/Icon.test.tsx +1 -1
- package/src/components/Icons/Icon.tsx +1 -1
- package/src/components/Icons/IconTypes.tsx +8 -6
- package/src/components/List/List.stories.mdx +24 -5
- package/src/components/List/List.test.tsx +1 -1
- package/src/components/List/List.tsx +2 -2
- package/src/components/List/__snapshots__/List.test.tsx.snap +3 -1
- package/src/components/Logo/Logo.stories.mdx +7 -5
- package/src/components/Logo/LogoSvgs.tsx +45 -1
- package/src/components/Logo/LogoTypes.tsx +22 -0
- package/src/components/Notification/Notification.stories.mdx +73 -1
- package/src/components/Notification/Notification.test.tsx +64 -5
- package/src/components/Notification/Notification.tsx +21 -11
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +103 -8
- package/src/components/Pagination/Pagination.stories.mdx +54 -12
- package/src/components/Pagination/Pagination.test.tsx +63 -5
- package/src/components/Pagination/Pagination.tsx +46 -24
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +3 -3
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +1 -0
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +5 -5
- package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
- package/src/components/RadioGroup/RadioGroup.test.tsx +13 -11
- package/src/components/RadioGroup/RadioGroup.tsx +88 -89
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +18 -18
- package/src/components/SearchBar/SearchBar.Test.tsx +124 -28
- package/src/components/SearchBar/SearchBar.stories.mdx +9 -6
- package/src/components/SearchBar/SearchBar.tsx +24 -23
- package/src/components/Select/Select.stories.mdx +1 -1
- package/src/components/Select/Select.test.tsx +89 -0
- package/src/components/Select/Select.tsx +11 -2
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +545 -0
- package/src/components/Slider/Slider.stories.mdx +1 -1
- package/src/components/Slider/Slider.tsx +4 -1
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +7 -0
- package/src/components/StructuredContent/StructuredContent.stories.mdx +1 -1
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +4 -4
- package/src/components/StyleGuide/Colors.stories.mdx +33 -18
- package/src/components/Table/Table.stories.mdx +118 -19
- package/src/components/Table/Table.test.tsx +80 -3
- package/src/components/Table/Table.tsx +26 -16
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +1179 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +21 -5
- package/src/components/Tabs/Tabs.tsx +35 -20
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +195 -0
- package/src/components/Template/Template.stories.mdx +79 -4
- package/src/components/Template/Template.test.tsx +65 -3
- package/src/components/Template/Template.tsx +60 -14
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +94 -1
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.tsx +2 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +4 -4
- package/src/docs/Chakra.stories.mdx +1 -1
- package/src/index.ts +8 -2
- package/src/styles/base/_place-holder.scss +2 -0
- package/src/styles.scss +0 -2
- package/src/theme/components/breadcrumb.ts +5 -1
- package/src/theme/components/checkbox.ts +3 -7
- package/src/theme/components/customTable.ts +16 -3
- package/src/theme/components/fieldset.ts +2 -0
- package/src/theme/components/global.ts +19 -16
- package/src/theme/components/globalMixins.ts +8 -8
- package/src/theme/components/list.ts +6 -2
- package/src/theme/components/notification.ts +21 -8
- package/src/theme/components/radio.ts +3 -6
- package/src/theme/components/searchBar.ts +4 -0
- package/src/theme/components/select.ts +3 -3
- package/src/theme/components/slider.ts +12 -9
- package/src/theme/components/structuredContent.ts +26 -6
- package/src/theme/components/textInput.ts +3 -2
- package/src/theme/components/toggle.ts +42 -38
- package/src/theme/foundations/colors.ts +19 -12
- package/src/theme/foundations/global.ts +17 -5
- package/src/theme/foundations/typography.ts +2 -2
- package/src/utils/componentCategories.ts +2 -1
- package/src/utils/utils.ts +28 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -13
- package/src/components/Pagination/Pagination.stories.tsx +0 -54
- package/src/styles/base/_03-base.scss +0 -25
- package/src/styles/base/_04-focus.scss +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,101 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 0.25.12 (March 18, 2022)
|
|
12
|
+
|
|
13
|
+
## Adds
|
|
14
|
+
|
|
15
|
+
- Adds `Education` section colors to the color palette theme object.
|
|
16
|
+
- Adds a `currentPage` prop to the `Pagination` component, a value that updates the selected page programmatically without the user explicitly requesting it.
|
|
17
|
+
|
|
18
|
+
### Changes
|
|
19
|
+
|
|
20
|
+
- Removes the margin from the global `.nypl p` CSS rule.
|
|
21
|
+
- Updates the top and bottom margin of the `List`'s `Unordered` and `Ordered` types.
|
|
22
|
+
- Updates the `Notification`'s icons to be decorative by default.
|
|
23
|
+
- Updates the default placeholder value for the `SearchBar`'s `TextInput` component.
|
|
24
|
+
- Updates the `SearchBar`'s `textInputProps` prop object to not require the `placeholder` property.
|
|
25
|
+
- Updates the `Logo` component to include new variants for `FirstBook` and `Open eBooks`.
|
|
26
|
+
- Updates the border and text styles for the `Select` component.
|
|
27
|
+
- Updates the `Breadcrumbs` component to inlcude an `Education` color variant.
|
|
28
|
+
- Updates the `Icon` component to include the `Education` color values.
|
|
29
|
+
- Updates the default font stack to fix a typo that was disabling `sans-serif` in the stack.
|
|
30
|
+
- Removes the `.nypl-ds` CSS class from the base SCSS file, from the `TemplateAppContainer` component, from the Storybook configuration, and from the entire repo.
|
|
31
|
+
- Moves the base styles from the SCSS global file to the Chakra theme global JS object.
|
|
32
|
+
- Updates the label font size for the `Radio` and `Checkbox` components to be "label.default".
|
|
33
|
+
|
|
34
|
+
### Fixes
|
|
35
|
+
|
|
36
|
+
- Fixes the styles for the `Slider` to better accomodate the slider thumbs and the width of the container.
|
|
37
|
+
- Updates the alignment of the `Notifications`'s dismissible icon.
|
|
38
|
+
- Fixes the border and padding from the `fieldset` HTML element by removing it.
|
|
39
|
+
- Fixes alignment for long labels in the `Checkbox` and `Radio` components.
|
|
40
|
+
- Fixes the line height for long labels in the `Toggle` component.
|
|
41
|
+
|
|
42
|
+
## 0.25.11 (March 3, 2022)
|
|
43
|
+
|
|
44
|
+
### Updates
|
|
45
|
+
|
|
46
|
+
- Updates the `Logo` component to include new variants for `BPL`, `Clever`, `LPA`, `MLN`, `QPL`, `Schomburg`, `SimplyE` and `Treasures`.
|
|
47
|
+
- Updates font size to "12px" and top margin to "4px" for `HelperErrorText` component.
|
|
48
|
+
- Updates font size to "14px" for `TextInput` component.
|
|
49
|
+
- Adds an `aria-label` attribute to the `Notification` component to use with its `aside` HTML landmark element. Added an "Accessibility" section in the `Notification` Storybook page to note that this component should not be used within a `header` or `footer` HTML landmark element.
|
|
50
|
+
- Updates the `Notification` component to handle link color inside the content area, better styling for centering and the dismissible variation, and updated background color for the "Announcement" and "Warning" types.
|
|
51
|
+
- Updates a log message in the `Icon` component to be more descriptive.
|
|
52
|
+
- Updates the mobile styles for the image in the `StructuredContent` component.
|
|
53
|
+
- Updates the prop type for the "Definition" `List` type so DOM elements can be passed in the definition.
|
|
54
|
+
|
|
55
|
+
### Fixes
|
|
56
|
+
|
|
57
|
+
- Updates the bottom margin of the `Select` in the `SearchBar` so that the helper text has standard gap between the main form components and itself.
|
|
58
|
+
- Updates how `TabList` and `TabPanels` are returned in the `Tabs` component so no false log messages are consoled.
|
|
59
|
+
- Updates `List` component styling for inline.
|
|
60
|
+
|
|
61
|
+
## 0.25.10 (February 22, 2022)
|
|
62
|
+
|
|
63
|
+
### Adds
|
|
64
|
+
|
|
65
|
+
- Exports Chakra's `Flex` and `Spacer` components.
|
|
66
|
+
- Adds `TemplateAboveHeader` component in the set of "template" components.
|
|
67
|
+
- Adds the `aboveHeader` prop to the `TemplateAppContainer` component to render a `TemplateAboveHeader` component immediately before the `TemplateHeader` component.
|
|
68
|
+
- Adds the `additionalStyles` prop to the `Select` component.
|
|
69
|
+
|
|
70
|
+
### Breaking Changes
|
|
71
|
+
|
|
72
|
+
- Renames the `Form` component's `"spacing"` prop to `"gap"` to be consistent with the `FormRow` and `FormField` components.
|
|
73
|
+
- Renames the `FormSpacing` enum to `FormGaps`.
|
|
74
|
+
|
|
75
|
+
### Changes
|
|
76
|
+
|
|
77
|
+
- Passes an `onChange` prop to the `Select` component inside the `SearchBar` through its `selectProps` prop.
|
|
78
|
+
- Adds snapshot tests for the `Tabs` component and better checks to warn the user that the `Tabs` is missing data if data wasn't passed as props or children.
|
|
79
|
+
- Updates the `Form` component to warn developers when a child component in the `FormRow` component _is not_ a `FormField`.
|
|
80
|
+
- Adds an `onSubmit` prop to the `Form` component.
|
|
81
|
+
- Adds the `renderHeaderElement` prop to the `TemplateAppContainer` component. This prop is used to control whether the `TemplateAppContainer` component should render its own `<header>` HTML element through its `header` prop, or let the user pass in their own component that renders the `<header>` HTML element.
|
|
82
|
+
- Updates the `Fieldset` and `RadioGroup` so the `children` prop is declared through `React.PropsWithChildren` rather than in their respective prop interfaces.
|
|
83
|
+
- Adds snapshot tests for the `Accordion` component, as well as `id` props to the components within the `Accordion` so snapshot tests pass.
|
|
84
|
+
- Passes an `id` to the `Icon` in the `Select` component.
|
|
85
|
+
- Adds snapshot tests for the `Select` component.
|
|
86
|
+
|
|
87
|
+
### Fixes
|
|
88
|
+
|
|
89
|
+
- Fixes `id` propagation issues in the `SearchBar` component and its children DS components.
|
|
90
|
+
- Fixing `Breadcrumbs` related logging issue with a CSS pseudo-selector and setting the `aria-label` to "Breadcrumbs". Adding an accessibility test that should fail when more than one `Breadcrumbs` component is rendered on a page since that landmark should only be rendered once on a web page.
|
|
91
|
+
- Exports the `FullDateType` interface related to the `DatePicker` component.
|
|
92
|
+
- Fixes and removes bad console logs from the `Pagination` and `List` components.
|
|
93
|
+
- Fixes auto-generated `id`s in the `Tabs` component.
|
|
94
|
+
- Fixes the Figma link for the `Hero` component.
|
|
95
|
+
- Fixes `Card` component bug for passing styles to the `CardHeading` correctly.
|
|
96
|
+
- Fixes the `Table` component so that a custom header text color of white does not visually hide row headers on a white background.
|
|
97
|
+
|
|
98
|
+
### Updates
|
|
99
|
+
|
|
100
|
+
- Updates the following packages: multiple `@storybook/...` packages, `autoprefixer`, `eslint-plugin-storybook`, `husky`, `lint-staged`, `semantic-release-slack-bot`, `storybook-addon-designs`.
|
|
101
|
+
- Removed the following packages: `postcss`, `pretty-quick`.
|
|
102
|
+
- Added `@chakra-ui/react`, `@chakra-ui/system`, `@emotion/react`, `@emotion/styled`, and `framer-motion` as "peerDependencies".
|
|
103
|
+
- Updates the node version in Github Action workflows from Node v12 to Node v14.
|
|
104
|
+
- Updates how `/dist/resources.scss` is created through gulp.
|
|
105
|
+
|
|
11
106
|
## 0.25.9 (February 3, 2022)
|
|
12
107
|
|
|
13
108
|
### Adds
|
|
@@ -43,6 +138,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
43
138
|
- Updates the `Template` component to use `s` (16px) spacing on the left and right sides of the main content area.
|
|
44
139
|
- Updates the `HelperErrorText` component to allow HTML to be passed in as a string or HTML.
|
|
45
140
|
- Updates how the `HelperErrorText` component renders text in the following components: `Checkbox`, `CheckboxGroup`, `ComponentWrapper`, `DatePicker`, `Radio`, `RadioGroup`, `SearchBar`, `Select`, `Slider`, `TextInput`, `Toggle`, `VideoPlayer`.
|
|
141
|
+
- Updates the `HorizontalRule` component to use "100%" as the default value for the `width` prop.
|
|
46
142
|
|
|
47
143
|
### Fixes
|
|
48
144
|
|
package/README.md
CHANGED
|
@@ -116,17 +116,7 @@ $ npm install @nypl/design-system-react-components
|
|
|
116
116
|
@import "~@nypl/design-system-react-components/dist/styles.css";
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
3.
|
|
120
|
-
|
|
121
|
-
Some CSS rules in the Design System, such as the universal focus styling and the box-model, are namespaced to the `.nypl-ds` class. To include those in your app, add `.nypl-ds` to whichever wrapper tag makes sense in your application (e.g., `<div class="app">` or `<div class="container">`).
|
|
122
|
-
|
|
123
|
-
```jsx
|
|
124
|
-
<div class="app nypl-ds">
|
|
125
|
-
<!-- your code here -->
|
|
126
|
-
</div>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
4. Import the `DSProvider` component
|
|
119
|
+
3. Import the `DSProvider` component
|
|
130
120
|
|
|
131
121
|
In order to use DS components in a consuming application, there is a necessary step that must be done for component styles to properly render. Consuming applications need to wrap all the DS components with a simple provider component. Fortunately, this only needs to be done once at the top level of the consuming application.
|
|
132
122
|
|
|
@@ -141,7 +131,7 @@ const ApplicationContainer = (props) => {
|
|
|
141
131
|
// ...
|
|
142
132
|
return (
|
|
143
133
|
<DSProvider>
|
|
144
|
-
<div className="my-app
|
|
134
|
+
<div className="my-app">
|
|
145
135
|
// ...
|
|
146
136
|
{children}
|
|
147
137
|
</div>
|
|
@@ -150,7 +140,7 @@ const ApplicationContainer = (props) => {
|
|
|
150
140
|
};
|
|
151
141
|
```
|
|
152
142
|
|
|
153
|
-
|
|
143
|
+
4. Use DS components!
|
|
154
144
|
|
|
155
145
|
Consult Storybook for the list of available components and props that they require.
|
|
156
146
|
|
|
@@ -181,13 +171,11 @@ function NewComponent(props) {
|
|
|
181
171
|
|
|
182
172
|
### NYPL DS, NYPL Header, and NYPL Footer
|
|
183
173
|
|
|
184
|
-
Please note that, if used, the NYPL Header and Footer components should be _outside_ of the `.nypl-ds` wrapper class.
|
|
185
|
-
|
|
186
174
|
```jsx
|
|
187
175
|
<body>
|
|
188
176
|
<NYPLHeader />
|
|
189
177
|
|
|
190
|
-
<div class="app
|
|
178
|
+
<div class="app">
|
|
191
179
|
<!-- your code here -->
|
|
192
180
|
</div>
|
|
193
181
|
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { DatePickerTypes } from "./DatePickerTypes";
|
|
3
3
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
4
4
|
import { TextInputRefType } from "../TextInput/TextInput";
|
|
5
|
-
interface FullDateType {
|
|
5
|
+
export interface FullDateType {
|
|
6
6
|
/** Date object that gets returned for the onChange
|
|
7
7
|
* function only for date ranges. */
|
|
8
8
|
endDate?: Date;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface FieldsetProps {
|
|
3
|
-
/** Children to render. Typically form-related components are used. */
|
|
4
|
-
children: React.ReactNode;
|
|
5
3
|
/** Additional class name to add. */
|
|
6
4
|
className?: string;
|
|
7
5
|
/** ID that other components can cross reference for accessibility purposes */
|
|
@@ -21,5 +19,5 @@ interface FieldsetProps {
|
|
|
21
19
|
* A wrapper component that renders a `fieldset` element along with a `legend`
|
|
22
20
|
* element as its first child. Commonly used to wrap form components.
|
|
23
21
|
*/
|
|
24
|
-
declare const Fieldset: React.
|
|
22
|
+
declare const Fieldset: ({ children, className, id, isLegendHidden, isRequired, legendText, optReqFlag, }: React.PropsWithChildren<FieldsetProps>) => JSX.Element;
|
|
25
23
|
export default Fieldset;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/** className to be applied to FormRow */
|
|
2
|
+
import { FormGaps } from "./FormTypes";
|
|
3
|
+
interface FormBaseProps {
|
|
4
|
+
/** className to be applied to FormRow, FormField, and Form */
|
|
5
5
|
className?: string;
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/** Optional spacing size; if omitted, the default `large` (2rem / 32px)
|
|
7
|
+
* spacing will be used; ```IMPORTANT: for general form layout, this prop
|
|
8
|
+
* should not be used``` */
|
|
9
|
+
gap?: FormGaps;
|
|
8
10
|
/** ID that other components can cross reference (internal use) */
|
|
9
11
|
id?: string;
|
|
10
12
|
}
|
|
11
|
-
export interface
|
|
13
|
+
export interface FormChildProps extends FormBaseProps {
|
|
14
|
+
}
|
|
15
|
+
export interface FormProps extends FormBaseProps {
|
|
12
16
|
/** Optional form `action` attribute */
|
|
13
17
|
action?: string;
|
|
14
|
-
/** Optional className you can add in addition to `form` */
|
|
15
|
-
className?: string;
|
|
16
|
-
/** Optional ID that other components can cross reference */
|
|
17
|
-
id?: string;
|
|
18
18
|
/** Optional form `method` attribute */
|
|
19
19
|
method?: "get" | "post";
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/** Function to call for the `onSubmit` form event. */
|
|
21
|
+
onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
22
22
|
}
|
|
23
23
|
/** FormRow child-component */
|
|
24
24
|
export declare function FormRow(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
|
|
@@ -26,3 +26,4 @@ export declare function FormRow(props: React.PropsWithChildren<FormChildProps>):
|
|
|
26
26
|
export declare function FormField(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
|
|
27
27
|
/** Main Form component */
|
|
28
28
|
export default function Form(props: React.PropsWithChildren<FormProps>): JSX.Element;
|
|
29
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GridGaps as
|
|
2
|
-
export {
|
|
1
|
+
import { GridGaps as FormGaps } from "../Grid/GridTypes";
|
|
2
|
+
export { FormGaps };
|
|
@@ -13,7 +13,7 @@ export interface HorizontalRuleProps {
|
|
|
13
13
|
height?: string;
|
|
14
14
|
/** Optional width value. This value should be entered with the same
|
|
15
15
|
* formatting as a CSS width attribute (ex. `50%`, `640px`, `20rem`). If
|
|
16
|
-
* omitted, the horizontal rule will have a default width of "
|
|
16
|
+
* omitted, the horizontal rule will have a default width of "100%". */
|
|
17
17
|
width?: string;
|
|
18
18
|
}
|
|
19
19
|
export default function HorizontalRule(props: HorizontalRuleProps): JSX.Element;
|
|
@@ -18,19 +18,21 @@ export declare enum IconColors {
|
|
|
18
18
|
UiWhite = "ui.white",
|
|
19
19
|
BrandPrimary = "brand.primary",
|
|
20
20
|
BrandSecondary = "brand.secondary",
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
SectionBlogsPrimary = "section.blogs.primary",
|
|
22
|
+
SectionBlogsSecondary = "section.blogs.secondary",
|
|
23
23
|
SectionBooksAndMorePrimary = "section.books-and-more.primary",
|
|
24
24
|
SectionBooksAndMoreSecondary = "section.books-and-more.secondary",
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
SectionEducationPrimary = "section.education.primary",
|
|
26
|
+
SectionEducationSecondary = "section.education.secondary",
|
|
27
27
|
SectionLocationsPrimary = "section.locations.primary",
|
|
28
28
|
SectionLocationsSecondary = "section.locations.secondary",
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
SectionResearchPrimary = "section.research.primary",
|
|
30
|
+
SectionResearchSecondary = "section.research.secondary",
|
|
31
31
|
SectionResearchLibraryLpa = "section.research-library.lpa",
|
|
32
32
|
SectionResearchLibrarySchomburg = "section.research-library.schomburg",
|
|
33
|
-
SectionResearchLibrarySchwartzman = "section.research-library.schwartzman"
|
|
33
|
+
SectionResearchLibrarySchwartzman = "section.research-library.schwartzman",
|
|
34
|
+
SectionWhatsOnPrimary = "section.whats-on.primary",
|
|
35
|
+
SectionWhatsOnSecondary = "section.whats-on.secondary"
|
|
34
36
|
}
|
|
35
37
|
export declare enum IconSizes {
|
|
36
38
|
Small = "small",
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { ListTypes } from "./ListTypes";
|
|
3
3
|
interface DefinitionProps {
|
|
4
4
|
term: string;
|
|
5
|
-
definition: string;
|
|
5
|
+
definition: string | JSX.Element;
|
|
6
6
|
}
|
|
7
7
|
export interface ListProps {
|
|
8
8
|
/** Optionally pass in additional Chakra-based styles. */
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
logo_bpl_black: string;
|
|
3
|
+
logo_bpl_white: string;
|
|
4
|
+
logo_clever_color: string;
|
|
5
|
+
logo_clever_white: string;
|
|
6
|
+
logo_firstbook_color: string;
|
|
7
|
+
logo_firstbook_color_negative: string;
|
|
8
|
+
logo_lpa_black: string;
|
|
3
9
|
logo_lpa_color: string;
|
|
4
10
|
logo_lpa_white: string;
|
|
11
|
+
logo_mln_black: string;
|
|
12
|
+
logo_mln_white: string;
|
|
5
13
|
logo_nypl_full_black: string;
|
|
6
14
|
logo_nypl_full_white: string;
|
|
7
|
-
logo_nypl_lion_white: string;
|
|
8
15
|
logo_nypl_lion_black: string;
|
|
16
|
+
logo_nypl_lion_white: string;
|
|
17
|
+
logo_openebooks_color: string;
|
|
18
|
+
logo_openebooks_negative: string;
|
|
19
|
+
logo_openebooks_wtext_color: string;
|
|
20
|
+
logo_openebooks_wtext_negative: string;
|
|
9
21
|
logo_qpl_alt_black: string;
|
|
22
|
+
logo_qpl_alt_white: string;
|
|
23
|
+
logo_qpl_black: string;
|
|
10
24
|
logo_qpl_color: string;
|
|
25
|
+
logo_qpl_white: string;
|
|
26
|
+
logo_schomburg_black: string;
|
|
27
|
+
logo_schomburg_circle_black: string;
|
|
11
28
|
logo_schomburg_circle_color: string;
|
|
29
|
+
logo_schomburg_circle_white: string;
|
|
12
30
|
logo_schomburg_color: string;
|
|
31
|
+
logo_schomburg_white: string;
|
|
13
32
|
logo_simplye_black: string;
|
|
33
|
+
logo_simplye_white: string;
|
|
14
34
|
logo_simplye_color: string;
|
|
15
35
|
logo_snfl_black: string;
|
|
16
36
|
logo_snfl_white: string;
|
|
37
|
+
logo_treasures_color: string;
|
|
38
|
+
logo_treasures_color_negative: string;
|
|
17
39
|
};
|
|
18
40
|
export default _default;
|
|
@@ -13,18 +13,40 @@ export declare enum LogoSizes {
|
|
|
13
13
|
}
|
|
14
14
|
export declare enum LogoNames {
|
|
15
15
|
BrooklynPublicLibraryBlack = "logo_bpl_black",
|
|
16
|
+
BrooklynPublicLibraryWhite = "logo_bpl_white",
|
|
17
|
+
CleverColor = "logo_clever_color",
|
|
18
|
+
CleverWhite = "logo_clever_white",
|
|
19
|
+
FirstBookColor = "logo_firstbook_color",
|
|
20
|
+
FirstBookColorNegative = "logo_firstbook_color_negative",
|
|
16
21
|
LPAColor = "logo_lpa_color",
|
|
22
|
+
LPABlack = "logo_lpa_black",
|
|
17
23
|
LPAWhite = "logo_lpa_white",
|
|
24
|
+
MyLibraryNYCBlack = "logo_mln_black",
|
|
25
|
+
MyLibraryNYCWhite = "logo_mln_white",
|
|
18
26
|
NYPLBlack = "logo_nypl_full_black",
|
|
19
27
|
NYPLWhite = "logo_nypl_full_white",
|
|
20
28
|
NYPLLionBlack = "logo_nypl_lion_black",
|
|
21
29
|
NYPLLionWhite = "logo_nypl_lion_white",
|
|
30
|
+
OpenEBooksColor = "logo_openebooks_color",
|
|
31
|
+
OpenEBooksNegative = "logo_openebooks_negative",
|
|
32
|
+
OpenEBooksWithTextColor = "logo_openebooks_wtext_color",
|
|
33
|
+
OpenEBooksWithTextNegative = "logo_openebooks_wtext_negative",
|
|
22
34
|
QueensPublicLibraryColor = "logo_qpl_color",
|
|
35
|
+
QueensPublicLibraryBlack = "logo_qpl_black",
|
|
36
|
+
QueensPublicLibraryWhite = "logo_qpl_white",
|
|
23
37
|
QueensPublicLibraryAltBlack = "logo_qpl_alt_black",
|
|
38
|
+
QueensPublicLibraryAltWhite = "logo_qpl_alt_white",
|
|
24
39
|
SchomburgColor = "logo_schomburg_color",
|
|
40
|
+
SchomburgBlack = "logo_schomburg_black",
|
|
41
|
+
SchomburgWhite = "logo_schomburg_white",
|
|
25
42
|
SchomburgCircleColor = "logo_schomburg_circle_color",
|
|
43
|
+
SchomburgCircleBlack = "logo_schomburg_circle_black",
|
|
44
|
+
SchomburgCircleWhite = "logo_schomburg_circle_white",
|
|
26
45
|
SimplyEColor = "logo_simplye_color",
|
|
27
46
|
SimplyEBlack = "logo_simplye_black",
|
|
47
|
+
SimplyEWhite = "logo_simplye_white",
|
|
28
48
|
SNFLBlack = "logo_snfl_black",
|
|
29
|
-
SNFLWhite = "logo_snfl_white"
|
|
49
|
+
SNFLWhite = "logo_snfl_white",
|
|
50
|
+
TreasuresColor = "logo_treasures_color",
|
|
51
|
+
TreasuresColorNegative = "logo_treasures_color_negative"
|
|
30
52
|
}
|
|
@@ -16,6 +16,8 @@ interface BaseProps {
|
|
|
16
16
|
declare type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
|
|
17
17
|
declare type BasePropsWithoutCentered = Omit<BaseProps, "centered">;
|
|
18
18
|
export interface NotificationProps extends BasePropsWithoutAlignText {
|
|
19
|
+
/** Label used to describe the `Notification`'s aside HTML element. */
|
|
20
|
+
ariaLabel?: string;
|
|
19
21
|
/** Additional `className` to add. */
|
|
20
22
|
className?: string;
|
|
21
23
|
/** Optional prop to control whether a `Notification` can be dismissed
|
|
@@ -2,14 +2,18 @@ import React from "react";
|
|
|
2
2
|
export interface PaginationProps {
|
|
3
3
|
/** Additional className. */
|
|
4
4
|
className?: string;
|
|
5
|
+
/** The currentPage can be used to programatically force the selected page to change
|
|
6
|
+
* without the user explicitly requesting it – for example, if the user should be
|
|
7
|
+
* brought back to the first page of a set of results after a new search. */
|
|
8
|
+
currentPage?: number;
|
|
5
9
|
/** The callback function that takes a page number and returns a string
|
|
6
10
|
* to use for a link's `href` attribute. This is used when the current
|
|
7
11
|
* page should refresh when navigating. */
|
|
8
12
|
getPageHref?: undefined | ((pageNumber: number) => string);
|
|
9
13
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
10
14
|
id?: string;
|
|
11
|
-
/** The
|
|
12
|
-
initialPage
|
|
15
|
+
/** The initially selected page (default value is 1). */
|
|
16
|
+
initialPage?: number;
|
|
13
17
|
/** The callback function called when an item is selected and the current
|
|
14
18
|
* page should not refresh. */
|
|
15
19
|
onPageChange?: (selected: number) => void;
|
|
@@ -2,8 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
3
|
import { RadioGroupLayoutTypes } from "./RadioGroupLayoutTypes";
|
|
4
4
|
export interface RadioGroupProps {
|
|
5
|
-
/** Any child node passed to the component. */
|
|
6
|
-
children: React.ReactNode;
|
|
7
5
|
/** Additional class name. */
|
|
8
6
|
className?: string;
|
|
9
7
|
/** Populates the initial value of the input */
|
|
@@ -39,5 +37,7 @@ export interface RadioGroupProps {
|
|
|
39
37
|
showLabel?: boolean;
|
|
40
38
|
}
|
|
41
39
|
export declare const onChangeDefault: () => void;
|
|
42
|
-
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps &
|
|
40
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & {
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
43
43
|
export default RadioGroup;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
-
interface
|
|
3
|
+
interface BaseProps {
|
|
4
4
|
labelText: string;
|
|
5
5
|
name: string;
|
|
6
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps extends BaseProps {
|
|
6
9
|
optionsData: string[];
|
|
7
10
|
}
|
|
8
|
-
interface TextInputProps {
|
|
9
|
-
|
|
10
|
-
name: string;
|
|
11
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
12
|
-
placeholder: string;
|
|
11
|
+
export interface TextInputProps extends BaseProps {
|
|
12
|
+
placeholder?: string;
|
|
13
13
|
value?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface SearchBarProps {
|
|
@@ -2,6 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
3
|
import { SelectTypes } from "./SelectTypes";
|
|
4
4
|
export interface SelectProps {
|
|
5
|
+
/** Optionally pass in additional Chakra-based styles. */
|
|
6
|
+
additionalStyles?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
5
9
|
/** A class name for the `div` parent element. */
|
|
6
10
|
className?: string;
|
|
7
11
|
/** Optional string to populate the `HelperErrorText` for the standard state. */
|
|
@@ -10,14 +10,20 @@ export interface TableProps {
|
|
|
10
10
|
columnHeadersTextColor?: string;
|
|
11
11
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
12
12
|
id?: string;
|
|
13
|
-
/** If true,
|
|
14
|
-
|
|
15
|
-
/** If true, a border will be displayed between each row in the `Table` component. The default value is false. */
|
|
13
|
+
/** If true, a border will be displayed between each row in the `Table`
|
|
14
|
+
* component. The default value is false. */
|
|
16
15
|
showRowDividers?: boolean;
|
|
17
16
|
/** Two-dimensional array used to populate the table rows. */
|
|
18
17
|
tableData: string[][];
|
|
19
18
|
/** Displays `Table` title element. */
|
|
20
19
|
titleText?: string;
|
|
20
|
+
/** If true, the first cell of each row in the `Table` component will be
|
|
21
|
+
* visually styled as a header. The default value is false */
|
|
22
|
+
useRowHeaders?: boolean;
|
|
21
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Basic `Table` component used to organize and display tabular data in
|
|
26
|
+
* rows and columns.
|
|
27
|
+
*/
|
|
22
28
|
declare function Table(props: React.PropsWithChildren<TableProps>): JSX.Element;
|
|
23
29
|
export default Table;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export interface TemplateProps {
|
|
3
3
|
}
|
|
4
|
+
export interface TemplateHeaderProps {
|
|
5
|
+
/** Flag to render an HTML header element. True by default. */
|
|
6
|
+
renderHeaderElement?: boolean;
|
|
7
|
+
}
|
|
4
8
|
export interface TemplateFooterProps {
|
|
5
9
|
/** Flag to render an HTML footer element. True by default. */
|
|
6
10
|
renderFooterElement?: boolean;
|
|
@@ -12,7 +16,10 @@ export interface TemplateSidebarProps {
|
|
|
12
16
|
}
|
|
13
17
|
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
14
18
|
}
|
|
15
|
-
export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateSidebarProps {
|
|
19
|
+
export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
|
|
20
|
+
/** DOM that will be rendered before the rest of the components in
|
|
21
|
+
* `TemplateAppContainer` and immediately before the `TemplateHeader` component. */
|
|
22
|
+
aboveHeader?: React.ReactElement;
|
|
16
23
|
/** DOM that will be rendered in the `TemplateBreakout` component section. */
|
|
17
24
|
breakout?: React.ReactElement;
|
|
18
25
|
/** DOM that will be rendered in the `TemplateContentPrimary` component section. */
|
|
@@ -28,14 +35,26 @@ export interface TemplateAppContainerProps extends TemplateFooterProps, Template
|
|
|
28
35
|
}
|
|
29
36
|
/**
|
|
30
37
|
* The main top-level parent component that wraps all template-related
|
|
31
|
-
* components.
|
|
38
|
+
* components.
|
|
32
39
|
*/
|
|
33
40
|
declare const Template: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
41
|
+
/**
|
|
42
|
+
* This optional component renders its children from edge-to-edge and should
|
|
43
|
+
* be used for alerts or notifications that are typically site-wide. This must
|
|
44
|
+
* be rendered immediately before the `TemplateHeader` component. This is meant
|
|
45
|
+
* for components that render an `aside` HTML element or HTML element with the
|
|
46
|
+
* `role="complementary"` attribute. These elements should *not* be rendered
|
|
47
|
+
* in the `header` HTML section since that's an accessibility violation.
|
|
48
|
+
*/
|
|
49
|
+
declare const TemplateAboveHeader: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
34
50
|
/**
|
|
35
51
|
* This optional component should be the first child of the `Template`
|
|
36
|
-
* component. This is rendered as an HTML `<header>` element.
|
|
52
|
+
* component. This is rendered as an HTML `<header>` element. If an HTML
|
|
53
|
+
* `<header>` element is already passed in a custom component as the children,
|
|
54
|
+
* set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
|
|
55
|
+
* render an HTML `<header>` element.
|
|
37
56
|
*/
|
|
38
|
-
declare const TemplateHeader: (
|
|
57
|
+
declare const TemplateHeader: ({ children, renderHeaderElement, }: React.PropsWithChildren<TemplateHeaderProps>) => JSX.Element;
|
|
39
58
|
/**
|
|
40
59
|
* This optional component should be used inside the `TemplateHeader` component.
|
|
41
60
|
* This is meant to render its children from edge to edge and is most useful
|
|
@@ -93,4 +112,4 @@ declare const TemplateFooter: ({ children, renderFooterElement, }: React.PropsWi
|
|
|
93
112
|
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
94
113
|
*/
|
|
95
114
|
declare const TemplateAppContainer: (props: React.PropsWithChildren<TemplateAppContainerProps>) => JSX.Element;
|
|
96
|
-
export { TemplateAppContainer, Template, TemplateHeader, TemplateBreakout, TemplateContent, TemplateContentTop, TemplateContentPrimary, TemplateContentSidebar, TemplateFooter, };
|
|
115
|
+
export { TemplateAppContainer, Template, TemplateAboveHeader, TemplateHeader, TemplateBreakout, TemplateContent, TemplateContentTop, TemplateContentPrimary, TemplateContentSidebar, TemplateFooter, };
|