@nypl/design-system-react-components 1.6.1 → 1.7.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.
@@ -19,6 +19,8 @@ interface ButtonProps {
19
19
  mouseDown?: boolean;
20
20
  /** The action to perform on the `<button>`'s onClick function. */
21
21
  onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
22
+ /** Visibly hidden text that will only be read by screenreaders. */
23
+ screenreaderOnlyText?: string;
22
24
  /** The size of the `Button`. */
23
25
  size?: ButtonSizes;
24
26
  /** The HTML button type attribute. */
@@ -1,12 +1,13 @@
1
1
  import React from "react";
2
- export declare const headingSizesArray: readonly ["primary", "secondary", "tertiary", "callout"];
3
- export declare const headingLevelsArray: readonly ["one", "two", "three", "four", "five", "six"];
2
+ export declare const headingSizesArray: readonly ["display1", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "primary", "secondary", "tertiary", "callout"];
3
+ export declare const headingLevelsArray: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "one", "two", "three", "four", "five", "six"];
4
4
  export type HeadingSizes = typeof headingSizesArray[number];
5
5
  export type HeadingLevels = typeof headingLevelsArray[number];
6
6
  export interface HeadingProps {
7
7
  /** Optional className that appears in addition to `heading` */
8
8
  className?: string;
9
- /** Optional ID that other components can cross reference for accessibility purposes */
9
+ /** Optional ID that other components can cross reference for accessibility
10
+ * purposes */
10
11
  id?: string;
11
12
  /** Optional prop used to show capitalized text */
12
13
  isCapitalized?: boolean;
@@ -17,16 +18,20 @@ export interface HeadingProps {
17
18
  /** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed,
18
19
  * `Heading` will default to `<h2>` */
19
20
  level?: HeadingLevels;
20
- /** Optional size used to override the default styles of the semantic HTM
21
- * `<h>` elements */
22
- size?: HeadingSizes;
23
21
  /** Optional prop used to remove default spacing */
24
22
  noSpace?: boolean;
23
+ /** String to populate the overline element */
24
+ overline?: string;
25
+ /** Optional size used to override the default styles of the native HTML `<h>`
26
+ * elements */
27
+ size?: HeadingSizes;
28
+ /** String to populate the subtitle element */
29
+ subtitle?: string;
25
30
  /** Inner text of the `<h*>` element */
26
31
  text?: string;
27
32
  /** Optional URL that header points to; when `url` prop is passed to
28
- * `Heading`, a child `<a>` element is created and the heading text becomes
29
- * an active link */
33
+ * `Heading`, a child `<a>` element is created and the heading text becomes an
34
+ * active link */
30
35
  url?: string;
31
36
  /** Optional className for the URL when the `url` prop is passed */
32
37
  urlClass?: string;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ /// <reference types="react" />
2
2
  export type AriaLiveValues = "assertive" | "off" | "polite" | undefined;
3
3
  export type HelperErrorTextType = string | JSX.Element;
4
4
  interface HelperErrorTextProps {
@@ -30,5 +30,5 @@ interface HelperErrorTextProps {
30
30
  * This pattern guarantees accessibility guidelines are met if the text content
31
31
  * is dynamically updated by the app or component that implements it.
32
32
  */
33
- export declare const HelperErrorText: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<HelperErrorTextProps & React.RefAttributes<HTMLDivElement>>, {}>;
33
+ export declare const HelperErrorText: import("@chakra-ui/react").ChakraComponent<import("react").ForwardRefExoticComponent<HelperErrorTextProps & import("react").RefAttributes<HTMLDivElement>>, {}>;
34
34
  export default HelperErrorText;
@@ -11,6 +11,8 @@ export interface LinkProps {
11
11
  /** ID used for accessibility purposes. */
12
12
  id?: string;
13
13
  onClick?: (event: React.MouseEvent<HTMLDivElement | HTMLAnchorElement, MouseEvent>) => void;
14
+ /** Visibly hidden text that will only be read by screenreaders. */
15
+ screenreaderOnlyText?: string;
14
16
  /** Prop that sets the HTML attribute to target where the link should go. */
15
17
  target?: "_blank" | "_parent" | "_self" | "_top";
16
18
  /** Controls the link visuals: action, button, backwards, forwards, or default. */
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- export declare const textSizesArray: readonly ["default", "caption", "tag", "mini"];
2
+ export declare const textSizesArray: readonly ["default", "body1", "body2", "caption", "tag", "mini", "overline1", "overline2", "subtitle1", "subtitle2"];
3
3
  export type TextSizes = typeof textSizesArray[number];
4
4
  export interface TextProps {
5
5
  /** Additional class name to render in the `Text` component. */
@@ -9,6 +9,25 @@ export declare const buttonBaseStyle: {
9
9
  lineHeight: string;
10
10
  textDecoration: string;
11
11
  wordWrap: string;
12
+ /** The element will handle descriptive text added to aid
13
+ * screen readers. */
14
+ screenreaderOnly: {
15
+ clip: string;
16
+ height: {
17
+ base: string;
18
+ md: string;
19
+ };
20
+ overflow: string;
21
+ position: {
22
+ base: string;
23
+ md: string;
24
+ };
25
+ width: {
26
+ base: string;
27
+ md: string;
28
+ };
29
+ wordWrap: string;
30
+ };
12
31
  svg: {
13
32
  fill: string;
14
33
  };
@@ -47,6 +66,7 @@ export declare const noBrand: ({ buttonSize }: {
47
66
  buttonSize?: string;
48
67
  }) => any;
49
68
  declare const Button: {
69
+ parts: string[];
50
70
  baseStyle: {
51
71
  alignItems: string;
52
72
  borderRadius: string;
@@ -58,6 +78,25 @@ declare const Button: {
58
78
  lineHeight: string;
59
79
  textDecoration: string;
60
80
  wordWrap: string;
81
+ /** The element will handle descriptive text added to aid
82
+ * screen readers. */
83
+ screenreaderOnly: {
84
+ clip: string;
85
+ height: {
86
+ base: string;
87
+ md: string;
88
+ };
89
+ overflow: string;
90
+ position: {
91
+ base: string;
92
+ md: string;
93
+ };
94
+ width: {
95
+ base: string;
96
+ md: string;
97
+ };
98
+ wordWrap: string;
99
+ };
61
100
  svg: {
62
101
  fill: string;
63
102
  };
@@ -1,5 +1,5 @@
1
1
  export declare const headings: {
2
- h1: {
2
+ one: {
3
3
  width: string;
4
4
  marginTop: string;
5
5
  marginStart: string;
@@ -9,7 +9,7 @@ export declare const headings: {
9
9
  letterSpacing: string;
10
10
  lineHeight: string;
11
11
  };
12
- h2: {
12
+ two: {
13
13
  width: string;
14
14
  marginTop: string;
15
15
  marginStart: string;
@@ -18,7 +18,7 @@ export declare const headings: {
18
18
  fontWeight: string;
19
19
  lineHeight: string;
20
20
  };
21
- h3: {
21
+ three: {
22
22
  width: string;
23
23
  marginTop: string;
24
24
  marginStart: string;
@@ -27,7 +27,7 @@ export declare const headings: {
27
27
  fontWeight: string;
28
28
  lineHeight: string;
29
29
  };
30
- h4: {
30
+ four: {
31
31
  width: string;
32
32
  marginTop: string;
33
33
  marginStart: string;
@@ -45,8 +45,48 @@ export declare const headings: {
45
45
  fontWeight: string;
46
46
  lineHeight: string;
47
47
  };
48
+ display1: {
49
+ fontWeight: string;
50
+ letterSpacing: string;
51
+ lineHeight: string;
52
+ width: string;
53
+ };
54
+ heading1: {
55
+ fontWeight: string;
56
+ letterSpacing: string;
57
+ lineHeight: string;
58
+ width: string;
59
+ };
60
+ heading2: {
61
+ fontWeight: string;
62
+ letterSpacing: string;
63
+ lineHeight: string;
64
+ width: string;
65
+ };
66
+ heading3: {
67
+ fontWeight: string;
68
+ letterSpacing: string;
69
+ lineHeight: string;
70
+ width: string;
71
+ };
72
+ heading4: {
73
+ fontWeight: string;
74
+ lineHeight: string;
75
+ width: string;
76
+ };
77
+ heading5: {
78
+ fontWeight: string;
79
+ lineHeight: string;
80
+ width: string;
81
+ };
82
+ heading6: {
83
+ fontWeight: string;
84
+ lineHeight: string;
85
+ width: string;
86
+ };
48
87
  };
49
88
  declare const Heading: {
89
+ parts: string[];
50
90
  baseStyle: ({ isCapitalized, isUppercase, isLowercase, noSpace }: {
51
91
  isCapitalized: any;
52
92
  isUppercase: any;
@@ -66,14 +106,52 @@ declare const Heading: {
66
106
  };
67
107
  };
68
108
  };
69
- marginBottom: string;
70
109
  textTransform: string;
71
110
  _dark: {
72
111
  color: string;
73
112
  };
113
+ headingWrapper: {
114
+ marginTop: string;
115
+ marginStart: string;
116
+ marginEnd: string;
117
+ marginBottom: string;
118
+ };
74
119
  };
75
120
  variants: {
76
121
  h1: {
122
+ fontWeight: string;
123
+ letterSpacing: string;
124
+ lineHeight: string;
125
+ width: string;
126
+ };
127
+ h2: {
128
+ fontWeight: string;
129
+ letterSpacing: string;
130
+ lineHeight: string;
131
+ width: string;
132
+ };
133
+ h3: {
134
+ fontWeight: string;
135
+ letterSpacing: string;
136
+ lineHeight: string;
137
+ width: string;
138
+ };
139
+ h4: {
140
+ fontWeight: string;
141
+ lineHeight: string;
142
+ width: string;
143
+ };
144
+ h5: {
145
+ fontWeight: string;
146
+ lineHeight: string;
147
+ width: string;
148
+ };
149
+ h6: {
150
+ fontWeight: string;
151
+ lineHeight: string;
152
+ width: string;
153
+ };
154
+ one: {
77
155
  width: string;
78
156
  marginTop: string;
79
157
  marginStart: string;
@@ -83,7 +161,7 @@ declare const Heading: {
83
161
  letterSpacing: string;
84
162
  lineHeight: string;
85
163
  };
86
- h2: {
164
+ two: {
87
165
  width: string;
88
166
  marginTop: string;
89
167
  marginStart: string;
@@ -92,7 +170,7 @@ declare const Heading: {
92
170
  fontWeight: string;
93
171
  lineHeight: string;
94
172
  };
95
- h3: {
173
+ three: {
96
174
  width: string;
97
175
  marginTop: string;
98
176
  marginStart: string;
@@ -101,7 +179,7 @@ declare const Heading: {
101
179
  fontWeight: string;
102
180
  lineHeight: string;
103
181
  };
104
- h4: {
182
+ four: {
105
183
  width: string;
106
184
  marginTop: string;
107
185
  marginStart: string;
@@ -110,7 +188,7 @@ declare const Heading: {
110
188
  fontWeight: string;
111
189
  lineHeight: string;
112
190
  };
113
- h5: {
191
+ five: {
114
192
  width: string;
115
193
  marginTop: string;
116
194
  marginStart: string;
@@ -119,7 +197,7 @@ declare const Heading: {
119
197
  fontWeight: string;
120
198
  lineHeight: string;
121
199
  };
122
- h6: {
200
+ six: {
123
201
  width: string;
124
202
  marginTop: string;
125
203
  marginStart: string;
@@ -128,6 +206,45 @@ declare const Heading: {
128
206
  fontWeight: string;
129
207
  lineHeight: string;
130
208
  };
209
+ display1: {
210
+ fontWeight: string;
211
+ letterSpacing: string;
212
+ lineHeight: string;
213
+ width: string;
214
+ };
215
+ heading1: {
216
+ fontWeight: string;
217
+ letterSpacing: string;
218
+ lineHeight: string;
219
+ width: string;
220
+ };
221
+ heading2: {
222
+ fontWeight: string;
223
+ letterSpacing: string;
224
+ lineHeight: string;
225
+ width: string;
226
+ };
227
+ heading3: {
228
+ fontWeight: string;
229
+ letterSpacing: string;
230
+ lineHeight: string;
231
+ width: string;
232
+ };
233
+ heading4: {
234
+ fontWeight: string;
235
+ lineHeight: string;
236
+ width: string;
237
+ };
238
+ heading5: {
239
+ fontWeight: string;
240
+ lineHeight: string;
241
+ width: string;
242
+ };
243
+ heading6: {
244
+ fontWeight: string;
245
+ lineHeight: string;
246
+ width: string;
247
+ };
131
248
  primary: {
132
249
  width: string;
133
250
  marginTop: string;
@@ -2,14 +2,17 @@ interface HelperErrorTextBaseStyle {
2
2
  isInvalid: boolean;
3
3
  }
4
4
  declare const helperErrorText: {
5
+ parts: string[];
5
6
  baseStyle: ({ isInvalid }: HelperErrorTextBaseStyle) => {
6
- marginTop: string;
7
- marginBottom: string;
8
7
  fontSize: string;
9
8
  color: string;
10
9
  _dark: {
11
10
  color: string;
12
11
  };
12
+ innerChild: {
13
+ marginTop: string;
14
+ marginBottom: string;
15
+ };
13
16
  };
14
17
  };
15
18
  export default helperErrorText;
@@ -23,7 +23,7 @@ declare const Link: {
23
23
  };
24
24
  /** The element will handle descriptive text added to aid
25
25
  * screen readers. */
26
- srOnly: {
26
+ screenreaderOnly: {
27
27
  clip: string;
28
28
  height: {
29
29
  base: string;
@@ -6,7 +6,7 @@ interface StructuredContentBaseStyle {
6
6
  declare const StructuredContent: {
7
7
  parts: string[];
8
8
  baseStyle: ({ hasFigureImage, imageAspectRatio, imagePosition, }: StructuredContentBaseStyle) => {
9
- h1: {
9
+ one: {
10
10
  width: string;
11
11
  marginTop: string;
12
12
  marginStart: string;
@@ -16,7 +16,7 @@ declare const StructuredContent: {
16
16
  letterSpacing: string;
17
17
  lineHeight: string;
18
18
  };
19
- h2: {
19
+ two: {
20
20
  width: string;
21
21
  marginTop: string;
22
22
  marginStart: string;
@@ -25,7 +25,7 @@ declare const StructuredContent: {
25
25
  fontWeight: string;
26
26
  lineHeight: string;
27
27
  };
28
- h3: {
28
+ three: {
29
29
  width: string;
30
30
  marginTop: string;
31
31
  marginStart: string;
@@ -34,7 +34,7 @@ declare const StructuredContent: {
34
34
  fontWeight: string;
35
35
  lineHeight: string;
36
36
  };
37
- h4: {
37
+ four: {
38
38
  width: string;
39
39
  marginTop: string;
40
40
  marginStart: string;
@@ -52,6 +52,45 @@ declare const StructuredContent: {
52
52
  fontWeight: string;
53
53
  lineHeight: string;
54
54
  };
55
+ display1: {
56
+ fontWeight: string;
57
+ letterSpacing: string;
58
+ lineHeight: string;
59
+ width: string;
60
+ };
61
+ heading1: {
62
+ fontWeight: string;
63
+ letterSpacing: string;
64
+ lineHeight: string;
65
+ width: string;
66
+ };
67
+ heading2: {
68
+ fontWeight: string;
69
+ letterSpacing: string;
70
+ lineHeight: string;
71
+ width: string;
72
+ };
73
+ heading3: {
74
+ fontWeight: string;
75
+ letterSpacing: string;
76
+ lineHeight: string;
77
+ width: string;
78
+ };
79
+ heading4: {
80
+ fontWeight: string;
81
+ lineHeight: string;
82
+ width: string;
83
+ };
84
+ heading5: {
85
+ fontWeight: string;
86
+ lineHeight: string;
87
+ width: string;
88
+ };
89
+ heading6: {
90
+ fontWeight: string;
91
+ lineHeight: string;
92
+ width: string;
93
+ };
55
94
  imageFigure: {
56
95
  marginBottom: string;
57
96
  maxWidth?: string;
@@ -54,6 +54,12 @@ declare const _default: {
54
54
  };
55
55
  };
56
56
  TemplateContentPrimary: {
57
+ baseStyle: {
58
+ gridColumn: {
59
+ base: string;
60
+ md: string;
61
+ };
62
+ };
57
63
  variants: {
58
64
  left: {
59
65
  gridColumn: {
@@ -67,6 +73,12 @@ declare const _default: {
67
73
  md: number;
68
74
  };
69
75
  };
76
+ right: {
77
+ gridColumn: {
78
+ base: string;
79
+ md: string;
80
+ };
81
+ };
70
82
  };
71
83
  };
72
84
  TemplateContentSidebar: {
@@ -16,14 +16,43 @@ declare const Text: {
16
16
  };
17
17
  variants: {
18
18
  default: {};
19
+ body1: {};
20
+ body2: {
21
+ fontSize: string;
22
+ };
19
23
  caption: {
20
24
  fontSize: string;
25
+ fontWeight: string;
26
+ };
27
+ overline1: {
28
+ fontSize: string;
29
+ fontWeight: string;
30
+ lineHeight: number;
31
+ textTransform: string;
32
+ };
33
+ overline2: {
34
+ fontSize: string;
35
+ fontWeight: string;
36
+ lineHeight: number;
37
+ textTransform: string;
38
+ };
39
+ subtitle1: {
40
+ fontSize: string;
41
+ fontWeight: string;
42
+ lineHeight: number;
43
+ };
44
+ subtitle2: {
45
+ fontSize: string;
46
+ fontWeight: string;
47
+ lineHeight: number;
21
48
  };
22
49
  tag: {
23
50
  fontSize: string;
51
+ fontWeight: string;
24
52
  };
25
53
  mini: {
26
54
  fontSize: string;
55
+ fontWeight: string;
27
56
  };
28
57
  };
29
58
  };
@@ -327,6 +327,11 @@ declare const TextInput: {
327
327
  wordWrap: string;
328
328
  };
329
329
  zIndex: string;
330
+ _dark: {
331
+ svg: {
332
+ fill: string;
333
+ };
334
+ };
330
335
  };
331
336
  };
332
337
  variants: {