@nypl/design-system-react-components 3.4.4 → 3.5.0-rc-svg-2
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 +50 -50
- package/dist/design-system-react-components.js +11518 -11191
- package/dist/src/components/MultiSelect/MultiSelect.d.ts +1 -0
- package/dist/src/components/SubNav/SubNav.d.ts +60 -0
- package/dist/src/hooks/useScrollFadeStyles.d.ts +11 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/theme/components/subnav.d.ts +275 -0
- package/dist/src/theme/components/template.d.ts +25 -7
- package/package.json +1 -1
|
@@ -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
|
+
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -98,6 +98,7 @@ export { default as StructuredContent } from "./components/StructuredContent/Str
|
|
|
98
98
|
export type { StructuredContentImagePosition, StructuredContentProps, } from "./components/StructuredContent/StructuredContent";
|
|
99
99
|
export { default as StyledList } from "./components/StyledList/StyledList";
|
|
100
100
|
export type { StyledListProps, StyledListTextSizes, } from "./components/StyledList/StyledList";
|
|
101
|
+
export { default as SubNav, SubNavButton, SubNavLink, } from "./components/SubNav/SubNav";
|
|
101
102
|
export { default as Table } from "./components/Table/Table";
|
|
102
103
|
export type { TableBodyTextSizes, TableProps } from "./components/Table/Table";
|
|
103
104
|
export { default as Tabs, TabList, Tab, TabPanels, TabPanel, } from "./components/Tabs/Tabs";
|
|
@@ -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 };
|
|
@@ -50,8 +50,7 @@ declare const _default: {
|
|
|
50
50
|
};
|
|
51
51
|
gridTemplateColumns: string;
|
|
52
52
|
paddingY: number;
|
|
53
|
-
|
|
54
|
-
gap: string;
|
|
53
|
+
rowGap: string;
|
|
55
54
|
};
|
|
56
55
|
sizes?: {
|
|
57
56
|
[key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
|
|
@@ -59,12 +58,12 @@ declare const _default: {
|
|
|
59
58
|
variants?: {
|
|
60
59
|
left: {
|
|
61
60
|
gridTemplateColumns: {
|
|
62
|
-
md: "
|
|
61
|
+
md: "271px 1fr";
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
64
|
right: {
|
|
66
65
|
gridTemplateColumns: {
|
|
67
|
-
md: "1fr
|
|
66
|
+
md: "1fr 271px";
|
|
68
67
|
};
|
|
69
68
|
};
|
|
70
69
|
};
|
|
@@ -81,6 +80,7 @@ declare const _default: {
|
|
|
81
80
|
md: "1 / span 2";
|
|
82
81
|
};
|
|
83
82
|
height: string;
|
|
83
|
+
paddingX: string;
|
|
84
84
|
};
|
|
85
85
|
sizes?: {
|
|
86
86
|
[key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
|
|
@@ -100,6 +100,7 @@ declare const _default: {
|
|
|
100
100
|
base: "1";
|
|
101
101
|
md: "1 / span 2";
|
|
102
102
|
};
|
|
103
|
+
paddingX: string;
|
|
103
104
|
};
|
|
104
105
|
sizes?: {
|
|
105
106
|
[key: string]: import("@chakra-ui/styled-system").SystemStyleInterpolation;
|
|
@@ -116,16 +117,23 @@ declare const _default: {
|
|
|
116
117
|
minWidth: {
|
|
117
118
|
md: number;
|
|
118
119
|
};
|
|
120
|
+
paddingRight: string;
|
|
121
|
+
paddingLeft: {
|
|
122
|
+
base: "s";
|
|
123
|
+
md: "l";
|
|
124
|
+
};
|
|
119
125
|
overflow: {
|
|
120
126
|
base: "unset";
|
|
121
127
|
md: "hidden";
|
|
122
128
|
};
|
|
123
129
|
};
|
|
124
130
|
right: {
|
|
125
|
-
gridColumn:
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
gridColumn: string;
|
|
132
|
+
paddingRight: {
|
|
133
|
+
base: "s";
|
|
134
|
+
md: "l";
|
|
128
135
|
};
|
|
136
|
+
paddingLeft: string;
|
|
129
137
|
overflow: {
|
|
130
138
|
base: "unset";
|
|
131
139
|
md: "hidden";
|
|
@@ -146,12 +154,22 @@ declare const _default: {
|
|
|
146
154
|
variants?: {
|
|
147
155
|
left: {
|
|
148
156
|
gridColumn: string;
|
|
157
|
+
paddingLeft: string;
|
|
158
|
+
paddingRight: {
|
|
159
|
+
base: "s";
|
|
160
|
+
md: number;
|
|
161
|
+
};
|
|
149
162
|
};
|
|
150
163
|
right: {
|
|
151
164
|
gridColumn: {
|
|
152
165
|
base: "1";
|
|
153
166
|
md: "2";
|
|
154
167
|
};
|
|
168
|
+
paddingLeft: {
|
|
169
|
+
base: "s";
|
|
170
|
+
md: number;
|
|
171
|
+
};
|
|
172
|
+
paddingRight: string;
|
|
155
173
|
};
|
|
156
174
|
};
|
|
157
175
|
defaultProps?: {
|