@nypl/design-system-react-components 3.1.0-rc → 3.1.0

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.
@@ -0,0 +1,43 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import React from "react";
3
+ export declare const bannerTypesArray: readonly ["informative", "negative", "neutral", "positive", "recommendation", "warning"];
4
+ export type BannerTypes = typeof bannerTypesArray[number];
5
+ export declare const bannerBgColorsArray: readonly ["brand.primary-05", "section.blogs.primary-05", "section.books-and-more.primary-05", "section.connect.primary-05", "section.education.primary-05", "section.locations.primary-05", "section.research.primary-05", "section.research-library.lpa-05", "section.research-library.schomburg-05", "section.research-library.schwarzman-05", "section.whats-on.primary-05", "dark.brand.primary-05", "dark.section.blogs.primary-05", "dark.section.books-and-more.primary-05", "dark.section.connect.primary-05", "dark.section.education.primary-05", "dark.section.locations.primary-05", "dark.section.research.secondary-05", "dark.section.research-library.lpa-05", "dark.section.research-library.schomburg-05", "dark.section.research-library.schwarzman-05", "dark.section.whats-on.primary-05"];
6
+ export type BannerBgColors = typeof bannerBgColorsArray[number];
7
+ export declare const bannerHighlightColorsArray: readonly ["brand.primary", "section.blogs.primary", "section.books-and-more.primary", "section.connect.primary", "section.education.primary", "section.locations.primary", "section.research.primary", "section.research-library-lpa.primary", "section.research-library-schomburg.primary", "section.research-library-schwarzman.primary", "section.whats-on.primary", "dark.brand.primary", "dark.section.blogs.primary", "dark.section.books-and-more.primary", "dark.section.connect.primary", "dark.section.education.primary", "dark.section.locations.primary", "dark.section.research.secondary", "dark.section.research-library-lpa.primary", "dark.section.research-library-schomburg.primary", "dark.section.research-library-schwarzman.primary", "dark.section.whats-on.primary"];
8
+ export type BannerHighlightColors = typeof bannerHighlightColorsArray[number];
9
+ interface BannerProps {
10
+ /** Label used to describe the `Banner`'s aside HTML element. */
11
+ ariaLabel?: string;
12
+ /** Used to set the color of the background for the full component.
13
+ * Refer to how color values are defined and typed in the DS Icon component. */
14
+ backgroundColor?: BannerBgColors;
15
+ /** Additional `className` to add. */
16
+ className?: string;
17
+ /** Used to populate the body content of the component. */
18
+ content: string | JSX.Element;
19
+ /** Used to populate the heading element within the component. A string
20
+ * value can be passed to set the text for a default DS Heading component,
21
+ * or an actual DS Heading component can be passed in. */
22
+ heading?: string | JSX.Element;
23
+ /** Used to set the color for the left border and icon. Refer to how color
24
+ * values are defined and typed in the DS Icon component. */
25
+ highlightColor?: BannerHighlightColors;
26
+ /** Optional custom `Icon` that will override the default `Icon`. */
27
+ icon?: JSX.Element;
28
+ /** ID that other components can cross reference for accessibility purposes. */
29
+ id?: string;
30
+ /** Optional prop to control whether a `Banner` can be dismissed
31
+ * (closed) by a user. */
32
+ isDismissible?: boolean;
33
+ /** Used to control the component's semantic coloring and iconography. */
34
+ type?: BannerTypes;
35
+ }
36
+ /**
37
+ * The `Banner` component is a non-modal semantic dialog used to communicate a
38
+ * general status event or to promote a feature, providing contextual feedback
39
+ * messages for typical user actions. They are displayed contextually within a
40
+ * page flow and they will often prompt a user to take action.
41
+ */
42
+ export declare const Banner: ChakraComponent<React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLDivElement>>, BannerProps>;
43
+ export default Banner;
@@ -0,0 +1,32 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import React from "react";
3
+ import { LayoutTypes } from "../../helpers/types";
4
+ import { MultiSelectWidths } from "../MultiSelect/MultiSelect";
5
+ export interface MultiSelectGroupProps {
6
+ /** Additional className to use. */
7
+ className?: string;
8
+ /** The id of the MultiSelectGroup. */
9
+ id: string;
10
+ /** The label text rendered within the MultiSelectGroup. */
11
+ labelText: string;
12
+ /** Renders the layout of `MultiSelect` components in a row or column. */
13
+ layout?: LayoutTypes;
14
+ /** Width will be passed on each `MultiSelect` component. */
15
+ multiSelectWidth?: MultiSelectWidths;
16
+ /** Render prop function used to render MultiSelect with updated props. */
17
+ renderMultiSelect: ({ isBlockElement, multiSelectWidth, }: {
18
+ isBlockElement?: boolean;
19
+ multiSelectWidth?: MultiSelectWidths;
20
+ }) => React.ReactNode;
21
+ /** Is set to `true` by default and determines if the `labelText` is visible on the site. */
22
+ showLabel?: boolean;
23
+ }
24
+ /**
25
+ * `MultiSelectGroup` is a wrapper for Reservoir `MultiSelect` components.
26
+ * It specifies display styles (e.g. whether `MultiSelect`s are rendered in a
27
+ * column or row) and any associated text (e.g. the group's label). Note,
28
+ * the `MultiSelectGroup` will not work with non-Reservoir `MultiSelect`s
29
+ * components or other HTML elements.
30
+ */
31
+ export declare const MultiSelectGroup: ChakraComponent<React.ForwardRefExoticComponent<MultiSelectGroupProps & React.RefAttributes<HTMLDivElement>>, MultiSelectGroupProps>;
32
+ export default MultiSelectGroup;
@@ -4,6 +4,8 @@ export type { AccordionTypes } from "./components/Accordion/Accordion";
4
4
  export { default as AlphabetFilter } from "./components/AlphabetFilter/AlphabetFilter";
5
5
  export { default as AudioPlayer } from "./components/AudioPlayer/AudioPlayer";
6
6
  export type { AudioType } from "./components/AudioPlayer/AudioPlayer";
7
+ export { default as Banner } from "./components/Banner/Banner";
8
+ export type { BannerTypes } from "./components/Banner/Banner";
7
9
  export { default as Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs";
8
10
  export type { BreadcrumbsTypes } from "./components/Breadcrumbs/Breadcrumbs";
9
11
  export { default as Button } from "./components/Button/Button";
@@ -46,10 +48,8 @@ export type { ListItemsData, ActionItem, GroupItem, DividerItem, } from "./compo
46
48
  export { ModalTrigger, useModal } from "./components/Modal/Modal";
47
49
  export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
48
50
  export type { MultiSelectItem, SelectedItems, } from "./components/MultiSelect/MultiSelect";
49
- /** The code associated with the MultiSelectGroup component will not be exported
50
- * until the refactor of the v2 version of the MultiSelectGroup component has
51
- * been completed.
52
- * */
51
+ export { default as MultiSelectGroup } from "./components/MultiSelectGroup/MultiSelectGroup";
52
+ export type { MultiSelectGroupProps } from "./components/MultiSelectGroup/MultiSelectGroup";
53
53
  /** The code associated with the NewsletterSignup component and the
54
54
  * NewsletterSignupViewType type will not be exported until the refactor of the
55
55
  * component has been completed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.1.0-rc",
3
+ "version": "3.1.0",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",