@nypl/design-system-react-components 1.4.0 → 1.4.2
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 +32 -2
- package/README.md +62 -2
- package/dist/components/Header/components/HeaderLogin.d.ts +1 -2
- package/dist/components/Header/components/HeaderSearchForm.d.ts +1 -0
- package/dist/components/Header/utils/headerUtils.d.ts +4 -0
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +6 -1
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +2 -0
- package/dist/components/SearchBar/SearchBar.d.ts +5 -14
- package/dist/components/TextInput/TextInput.d.ts +2 -0
- package/dist/design-system-react-components.cjs.development.js +1042 -1184
- 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 +1043 -1185
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/header/headerLogin.d.ts +1 -8
- package/dist/theme/components/header/headerSearchForm.d.ts +14 -14
- package/dist/utils/utils.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,35 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 1.4.2 (March 2, 2023)
|
|
12
|
+
|
|
13
|
+
### Updates
|
|
14
|
+
|
|
15
|
+
- Updates the `Logo` component to include "black" and "white" variants for `Digital Collections`.
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- Updates the `Slider` component's `currentValue` state to use the `useStateWithDependencies` hook.
|
|
20
|
+
|
|
21
|
+
## 1.4.1 (February 9, 2023)
|
|
22
|
+
|
|
23
|
+
### Adds
|
|
24
|
+
|
|
25
|
+
- Adds the `pattern` prop to the `TextInput` component.
|
|
26
|
+
- Adds documentation page "Dynamic Content" to the `Accessibility Guide`.
|
|
27
|
+
- Adds the `isRenderedText` prop to the `HelperErrorText` component.
|
|
28
|
+
|
|
29
|
+
### Updates
|
|
30
|
+
|
|
31
|
+
- Adds a third radio button to the `Header` component, separating search options between the Circulating Catalog, Research Catalog, and the NYPL.org website.
|
|
32
|
+
- Temporarily removes the "log in" state from the `Header` component, the feature to read auth cookies, and the patron's name when logged in, and the log out link.
|
|
33
|
+
- Truncate breadcrumb text if beyond 40 characters then add ellipsis at the end. If the breadcrumb text is truncated, the DS `Tooltip` component is used to display the full text in a tooltip when the text is hovered.
|
|
34
|
+
- Updates the `SearchBar`'s `textInputProps` prop to include the following props to pass to the `TextInput` component: `isClearableCallback`, `max`, `maxLength`, `min`, and `pattern`.
|
|
35
|
+
- Updates how the `CheckboxGroup`, `ComponentWrapper`, `DatePicker`, and `RadioGroup` components internally render the `HelperErrorText` component. The update in the `ComponentWrapper` component affects the `AudioPlayer`, `Checkbox`, `Radio`, `SearchBar`, `Select`, `Slider`, `TextInput`, `Toggle`, and `VideoPlayer` DS components, each of which render helper or error text.
|
|
36
|
+
- Updates the `MultiSelect` component so it closes when the "escape" key is pressed.
|
|
37
|
+
- Updates where the focus is set in the `MultiSelect` "dialog" variant after the "Apply" button is clicked.
|
|
38
|
+
- Updates where the focus is set in the `MultiSelect` component after the selected items count button is clicked.
|
|
39
|
+
|
|
11
40
|
## 1.4.0 (January 26, 2023)
|
|
12
41
|
|
|
13
42
|
### Adds
|
|
@@ -28,7 +57,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
28
57
|
`dark.ui.status.primary`, `dark.ui.status.secondary`, `dark.ui.success.primary`,
|
|
29
58
|
`dark.ui.success.secondary`, `dark.ui.warning.primary`
|
|
30
59
|
and `dark.ui.warning.secondary`.
|
|
31
|
-
- Updates the layout of the category `RadioGroup` to `column` for the
|
|
60
|
+
- Updates the layout of the category `RadioGroup` to `column` for the mobile
|
|
32
61
|
view of the `FeedbackBox` component.
|
|
33
62
|
- Updates the background color for the `"iconOnly"` and `"text"` variants of
|
|
34
63
|
the `Button` component.
|
|
@@ -39,6 +68,7 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
39
68
|
- Updates the `HelperErrorText` component to set the `ariaLive` default value
|
|
40
69
|
to `"polite"`.
|
|
41
70
|
- Updates the `Accessibility` details for the `Notification` component.
|
|
71
|
+
- Better docs for the `onSubmit` prop in the `FeedbackBox` component.
|
|
42
72
|
|
|
43
73
|
### Fixes
|
|
44
74
|
|
|
@@ -198,7 +228,7 @@ This release is exactly the same as the `1.3.0-rc` release candidate published o
|
|
|
198
228
|
|
|
199
229
|
- Deprecates the `link` variant in the `Button` component.
|
|
200
230
|
|
|
201
|
-
## 1.1.0 (
|
|
231
|
+
## 1.1.0 (August 30, 2022)
|
|
202
232
|
|
|
203
233
|
This release is exactly the same as the `1.1.0-rc5` release candidate which was published and reviewed. Minor bug fixes, listed below, were made.
|
|
204
234
|
|
package/README.md
CHANGED
|
@@ -272,9 +272,69 @@ Follow the [contribution document](/.github/CONTRIBUTING.md) to follow git branc
|
|
|
272
272
|
|
|
273
273
|
### Node Version
|
|
274
274
|
|
|
275
|
-
We recommend using Node version
|
|
275
|
+
We recommend using Node version 14.x since the DS has some issues with versions higher than 14.x. The Github Actions for linting, automated testing, deploying to Github Pages, and releasing to npm are all running on Node 14.x.
|
|
276
276
|
|
|
277
|
-
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 `
|
|
277
|
+
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 `14.x`).
|
|
278
|
+
|
|
279
|
+
### Git Branch Workflow
|
|
280
|
+
|
|
281
|
+
There are currently two main branches for the DS:
|
|
282
|
+
|
|
283
|
+
- `development` is the main and default branch for the DS. All new feature and bug fix pull requests should be made against this branch.
|
|
284
|
+
- `release` is the branch used to deploy the static Storybook instance to Github Pages, the DS' production Storybook instance.
|
|
285
|
+
|
|
286
|
+
When a new version of the DS is ready for release, the `development` branch is merged into the `release` branch through a pull request. Once merged, Github Actions will run to deploy the static Storybook as well as publish the new version to npm. Here is a [pull request](https://github.com/NYPL/nypl-design-system/pull/1249) that follows the convention outlined in [How to Run a Release](https://github.com/NYPL/nypl-design-system/wiki/How-to-Run-a-Release).
|
|
287
|
+
|
|
288
|
+
When working on a new feature or a bug fix:
|
|
289
|
+
|
|
290
|
+
1. Create a new branch off of `development` with the following naming convention: `[ticket-number]/your-feature-or-bug-name`. For example, if the JIRA ticket is DSD-1234 and the feature is "Add more Animal Crossing examples", then potential branch names can be `DSD-1234/add-more-animal-crossing-examples`, `DSD-1234/more-ac-examples`, or `DSD-1234/animal-crossing-examples`. The ticket number in the branch name is usually more helpful than the text that follows.
|
|
291
|
+
2. Create a pull request that points to the `development` branch.
|
|
292
|
+
3. If your pull request is approved and _should_ be merged, merge it. This is indicated with the "SHIP IT" Github label. Sometimes, some features must wait and the "DO NOT MERGE" label is added to the pull request.
|
|
293
|
+
|
|
294
|
+
### Release Candidates
|
|
295
|
+
|
|
296
|
+
For new big feature updates, we typically want to QA it in the Turbine test app before the real stable release is made. In this case, we create "release candidate" npm packages. This can be based off the feature branch or the `developement` branch once the feature is merged in.
|
|
297
|
+
|
|
298
|
+
At the moment, this is a manual process. For this example, we will use version `1.5.0` as the new version that will be released.
|
|
299
|
+
|
|
300
|
+
1. Whether on the feature branch or the `development` branch, the version in the `package.json` file must be updated to include the `-rc` suffix. For example, `1.5.0` becomes `1.5.0-rc`. This is to indicate that this is a release candidate version.
|
|
301
|
+
2. Delete the `package-lock.json` file and the `node_modules` directory.
|
|
302
|
+
3. Run `npm install` to install all the dependencies and create a new `package-lock.json` file with the updated version.
|
|
303
|
+
4. Run `npm publish` to publish the new release candidate version to npm. Make sure you have an npm account, are logged in to npm on your machine, and have the correct permissions to publish to the `@nypl/design-system-react-components` package.
|
|
304
|
+
|
|
305
|
+
What happens if QA finds a bug in the release candidate version in the Turbine test app?
|
|
306
|
+
|
|
307
|
+
1. Update or fix the bug in a new branch.
|
|
308
|
+
2. Once approved, merge the pull request into the feature branch or the `development` branch.
|
|
309
|
+
3. Follow the same steps above to create a new release candidate version but this time the `-rc` suffix should be incremented. For example, `1.5.0-rc` becomes `1.5.0-rc1`.
|
|
310
|
+
4. QA the new release candidate version in the Turbine test app.
|
|
311
|
+
|
|
312
|
+
The release candidate version passed QA and is ready for production! What do we do now?
|
|
313
|
+
|
|
314
|
+
1. Celebrate.
|
|
315
|
+
2. Make sure all the new changes are merged into the `development` branch.
|
|
316
|
+
3. Remove the `-rc` suffix from the version in the `package.json` file.
|
|
317
|
+
4. Delete the `package-lock.json` file and the `node_modules` directory.
|
|
318
|
+
5. Run `npm install` to install all the dependencies and create a new `package-lock.json` file with the updated version.
|
|
319
|
+
6. Push the changes to Github and create a new pull request from `development` that points to the `release` branch.
|
|
320
|
+
7. Once approved and merged, a Github Action will run that will automatically deploy the static Storybook to Github Pages and publish the new version to npm.
|
|
321
|
+
|
|
322
|
+
#### Release Troubleshooting
|
|
323
|
+
|
|
324
|
+
There is currently a bug with node that causes Vercel preview instances to fail and not build correctly. In order to fix this, the build script has an included node flag added. This can be found in package.json:
|
|
325
|
+
|
|
326
|
+
```json
|
|
327
|
+
"build-storybook:v1": "npm run prebuild:storybook && NODE_OPTIONS=--openssl-legacy-provider build-storybook -c .storybook -o ./reservoir/v1",
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Unfortunately, while this helps the Vercel previews to build correctly, it causes the Github Action that builds the production Storybook to fail. Because of this, the `release` branch must _not_ include the `NODE_OPTIONS=--openssl-legacy-provider` flag. This means that the `release` branch must be updated to remove this flag before merging the `development` branch into it.
|
|
331
|
+
|
|
332
|
+
For now, this is a manual process until the repo's node version and build system are updated.
|
|
333
|
+
|
|
334
|
+
| Branch | Script |
|
|
335
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
336
|
+
| `development` | `"build-storybook:v1": "npm run prebuild:storybook && NODE_OPTIONS=--openssl-legacy-provider build-storybook -c .storybook -o ./reservoir/v1",` |
|
|
337
|
+
| `release` | `"build-storybook:v1": "npm run prebuild:storybook && build-storybook -c .storybook -o ./reservoir/v1",` |
|
|
278
338
|
|
|
279
339
|
## Developing with NPM Link
|
|
280
340
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface HeaderLoginProps {
|
|
3
3
|
catalogRef?: React.RefObject<HTMLDivElement & HTMLAnchorElement>;
|
|
4
|
-
greetingRef?: React.RefObject<HTMLDivElement>;
|
|
5
4
|
isMobile?: boolean;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
@@ -9,5 +8,5 @@ export interface HeaderLoginProps {
|
|
|
9
8
|
* in and log out. When the patron is logged in, it will also display the patron's
|
|
10
9
|
* name, links to the catalogs, and a log out link.
|
|
11
10
|
*/
|
|
12
|
-
declare const HeaderLogin: import("@chakra-ui/react").ChakraComponent<({ catalogRef,
|
|
11
|
+
declare const HeaderLogin: import("@chakra-ui/react").ChakraComponent<({ catalogRef, isMobile }: HeaderLoginProps) => JSX.Element, {}>;
|
|
13
12
|
export default HeaderLogin;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface HeaderSearchFormProps {
|
|
3
3
|
isMobile?: boolean;
|
|
4
4
|
}
|
|
5
|
+
export declare type SearchOptionType = "circulatingCatalog" | "researchCatalog" | "website";
|
|
5
6
|
/**
|
|
6
7
|
* Displays the search form for the Header's search interface. On mobile, two
|
|
7
8
|
* buttons are displayed and on desktop, two radio inputs are displayed.
|
|
@@ -48,6 +48,10 @@ export declare const encoreEncodeSearchString: (searchString: any) => any;
|
|
|
48
48
|
* Returns the final URL for the NYPL Encore search.
|
|
49
49
|
*/
|
|
50
50
|
export declare const getEncoreCatalogURL: (searchValue: any) => any;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the final URL for the NYPL Research Catalog search.
|
|
53
|
+
*/
|
|
54
|
+
export declare const getResearchCatalogURL: (searchValue: any) => string;
|
|
51
55
|
/**
|
|
52
56
|
* Returns the final URL for the NYPL catalog search.
|
|
53
57
|
*/
|
|
@@ -19,11 +19,16 @@ interface HelperErrorTextProps {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
/** Toggles between helper and invalid styling. */
|
|
21
21
|
isInvalid?: boolean;
|
|
22
|
+
/** Offers the ability to render or not render the content passed in
|
|
23
|
+
* the `text` prop; `true` by default. */
|
|
24
|
+
isRenderedText?: boolean;
|
|
22
25
|
/** The text to display. */
|
|
23
26
|
text: HelperErrorTextType;
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
29
|
+
* Component that always renders a div even if the text content is not passed.
|
|
30
|
+
* This pattern guarantees accessibility guidelines are met if the text content
|
|
31
|
+
* is dynamically updated by the app or component that implements it.
|
|
27
32
|
*/
|
|
28
33
|
export declare const HelperErrorText: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<HelperErrorTextProps & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
29
34
|
export default HelperErrorText;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare type LogoNames = "appleAppStoreBlack" | "appleAppStoreWhite" | "bplBlack" | "bplWhite" | "cleverBadgeColor" | "cleverColor" | "cleverWhite" | "firstbookColor" | "firstbookColorNegative" | "googlePlayBlack" | "lpaBlack" | "lpaColor" | "lpaWhite" | "mlnBlack" | "mlnColor" | "mlnWhite" | "nycdoeColor" | "nyplFullBlack" | "nyplFullWhite" | "nyplLionBlack" | "nyplLionWhite" | "nyplTextBlack" | "nyplTextWhite" | "openebooksColor" | "openebooksNegative" | "openebooksWithTextColor" | "openebooksWithTextNegative" | "qplAltBlack" | "qplAltWhite" | "qplBlack" | "qplColor" | "qplWhite" | "reservoirIconColor" | "reservoirVerticalColor" | "schomburgBlack" | "schomburgCircleBlack" | "schomburgCircleColor" | "schomburgCircleWhite" | "schomburgColor" | "schomburgWhite" | "simplyeBlack" | "simplyeWhite" | "simplyeColor" | "snflBlack" | "snflWhite" | "treasuresColor" | "treasuresColorNegative";
|
|
2
|
+
export declare type LogoNames = "appleAppStoreBlack" | "appleAppStoreWhite" | "bplBlack" | "bplWhite" | "cleverBadgeColor" | "cleverColor" | "cleverWhite" | "digitalCollectionsBlack" | "digitalCollectionsWhite" | "firstbookColor" | "firstbookColorNegative" | "googlePlayBlack" | "lpaBlack" | "lpaColor" | "lpaWhite" | "mlnBlack" | "mlnColor" | "mlnWhite" | "nycdoeColor" | "nyplFullBlack" | "nyplFullWhite" | "nyplLionBlack" | "nyplLionWhite" | "nyplTextBlack" | "nyplTextWhite" | "openebooksColor" | "openebooksNegative" | "openebooksWithTextColor" | "openebooksWithTextNegative" | "qplAltBlack" | "qplAltWhite" | "qplBlack" | "qplColor" | "qplWhite" | "reservoirIconColor" | "reservoirVerticalColor" | "schomburgBlack" | "schomburgCircleBlack" | "schomburgCircleColor" | "schomburgCircleWhite" | "schomburgColor" | "schomburgWhite" | "simplyeBlack" | "simplyeWhite" | "simplyeColor" | "snflBlack" | "snflWhite" | "treasuresColor" | "treasuresColorNegative";
|
|
3
3
|
export declare type LogoSizes = "default" | "xxsmall" | "xsmall" | "small" | "medium" | "large";
|
|
4
4
|
export interface LogoProps {
|
|
5
5
|
/** Optional className that will be added to the parent element */
|
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
labelText: string;
|
|
6
|
-
name: string;
|
|
7
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
3
|
+
import { SelectProps as InitialSelectProps } from "../Select/Select";
|
|
4
|
+
import { InputProps as InitialInputProps } from "../TextInput/TextInput";
|
|
10
5
|
interface SelectOptionsProps {
|
|
11
6
|
text: string;
|
|
12
7
|
value: string;
|
|
13
8
|
}
|
|
14
|
-
export
|
|
9
|
+
export declare type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" | "name" | "onChange" | "value">> & {
|
|
15
10
|
optionsData: SelectOptionsProps[];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export interface TextInputProps extends BaseProps {
|
|
19
|
-
isClearable?: boolean;
|
|
20
|
-
placeholder?: string;
|
|
21
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export declare type TextInputProps = Pick<InitialInputProps, "labelText" | "name"> & Partial<Pick<InitialInputProps, "id" | "isClearable" | "isClearableCallback" | "max" | "maxLength" | "min" | "onChange" | "pattern" | "placeholder" | "value">>;
|
|
22
13
|
export interface SearchBarProps {
|
|
23
14
|
/** Adds 'action' property to the `form` element. */
|
|
24
15
|
action?: string;
|
|
@@ -50,6 +50,8 @@ export interface InputProps {
|
|
|
50
50
|
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
51
51
|
/** The action to perform on the `input`/`textarea`'s onFocus function */
|
|
52
52
|
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
+
/** Regex to query the user input against. */
|
|
54
|
+
pattern?: string;
|
|
53
55
|
/** Populates the placeholder for the input/textarea elements */
|
|
54
56
|
placeholder?: string;
|
|
55
57
|
/** Allows the '(Required)' text to be changed for language purposes
|