@bug-on/m3-expressive 1.0.0 → 1.1.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 +29 -2
- package/README.md +20 -18
- package/dist/assets/material-symbols-self-hosted.css +27 -26
- package/dist/buttons.d.mts +1 -1
- package/dist/buttons.d.ts +1 -1
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.d.mts +44 -44
- package/dist/core.d.ts +44 -44
- package/dist/core.js.map +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +54 -54
- package/dist/feedback.d.ts +54 -54
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +40 -40
- package/dist/layout.d.ts +40 -40
- package/dist/layout.js +5 -5
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +5 -5
- package/dist/layout.mjs.map +1 -1
- package/dist/material-symbols-self-hosted.css +27 -26
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +2 -2
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +2 -2
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.d.mts +241 -243
- package/dist/pickers.d.ts +241 -243
- package/dist/pickers.js +1 -1
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +1 -1
- package/dist/pickers.mjs.map +1 -1
- package/dist/{side-sheet-modal-BY6VCC8p.d.mts → side-sheet-modal-64FGhDxL.d.mts} +20 -21
- package/dist/{side-sheet-modal-CglP6KYA.d.ts → side-sheet-modal-Bd5Qqvp9.d.ts} +20 -21
- package/dist/{split-button-trailing-uncheckable-MXj_kyNt.d.mts → split-button-trailing-uncheckable-BRPuTqi1.d.mts} +140 -151
- package/dist/{split-button-trailing-uncheckable-C5CLCIKP.d.ts → split-button-trailing-uncheckable-CjOFCoyW.d.ts} +140 -151
- package/dist/typography.css +5 -0
- package/package.json +4 -4
|
@@ -175,72 +175,72 @@ declare const BUTTON_COLOR_TOKENS: {
|
|
|
175
175
|
type ButtonGroupVariant = "standard" | "connected" | "navbar";
|
|
176
176
|
type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
177
177
|
/**
|
|
178
|
-
*
|
|
178
|
+
* Props for ButtonGroup component.
|
|
179
179
|
*/
|
|
180
180
|
interface ButtonGroupProps extends React$1.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
183
|
-
* - `standard`:
|
|
184
|
-
* - `connected`:
|
|
185
|
-
* - `navbar`:
|
|
182
|
+
* Display variant of the button group:
|
|
183
|
+
* - `standard`: Independent buttons with gap spacing.
|
|
184
|
+
* - `connected`: Connected buttons sharing borders (Segmented Button).
|
|
185
|
+
* - `navbar`: Navigation bar variant with animated active sliding indicator pill.
|
|
186
186
|
* @default "standard"
|
|
187
187
|
*/
|
|
188
188
|
variant?: ButtonGroupVariant;
|
|
189
189
|
/**
|
|
190
|
-
*
|
|
190
|
+
* Layout orientation of buttons in group.
|
|
191
191
|
* @default "horizontal"
|
|
192
192
|
*/
|
|
193
193
|
orientation?: ButtonGroupOrientation;
|
|
194
194
|
/**
|
|
195
|
-
*
|
|
195
|
+
* When `true`, expands `standard` group to stretch full width of container.
|
|
196
196
|
* @default false
|
|
197
197
|
*/
|
|
198
198
|
fullWidth?: boolean;
|
|
199
199
|
/**
|
|
200
|
-
*
|
|
200
|
+
* Applies unified `size` to all child buttons in group (overrides individual button sizes).
|
|
201
201
|
*/
|
|
202
202
|
size?: MD3Size;
|
|
203
203
|
/**
|
|
204
|
-
*
|
|
204
|
+
* Toggles width expansion/padding animation (Morphing Width) when buttons are pressed (`standard` group).
|
|
205
205
|
* @default true
|
|
206
206
|
*/
|
|
207
207
|
morphingWidth?: boolean;
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
209
|
+
* Expansion ratio for button width on press (`standard` horizontal group).
|
|
210
|
+
* Per MD3 Spec, default is 0.15 (15%).
|
|
211
211
|
* @default 0.15
|
|
212
212
|
*/
|
|
213
213
|
expandedRatio?: number;
|
|
214
214
|
/**
|
|
215
|
-
*
|
|
215
|
+
* Automatically displays Check icon when a child button has `selected={true}`.
|
|
216
216
|
* @default false
|
|
217
217
|
*/
|
|
218
218
|
showCheck?: boolean;
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
221
|
-
* - `selected`:
|
|
222
|
-
* - `all`:
|
|
223
|
-
* - `none`:
|
|
220
|
+
* Controls icon display behavior (primarily for `navbar`).
|
|
221
|
+
* - `selected`: Display icon only on selected item.
|
|
222
|
+
* - `all`: Display on all items.
|
|
223
|
+
* - `none`: Hide all icons.
|
|
224
224
|
*/
|
|
225
225
|
iconBehavior?: "selected" | "all" | "none";
|
|
226
226
|
/**
|
|
227
|
-
*
|
|
228
|
-
* - `selected`:
|
|
229
|
-
* - `all`:
|
|
230
|
-
* - `none`:
|
|
227
|
+
* Controls label display behavior (primarily for `navbar`).
|
|
228
|
+
* - `selected`: Display label only on selected item.
|
|
229
|
+
* - `all`: Display on all items.
|
|
230
|
+
* - `none`: Hide all labels.
|
|
231
231
|
*/
|
|
232
232
|
labelBehavior?: "selected" | "all" | "none";
|
|
233
233
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
234
|
+
* Enable Active Morphing mode (selection-based).
|
|
235
|
+
* When `true`, buttons automatically expand/contract based on selection state,
|
|
236
|
+
* creating smooth size transitions.
|
|
237
|
+
* When `false` or `undefined`, Group responds to `isPressed` by default.
|
|
238
238
|
*/
|
|
239
239
|
activeMorphing?: boolean;
|
|
240
240
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
241
|
+
* Custom CSS class applied to individual child buttons in group.
|
|
242
|
+
* Useful for customizing padding, min-width, or other layout properties.
|
|
243
|
+
* For `navbar` variant, overrides default padding styles.
|
|
244
244
|
*/
|
|
245
245
|
itemClassName?: string;
|
|
246
246
|
}
|
|
@@ -287,236 +287,225 @@ declare const ExtendedFAB: React$1.NamedExoticComponent<Omit<ExtendedFABProps, "
|
|
|
287
287
|
|
|
288
288
|
type MotionButtonProps$1 = Omit<HTMLMotionProps<"button">, "children" | "color">;
|
|
289
289
|
/**
|
|
290
|
-
*
|
|
290
|
+
* Props for `FAB` Floating Action Button component.
|
|
291
291
|
*
|
|
292
292
|
* @remarks
|
|
293
|
-
* -
|
|
294
|
-
* -
|
|
295
|
-
* -
|
|
296
|
-
*
|
|
293
|
+
* - Ensure icon-only FABs specify `aria-label` for accessibility.
|
|
294
|
+
* - In extended mode (`extended={true}`), text passed to `children` acts as the label, so `aria-label` may be omitted if children is string.
|
|
295
|
+
* - `lowered` prop reduces the container shadow to MD3 "lowered" FAB specification;
|
|
296
|
+
* useful when placed on surface containers like Bottom App Bars for visual balance.
|
|
297
297
|
*
|
|
298
298
|
* @see https://m3.material.io/components/floating-action-button/overview
|
|
299
299
|
*/
|
|
300
300
|
interface FABProps extends MotionButtonProps$1 {
|
|
301
301
|
/**
|
|
302
|
-
* Icon
|
|
303
|
-
*
|
|
302
|
+
* Icon element to render — typically an Icon component.
|
|
303
|
+
* Swapped for loading spinner when `loading={true}`.
|
|
304
304
|
*/
|
|
305
305
|
icon: React$1.ReactNode;
|
|
306
306
|
/**
|
|
307
|
-
*
|
|
308
|
-
* - `sm`: Small (40dp) —
|
|
309
|
-
* - `md`: Regular (56dp) —
|
|
310
|
-
* - `lg`: Large (96dp) —
|
|
311
|
-
* - `xl`: Extra-large (136dp) —
|
|
307
|
+
* FAB size variant according to MD3 specification.
|
|
308
|
+
* - `sm`: Small (40dp) — Recommended for tight layouts / inside content.
|
|
309
|
+
* - `md`: Regular (56dp) — Standard primary action.
|
|
310
|
+
* - `lg`: Large (96dp) — High-emphasis action.
|
|
311
|
+
* - `xl`: Extra-large (136dp) — Spotlight action element.
|
|
312
312
|
* @default "md"
|
|
313
313
|
*/
|
|
314
314
|
size?: "sm" | "md" | "lg" | "xl";
|
|
315
315
|
/**
|
|
316
|
-
*
|
|
316
|
+
* MD3 color role container style.
|
|
317
317
|
* @default "primary"
|
|
318
318
|
*/
|
|
319
319
|
colorStyle?: "primary" | "secondary" | "tertiary" | "surface";
|
|
320
320
|
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
321
|
+
* When `true`, expands FAB to display label text alongside icon.
|
|
322
|
+
* Width automatically expands to fit `children`.
|
|
323
323
|
* @default false
|
|
324
324
|
*/
|
|
325
325
|
extended?: boolean;
|
|
326
326
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
327
|
+
* Label content rendered when `extended={true}`.
|
|
328
|
+
* Plain string recommended.
|
|
329
329
|
*/
|
|
330
330
|
children?: React$1.ReactNode;
|
|
331
331
|
/**
|
|
332
|
-
*
|
|
333
|
-
* Mảng bám ở Bottom bar hay Top bar Surface để ránh rườm rà.
|
|
332
|
+
* When `true`, reduces container shadow to lowered elevation.
|
|
334
333
|
* @default false
|
|
335
334
|
*/
|
|
336
335
|
lowered?: boolean;
|
|
337
336
|
/**
|
|
338
|
-
*
|
|
337
|
+
* When `true`, displays loading spinner and disables click interactions.
|
|
339
338
|
* @default false
|
|
340
339
|
*/
|
|
341
340
|
loading?: boolean;
|
|
342
341
|
/**
|
|
343
|
-
*
|
|
342
|
+
* Loading spinner variant.
|
|
344
343
|
* @default "loading-indicator"
|
|
345
344
|
*/
|
|
346
345
|
loadingVariant?: "loading-indicator" | "circular";
|
|
347
346
|
/**
|
|
348
|
-
*
|
|
347
|
+
* Controls FAB visibility in layout using scale motion animation.
|
|
349
348
|
* @default true
|
|
350
349
|
*/
|
|
351
350
|
visible?: boolean;
|
|
352
351
|
}
|
|
353
352
|
/**
|
|
354
|
-
*
|
|
353
|
+
* Props for `FABPosition` layout wrapper component.
|
|
354
|
+
* Position absolute wrapper to anchor FAB to a screen corner.
|
|
355
355
|
*
|
|
356
356
|
* @see {@link FABPosition}
|
|
357
357
|
*/
|
|
358
358
|
interface FABPositionProps {
|
|
359
359
|
/**
|
|
360
|
-
*
|
|
360
|
+
* Screen corner position for FAB.
|
|
361
361
|
* @default "bottom-right"
|
|
362
362
|
*/
|
|
363
363
|
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
364
|
-
/**
|
|
364
|
+
/** Child elements — typically a `<FAB>` component */
|
|
365
365
|
children: React$1.ReactNode;
|
|
366
|
-
/** CSS
|
|
366
|
+
/** Additional CSS class */
|
|
367
367
|
className?: string;
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
|
-
*
|
|
370
|
+
* Absolute position wrapper component for `<FAB>`.
|
|
371
371
|
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
372
|
+
* Anchors FAB to a screen corner with responsive offset padding.
|
|
373
|
+
* Requires parent element to have `position: relative`.
|
|
374
374
|
*
|
|
375
|
-
* @example
|
|
376
|
-
* ```tsx
|
|
377
|
-
* <div className="relative min-h-screen">
|
|
378
|
-
* // Cái nút sẽ xà xuống dưới cùng bên lề Trái
|
|
379
|
-
* <FABPosition position="bottom-left">
|
|
380
|
-
* <FAB icon={<Icon name="edit" />} aria-label="Compose New Mail" />
|
|
381
|
-
* </FABPosition>
|
|
382
|
-
* </div>
|
|
383
|
-
* ```
|
|
384
|
-
*
|
|
385
|
-
* @see {@link FAB}
|
|
386
375
|
* @see https://m3.material.io/components/floating-action-button/guidelines
|
|
387
376
|
*/
|
|
388
377
|
declare function FABPosition({ position, children, className, }: FABPositionProps): react_jsx_runtime.JSX.Element;
|
|
389
378
|
/**
|
|
390
|
-
* Action
|
|
379
|
+
* Primary Floating Action Button (FAB) component adhering to MD3 Expressive.
|
|
391
380
|
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* Trạng thái load/nhấp hiện xuất cùng animation thu scale thoát cảnh bắt mắt đầy nghệ thuật.
|
|
381
|
+
* Supports sizes from SM to XL, multiple color roles, extended label expansion,
|
|
382
|
+
* loading states, and entrance/exit scale motion animations.
|
|
395
383
|
*
|
|
396
384
|
* @remarks
|
|
397
|
-
* -
|
|
398
|
-
* -
|
|
399
|
-
*
|
|
400
|
-
* -
|
|
401
|
-
* - Sài kèm `FABPosition` bao đùm nó lại nếu bạn muốn xích nó cố định ngấm chân sâu góc màn hình hiển thị.
|
|
385
|
+
* - Requires `aria-label` for icon-only FABs.
|
|
386
|
+
* - When `extended={true}`, string `children` is automatically used as the accessible label.
|
|
387
|
+
* - Animates scale out when `visible={false}` using fluid spring animation.
|
|
388
|
+
* - Combine with `FABPosition` to anchor to screen corners.
|
|
402
389
|
*
|
|
403
390
|
* @example
|
|
404
391
|
* ```tsx
|
|
405
|
-
* //
|
|
406
|
-
* <FAB icon={<Icon name="search" />} aria-label="
|
|
392
|
+
* // Basic small icon-only FAB
|
|
393
|
+
* <FAB icon={<Icon name="search" />} aria-label="Search" size="sm" />
|
|
407
394
|
*
|
|
408
|
-
* //
|
|
395
|
+
* // Extended FAB with label
|
|
409
396
|
* const [isOpen, setOpen] = React.useState(false);
|
|
410
397
|
* <FAB
|
|
411
398
|
* icon={<Icon name="edit" />}
|
|
412
399
|
* extended={isOpen}
|
|
413
400
|
* onClick={() => setOpen(!isOpen)}
|
|
414
401
|
* >
|
|
415
|
-
*
|
|
402
|
+
* Compose
|
|
416
403
|
* </FAB>
|
|
417
404
|
*
|
|
418
|
-
* // FAB
|
|
405
|
+
* // Large FAB with loading state
|
|
419
406
|
* <FAB
|
|
420
407
|
* icon={<Icon name="upload" />}
|
|
408
|
+
|
|
421
409
|
* size="lg"
|
|
422
410
|
* loading={isUploading}
|
|
423
411
|
* colorStyle="secondary"
|
|
424
|
-
* aria-label="Upload
|
|
412
|
+
* aria-label="Upload files"
|
|
425
413
|
* />
|
|
426
414
|
*
|
|
427
|
-
* //
|
|
415
|
+
* // Fixed at bottom right
|
|
428
416
|
* <FABPosition position="bottom-right">
|
|
429
|
-
* <FAB icon={<Icon name="add" />} aria-label="
|
|
417
|
+
* <FAB icon={<Icon name="add" />} aria-label="Add item" />
|
|
430
418
|
* </FABPosition>
|
|
431
419
|
* ```
|
|
420
|
+
|
|
432
421
|
*
|
|
433
422
|
* @see https://m3.material.io/components/floating-action-button/overview
|
|
434
423
|
*/
|
|
435
424
|
declare const FAB: React$1.NamedExoticComponent<Omit<FABProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
436
425
|
|
|
437
426
|
/**
|
|
438
|
-
*
|
|
427
|
+
* Data interface for each action item in FAB menu.
|
|
439
428
|
*
|
|
440
|
-
*
|
|
429
|
+
* If `label` is omitted, renders as an icon-only item.
|
|
441
430
|
*/
|
|
442
431
|
interface FABMenuItemData {
|
|
443
|
-
/**
|
|
432
|
+
/** Unique ID used for React keys and focus tracking. */
|
|
444
433
|
id: string;
|
|
445
|
-
/** Label
|
|
434
|
+
/** Label displayed adjacent to icon (optional). Omit for icon-only item. */
|
|
446
435
|
label?: string;
|
|
447
|
-
/**
|
|
436
|
+
/** Icon node — typically an SVG icon component. */
|
|
448
437
|
icon: React$1.ReactNode;
|
|
449
|
-
/**
|
|
438
|
+
/** Callback invoked when item is activated (click, Enter, or Space). */
|
|
450
439
|
onClick: () => void;
|
|
451
440
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
441
|
+
* When `true`, visually and interactively disables the item.
|
|
442
|
+
* Uses `aria-disabled` instead of HTML `disabled` to preserve focusability for accessibility.
|
|
454
443
|
* @default false
|
|
455
444
|
*/
|
|
456
445
|
disabled?: boolean;
|
|
457
|
-
/**
|
|
446
|
+
/** Additional CSS class names for item wrapper. */
|
|
458
447
|
className?: string;
|
|
459
448
|
}
|
|
460
449
|
/**
|
|
461
|
-
*
|
|
450
|
+
* Props controlling the main `FABMenu` component.
|
|
462
451
|
*
|
|
463
452
|
* @remarks
|
|
464
|
-
* FABMenu
|
|
465
|
-
*
|
|
466
|
-
* do đó bạn có thể quản lý qua react state, hoặc dùng router hay business logic khác.
|
|
453
|
+
* FABMenu manages menu open/close lifecycle, focus trapping, keyboard control,
|
|
454
|
+
* and staggered motion transitions. `expanded` state is controlled externally.
|
|
467
455
|
*/
|
|
468
456
|
interface FABMenuProps {
|
|
469
|
-
/** FAB Menu
|
|
457
|
+
/** Whether the FAB Menu is open (expanded). */
|
|
470
458
|
expanded: boolean;
|
|
471
|
-
/**
|
|
459
|
+
/** Callback invoked when Toggle FAB is interacted with or backdrop dismissed. */
|
|
472
460
|
onToggle: (expanded: boolean) => void;
|
|
473
|
-
/**
|
|
461
|
+
/** List of action items (MD3 spec recommends 2–6 items). */
|
|
474
462
|
items: FABMenuItemData[];
|
|
475
463
|
/**
|
|
476
|
-
*
|
|
464
|
+
* MD3 container color role for trigger FAB and menu items.
|
|
477
465
|
* @default "primary"
|
|
478
466
|
*/
|
|
479
467
|
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
480
468
|
/**
|
|
481
|
-
*
|
|
469
|
+
* Initial size variant for ToggleFAB (morphs into close icon when expanded).
|
|
482
470
|
* @default "baseline"
|
|
483
471
|
*/
|
|
484
472
|
fabSize?: "baseline" | "medium" | "large";
|
|
485
473
|
/**
|
|
486
|
-
*
|
|
487
|
-
* - `"end"`:
|
|
488
|
-
* - `"start"`:
|
|
489
|
-
* - `"center"`:
|
|
474
|
+
* Menu items alignment relative to Toggle FAB.
|
|
475
|
+
* - `"end"`: Items align to right edge (trailing edge, recommended for RTL).
|
|
476
|
+
* - `"start"`: Items align along left edge.
|
|
477
|
+
* - `"center"`: Items align vertically centered above FAB.
|
|
490
478
|
* @default "end"
|
|
491
479
|
*/
|
|
492
480
|
alignment?: "start" | "end" | "center";
|
|
493
|
-
/**
|
|
481
|
+
/** Custom CSS className for root component. */
|
|
494
482
|
className?: string;
|
|
495
483
|
/**
|
|
496
|
-
*
|
|
484
|
+
* When `true`, clicking backdrop overlay closes menu.
|
|
497
485
|
* @default true
|
|
498
486
|
*/
|
|
499
487
|
closeOnBackdropClick?: boolean;
|
|
500
488
|
/**
|
|
501
|
-
*
|
|
502
|
-
*
|
|
489
|
+
* When `true`, focus automatically moves to the LAST item (closest above FAB) when expanded.
|
|
490
|
+
* If `false`, focus moves to the FIRST item in list.
|
|
491
|
+
|
|
503
492
|
* @default true
|
|
504
493
|
*/
|
|
505
494
|
focusLast?: boolean;
|
|
506
|
-
/**
|
|
495
|
+
/** Required `aria-label` for ToggleFAB for accessibility. */
|
|
507
496
|
"aria-label"?: string;
|
|
508
497
|
}
|
|
509
498
|
/**
|
|
510
|
-
* Props
|
|
499
|
+
* Props for standalone `ToggleFAB` component.
|
|
511
500
|
*/
|
|
512
501
|
interface ToggleFABProps {
|
|
513
|
-
/**
|
|
502
|
+
/** Whether the button is in expanded/active state. */
|
|
514
503
|
expanded: boolean;
|
|
515
|
-
/**
|
|
504
|
+
/** Callback fired when button toggle state changes. */
|
|
516
505
|
onToggle: (expanded: boolean) => void;
|
|
517
506
|
/**
|
|
518
|
-
*
|
|
519
|
-
*
|
|
507
|
+
* Icon generator function receiving `progress` between `0` -> `1` (collapsed -> expanded).
|
|
508
|
+
* Useful for icon morphing effects during animation (e.g., plus to close icon).
|
|
520
509
|
*
|
|
521
510
|
* @example
|
|
522
511
|
* ```tsx
|
|
@@ -524,47 +513,47 @@ interface ToggleFABProps {
|
|
|
524
513
|
* ```
|
|
525
514
|
*/
|
|
526
515
|
icon: (progress: number) => React$1.ReactNode;
|
|
527
|
-
/**
|
|
516
|
+
/** MD3 container color role. @default "primary" */
|
|
528
517
|
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
529
|
-
/**
|
|
518
|
+
/** Initial FAB size variant. @default "baseline" */
|
|
530
519
|
fabSize?: "baseline" | "medium" | "large";
|
|
531
|
-
/** CSS
|
|
520
|
+
/** Additional CSS class name. */
|
|
532
521
|
className?: string;
|
|
533
|
-
/**
|
|
522
|
+
/** Accessible label requirement. Required. */
|
|
534
523
|
"aria-label"?: string;
|
|
535
|
-
/**
|
|
524
|
+
/** ID link for aria-controls attribute to reference menu. */
|
|
536
525
|
"aria-controls"?: string;
|
|
537
|
-
/**
|
|
526
|
+
/** Component ID. */
|
|
538
527
|
id?: string;
|
|
539
528
|
}
|
|
540
529
|
/**
|
|
541
|
-
* Props
|
|
530
|
+
* Props for an individual `FABMenuItem`.
|
|
542
531
|
*/
|
|
543
532
|
interface FABMenuItemProps {
|
|
544
|
-
/**
|
|
533
|
+
/** Icon node to display. */
|
|
545
534
|
icon: React$1.ReactNode;
|
|
546
|
-
/**
|
|
535
|
+
/** Descriptive label text adjacent to icon. */
|
|
547
536
|
label?: string;
|
|
548
|
-
/**
|
|
537
|
+
/** Callback fired when item is clicked. */
|
|
549
538
|
onClick: () => void;
|
|
550
|
-
/**
|
|
539
|
+
/** Disables interaction while keeping element focusable in tab order. @default false */
|
|
551
540
|
disabled?: boolean;
|
|
552
|
-
/** Container
|
|
541
|
+
/** Container color role. @default "primary" */
|
|
553
542
|
colorVariant?: "primary" | "secondary" | "tertiary";
|
|
554
543
|
/** Custom CSS className. */
|
|
555
544
|
className?: string;
|
|
556
|
-
/**
|
|
545
|
+
/** Item index used for staggered animation delay. */
|
|
557
546
|
index?: number;
|
|
558
|
-
/**
|
|
547
|
+
/** Total items count in menu array. */
|
|
559
548
|
totalItems?: number;
|
|
560
|
-
/**
|
|
549
|
+
/** Logic `tabIndex` value for manual keyboard navigation. */
|
|
561
550
|
tabIndex?: number;
|
|
562
551
|
}
|
|
563
552
|
/**
|
|
564
|
-
*
|
|
553
|
+
* Toggle FAB button (Morphing FAB) usable as standalone or trigger for `FABMenu`.
|
|
565
554
|
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
555
|
+
* Container shape transitions from squircle to circle (square → circle) and shifts colors
|
|
556
|
+
* when `expanded` state changes from false → true.
|
|
568
557
|
*
|
|
569
558
|
* @example
|
|
570
559
|
* ```tsx
|
|
@@ -580,45 +569,45 @@ interface FABMenuItemProps {
|
|
|
580
569
|
*/
|
|
581
570
|
declare const ToggleFAB: React$1.NamedExoticComponent<ToggleFABProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
582
571
|
/**
|
|
583
|
-
*
|
|
572
|
+
* Single action item within a `FABMenu`.
|
|
584
573
|
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
574
|
+
* Renders a pill shape enclosing icon and optional label text.
|
|
575
|
+
* When `label` is omitted, renders as a square item containing only icon.
|
|
576
|
+
* Includes MD3 Ripple and 48dp touch target area per WCAG 2.5.5 touch target guidelines.
|
|
588
577
|
*
|
|
589
578
|
* @remarks
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
* (quy chuẩn chặt chẽ của Material Design 3).
|
|
579
|
+
* Disabled items use `aria-disabled="true"` rather than native HTML `disabled`
|
|
580
|
+
* so they remain focusable in the tab sequence per MD3 specification.
|
|
593
581
|
*/
|
|
594
582
|
declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, className, tabIndex, }: FABMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
595
583
|
/**
|
|
596
584
|
* MD3 Expressive FAB Menu.
|
|
597
585
|
*
|
|
598
|
-
*
|
|
586
|
+
* Floating Action Button expansion menu. Toggling trigger button reveals vertically stacked action items.
|
|
599
587
|
*
|
|
600
|
-
*
|
|
601
|
-
* -
|
|
602
|
-
* -
|
|
603
|
-
* -
|
|
604
|
-
* -
|
|
588
|
+
* Full MD3 Accessibility implementation:
|
|
589
|
+
* - `role="menu"` assigned to container
|
|
590
|
+
* - `role="menuitem"` assigned to child action items
|
|
591
|
+
* - Focus lifecycle management: Open -> Focus first/last menu item; Close -> Restore focus to ToggleFAB
|
|
592
|
+
* - Keyboard navigation: Escape key closes menu, ArrowUp/Down navigates items, Tab moves focus.
|
|
605
593
|
*
|
|
606
594
|
* @example
|
|
607
595
|
* ```tsx
|
|
608
596
|
* const [open, setOpen] = React.useState(false);
|
|
609
597
|
*
|
|
610
598
|
* const items = [
|
|
611
|
-
* { id: 'share', icon: <Icon name="share" />, label: '
|
|
612
|
-
* { id: 'edit', icon: <Icon name="edit" />, label: '
|
|
613
|
-
* { id: 'delete', icon: <Icon name="delete" />, label: '
|
|
599
|
+
* { id: 'share', icon: <Icon name="share" />, label: 'Share', onClick: () => console.log('Share') },
|
|
600
|
+
* { id: 'edit', icon: <Icon name="edit" />, label: 'Edit', onClick: () => console.log('Edit') },
|
|
601
|
+
* { id: 'delete', icon: <Icon name="delete" />, label: 'Delete', disabled: true, onClick: () => {} }
|
|
614
602
|
* ];
|
|
615
603
|
*
|
|
616
604
|
* <FABMenu
|
|
617
605
|
* expanded={open}
|
|
618
606
|
* onToggle={setOpen}
|
|
619
|
-
* aria-label="
|
|
607
|
+
* aria-label="Quick actions"
|
|
620
608
|
* alignment="center"
|
|
621
609
|
* colorVariant="tertiary"
|
|
610
|
+
|
|
622
611
|
* items={items}
|
|
623
612
|
* />
|
|
624
613
|
* ```
|