@nypl/design-system-react-components 1.4.1 → 1.5.0-rc

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +62 -2
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  4. package/dist/components/Header/components/HeaderSearchButton.d.ts +2 -2
  5. package/dist/components/Logo/Logo.d.ts +1 -1
  6. package/dist/components/Logo/LogoSvgs.d.ts +2 -0
  7. package/dist/components/Notification/Notification.d.ts +8 -7
  8. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
  9. package/dist/design-system-react-components.cjs.development.js +1764 -670
  10. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  11. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  12. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  13. package/dist/design-system-react-components.esm.js +1767 -673
  14. package/dist/design-system-react-components.esm.js.map +1 -1
  15. package/dist/styles.css +1 -1
  16. package/dist/theme/components/accordion.d.ts +14 -0
  17. package/dist/theme/components/audioPlayer.d.ts +7 -0
  18. package/dist/theme/components/breadcrumb.d.ts +28 -0
  19. package/dist/theme/components/button.d.ts +12 -0
  20. package/dist/theme/components/card.d.ts +40 -0
  21. package/dist/theme/components/checkbox.d.ts +67 -0
  22. package/dist/theme/components/customTable.d.ts +103 -2
  23. package/dist/theme/components/feedbackBox.d.ts +22 -0
  24. package/dist/theme/components/fieldset.d.ts +3 -0
  25. package/dist/theme/components/filterBar.d.ts +16 -0
  26. package/dist/theme/components/footer.d.ts +18 -0
  27. package/dist/theme/components/global.d.ts +46 -0
  28. package/dist/theme/components/header/header.d.ts +7 -0
  29. package/dist/theme/components/header/headerLogin.d.ts +18 -0
  30. package/dist/theme/components/header/headerLoginButton.d.ts +15 -0
  31. package/dist/theme/components/header/headerLowerNav.d.ts +32 -0
  32. package/dist/theme/components/header/headerMobileIconNav.d.ts +5 -0
  33. package/dist/theme/components/header/headerMobileNavButton.d.ts +6 -0
  34. package/dist/theme/components/header/headerSearchButton.d.ts +26 -0
  35. package/dist/theme/components/header/headerSearchForm.d.ts +9 -0
  36. package/dist/theme/components/header/headerSitewideAlerts.d.ts +12 -0
  37. package/dist/theme/components/header/headerUpperNav.d.ts +12 -0
  38. package/dist/theme/components/heading.d.ts +9 -0
  39. package/dist/theme/components/helperErrorText.d.ts +3 -0
  40. package/dist/theme/components/hero.d.ts +42 -5
  41. package/dist/theme/components/horizontalRule.d.ts +3 -0
  42. package/dist/theme/components/image.d.ts +54 -0
  43. package/dist/theme/components/label.d.ts +3 -0
  44. package/dist/theme/components/link.d.ts +20 -4
  45. package/dist/theme/components/list.d.ts +46 -0
  46. package/dist/theme/components/modal.d.ts +21 -0
  47. package/dist/theme/components/multiSelectMenuButton.d.ts +23 -0
  48. package/dist/theme/components/notification.d.ts +62 -21
  49. package/dist/theme/components/progressIndicator.d.ts +16 -0
  50. package/dist/theme/components/radio.d.ts +63 -0
  51. package/dist/theme/components/searchBar.d.ts +11 -1
  52. package/dist/theme/components/select.d.ts +39 -0
  53. package/dist/theme/components/skeletonLoader.d.ts +4 -1
  54. package/dist/theme/components/slider.d.ts +21 -2
  55. package/dist/theme/components/statusBadge.d.ts +12 -0
  56. package/dist/theme/components/structuredContent.d.ts +63 -4
  57. package/dist/theme/components/styledList.d.ts +10 -0
  58. package/dist/theme/components/tabs.d.ts +37 -1
  59. package/dist/theme/components/tagSet.d.ts +39 -0
  60. package/dist/theme/components/template.d.ts +3 -0
  61. package/dist/theme/components/textInput.d.ts +194 -0
  62. package/dist/theme/components/toggle.d.ts +39 -3
  63. package/dist/theme/components/tooltip.d.ts +6 -1
  64. package/dist/theme/components/videoPlayer.d.ts +7 -0
  65. package/dist/theme/foundations/global.d.ts +10 -0
  66. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -8,6 +8,36 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
