@cambly/syntax-core 4.6.0 → 4.7.0
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/index.d.ts +75 -76
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React$1
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode, AriaRole, ReactElement } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Avatar is a circular image that represents a user.
|
|
@@ -26,10 +27,8 @@ declare const Avatar: ({ src, accessibilityLabel, size, }: {
|
|
|
26
27
|
size?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
27
28
|
}) => JSX.Element;
|
|
28
29
|
|
|
29
|
-
declare const colors: readonly ["black", "destructive100", "destructive200", "destructive300", "destructive700", "destructive800", "destructive900", "gray10", "gray100", "gray200", "gray30", "gray60", "gray300", "gray700", "gray80", "gray800", "gray900", "orange100", "orange200", "orange300", "orange700", "orange800", "orange900", "primary100", "primary200", "primary300", "primary700", "primary800", "primary900", "purple100", "purple200", "purple300", "purple700", "purple800", "purple900", "success100", "success200", "success300", "success700", "success800", "success900", "white", "yellow100", "yellow200", "yellow300", "yellow700", "yellow800", "yellow900"];
|
|
30
|
-
|
|
31
30
|
type AlignItems = "baseline" | "center" | "end" | "start" | "stretch";
|
|
32
|
-
type As = "article" | "aside" | "caption" | "
|
|
31
|
+
type As = "article" | "aside" | "caption" | "div" | "figcaption" | "figure" | "footer" | "header" | "main" | "nav" | "section" | "summary";
|
|
33
32
|
type Dimension = number | string;
|
|
34
33
|
type Direction = "row" | "column";
|
|
35
34
|
type Display = "none" | "flex" | "block" | "inlineBlock" | "visuallyHidden";
|
|
@@ -44,7 +43,7 @@ type Padding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
|
44
43
|
* * `aria-*`
|
|
45
44
|
* * `data-testid`
|
|
46
45
|
*/
|
|
47
|
-
declare
|
|
46
|
+
declare const _default: React$1.ForwardRefExoticComponent<{
|
|
48
47
|
/**
|
|
49
48
|
* The alignment of the box on the cross axis.
|
|
50
49
|
*
|
|
@@ -52,21 +51,21 @@ declare function Box(props: {
|
|
|
52
51
|
* * `smAlignItems`
|
|
53
52
|
* * `lgAlignItems`
|
|
54
53
|
*/
|
|
55
|
-
alignItems?: AlignItems;
|
|
54
|
+
alignItems?: AlignItems | undefined;
|
|
56
55
|
/**
|
|
57
56
|
* Allows the default alignment (or the one specified by align-items) to be overridden for individual flex items.
|
|
58
57
|
*/
|
|
59
|
-
alignSelf?: "
|
|
58
|
+
alignSelf?: "baseline" | "center" | "end" | "start" | "stretch" | "auto" | undefined;
|
|
60
59
|
/**
|
|
61
60
|
* The underlying DOM element usually set for accessibility or SEO reasons.
|
|
62
61
|
*
|
|
63
62
|
* @defaultValue "div"
|
|
64
63
|
*/
|
|
65
|
-
as?: As;
|
|
64
|
+
as?: As | undefined;
|
|
66
65
|
/**
|
|
67
66
|
* The background color of the box.
|
|
68
67
|
*/
|
|
69
|
-
backgroundColor?:
|
|
68
|
+
backgroundColor?: "black" | "destructive100" | "destructive200" | "destructive300" | "destructive700" | "destructive800" | "destructive900" | "gray10" | "gray100" | "gray200" | "gray30" | "gray60" | "gray300" | "gray700" | "gray80" | "gray800" | "gray900" | "orange100" | "orange200" | "orange300" | "orange700" | "orange800" | "orange900" | "primary100" | "primary200" | "primary300" | "primary700" | "primary800" | "primary900" | "purple100" | "purple200" | "purple300" | "purple700" | "purple800" | "purple900" | "success100" | "success200" | "success300" | "success700" | "success800" | "success900" | "white" | "yellow100" | "yellow200" | "yellow300" | "yellow700" | "yellow800" | "yellow900" | undefined;
|
|
70
69
|
/**
|
|
71
70
|
* The children to be rendered inside the box.
|
|
72
71
|
*/
|
|
@@ -78,7 +77,7 @@ declare function Box(props: {
|
|
|
78
77
|
*/
|
|
79
78
|
dangerouslySetInlineStyle?: {
|
|
80
79
|
__style: Record<string, string | number | null>;
|
|
81
|
-
};
|
|
80
|
+
} | undefined;
|
|
82
81
|
/**
|
|
83
82
|
* The flex direction of the box.
|
|
84
83
|
*
|
|
@@ -88,7 +87,7 @@ declare function Box(props: {
|
|
|
88
87
|
*
|
|
89
88
|
* @defaultValue `row`
|
|
90
89
|
*/
|
|
91
|
-
direction?: Direction;
|
|
90
|
+
direction?: Direction | undefined;
|
|
92
91
|
/**
|
|
93
92
|
* The display property specifies the display behavior (the type of rendering box) of an element.
|
|
94
93
|
*
|
|
@@ -98,74 +97,74 @@ declare function Box(props: {
|
|
|
98
97
|
*
|
|
99
98
|
* @defaultValue `block`
|
|
100
99
|
*/
|
|
101
|
-
display?: Display;
|
|
100
|
+
display?: Display | undefined;
|
|
102
101
|
/**
|
|
103
102
|
* If the size of all flex items is larger than the flex container, items shrink to fit according to flex-shrink
|
|
104
103
|
*
|
|
105
104
|
*/
|
|
106
|
-
flexShrink?: number;
|
|
105
|
+
flexShrink?: number | undefined;
|
|
107
106
|
/**
|
|
108
107
|
* By default, flex items will all try to fit onto one line. But if you specify `flexWrap="wrap"`, the flex items will wrap onto multiple lines.
|
|
109
108
|
*
|
|
110
109
|
* @defaultValue `nowrap`
|
|
111
110
|
*/
|
|
112
|
-
flexWrap?: "wrap" | "nowrap";
|
|
111
|
+
flexWrap?: "wrap" | "nowrap" | undefined;
|
|
113
112
|
/**
|
|
114
113
|
* The gap between the children of the box.
|
|
115
114
|
*/
|
|
116
|
-
gap?: Gap;
|
|
115
|
+
gap?: Gap | undefined;
|
|
117
116
|
/**
|
|
118
117
|
* The id of the element.
|
|
119
118
|
*/
|
|
120
|
-
id?: string;
|
|
119
|
+
id?: string | undefined;
|
|
121
120
|
/**
|
|
122
121
|
* The alignment of the box on the cross axis on lg (960px) or larger viewports.
|
|
123
122
|
*/
|
|
124
|
-
lgAlignItems?: AlignItems;
|
|
123
|
+
lgAlignItems?: AlignItems | undefined;
|
|
125
124
|
/**
|
|
126
125
|
* The flex direction on lg (960px) or larger viewports.
|
|
127
126
|
*/
|
|
128
|
-
lgDirection?: Direction;
|
|
127
|
+
lgDirection?: Direction | undefined;
|
|
129
128
|
/**
|
|
130
129
|
* The display style on lg (960px) or larger viewports.
|
|
131
130
|
*/
|
|
132
|
-
lgDisplay?: Display;
|
|
131
|
+
lgDisplay?: Display | undefined;
|
|
133
132
|
/**
|
|
134
133
|
* The alignment of the box on the cross axis on lg (960px) or larger viewports.
|
|
135
134
|
*/
|
|
136
|
-
lgJustifyContent?: JustifyContent;
|
|
135
|
+
lgJustifyContent?: JustifyContent | undefined;
|
|
137
136
|
/**
|
|
138
137
|
* Margin on lg (960px) or larger viewports.
|
|
139
138
|
*/
|
|
140
|
-
lgMargin?: Margin;
|
|
139
|
+
lgMargin?: Margin | undefined;
|
|
141
140
|
/**
|
|
142
141
|
* Bottom margin on lg (960px) or larger viewports.
|
|
143
142
|
*/
|
|
144
|
-
lgMarginBottom?: Margin;
|
|
143
|
+
lgMarginBottom?: Margin | undefined;
|
|
145
144
|
/**
|
|
146
145
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages on lg (960px) or larger viewports.
|
|
147
146
|
*/
|
|
148
|
-
lgMarginEnd?: Margin;
|
|
147
|
+
lgMarginEnd?: Margin | undefined;
|
|
149
148
|
/**
|
|
150
149
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages on lg (960px) or larger viewports.
|
|
151
150
|
*/
|
|
152
|
-
lgMarginStart?: Margin;
|
|
151
|
+
lgMarginStart?: Margin | undefined;
|
|
153
152
|
/**
|
|
154
153
|
* Top margin on lg (960px) or larger viewports.
|
|
155
154
|
*/
|
|
156
|
-
lgMarginTop?: Margin;
|
|
155
|
+
lgMarginTop?: Margin | undefined;
|
|
157
156
|
/**
|
|
158
157
|
* The padding of the box on lg (960px) or larger viewports.
|
|
159
158
|
*/
|
|
160
|
-
lgPadding?: Padding;
|
|
159
|
+
lgPadding?: Padding | undefined;
|
|
161
160
|
/**
|
|
162
161
|
* The padding of the box on the x-axis on lg (960px) or larger viewports.
|
|
163
162
|
*/
|
|
164
|
-
lgPaddingX?: Padding;
|
|
163
|
+
lgPaddingX?: Padding | undefined;
|
|
165
164
|
/**
|
|
166
165
|
* The padding of the box on the y-axis on lg (960px) or larger viewports.
|
|
167
166
|
*/
|
|
168
|
-
lgPaddingY?: Padding;
|
|
167
|
+
lgPaddingY?: Padding | undefined;
|
|
169
168
|
/**
|
|
170
169
|
* The margin of the box.
|
|
171
170
|
*
|
|
@@ -175,7 +174,7 @@ declare function Box(props: {
|
|
|
175
174
|
*
|
|
176
175
|
* @defaultValue 0
|
|
177
176
|
*/
|
|
178
|
-
margin?: Margin;
|
|
177
|
+
margin?: Margin | undefined;
|
|
179
178
|
/**
|
|
180
179
|
* Bottom margin of the box.
|
|
181
180
|
*
|
|
@@ -184,7 +183,7 @@ declare function Box(props: {
|
|
|
184
183
|
* * `lgMarginBottom`
|
|
185
184
|
*
|
|
186
185
|
*/
|
|
187
|
-
marginBottom?: Margin;
|
|
186
|
+
marginBottom?: Margin | undefined;
|
|
188
187
|
/**
|
|
189
188
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages.
|
|
190
189
|
*
|
|
@@ -193,7 +192,7 @@ declare function Box(props: {
|
|
|
193
192
|
* * `lgMarginEnd`
|
|
194
193
|
*
|
|
195
194
|
*/
|
|
196
|
-
marginEnd?: Margin;
|
|
195
|
+
marginEnd?: Margin | undefined;
|
|
197
196
|
/**
|
|
198
197
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages.
|
|
199
198
|
*
|
|
@@ -202,7 +201,7 @@ declare function Box(props: {
|
|
|
202
201
|
* * `lgMarginStart`
|
|
203
202
|
*
|
|
204
203
|
*/
|
|
205
|
-
marginStart?: Margin;
|
|
204
|
+
marginStart?: Margin | undefined;
|
|
206
205
|
/**
|
|
207
206
|
* Top margin of the box.
|
|
208
207
|
*
|
|
@@ -211,27 +210,27 @@ declare function Box(props: {
|
|
|
211
210
|
* * `lgMarginTop`
|
|
212
211
|
*
|
|
213
212
|
*/
|
|
214
|
-
marginTop?: Margin;
|
|
213
|
+
marginTop?: Margin | undefined;
|
|
215
214
|
/**
|
|
216
215
|
* The maximum height of the box.
|
|
217
216
|
*/
|
|
218
|
-
maxHeight?: Dimension;
|
|
217
|
+
maxHeight?: Dimension | undefined;
|
|
219
218
|
/**
|
|
220
219
|
* The maximum width of the box.
|
|
221
220
|
*/
|
|
222
|
-
maxWidth?: Dimension;
|
|
221
|
+
maxWidth?: Dimension | undefined;
|
|
223
222
|
/**
|
|
224
223
|
* The minimum height of the box.
|
|
225
224
|
*/
|
|
226
|
-
minHeight?: Dimension;
|
|
225
|
+
minHeight?: Dimension | undefined;
|
|
227
226
|
/**
|
|
228
227
|
* The minimum width of the box.
|
|
229
228
|
*/
|
|
230
|
-
minWidth?: Dimension;
|
|
229
|
+
minWidth?: Dimension | undefined;
|
|
231
230
|
/**
|
|
232
231
|
* The height of the box.
|
|
233
232
|
*/
|
|
234
|
-
height?: Dimension;
|
|
233
|
+
height?: Dimension | undefined;
|
|
235
234
|
/**
|
|
236
235
|
* The alignment of the box on the main axis.
|
|
237
236
|
*
|
|
@@ -241,7 +240,7 @@ declare function Box(props: {
|
|
|
241
240
|
*
|
|
242
241
|
* @defaultValue "start"
|
|
243
242
|
*/
|
|
244
|
-
justifyContent?: JustifyContent;
|
|
243
|
+
justifyContent?: JustifyContent | undefined;
|
|
245
244
|
/**
|
|
246
245
|
* The padding of the box.
|
|
247
246
|
*
|
|
@@ -251,7 +250,7 @@ declare function Box(props: {
|
|
|
251
250
|
*
|
|
252
251
|
* @defaultValue 0
|
|
253
252
|
*/
|
|
254
|
-
padding?: Padding;
|
|
253
|
+
padding?: Padding | undefined;
|
|
255
254
|
/**
|
|
256
255
|
* The padding of the box on the x-axis.
|
|
257
256
|
*
|
|
@@ -260,7 +259,7 @@ declare function Box(props: {
|
|
|
260
259
|
* * `lgPaddingX`
|
|
261
260
|
*
|
|
262
261
|
*/
|
|
263
|
-
paddingX?: Padding;
|
|
262
|
+
paddingX?: Padding | undefined;
|
|
264
263
|
/**
|
|
265
264
|
* The padding of the box on the y-axis.
|
|
266
265
|
*
|
|
@@ -268,19 +267,19 @@ declare function Box(props: {
|
|
|
268
267
|
* * `smPaddingY`
|
|
269
268
|
* * `lgPaddingY`
|
|
270
269
|
*/
|
|
271
|
-
paddingY?: Padding;
|
|
270
|
+
paddingY?: Padding | undefined;
|
|
272
271
|
/**
|
|
273
272
|
* The position of the box.
|
|
274
273
|
*
|
|
275
274
|
* @defaultValue "static"
|
|
276
275
|
*/
|
|
277
|
-
position?: "absolute" | "fixed" | "relative" | "static" | "sticky";
|
|
276
|
+
position?: "absolute" | "fixed" | "relative" | "static" | "sticky" | undefined;
|
|
278
277
|
/**
|
|
279
278
|
* The role attribute of the box.
|
|
280
279
|
*
|
|
281
280
|
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the list of valid roles.
|
|
282
281
|
*/
|
|
283
|
-
role?: AriaRole;
|
|
282
|
+
role?: AriaRole | undefined;
|
|
284
283
|
/**
|
|
285
284
|
* Border radius of the box.
|
|
286
285
|
*
|
|
@@ -293,60 +292,60 @@ declare function Box(props: {
|
|
|
293
292
|
*
|
|
294
293
|
* @defaultValue "none"
|
|
295
294
|
*/
|
|
296
|
-
rounding?: "
|
|
295
|
+
rounding?: "sm" | "md" | "lg" | "xl" | "none" | "full" | undefined;
|
|
297
296
|
/**
|
|
298
297
|
* The alignment of the box on the cross axis on sm (480px) or larger viewports.
|
|
299
298
|
*/
|
|
300
|
-
smAlignItems?: AlignItems;
|
|
299
|
+
smAlignItems?: AlignItems | undefined;
|
|
301
300
|
/**
|
|
302
301
|
* The flex direction on sm (480px) or larger viewports.
|
|
303
302
|
*/
|
|
304
|
-
smDirection?: Direction;
|
|
303
|
+
smDirection?: Direction | undefined;
|
|
305
304
|
/**
|
|
306
305
|
* The display style on sm (480px) or larger viewports.
|
|
307
306
|
*/
|
|
308
|
-
smDisplay?: Display;
|
|
307
|
+
smDisplay?: Display | undefined;
|
|
309
308
|
/**
|
|
310
309
|
* The alignment of the box on the main axis on sm (480px) or larger viewports.
|
|
311
310
|
*/
|
|
312
|
-
smJustifyContent?: JustifyContent;
|
|
311
|
+
smJustifyContent?: JustifyContent | undefined;
|
|
313
312
|
/**
|
|
314
313
|
* Margin on sm (480px) or larger viewports.
|
|
315
314
|
*/
|
|
316
|
-
smMargin?: Margin;
|
|
315
|
+
smMargin?: Margin | undefined;
|
|
317
316
|
/**
|
|
318
317
|
* Bottom margin on sm (480px) or larger viewports.
|
|
319
318
|
*/
|
|
320
|
-
smMarginBottom?: Margin;
|
|
319
|
+
smMarginBottom?: Margin | undefined;
|
|
321
320
|
/**
|
|
322
321
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages on sm (480px) or larger viewports.
|
|
323
322
|
*/
|
|
324
|
-
smMarginEnd?: Margin;
|
|
323
|
+
smMarginEnd?: Margin | undefined;
|
|
325
324
|
/**
|
|
326
325
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages on sm (480px) or larger viewports.
|
|
327
326
|
*/
|
|
328
|
-
smMarginStart?: Margin;
|
|
327
|
+
smMarginStart?: Margin | undefined;
|
|
329
328
|
/**
|
|
330
329
|
* Top margin on sm (480px) or larger viewports.
|
|
331
330
|
*/
|
|
332
|
-
smMarginTop?: Margin;
|
|
331
|
+
smMarginTop?: Margin | undefined;
|
|
333
332
|
/**
|
|
334
333
|
* The padding of the box on sm (480px) or larger viewports.
|
|
335
334
|
*/
|
|
336
|
-
smPadding?: Padding;
|
|
335
|
+
smPadding?: Padding | undefined;
|
|
337
336
|
/**
|
|
338
337
|
* The padding of the box on the x-axis on sm (480px) or larger viewports.
|
|
339
338
|
*/
|
|
340
|
-
smPaddingX?: Padding;
|
|
339
|
+
smPaddingX?: Padding | undefined;
|
|
341
340
|
/**
|
|
342
341
|
* The padding of the box on the y-axis on sm (480px) or larger viewports.
|
|
343
342
|
*/
|
|
344
|
-
smPaddingY?: Padding;
|
|
343
|
+
smPaddingY?: Padding | undefined;
|
|
345
344
|
/**
|
|
346
345
|
* The width of the box.
|
|
347
346
|
*/
|
|
348
|
-
width?: Dimension;
|
|
349
|
-
}
|
|
347
|
+
width?: Dimension | undefined;
|
|
348
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
350
349
|
|
|
351
350
|
/**
|
|
352
351
|
* Button is a clickable element that is used to perform an action.
|
|
@@ -365,7 +364,7 @@ declare const Button: ({ text, loadingText, color, size, accessibilityLabel, dis
|
|
|
365
364
|
*
|
|
366
365
|
* @defaultValue "primary"
|
|
367
366
|
*/
|
|
368
|
-
color?: "
|
|
367
|
+
color?: "gray200" | "gray700" | "gray800" | "gray900" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
|
|
369
368
|
/**
|
|
370
369
|
* The size of the button
|
|
371
370
|
*
|
|
@@ -401,19 +400,19 @@ declare const Button: ({ text, loadingText, color, size, accessibilityLabel, dis
|
|
|
401
400
|
/**
|
|
402
401
|
* The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
403
402
|
*/
|
|
404
|
-
startIcon?:
|
|
403
|
+
startIcon?: React__default.ComponentType<{
|
|
405
404
|
className: string;
|
|
406
405
|
}> | undefined;
|
|
407
406
|
/**
|
|
408
407
|
* The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
409
408
|
*/
|
|
410
|
-
endIcon?:
|
|
409
|
+
endIcon?: React__default.ComponentType<{
|
|
411
410
|
className: string;
|
|
412
411
|
}> | undefined;
|
|
413
412
|
/**
|
|
414
413
|
* The callback to be called when the button is clicked
|
|
415
414
|
*/
|
|
416
|
-
onClick:
|
|
415
|
+
onClick: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
417
416
|
/**
|
|
418
417
|
* The tooltip to be displayed when the user hovers over the button
|
|
419
418
|
*/
|
|
@@ -475,7 +474,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
475
474
|
*
|
|
476
475
|
* @defaultValue "start"
|
|
477
476
|
*/
|
|
478
|
-
align?: "
|
|
477
|
+
align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
|
|
479
478
|
/**
|
|
480
479
|
* DOM element to render as.
|
|
481
480
|
*
|
|
@@ -491,7 +490,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
491
490
|
*
|
|
492
491
|
* @defaultValue "gray900"
|
|
493
492
|
*/
|
|
494
|
-
color?: "
|
|
493
|
+
color?: "gray200" | "gray700" | "gray800" | "gray900" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
|
|
495
494
|
/**
|
|
496
495
|
* Size of the text.
|
|
497
496
|
*
|
|
@@ -514,7 +513,7 @@ declare const IconButton: ({ accessibilityLabel, color, disabled, icon: Icon, si
|
|
|
514
513
|
*
|
|
515
514
|
* @defaultValue "primary"
|
|
516
515
|
*/
|
|
517
|
-
color?: "
|
|
516
|
+
color?: "gray200" | "gray700" | "gray800" | "gray900" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
|
|
518
517
|
/**
|
|
519
518
|
* The size of the button
|
|
520
519
|
*
|
|
@@ -532,7 +531,7 @@ declare const IconButton: ({ accessibilityLabel, color, disabled, icon: Icon, si
|
|
|
532
531
|
/**
|
|
533
532
|
* The icon to be displayed. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round)
|
|
534
533
|
*/
|
|
535
|
-
icon:
|
|
534
|
+
icon: React__default.ComponentType<{
|
|
536
535
|
className: string;
|
|
537
536
|
}>;
|
|
538
537
|
/**
|
|
@@ -544,7 +543,7 @@ declare const IconButton: ({ accessibilityLabel, color, disabled, icon: Icon, si
|
|
|
544
543
|
/**
|
|
545
544
|
* The callback to be called when the button is clicked
|
|
546
545
|
*/
|
|
547
|
-
onClick:
|
|
546
|
+
onClick: React__default.MouseEventHandler<HTMLButtonElement>;
|
|
548
547
|
/**
|
|
549
548
|
* The tooltip to be displayed when the user hovers over the button
|
|
550
549
|
*/
|
|
@@ -564,7 +563,7 @@ declare const Checkbox: ({ checked, disabled, size, label, error, onChange, }: {
|
|
|
564
563
|
/**
|
|
565
564
|
* The callback to be called when the checkbox value changes
|
|
566
565
|
*/
|
|
567
|
-
onChange:
|
|
566
|
+
onChange: React__default.ChangeEventHandler<HTMLInputElement>;
|
|
568
567
|
/**
|
|
569
568
|
* Whether or not the box is disabled
|
|
570
569
|
*
|
|
@@ -635,7 +634,7 @@ declare const RadioButton: ({ checked, disabled, error, label, name, onChange, s
|
|
|
635
634
|
/**
|
|
636
635
|
* The callback to be called when the radio button is clicked
|
|
637
636
|
*/
|
|
638
|
-
onChange:
|
|
637
|
+
onChange: React__default.ChangeEventHandler<HTMLInputElement>;
|
|
639
638
|
/**
|
|
640
639
|
* Size of the components
|
|
641
640
|
*
|
|
@@ -678,7 +677,7 @@ declare const SelectList: {
|
|
|
678
677
|
/**
|
|
679
678
|
* The callback to be called when an option is selected
|
|
680
679
|
*/
|
|
681
|
-
onChange:
|
|
680
|
+
onChange: React__default.ChangeEventHandler<HTMLSelectElement>;
|
|
682
681
|
/**
|
|
683
682
|
* Text showing in select box if no option has been chosen.
|
|
684
683
|
* We should always have a placeholder unless there is a default option selected
|
|
@@ -702,7 +701,7 @@ declare const SelectList: {
|
|
|
702
701
|
value: string;
|
|
703
702
|
label: string;
|
|
704
703
|
disabled?: boolean | undefined;
|
|
705
|
-
}) =>
|
|
704
|
+
}) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>>;
|
|
706
705
|
};
|
|
707
706
|
|
|
708
707
|
/**
|
|
@@ -716,13 +715,13 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
716
715
|
*
|
|
717
716
|
* @defaultValue "start"
|
|
718
717
|
*/
|
|
719
|
-
align?: "
|
|
718
|
+
align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
|
|
720
719
|
/**
|
|
721
720
|
* DOM element to render as.
|
|
722
721
|
*
|
|
723
722
|
* @defaultValue "div"
|
|
724
723
|
*/
|
|
725
|
-
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" |
|
|
724
|
+
as?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
726
725
|
/**
|
|
727
726
|
* The text to be rendered
|
|
728
727
|
*/
|
|
@@ -732,7 +731,7 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
732
731
|
*
|
|
733
732
|
* @defaultValue "gray900"
|
|
734
733
|
*/
|
|
735
|
-
color?: "
|
|
734
|
+
color?: "gray200" | "gray700" | "gray800" | "gray900" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
|
|
736
735
|
/**
|
|
737
736
|
* Whether the text should flow inline with other elements.
|
|
738
737
|
*
|
|
@@ -781,4 +780,4 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
781
780
|
weight?: "regular" | "semiBold" | "bold" | "heavy" | undefined;
|
|
782
781
|
}) => ReactElement;
|
|
783
782
|
|
|
784
|
-
export { Avatar, Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, RadioButton, SelectList, Typography };
|
|
783
|
+
export { Avatar, _default as Box, Button, ButtonGroup, Card, Checkbox, Divider, Heading, IconButton, MiniActionCard, RadioButton, SelectList, Typography };
|
package/dist/index.js
CHANGED
|
@@ -114,7 +114,7 @@ var require_classnames = __commonJS({
|
|
|
114
114
|
var src_exports = {};
|
|
115
115
|
__export(src_exports, {
|
|
116
116
|
Avatar: () => Avatar_default,
|
|
117
|
-
Box: () =>
|
|
117
|
+
Box: () => Box_default,
|
|
118
118
|
Button: () => Button_default,
|
|
119
119
|
ButtonGroup: () => ButtonGroup_default,
|
|
120
120
|
Card: () => Card_default,
|
|
@@ -169,8 +169,9 @@ var padding_module_default = { "paddingX0": "_paddingX0_1aqye_2", "paddingX1": "
|
|
|
169
169
|
var colors_module_default = { "inheritColor": "_inheritColor_11wj3_2", "destructive700Color": "_destructive700Color_11wj3_6", "gray700Color": "_gray700Color_11wj3_10", "gray900Color": "_gray900Color_11wj3_14", "primary700Color": "_primary700Color_11wj3_18", "whiteColor": "_whiteColor_11wj3_22", "blackBackgroundColor": "_blackBackgroundColor_11wj3_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_11wj3_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_11wj3_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_11wj3_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_11wj3_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_11wj3_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_11wj3_51", "gray10BackgroundColor": "_gray10BackgroundColor_11wj3_55", "gray30BackgroundColor": "_gray30BackgroundColor_11wj3_59", "gray60BackgroundColor": "_gray60BackgroundColor_11wj3_63", "gray80BackgroundColor": "_gray80BackgroundColor_11wj3_67", "gray100BackgroundColor": "_gray100BackgroundColor_11wj3_71", "gray200BackgroundColor": "_gray200BackgroundColor_11wj3_75", "gray300BackgroundColor": "_gray300BackgroundColor_11wj3_79", "gray700BackgroundColor": "_gray700BackgroundColor_11wj3_83", "gray800BackgroundColor": "_gray800BackgroundColor_11wj3_87", "gray900BackgroundColor": "_gray900BackgroundColor_11wj3_91", "orange100BackgroundColor": "_orange100BackgroundColor_11wj3_95", "orange200BackgroundColor": "_orange200BackgroundColor_11wj3_99", "orange300BackgroundColor": "_orange300BackgroundColor_11wj3_103", "orange700BackgroundColor": "_orange700BackgroundColor_11wj3_107", "orange800BackgroundColor": "_orange800BackgroundColor_11wj3_111", "orange900BackgroundColor": "_orange900BackgroundColor_11wj3_115", "primary100BackgroundColor": "_primary100BackgroundColor_11wj3_119", "primary200BackgroundColor": "_primary200BackgroundColor_11wj3_123", "primary300BackgroundColor": "_primary300BackgroundColor_11wj3_127", "primary700BackgroundColor": "_primary700BackgroundColor_11wj3_131", "primary800BackgroundColor": "_primary800BackgroundColor_11wj3_135", "primary900BackgroundColor": "_primary900BackgroundColor_11wj3_139", "success100BackgroundColor": "_success100BackgroundColor_11wj3_143", "success200BackgroundColor": "_success200BackgroundColor_11wj3_147", "success300BackgroundColor": "_success300BackgroundColor_11wj3_151", "success700BackgroundColor": "_success700BackgroundColor_11wj3_155", "success800BackgroundColor": "_success800BackgroundColor_11wj3_159", "success900BackgroundColor": "_success900BackgroundColor_11wj3_163", "purple100BackgroundColor": "_purple100BackgroundColor_11wj3_167", "purple200BackgroundColor": "_purple200BackgroundColor_11wj3_171", "purple300BackgroundColor": "_purple300BackgroundColor_11wj3_175", "purple700BackgroundColor": "_purple700BackgroundColor_11wj3_179", "purple800BackgroundColor": "_purple800BackgroundColor_11wj3_183", "purple900BackgroundColor": "_purple900BackgroundColor_11wj3_187", "whiteBackgroundColor": "_whiteBackgroundColor_11wj3_191", "yellow100BackgroundColor": "_yellow100BackgroundColor_11wj3_195", "yellow200BackgroundColor": "_yellow200BackgroundColor_11wj3_199", "yellow300BackgroundColor": "_yellow300BackgroundColor_11wj3_203", "yellow700BackgroundColor": "_yellow700BackgroundColor_11wj3_207", "yellow800BackgroundColor": "_yellow800BackgroundColor_11wj3_211", "yellow900BackgroundColor": "_yellow900BackgroundColor_11wj3_215" };
|
|
170
170
|
|
|
171
171
|
// src/Box/Box.tsx
|
|
172
|
+
var import_react = require("react");
|
|
172
173
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
173
|
-
function Box(props) {
|
|
174
|
+
var Box_default = (0, import_react.forwardRef)(function Box(props, ref) {
|
|
174
175
|
var _c;
|
|
175
176
|
const _a = props, { as: BoxElement = "div", children } = _a, boxProps = __objRest(_a, ["as", "children"]);
|
|
176
177
|
const _b = boxProps, {
|
|
@@ -354,8 +355,8 @@ function Box(props) {
|
|
|
354
355
|
}
|
|
355
356
|
return acc;
|
|
356
357
|
}, {});
|
|
357
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxElement, __spreadProps(__spreadValues(__spreadValues({}, parsedProps), passthroughProps), { children }));
|
|
358
|
-
}
|
|
358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BoxElement, __spreadProps(__spreadValues(__spreadValues({}, parsedProps), passthroughProps), { ref, children }));
|
|
359
|
+
});
|
|
359
360
|
|
|
360
361
|
// src/Button/Button.tsx
|
|
361
362
|
var import_classnames3 = __toESM(require_classnames());
|
|
@@ -648,11 +649,11 @@ var IconButton = ({
|
|
|
648
649
|
var IconButton_default = IconButton;
|
|
649
650
|
|
|
650
651
|
// src/Checkbox/Checkbox.tsx
|
|
651
|
-
var
|
|
652
|
+
var import_react3 = require("react");
|
|
652
653
|
var import_classnames7 = __toESM(require_classnames());
|
|
653
654
|
|
|
654
655
|
// src/useFocusVisible.tsx
|
|
655
|
-
var
|
|
656
|
+
var import_react2 = require("react");
|
|
656
657
|
var hasSetupGlobalListeners = false;
|
|
657
658
|
var currentModality = null;
|
|
658
659
|
var changeHandlers = /* @__PURE__ */ new Set();
|
|
@@ -728,8 +729,8 @@ function setupGlobalFocusEvents() {
|
|
|
728
729
|
}
|
|
729
730
|
function useFocusVisible() {
|
|
730
731
|
setupGlobalFocusEvents();
|
|
731
|
-
const [isFocusVisibleState, setFocusVisible] = (0,
|
|
732
|
-
(0,
|
|
732
|
+
const [isFocusVisibleState, setFocusVisible] = (0, import_react2.useState)(isFocusVisible());
|
|
733
|
+
(0, import_react2.useEffect)(() => {
|
|
733
734
|
const handler = () => {
|
|
734
735
|
setFocusVisible(isFocusVisible());
|
|
735
736
|
};
|
|
@@ -765,7 +766,7 @@ var Checkbox = ({
|
|
|
765
766
|
error = false,
|
|
766
767
|
onChange
|
|
767
768
|
}) => {
|
|
768
|
-
const [isFocused, setIsFocused] = (0,
|
|
769
|
+
const [isFocused, setIsFocused] = (0, import_react3.useState)(false);
|
|
769
770
|
const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
|
|
770
771
|
const checkboxStyling = (0, import_classnames7.default)(Checkbox_module_default.checkbox, Checkbox_module_default[size]);
|
|
771
772
|
const uncheckedStyling = (0, import_classnames7.default)(checkboxStyling, Checkbox_module_default.uncheckedBox, {
|
|
@@ -827,7 +828,7 @@ var MiniActionCard = ({
|
|
|
827
828
|
var MiniActionCard_default = MiniActionCard;
|
|
828
829
|
|
|
829
830
|
// src/RadioButton/RadioButton.tsx
|
|
830
|
-
var
|
|
831
|
+
var import_react4 = require("react");
|
|
831
832
|
var import_classnames8 = __toESM(require_classnames());
|
|
832
833
|
|
|
833
834
|
// css-module:./RadioButton.module.css#css-module
|
|
@@ -845,7 +846,7 @@ var RadioButton = ({
|
|
|
845
846
|
size = "md",
|
|
846
847
|
value
|
|
847
848
|
}) => {
|
|
848
|
-
const [isFocused, setIsFocused] = (0,
|
|
849
|
+
const [isFocused, setIsFocused] = (0, import_react4.useState)(false);
|
|
849
850
|
const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
|
|
850
851
|
const sharedStyles = (0, import_classnames8.default)(RadioButton_module_default.background, RadioButton_module_default[size], {
|
|
851
852
|
[RadioButton_module_default.errorBorderColor]: error,
|
|
@@ -905,7 +906,7 @@ var RadioButton = ({
|
|
|
905
906
|
var RadioButton_default = RadioButton;
|
|
906
907
|
|
|
907
908
|
// src/SelectList/SelectList.tsx
|
|
908
|
-
var
|
|
909
|
+
var import_react5 = require("react");
|
|
909
910
|
var import_classnames9 = __toESM(require_classnames());
|
|
910
911
|
|
|
911
912
|
// ../syntax-design-tokens/dist/js/index.js
|
|
@@ -950,9 +951,9 @@ var SelectList = ({
|
|
|
950
951
|
selectedValue = "",
|
|
951
952
|
size = "md"
|
|
952
953
|
}) => {
|
|
953
|
-
const id = (0,
|
|
954
|
+
const id = (0, import_react5.useId)();
|
|
954
955
|
const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
|
|
955
|
-
const [isFocused, setIsFocused] = (0,
|
|
956
|
+
const [isFocused, setIsFocused] = (0, import_react5.useState)(false);
|
|
956
957
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
957
958
|
"div",
|
|
958
959
|
{
|