@nypl/design-system-react-components 3.4.4-template-overflow-fix-rc → 3.5.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.
@@ -5,6 +5,7 @@ export interface MultiSelectItem {
5
5
  name: string;
6
6
  isDisabled?: boolean;
7
7
  children?: MultiSelectItem[];
8
+ itemCount?: number;
8
9
  }
9
10
  export declare const multiSelectWidthsArray: readonly ["fitContent", "full"];
10
11
  export type MultiSelectWidths = typeof multiSelectWidthsArray[number];
@@ -0,0 +1,60 @@
1
+ import React from "react";
2
+ import { ChakraComponent } from "@chakra-ui/react";
3
+ export declare const actionBackgroundColorsArray: 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"];
4
+ export type actionBackgroundColors = typeof actionBackgroundColorsArray[number];
5
+ export declare const highlightColorsArray: string[];
6
+ export type highlightColors = typeof highlightColorsArray[number];
7
+ export interface SubNavProps {
8
+ /**
9
+ * The background color to be applied to the hover and active states
10
+ * of the SubNavLink and SubNavButton components.
11
+ * This allows for customization of the action items.
12
+ */
13
+ actionBackgroundColor?: actionBackgroundColors;
14
+ /** Additional class name for the `SubNav` component. */
15
+ className?: string;
16
+ /**
17
+ * Custom color for SubNavLink, SubNavButton, and icons.
18
+ */
19
+ highlightColor?: highlightColors;
20
+ /**
21
+ * Optional unique ID for accessibility, allowing other components
22
+ * to reference this element.
23
+ */
24
+ id?: string;
25
+ /**
26
+ * Primary actions displayed on the left side of the SubNav.
27
+ * Use SubNavButton and SubNavLink components, which mirror
28
+ * the DS Button and Link.
29
+ */
30
+ primaryActions: React.ReactNode;
31
+ /**
32
+ * Secondary actions displayed on the right side of the SubNav.
33
+ * Use SubNavButton and SubNavLink components, which mirror
34
+ * the DS Button and Link.
35
+ */
36
+ secondaryActions?: React.ReactNode;
37
+ }
38
+ interface SubNavItemProps {
39
+ id: string;
40
+ children: React.ReactNode;
41
+ isOutlined?: boolean;
42
+ isSelected?: boolean;
43
+ screenreaderOnlyText?: string;
44
+ }
45
+ interface SubNavLinkProps extends SubNavItemProps {
46
+ href: string;
47
+ }
48
+ interface SubNavButtonProps extends SubNavItemProps {
49
+ onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
50
+ }
51
+ export declare const SubNavButton: React.FC<React.PropsWithChildren<SubNavButtonProps>>;
52
+ export declare const SubNavLink: React.FC<React.PropsWithChildren<SubNavLinkProps>>;
53
+ /**
54
+ * The `SubNav` component is a navigation element that displays a group of
55
+ * related action items (buttons or links) in a horizontal layout. The action
56
+ * items in the `SubNav` component will link to children within or perform
57
+ * actions related to the current section of a website.
58
+ */
59
+ export declare const SubNav: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<SubNavProps> & React.RefAttributes<HTMLDivElement>>, SubNavProps>;
60
+ export default SubNav;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ /**
3
+ * The `useScrollFadeStyles` hook manages the visibility of a right-side fade effect
4
+ * based on horizontal scrolling. It tracks scroll events and shows the fade effect
5
+ * when scrolling to the left and more content is available to the right, hiding it
6
+ * when scrolling right or when at the right edge of the scrollable container.
7
+ */
8
+ export default function useScrollFadeStyles(): {
9
+ scrollableRef: React.MutableRefObject<any>;
10
+ showRightFade: boolean;
11
+ };
@@ -60,6 +60,7 @@ export type { LogoNames, LogoProps, LogoSizes } from "./components/Logo/Logo";
60
60
  export { default as MatchMedia } from "../src/__tests__/mediaMatchMock";
61
61
  export { default as Menu } from "./components/Menu/Menu";
62
62
  export type { ActionItem, DividerItem, GroupItem, ListItemsData, MenuProps, } from "./components/Menu/Menu";