8
8
 
9
9
  ## Prerelease
10
10
 
11
+ ### Adds
12
+
13
+ - Adds `dark` color mode support for `background-color` and `color` global styles.
14
+ - Adds `dark` color mode support for the `HelperErrorText` and `StatusBadge` components.
15
+ - Adds `dark` color mode support for the `Button`, `Checkbox`, `DatePicker`, `ProgressIndicator`, `Radio`, `SearchBar`, `Select`, `Slider` and `Toggle` components.
16
+ - Adds `dark` color mode support for the `Card` and `Hero` components.
17
+ - Adds `dark` color mode support for the `Heading` and `List` components.
18
+ - Adds `dark` color mode support for the `Footer`, `Header`, `HorizontalRule` and `Table` components.
19
+ - Adds `dark` color mode support for the `Notification`, `ProgressIndicator`, and `SkeletonLoader` components.
20
+ - Adds `dark` color mode support for the `Breadcrumbs`, `Link Types`, and `Pagination` components.
21
+ - Adds `dark` color mode support for the `Accordion`, `Modal`, `Tabs`, and `Tooltip` components.
22
+ - Adds `dark` color mode support for the `AlphabetFilter`, `AudioPlayer`, and `TagSet` components.
23
+ - Adds `dark` color mode support for the `FeedbackBox` and `StyledList` components.
24
+ - Adds `dark` color mode support for the `FilterBar` and `MultiSelect` components.
25
+ - Adds `Supporting Dark Mode` under the `Development Guide`.
26
+
27
+ ### Updates
28
+
29
+ - Updates the `Design Tokens Style Guide` to include more detailed information about the available tokens.
30
+
31
+ ## 1.4.2 (March 2, 2023)
32
+
33
+ ### Updates
34
+
35
+ - Updates the `Logo` component to include "black" and "white" variants for `Digital Collections`.
36
+
37
+ ### Fixes
38
+
39
+ - Updates the `Slider` component's `currentValue` state to use the `useStateWithDependencies` hook.
40
+
11
41
  ## 1.4.1 (February 9, 2023)
12
42
 
13
43
  ### Adds
@@ -141,6 +171,16 @@ This release is exactly the same as the `1.3.0-rc` release candidate published o
141
171
 
142
172
  ### Adds
143
173
 
174
+ - Adds `brand` as a `breadcrumbsType` to the `Breadcrumbs` component.
175
+
176
+ ### Updates
177
+
178
+ - Updates the hex value for `dark.ui.error.primary`.
179
+
180
+ ## 1.2.1 (October 27, 2022)
181
+
182
+ ### Adds
183
+
144
184
  - Adds the `"buttonPrimary"`, `"buttonSecondary"`, `"buttonPill"`, `"buttonCallout"`, `"buttonNoBrand"`, `"buttonDisabled"` variants for the the `Link` component, set through the `type` prop.
145
185
 
146
186
  ### Deprecates
@@ -217,6 +257,7 @@ This release is exactly the same as the `1.3.0-rc` release candidate published o
217
257
  ### Deprecates
218
258
 
219
259
  - Deprecates the `link` variant in the `Button` component.
260
+ - Deprecates the `darkMode` prop in the `ProgressIndicator` component.
220
261
 
221
262
  ## 1.1.0 (August 30, 2022)
222
263
 
@@ -260,6 +301,7 @@ This release is exactly the same as the `1.1.0-rc5` release candidate which was
260
301
  - Updates the `onClick` event type for the `Pagination` links `onClick` function.
261
302
  - Updates the `Link` component's `onClick` event type.
262
303
  - Makes small, clarifying update to `Color Mode` story in Storybook.
304
+ - Updates background color values available in Storybook.
263
305
 
264
306
  ### Fixes
265
307
 
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 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.
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 `12.22.x`).
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,5 +1,5 @@
1
1
  import React from "react";
