@nypl/design-system-react-components 3.1.7 → 3.2.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.
- package/dist/design-system-react-components.cjs +34 -34
- package/dist/design-system-react-components.js +3541 -3554
- package/dist/src/components/NewsletterSignup/NewsletterSignup.d.ts +53 -0
- package/dist/src/components/NewsletterSignup/NewsletterSignupResponse.d.ts +12 -0
- package/dist/src/theme/components/newsletterSignup.d.ts +6 -7
- package/package.json +12 -14
|
@@ -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 {};
|
|
@@ -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
|
-
|
|
4
|
+
highlightColor: HighlightColorTypes;
|
|
5
5
|
}
|
|
6
6
|
declare const NewsletterSignup: {
|
|
7
|
-
baseStyle?: ({
|
|
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:
|
|
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:
|
|
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:
|
|
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.
|
|
3
|
+
"version": "3.2.0-rc",
|
|
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.
|
|
83
|
-
"@storybook/addon-designs": "8.0.
|
|
84
|
-
"@storybook/addon-essentials": "8.
|
|
85
|
-
"@storybook/addon-interactions": "8.
|
|
86
|
-
"@storybook/addon-jest": "8.
|
|
87
|
-
"@storybook/addon-links": "8.
|
|
88
|
-
"@storybook/blocks": "8.
|
|
89
|
-
"@storybook/react": "8.
|
|
90
|
-
"@storybook/react-vite": "8.
|
|
91
|
-
"@storybook/test": "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.
|
|
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",
|