@nypl/design-system-react-components 0.28.0 → 1.0.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/CHANGELOG.md +39 -0
- package/README.md +10 -10
- package/dist/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +8 -0
- package/dist/components/Heading/Heading.d.ts +2 -0
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +4 -0
- package/dist/design-system-react-components.cjs.development.js +1021 -683
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +1022 -684
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/button.d.ts +1 -0
- package/dist/theme/components/card.d.ts +98 -13
- package/dist/theme/components/checkboxGroup.d.ts +1 -1
- package/dist/theme/components/global.d.ts +1 -1
- package/dist/theme/components/heading.d.ts +4 -16
- package/dist/theme/components/image.d.ts +6 -0
- package/dist/theme/components/radioGroup.d.ts +1 -1
- package/dist/theme/components/skipNavigation.d.ts +3 -0
- package/dist/theme/components/structuredContent.d.ts +0 -5
- package/dist/utils/utils.d.ts +15 -0
- package/package.json +6 -6
- package/src/components/Accordion/Accordion.stories.mdx +18 -46
- package/src/components/Accordion/Accordion.tsx +3 -2
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +12 -12
- package/src/components/Button/Button.stories.mdx +1 -1
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +33 -2
- package/src/components/ButtonGroup/ButtonGroup.tsx +2 -1
- package/src/components/Card/Card.stories.mdx +2 -4
- package/src/components/Card/Card.tsx +2 -1
- package/src/components/Chakra/Box.stories.mdx +1 -1
- package/src/components/Chakra/Center.stories.mdx +1 -1
- package/src/components/Chakra/Flex.stories.mdx +1 -1
- package/src/components/Chakra/Grid.stories.mdx +1 -1
- package/src/components/Chakra/Stack.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +42 -11
- package/src/components/Checkbox/Checkbox.tsx +25 -39
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +589 -544
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +1 -1
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +1 -1
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1540 -1420
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +12 -3
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +5 -0
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +36 -17
- package/src/components/Grid/SimpleGrid.stories.mdx +1 -3
- package/src/components/Heading/Heading.stories.mdx +4 -1
- package/src/components/Heading/Heading.tsx +4 -1
- package/src/components/Image/Image.stories.mdx +1 -1
- package/src/components/Logo/Logo.stories.mdx +10 -5
- package/src/components/Logo/Logo.tsx +4 -0
- package/src/components/Logo/LogoSvgs.tsx +8 -0
- package/src/components/Modal/Modal.stories.mdx +83 -90
- package/src/components/Pagination/Pagination.stories.mdx +1 -1
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +22 -31
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +405 -365
- package/src/components/RadioGroup/RadioGroup.stories.mdx +2 -1
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1236 -1116
- package/src/components/SearchBar/SearchBar.stories.mdx +3 -3
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +32 -10
- package/src/components/Select/Select.stories.mdx +1 -1
- package/src/components/Select/Select.tsx +24 -22
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +21 -11
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +2 -2
- package/src/components/Slider/Slider.stories.mdx +1 -1
- package/src/components/Slider/Slider.tsx +14 -14
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +66 -33
- package/src/components/StyleGuide/Buttons.stories.mdx +1 -1
- package/src/components/StyleGuide/Colors.stories.mdx +2 -2
- package/src/components/StyleGuide/Forms.stories.mdx +2 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -2
- package/src/components/StyleGuide/Spacing.stories.mdx +1 -1
- package/src/components/StyleGuide/Typography.stories.mdx +1 -1
- package/src/components/Table/Table.stories.mdx +1 -5
- package/src/components/Table/Table.test.tsx +33 -0
- package/src/components/Table/Table.tsx +21 -0
- package/src/components/Template/Template.stories.mdx +9 -5
- package/src/components/TextInput/TextInput.stories.mdx +1 -1
- package/src/components/TextInput/TextInput.tsx +21 -21
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +19 -9
- package/src/components/Toggle/Toggle.stories.mdx +1 -1
- package/src/components/Toggle/Toggle.tsx +22 -20
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +400 -372
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +1 -0
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +5 -0
- package/src/docs/Chakra.stories.mdx +2 -2
- package/src/theme/components/button.ts +1 -0
- package/src/theme/components/card.ts +9 -3
- package/src/theme/components/componentWrapper.ts +1 -1
- package/src/theme/components/global.ts +1 -1
- package/src/theme/components/heading.ts +3 -3
- package/src/theme/components/image.ts +1 -0
- package/src/theme/components/skipNavigation.ts +3 -0
- package/src/theme/foundations/colors.ts +6 -9
- package/src/utils/utils.ts +40 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface CardBaseStyleProps {
|
|
2
2
|
hasImage: boolean;
|
|
3
3
|
imageIsAtEnd: boolean;
|
|
4
|
+
isAlignedRightActions: boolean;
|
|
4
5
|
isBordered: boolean;
|
|
5
6
|
isCentered: boolean;
|
|
6
7
|
layout: string;
|
|
@@ -50,7 +51,7 @@ declare const imageSizes: {
|
|
|
50
51
|
declare const _default: {
|
|
51
52
|
Card: {
|
|
52
53
|
parts: string[];
|
|
53
|
-
baseStyle: ({ hasImage, imageIsAtEnd, isBordered, isCentered, layout, mainActionLink, }: CardBaseStyleProps) => {
|
|
54
|
+
baseStyle: ({ hasImage, imageIsAtEnd, isAlignedRightActions, isBordered, isCentered, layout, mainActionLink, }: CardBaseStyleProps) => {
|
|
54
55
|
display: string;
|
|
55
56
|
flexFlow: {
|
|
56
57
|
base: string;
|
|
@@ -62,19 +63,40 @@ declare const _default: {
|
|
|
62
63
|
border: string;
|
|
63
64
|
borderColor: string;
|
|
64
65
|
actions: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
flexShrink: {
|
|
67
|
+
base: string;
|
|
68
|
+
md: string;
|
|
69
|
+
};
|
|
70
|
+
marginLeft: {
|
|
71
|
+
base: string;
|
|
72
|
+
md: string;
|
|
73
|
+
};
|
|
74
|
+
marginTop: {
|
|
75
|
+
base: string;
|
|
76
|
+
md: string;
|
|
77
|
+
};
|
|
78
|
+
maxWidth: {
|
|
79
|
+
base: string;
|
|
80
|
+
md: string;
|
|
81
|
+
};
|
|
82
|
+
width: string;
|
|
68
83
|
};
|
|
69
84
|
body: {
|
|
70
85
|
display: {
|
|
71
86
|
md: string;
|
|
72
87
|
};
|
|
88
|
+
flexBasis: {
|
|
89
|
+
sm: string;
|
|
90
|
+
};
|
|
73
91
|
flexFlow: {
|
|
74
92
|
md: string;
|
|
75
93
|
};
|
|
76
94
|
margin: any;
|
|
77
95
|
padding: any;
|
|
96
|
+
width: {
|
|
97
|
+
base: string;
|
|
98
|
+
md: string;
|
|
99
|
+
};
|
|
78
100
|
};
|
|
79
101
|
heading: {
|
|
80
102
|
marginBottom: string;
|
|
@@ -91,19 +113,40 @@ declare const _default: {
|
|
|
91
113
|
border: string;
|
|
92
114
|
borderColor: string;
|
|
93
115
|
actions: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
flexShrink: {
|
|
117
|
+
base: string;
|
|
118
|
+
md: string;
|
|
119
|
+
};
|
|
120
|
+
marginLeft: {
|
|
121
|
+
base: string;
|
|
122
|
+
md: string;
|
|
123
|
+
};
|
|
124
|
+
marginTop: {
|
|
125
|
+
base: string;
|
|
126
|
+
md: string;
|
|
127
|
+
};
|
|
128
|
+
maxWidth: {
|
|
129
|
+
base: string;
|
|
130
|
+
md: string;
|
|
131
|
+
};
|
|
132
|
+
width: string;
|
|
97
133
|
};
|
|
98
134
|
body: {
|
|
99
135
|
display: {
|
|
100
136
|
md: string;
|
|
101
137
|
};
|
|
138
|
+
flexBasis: {
|
|
139
|
+
sm: string;
|
|
140
|
+
};
|
|
102
141
|
flexFlow: {
|
|
103
142
|
md: string;
|
|
104
143
|
};
|
|
105
144
|
margin: any;
|
|
106
145
|
padding: any;
|
|
146
|
+
width: {
|
|
147
|
+
base: string;
|
|
148
|
+
md: string;
|
|
149
|
+
};
|
|
107
150
|
};
|
|
108
151
|
heading: {
|
|
109
152
|
marginBottom: string;
|
|
@@ -123,19 +166,40 @@ declare const _default: {
|
|
|
123
166
|
border?: undefined;
|
|
124
167
|
borderColor?: undefined;
|
|
125
168
|
actions: {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
169
|
+
flexShrink: {
|
|
170
|
+
base: string;
|
|
171
|
+
md: string;
|
|
172
|
+
};
|
|
173
|
+
marginLeft: {
|
|
174
|
+
base: string;
|
|
175
|
+
md: string;
|
|
176
|
+
};
|
|
177
|
+
marginTop: {
|
|
178
|
+
base: string;
|
|
179
|
+
md: string;
|
|
180
|
+
};
|
|
181
|
+
maxWidth: {
|
|
182
|
+
base: string;
|
|
183
|
+
md: string;
|
|
184
|
+
};
|
|
185
|
+
width: string;
|
|
129
186
|
};
|
|
130
187
|
body: {
|
|
131
188
|
display: {
|
|
132
189
|
md: string;
|
|
133
190
|
};
|
|
191
|
+
flexBasis: {
|
|
192
|
+
sm: string;
|
|
193
|
+
};
|
|
134
194
|
flexFlow: {
|
|
135
195
|
md: string;
|
|
136
196
|
};
|
|
137
197
|
margin: any;
|
|
138
198
|
padding: any;
|
|
199
|
+
width: {
|
|
200
|
+
base: string;
|
|
201
|
+
md: string;
|
|
202
|
+
};
|
|
139
203
|
};
|
|
140
204
|
heading: {
|
|
141
205
|
marginBottom: string;
|
|
@@ -152,19 +216,40 @@ declare const _default: {
|
|
|
152
216
|
border?: undefined;
|
|
153
217
|
borderColor?: undefined;
|
|
154
218
|
actions: {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
219
|
+
flexShrink: {
|
|
220
|
+
base: string;
|
|
221
|
+
md: string;
|
|
222
|
+
};
|
|
223
|
+
marginLeft: {
|
|
224
|
+
base: string;
|
|
225
|
+
md: string;
|
|
226
|
+
};
|
|
227
|
+
marginTop: {
|
|
228
|
+
base: string;
|
|
229
|
+
md: string;
|
|
230
|
+
};
|
|
231
|
+
maxWidth: {
|
|
232
|
+
base: string;
|
|
233
|
+
md: string;
|
|
234
|
+
};
|
|
235
|
+
width: string;
|
|
158
236
|
};
|
|
159
237
|
body: {
|
|
160
238
|
display: {
|
|
161
239
|
md: string;
|
|
162
240
|
};
|
|
241
|
+
flexBasis: {
|
|
242
|
+
sm: string;
|
|
243
|
+
};
|
|
163
244
|
flexFlow: {
|
|
164
245
|
md: string;
|
|
165
246
|
};
|
|
166
247
|
margin: any;
|
|
167
248
|
padding: any;
|
|
249
|
+
width: {
|
|
250
|
+
base: string;
|
|
251
|
+
md: string;
|
|
252
|
+
};
|
|
168
253
|
};
|
|
169
254
|
heading: {
|
|
170
255
|
marginBottom: string;
|
|
@@ -4,7 +4,6 @@ export declare const headings: {
|
|
|
4
4
|
marginTop: string;
|
|
5
5
|
marginLeft: string;
|
|
6
6
|
marginRight: string;
|
|
7
|
-
marginBottom: string;
|
|
8
7
|
fontSize: string;
|
|
9
8
|
fontWeight: string;
|
|
10
9
|
letterSpacing: string;
|
|
@@ -15,7 +14,6 @@ export declare const headings: {
|
|
|
15
14
|
marginTop: string;
|
|
16
15
|
marginLeft: string;
|
|
17
16
|
marginRight: string;
|
|
18
|
-
marginBottom: string;
|
|
19
17
|
fontSize: string;
|
|
20
18
|
fontWeight: string;
|
|
21
19
|
lineHeight: string;
|
|
@@ -25,7 +23,6 @@ export declare const headings: {
|
|
|
25
23
|
marginTop: string;
|
|
26
24
|
marginLeft: string;
|
|
27
25
|
marginRight: string;
|
|
28
|
-
marginBottom: string;
|
|
29
26
|
fontSize: string;
|
|
30
27
|
fontWeight: string;
|
|
31
28
|
lineHeight: string;
|
|
@@ -35,7 +32,6 @@ export declare const headings: {
|
|
|
35
32
|
marginTop: string;
|
|
36
33
|
marginLeft: string;
|
|
37
34
|
marginRight: string;
|
|
38
|
-
marginBottom: string;
|
|
39
35
|
fontSize: string;
|
|
40
36
|
fontWeight: string;
|
|
41
37
|
lineHeight: string;
|
|
@@ -45,14 +41,15 @@ export declare const headings: {
|
|
|
45
41
|
marginTop: string;
|
|
46
42
|
marginLeft: string;
|
|
47
43
|
marginRight: string;
|
|
48
|
-
marginBottom: string;
|
|
49
44
|
fontSize: string;
|
|
50
45
|
fontWeight: string;
|
|
51
46
|
lineHeight: string;
|
|
52
47
|
};
|
|
53
48
|
};
|
|
54
49
|
declare const Heading: {
|
|
55
|
-
baseStyle: {
|
|
50
|
+
baseStyle: ({ noSpace }: {
|
|
51
|
+
noSpace: any;
|
|
52
|
+
}) => {
|
|
56
53
|
a: {
|
|
57
54
|
color: string;
|
|
58
55
|
textDecoration: string;
|
|
@@ -60,6 +57,7 @@ declare const Heading: {
|
|
|
60
57
|
color: string;
|
|
61
58
|
};
|
|
62
59
|
};
|
|
60
|
+
marginBottom: string;
|
|
63
61
|
};
|
|
64
62
|
variants: {
|
|
65
63
|
h1: {
|
|
@@ -67,7 +65,6 @@ declare const Heading: {
|
|
|
67
65
|
marginTop: string;
|
|
68
66
|
marginLeft: string;
|
|
69
67
|
marginRight: string;
|
|
70
|
-
marginBottom: string;
|
|
71
68
|
fontSize: string;
|
|
72
69
|
fontWeight: string;
|
|
73
70
|
letterSpacing: string;
|
|
@@ -78,7 +75,6 @@ declare const Heading: {
|
|
|
78
75
|
marginTop: string;
|
|
79
76
|
marginLeft: string;
|
|
80
77
|
marginRight: string;
|
|
81
|
-
marginBottom: string;
|
|
82
78
|
fontSize: string;
|
|
83
79
|
fontWeight: string;
|
|
84
80
|
lineHeight: string;
|
|
@@ -88,7 +84,6 @@ declare const Heading: {
|
|
|
88
84
|
marginTop: string;
|
|
89
85
|
marginLeft: string;
|
|
90
86
|
marginRight: string;
|
|
91
|
-
marginBottom: string;
|
|
92
87
|
fontSize: string;
|
|
93
88
|
fontWeight: string;
|
|
94
89
|
lineHeight: string;
|
|
@@ -98,7 +93,6 @@ declare const Heading: {
|
|
|
98
93
|
marginTop: string;
|
|
99
94
|
marginLeft: string;
|
|
100
95
|
marginRight: string;
|
|
101
|
-
marginBottom: string;
|
|
102
96
|
fontSize: string;
|
|
103
97
|
fontWeight: string;
|
|
104
98
|
lineHeight: string;
|
|
@@ -108,7 +102,6 @@ declare const Heading: {
|
|
|
108
102
|
marginTop: string;
|
|
109
103
|
marginLeft: string;
|
|
110
104
|
marginRight: string;
|
|
111
|
-
marginBottom: string;
|
|
112
105
|
fontSize: string;
|
|
113
106
|
fontWeight: string;
|
|
114
107
|
lineHeight: string;
|
|
@@ -118,7 +111,6 @@ declare const Heading: {
|
|
|
118
111
|
marginTop: string;
|
|
119
112
|
marginLeft: string;
|
|
120
113
|
marginRight: string;
|
|
121
|
-
marginBottom: string;
|
|
122
114
|
fontSize: string;
|
|
123
115
|
fontWeight: string;
|
|
124
116
|
lineHeight: string;
|
|
@@ -128,7 +120,6 @@ declare const Heading: {
|
|
|
128
120
|
marginTop: string;
|
|
129
121
|
marginLeft: string;
|
|
130
122
|
marginRight: string;
|
|
131
|
-
marginBottom: string;
|
|
132
123
|
fontSize: string;
|
|
133
124
|
fontWeight: string;
|
|
134
125
|
letterSpacing: string;
|
|
@@ -139,7 +130,6 @@ declare const Heading: {
|
|
|
139
130
|
marginTop: string;
|
|
140
131
|
marginLeft: string;
|
|
141
132
|
marginRight: string;
|
|
142
|
-
marginBottom: string;
|
|
143
133
|
fontSize: string;
|
|
144
134
|
fontWeight: string;
|
|
145
135
|
lineHeight: string;
|
|
@@ -149,7 +139,6 @@ declare const Heading: {
|
|
|
149
139
|
marginTop: string;
|
|
150
140
|
marginLeft: string;
|
|
151
141
|
marginRight: string;
|
|
152
|
-
marginBottom: string;
|
|
153
142
|
fontSize: string;
|
|
154
143
|
fontWeight: string;
|
|
155
144
|
lineHeight: string;
|
|
@@ -159,7 +148,6 @@ declare const Heading: {
|
|
|
159
148
|
marginTop: string;
|
|
160
149
|
marginLeft: string;
|
|
161
150
|
marginRight: string;
|
|
162
|
-
marginBottom: string;
|
|
163
151
|
fontSize: string;
|
|
164
152
|
fontWeight: string;
|
|
165
153
|
lineHeight: string;
|
|
@@ -108,6 +108,7 @@ declare const CustomImage: {
|
|
|
108
108
|
};
|
|
109
109
|
maxWidth: string;
|
|
110
110
|
margin: string;
|
|
111
|
+
width: string;
|
|
111
112
|
} | {
|
|
112
113
|
img: {
|
|
113
114
|
marginBottom: string;
|
|
@@ -116,6 +117,7 @@ declare const CustomImage: {
|
|
|
116
117
|
marginLeft: string;
|
|
117
118
|
marginRight: string;
|
|
118
119
|
margin: string;
|
|
120
|
+
width: string;
|
|
119
121
|
} | {
|
|
120
122
|
img: {
|
|
121
123
|
marginBottom: string;
|
|
@@ -124,6 +126,7 @@ declare const CustomImage: {
|
|
|
124
126
|
marginLeft: string;
|
|
125
127
|
marginRight: string;
|
|
126
128
|
margin: string;
|
|
129
|
+
width: string;
|
|
127
130
|
} | {
|
|
128
131
|
img: {
|
|
129
132
|
marginBottom: string;
|
|
@@ -132,6 +135,7 @@ declare const CustomImage: {
|
|
|
132
135
|
marginLeft: string;
|
|
133
136
|
marginRight: string;
|
|
134
137
|
margin: string;
|
|
138
|
+
width: string;
|
|
135
139
|
} | {
|
|
136
140
|
img: {
|
|
137
141
|
marginBottom: string;
|
|
@@ -140,6 +144,7 @@ declare const CustomImage: {
|
|
|
140
144
|
marginLeft: string;
|
|
141
145
|
marginRight: string;
|
|
142
146
|
margin: string;
|
|
147
|
+
width: string;
|
|
143
148
|
} | {
|
|
144
149
|
img: {
|
|
145
150
|
marginBottom: string;
|
|
@@ -148,6 +153,7 @@ declare const CustomImage: {
|
|
|
148
153
|
marginLeft: string;
|
|
149
154
|
marginRight: string;
|
|
150
155
|
margin: string;
|
|
156
|
+
width: string;
|
|
151
157
|
};
|
|
152
158
|
figcaption: {
|
|
153
159
|
fontStyle: string;
|
|
@@ -11,7 +11,6 @@ declare const StructuredContent: {
|
|
|
11
11
|
marginTop: string;
|
|
12
12
|
marginLeft: string;
|
|
13
13
|
marginRight: string;
|
|
14
|
-
marginBottom: string;
|
|
15
14
|
fontSize: string;
|
|
16
15
|
fontWeight: string;
|
|
17
16
|
letterSpacing: string;
|
|
@@ -22,7 +21,6 @@ declare const StructuredContent: {
|
|
|
22
21
|
marginTop: string;
|
|
23
22
|
marginLeft: string;
|
|
24
23
|
marginRight: string;
|
|
25
|
-
marginBottom: string;
|
|
26
24
|
fontSize: string;
|
|
27
25
|
fontWeight: string;
|
|
28
26
|
lineHeight: string;
|
|
@@ -32,7 +30,6 @@ declare const StructuredContent: {
|
|
|
32
30
|
marginTop: string;
|
|
33
31
|
marginLeft: string;
|
|
34
32
|
marginRight: string;
|
|
35
|
-
marginBottom: string;
|
|
36
33
|
fontSize: string;
|
|
37
34
|
fontWeight: string;
|
|
38
35
|
lineHeight: string;
|
|
@@ -42,7 +39,6 @@ declare const StructuredContent: {
|
|
|
42
39
|
marginTop: string;
|
|
43
40
|
marginLeft: string;
|
|
44
41
|
marginRight: string;
|
|
45
|
-
marginBottom: string;
|
|
46
42
|
fontSize: string;
|
|
47
43
|
fontWeight: string;
|
|
48
44
|
lineHeight: string;
|
|
@@ -52,7 +48,6 @@ declare const StructuredContent: {
|
|
|
52
48
|
marginTop: string;
|
|
53
49
|
marginLeft: string;
|
|
54
50
|
marginRight: string;
|
|
55
|
-
marginBottom: string;
|
|
56
51
|
fontSize: string;
|
|
57
52
|
fontWeight: string;
|
|
58
53
|
lineHeight: string;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { HelperErrorTextType } from "../components/HelperErrorText/HelperErrorText";
|
|
2
|
+
import { AriaAttributes } from "./interfaces";
|
|
1
3
|
/**
|
|
2
4
|
* range
|
|
3
5
|
* Get an array of values from `start` to `stop` - 1 with an optional
|
|
@@ -14,3 +16,16 @@ export declare const getStorybookHrefProps: (pageCount: number) => {
|
|
|
14
16
|
computedCurrentPage: number;
|
|
15
17
|
getPageHref: (selectedPage: number) => string;
|
|
16
18
|
};
|
|
19
|
+
interface GetAriaAttrsProps {
|
|
20
|
+
footnote: HelperErrorTextType;
|
|
21
|
+
id: string;
|
|
22
|
+
labelText: HelperErrorTextType;
|
|
23
|
+
name: string;
|
|
24
|
+
showLabel: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get aria-* attributes for input components. This sets the `aria-label` and
|
|
28
|
+
* `aria-describedby` attributes, based on the label and footnote values.
|
|
29
|
+
*/
|
|
30
|
+
export declare const getAriaAttrs: ({ footnote, id, labelText, name, showLabel, }: GetAriaAttrsProps) => AriaAttributes;
|
|
31
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nypl/design-system-react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "NYPL Reservoir Design System React Components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"analyze": "size-limit --why",
|
|
34
34
|
"generate-sass-resources": "gulp",
|
|
35
35
|
"storybook": "start-storybook -p 6006 -s ./.storybook/public",
|
|
36
|
-
"build-storybook:
|
|
36
|
+
"build-storybook:v1": "npm run prebuild:storybook && build-storybook -c .storybook -o ./reservoir/v1",
|
|
37
37
|
"prebuild:storybook": "npm run test:generate-output"
|
|
38
38
|
},
|
|
39
39
|
"lint-staged": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@chakra-ui/react": ">=1.8.5",
|
|
61
|
-
"@chakra-ui/system": ">=1.11.0",
|
|
60
|
+
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
|
|
61
|
+
"@chakra-ui/system": ">=1.11.0 <=1.12.1",
|
|
62
62
|
"@emotion/react": ">=11.4.1",
|
|
63
63
|
"@emotion/styled": ">=11.3.0",
|
|
64
64
|
"framer-motion": "^4.1.17",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"typescript": "4.3.5"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@chakra-ui/react": ">=1.8.
|
|
72
|
-
"@chakra-ui/system": ">=1.
|
|
71
|
+
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
|
|
72
|
+
"@chakra-ui/system": ">=1.11.0 <=1.12.1",
|
|
73
73
|
"@emotion/react": ">=11.4.1",
|
|
74
74
|
"@emotion/styled": ">=11.3.0",
|
|
75
75
|
"framer-motion": "^4.1.17",
|
|
@@ -35,7 +35,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
35
35
|
| Component Version | DS Version |
|
|
36
36
|
| ----------------- | ---------- |
|
|
37
37
|
| Added | `0.1.0` |
|
|
38
|
-
| Latest | `0.
|
|
38
|
+
| Latest | `1.0.2` |
|
|
39
39
|
|
|
40
40
|
## Table of Contents
|
|
41
41
|
|
|
@@ -72,13 +72,13 @@ const accordionData = [
|
|
|
72
72
|
label: "Tom Nook",
|
|
73
73
|
panel: (
|
|
74
74
|
<Card
|
|
75
|
-
layout="row"
|
|
76
|
-
center
|
|
77
75
|
imageProps={{
|
|
78
76
|
alt: "Alt text",
|
|
79
77
|
aspectRatio: "twoByOne",
|
|
80
78
|
src: "https://play.nintendo.com/images/AC_Tom_FRYtwIN.17345b1513ac044897cfc243542899dce541e8dc.9afde10b.png",
|
|
81
79
|
}}
|
|
80
|
+
isCentered
|
|
81
|
+
layout="row"
|
|
82
82
|
>
|
|
83
83
|
<CardHeading level="four" id="heading1">
|
|
84
84
|
Tom Nook
|
|
@@ -100,48 +100,7 @@ const accordionData = [
|
|
|
100
100
|
|
|
101
101
|
## Component Props
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
<Story
|
|
105
|
-
name="Accordion with Controls"
|
|
106
|
-
args={{
|
|
107
|
-
accordionData: [
|
|
108
|
-
{
|
|
109
|
-
accordionType: "default",
|
|
110
|
-
label: "Tom Nook",
|
|
111
|
-
panel: (
|
|
112
|
-
<Card
|
|
113
|
-
imageProps={{
|
|
114
|
-
alt: "Alt text",
|
|
115
|
-
aspectRatio: "twoByOne",
|
|
116
|
-
src: "https://play.nintendo.com/images/AC_Tom_FRYtwIN.17345b1513ac044897cfc243542899dce541e8dc.9afde10b.png",
|
|
117
|
-
}}
|
|
118
|
-
isCentered
|
|
119
|
-
layout="row"
|
|
120
|
-
>
|
|
121
|
-
<CardHeading level="four" id="heading1">
|
|
122
|
-
Tom Nook
|
|
123
|
-
</CardHeading>
|
|
124
|
-
<CardContent>
|
|
125
|
-
Tom Nook, <b>known in Japan as Tanukichi</b>, is a fictional
|
|
126
|
-
character in the Animal Crossing series who operates the village
|
|
127
|
-
store.
|
|
128
|
-
</CardContent>
|
|
129
|
-
</Card>
|
|
130
|
-
),
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
id: "accordion-id",
|
|
134
|
-
isDefaultOpen: false,
|
|
135
|
-
}}
|
|
136
|
-
>
|
|
137
|
-
{(args) => <Accordion {...args} />}
|
|
138
|
-
</Story>
|
|
139
|
-
</Canvas>
|
|
140
|
-
|
|
141
|
-
<ArgsTable story="Accordion with Controls" />
|
|
142
|
-
|
|
143
|
-
```jsx
|
|
144
|
-
const accordionData = [
|
|
103
|
+
export const accordionData = [
|
|
145
104
|
{
|
|
146
105
|
accordionType: "default",
|
|
147
106
|
label: "Tom Nook",
|
|
@@ -166,7 +125,20 @@ const accordionData = [
|
|
|
166
125
|
),
|
|
167
126
|
},
|
|
168
127
|
];
|
|
169
|
-
|
|
128
|
+
|
|
129
|
+
<Canvas withToolbar>
|
|
130
|
+
<Story
|
|
131
|
+
name="Accordion with Controls"
|
|
132
|
+
args={{
|
|
133
|
+
id: "accordion-id",
|
|
134
|
+
isDefaultOpen: false,
|
|
135
|
+
}}
|
|
136
|
+
>
|
|
137
|
+
{(args) => <Accordion accordionData={accordionData} {...args} />}
|
|
138
|
+
</Story>
|
|
139
|
+
</Canvas>
|
|
140
|
+
|
|
141
|
+
<ArgsTable story="Accordion with Controls" />
|
|
170
142
|
|
|
171
143
|
## Accessibility
|
|
172
144
|
|
|
@@ -49,7 +49,8 @@ const getElementsFromData = (data: AccordionDataProps[] = [], id: string) => {
|
|
|
49
49
|
};
|
|
50
50
|
// For FAQ-style multiple accordions, the button should be bigger.
|
|
51
51
|
// Otherwise, use the default.
|
|
52
|
-
const
|
|
52
|
+
const multipleFontSize = data?.length > 1 ? "text.default" : "text.caption";
|
|
53
|
+
const multiplePadding = data?.length > 1 ? "s" : "xs s";
|
|
53
54
|
|
|
54
55
|
return data.map((content, index) => {
|
|
55
56
|
// This is done to support both string and DOM element input.
|
|
@@ -97,7 +98,7 @@ const getElementsFromData = (data: AccordionDataProps[] = [], id: string) => {
|
|
|
97
98
|
borderColor: "ui.gray.dark",
|
|
98
99
|
}}
|
|
99
100
|
>
|
|
100
|
-
<Box flex="1" textAlign="left">
|
|
101
|
+
<Box flex="1" fontSize={multipleFontSize} textAlign="left">
|
|
101
102
|
{content.label}
|
|
102
103
|
</Box>
|
|
103
104
|
{getIcon(isExpanded, index, id)}
|