@nypl/design-system-react-components 3.4.4 → 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";
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.4.4",
3
+ "version": "3.5.0-rc",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",