63
+ export type { default as SubNav, SubNavButton, SubNavLink, } from "./components/SubNav/SubNav";
63
64
  export { ModalTrigger, useModal } from "./components/Modal/Modal";
64
65
  export type { BaseModalProps, ConfirmationModalProps, DefaultModalProps, ModalProps, ModalTypeProps, } from "./components/Modal/Modal";
65
66
  export { default as MultiSelect } from "./components/MultiSelect/MultiSelect";
@@ -122,5 +123,6 @@ export { default as useMultiSelect } from "./hooks/useMultiSelect";
122
123
  export { default as useNYPLBreakpoints } from "./hooks/useNYPLBreakpoints";
123
124
  export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
124
125
  export { default as useWindowSize } from "./hooks/useWindowSize";
126
+ export { default as useScrollFadeStyles } from "./hooks/useScrollFadeStyles";
125
127
  export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
126
128
  export type { VideoPlayerAspectRatios, VideoPlayerProps, VideoPlayerTypes, } from "./components/VideoPlayer/VideoPlayer";
@@ -5,14 +5,14 @@ declare const HeaderLowerNav: {
5
5
  marginBottom: string;
6
6
  marginLeft: string;
7
7
  whiteSpace: string;
8
- };
9
- li: {
10
- marginEnd: {
11
- mh: string;
12
- xl: string;
13
- };
14
- _last: {
15
- marginRight: string;
8
+ li: {
9
+ marginEnd: {
10
+ mh: string;
11
+ xl: string;
12
+ };
13
+ _last: {
14
+ marginRight: string;
15
+ };
16
16
  };
17
17
  };
18
18
  "li > a": {
@@ -7,13 +7,13 @@ declare const HeaderUpperNav: {
7
7
  display: string;
8
8
  margin: string;
9
9
  whiteSpace: string;
10
- };
11
- li: {
12
- fontSize: string;
13
- fontWeight: string;
14
- marginRight: string;
15
- _last: {
10
+ li: {
11
+ fontSize: string;
12
+ fontWeight: string;
16
13
  marginRight: string;
14
+ _last: {
15
+ marginRight: string;
16
+ };
17
17
  };
18
18
  };
19
19
  a: {
@@ -0,0 +1,275 @@
1
+ import { StyleFunctionProps } from "@chakra-ui/system";
2
+ interface SubNavStyleProps extends StyleFunctionProps {
3
+ backgroundColor: string;
4
+ highlightColor: string;
5
+ }
6
+ interface SubNavChildrenStyleProps extends StyleFunctionProps {
7
+ isOutlined: boolean;
8
+ }
9
+ declare const SubNav: {
10
+ baseStyle?: ({ backgroundColor, highlightColor }: SubNavStyleProps) => {
11
+ base: {
12
+ ".selectedItem": {
13
+ color: string;
14
+ fontWeight: string;
15
+ backgroundColor: string;
16
+ "&:hover": {
17
+ color: string;
18
+ };
19
+ };
20
+ borderBottom: string;
21
+ borderColor: string;
22
+ display: string;
23
+ justifyContent: string;
24
+ };
25
+ container: {
26
+ maxWidth: string;
27
+ px: {
28
+ base: "0";
29
+ md: "xs";
30
+ };
31
+ width: string;
32
+ };
33
+ scrollableList: {
34
+ display: string;
35
+ overflowX: string;
36
+ whiteSpace: string;
37
+ position: string;
38
+ scrollbarWidth: string;
39
+ };
40
+ primaryActions: {
41
+ width: string;
42
+ button: {
43
+ svg: {
44
+ fill: string;
45
+ margin: {
46
+ base: string;
47
+ md: any;
48
+ };
49
+ _dark: {
50
+ fill: string;
51
+ };
52
+ };
53
+ _hover: {
54
+ backgroundColor: string;
55
+ color: string;
56
+ svg: {
57
+ fill: string;
58
+ _dark: {
59
+ fill: string;
60
+ };
61
+ };
62
+ };
63
+ alignItems: string;
64
+ display: string;
65
+ fontSize: string;
66
+ fontWeight: string;
67
+ gap: string;
68
+ height: {
69
+ base: string;
70
+ md: string;
71
+ };
72
+ lineHeight: string;
73
+ position: string;
74
+ px: string;
75
+ py: string;
76
+ textDecoration: string;
77
+ transition: string;
78
+ color: string;
79
+ };
80
+ a: {
81
+ svg: {
82
+ fill: string;
83
+ margin: {
84
+ base: "0";
85
+ md: any;
86
+ };
87
+ _dark: {
88
+ fill: string;
89
+ };
90
+ };
91
+ _hover: {
92
+ backgroundColor: string;
93
+ color: string;
94
+ svg: {
95
+ fill: string;
96
+ _dark: {
97
+ fill: string;
98
+ };
99
+ };
100
+ };
101
+ alignItems: string;
102
+ display: string;
103
+ fontSize: string;
104
+ fontWeight: string;
105
+ gap: string;
106
+ height: {
107
+ base: string;
108
+ md: string;
109
+ };
110
+ lineHeight: string;
111
+ position: string;
112
+ px: string;
113
+ py: string;
114
+ textDecoration: string;
115
+ transition: string;
116
+ color: string;
117
+ };
118
+ p: {
119
+ base: string;
120
+ md: string;
121
+ };
122
+ gap: string;
123
+ li: {
124
+ marginEnd: string;
125
+ };
126
+ margin: string;
127
+ };
128
+ secondaryActions: {
129
+ width: string;
130
+ whiteSpace: string;
131
+ button: {
132
+ color: string;
133
+ svg: {
134
+ fill: string;
135
+ margin: {
136
+ base: string;
137
+ md: any;
138
+ };
139
+ _dark: {
140
+ fill: string;
141
+ };
142
+ };
143
+ _hover: {
144
+ background: string;
145
+ color: string;
146
+ svg: {
147
+ fill: string;
148
+ _dark: {
149
+ fill: string;
150
+ };
151
+ };
152
+ };
153
+ alignItems: string;
154
+ display: string;
155
+ fontSize: string;
156
+ fontWeight: string;
157
+ gap: string;
158
+ height: {
159
+ base: string;
160
+ md: string;
161
+ };
162
+ lineHeight: string;
163
+ position: string;
164
+ px: string;
165
+ py: string;
166
+ textDecoration: string;
167
+ transition: string;
168
+ };
169
+ a: {
170
+ color: string;
171
+ svg: {
172
+ fill: string;
173
+ margin: {
174
+ base: string;
175
+ md: any;
176
+ };
177
+ _dark: {
178
+ fill: string;
179
+ };
180
+ };
181
+ _hover: {
182
+ background: string;
183
+ color: string;
184
+ svg: {
185
+ fill: string;
186
+ _dark: {
187
+ fill: string;
188
+ };
189
+ };
190
+ };
191
+ alignItems: string;
192
+ display: string;
193
+ fontSize: string;
194
+ fontWeight: string;
195
+ gap: string;
196
+ height: {
197
+ base: string;
198
+ md: string;
199
+ };
200
+ lineHeight: string;
201
+ position: string;
202
+ px: string;
203
+ py: string;
204
+ textDecoration: string;
205
+ transition: string;
206
+ };
207
+ p: {
208
+ base: string;
209
+ md: string;
210
+ };
211
+ gap: string;
212
+ li: {
213
+ marginEnd: string;
214
+ };
215
+ margin: string;
216
+ };
217
+ fadeEffect: {
218
+ position: string;
219
+ top: number;
220
+ right: number;
221
+ height: string;
222
+ width: string;
223
+ background: string;
224
+ pointerEvents: string;
225
+ zIndex: number;
226
+ };
227
+ primaryList: {
228
+ position: string;
229
+ display: string;
230
+ width: string;
231
+ overflowX: string;
232
+ };
233
+ };
234
+ sizes?: {
235
+ [key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
236
+ keys: ("base" | "container" | "primaryActions" | "selectedItem" | "secondaryActions")[];
237
+ }>;
238
+ };
239
+ variants?: {
240
+ [key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
241
+ keys: ("base" | "container" | "primaryActions" | "selectedItem" | "secondaryActions")[];
242
+ }>;
243
+ };
244
+ defaultProps?: {
245
+ size?: string | number;
246
+ variant?: string | number;
247
+ colorScheme?: string;
248
+ };
249
+ parts: ("base" | "container" | "primaryActions" | "selectedItem" | "secondaryActions")[];
250
+ };
251
+ declare const SubNavChildren: {
252
+ baseStyle?: ({ isOutlined }: SubNavChildrenStyleProps) => {
253
+ outLine: {
254
+ border: string;
255
+ borderRadius: string;
256
+ };
257
+ };
258
+ sizes?: {
259
+ [key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
260
+ keys: "outLine"[];
261
+ }>;
262
+ };
263
+ variants?: {
264
+ [key: string]: import("@chakra-ui/styled-system").PartsStyleInterpolation<{
265
+ keys: "outLine"[];
266
+ }>;
267
+ };
268
+ defaultProps?: {
269
+ size?: string | number;
270
+ variant?: string | number;
271
+ colorScheme?: string;
272
+ };
273
+ parts: "outLine"[];
274
+ };
275
+ export { SubNav, SubNavChildren };
@@ -50,7 +50,8 @@ declare const _default: {
50
50
  };
51
51
  gridTemplateColumns: string;
52
52
  paddingY: number;
53
- rowGap: string;
53
+ paddingX: string;
54
+ gap: string;
54
55
  };
55
56
  sizes?: {
56
57
  [key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
@@ -58,12 +59,12 @@ declare const _default: {
58
59
  variants?: {
59
60
  left: {
60
61
  gridTemplateColumns: {
61
- md: "271px 1fr";
62
+ md: "255px 1fr";
62
63
  };
63
64
  };
64
65
  right: {
65
66
  gridTemplateColumns: {
66
- md: "1fr 271px";
67
+ md: "1fr 255px";
67
68
  };
68
69
  };
69
70
  };
@@ -80,7 +81,6 @@ declare const _default: {
80
81
  md: "1 / span 2";
81
82
  };
82
83
  height: string;
83
- paddingX: string;
84
84
  };
85
85
  sizes?: {
86
86
  [key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
@@ -100,11 +100,6 @@ declare const _default: {
100
100
  base: "1";
101
101
  md: "1 / span 2";
102
102
  };
103
- overflow: {
104
- base: "unset";
105
- md: "hidden";
106
- };
107
- paddingX: string;
108
103
  };
109
104
  sizes?: {
110
105
  [key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
@@ -121,19 +116,20 @@ declare const _default: {
121
116
  minWidth: {
122
117
  md: number;
123
118
  };
124
- paddingRight: string;
125
- paddingLeft: {
126
- base: "s";
127
- md: "l";
119
+ overflow: {
120
+ base: "unset";
121
+ md: "hidden";
128
122
  };
129
123
  };
130
124
  right: {
131
- gridColumn: string;
132
- paddingRight: {
133
- base: "s";
134
- md: "l";
125
+ gridColumn: {
126
+ base: "1";
127
+ md: "1";
128
+ };
129
+ overflow: {
130
+ base: "unset";
131
+ md: "hidden";
135
132
  };
136
- paddingLeft: string;
137
133
  };
138
134
  };
139
135
  defaultProps?: {
@@ -150,22 +146,12 @@ declare const _default: {
150
146
  variants?: {
151
147
  left: {
152
148
  gridColumn: string;
153
- paddingLeft: string;
154
- paddingRight: {
155
- base: "s";
156
- md: number;
157
- };
158
149
  };
159
150
  right: {
160
151
  gridColumn: {
161
152
  base: "1";
162
153
  md: "2";
163
154
  };
164
- paddingLeft: {
165
- base: "s";
166
- md: number;
167
- };
168
- paddingRight: string;
169
155
  };
170
156
  };
171
157
  defaultProps?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.4.4-template-overflow-fix-rc",
3
+ "version": "3.5.0-rc",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",