@nypl/design-system-react-components 3.4.2 → 3.4.3-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.
Files changed (32) hide show
  1. package/dist/design-system-react-components.cjs +55 -55
  2. package/dist/design-system-react-components.js +17002 -15547
  3. package/dist/src/components/Header/Header.d.ts +13 -0
  4. package/dist/src/components/Header/components/HeaderLogin.d.ts +12 -0
  5. package/dist/src/components/Header/components/HeaderLoginButton.d.ts +10 -0
  6. package/dist/src/components/Header/components/HeaderLowerNav.d.ts +6 -0
  7. package/dist/src/components/Header/components/HeaderMobileIconNav.d.ts +6 -0
  8. package/dist/src/components/Header/components/HeaderMobileNav.d.ts +6 -0
  9. package/dist/src/components/Header/components/HeaderMobileNavButton.d.ts +6 -0
  10. package/dist/src/components/Header/components/HeaderSearchButton.d.ts +9 -0
  11. package/dist/src/components/Header/components/HeaderSearchForm.d.ts +10 -0
  12. package/dist/src/components/Header/components/HeaderSitewideAlerts.d.ts +7 -0
  13. package/dist/src/components/Header/components/HeaderUpperNav.d.ts +7 -0
  14. package/dist/src/components/Header/context/headerContext.d.ts +13 -0
  15. package/dist/src/components/Header/utils/encoreCatalogLogOutTimer.d.ts +4 -0
  16. package/dist/src/components/Header/utils/headerUtils.d.ts +70 -0
  17. package/dist/src/index.d.ts +1 -0
  18. package/dist/src/theme/components/header.d.ts +100 -0
  19. package/dist/src/theme/components/headerLogin.d.ts +333 -0
  20. package/dist/src/theme/components/headerLoginButton.d.ts +72 -0
  21. package/dist/src/theme/components/headerLowerNav.d.ts +78 -0
  22. package/dist/src/theme/components/headerMobileIconNav.d.ts +28 -0
  23. package/dist/src/theme/components/headerMobileNav.d.ts +92 -0
  24. package/dist/src/theme/components/headerMobileNavButton.d.ts +36 -0
  25. package/dist/src/theme/components/headerSearchButton.d.ts +85 -0
  26. package/dist/src/theme/components/headerSearchForm.d.ts +185 -0
  27. package/dist/src/theme/components/headerSitewideAlerts.d.ts +43 -0
  28. package/dist/src/theme/components/headerUpperNav.d.ts +60 -0
  29. package/dist/src/theme/components/newsletterSignup.d.ts +1 -1
  30. package/dist/src/theme/components/slider.d.ts +3 -3
  31. package/dist/src/theme/foundations/breakpoints.d.ts +6 -0
  32. package/package.json +2 -1
