@xsolla/xui-button 0.119.0 → 0.121.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-button",
3
- "version": "0.119.0",
3
+ "version": "0.121.0",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,9 +13,9 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-core": "0.119.0",
17
- "@xsolla/xui-icons": "0.119.0",
18
- "@xsolla/xui-primitives-core": "0.119.0"
16
+ "@xsolla/xui-core": "0.121.0",
17
+ "@xsolla/xui-icons": "0.121.0",
18
+ "@xsolla/xui-primitives-core": "0.121.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "react": ">=16.8.0",
@@ -1,566 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- import React, { Node } from "react";
9
- declare interface ButtonProps {
10
- /**
11
- * Visual variant of the button
12
- */
13
- variant?: "primary" | "secondary" | "tertiary" | "ghost";
14
-
15
- /**
16
- * Color tone of the button
17
- */
18
- tone?: "brand" | "brandExtra" | "alert" | "mono";
19
-
20
- /**
21
- * Size of the button
22
- */
23
- size?: "xl" | "lg" | "md" | "sm" | "xs";
24
-
25
- /**
26
- * Whether the button is disabled
27
- */
28
- disabled?: boolean;
29
-
30
- /**
31
- * Whether the button is in a loading state
32
- */
33
- loading?: boolean;
34
-
35
- /**
36
- * Button content
37
- */
38
- children: React.ReactNode;
39
-
40
- /**
41
- * Click handler
42
- */
43
- onPress?: () => void;
44
-
45
- /**
46
- * Icon to display on the left side.
47
- * Size and color are automatically set based on button size/state.
48
- * To override, specify size/color on the icon: `iconLeft={<ArrowLeft size={16} />}`
49
- */
50
- iconLeft?: React.ReactNode;
51
-
52
- /**
53
- * Icon to display on the right side.
54
- * Size and color are automatically set based on button size/state.
55
- * To override, specify size/color on the icon: `iconRight={<ArrowRight size={16} />}`
56
- */
57
- iconRight?: React.ReactNode;
58
-
59
- /**
60
- * Secondary text displayed inline with the main label (e.g., price), shown with 40% opacity
61
- */
62
- sublabel?: string;
63
-
64
- /**
65
- * Alignment of the label text
66
- */
67
- labelAlignment?: "left" | "center";
68
-
69
- /**
70
- * Small icon displayed directly next to the label text.
71
- * Size and color are automatically set based on button size/state.
72
- * To override, specify size/color on the icon: `labelIcon={<InfoIcon size={12} />}`
73
- */
74
- labelIcon?: React.ReactNode;
75
-
76
- /**
77
- * Custom content slot for badges, tags, or other elements
78
- */
79
- customContent?: React.ReactNode;
80
-
81
- /**
82
- * Accessible label for screen readers (use for icon-only buttons)
83
- */
84
- "aria-label"?: string;
85
-
86
- /**
87
- * ID of element that describes this button
88
- */
89
- "aria-describedby"?: string;
90
-
91
- /**
92
- * Indicates the button controls an expandable element
93
- */
94
- "aria-expanded"?: boolean;
95
-
96
- /**
97
- * Indicates the type of popup triggered by the button
98
- */
99
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
100
-
101
- /**
102
- * Indicates the button is pressed (for toggle buttons)
103
- */
104
- "aria-pressed"?: boolean | "mixed";
105
-
106
- /**
107
- * ID of the element this button controls
108
- */
109
- "aria-controls"?: string;
110
-
111
- /**
112
- * Test ID for testing frameworks
113
- */
114
- testID?: string;
115
-
116
- /**
117
- * HTML id attribute
118
- */
119
- id?: string;
120
-
121
- /**
122
- * HTML type attribute for the button
123
- */
124
- type?: "button" | "submit" | "reset";
125
-
126
- /**
127
- * Whether the button should stretch to fill the full width of its container
128
- */
129
- fullWidth?: boolean;
130
- }
131
- /**
132
- * Button - An accessible button component
133
- *
134
- * Renders as a semantic `<button>` element with full ARIA support.
135
- * Supports various visual variants, sizes, and states including loading.
136
- *
137
- * ## Accessibility Features
138
- *
139
- * - **Semantic HTML**: Renders as a native `<button>` element
140
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
141
- * - **ARIA States**: Properly announces disabled and loading states
142
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
143
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
144
- */
145
- declare var Button: React.FC<ButtonProps>;
146
- declare interface IconButtonProps {
147
- /**
148
- * Visual variant of the button
149
- */
150
- variant?: "primary" | "secondary" | "tertiary" | "ghost";
151
-
152
- /**
153
- * Color tone of the button
154
- */
155
- tone?: "brand" | "brandExtra" | "alert" | "mono";
156
-
157
- /**
158
- * Size of the button
159
- */
160
- size?: "xl" | "lg" | "md" | "sm" | "xs";
161
-
162
- /**
163
- * Whether the button is disabled
164
- */
165
- disabled?: boolean;
166
-
167
- /**
168
- * Whether the button is in a loading state
169
- */
170
- loading?: boolean;
171
-
172
- /**
173
- * Icon to display in the button (required).
174
- * Size and color are automatically set based on button size/state.
175
- * To override, specify size/color on the icon: `icon={<CloseIcon size={16} />}`
176
- */
177
- icon: React.ReactNode;
178
-
179
- /**
180
- * Click handler
181
- */
182
- onPress?: () => void;
183
-
184
- /**
185
- * Accessible label for screen readers (REQUIRED for icon-only buttons)
186
- * Since icon buttons have no visible text, this label is essential for accessibility.
187
- * @example aria-label="Close dialog"
188
- * @example aria-label="Open settings menu"
189
- */
190
- "aria-label": string;
191
-
192
- /**
193
- * ID of element that describes this button
194
- */
195
- "aria-describedby"?: string;
196
-
197
- /**
198
- * Indicates the button controls an expandable element
199
- */
200
- "aria-expanded"?: boolean;
201
-
202
- /**
203
- * Indicates the type of popup triggered by the button
204
- */
205
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
206
-
207
- /**
208
- * Indicates the button is pressed (for toggle buttons)
209
- */
210
- "aria-pressed"?: boolean | "mixed";
211
-
212
- /**
213
- * ID of the element this button controls
214
- */
215
- "aria-controls"?: string;
216
-
217
- /**
218
- * Test ID for testing frameworks
219
- */
220
- testID?: string;
221
-
222
- /**
223
- * HTML id attribute
224
- */
225
- id?: string;
226
-
227
- /**
228
- * HTML type attribute for the button
229
- */
230
- type?: "button" | "submit" | "reset";
231
- }
232
- /**
233
- * IconButton - An accessible icon-only button component
234
- *
235
- * Renders as a semantic `<button>` element with full ARIA support.
236
- * Supports various visual variants, sizes, and states including loading.
237
- *
238
- * ## Accessibility Features
239
- *
240
- * - **Semantic HTML**: Renders as a native `<button>` element
241
- * - **Required aria-label**: Ensures screen readers can announce the button's purpose
242
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
243
- * - **ARIA States**: Properly announces disabled and loading states
244
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
245
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
246
- *
247
- * ## Usage
248
- *
249
- * ```tsx
250
- * // Basic usage - aria-label is required
251
- * <IconButton icon={<CloseIcon />} aria-label="Close dialog" onPress={handleClose} />
252
- *
253
- * // Toggle button
254
- * <IconButton
255
- * icon={<MenuIcon />}
256
- * aria-label="Toggle menu"
257
- * aria-expanded={isOpen}
258
- * aria-controls="menu-id"
259
- * onPress={toggleMenu}
260
- * />
261
- *
262
- * // Loading state
263
- * <IconButton icon={<SaveIcon />} aria-label="Save changes" loading />
264
- * ```
265
- */
266
- declare var IconButton: React.FC<IconButtonProps>;
267
- declare type FlexButtonProps = {
268
- /**
269
- * Button content
270
- */
271
- children: Node,
272
-
273
- /**
274
- * Visual variant of the button
275
- */
276
- variant?:
277
- | "brand"
278
- | "primary"
279
- | "secondary"
280
- | "tertiary"
281
- | "brandExtra"
282
- | "inverse",
283
-
284
- /**
285
- * Size of the button
286
- */
287
- size?: "xl" | "lg" | "md" | "sm" | "xs",
288
-
289
- /**
290
- * Whether to show background fill
291
- */
292
- background?: boolean,
293
-
294
- /**
295
- * Whether the button is disabled
296
- */
297
- disabled?: boolean,
298
-
299
- /**
300
- * Whether the button is in a loading state
301
- */
302
- loading?: boolean,
303
-
304
- /**
305
- * Icon to display on the left side
306
- */
307
- iconLeft?: Node,
308
-
309
- /**
310
- * Icon to display on the right side
311
- */
312
- iconRight?: Node,
313
-
314
- /**
315
- * Click handler
316
- */
317
- onPress?: () => void,
318
-
319
- /**
320
- * HTML type attribute for the button
321
- */
322
- type?: "button" | "submit" | "reset",
323
-
324
- /**
325
- * Accessible label for screen readers
326
- */
327
- "aria-label"?: string,
328
-
329
- /**
330
- * ID of element that describes this button
331
- */
332
- "aria-describedby"?: string,
333
-
334
- /**
335
- * Indicates the button controls an expandable element
336
- */
337
- "aria-expanded"?: boolean,
338
-
339
- /**
340
- * Indicates the type of popup triggered by the button
341
- */
342
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog",
343
-
344
- /**
345
- * Indicates the button is pressed (for toggle buttons)
346
- */
347
- "aria-pressed"?: boolean | "mixed",
348
-
349
- /**
350
- * ID of the element this button controls
351
- */
352
- "aria-controls"?: string,
353
-
354
- /**
355
- * Test ID for testing frameworks
356
- */
357
- testID?: string,
358
- ...
359
- } & $Diff<React.ButtonHTMLAttributes<HTMLButtonElement>, { type: any }>;
360
-
361
- /**
362
- * FlexButton - A compact button component designed for use in modals and popups.
363
- *
364
- * Renders as a semantic `<button>` element with full ARIA support.
365
- *
366
- * ## Accessibility Features
367
- *
368
- * - **Semantic HTML**: Renders as a native `<button>` element
369
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
370
- * - **ARIA States**: Properly announces disabled and loading states
371
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
372
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
373
- */
374
- declare var FlexButton: React.FC<FlexButtonProps>;
375
- declare interface AppButtonProps {
376
- /**
377
- * Size of the button
378
- */
379
- size?: "xl" | "lg" | "md" | "sm" | "xs";
380
-
381
- /**
382
- * Whether the button is disabled
383
- */
384
- disabled?: boolean;
385
-
386
- /**
387
- * Whether the button is in a loading state
388
- */
389
- loading?: boolean;
390
-
391
- /**
392
- * Button content
393
- */
394
- children: React.ReactNode;
395
-
396
- /**
397
- * Click handler
398
- */
399
- onPress?: () => void;
400
-
401
- /**
402
- * Icon to display on the left side
403
- */
404
- iconLeft?: React.ReactNode;
405
-
406
- /**
407
- * Icon to display on the right side
408
- */
409
- iconRight?: React.ReactNode;
410
-
411
- /**
412
- * Secondary text displayed inline with the main label
413
- */
414
- sublabel?: string;
415
-
416
- /**
417
- * Alignment of the label text
418
- */
419
- labelAlignment?: "left" | "center";
420
-
421
- /**
422
- * Small icon displayed directly next to the label text
423
- */
424
- labelIcon?: React.ReactNode;
425
-
426
- /**
427
- * Custom content slot for badges, tags, or other elements
428
- */
429
- customContent?: React.ReactNode;
430
-
431
- /**
432
- * Accessible label for screen readers
433
- */
434
- "aria-label"?: string;
435
-
436
- /**
437
- * ID of element that describes this button
438
- */
439
- "aria-describedby"?: string;
440
-
441
- /**
442
- * Indicates the button controls an expandable element
443
- */
444
- "aria-expanded"?: boolean;
445
-
446
- /**
447
- * Indicates the type of popup triggered by the button
448
- */
449
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
450
-
451
- /**
452
- * Indicates the button is pressed (for toggle buttons)
453
- */
454
- "aria-pressed"?: boolean | "mixed";
455
-
456
- /**
457
- * ID of the element this button controls
458
- */
459
- "aria-controls"?: string;
460
-
461
- /**
462
- * Test ID for testing frameworks
463
- */
464
- testID?: string;
465
-
466
- /**
467
- * HTML id attribute
468
- */
469
- id?: string;
470
-
471
- /**
472
- * HTML type attribute for the button
473
- */
474
- type?: "button" | "submit" | "reset";
475
-
476
- /**
477
- * Whether the button should stretch to fill the full width of its container
478
- */
479
- fullWidth?: boolean;
480
- }
481
- /**
482
- * AppButton - A prominent filled button for app-level actions.
483
- *
484
- * Uses the `control.appButton` theme tokens for styling.
485
- * Supports all the same layout features as Button (icons, sublabels, etc.).
486
- */
487
- declare var AppButton: React.FC<AppButtonProps>;
488
- declare interface ButtonGroupProps {
489
- /**
490
- * Layout orientation of the buttons
491
- * @default 'horizontal'
492
- */
493
- orientation?: "horizontal" | "vertical";
494
-
495
- /**
496
- * Size of the button group, determines default gap between buttons
497
- * @default 'md'
498
- */
499
- size?: "xl" | "lg" | "md" | "sm" | "xs";
500
-
501
- /**
502
- * Buttons to be grouped
503
- */
504
- children: React.ReactNode;
505
-
506
- /**
507
- * Optional description text below the buttons
508
- */
509
- description?: string;
510
-
511
- /**
512
- * Optional error message text below the buttons
513
- */
514
- error?: string;
515
-
516
- /**
517
- * Custom gap between buttons (in pixels). If not provided, uses size and orientation based default.
518
- */
519
- gap?: number;
520
-
521
- /**
522
- * Accessible label for the button group
523
- */
524
- "aria-label"?: string;
525
-
526
- /**
527
- * ID of element that labels this button group
528
- */
529
- "aria-labelledby"?: string;
530
-
531
- /**
532
- * ID of element that describes this button group
533
- */
534
- "aria-describedby"?: string;
535
-
536
- /**
537
- * HTML id attribute
538
- */
539
- id?: string;
540
-
541
- /**
542
- * Test ID for testing frameworks
543
- */
544
- testID?: string;
545
- }
546
- /**
547
- * ButtonGroup - A container for grouping related buttons
548
- *
549
- * Provides semantic grouping for related actions with proper accessibility support.
550
- *
551
- * ## Accessibility Features
552
- *
553
- * - **Semantic Grouping**: Uses `role="group"` to indicate related buttons
554
- * - **Accessible Name**: Supports `aria-label` or `aria-labelledby` to describe the group's purpose
555
- * - **Error Announcements**: Errors are announced to screen readers via `aria-live`
556
- * - **Description Support**: Optional description text for additional context
557
- */
558
- declare var ButtonGroup: React.FC<ButtonGroupProps>;
559
- export type {
560
- AppButtonProps,
561
- ButtonGroupProps,
562
- ButtonProps,
563
- FlexButtonProps,
564
- IconButtonProps,
565
- };
566
- declare export { AppButton, Button, ButtonGroup, FlexButton, IconButton };
package/web/index.js.flow DELETED
@@ -1,566 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.21.0
5
- * @flow
6
- */
7
-
8
- import React, { Node } from "react";
9
- declare interface ButtonProps {
10
- /**
11
- * Visual variant of the button
12
- */
13
- variant?: "primary" | "secondary" | "tertiary" | "ghost";
14
-
15
- /**
16
- * Color tone of the button
17
- */
18
- tone?: "brand" | "brandExtra" | "alert" | "mono";
19
-
20
- /**
21
- * Size of the button
22
- */
23
- size?: "xl" | "lg" | "md" | "sm" | "xs";
24
-
25
- /**
26
- * Whether the button is disabled
27
- */
28
- disabled?: boolean;
29
-
30
- /**
31
- * Whether the button is in a loading state
32
- */
33
- loading?: boolean;
34
-
35
- /**
36
- * Button content
37
- */
38
- children: React.ReactNode;
39
-
40
- /**
41
- * Click handler
42
- */
43
- onPress?: () => void;
44
-
45
- /**
46
- * Icon to display on the left side.
47
- * Size and color are automatically set based on button size/state.
48
- * To override, specify size/color on the icon: `iconLeft={<ArrowLeft size={16} />}`
49
- */
50
- iconLeft?: React.ReactNode;
51
-
52
- /**
53
- * Icon to display on the right side.
54
- * Size and color are automatically set based on button size/state.
55
- * To override, specify size/color on the icon: `iconRight={<ArrowRight size={16} />}`
56
- */
57
- iconRight?: React.ReactNode;
58
-
59
- /**
60
- * Secondary text displayed inline with the main label (e.g., price), shown with 40% opacity
61
- */
62
- sublabel?: string;
63
-
64
- /**
65
- * Alignment of the label text
66
- */
67
- labelAlignment?: "left" | "center";
68
-
69
- /**
70
- * Small icon displayed directly next to the label text.
71
- * Size and color are automatically set based on button size/state.
72
- * To override, specify size/color on the icon: `labelIcon={<InfoIcon size={12} />}`
73
- */
74
- labelIcon?: React.ReactNode;
75
-
76
- /**
77
- * Custom content slot for badges, tags, or other elements
78
- */
79
- customContent?: React.ReactNode;
80
-
81
- /**
82
- * Accessible label for screen readers (use for icon-only buttons)
83
- */
84
- "aria-label"?: string;
85
-
86
- /**
87
- * ID of element that describes this button
88
- */
89
- "aria-describedby"?: string;
90
-
91
- /**
92
- * Indicates the button controls an expandable element
93
- */
94
- "aria-expanded"?: boolean;
95
-
96
- /**
97
- * Indicates the type of popup triggered by the button
98
- */
99
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
100
-
101
- /**
102
- * Indicates the button is pressed (for toggle buttons)
103
- */
104
- "aria-pressed"?: boolean | "mixed";
105
-
106
- /**
107
- * ID of the element this button controls
108
- */
109
- "aria-controls"?: string;
110
-
111
- /**
112
- * Test ID for testing frameworks
113
- */
114
- testID?: string;
115
-
116
- /**
117
- * HTML id attribute
118
- */
119
- id?: string;
120
-
121
- /**
122
- * HTML type attribute for the button
123
- */
124
- type?: "button" | "submit" | "reset";
125
-
126
- /**
127
- * Whether the button should stretch to fill the full width of its container
128
- */
129
- fullWidth?: boolean;
130
- }
131
- /**
132
- * Button - An accessible button component
133
- *
134
- * Renders as a semantic `<button>` element with full ARIA support.
135
- * Supports various visual variants, sizes, and states including loading.
136
- *
137
- * ## Accessibility Features
138
- *
139
- * - **Semantic HTML**: Renders as a native `<button>` element
140
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
141
- * - **ARIA States**: Properly announces disabled and loading states
142
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
143
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
144
- */
145
- declare var Button: React.FC<ButtonProps>;
146
- declare interface IconButtonProps {
147
- /**
148
- * Visual variant of the button
149
- */
150
- variant?: "primary" | "secondary" | "tertiary" | "ghost";
151
-
152
- /**
153
- * Color tone of the button
154
- */
155
- tone?: "brand" | "brandExtra" | "alert" | "mono";
156
-
157
- /**
158
- * Size of the button
159
- */
160
- size?: "xl" | "lg" | "md" | "sm" | "xs";
161
-
162
- /**
163
- * Whether the button is disabled
164
- */
165
- disabled?: boolean;
166
-
167
- /**
168
- * Whether the button is in a loading state
169
- */
170
- loading?: boolean;
171
-
172
- /**
173
- * Icon to display in the button (required).
174
- * Size and color are automatically set based on button size/state.
175
- * To override, specify size/color on the icon: `icon={<CloseIcon size={16} />}`
176
- */
177
- icon: React.ReactNode;
178
-
179
- /**
180
- * Click handler
181
- */
182
- onPress?: () => void;
183
-
184
- /**
185
- * Accessible label for screen readers (REQUIRED for icon-only buttons)
186
- * Since icon buttons have no visible text, this label is essential for accessibility.
187
- * @example aria-label="Close dialog"
188
- * @example aria-label="Open settings menu"
189
- */
190
- "aria-label": string;
191
-
192
- /**
193
- * ID of element that describes this button
194
- */
195
- "aria-describedby"?: string;
196
-
197
- /**
198
- * Indicates the button controls an expandable element
199
- */
200
- "aria-expanded"?: boolean;
201
-
202
- /**
203
- * Indicates the type of popup triggered by the button
204
- */
205
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
206
-
207
- /**
208
- * Indicates the button is pressed (for toggle buttons)
209
- */
210
- "aria-pressed"?: boolean | "mixed";
211
-
212
- /**
213
- * ID of the element this button controls
214
- */
215
- "aria-controls"?: string;
216
-
217
- /**
218
- * Test ID for testing frameworks
219
- */
220
- testID?: string;
221
-
222
- /**
223
- * HTML id attribute
224
- */
225
- id?: string;
226
-
227
- /**
228
- * HTML type attribute for the button
229
- */
230
- type?: "button" | "submit" | "reset";
231
- }
232
- /**
233
- * IconButton - An accessible icon-only button component
234
- *
235
- * Renders as a semantic `<button>` element with full ARIA support.
236
- * Supports various visual variants, sizes, and states including loading.
237
- *
238
- * ## Accessibility Features
239
- *
240
- * - **Semantic HTML**: Renders as a native `<button>` element
241
- * - **Required aria-label**: Ensures screen readers can announce the button's purpose
242
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
243
- * - **ARIA States**: Properly announces disabled and loading states
244
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
245
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
246
- *
247
- * ## Usage
248
- *
249
- * ```tsx
250
- * // Basic usage - aria-label is required
251
- * <IconButton icon={<CloseIcon />} aria-label="Close dialog" onPress={handleClose} />
252
- *
253
- * // Toggle button
254
- * <IconButton
255
- * icon={<MenuIcon />}
256
- * aria-label="Toggle menu"
257
- * aria-expanded={isOpen}
258
- * aria-controls="menu-id"
259
- * onPress={toggleMenu}
260
- * />
261
- *
262
- * // Loading state
263
- * <IconButton icon={<SaveIcon />} aria-label="Save changes" loading />
264
- * ```
265
- */
266
- declare var IconButton: React.FC<IconButtonProps>;
267
- declare type FlexButtonProps = {
268
- /**
269
- * Button content
270
- */
271
- children: Node,
272
-
273
- /**
274
- * Visual variant of the button
275
- */
276
- variant?:
277
- | "brand"
278
- | "primary"
279
- | "secondary"
280
- | "tertiary"
281
- | "brandExtra"
282
- | "inverse",
283
-
284
- /**
285
- * Size of the button
286
- */
287
- size?: "xl" | "lg" | "md" | "sm" | "xs",
288
-
289
- /**
290
- * Whether to show background fill
291
- */
292
- background?: boolean,
293
-
294
- /**
295
- * Whether the button is disabled
296
- */
297
- disabled?: boolean,
298
-
299
- /**
300
- * Whether the button is in a loading state
301
- */
302
- loading?: boolean,
303
-
304
- /**
305
- * Icon to display on the left side
306
- */
307
- iconLeft?: Node,
308
-
309
- /**
310
- * Icon to display on the right side
311
- */
312
- iconRight?: Node,
313
-
314
- /**
315
- * Click handler
316
- */
317
- onPress?: () => void,
318
-
319
- /**
320
- * HTML type attribute for the button
321
- */
322
- type?: "button" | "submit" | "reset",
323
-
324
- /**
325
- * Accessible label for screen readers
326
- */
327
- "aria-label"?: string,
328
-
329
- /**
330
- * ID of element that describes this button
331
- */
332
- "aria-describedby"?: string,
333
-
334
- /**
335
- * Indicates the button controls an expandable element
336
- */
337
- "aria-expanded"?: boolean,
338
-
339
- /**
340
- * Indicates the type of popup triggered by the button
341
- */
342
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog",
343
-
344
- /**
345
- * Indicates the button is pressed (for toggle buttons)
346
- */
347
- "aria-pressed"?: boolean | "mixed",
348
-
349
- /**
350
- * ID of the element this button controls
351
- */
352
- "aria-controls"?: string,
353
-
354
- /**
355
- * Test ID for testing frameworks
356
- */
357
- testID?: string,
358
- ...
359
- } & $Diff<React.ButtonHTMLAttributes<HTMLButtonElement>, { type: any }>;
360
-
361
- /**
362
- * FlexButton - A compact button component designed for use in modals and popups.
363
- *
364
- * Renders as a semantic `<button>` element with full ARIA support.
365
- *
366
- * ## Accessibility Features
367
- *
368
- * - **Semantic HTML**: Renders as a native `<button>` element
369
- * - **Keyboard Navigation**: Focusable via Tab, activated with Enter or Space
370
- * - **ARIA States**: Properly announces disabled and loading states
371
- * - **Focus Indicator**: Visible focus ring for keyboard navigation
372
- * - **Screen Reader Support**: Announces button label, state, and any associated descriptions
373
- */
374
- declare var FlexButton: React.FC<FlexButtonProps>;
375
- declare interface AppButtonProps {
376
- /**
377
- * Size of the button
378
- */
379
- size?: "xl" | "lg" | "md" | "sm" | "xs";
380
-
381
- /**
382
- * Whether the button is disabled
383
- */
384
- disabled?: boolean;
385
-
386
- /**
387
- * Whether the button is in a loading state
388
- */
389
- loading?: boolean;
390
-
391
- /**
392
- * Button content
393
- */
394
- children: React.ReactNode;
395
-
396
- /**
397
- * Click handler
398
- */
399
- onPress?: () => void;
400
-
401
- /**
402
- * Icon to display on the left side
403
- */
404
- iconLeft?: React.ReactNode;
405
-
406
- /**
407
- * Icon to display on the right side
408
- */
409
- iconRight?: React.ReactNode;
410
-
411
- /**
412
- * Secondary text displayed inline with the main label
413
- */
414
- sublabel?: string;
415
-
416
- /**
417
- * Alignment of the label text
418
- */
419
- labelAlignment?: "left" | "center";
420
-
421
- /**
422
- * Small icon displayed directly next to the label text
423
- */
424
- labelIcon?: React.ReactNode;
425
-
426
- /**
427
- * Custom content slot for badges, tags, or other elements
428
- */
429
- customContent?: React.ReactNode;
430
-
431
- /**
432
- * Accessible label for screen readers
433
- */
434
- "aria-label"?: string;
435
-
436
- /**
437
- * ID of element that describes this button
438
- */
439
- "aria-describedby"?: string;
440
-
441
- /**
442
- * Indicates the button controls an expandable element
443
- */
444
- "aria-expanded"?: boolean;
445
-
446
- /**
447
- * Indicates the type of popup triggered by the button
448
- */
449
- "aria-haspopup"?: boolean | "menu" | "listbox" | "tree" | "grid" | "dialog";
450
-
451
- /**
452
- * Indicates the button is pressed (for toggle buttons)
453
- */
454
- "aria-pressed"?: boolean | "mixed";
455
-
456
- /**
457
- * ID of the element this button controls
458
- */
459
- "aria-controls"?: string;
460
-
461
- /**
462
- * Test ID for testing frameworks
463
- */
464
- testID?: string;
465
-
466
- /**
467
- * HTML id attribute
468
- */
469
- id?: string;
470
-
471
- /**
472
- * HTML type attribute for the button
473
- */
474
- type?: "button" | "submit" | "reset";
475
-
476
- /**
477
- * Whether the button should stretch to fill the full width of its container
478
- */
479
- fullWidth?: boolean;
480
- }
481
- /**
482
- * AppButton - A prominent filled button for app-level actions.
483
- *
484
- * Uses the `control.appButton` theme tokens for styling.
485
- * Supports all the same layout features as Button (icons, sublabels, etc.).
486
- */
487
- declare var AppButton: React.FC<AppButtonProps>;
488
- declare interface ButtonGroupProps {
489
- /**
490
- * Layout orientation of the buttons
491
- * @default 'horizontal'
492
- */
493
- orientation?: "horizontal" | "vertical";
494
-
495
- /**
496
- * Size of the button group, determines default gap between buttons
497
- * @default 'md'
498
- */
499
- size?: "xl" | "lg" | "md" | "sm" | "xs";
500
-
501
- /**
502
- * Buttons to be grouped
503
- */
504
- children: React.ReactNode;
505
-
506
- /**
507
- * Optional description text below the buttons
508
- */
509
- description?: string;
510
-
511
- /**
512
- * Optional error message text below the buttons
513
- */
514
- error?: string;
515
-
516
- /**
517
- * Custom gap between buttons (in pixels). If not provided, uses size and orientation based default.
518
- */
519
- gap?: number;
520
-
521
- /**
522
- * Accessible label for the button group
523
- */
524
- "aria-label"?: string;
525
-
526
- /**
527
- * ID of element that labels this button group
528
- */
529
- "aria-labelledby"?: string;
530
-
531
- /**
532
- * ID of element that describes this button group
533
- */
534
- "aria-describedby"?: string;
535
-
536
- /**
537
- * HTML id attribute
538
- */
539
- id?: string;
540
-
541
- /**
542
- * Test ID for testing frameworks
543
- */
544
- testID?: string;
545
- }
546
- /**
547
- * ButtonGroup - A container for grouping related buttons
548
- *
549
- * Provides semantic grouping for related actions with proper accessibility support.
550
- *
551
- * ## Accessibility Features
552
- *
553
- * - **Semantic Grouping**: Uses `role="group"` to indicate related buttons
554
- * - **Accessible Name**: Supports `aria-label` or `aria-labelledby` to describe the group's purpose
555
- * - **Error Announcements**: Errors are announced to screen readers via `aria-live`
556
- * - **Description Support**: Optional description text for additional context
557
- */
558
- declare var ButtonGroup: React.FC<ButtonGroupProps>;
559
- export type {
560
- AppButtonProps,
561
- ButtonGroupProps,
562
- ButtonProps,
563
- FlexButtonProps,
564
- IconButtonProps,
565
- };
566
- declare export { AppButton, Button, ButtonGroup, FlexButton, IconButton };