@nypl/design-system-react-components 3.1.6 → 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 +42 -42
- package/dist/design-system-react-components.js +8470 -8414
- package/dist/src/components/Accordion/Accordion.d.ts +4 -0
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/src/components/MultiSelect/MultiSelect.d.ts +3 -0
- package/dist/src/components/MultiSelect/MultiSelectItemsCountButton.d.ts +1 -1
- 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/breadcrumb.d.ts +40 -1
- package/dist/src/theme/components/newsletterSignup.d.ts +6 -7
- package/package.json +17 -19
|
@@ -27,6 +27,10 @@ export interface AccordionProps {
|
|
|
27
27
|
* within accordion panel is greater than height set by panelMaxHeight, a
|
|
28
28
|
* scrollbar will appear for accordion panel. */
|
|
29
29
|
panelMaxHeight?: string;
|
|
30
|
+
/** For internal use only. This value toggles the accordion closed if the
|
|
31
|
+
* MultiSelect's `closeOnBlur` prop is true and the user clicks outside the
|
|
32
|
+
* component. */
|
|
33
|
+
userClickedOutside?: boolean;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* Accordion component that shows content on toggle. Can be used to display
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
export declare const breadcrumbTypeArray: readonly ["blogs", "booksAndMore", "brand", "connect", "education", "locations", "research", "whatsOn"];
|
|
3
|
+
export declare const breadcrumbTypeArray: readonly ["blogs", "booksAndMore", "brand", "connect", "digitalCollections", "education", "locations", "research", "whatsOn"];
|
|
4
4
|
export type BreadcrumbsTypes = typeof breadcrumbTypeArray[number];
|
|
5
5
|
export interface BreadcrumbsDataProps {
|
|
6
6
|
url: string;
|
|
@@ -18,6 +18,9 @@ export interface SelectedItems {
|
|
|
18
18
|
export interface MultiSelectProps {
|
|
19
19
|
/** The button text rendered within the MultiSelect. */
|
|
20
20
|
buttonText: string;
|
|
21
|
+
/** Determines whether the component will toggle to the closed state
|
|
22
|
+
* when it loses focus. The default value is false. */
|
|
23
|
+
closeOnBlur?: boolean;
|
|
21
24
|
/** The number of items that will be visible in the list when the component
|
|
22
25
|
* first loads. */
|
|
23
26
|
defaultItemsVisible?: number;
|
|
@@ -19,7 +19,7 @@ export interface MultiSelectItemsCountButtonProps {
|
|
|
19
19
|
/** The action to perform for key down event. */
|
|
20
20
|
onKeyDown?: () => void;
|
|
21
21
|
/** Ref to the Accordion Button element. */
|
|
22
|
-
|
|
22
|
+
accordionButtonRef: any;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* The toggle button component used to open and close the `MultiSelect` menu.
|
|
@@ -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 {};
|
|
@@ -152,6 +152,45 @@ declare const Breadcrumb: {
|
|
|
152
152
|
bg: string;
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
|
+
digitalCollections: {
|
|
156
|
+
bg: string;
|
|
157
|
+
color: string;
|
|
158
|
+
_dark: {
|
|
159
|
+
bg: string;
|
|
160
|
+
};
|
|
161
|
+
a: {
|
|
162
|
+
_hover: {
|
|
163
|
+
color: string;
|
|
164
|
+
};
|
|
165
|
+
_dark: {
|
|
166
|
+
_hover: {
|
|
167
|
+
color: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
_focus: {
|
|
171
|
+
boxShadow: string;
|
|
172
|
+
outline: string;
|
|
173
|
+
outlineOffset: string;
|
|
174
|
+
outlineColor: any;
|
|
175
|
+
zIndex: string;
|
|
176
|
+
_dark: {
|
|
177
|
+
outlineColor: any;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
"li:last-child": {
|
|
182
|
+
".chakra-breadcrumb__link": {
|
|
183
|
+
_hover: {
|
|
184
|
+
color: string;
|
|
185
|
+
};
|
|
186
|
+
_dark: {
|
|
187
|
+
_hover: {
|
|
188
|
+
color: string;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
155
194
|
education: {
|
|
156
195
|
bg: string;
|
|
157
196
|
_dark: {
|
|
@@ -179,7 +218,7 @@ declare const Breadcrumb: {
|
|
|
179
218
|
};
|
|
180
219
|
defaultProps?: {
|
|
181
220
|
size?: string | number;
|
|
182
|
-
variant?: "blogs" | "booksAndMore" | "brand" | "connect" | "education" | "locations" | "research" | "whatsOn";
|
|
221
|
+
variant?: "blogs" | "booksAndMore" | "brand" | "connect" | "digitalCollections" | "education" | "locations" | "research" | "whatsOn";
|
|
183
222
|
colorScheme?: string;
|
|
184
223
|
};
|
|
185
224
|
};
|
|
@@ -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",
|
|
@@ -76,21 +76,19 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@babel/core": "7.14.6",
|
|
79
|
-
"@jest/core": "
|
|
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",
|
|
@@ -112,9 +110,9 @@
|
|
|
112
110
|
"eslint-plugin-react": "7.32.2",
|
|
113
111
|
"eslint-plugin-react-hooks": "4.2.0",
|
|
114
112
|
"husky": "7.0.4",
|
|
115
|
-
"jest": "29.
|
|
116
|
-
"jest-axe": "
|
|
117
|
-
"jest-environment-jsdom": "29.
|
|
113
|
+
"jest": "29.7.0",
|
|
114
|
+
"jest-axe": "9.0.0",
|
|
115
|
+
"jest-environment-jsdom": "29.7.0",
|
|
118
116
|
"jest-transformer-svg": "2.0.2",
|
|
119
117
|
"lint-staged": "10.5.4",
|
|
120
118
|
"normalize.css": "8.0.1",
|
|
@@ -128,9 +126,9 @@
|
|
|
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
|
-
"ts-jest": "29.
|
|
131
|
+
"ts-jest": "29.1.5",
|
|
134
132
|
"tslib": "2.3.0",
|
|
135
133
|
"typescript": "4.9.5",
|
|
136
134
|
"vite": "5.2.8",
|