@cambly/syntax-core 7.1.0 → 7.3.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 +119 -109
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ declare const Badge: ({ icon: Icon, text, color, }: {
|
|
|
49
49
|
color?: "gray200" | "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | undefined;
|
|
50
50
|
}) => JSX.Element;
|
|
51
51
|
|
|
52
|
+
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"];
|
|
53
|
+
|
|
52
54
|
type AlignItems = "baseline" | "center" | "end" | "start" | "stretch";
|
|
53
55
|
type As = "article" | "aside" | "caption" | "div" | "figcaption" | "figure" | "footer" | "header" | "main" | "nav" | "section" | "summary";
|
|
54
56
|
type Dimension = number | string;
|
|
@@ -58,14 +60,7 @@ type Gap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
|
58
60
|
type JustifyContent = "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
59
61
|
type Margin = -12 | -11 | -10 | -9 | -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "auto";
|
|
60
62
|
type Padding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
61
|
-
|
|
62
|
-
* [Box](https://cambly-syntax.vercel.app/?path=/docs/components-box--docs) is primitive design component and is used by lots of other components. It keeps details like spacing, borders and colors consistent across all of Syntax.
|
|
63
|
-
*
|
|
64
|
-
* Passthrough props:
|
|
65
|
-
* * `aria-*`
|
|
66
|
-
* * `data-testid`
|
|
67
|
-
*/
|
|
68
|
-
declare const Box: React$1.ForwardRefExoticComponent<{
|
|
63
|
+
type BoxProps = {
|
|
69
64
|
/**
|
|
70
65
|
* The alignment of the box on the cross axis.
|
|
71
66
|
*
|
|
@@ -73,21 +68,21 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
73
68
|
* * `smAlignItems`
|
|
74
69
|
* * `lgAlignItems`
|
|
75
70
|
*/
|
|
76
|
-
alignItems?: AlignItems
|
|
71
|
+
alignItems?: AlignItems;
|
|
77
72
|
/**
|
|
78
73
|
* Allows the default alignment (or the one specified by align-items) to be overridden for individual flex items.
|
|
79
74
|
*/
|
|
80
|
-
alignSelf?: "
|
|
75
|
+
alignSelf?: "auto" | "start" | "end" | "center" | "baseline" | "stretch";
|
|
81
76
|
/**
|
|
82
77
|
* The underlying DOM element usually set for accessibility or SEO reasons.
|
|
83
78
|
*
|
|
84
79
|
* @defaultValue "div"
|
|
85
80
|
*/
|
|
86
|
-
as?: As
|
|
81
|
+
as?: As;
|
|
87
82
|
/**
|
|
88
83
|
* The background color of the box.
|
|
89
84
|
*/
|
|
90
|
-
backgroundColor?:
|
|
85
|
+
backgroundColor?: (typeof colors)[number];
|
|
91
86
|
/**
|
|
92
87
|
* The children to be rendered inside the box.
|
|
93
88
|
*/
|
|
@@ -99,7 +94,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
99
94
|
*/
|
|
100
95
|
dangerouslySetInlineStyle?: {
|
|
101
96
|
__style: Record<string, string | number | null>;
|
|
102
|
-
}
|
|
97
|
+
};
|
|
103
98
|
/**
|
|
104
99
|
* The flex direction of the box.
|
|
105
100
|
*
|
|
@@ -109,7 +104,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
109
104
|
*
|
|
110
105
|
* @defaultValue `row`
|
|
111
106
|
*/
|
|
112
|
-
direction?: Direction
|
|
107
|
+
direction?: Direction;
|
|
113
108
|
/**
|
|
114
109
|
* The display property specifies the display behavior (the type of rendering box) of an element.
|
|
115
110
|
*
|
|
@@ -119,7 +114,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
119
114
|
*
|
|
120
115
|
* @defaultValue `block`
|
|
121
116
|
*/
|
|
122
|
-
display?: Display
|
|
117
|
+
display?: Display;
|
|
123
118
|
/**
|
|
124
119
|
* Sets the flex behavior of a flex item.
|
|
125
120
|
*
|
|
@@ -129,69 +124,69 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
129
124
|
*
|
|
130
125
|
* @defaultValue `shrink`
|
|
131
126
|
*/
|
|
132
|
-
flex?: "none" | "shrink" | "grow"
|
|
127
|
+
flex?: "none" | "shrink" | "grow";
|
|
133
128
|
/**
|
|
134
129
|
* 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.
|
|
135
130
|
*
|
|
136
131
|
* @defaultValue `nowrap`
|
|
137
132
|
*/
|
|
138
|
-
flexWrap?: "wrap" | "nowrap"
|
|
133
|
+
flexWrap?: "wrap" | "nowrap";
|
|
139
134
|
/**
|
|
140
135
|
* The gap between the children of the box.
|
|
141
136
|
*/
|
|
142
|
-
gap?: Gap
|
|
137
|
+
gap?: Gap;
|
|
143
138
|
/**
|
|
144
139
|
* The id of the element.
|
|
145
140
|
*/
|
|
146
|
-
id?: string
|
|
141
|
+
id?: string;
|
|
147
142
|
/**
|
|
148
143
|
* The alignment of the box on the cross axis on lg (960px) or larger viewports.
|
|
149
144
|
*/
|
|
150
|
-
lgAlignItems?: AlignItems
|
|
145
|
+
lgAlignItems?: AlignItems;
|
|
151
146
|
/**
|
|
152
147
|
* The flex direction on lg (960px) or larger viewports.
|
|
153
148
|
*/
|
|
154
|
-
lgDirection?: Direction
|
|
149
|
+
lgDirection?: Direction;
|
|
155
150
|
/**
|
|
156
151
|
* The display style on lg (960px) or larger viewports.
|
|
157
152
|
*/
|
|
158
|
-
lgDisplay?: Display
|
|
153
|
+
lgDisplay?: Display;
|
|
159
154
|
/**
|
|
160
155
|
* The alignment of the box on the cross axis on lg (960px) or larger viewports.
|
|
161
156
|
*/
|
|
162
|
-
lgJustifyContent?: JustifyContent
|
|
157
|
+
lgJustifyContent?: JustifyContent;
|
|
163
158
|
/**
|
|
164
159
|
* Margin on lg (960px) or larger viewports.
|
|
165
160
|
*/
|
|
166
|
-
lgMargin?: Margin
|
|
161
|
+
lgMargin?: Margin;
|
|
167
162
|
/**
|
|
168
163
|
* Bottom margin on lg (960px) or larger viewports.
|
|
169
164
|
*/
|
|
170
|
-
lgMarginBottom?: Margin
|
|
165
|
+
lgMarginBottom?: Margin;
|
|
171
166
|
/**
|
|
172
167
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages on lg (960px) or larger viewports.
|
|
173
168
|
*/
|
|
174
|
-
lgMarginEnd?: Margin
|
|
169
|
+
lgMarginEnd?: Margin;
|
|
175
170
|
/**
|
|
176
171
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages on lg (960px) or larger viewports.
|
|
177
172
|
*/
|
|
178
|
-
lgMarginStart?: Margin
|
|
173
|
+
lgMarginStart?: Margin;
|
|
179
174
|
/**
|
|
180
175
|
* Top margin on lg (960px) or larger viewports.
|
|
181
176
|
*/
|
|
182
|
-
lgMarginTop?: Margin
|
|
177
|
+
lgMarginTop?: Margin;
|
|
183
178
|
/**
|
|
184
179
|
* The padding of the box on lg (960px) or larger viewports.
|
|
185
180
|
*/
|
|
186
|
-
lgPadding?: Padding
|
|
181
|
+
lgPadding?: Padding;
|
|
187
182
|
/**
|
|
188
183
|
* The padding of the box on the x-axis on lg (960px) or larger viewports.
|
|
189
184
|
*/
|
|
190
|
-
lgPaddingX?: Padding
|
|
185
|
+
lgPaddingX?: Padding;
|
|
191
186
|
/**
|
|
192
187
|
* The padding of the box on the y-axis on lg (960px) or larger viewports.
|
|
193
188
|
*/
|
|
194
|
-
lgPaddingY?: Padding
|
|
189
|
+
lgPaddingY?: Padding;
|
|
195
190
|
/**
|
|
196
191
|
* The margin of the box.
|
|
197
192
|
*
|
|
@@ -201,7 +196,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
201
196
|
*
|
|
202
197
|
* @defaultValue 0
|
|
203
198
|
*/
|
|
204
|
-
margin?: Margin
|
|
199
|
+
margin?: Margin;
|
|
205
200
|
/**
|
|
206
201
|
* Bottom margin of the box.
|
|
207
202
|
*
|
|
@@ -210,7 +205,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
210
205
|
* * `lgMarginBottom`
|
|
211
206
|
*
|
|
212
207
|
*/
|
|
213
|
-
marginBottom?: Margin
|
|
208
|
+
marginBottom?: Margin;
|
|
214
209
|
/**
|
|
215
210
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages.
|
|
216
211
|
*
|
|
@@ -219,7 +214,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
219
214
|
* * `lgMarginEnd`
|
|
220
215
|
*
|
|
221
216
|
*/
|
|
222
|
-
marginEnd?: Margin
|
|
217
|
+
marginEnd?: Margin;
|
|
223
218
|
/**
|
|
224
219
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages.
|
|
225
220
|
*
|
|
@@ -228,7 +223,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
228
223
|
* * `lgMarginStart`
|
|
229
224
|
*
|
|
230
225
|
*/
|
|
231
|
-
marginStart?: Margin
|
|
226
|
+
marginStart?: Margin;
|
|
232
227
|
/**
|
|
233
228
|
* Top margin of the box.
|
|
234
229
|
*
|
|
@@ -237,27 +232,27 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
237
232
|
* * `lgMarginTop`
|
|
238
233
|
*
|
|
239
234
|
*/
|
|
240
|
-
marginTop?: Margin
|
|
235
|
+
marginTop?: Margin;
|
|
241
236
|
/**
|
|
242
237
|
* The maximum height of the box.
|
|
243
238
|
*/
|
|
244
|
-
maxHeight?: Dimension
|
|
239
|
+
maxHeight?: Dimension;
|
|
245
240
|
/**
|
|
246
241
|
* The maximum width of the box.
|
|
247
242
|
*/
|
|
248
|
-
maxWidth?: Dimension
|
|
243
|
+
maxWidth?: Dimension;
|
|
249
244
|
/**
|
|
250
245
|
* The minimum height of the box.
|
|
251
246
|
*/
|
|
252
|
-
minHeight?: Dimension
|
|
247
|
+
minHeight?: Dimension;
|
|
253
248
|
/**
|
|
254
249
|
* The minimum width of the box.
|
|
255
250
|
*/
|
|
256
|
-
minWidth?: Dimension
|
|
251
|
+
minWidth?: Dimension;
|
|
257
252
|
/**
|
|
258
253
|
* The height of the box.
|
|
259
254
|
*/
|
|
260
|
-
height?: Dimension
|
|
255
|
+
height?: Dimension;
|
|
261
256
|
/**
|
|
262
257
|
* The alignment of the box on the main axis.
|
|
263
258
|
*
|
|
@@ -267,7 +262,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
267
262
|
*
|
|
268
263
|
* @defaultValue "start"
|
|
269
264
|
*/
|
|
270
|
-
justifyContent?: JustifyContent
|
|
265
|
+
justifyContent?: JustifyContent;
|
|
271
266
|
/**
|
|
272
267
|
* The padding of the box.
|
|
273
268
|
*
|
|
@@ -277,7 +272,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
277
272
|
*
|
|
278
273
|
* @defaultValue 0
|
|
279
274
|
*/
|
|
280
|
-
padding?: Padding
|
|
275
|
+
padding?: Padding;
|
|
281
276
|
/**
|
|
282
277
|
* The padding of the box on the x-axis.
|
|
283
278
|
*
|
|
@@ -286,7 +281,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
286
281
|
* * `lgPaddingX`
|
|
287
282
|
*
|
|
288
283
|
*/
|
|
289
|
-
paddingX?: Padding
|
|
284
|
+
paddingX?: Padding;
|
|
290
285
|
/**
|
|
291
286
|
* The padding of the box on the y-axis.
|
|
292
287
|
*
|
|
@@ -294,19 +289,19 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
294
289
|
* * `smPaddingY`
|
|
295
290
|
* * `lgPaddingY`
|
|
296
291
|
*/
|
|
297
|
-
paddingY?: Padding
|
|
292
|
+
paddingY?: Padding;
|
|
298
293
|
/**
|
|
299
294
|
* The position of the box.
|
|
300
295
|
*
|
|
301
296
|
* @defaultValue "static"
|
|
302
297
|
*/
|
|
303
|
-
position?: "absolute" | "fixed" | "relative" | "static" | "sticky"
|
|
298
|
+
position?: "absolute" | "fixed" | "relative" | "static" | "sticky";
|
|
304
299
|
/**
|
|
305
300
|
* The role attribute of the box.
|
|
306
301
|
*
|
|
307
302
|
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles) for the list of valid roles.
|
|
308
303
|
*/
|
|
309
|
-
role?: AriaRole
|
|
304
|
+
role?: AriaRole;
|
|
310
305
|
/**
|
|
311
306
|
* Border radius of the box.
|
|
312
307
|
*
|
|
@@ -319,65 +314,73 @@ declare const Box: React$1.ForwardRefExoticComponent<{
|
|
|
319
314
|
*
|
|
320
315
|
* @defaultValue "none"
|
|
321
316
|
*/
|
|
322
|
-
rounding?: "
|
|
317
|
+
rounding?: "xl" | "lg" | "md" | "sm" | "full" | "none";
|
|
323
318
|
/**
|
|
324
319
|
* The alignment of the box on the cross axis on sm (480px) or larger viewports.
|
|
325
320
|
*/
|
|
326
|
-
smAlignItems?: AlignItems
|
|
321
|
+
smAlignItems?: AlignItems;
|
|
327
322
|
/**
|
|
328
323
|
* The flex direction on sm (480px) or larger viewports.
|
|
329
324
|
*/
|
|
330
|
-
smDirection?: Direction
|
|
325
|
+
smDirection?: Direction;
|
|
331
326
|
/**
|
|
332
327
|
* The display style on sm (480px) or larger viewports.
|
|
333
328
|
*/
|
|
334
|
-
smDisplay?: Display
|
|
329
|
+
smDisplay?: Display;
|
|
335
330
|
/**
|
|
336
331
|
* The alignment of the box on the main axis on sm (480px) or larger viewports.
|
|
337
332
|
*/
|
|
338
|
-
smJustifyContent?: JustifyContent
|
|
333
|
+
smJustifyContent?: JustifyContent;
|
|
339
334
|
/**
|
|
340
335
|
* Margin on sm (480px) or larger viewports.
|
|
341
336
|
*/
|
|
342
|
-
smMargin?: Margin
|
|
337
|
+
smMargin?: Margin;
|
|
343
338
|
/**
|
|
344
339
|
* Bottom margin on sm (480px) or larger viewports.
|
|
345
340
|
*/
|
|
346
|
-
smMarginBottom?: Margin
|
|
341
|
+
smMarginBottom?: Margin;
|
|
347
342
|
/**
|
|
348
343
|
* Margin to the right in left-to-right languages, and to the left in right-to-left languages on sm (480px) or larger viewports.
|
|
349
344
|
*/
|
|
350
|
-
smMarginEnd?: Margin
|
|
345
|
+
smMarginEnd?: Margin;
|
|
351
346
|
/**
|
|
352
347
|
* Margin to the left in left-to-right languages, and to the right in right-to-left languages on sm (480px) or larger viewports.
|
|
353
348
|
*/
|
|
354
|
-
smMarginStart?: Margin
|
|
349
|
+
smMarginStart?: Margin;
|
|
355
350
|
/**
|
|
356
351
|
* Top margin on sm (480px) or larger viewports.
|
|
357
352
|
*/
|
|
358
|
-
smMarginTop?: Margin
|
|
353
|
+
smMarginTop?: Margin;
|
|
359
354
|
/**
|
|
360
355
|
* The padding of the box on sm (480px) or larger viewports.
|
|
361
356
|
*/
|
|
362
|
-
smPadding?: Padding
|
|
357
|
+
smPadding?: Padding;
|
|
363
358
|
/**
|
|
364
359
|
* The padding of the box on the x-axis on sm (480px) or larger viewports.
|
|
365
360
|
*/
|
|
366
|
-
smPaddingX?: Padding
|
|
361
|
+
smPaddingX?: Padding;
|
|
367
362
|
/**
|
|
368
363
|
* The padding of the box on the y-axis on sm (480px) or larger viewports.
|
|
369
364
|
*/
|
|
370
|
-
smPaddingY?: Padding
|
|
365
|
+
smPaddingY?: Padding;
|
|
371
366
|
/**
|
|
372
367
|
* The width of the box.
|
|
373
368
|
*/
|
|
374
|
-
width?: Dimension
|
|
375
|
-
}
|
|
369
|
+
width?: Dimension;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* [Box](https://cambly-syntax.vercel.app/?path=/docs/components-box--docs) is primitive design component and is used by lots of other components. It keeps details like spacing, borders and colors consistent across all of Syntax.
|
|
373
|
+
*
|
|
374
|
+
* Passthrough props:
|
|
375
|
+
* * `aria-*`
|
|
376
|
+
* * `data-testid`
|
|
377
|
+
*/
|
|
378
|
+
declare const Box: React$1.ForwardRefExoticComponent<BoxProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
376
379
|
|
|
377
380
|
declare const Color: readonly ["primary", "secondary", "tertiary", "branded", "destructive-primary", "destructive-secondary", "destructive-tertiary", "success", "gray200", "gray700", "gray800", "gray900", "white", "inherit"];
|
|
378
381
|
declare const Size: readonly ["sm", "md", "lg"];
|
|
379
382
|
|
|
380
|
-
type
|
|
383
|
+
type ButtonProps = {
|
|
381
384
|
/**
|
|
382
385
|
* Test id for the button
|
|
383
386
|
*/
|
|
@@ -456,7 +459,7 @@ type ButtonType = {
|
|
|
456
459
|
/**
|
|
457
460
|
* [Button](https://cambly-syntax.vercel.app/?path=/docs/components-button--docs) is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
|
|
458
461
|
*/
|
|
459
|
-
declare const Button: React__default.ForwardRefExoticComponent<
|
|
462
|
+
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
460
463
|
|
|
461
464
|
/**
|
|
462
465
|
* [ButtonGroup](https://cambly-syntax.vercel.app/?path=/docs/components-buttongroup--docs) groups buttons in a row or column with consistent spacing between each button.
|
|
@@ -565,7 +568,7 @@ declare namespace Divider {
|
|
|
565
568
|
/**
|
|
566
569
|
* [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.
|
|
567
570
|
*/
|
|
568
|
-
declare const Heading: ({ align, as, children, color, size, }: {
|
|
571
|
+
declare const Heading: ({ align, as, children, color, "data-testid": dataTestId, size, }: {
|
|
569
572
|
/**
|
|
570
573
|
* Aligns the text to the left, right, or center of the container.
|
|
571
574
|
* * `start` and `end` will align the text to the left or right of the container depending on the locale.
|
|
@@ -573,7 +576,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
573
576
|
*
|
|
574
577
|
* @defaultValue "start"
|
|
575
578
|
*/
|
|
576
|
-
align?: "
|
|
579
|
+
align?: "start" | "end" | "forceLeft" | "center" | "forceRight" | undefined;
|
|
577
580
|
/**
|
|
578
581
|
* DOM element to render as.
|
|
579
582
|
*
|
|
@@ -589,7 +592,11 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
589
592
|
*
|
|
590
593
|
* @defaultValue "gray900"
|
|
591
594
|
*/
|
|
592
|
-
color?: "gray200" | "gray900" | "
|
|
595
|
+
color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "gray700" | "gray800" | "white" | "inherit" | undefined;
|
|
596
|
+
/**
|
|
597
|
+
* Test id for the text.
|
|
598
|
+
*/
|
|
599
|
+
"data-testid"?: string | undefined;
|
|
593
600
|
/**
|
|
594
601
|
* Size of the text.
|
|
595
602
|
*
|
|
@@ -603,7 +610,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
|
|
|
603
610
|
size?: 500 | 600 | 700 | 800 | undefined;
|
|
604
611
|
}) => ReactElement;
|
|
605
612
|
|
|
606
|
-
type
|
|
613
|
+
type IconButtonProps = {
|
|
607
614
|
/**
|
|
608
615
|
* The color of the button
|
|
609
616
|
*
|
|
@@ -652,7 +659,7 @@ type IconButtonType = {
|
|
|
652
659
|
/**
|
|
653
660
|
* [IconButton](https://cambly-syntax.vercel.app/?path=/docs/components-iconbutton--docs) is a clickable element that is used to perform an action.
|
|
654
661
|
*/
|
|
655
|
-
declare const IconButton: React__default.ForwardRefExoticComponent<
|
|
662
|
+
declare const IconButton: React__default.ForwardRefExoticComponent<IconButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
656
663
|
|
|
657
664
|
/**
|
|
658
665
|
* [LinkButton](https://cambly-syntax.vercel.app/?path=/docs/components-linkbutton--docs) is a "variation" of Button that should look identical to Button, but should be used to render links instead.
|
|
@@ -735,7 +742,40 @@ declare const sizeWidth: {
|
|
|
735
742
|
readonly sm: 400;
|
|
736
743
|
readonly lg: 600;
|
|
737
744
|
};
|
|
738
|
-
|
|
745
|
+
/**
|
|
746
|
+
* [Modal](https://cambly-syntax.vercel.app/?path=/docs/components-modal--docs) is a dialog that appears on top of the main content and locks user interaction within the modal.
|
|
747
|
+
*
|
|
748
|
+
```
|
|
749
|
+
const [showModal, setShowModal] = useState(false)
|
|
750
|
+
|
|
751
|
+
return (
|
|
752
|
+
<>
|
|
753
|
+
{showModal && <Modal
|
|
754
|
+
header="header text"
|
|
755
|
+
onDismiss={() => setShowModal(false)}
|
|
756
|
+
footer={
|
|
757
|
+
<>
|
|
758
|
+
<Button
|
|
759
|
+
text="Cancel"
|
|
760
|
+
color="secondary"
|
|
761
|
+
onClick={() => {}}
|
|
762
|
+
/>
|
|
763
|
+
<Button
|
|
764
|
+
text="Confirm"
|
|
765
|
+
onClick={() => {}}
|
|
766
|
+
/>
|
|
767
|
+
</>
|
|
768
|
+
}
|
|
769
|
+
>
|
|
770
|
+
<Typography>
|
|
771
|
+
Body text goes here!
|
|
772
|
+
</Typography>
|
|
773
|
+
</Modal> }
|
|
774
|
+
</>
|
|
775
|
+
)
|
|
776
|
+
```
|
|
777
|
+
*/
|
|
778
|
+
declare function Modal({ header, children, image, onDismiss, footer, accessibilityCloseLabel, size, zIndex, "data-testid": dataTestId, }: {
|
|
739
779
|
/**
|
|
740
780
|
* The modal's main content. Should typically take in `Typography`'d text.
|
|
741
781
|
*/
|
|
@@ -803,41 +843,7 @@ type ModalType = {
|
|
|
803
843
|
* Test id for the modal
|
|
804
844
|
*/
|
|
805
845
|
"data-testid"?: string;
|
|
806
|
-
};
|
|
807
|
-
/**
|
|
808
|
-
* [Modal](https://cambly-syntax.vercel.app/?path=/docs/components-modal--docs) is a dialog that appears on top of the main content and locks user interaction within the modal.
|
|
809
|
-
*
|
|
810
|
-
```
|
|
811
|
-
const [showModal, setShowModal] = useState(false)
|
|
812
|
-
|
|
813
|
-
return (
|
|
814
|
-
<>
|
|
815
|
-
{showModal && <Modal
|
|
816
|
-
header="header text"
|
|
817
|
-
onDismiss={() => setShowModal(false)}
|
|
818
|
-
footer={
|
|
819
|
-
<>
|
|
820
|
-
<Button
|
|
821
|
-
text="Cancel"
|
|
822
|
-
color="secondary"
|
|
823
|
-
onClick={() => {}}
|
|
824
|
-
/>
|
|
825
|
-
<Button
|
|
826
|
-
text="Confirm"
|
|
827
|
-
onClick={() => {}}
|
|
828
|
-
/>
|
|
829
|
-
</>
|
|
830
|
-
}
|
|
831
|
-
>
|
|
832
|
-
<Typography>
|
|
833
|
-
Body text goes here!
|
|
834
|
-
</Typography>
|
|
835
|
-
</Modal> }
|
|
836
|
-
</>
|
|
837
|
-
)
|
|
838
|
-
```
|
|
839
|
-
*/
|
|
840
|
-
declare function Modal({ header, children, image, onDismiss, footer, accessibilityCloseLabel, size, zIndex, "data-testid": dataTestId, }: ModalType): ReactElement;
|
|
846
|
+
}): ReactElement;
|
|
841
847
|
declare namespace Modal {
|
|
842
848
|
var displayName: string;
|
|
843
849
|
}
|
|
@@ -1032,7 +1038,7 @@ declare function TextField({ autoComplete, "data-testid": dataTestId, disabled,
|
|
|
1032
1038
|
/**
|
|
1033
1039
|
* [Typography](https://cambly-syntax.vercel.app/?path=/docs/components-typography--docs) is a component that renders text.
|
|
1034
1040
|
*/
|
|
1035
|
-
declare const Typography: ({ align, as, children, color, inline, lineClamp, size, tooltip, transform, underline, weight, }: {
|
|
1041
|
+
declare const Typography: ({ align, as, children, color, "data-testid": dataTestId, inline, lineClamp, size, tooltip, transform, underline, weight, }: {
|
|
1036
1042
|
/**
|
|
1037
1043
|
* Aligns the text to the left, right, or center of the container.
|
|
1038
1044
|
* * `start` and `end` will align the text to the left or right of the container depending on the locale.
|
|
@@ -1040,13 +1046,13 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
1040
1046
|
*
|
|
1041
1047
|
* @defaultValue "start"
|
|
1042
1048
|
*/
|
|
1043
|
-
align?: "
|
|
1049
|
+
align?: "start" | "end" | "forceLeft" | "center" | "forceRight" | undefined;
|
|
1044
1050
|
/**
|
|
1045
1051
|
* DOM element to render as.
|
|
1046
1052
|
*
|
|
1047
1053
|
* @defaultValue "div"
|
|
1048
1054
|
*/
|
|
1049
|
-
as?: "
|
|
1055
|
+
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | undefined;
|
|
1050
1056
|
/**
|
|
1051
1057
|
* The text to be rendered
|
|
1052
1058
|
*/
|
|
@@ -1056,7 +1062,11 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
|
|
|
1056
1062
|
*
|
|
1057
1063
|
* @defaultValue "gray900"
|
|
1058
1064
|
*/
|
|
1059
|
-
color?: "gray200" | "gray900" | "
|
|
1065
|
+
color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "gray700" | "gray800" | "white" | "inherit" | undefined;
|
|
1066
|
+
/**
|
|
1067
|
+
* Test id for the text
|
|
1068
|
+
*/
|
|
1069
|
+
"data-testid"?: string | undefined;
|
|
1060
1070
|
/**
|
|
1061
1071
|
* Whether the text should flow inline with other elements.
|
|
1062
1072
|
*
|
package/dist/index.js
CHANGED
|
@@ -189,6 +189,7 @@ var Typography = ({
|
|
|
189
189
|
as = "div",
|
|
190
190
|
children,
|
|
191
191
|
color = "gray900",
|
|
192
|
+
"data-testid": dataTestId,
|
|
192
193
|
inline = false,
|
|
193
194
|
lineClamp = void 0,
|
|
194
195
|
size = 200,
|
|
@@ -212,6 +213,7 @@ var Typography = ({
|
|
|
212
213
|
underline && Typography_module_default.underline,
|
|
213
214
|
lineClamp != null && Typography_module_default.lineClamp
|
|
214
215
|
),
|
|
216
|
+
"data-testid": dataTestId,
|
|
215
217
|
style: {
|
|
216
218
|
WebkitLineClamp: lineClamp
|
|
217
219
|
},
|
|
@@ -889,10 +891,22 @@ var Heading = ({
|
|
|
889
891
|
as = "h1",
|
|
890
892
|
children,
|
|
891
893
|
color = "gray900",
|
|
894
|
+
"data-testid": dataTestId,
|
|
892
895
|
size = 500
|
|
893
896
|
}) => {
|
|
894
897
|
const weight = [700, 800].includes(size) ? "heavy" : "bold";
|
|
895
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
899
|
+
Typography_default,
|
|
900
|
+
{
|
|
901
|
+
align,
|
|
902
|
+
as,
|
|
903
|
+
color,
|
|
904
|
+
"data-testid": dataTestId,
|
|
905
|
+
size,
|
|
906
|
+
weight,
|
|
907
|
+
children
|
|
908
|
+
}
|
|
909
|
+
);
|
|
896
910
|
};
|
|
897
911
|
var Heading_default = Heading;
|
|
898
912
|
|