@cloudflare/component-button 3.2.8 → 5.0.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/CHANGELOG.md +1026 -3173
- package/dist/Button.d.ts +45 -39
- package/dist/ButtonGroup.d.ts +44 -38
- package/dist/TextButton.d.ts +51 -45
- package/dist/UnstyledButton.d.ts +51 -45
- package/es/Button.js +68 -64
- package/es/ButtonGroup.js +23 -19
- package/es/IconTextButton.js +21 -18
- package/es/TextButton.js +32 -29
- package/es/UnstyledButton.js +1 -1
- package/lib/Button.js +7 -5
- package/lib/index.js +11 -11
- package/package.json +9 -8
package/dist/UnstyledButton.d.ts
CHANGED
|
@@ -30,11 +30,11 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
30
30
|
'aria-colindex'?: number | undefined;
|
|
31
31
|
'aria-colspan'?: number | undefined;
|
|
32
32
|
'aria-controls'?: string | undefined;
|
|
33
|
-
'aria-current'?: boolean | "time" | "true" | "false" | "step" | "
|
|
33
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "step" | "page" | "location" | "date" | undefined;
|
|
34
34
|
'aria-describedby'?: string | undefined;
|
|
35
35
|
'aria-details'?: string | undefined;
|
|
36
36
|
'aria-disabled'?: boolean | "true" | "false" | undefined;
|
|
37
|
-
'aria-dropeffect'?: "link" | "none" | "
|
|
37
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
38
38
|
'aria-errormessage'?: string | undefined;
|
|
39
39
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
|
40
40
|
'aria-flowto'?: string | undefined;
|
|
@@ -64,7 +64,7 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
64
64
|
'aria-rowspan'?: number | undefined;
|
|
65
65
|
'aria-selected'?: boolean | "true" | "false" | undefined;
|
|
66
66
|
'aria-setsize'?: number | undefined;
|
|
67
|
-
'aria-sort'?: "none" | "
|
|
67
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
68
68
|
'aria-valuemax'?: number | undefined;
|
|
69
69
|
'aria-valuemin'?: number | undefined;
|
|
70
70
|
'aria-valuenow'?: number | undefined;
|
|
@@ -228,9 +228,8 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
228
228
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
229
229
|
dir?: string | undefined;
|
|
230
230
|
is?: string | undefined;
|
|
231
|
-
value?: string | number | readonly string[] | undefined;
|
|
232
231
|
disabled?: boolean | undefined;
|
|
233
|
-
|
|
232
|
+
value?: string | number | readonly string[] | undefined;
|
|
234
233
|
defaultChecked?: boolean | undefined;
|
|
235
234
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
236
235
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -240,7 +239,7 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
240
239
|
contextMenu?: string | undefined;
|
|
241
240
|
placeholder?: string | undefined;
|
|
242
241
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
243
|
-
inputMode?: "search" | "text" | "none" | "
|
|
242
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
244
243
|
radioGroup?: string | undefined;
|
|
245
244
|
about?: string | undefined;
|
|
246
245
|
datatype?: string | undefined;
|
|
@@ -260,7 +259,7 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
260
259
|
itemRef?: string | undefined;
|
|
261
260
|
results?: number | undefined;
|
|
262
261
|
security?: string | undefined;
|
|
263
|
-
unselectable?: "
|
|
262
|
+
unselectable?: "on" | "off" | undefined;
|
|
264
263
|
autoFocus?: boolean | undefined;
|
|
265
264
|
formAction?: string | undefined;
|
|
266
265
|
formEncType?: string | undefined;
|
|
@@ -268,6 +267,7 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
268
267
|
formNoValidate?: boolean | undefined;
|
|
269
268
|
formTarget?: string | undefined;
|
|
270
269
|
hidden?: boolean | undefined;
|
|
270
|
+
translate?: "no" | "yes" | undefined;
|
|
271
271
|
p?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
|
|
272
272
|
height?: import("csstype").HeightProperty<string | number> | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | undefined;
|
|
273
273
|
width?: import("csstype").WidthProperty<string | number> | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | undefined;
|
|
@@ -276,50 +276,17 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
276
276
|
fontSize?: import("csstype").FontSizeProperty<string | number> | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | undefined;
|
|
277
277
|
fontWeight?: import("csstype").FontWeightProperty | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | undefined;
|
|
278
278
|
textDecoration?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
279
|
-
textAlign?: import("csstype").TextAlignProperty | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | undefined;
|
|
280
|
-
backgroundColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
281
279
|
borderColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
282
|
-
borderLeftColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
283
|
-
borderRightColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
284
|
-
borderTopColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
285
|
-
borderBottomColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
286
|
-
minWidth?: import("csstype").MinWidthProperty<string | number> | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | undefined;
|
|
287
|
-
minHeight?: import("csstype").MinHeightProperty<string | number> | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | undefined;
|
|
288
|
-
maxWidth?: import("csstype").MaxWidthProperty<string | number> | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | undefined;
|
|
289
|
-
maxHeight?: import("csstype").MaxHeightProperty<string | number> | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | undefined;
|
|
290
280
|
margin?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
|
|
291
|
-
marginTop?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
|
|
292
|
-
marginRight?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
|
|
293
281
|
marginLeft?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
|
|
282
|
+
marginRight?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
|
|
283
|
+
marginTop?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
|
|
284
|
+
marginBottom?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
|
|
294
285
|
padding?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
|
|
295
|
-
paddingTop?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
296
|
-
paddingRight?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
|
|
297
286
|
paddingLeft?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
alignItems?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
301
|
-
alignSelf?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
302
|
-
borderBottomLeftRadius?: import("csstype").BorderBottomLeftRadiusProperty<string | number> | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
303
|
-
borderBottomStyle?: import("csstype").BorderBottomStyleProperty | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | undefined;
|
|
304
|
-
borderBottomWidth?: import("csstype").BorderBottomWidthProperty<string | number> | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | undefined;
|
|
305
|
-
borderLeftStyle?: import("csstype").BorderLeftStyleProperty | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | undefined;
|
|
306
|
-
borderLeftWidth?: import("csstype").BorderLeftWidthProperty<string | number> | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | undefined;
|
|
307
|
-
borderRightStyle?: import("csstype").BorderRightStyleProperty | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | undefined;
|
|
308
|
-
borderRightWidth?: import("csstype").BorderRightWidthProperty<string | number> | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | undefined;
|
|
309
|
-
borderTopLeftRadius?: import("csstype").BorderTopLeftRadiusProperty<string | number> | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
310
|
-
borderTopRightRadius?: import("csstype").BorderTopRightRadiusProperty<string | number> | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | undefined;
|
|
311
|
-
borderTopStyle?: import("csstype").BorderTopStyleProperty | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | undefined;
|
|
312
|
-
borderTopWidth?: import("csstype").BorderTopWidthProperty<string | number> | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | undefined;
|
|
313
|
-
boxSizing?: import("csstype").BoxSizingProperty | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | undefined;
|
|
314
|
-
flexBasis?: import("csstype").FlexBasisProperty<string | number> | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | undefined;
|
|
315
|
-
flexDirection?: import("csstype").FlexDirectionProperty | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | undefined;
|
|
316
|
-
flexGrow?: import("csstype").GlobalsNumber | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | undefined;
|
|
317
|
-
justifyContent?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
318
|
-
marginBottom?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
|
|
287
|
+
paddingRight?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
|
|
288
|
+
paddingTop?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
319
289
|
paddingBottom?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
|
|
320
|
-
textTransform?: import("csstype").TextTransformProperty | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | undefined;
|
|
321
|
-
borderStyle?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
322
|
-
borderWidth?: import("csstype").BorderWidthProperty<string | number> | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | undefined;
|
|
323
290
|
gap?: import("csstype").GapProperty<string | number> | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | undefined;
|
|
324
291
|
m?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
|
|
325
292
|
ml?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
|
|
@@ -334,7 +301,46 @@ declare const UnstyledButton: import("react").ComponentType<{
|
|
|
334
301
|
pb?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
|
|
335
302
|
px?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
|
|
336
303
|
py?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
|
|
304
|
+
minWidth?: import("csstype").MinWidthProperty<string | number> | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | undefined;
|
|
305
|
+
minHeight?: import("csstype").MinHeightProperty<string | number> | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | undefined;
|
|
306
|
+
maxWidth?: import("csstype").MaxWidthProperty<string | number> | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | undefined;
|
|
307
|
+
maxHeight?: import("csstype").MaxHeightProperty<string | number> | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | undefined;
|
|
308
|
+
backgroundColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
309
|
+
borderLeftColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
310
|
+
borderRightColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
311
|
+
borderTopColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
312
|
+
borderBottomColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
313
|
+
borderStyle?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
314
|
+
borderTopStyle?: import("csstype").BorderTopStyleProperty | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | undefined;
|
|
315
|
+
borderBottomStyle?: import("csstype").BorderBottomStyleProperty | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | undefined;
|
|
316
|
+
borderLeftStyle?: import("csstype").BorderLeftStyleProperty | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | undefined;
|
|
317
|
+
borderRightStyle?: import("csstype").BorderRightStyleProperty | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | undefined;
|
|
318
|
+
borderWidth?: import("csstype").BorderWidthProperty<string | number> | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | undefined;
|
|
319
|
+
borderTopWidth?: import("csstype").BorderTopWidthProperty<string | number> | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | undefined;
|
|
320
|
+
borderBottomWidth?: import("csstype").BorderBottomWidthProperty<string | number> | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | undefined;
|
|
321
|
+
borderLeftWidth?: import("csstype").BorderLeftWidthProperty<string | number> | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | undefined;
|
|
322
|
+
borderRightWidth?: import("csstype").BorderRightWidthProperty<string | number> | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | undefined;
|
|
323
|
+
borderRadius?: import("csstype").BorderRadiusProperty<string | number> | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | undefined;
|
|
324
|
+
borderTopLeftRadius?: import("csstype").BorderTopLeftRadiusProperty<string | number> | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
325
|
+
borderTopRightRadius?: import("csstype").BorderTopRightRadiusProperty<string | number> | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | undefined;
|
|
326
|
+
borderBottomLeftRadius?: import("csstype").BorderBottomLeftRadiusProperty<string | number> | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | undefined;
|
|
337
327
|
borderbottomRightRadius?: ([never, never] | [never, never, never]) | undefined;
|
|
328
|
+
textAlign?: import("csstype").TextAlignProperty | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | undefined;
|
|
329
|
+
verticalAlign?: import("csstype").VerticalAlignProperty<string | number> | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | undefined;
|
|
330
|
+
alignItems?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
331
|
+
alignSelf?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
332
|
+
justifyContent?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
|
|
333
|
+
textTransform?: import("csstype").TextTransformProperty | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | undefined;
|
|
334
|
+
boxSizing?: import("csstype").BoxSizingProperty | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | undefined;
|
|
335
|
+
flexDirection?: import("csstype").FlexDirectionProperty | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | undefined;
|
|
336
|
+
flexBasis?: import("csstype").FlexBasisProperty<string | number> | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | undefined;
|
|
337
|
+
flexGrow?: import("csstype").GlobalsNumber | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | undefined;
|
|
338
338
|
innerRef?: import("react").Ref<HTMLButtonElement> | undefined;
|
|
339
|
+
gridColumnSpan?: number | number[] | "end" | "all" | undefined;
|
|
340
|
+
gridColumnPad?: number | number[] | undefined;
|
|
341
|
+
gridRowSpan?: number | number[] | undefined;
|
|
342
|
+
gridRowPad?: number | number[] | undefined;
|
|
343
|
+
gridAlign?: ("end" | "start" | "center" | "stretch") | undefined;
|
|
344
|
+
gridJustify?: ("end" | "start" | "center" | "stretch") | undefined;
|
|
339
345
|
}>;
|
|
340
346
|
export default UnstyledButton;
|
package/es/Button.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
6
|
|
|
5
7
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
8
|
|
|
@@ -10,8 +12,8 @@ import { isDarkMode } from '@cloudflare/style-const';
|
|
|
10
12
|
import { ariaAttributes, createStyledComponent } from '@cloudflare/style-container';
|
|
11
13
|
import { Icon } from '@cloudflare/component-icon';
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
var standardColors = theme => {
|
|
16
|
+
var color = theme.colors.gray[9];
|
|
15
17
|
return {
|
|
16
18
|
default: isDarkMode() ? color : theme.colors.gray[1],
|
|
17
19
|
primary: color,
|
|
@@ -25,9 +27,9 @@ const standardColors = theme => {
|
|
|
25
27
|
};
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var buttonColors = theme => {
|
|
31
|
+
var standardIndex = isDarkMode() ? 3 : 4;
|
|
32
|
+
var hoverIndex = isDarkMode() ? 1 : 2;
|
|
31
33
|
return {
|
|
32
34
|
// Normal default state colors
|
|
33
35
|
normal: {
|
|
@@ -57,7 +59,7 @@ const buttonColors = theme => {
|
|
|
57
59
|
primary: theme.colors.blue[hoverIndex]
|
|
58
60
|
}
|
|
59
61
|
},
|
|
60
|
-
color: _objectSpread({}, standardColors(theme), {
|
|
62
|
+
color: _objectSpread(_objectSpread({}, standardColors(theme)), {}, {
|
|
61
63
|
inverted: {
|
|
62
64
|
danger: theme.colors.white,
|
|
63
65
|
primary: theme.colors.white
|
|
@@ -77,7 +79,7 @@ const buttonColors = theme => {
|
|
|
77
79
|
primary: theme.colors.blue[standardIndex]
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
|
-
color: _objectSpread({}, standardColors(theme), {
|
|
82
|
+
color: _objectSpread(_objectSpread({}, standardColors(theme)), {}, {
|
|
81
83
|
inverted: {
|
|
82
84
|
danger: theme.colors.gray[9],
|
|
83
85
|
primary: theme.colors.gray[9]
|
|
@@ -102,63 +104,66 @@ const buttonColors = theme => {
|
|
|
102
104
|
};
|
|
103
105
|
};
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
var getFocusOutlineColor = (theme, type, inverted) => {
|
|
106
108
|
var _invertedOutlines$typ;
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
var standardIndex = isDarkMode() ? 3 : 4;
|
|
111
|
+
var FOCUS_OFFSET_INDEX = 2;
|
|
112
|
+
var focusIndex = standardIndex - FOCUS_OFFSET_INDEX;
|
|
113
|
+
var outlines = {
|
|
112
114
|
default: isDarkMode() ? theme.colors.gray[focusIndex] : theme.colors.gray[8 - FOCUS_OFFSET_INDEX],
|
|
113
115
|
primary: theme.colors.blue[focusIndex],
|
|
114
116
|
success: theme.colors.green[focusIndex],
|
|
115
117
|
warning: theme.colors.orange[focusIndex],
|
|
116
118
|
danger: theme.colors.red[focusIndex]
|
|
117
119
|
};
|
|
118
|
-
|
|
120
|
+
var invertedOutlines = {
|
|
119
121
|
danger: theme.colors.red[focusIndex],
|
|
120
122
|
primary: theme.colors.blue[focusIndex]
|
|
121
123
|
};
|
|
122
124
|
return inverted ? (_invertedOutlines$typ = invertedOutlines[type]) !== null && _invertedOutlines$typ !== void 0 ? _invertedOutlines$typ : outlines[type] : outlines[type];
|
|
123
125
|
};
|
|
124
126
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
var colorAccessor = (property, _ref) => {
|
|
128
|
+
var {
|
|
129
|
+
inverted = false,
|
|
130
|
+
type = 'default'
|
|
131
|
+
} = _ref;
|
|
132
|
+
return !property ? undefined : inverted && (type === 'danger' || type === 'primary') ? property.inverted[type] : property[type];
|
|
133
|
+
};
|
|
129
134
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
var interactionStyleAccessor = (interactionState, props) => {
|
|
136
|
+
var {
|
|
137
|
+
theme,
|
|
138
|
+
loading,
|
|
139
|
+
disabled
|
|
140
|
+
} = props;
|
|
141
|
+
var isInteractive = !(loading || disabled);
|
|
142
|
+
var stateStyles = buttonColors(theme)[interactionState];
|
|
136
143
|
return isInteractive ? {
|
|
137
144
|
backgroundColor: colorAccessor(stateStyles.backgroundColor, props),
|
|
138
145
|
color: colorAccessor(stateStyles.color, props)
|
|
139
146
|
} : undefined;
|
|
140
147
|
};
|
|
141
148
|
|
|
142
|
-
export
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const activeStyles = interactionStyleAccessor('active', props);
|
|
161
|
-
const focusStyles = interactionStyleAccessor('focus', props);
|
|
149
|
+
export var buttonStyles = props => {
|
|
150
|
+
var {
|
|
151
|
+
theme,
|
|
152
|
+
loading = false,
|
|
153
|
+
disabled,
|
|
154
|
+
direction,
|
|
155
|
+
inverted = false,
|
|
156
|
+
group,
|
|
157
|
+
spaced,
|
|
158
|
+
space = 2,
|
|
159
|
+
type = 'default',
|
|
160
|
+
stretch,
|
|
161
|
+
noWrapText
|
|
162
|
+
} = props;
|
|
163
|
+
var normalStyles = buttonColors(theme).normal;
|
|
164
|
+
var hoverStyles = interactionStyleAccessor('hover', props);
|
|
165
|
+
var activeStyles = interactionStyleAccessor('active', props);
|
|
166
|
+
var focusStyles = interactionStyleAccessor('focus', props);
|
|
162
167
|
return {
|
|
163
168
|
'&:hover': hoverStyles,
|
|
164
169
|
'&:active': activeStyles,
|
|
@@ -237,25 +242,24 @@ export const buttonStyles = props => {
|
|
|
237
242
|
width: direction === 'column' ? '100%' : 'auto'
|
|
238
243
|
};
|
|
239
244
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const ariaAndDataProps = Object.keys(props).filter(propName => propName.startsWith('data-') || ariaAttributes.includes(propName)).reduce((memo, propName) => _objectSpread({}, memo, {
|
|
245
|
+
var Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
246
|
+
var {
|
|
247
|
+
submit = false,
|
|
248
|
+
className,
|
|
249
|
+
disabled,
|
|
250
|
+
loading = false,
|
|
251
|
+
testId,
|
|
252
|
+
children,
|
|
253
|
+
onClick,
|
|
254
|
+
iconType,
|
|
255
|
+
iconLabel,
|
|
256
|
+
iconSize,
|
|
257
|
+
iconPosition = 'left',
|
|
258
|
+
form,
|
|
259
|
+
tabIndex,
|
|
260
|
+
ariaLabel
|
|
261
|
+
} = props;
|
|
262
|
+
var ariaAndDataProps = Object.keys(props).filter(propName => propName.startsWith('data-') || ariaAttributes.includes(propName)).reduce((memo, propName) => _objectSpread(_objectSpread({}, memo), {}, {
|
|
259
263
|
[propName]: props[propName]
|
|
260
264
|
}), {});
|
|
261
265
|
return /*#__PURE__*/React.createElement("button", _extends({}, ariaAndDataProps, {
|
package/es/ButtonGroup.js
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { createStyledComponent } from '@cloudflare/style-container';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
var getGroupByIndex = (index, length) => {
|
|
6
6
|
if (index === length - 1) {
|
|
7
7
|
return 'last';
|
|
8
8
|
}
|
|
@@ -14,7 +14,7 @@ const getGroupByIndex = (index, length) => {
|
|
|
14
14
|
return 'inbetween';
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
var addGroupProps = (children, spaced, space, direction, stretch) => React.Children.map(children, (child, index) => {
|
|
18
18
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
19
19
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
20
20
|
group: getGroupByIndex(index, React.Children.count(children)),
|
|
@@ -28,14 +28,15 @@ const addGroupProps = (children, spaced, space, direction, stretch) => React.Chi
|
|
|
28
28
|
return child;
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
var ButtonGroup = _ref => {
|
|
32
|
+
var {
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
spaced,
|
|
36
|
+
space,
|
|
37
|
+
direction = 'row',
|
|
38
|
+
stretch
|
|
39
|
+
} = _ref;
|
|
39
40
|
return /*#__PURE__*/React.createElement("div", {
|
|
40
41
|
className: className
|
|
41
42
|
}, addGroupProps(children, spaced, space, direction, stretch));
|
|
@@ -49,12 +50,15 @@ ButtonGroup.propTypes = {
|
|
|
49
50
|
direction: PropTypes.oneOf(['column', 'row'])
|
|
50
51
|
};
|
|
51
52
|
ButtonGroup.displayName = 'ButtonGroup';
|
|
52
|
-
export default createStyledComponent(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
export default createStyledComponent(_ref2 => {
|
|
54
|
+
var {
|
|
55
|
+
direction = 'row'
|
|
56
|
+
} = _ref2;
|
|
57
|
+
return {
|
|
58
|
+
position: 'relative',
|
|
59
|
+
display: 'inline-flex',
|
|
60
|
+
width: direction === 'column' ? '100%' : 'initial',
|
|
61
|
+
flexDirection: direction === 'column' ? 'column' : 'row',
|
|
62
|
+
flexWrap: 'nowrap'
|
|
63
|
+
};
|
|
64
|
+
}, ButtonGroup);
|
package/es/IconTextButton.js
CHANGED
|
@@ -2,27 +2,30 @@ import React from 'react';
|
|
|
2
2
|
import { createStyledComponent } from '@cloudflare/style-container';
|
|
3
3
|
import { Icon } from '@cloudflare/component-icon';
|
|
4
4
|
import TextButton from './TextButton';
|
|
5
|
-
|
|
5
|
+
var IconTextWrapper = createStyledComponent(() => ({
|
|
6
6
|
display: 'flex',
|
|
7
7
|
alignItems: 'center'
|
|
8
8
|
}), 'div');
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
var IconTextButton = _ref => {
|
|
11
|
+
var {
|
|
12
|
+
onClick,
|
|
13
|
+
iconType,
|
|
14
|
+
iconPosition = 'left',
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/React.createElement(TextButton, {
|
|
18
|
+
type: "button",
|
|
19
|
+
onClick: onClick
|
|
20
|
+
}, /*#__PURE__*/React.createElement(IconTextWrapper, null, iconPosition === 'left' && /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
type: iconType,
|
|
22
|
+
mr: 1,
|
|
23
|
+
label: iconType
|
|
24
|
+
}), children, iconPosition === 'right' && /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
+
type: iconType,
|
|
26
|
+
ml: 1,
|
|
27
|
+
label: iconType
|
|
28
|
+
})));
|
|
29
|
+
};
|
|
27
30
|
|
|
28
31
|
export default IconTextButton;
|
package/es/TextButton.js
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
import { createStyledComponent } from '@cloudflare/style-container';
|
|
2
2
|
import { isDarkMode } from '@cloudflare/style-const';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
var TextButton = createStyledComponent(_ref => {
|
|
4
|
+
var {
|
|
5
|
+
theme
|
|
6
|
+
} = _ref;
|
|
7
|
+
return {
|
|
8
|
+
background: 'transparent',
|
|
9
|
+
borderRadius: 'none',
|
|
10
|
+
color: theme.colors.blue[4],
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
transitionProperty: 'color',
|
|
13
|
+
transitionDuration: '150ms',
|
|
14
|
+
transitionTimingFunction: 'ease',
|
|
15
|
+
padding: '0px',
|
|
16
|
+
display: 'inline-block',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
lineHeight: '1.5',
|
|
19
|
+
height: 'fit-content',
|
|
20
|
+
fontSize: 2,
|
|
21
|
+
fontWeight: 400,
|
|
22
|
+
outline: 'none',
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
textUnderlineOffset: 4,
|
|
25
|
+
':hover': {
|
|
26
|
+
color: isDarkMode() ? theme.colors.orange[6] : theme.colors.blue[2],
|
|
27
|
+
textDecoration: 'underline'
|
|
28
|
+
},
|
|
29
|
+
':focus-visible': {
|
|
30
|
+
outline: '-webkit-focus-ring-color auto 1px',
|
|
31
|
+
outlineOffset: '1px'
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, 'button');
|
|
32
35
|
TextButton.displayName = 'TextButton';
|
|
33
36
|
export default TextButton;
|
package/es/UnstyledButton.js
CHANGED