2
- export declare type BreadcrumbsTypes = "blogs" | "booksAndMore" | "education" | "locations" | "research" | "whatsOn";
2
+ export declare type BreadcrumbsTypes = "blogs" | "booksAndMore" | "brand" | "education" | "locations" | "research" | "whatsOn";
3
3
  export interface BreadcrumbsDataProps {
4
4
  url: string;
5
5
  text: string | React.ReactNode;
@@ -3,8 +3,8 @@ export interface HeaderSearchButtonProps {
3
3
  isMobile?: boolean;
4
4
  }
5
5
  /**
6
- * This is the button that will render the search form when it is clicked
7
- * and keep focus trapped within the menu.
6
+ * This is the button that will render the search form when it is clicked and
7
+ * keep focus trapped within the menu.
8
8
  */
9
9
  declare const HeaderSearchButton: import("@chakra-ui/react").ChakraComponent<({ isMobile }: HeaderSearchButtonProps) => JSX.Element, {}>;
10
10
  export default HeaderSearchButton;
@@ -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 */
@@ -6,6 +6,8 @@ declare const _default: {
6
6
  cleverBadgeColor: string;
7
7
  cleverColor: string;
8
8
  cleverWhite: string;
9
+ digitalCollectionsBlack: string;
10
+ digitalCollectionsWhite: string;
9
11
  firstbookColor: string;
10
12
  firstbookColorNegative: string;
11
13
  googlePlayBlack: string;
@@ -9,12 +9,17 @@ interface BaseProps {
9
9
  id?: string;
10
10
  /** Optional prop to control horizontal alignment of the `Notification` content */
11
11
  isCentered?: boolean;
12
+ /** Content to be rendered in a `NotificationHeading` component. */
13
+ notificationHeading?: string;
12
14
  /** Optional prop to control the coloring of the `Notification` text and the
13
15
  * visibility of an applicable icon. */
14
16
  notificationType?: NotificationTypes;
17
+ /** Prop to display the `Notification` icon. Defaults to `true`. */
18
+ showIcon?: boolean;
15
19
  }
20
+ declare type NotificationHeadingProps = Omit<BasePropsWithoutAlignText, "notificationHeading" | "showIcon">;
21
+ declare type NotificationContentProps = Omit<BaseProps, "icon">;
16
22
  declare type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
17
- declare type BasePropsWithoutIsCentered = Omit<BaseProps, "isCentered">;
18
23
  export interface NotificationProps extends BasePropsWithoutAlignText {
19
24
  /** Label used to describe the `Notification`'s aside HTML element. */
20
25
  ariaLabel?: string;
@@ -29,19 +34,15 @@ export interface NotificationProps extends BasePropsWithoutAlignText {
29
34
  noMargin?: boolean;
30
35
  /** Content to be rendered in a `NotificationContent` component. */
31
36
  notificationContent: string | JSX.Element;
32
- /** Content to be rendered in a `NotificationHeading` component. */
33
- notificationHeading?: string;
34
- /** Prop to display the `Notification` icon. Defaults to `true`. */
35
- showIcon?: boolean;
36
37
  }
37
38
  /**
38
39
  * NotificationHeading child-component.
39
40
  */
40
- export declare const NotificationHeading: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<BasePropsWithoutAlignText>) => JSX.Element, {}>;
41
+ export declare const NotificationHeading: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<NotificationHeadingProps>) => JSX.Element, {}>;
41
42
  /**
42
43
  * NotificationContent child-component.
43
44
  */
44
- export declare const NotificationContent: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<BasePropsWithoutIsCentered>) => JSX.Element, {}>;
45
+ export declare const NotificationContent: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<NotificationContentProps>) => JSX.Element, {}>;
45
46
  /**
46
47
  * Component used to present users with three different levels of notifications:
47
48
  * standard, announcement, and warning.
@@ -2,7 +2,7 @@ import React from "react";
2
2
  export declare type ProgressIndicatorSizes = "default" | "small";
3
3
  export declare type ProgressIndicatorTypes = "circular" | "linear";
4
4
  export interface ProgressIndicatorProps {
5
- /** Flag to render the component in a dark background. */
5
+ /** The darkMode prop is deprecated and should no longer be used. */
6
6
  darkMode?: boolean;
7
7
  /** ID that other components can cross reference for accessibility purposes. */
8
8
  id: string;