@@ -0,0 +1,13 @@
1
+ export interface HeaderProps {
2
+ /** Whether to render sitewide alerts or not. True by default. */
3
+ fetchSitewideAlerts?: boolean;
4
+ /** Whether or not the `Header` is in production mode. True by default. */
5
+ isProduction?: boolean;
6
+ }
7
+ /**
8
+ * The NYPL `Header` component is the top-level component of the site. It
9
+ * contains features for logging in, logging out, searching, and navigating
10
+ * the NYPL.org site.
11
+ */
12
+ export declare const Header: import("@chakra-ui/system/dist/system.types").ChakraComponent<({ fetchSitewideAlerts, isProduction }: HeaderProps) => import("react/jsx-runtime").JSX.Element, {}>;
13
+ export default Header;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ export interface HeaderLoginProps {
3
+ catalogRef?: React.RefObject<HTMLDivElement & HTMLAnchorElement>;
4
+ isMobile?: boolean;
5
+ }
6
+ /**
7
+ * The content of the login dropdown menu. Initially, this renders links to log
8
+ * in and log out. When the patron is logged in, it will also display the patron's
9
+ * name, links to the catalogs, and a log out link.
10
+ */
11
+ declare const HeaderLogin: import("@chakra-ui/system/dist/system.types").ChakraComponent<({ catalogRef, isMobile }: HeaderLoginProps) => import("react/jsx-runtime").JSX.Element, {}>;
12
+ export default HeaderLogin;
@@ -0,0 +1,10 @@
1
+ export interface HeaderLoginButtonProps {
2
+ isMobile?: boolean;
3
+ }
4
+ /**
5
+ * This is the button that will render the login menu when it is clicked
6
+ * and keep focus trapped within the menu. Its display text will be "Log In"
7
+ * when the user is not logged in and "My Account" when the user is logged in.
8
+ */
9
+ declare const HeaderLoginButton: import("@chakra-ui/system/dist/system.types").ChakraComponent<({ isMobile }: HeaderLoginButtonProps) => import("react/jsx-runtime").JSX.Element, {}>;
10
+ export default HeaderLoginButton;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This component renders the navigational list of links used to
3
+ * navigate to different landing pages on NYPL.org.
4
+ */
5
+ declare const HeaderLowerNav: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
6
+ export default HeaderLowerNav;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This component renders the mobile list of icon buttons for
3
+ * logging in, searching, and navigating on NYPL.org.
4
+ */
5
+ declare const HeaderMobileIconNav: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
6
+ export default HeaderMobileIconNav;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This component renders the navigational list of links used to navigate
3
+ * NYPL.org for mobile devices.
4
+ */
5
+ declare const HeaderMobileNav: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
6
+ export default HeaderMobileNav;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This is the button that will render the navigational list of links
3
+ * when it is clicked and keep focus trapped within the menu.
4
+ */
5
+ declare const HeaderMobileNavButton: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
6
+ export default HeaderMobileNavButton;
@@ -0,0 +1,9 @@
1
+ export interface HeaderSearchButtonProps {
2
+ isMobile?: boolean;
3
+ }
4
+ /**
5
+ * This is the button that will render the search form when it is clicked and
6
+ * keep focus trapped within the menu.
7
+ */
8
+ declare const HeaderSearchButton: import("@chakra-ui/system/dist/system.types").ChakraComponent<({ isMobile }: HeaderSearchButtonProps) => import("react/jsx-runtime").JSX.Element, {}>;
9
+ export default HeaderSearchButton;
@@ -0,0 +1,10 @@
1
+ export interface HeaderSearchFormProps {
2
+ isMobile?: boolean;
3
+ }
4
+ export type SearchOptionType = "circulatingCatalog" | "researchCatalog" | "website";
5
+ /**
6
+ * Displays the search form for the Header's search interface. On mobile, two
7
+ * buttons are displayed and on desktop, two radio inputs are displayed.
8
+ */
9
+ declare const HeaderSearchForm: import("@chakra-ui/system/dist/system.types").ChakraComponent<({ isMobile }: HeaderSearchFormProps) => import("react/jsx-runtime").JSX.Element, {}>;
10
+ export default HeaderSearchForm;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The HeaderSitewideAlerts component makes an API request to an NYPL API
3
+ * endpoint to fetch NYPL sitewide alerts. While this component can be used in
4
+ * isolation, it is already rendered in the DS Header component.
5
+ */
6
+ export declare const HeaderSitewideAlerts: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
7
+ export default HeaderSitewideAlerts;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This renders the navigational list of links for logging in, subscribing
3
+ * to the email service, going to the Locations page, getting a Library card,
4
+ * donating, and shopping at NYPL.
5
+ */
6
+ declare const HeaderUpperNav: import("@chakra-ui/system/dist/system.types").ChakraComponent<() => import("react/jsx-runtime").JSX.Element, {}>;
7
+ export default HeaderUpperNav;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Context used for patron and production status data.
4
+ */
5
+ export declare const HeaderContext: React.Context<any>;
6
+ /**
7
+ * Context Provider used only in the Header component.
8
+ */
9
+ export declare const HeaderProvider: ({ children, isProduction, patronName, }: {
10
+ children: any;
11
+ isProduction?: boolean;
12
+ patronName?: string;
13
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const catalogLogOutURL = "https:/login.nypl.org/auth/logout?redirect_uri=";
2
+ export declare const patLoggedInCookieExpiredTime = 1800000;
3
+ declare function EncoreCatalogLogOutTimer(currentTime?: number, isTestMode?: boolean): void;
4
+ export default EncoreCatalogLogOutTimer;
@@ -0,0 +1,70 @@
1
+ export interface Alert {
2
+ id: string;
3
+ link: string;
4
+ description: string;
5
+ startDate: string;
6
+ endDate: string;
7
+ }
8
+ export declare const alertsApiUrl = "https://refinery.nypl.org/api/nypl/ndo/v0.1/content/alerts?filter%5Bscope%5D=all";
9
+ export declare const getLoginLinks: (patronName?: string, isProduction?: boolean) => {
10
+ catalogLink: string;
11
+ researchLink: string;
12
+ logOutLink: string;
13
+ };
14
+ export declare const upperNavLinks: {
15
+ locations: {
16
+ href: string;
17
+ text: string;
18
+ };
19
+ libraryCard: {
20
+ href: string;
21
+ text: string;
22
+ };
23
+ emailUpdates: {
24
+ href: string;
25
+ text: string;
26
+ };
27
+ donate: {
28
+ href: string;
29
+ text: string;
30
+ };
31
+ shop: {
32
+ href: string;
33
+ text: string;
34
+ };
35
+ };
36
+ export declare const siteNavLinks: {
37
+ href: string;
38
+ text: string;
39
+ }[];
40
+ /**
41
+ * Returns the final URL for the NYPL Catalog search.
42
+ */
43
+ export declare const getCatalogURL: (searchValue: any) => any;
44
+ /**
45
+ * Returns the final URL for the NYPL Research Catalog search.
46
+ */
47
+ export declare const getResearchCatalogURL: (searchValue: any) => string;
48
+ /**
49
+ * Returns the final URL for the NYPL catalog search.
50
+ */
51
+ export declare const getNYPLSearchURL: (searchString: any) => string;
52
+ /**
53
+ * The `alertsApiUrl` fetches NYPL alerts from the Refinery API. This API
54
+ * returns JSONAPI-formatted data. We could use a better JSONAPI parser, but
55
+ * this is the only endpoint we will use that is JSONAPI. Eventually, this
56
+ * endpoint will be replaced. This function parses the JSONAPI data in a very
57
+ * naive and quick way to get the necessary alerts data. The data is then
58
+ * filtered to include active alerts.
59
+ */
60
+ export declare const parseAlertsData: (data: any) => Alert[];
61
+ /**
62
+ * getCookieValue uses the js.cookie package to get the value
63
+ * of the "nyplIdentityPatron" cookie (if it exists) and extract
64
+ * the cookie's `access_token`.
65
+ */
66
+ export declare const getCookieValue: () => {
67
+ cookieValue: any;
68
+ accessToken: any;
69
+ };
70
+ export declare const deleteCookieValue: () => void;
@@ -35,6 +35,7 @@ export { default as FilterBarPopup, useFilterBarPopup, } from "./components/Filt
35
35
  export type { FilterBarPopupProps } from "./components/FilterBarPopup/FilterBarPopup";
36
36
  export { default as Form, FormField, FormRow } from "./components/Form/Form";
37
37
  export type { FormProps } from "./components/Form/Form";
38
+ export { default as Header } from "./components/Header/Header";
38
39
  export { default as Heading } from "./components/Heading/Heading";
39
40
  export type { HeadingLevels, HeadingProps, HeadingSizes, } from "./components/Heading/Heading";
40
41
  export { default as HelperErrorText } from "./components/HelperErrorText/HelperErrorText";
@@ -0,0 +1,100 @@
1
+ export declare const headerBlack = "#2b2b2b";
2
+ export declare const headerBlue = "#1B7FA7";
3
+ export declare const headerDarkBlue = "#135772";
4
+ export declare const headerFocusColor = "#0F465C";
5
+ export declare const headerLightBlue = "#78CCED";
6
+ export declare const headerLightBlueIcon = "#1DA1D4";
7
+ export declare const headerRed = "#ED1C24";
8
+ export declare const headerRedDarkMode = "dark.ui.error.primary";
9
+ export declare const headerRedDonate = "#E32B31";
10
+ export declare const headerYellow = "#FEE34A";
11
+ export declare const headerYellowDark = "#403B2D";
12
+ export declare const headerFocus: {
13
+ borderRadius: string;
14
+ outlineColor: string;
15
+ outlineOffset: string;
16
+ outlineStyle: string;
17
+ outlineWidth: string;
18
+ };
19
+ declare const Header: {
20
+ parts: string[];
21
+ baseStyle: {
22
+ fontFamily: string;
23
+ fontSize: string;
24
+ fontWeight: string;
25
+ "& > nav li": {
26
+ marginBottom: string;
27
+ };
28
+ "& > nav a": {
29
+ lineHeight: string;
30
+ _focus: {
31
+ boxShadow: string;
32
+ outline: string;
33
+ outlineOffset: string;
34
+ outlineColor: string;
35
+ zIndex: string;
36
+ _dark: {
37
+ outlineColor: string;
38
+ };
39
+ };
40
+ };
41
+ a: {
42
+ _visited: {
43
+ color: string;
44
+ };
45
+ };
46
+ button: {
47
+ cursor: string;
48
+ };
49
+ container: {
50
+ paddingX: {
51
+ base: string;
52
+ mh: string;
53
+ };
54
+ paddingY: {
55
+ mh: string;
56
+ };
57
+ maxWidth: string;
58
+ minHeight: {
59
+ mh: string;
60
+ };
61
+ margin: string;
62
+ };
63
+ navContainer: {
64
+ height: {
65
+ mh: string;
66
+ lh: string;
67
+ };
68
+ gap: {
69
+ mh: string;
70
+ lh: string;
71
+ };
72
+ };
73
+ horizontalRule: {
74
+ bg: string;
75
+ marginTop: string;
76
+ marginBottom: string;
77
+ _dark: {
78
+ backgroundColor: string;
79
+ };
80
+ };
81
+ logo: {
82
+ lineHeight: string;
83
+ svg: {
84
+ height: {
85
+ base: string;
86
+ mh: string;
87
+ lh: string;
88
+ };
89
+ };
90
+ _focus: {
91
+ borderRadius: string;
92
+ outlineColor: string;
93
+ outlineOffset: string;
94
+ outlineStyle: string;
95
+ outlineWidth: string;
96
+ };
97
+ };
98
+ };
99
+ };
100
+ export default Header;
@@ -0,0 +1,333 @@
1
+ declare const HeaderLogin: {
2
+ parts: string[];
3
+ baseStyle: ({ patronName }: {
4
+ patronName: any;
5
+ }) => {
6
+ bg: {
7
+ base: string;
8
+ mh: string;
9
+ };
10
+ boxShadow: {
11
+ base: string;
12
+ mh: string;
13
+ };
14
+ display: {
15
+ base: string;
16
+ mh: string;
17
+ };
18
+ flexDirection: string;
19
+ left: {
20
+ base: string;
21
+ mh: any;
22
+ };
23
+ marginTop: {
24
+ mh: string;
25
+ };
26
+ minHeight: {
27
+ base: string;
28
+ mh: string;
29
+ };
30
+ minWidth: {
31
+ base: string;
32
+ mh: string;
33
+ };
34
+ position: string;
35
+ padding: {
36
+ base: string;
37
+ mh: string;
38
+ };
39
+ zIndex: string;
40
+ ul: {
41
+ display: {
42
+ base: string;
43
+ mh: string;
44
+ };
45
+ marginBottom: string;
46
+ marginTop: {
47
+ base: string;
48
+ mh: string;
49
+ };
50
+ width: string;
51
+ li: {
52
+ _first: {
53
+ gridColumn: {
54
+ base: string;
55
+ mh: any;
56
+ };
57
+ };
58
+ _last: {
59
+ gridColumn: {
60
+ base: string;
61
+ mh: any;
62
+ };
63
+ };
64
+ };
65
+ };
66
+ li: {
67
+ _first: {
68
+ marginEnd: {
69
+ base: string;
70
+ mh: string;
71
+ };
72
+ marginTop: {
73
+ base: string;
74
+ mh: string;
75
+ };
76
+ marginBottom: {
77
+ mh: string;
78
+ };
79
+ };
80
+ };
81
+ "li a": {
82
+ alignItems: string;
83
+ border: {
84
+ base: string;
85
+ mh: string;
86
+ };
87
+ borderColor: string;
88
+ borderRadius: {
89
+ base: string;
90
+ mh: string;
91
+ };
92
+ bg: {
93
+ base: string;
94
+ mh: string;
95
+ };
96
+ color: string;
97
+ display: string;
98
+ fontSize: string;
99
+ fontWeight: string;
100
+ justifyContent: {
101
+ mh: string;
102
+ };
103
+ lineHeight: {
104
+ base: string;
105
+ mh: string;
106
+ };
107
+ marginTop: {
108
+ base: string;
109
+ };
110
+ minHeight: {
111
+ base: string;
112
+ mh: string;
113
+ };
114
+ padding: {
115
+ base: string;
116
+ mh: string;
117
+ };
118
+ textTransform: string;
119
+ whiteSpace: string;
120
+ width: string;
121
+ svg: {
122
+ marginRight: {
123
+ base: string;
124
+ mh: any;
125
+ };
126
+ };
127
+ span: {
128
+ width: {
129
+ base: string;
130
+ mh: string;
131
+ };
132
+ };
133
+ _hover: {
134
+ bg: {
135
+ base: string;
136
+ mh: string;
137
+ };
138
+ color: string;
139
+ };
140
+ _focus: {
141
+ borderRadius: {
142
+ base: string;
143
+ mh: string;
144
+ };
145
+ boxShadow: {
146
+ base: any;
147
+ mh: string;
148
+ };
149
+ outline: {
150
+ base: string;
151
+ mh: string;
152
+ };
153
+ outlineStyle: {
154
+ base: string;
155
+ mh: any;
156
+ };
157
+ outlineWidth: {
158
+ base: string;
159
+ mh: any;
160
+ };
161
+ };
162
+ _dark: {
163
+ bgColor: {
164
+ base: string;
165
+ mh: string;
166
+ };
167
+ color: {
168
+ base: string;
169
+ mh: string;
170
+ };
171
+ svg: {
172
+ fill: {
173
+ base: string;
174
+ mh: string;
175
+ };
176
+ };
177
+ _hover: {
178
+ bgColor: {
179
+ base: string;
180
+ mh: string;
181
+ };
182
+ color: {
183
+ base: string;
184
+ mh: string;
185
+ };
186
+ };
187
+ };
188
+ _visited: {
189
+ color: string;
190
+ };
191
+ };
192
+ patronGreeting: {
193
+ alignSelf: string;
194
+ color: string;
195
+ fontSize: {
196
+ base: string;
197
+ mh: string;
198
+ };
199
+ fontWeight: string;
200
+ lineHeight: string;
201
+ margin: {
202
+ base: string;
203
+ mh: string;
204
+ };
205
+ minHeight: {
206
+ base: string;
207
+ mh: string;
208
+ };
209
+ textAlign: string;
210
+ textTransform: string;
211
+ width: {
212
+ mh: string;
213
+ };
214
+ _focus: {
215
+ boxShadow: {
216
+ base: any;
217
+ mh: string;
218
+ };
219
+ outline: {
220
+ base: string;
221
+ mh: string;
222
+ };
223
+ outlineStyle: {
224
+ base: string;
225
+ mh: any;
226
+ };
227
+ outlineWidth: {
228
+ base: string;
229
+ mh: any;
230
+ };
231
+ };
232
+ ".greeting": {
233
+ fontStyle: string;
234
+ margin: {
235
+ base: string;
236
+ mh: string;
237
+ };
238
+ };
239
+ ".name": {
240
+ margin: number;
241
+ };
242
+ };
243
+ logoutButton: {
244
+ alignSelf: string;
245
+ bg: {
246
+ base: string;
247
+ mh: string;
248
+ };
249
+ borderRadius: {
250
+ base: string;
251
+ mh: string;
252
+ };
253
+ color: {
254
+ base: string;
255
+ mh: string;
256
+ };
257
+ fontSize: {
258
+ base: string;
259
+ mh: string;
260
+ };
261
+ marginTop: {
262
+ base: string;
263
+ mh: string;
264
+ };
265
+ marginBottom: {
266
+ base: string;
267
+ mh: string;
268
+ };
269
+ padding: {
270
+ base: string;
271
+ mh: any;
272
+ };
273
+ textDecoration: {
274
+ base: string;
275
+ mh: any;
276
+ };
277
+ textTransform: string;
278
+ width: {
279
+ base: string;
280
+ mh: string;
281
+ };
282
+ svg: {
283
+ fill: string;
284
+ };
285
+ _hover: {
286
+ bg: {
287
+ base: string;
288
+ mh: string;
289
+ };
290
+ color: {
291
+ base: string;
292
+ mh: string;
293
+ };
294
+ textDecoration: {
295
+ base: string;
296
+ mh: any;
297
+ };
298
+ };
299
+ _focus: {
300
+ borderRadius: {
301
+ base: string;
302
+ mh: string;
303
+ };
304
+ boxShadow: {
305
+ base: any;
306
+ mh: string;
307
+ };
308
+ outline: {
309
+ base: string;
310
+ mh: string;
311
+ };
312
+ outlineStyle: {
313
+ base: string;
314
+ mh: any;
315
+ };
316
+ outlineWidth: {
317
+ base: string;
318
+ mh: any;
319
+ };
320
+ };
321
+ _dark: {
322
+ color: string;
323
+ svg: {
324
+ fill: string;
325
+ };
326
+ _hover: {
327
+ color: string;
328
+ };
329
+ };
330
+ };
331
+ };
332
+ };
333
+ export default HeaderLogin;