@nypl/design-system-react-components 3.1.7 → 3.2.0-rc2

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,31 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import React from "react";
3
+ import { LayoutTypes } from "../../helpers/types";
4
+ import { MultiSelectWidths, SelectedItems as MultiSelectItems } from "../MultiSelect/MultiSelect";
5
+ export type FilterBarItemsType = (boolean | number | number[] | string | string[] | MultiSelectItems)[];
6
+ interface FilterBarInlineProps {
7
+ /** The className of the FilterBarInline. */
8
+ className?: string;
9
+ /** ID that other components can cross reference for accessibility purposes. */
10
+ id?: string;
11
+ /** Optional string value used to set the text for a `Heading` component, or
12
+ * a DS Heading component that can be passed in.
13
+ */
14
+ heading?: string | JSX.Element;
15
+ /** Renders the layout of the FilterBarInline child components in a row or column. */
16
+ layout?: LayoutTypes;
17
+ /** Function for the global `Clear Filters` button. If passed the `Clear Filters` button will render. */
18
+ onClear?: () => void;
19
+ /** Function for the global `Apply Filters` button. If passed the `Apply Filters` button will render. */
20
+ onSubmit?: () => void;
21
+ /** Render prop function used to render child components with updated props. */
22
+ renderChildren: ({ isBlockElement, layout, width, }: {
23
+ isBlockElement?: boolean;
24
+ layout?: LayoutTypes;
25
+ width?: MultiSelectWidths;
26
+ }) => React.ReactNode;
27
+ /** The selected items state (items that were checked by user). */
28
+ selectedItems?: FilterBarItemsType;
29
+ }
30
+ export declare const FilterBarInline: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<FilterBarInlineProps> & React.RefAttributes<HTMLDivElement>>, FilterBarInlineProps>;
31
+ export default FilterBarInline;
@@ -0,0 +1,53 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import React from "react";
3
+ interface NewsletterSignupProps {
4
+ /** Additional class name to add. */
5
+ className?: string;
6
+ /** Text displayed next to the confirmation icon after a successful email submission */
7
+ confirmationHeading: string;
8
+ /** Detail text for the confirmation view */
9
+ confirmationText?: string | JSX.Element;
10
+ /** Appears below the title to provide details about the newsletter. Accepts a string or an element. */
11
+ descriptionText?: string | JSX.Element;
12
+ /** Text displayed next to the error icon in case of an error in the email submission process*/
13
+ errorHeading: string;
14
+ /** Appears below the title to provide details about next steps in case of an error. Accepts a string or an element. */
15
+ errorText?: string | JSX.Element;
16
+ /** Appears below the input field's example text to provide any additional instructions. Accepts a string or
17
+ * an element. */
18
+ formHelperText?: string | JSX.Element;
19
+ /** ID that other components can cross-reference for accessibility purposes */
20
+ id?: string;
21
+ /** Toggles the invalid state for the email field. */
22
+ isInvalidEmail?: boolean;
23
+ /** Value to determine the section color highlight.
24
+ */
25
+ highlightColor?: HighlightColorTypes;
26
+ /** A handler function that will be called when the form is submitted. */
27
+ onSubmit: (event: React.FormEvent<any>) => void;
28
+ /** A handler function that will be called when the text input changes. */
29
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
30
+ /** Gives option to remove the default Privacy Link if a custom one is provided
31
+ * NOTE: A Privacy Policy link should always be included.
32
+ */
33
+ showPrivacyLink?: boolean;
34
+ /** Link to the relevant privacy policy page. */
35
+ privacyPolicyLink?: string;
36
+ /** Sets the text for a `Heading` component, or
37
+ * a DS Heading component that can be passed in.
38
+ */
39
+ title: JSX.Element | string;
40
+ /** The value of the email text input field. */
41
+ valueEmail?: string;
42
+ /** Used to specify what is displayed in the component form/feedback area. */
43
+ view?: NewsletterSignupViewType;
44
+ }
45
+ export declare const highlightColorTypesArray: readonly ["ui.gray.medium", "section.blogs.secondary", "section.books-and-more.primary", "brand.primary", "section.connect.primary", "section.education.primary", "section.locations.primary", "section.research.primary", "section.research-library.lpa", "section.research-library.schomburg", "section.research-library.schwartzman", "section.whats-on.primary"];
46
+ export type HighlightColorTypes = typeof highlightColorTypesArray[number];
47
+ export type NewsletterSignupViewType = "form" | "submitting" | "confirmation" | "error";
48
+ /**
49
+ * The NewsletterSignup component provides a way for patrons to register for an
50
+ * email-based newsletter distribution list.
51
+ */
52
+ export declare const NewsletterSignup: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<NewsletterSignupProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<NewsletterSignupProps>>;
53
+ export default NewsletterSignup;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { IconColors, IconNames } from "../Icons/Icon";
3
+ interface NewsletterSignupResponseProps {
4
+ focusRef: React.MutableRefObject<HTMLDivElement>;
5
+ heading: string;
6
+ headingColor?: string;
7
+ iconName: IconNames;
8
+ iconColor: IconColors;
9
+ text?: string | JSX.Element;
10
+ }
11
+ export declare const NewsletterSignupResponse: ({ focusRef, heading, headingColor, iconName, iconColor, text, }: NewsletterSignupResponseProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,48 @@
1
+ import { ChakraComponent } from "@chakra-ui/react";
2
+ import { LayoutTypes } from "../../helpers/types";
3
+ import React from "react";
4
+ export declare const borderTypeArray: readonly ["none", "circular", "straight"];
5
+ export type BorderType = typeof borderTypeArray[number];
6
+ export declare const colorTypeArray: readonly ["link", "textDefault", "textInverse"];
7
+ export type ColorType = typeof colorTypeArray[number];
8
+ export declare const sizeTypeArray: readonly ["small", "medium", "large"];
9
+ export type SizeType = typeof sizeTypeArray[number];
10
+ type IconNames = "fileTypeGenericDoc" | "socialFacebook" | "socialInstagram" | "socialPinterest" | "socialSoundCloud" | "socialTikTok" | "socialTumblr" | "socialTwitter" | "socialYoutube";
11
+ export interface SocialMediaLinkDataProps {
12
+ /** Required. Label rendered on page is showLabel is true */
13
+ labelText: string;
14
+ /** Required. Should match the social media platform that it's linking to */
15
+ icon: IconNames;
16
+ /** Required. Url to link to the platform */
17
+ url: string;
18
+ }
19
+ interface BaseSocialMediaLinksProps {
20
+ /** Optional className you can add in addition to "social-media-links." */
21
+ className?: string;
22
+ /** Any of three optional values that will change the color of the svg and label text (if any). */
23
+ color?: ColorType;
24
+ /** ID that other components can cross-reference for accessibility purposes. */
25
+ id?: string;
26
+ /** Optional desktop layout. Smaller viewports are always in a column if there are labels and
27
+ * in a row if there are no labels. */
28
+ layout?: LayoutTypes;
29
+ /** Required. Array of social media platform types, urls, and label texts. */
30
+ linksData: SocialMediaLinkDataProps[];
31
+ /** Optional size: small, medium, or large. */
32
+ size?: SizeType;
33
+ }
34
+ type ConditionalSocialMediaLinksProps = {
35
+ showLabels?: true;
36
+ borders?: Exclude<BorderType, "circular">;
37
+ } | {
38
+ showLabels?: false;
39
+ borders?: BorderType;
40
+ };
41
+ export type SocialMediaLinksProps = BaseSocialMediaLinksProps & ConditionalSocialMediaLinksProps;
42
+ /**
43
+ * The SocialMediaLinks component renders a list of links for accessing social media sites.
44
+ * The data passed to the `linksData` prop controls which social media icons are displayed,
45
+ * the order they appear, the url they link to, and the text used for the label of each.
46
+ */
47
+ export declare const SocialMediaLinks: ChakraComponent<React.ForwardRefExoticComponent<SocialMediaLinksProps & React.RefAttributes<HTMLDivElement & HTMLUListElement & HTMLOListElement>>, SocialMediaLinksProps>;
48
+ export default SocialMediaLinks;
@@ -23,6 +23,7 @@ export { default as FeaturedContent } from "./components/FeaturedContent/Feature
23
23
  export { default as FeedbackBox, useFeedbackBox, } from "./components/FeedbackBox/FeedbackBox";
24
24
  export type { FeedbackBoxViewType } from "./components/FeedbackBox/FeedbackBox";
25
25
  export { default as Fieldset } from "./components/Fieldset/Fieldset";
26
+ export { default as FilterBarInline } from "./components/FilterBarInline/FilterBarInline";
26
27
  export { default as Form, FormField, FormRow } from "./components/Form/Form";
27
28
  export { default as Heading } from "./components/Heading/Heading";
28
29
  export type { HeadingSizes, HeadingLevels } from "./components/Heading/Heading";
@@ -51,10 +52,8 @@ export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
51
52
  export type { MultiSelectItem, SelectedItems, } from "./components/MultiSelect/MultiSelect";
52
53
  export { default as MultiSelectGroup } from "./components/MultiSelectGroup/MultiSelectGroup";
53
54
  export type { MultiSelectGroupProps } from "./components/MultiSelectGroup/MultiSelectGroup";
54
- /** The code associated with the NewsletterSignup component and the
55
- * NewsletterSignupViewType type will not be exported until the refactor of the
56
- * component has been completed.
57
- * */
55
+ export { default as NewsletterSignup } from "./components/NewsletterSignup/NewsletterSignup";
56
+ export type { NewsletterSignupViewType } from "./components/NewsletterSignup/NewsletterSignup";
58
57
  export { default as Notification } from "./components/Notification/Notification";
59
58
  export type { NotificationTypes } from "./components/Notification/Notification";
60
59
  export { default as Pagination } from "./components/Pagination/Pagination";
@@ -71,9 +70,7 @@ export { default as SkeletonLoader } from "./components/SkeletonLoader/SkeletonL
71
70
  export type { SkeletonLoaderImageRatios } from "./components/SkeletonLoader/SkeletonLoader";
72
71
  export { default as SkipNavigation } from "./components/SkipNavigation/SkipNavigation";
73
72
  export { default as Slider } from "./components/Slider/Slider";
74
- /** The code associated with the SocialMediaLinks component will not be exported
75
- * until the refactor of the component has been completed.
76
- * */
73
+ export { default as SocialMediaLinks } from "./components/SocialMediaLinks/SocialMediaLinks";
77
74
  export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
78
75
  export type { StatusBadgeTypes } from "./components/StatusBadge/StatusBadge";
79
76
  export { default as StructuredContent } from "./components/StructuredContent/StructuredContent";
@@ -1,23 +1,22 @@
1
- import { SectionTypes } from "../../helpers/types";
2
1
  import { StyleFunctionProps } from "@chakra-ui/system";
2
+ import { HighlightColorTypes } from "../../components/NewsletterSignup/NewsletterSignup";
3
3
  interface NewsLetterStyleProps extends StyleFunctionProps {
4
- newsletterSignupType?: SectionTypes;
4
+ highlightColor: HighlightColorTypes;
5
5
  }
6
6
  declare const NewsletterSignup: {
7
- baseStyle?: ({ newsletterSignupType }: NewsLetterStyleProps) => {
7
+ baseStyle?: ({ highlightColor }: NewsLetterStyleProps) => {
8
8
  borderWidth: {
9
9
  base: string;
10
10
  md: string;
11
11
  };
12
12
  width: string;
13
13
  pitch: {
14
- alignItems: string;
15
14
  bg: string;
16
15
  borderLeftColor: {
17
- md: any;
16
+ md: "section.blogs.secondary" | "section.books-and-more.primary" | "brand.primary" | "section.connect.primary" | "section.education.primary" | "section.locations.primary" | "section.research.primary" | "section.research-library.lpa" | "section.research-library.schomburg" | "section.whats-on.primary" | "ui.gray.medium" | "section.research-library.schwartzman";
18
17
  };
19
18
  borderTopColor: {
20
- base: any;
19
+ base: "section.blogs.secondary" | "section.books-and-more.primary" | "brand.primary" | "section.connect.primary" | "section.education.primary" | "section.locations.primary" | "section.research.primary" | "section.research-library.lpa" | "section.research-library.schomburg" | "section.whats-on.primary" | "ui.gray.medium" | "section.research-library.schwartzman";
21
20
  md: "ui.border.default";
22
21
  };
23
22
  borderWidth: {
@@ -36,7 +35,7 @@ declare const NewsletterSignup: {
36
35
  md: "dark.ui.border.default";
37
36
  };
38
37
  borderLeftColor: {
39
- md: any;
38
+ md: "dark.section.blogs.secondary" | "dark.section.locations.primary" | "dark.section.books-and-more.primary" | "dark.brand.primary" | "dark.section.connect.primary" | "dark.section.education.primary" | "dark.section.research.primary" | "dark.section.research-library.lpa" | "dark.section.research-library.schomburg" | "dark.section.whats-on.primary" | "dark.ui.gray.medium" | "dark.section.research-library.schwartzman";
40
39
  };
41
40
  };
42
41
  padding: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.1.7",
3
+ "version": "3.2.0-rc2",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -79,18 +79,16 @@
79
79
  "@jest/core": "29.7.0",
80
80
  "@rollup/plugin-commonjs": "24.0.1",
81
81
  "@rollup/plugin-typescript": "11.0.0",
82
- "@storybook/addon-a11y": "8.0.8",
83
- "@storybook/addon-designs": "8.0.0",
84
- "@storybook/addon-essentials": "8.0.8",
85
- "@storybook/addon-interactions": "8.0.8",
86
- "@storybook/addon-jest": "8.0.8",
87
- "@storybook/addon-links": "8.0.8",
88
- "@storybook/blocks": "8.0.8",
89
- "@storybook/react": "8.0.8",
90
- "@storybook/react-vite": "8.0.8",
91
- "@storybook/test": "8.0.8",
92
- "@storybook/jest": "0.2.3",
93
- "@svgr/webpack": "5.5.0",
82
+ "@storybook/addon-a11y": "8.1.11",
83
+ "@storybook/addon-designs": "8.0.2",
84
+ "@storybook/addon-essentials": "8.1.11",
85
+ "@storybook/addon-interactions": "8.1.11",
86
+ "@storybook/addon-jest": "8.1.11",
87
+ "@storybook/addon-links": "8.1.11",
88
+ "@storybook/blocks": "8.1.11",
89
+ "@storybook/react": "8.1.11",
90
+ "@storybook/react-vite": "8.1.11",
91
+ "@storybook/test": "8.1.11",
94
92
  "@testing-library/dom": "9.2.0",
95
93
  "@testing-library/jest-dom": "5.14.1",
96
94
  "@testing-library/react": "12.0.0",
@@ -128,7 +126,7 @@
128
126
  "remark-gfm": "4.0.0",
129
127
  "sass": "1.60.0",
130
128
  "sass-loader": "10.0.0",
131
- "storybook": "8.0.8",
129
+ "storybook": "8.1.11",
132
130
  "style-loader": "2.0.0",
133
131
  "ts-jest": "29.1.5",
134
132
  "tslib": "2.3.0",