@aurora-ds/components 1.1.7 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +397 -50
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +397 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +363 -57
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes, AriaRole, AriaAttributes } from 'react';
|
|
1
|
+
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes, MouseEvent, AriaRole, AriaAttributes } from 'react';
|
|
2
2
|
|
|
3
3
|
declare const lightPalette: {
|
|
4
4
|
surfaceBackground: string;
|
|
@@ -282,8 +282,11 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
|
282
282
|
isLoading?: boolean;
|
|
283
283
|
/** Native button type. @default 'button' */
|
|
284
284
|
type?: 'button' | 'submit' | 'reset';
|
|
285
|
-
/**
|
|
286
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Text label displayed inside the button. Can also pass children directly.
|
|
287
|
+
* @a11y Recommended — provides the button's accessible name. With no visible text, prefer `IconButton` with `ariaLabel`.
|
|
288
|
+
*/
|
|
289
|
+
label?: string;
|
|
287
290
|
/** SVG icon component rendered before the label (inherits the button color). */
|
|
288
291
|
startIcon?: ButtonIcon;
|
|
289
292
|
/** SVG icon component rendered after the label (inherits the button color). */
|
|
@@ -304,7 +307,10 @@ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'
|
|
|
304
307
|
ref?: Ref<HTMLButtonElement>;
|
|
305
308
|
/** SVG icon component to render inside the button. */
|
|
306
309
|
icon: ButtonIcon;
|
|
307
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* Accessible label — required since there is no visible text.
|
|
312
|
+
* @a11y Required — the button's only accessible name (no visible text). Describe the action, not the icon (e.g. "Close" rather than "Cross").
|
|
313
|
+
*/
|
|
308
314
|
ariaLabel: string;
|
|
309
315
|
/** Visual style. @default 'contained' */
|
|
310
316
|
variant?: ButtonVariant;
|
|
@@ -329,6 +335,8 @@ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'
|
|
|
329
335
|
declare const IconButton: FC<IconButtonProps>;
|
|
330
336
|
|
|
331
337
|
type LinkUnderline = 'always' | 'hover' | 'none';
|
|
338
|
+
/** Controls the link color palette. `'default'` uses the brand blue, `'secondary'` uses `textSecondary`. */
|
|
339
|
+
type LinkColor = 'default' | 'secondary';
|
|
332
340
|
|
|
333
341
|
/** SVG icon component, e.g. imported via `?react` or taken from the `IconRegistry`. */
|
|
334
342
|
type LinkIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -337,10 +345,35 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
337
345
|
ref?: Ref<HTMLAnchorElement>;
|
|
338
346
|
/** Controls when the underline is visible. @default 'hover' */
|
|
339
347
|
underline?: LinkUnderline;
|
|
340
|
-
/**
|
|
348
|
+
/**
|
|
349
|
+
* Color palette variant. `'default'` uses the brand blue link color,
|
|
350
|
+
* `'secondary'` uses the `textSecondary` color token.
|
|
351
|
+
* @default 'default'
|
|
352
|
+
*/
|
|
353
|
+
color?: LinkColor;
|
|
354
|
+
/**
|
|
355
|
+
* Open in a new tab with `rel="noopener noreferrer"`.
|
|
356
|
+
* @a11y Recommended — warn users that a new tab will open (via visible text or `aria-label`).
|
|
357
|
+
*/
|
|
341
358
|
external?: boolean;
|
|
342
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Prevent navigation and style as inactive.
|
|
361
|
+
* @a11y Sets `aria-disabled`, removes the element from the tab order.
|
|
362
|
+
*/
|
|
343
363
|
disabled?: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* The URL to navigate to. When omitted (SPA navigation via `onClick`),
|
|
366
|
+
* the component automatically adds `role="link"`, `tabIndex={0}` and
|
|
367
|
+
* handles Enter-key activation so that accessibility is preserved.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* // Standard href
|
|
371
|
+
* <Link href="/about">About</Link>
|
|
372
|
+
*
|
|
373
|
+
* // React Router (no href)
|
|
374
|
+
* <Link onClick={() => navigate('/about')}>About</Link>
|
|
375
|
+
*/
|
|
376
|
+
href?: string;
|
|
344
377
|
/** SVG icon rendered before the text. */
|
|
345
378
|
startIcon?: LinkIcon;
|
|
346
379
|
/** SVG icon rendered after the text. */
|
|
@@ -350,10 +383,15 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
350
383
|
/**
|
|
351
384
|
* Theme-aware anchor element with optional icons and underline control.
|
|
352
385
|
*
|
|
386
|
+
* Supports SPA navigation (e.g. React Router) via `onClick` without `href`.
|
|
387
|
+
* In that case the component stays accessible: it gets `role="link"`,
|
|
388
|
+
* `tabIndex={0}` and keyboard Enter support automatically.
|
|
389
|
+
*
|
|
353
390
|
* @example <Link href='/about'>About</Link>
|
|
354
391
|
* @example <Link href='https://example.com' external>External site</Link>
|
|
355
392
|
* @example <Link href='/profile' underline='always' startIcon={UserIcon}>Profile</Link>
|
|
356
393
|
* @example <Link href='/terms' underline='none'>Terms</Link>
|
|
394
|
+
* @example <Link onClick={() => navigate('/about')}>About (SPA)</Link>
|
|
357
395
|
*/
|
|
358
396
|
declare const Link: FC<LinkProps>;
|
|
359
397
|
|
|
@@ -382,7 +420,10 @@ type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
|
382
420
|
endIcon?: BadgeIcon;
|
|
383
421
|
/** @deprecated Use `startIcon` instead. */
|
|
384
422
|
icon?: BadgeIcon;
|
|
385
|
-
/**
|
|
423
|
+
/**
|
|
424
|
+
* Render as a small colored dot indicator — children and icons are ignored. @default false
|
|
425
|
+
* @a11y Recommended — a dot conveys meaning visually only; add `role="img"` + `aria-label` (via the spread props) to describe it.
|
|
426
|
+
*/
|
|
386
427
|
dot?: boolean;
|
|
387
428
|
};
|
|
388
429
|
|
|
@@ -400,7 +441,10 @@ type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
|
400
441
|
interface TooltipProps {
|
|
401
442
|
/** Content that triggers the tooltip on hover/focus. */
|
|
402
443
|
children: ReactNode;
|
|
403
|
-
/**
|
|
444
|
+
/**
|
|
445
|
+
* Text displayed inside the tooltip bubble.
|
|
446
|
+
* @a11y Recommended — exposed to assistive tech; keep it concise as it describes the trigger.
|
|
447
|
+
*/
|
|
404
448
|
label: string;
|
|
405
449
|
/** Placement of the tooltip relative to the trigger element. @default 'right' */
|
|
406
450
|
placement?: TooltipPlacement;
|
|
@@ -439,7 +483,10 @@ interface TooltipProps {
|
|
|
439
483
|
}
|
|
440
484
|
|
|
441
485
|
interface InfoBubbleProps {
|
|
442
|
-
/**
|
|
486
|
+
/**
|
|
487
|
+
* Text displayed inside the tooltip bubble.
|
|
488
|
+
* @a11y Recommended — provides the accessible name/description of the info trigger.
|
|
489
|
+
*/
|
|
443
490
|
label: string;
|
|
444
491
|
/** Placement of the tooltip relative to the info icon. @default 'top' */
|
|
445
492
|
placement?: TooltipPlacement;
|
|
@@ -476,7 +523,10 @@ declare const InfoBubble: FC<InfoBubbleProps>;
|
|
|
476
523
|
|
|
477
524
|
type IconProps = HTMLAttributes<HTMLDivElement> & {
|
|
478
525
|
ref?: Ref<HTMLDivElement>;
|
|
479
|
-
/**
|
|
526
|
+
/**
|
|
527
|
+
* SVG component to render — import with `?react` (e.g. `import MyIcon from './my-icon.svg?react'`).
|
|
528
|
+
* @a11y Recommended — decorative by default (`aria-hidden`). When meaningful, pass `role="img"` + `aria-label` through the spread props.
|
|
529
|
+
*/
|
|
480
530
|
icon: ComponentType<SVGProps<SVGSVGElement>>;
|
|
481
531
|
/** Size token mapped to `theme.fontSize`. Controls both width and height. @default 'md' */
|
|
482
532
|
size?: keyof Theme['fontSize'];
|
|
@@ -519,7 +569,10 @@ type SkeletonAnimation = 'shimmer' | false;
|
|
|
519
569
|
|
|
520
570
|
type SkeletonProps = HTMLAttributes<HTMLSpanElement> & {
|
|
521
571
|
ref?: Ref<HTMLSpanElement>;
|
|
522
|
-
/**
|
|
572
|
+
/**
|
|
573
|
+
* Shape of the placeholder: `'text'` | `'circular'` | `'rectangular'` | `'rounded'`. @default 'rounded'
|
|
574
|
+
* @a11y Recommended — convey loading state to assistive tech by wrapping the region with `aria-busy="true"` (or `role="status"`).
|
|
575
|
+
*/
|
|
523
576
|
variant?: SkeletonVariant;
|
|
524
577
|
/** Loading animation: `'shimmer'` (default) or `false` to disable. */
|
|
525
578
|
animation?: SkeletonAnimation;
|
|
@@ -560,9 +613,15 @@ type TextVariantStyle = {
|
|
|
560
613
|
|
|
561
614
|
type TextProps = HTMLAttributes<HTMLElement> & {
|
|
562
615
|
ref?: Ref<HTMLElement>;
|
|
563
|
-
/**
|
|
616
|
+
/**
|
|
617
|
+
* Semantic variant — determines the rendered HTML tag and baseline styles. @default 'span'
|
|
618
|
+
* @a11y Recommended — pick the variant matching the document outline (e.g. `h1`–`h6`, `p`) so semantics are conveyed to assistive tech.
|
|
619
|
+
*/
|
|
564
620
|
variant?: TextVariants;
|
|
565
|
-
/**
|
|
621
|
+
/**
|
|
622
|
+
* Override the rendered HTML tag while keeping variant styles (e.g. `variant="h1" as="h2"`).
|
|
623
|
+
* @a11y Recommended — keep the rendered tag consistent with the heading level expected by the page outline.
|
|
624
|
+
*/
|
|
566
625
|
as?: string;
|
|
567
626
|
/** Theme color token — e.g. `'textPrimary'`, `'errorMain'`, `'linkHover'`. @default 'inherit' */
|
|
568
627
|
color?: keyof Theme['colors'];
|
|
@@ -588,7 +647,10 @@ type TextProps = HTMLAttributes<HTMLElement> & {
|
|
|
588
647
|
noWrap?: boolean;
|
|
589
648
|
/** Preserve whitespace and line breaks (`white-space: pre-wrap`). */
|
|
590
649
|
preserveWhitespace?: boolean;
|
|
591
|
-
/**
|
|
650
|
+
/**
|
|
651
|
+
* Associates a `<label>` with an input — only meaningful when `variant` or `as` is `"label"`.
|
|
652
|
+
* @a11y Recommended — link the label to its control's `id` so clicking the label focuses the input.
|
|
653
|
+
*/
|
|
592
654
|
htmlFor?: string;
|
|
593
655
|
/** Explicit CSS width applied as a style property (not an HTML attribute). */
|
|
594
656
|
width?: CSSProperties['width'];
|
|
@@ -633,9 +695,15 @@ type FormProps = {
|
|
|
633
695
|
children: ReactNode;
|
|
634
696
|
/** Called when the form is submitted. Receives the native submit event. */
|
|
635
697
|
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
636
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* Accessible name for the form.
|
|
700
|
+
* @a11y Recommended — names the form landmark; use `aria-labelledby` instead when a visible heading exists.
|
|
701
|
+
*/
|
|
637
702
|
'aria-label'?: string;
|
|
638
|
-
/**
|
|
703
|
+
/**
|
|
704
|
+
* Id of an element that labels the form.
|
|
705
|
+
* @a11y Recommended — references a visible heading to name the form landmark.
|
|
706
|
+
*/
|
|
639
707
|
'aria-labelledby'?: string;
|
|
640
708
|
};
|
|
641
709
|
|
|
@@ -656,7 +724,10 @@ type SwitchColor = 'primary' | 'success' | 'error' | 'warning' | 'info' | 'neutr
|
|
|
656
724
|
|
|
657
725
|
type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> & {
|
|
658
726
|
ref?: Ref<HTMLInputElement>;
|
|
659
|
-
/**
|
|
727
|
+
/**
|
|
728
|
+
* Visible label rendered next to the switch.
|
|
729
|
+
* @a11y Recommended — provides the switch's accessible name. Without it, set `aria-label` instead.
|
|
730
|
+
*/
|
|
660
731
|
label?: string;
|
|
661
732
|
/** Size variant. @default 'md' */
|
|
662
733
|
size?: SwitchSize;
|
|
@@ -681,13 +752,22 @@ type TextFieldStatus = 'default' | 'error' | 'success' | 'warning';
|
|
|
681
752
|
|
|
682
753
|
type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
683
754
|
ref?: Ref<HTMLInputElement>;
|
|
684
|
-
/**
|
|
755
|
+
/**
|
|
756
|
+
* Visible label rendered above the field.
|
|
757
|
+
* @a11y Recommended — provides the input's accessible name (linked via `htmlFor`/`id`).
|
|
758
|
+
*/
|
|
685
759
|
label?: string;
|
|
686
|
-
/**
|
|
760
|
+
/**
|
|
761
|
+
* Helper text or validation message rendered below the field.
|
|
762
|
+
* @a11y Recommended — linked to the input via `aria-describedby` (and `aria-errormessage` when `status='error'`).
|
|
763
|
+
*/
|
|
687
764
|
helperText?: string;
|
|
688
765
|
/** Size variant controlling height, padding and font size. @default 'md' */
|
|
689
766
|
size?: TextFieldSize;
|
|
690
|
-
/**
|
|
767
|
+
/**
|
|
768
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
769
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` on the input.
|
|
770
|
+
*/
|
|
691
771
|
status?: TextFieldStatus;
|
|
692
772
|
/** SVG icon component rendered on the left inside the field. */
|
|
693
773
|
startIcon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -738,19 +818,31 @@ type SelectProps = {
|
|
|
738
818
|
onChange?: (value: string) => void;
|
|
739
819
|
/** List of options. */
|
|
740
820
|
options?: SelectOption[];
|
|
741
|
-
/**
|
|
821
|
+
/**
|
|
822
|
+
* Label rendered above the trigger.
|
|
823
|
+
* @a11y Recommended — associates an accessible name with the combobox via `aria-labelledby`.
|
|
824
|
+
*/
|
|
742
825
|
label?: string;
|
|
743
|
-
/**
|
|
826
|
+
/**
|
|
827
|
+
* Helper text or validation message rendered below the trigger.
|
|
828
|
+
* @a11y Recommended — linked to the trigger via `aria-describedby` (and `aria-errormessage` when `status='error'`).
|
|
829
|
+
*/
|
|
744
830
|
helperText?: string;
|
|
745
831
|
/** Placeholder shown when no option is selected. */
|
|
746
832
|
placeholder?: string;
|
|
747
833
|
/** Size variant. @default 'md' */
|
|
748
834
|
size?: TextFieldSize;
|
|
749
|
-
/**
|
|
835
|
+
/**
|
|
836
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
837
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` and links the error message.
|
|
838
|
+
*/
|
|
750
839
|
status?: TextFieldStatus;
|
|
751
840
|
/** Whether the select is disabled. */
|
|
752
841
|
disabled?: boolean;
|
|
753
|
-
/**
|
|
842
|
+
/**
|
|
843
|
+
* Whether the field is required.
|
|
844
|
+
* @a11y Recommended — sets `aria-required` on the combobox and shows the visual asterisk on the label.
|
|
845
|
+
*/
|
|
754
846
|
required?: boolean;
|
|
755
847
|
/** Fixed width for the select. Defaults to 100% of its container. */
|
|
756
848
|
width?: string | number;
|
|
@@ -762,15 +854,27 @@ declare const Select: FC<SelectProps>;
|
|
|
762
854
|
|
|
763
855
|
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> & {
|
|
764
856
|
ref?: Ref<HTMLInputElement>;
|
|
765
|
-
/**
|
|
857
|
+
/**
|
|
858
|
+
* Visible label rendered next to the checkbox.
|
|
859
|
+
* @a11y Recommended — provides the checkbox's accessible name (clickable to toggle it).
|
|
860
|
+
*/
|
|
766
861
|
label?: ReactNode;
|
|
767
|
-
/**
|
|
862
|
+
/**
|
|
863
|
+
* Helper text or validation message rendered below the checkbox row.
|
|
864
|
+
* @a11y Recommended — linked to the input via `aria-describedby`.
|
|
865
|
+
*/
|
|
768
866
|
helperText?: string;
|
|
769
867
|
/** Size variant controlling checkbox box size and text scale. @default 'md' */
|
|
770
868
|
size?: TextFieldSize;
|
|
771
|
-
/**
|
|
869
|
+
/**
|
|
870
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
871
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` on the input.
|
|
872
|
+
*/
|
|
772
873
|
status?: TextFieldStatus;
|
|
773
|
-
/**
|
|
874
|
+
/**
|
|
875
|
+
* Sets the native checkbox in indeterminate (mixed) state.
|
|
876
|
+
* @a11y Recommended — exposes the mixed state via `aria-checked="mixed"`.
|
|
877
|
+
*/
|
|
774
878
|
indeterminate?: boolean;
|
|
775
879
|
/** @deprecated Use `status='error'` instead. Kept for backward compatibility. */
|
|
776
880
|
error?: boolean;
|
|
@@ -950,6 +1054,61 @@ declare const Grid: FC<GridProps>;
|
|
|
950
1054
|
*/
|
|
951
1055
|
declare const Stack: FC<StackProps>;
|
|
952
1056
|
|
|
1057
|
+
/** Separator character rendered between breadcrumb items. */
|
|
1058
|
+
type BreadcrumbSeparator = '/' | '-' | '>';
|
|
1059
|
+
|
|
1060
|
+
type BreadcrumbProps = {
|
|
1061
|
+
/** Breadcrumb items — use `Breadcrumb.Item` as children. */
|
|
1062
|
+
children: ReactNode;
|
|
1063
|
+
/**
|
|
1064
|
+
* Character rendered between each breadcrumb item.
|
|
1065
|
+
* @default '/'
|
|
1066
|
+
*/
|
|
1067
|
+
separator?: BreadcrumbSeparator;
|
|
1068
|
+
/**
|
|
1069
|
+
* Accessible label for the `<nav>` landmark.
|
|
1070
|
+
* @default 'Breadcrumb'
|
|
1071
|
+
* @a11y Recommended — describe the navigation to assistive technologies.
|
|
1072
|
+
*/
|
|
1073
|
+
ariaLabel?: string;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
type BreadcrumbItemProps = {
|
|
1077
|
+
/** Text label of the breadcrumb item. */
|
|
1078
|
+
label: string;
|
|
1079
|
+
/**
|
|
1080
|
+
* URL to navigate to.
|
|
1081
|
+
* Can be omitted when using SPA navigation via `onClick` (e.g. React Router).
|
|
1082
|
+
*/
|
|
1083
|
+
href?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* SPA navigation handler (e.g. React Router's `navigate`).
|
|
1086
|
+
* When provided without `href`, the link stays accessible: `role="link"`,
|
|
1087
|
+
* `tabIndex={0}` and Enter-key activation are handled automatically by `Link`.
|
|
1088
|
+
*
|
|
1089
|
+
* @example
|
|
1090
|
+
* <Breadcrumb.Item label="Products" onClick={() => navigate('/products')} />
|
|
1091
|
+
*/
|
|
1092
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
1093
|
+
/**
|
|
1094
|
+
* Marks this item as the current page. Renders as bold text (non-clickable)
|
|
1095
|
+
* and sets `aria-current="page"`.
|
|
1096
|
+
* @default false
|
|
1097
|
+
*/
|
|
1098
|
+
current?: boolean;
|
|
1099
|
+
/**
|
|
1100
|
+
* Injected internally by `Breadcrumb` — hides the separator for the first item.
|
|
1101
|
+
* @internal
|
|
1102
|
+
*/
|
|
1103
|
+
isFirst?: boolean;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
type BreadcrumbComponent = FC<BreadcrumbProps> & {
|
|
1107
|
+
Item: FC<BreadcrumbItemProps>;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
declare const Breadcrumb: BreadcrumbComponent;
|
|
1111
|
+
|
|
953
1112
|
/**
|
|
954
1113
|
* Layout variant for the Drawer.
|
|
955
1114
|
* - `'permanent'` — inline drawer that pushes page content (default on desktop).
|
|
@@ -983,44 +1142,80 @@ type DrawerProps = {
|
|
|
983
1142
|
onClose?: () => void;
|
|
984
1143
|
/** ARIA role applied to the root navigation container. @default 'navigation' */
|
|
985
1144
|
role?: AriaRole;
|
|
986
|
-
/**
|
|
1145
|
+
/**
|
|
1146
|
+
* Accessible name for the drawer landmark. @default 'Navigation'
|
|
1147
|
+
* @a11y Recommended — distinguishes this landmark when several navigation regions exist on the page.
|
|
1148
|
+
*/
|
|
987
1149
|
ariaLabel?: string;
|
|
988
|
-
/**
|
|
1150
|
+
/**
|
|
1151
|
+
* Id of the element that labels the drawer landmark.
|
|
1152
|
+
* @a11y Recommended — references a visible heading to name the landmark (alternative to `ariaLabel`).
|
|
1153
|
+
*/
|
|
989
1154
|
ariaLabelledBy?: string;
|
|
990
|
-
/**
|
|
1155
|
+
/**
|
|
1156
|
+
* Id of the element that describes the drawer landmark.
|
|
1157
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1158
|
+
*/
|
|
991
1159
|
ariaDescribedBy?: string;
|
|
992
1160
|
};
|
|
993
1161
|
|
|
994
1162
|
type DrawerHeaderProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
995
1163
|
/** ARIA role applied to the header container. */
|
|
996
1164
|
role?: AriaRole;
|
|
997
|
-
/**
|
|
1165
|
+
/**
|
|
1166
|
+
* Accessible name for the header region.
|
|
1167
|
+
* @a11y Recommended — names the header region for assistive tech.
|
|
1168
|
+
*/
|
|
998
1169
|
ariaLabel?: string;
|
|
999
|
-
/**
|
|
1170
|
+
/**
|
|
1171
|
+
* Id of the element that labels the header region.
|
|
1172
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1173
|
+
*/
|
|
1000
1174
|
ariaLabelledBy?: string;
|
|
1001
|
-
/**
|
|
1175
|
+
/**
|
|
1176
|
+
* Id of the element that describes the header region.
|
|
1177
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1178
|
+
*/
|
|
1002
1179
|
ariaDescribedBy?: string;
|
|
1003
1180
|
};
|
|
1004
1181
|
|
|
1005
1182
|
type DrawerBodyProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
1006
1183
|
/** ARIA role applied to the body container. */
|
|
1007
1184
|
role?: AriaRole;
|
|
1008
|
-
/**
|
|
1185
|
+
/**
|
|
1186
|
+
* Accessible name for the body region.
|
|
1187
|
+
* @a11y Recommended — names the body region for assistive tech.
|
|
1188
|
+
*/
|
|
1009
1189
|
ariaLabel?: string;
|
|
1010
|
-
/**
|
|
1190
|
+
/**
|
|
1191
|
+
* Id of the element that labels the body region.
|
|
1192
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1193
|
+
*/
|
|
1011
1194
|
ariaLabelledBy?: string;
|
|
1012
|
-
/**
|
|
1195
|
+
/**
|
|
1196
|
+
* Id of the element that describes the body region.
|
|
1197
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1198
|
+
*/
|
|
1013
1199
|
ariaDescribedBy?: string;
|
|
1014
1200
|
};
|
|
1015
1201
|
|
|
1016
1202
|
type DrawerFooterProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
1017
1203
|
/** ARIA role applied to the footer container. */
|
|
1018
1204
|
role?: AriaRole;
|
|
1019
|
-
/**
|
|
1205
|
+
/**
|
|
1206
|
+
* Accessible name for the footer region.
|
|
1207
|
+
* @a11y Recommended — names the footer region for assistive tech.
|
|
1208
|
+
*/
|
|
1020
1209
|
ariaLabel?: string;
|
|
1021
|
-
/**
|
|
1210
|
+
/**
|
|
1211
|
+
* Id of the element that labels the footer region.
|
|
1212
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1213
|
+
*/
|
|
1022
1214
|
ariaLabelledBy?: string;
|
|
1023
|
-
/**
|
|
1215
|
+
/**
|
|
1216
|
+
* Id of the element that describes the footer region.
|
|
1217
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1218
|
+
*/
|
|
1024
1219
|
ariaDescribedBy?: string;
|
|
1025
1220
|
};
|
|
1026
1221
|
|
|
@@ -1029,7 +1224,10 @@ type DrawerItemIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
|
1029
1224
|
type DrawerItemProps = {
|
|
1030
1225
|
/** SVG icon shown in both expanded and collapsed states. */
|
|
1031
1226
|
startIcon: DrawerItemIcon;
|
|
1032
|
-
/**
|
|
1227
|
+
/**
|
|
1228
|
+
* Text label — visible when expanded, shown as tooltip when collapsed.
|
|
1229
|
+
* @a11y Recommended — provides the item's accessible name in both expanded and collapsed states.
|
|
1230
|
+
*/
|
|
1033
1231
|
label: string;
|
|
1034
1232
|
/** Marks the item as selected/active. @default false */
|
|
1035
1233
|
selected?: boolean;
|
|
@@ -1041,19 +1239,40 @@ type DrawerItemProps = {
|
|
|
1041
1239
|
onClick?: () => void;
|
|
1042
1240
|
/** Prevents interaction and dims the item. @default false */
|
|
1043
1241
|
disabled?: boolean;
|
|
1044
|
-
/**
|
|
1242
|
+
/**
|
|
1243
|
+
* Accessible label override (by default uses `label` when collapsed).
|
|
1244
|
+
* @a11y Recommended — override the accessible name when `label` is not descriptive enough.
|
|
1245
|
+
*/
|
|
1045
1246
|
ariaLabel?: string;
|
|
1046
|
-
/**
|
|
1247
|
+
/**
|
|
1248
|
+
* Id of the element that labels this item.
|
|
1249
|
+
* @a11y Recommended — references an external label via `aria-labelledby`.
|
|
1250
|
+
*/
|
|
1047
1251
|
ariaLabelledBy?: string;
|
|
1048
|
-
/**
|
|
1252
|
+
/**
|
|
1253
|
+
* Id of the element that describes this item.
|
|
1254
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1255
|
+
*/
|
|
1049
1256
|
ariaDescribedBy?: string;
|
|
1050
|
-
/**
|
|
1257
|
+
/**
|
|
1258
|
+
* Id of the element controlled by this item.
|
|
1259
|
+
* @a11y Recommended — set with `ariaExpanded` when the item toggles a submenu/panel.
|
|
1260
|
+
*/
|
|
1051
1261
|
ariaControls?: string;
|
|
1052
|
-
/**
|
|
1262
|
+
/**
|
|
1263
|
+
* Whether the controlled element is expanded/collapsed.
|
|
1264
|
+
* @a11y Recommended — exposes the expanded state of the controlled element via `aria-expanded`.
|
|
1265
|
+
*/
|
|
1053
1266
|
ariaExpanded?: boolean;
|
|
1054
|
-
/**
|
|
1267
|
+
/**
|
|
1268
|
+
* Indicates popup behavior when item triggers a menu/dialog/listbox/tree/grid.
|
|
1269
|
+
* @a11y Recommended — set `aria-haspopup` when the item opens an overlay.
|
|
1270
|
+
*/
|
|
1055
1271
|
ariaHasPopup?: AriaAttributes['aria-haspopup'];
|
|
1056
|
-
/**
|
|
1272
|
+
/**
|
|
1273
|
+
* Explicit current state. Defaults to `page` when `selected` is true.
|
|
1274
|
+
* @a11y Recommended — exposes the active item to assistive tech via `aria-current`.
|
|
1275
|
+
*/
|
|
1057
1276
|
ariaCurrent?: AriaAttributes['aria-current'];
|
|
1058
1277
|
};
|
|
1059
1278
|
|
|
@@ -1072,8 +1291,67 @@ type DrawerContextValue = {
|
|
|
1072
1291
|
};
|
|
1073
1292
|
declare const useDrawerContext: () => DrawerContextValue;
|
|
1074
1293
|
|
|
1294
|
+
type TabsProps = {
|
|
1295
|
+
/** Children — typically a `Tabs.List` with `Tabs.Tab`s and one or more `Tabs.Panel`s. */
|
|
1296
|
+
children: ReactNode;
|
|
1297
|
+
/** Controlled selected tab value. */
|
|
1298
|
+
value?: string;
|
|
1299
|
+
/** Default selected tab value when uncontrolled. */
|
|
1300
|
+
defaultValue?: string;
|
|
1301
|
+
/** Called whenever the selected tab changes. */
|
|
1302
|
+
onChange?: (value: string) => void;
|
|
1303
|
+
/** Optional id prefix used to derive `id`/`aria-controls`/`aria-labelledby`. */
|
|
1304
|
+
id?: string;
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
type TabsListProps = {
|
|
1308
|
+
/** `Tabs.Tab` children. */
|
|
1309
|
+
children: ReactNode;
|
|
1310
|
+
/** Accessible label for the tablist (required by WAI-ARIA when no visible label exists). */
|
|
1311
|
+
ariaLabel?: string;
|
|
1312
|
+
/** Id of an element labelling the tablist (alternative to `ariaLabel`). */
|
|
1313
|
+
ariaLabelledBy?: string;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
type TabItemProps = {
|
|
1317
|
+
/** Unique value identifying this tab — must match the corresponding `Tabs.Panel` value. */
|
|
1318
|
+
value: string;
|
|
1319
|
+
/** Visible label of the tab. */
|
|
1320
|
+
label: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Disables the tab. Sets `aria-disabled="true"` without removing the element from
|
|
1323
|
+
* the focus tree — screen readers can still announce its existence.
|
|
1324
|
+
* Click and keyboard activation are blocked programmatically.
|
|
1325
|
+
* Disabled tabs are skipped during ArrowLeft/Right/Home/End keyboard navigation.
|
|
1326
|
+
*/
|
|
1327
|
+
disabled?: boolean;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
type TabsPanelProps = {
|
|
1331
|
+
/** Value of the tab this panel is associated with. */
|
|
1332
|
+
value: string;
|
|
1333
|
+
/** Panel content. Only rendered when its tab is active (no DOM cost when inactive). */
|
|
1334
|
+
children: ReactNode;
|
|
1335
|
+
/**
|
|
1336
|
+
* Keep the panel mounted even when inactive (set `hidden` instead of unmount).
|
|
1337
|
+
* Useful when the panel holds expensive state that should survive tab switches.
|
|
1338
|
+
*/
|
|
1339
|
+
keepMounted?: boolean;
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
type TabsComponent = FC<TabsProps> & {
|
|
1343
|
+
List: FC<TabsListProps>;
|
|
1344
|
+
Tab: FC<TabItemProps>;
|
|
1345
|
+
Panel: FC<TabsPanelProps>;
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
declare const Tabs: TabsComponent;
|
|
1349
|
+
|
|
1075
1350
|
type AlertProps = {
|
|
1076
|
-
/**
|
|
1351
|
+
/**
|
|
1352
|
+
* Visual style of the alert. @default 'default'
|
|
1353
|
+
* @a11y Recommended — `'error'` renders `role="alert"` + `aria-live="assertive"`; other variants use `role="status"` + `aria-live="polite"`.
|
|
1354
|
+
*/
|
|
1077
1355
|
variant?: AlertVariant;
|
|
1078
1356
|
/** Alert sub-components: Alert.Title and/or Alert.Body. */
|
|
1079
1357
|
children?: ReactNode;
|
|
@@ -1134,7 +1412,10 @@ declare const Backdrop: FC<BackdropProps>;
|
|
|
1134
1412
|
type DialogProps = {
|
|
1135
1413
|
/** Whether the dialog is visible. */
|
|
1136
1414
|
open: boolean;
|
|
1137
|
-
/**
|
|
1415
|
+
/**
|
|
1416
|
+
* Called when the dialog should close (Escape key or close button).
|
|
1417
|
+
* @a11y Recommended — enables closing via Escape, which assistive-tech users expect.
|
|
1418
|
+
*/
|
|
1138
1419
|
onClose: () => void;
|
|
1139
1420
|
/** Whether clicking the backdrop closes the dialog. @default false */
|
|
1140
1421
|
closeOnBackdropClick?: boolean;
|
|
@@ -1148,16 +1429,25 @@ type DialogProps = {
|
|
|
1148
1429
|
minHeight?: number | string;
|
|
1149
1430
|
/** Whether the dialog takes the full viewport height on mobile (bottom-sheet variant). @default false */
|
|
1150
1431
|
fullscreen?: boolean;
|
|
1151
|
-
/**
|
|
1432
|
+
/**
|
|
1433
|
+
* Accessible label — use when Dialog.Header is not present.
|
|
1434
|
+
* @a11y Recommended — provides the dialog's accessible name when there is no `Dialog.Header` title to reference.
|
|
1435
|
+
*/
|
|
1152
1436
|
'aria-label'?: string;
|
|
1153
1437
|
/** Dialog content. Typically Dialog.Header + Dialog.Body. */
|
|
1154
1438
|
children: ReactNode;
|
|
1155
1439
|
};
|
|
1156
1440
|
|
|
1157
1441
|
type DialogHeaderProps = {
|
|
1158
|
-
/**
|
|
1442
|
+
/**
|
|
1443
|
+
* Dialog title displayed in the header.
|
|
1444
|
+
* @a11y Recommended — labels the dialog via `aria-labelledby` (the accessible name).
|
|
1445
|
+
*/
|
|
1159
1446
|
title: string;
|
|
1160
|
-
/**
|
|
1447
|
+
/**
|
|
1448
|
+
* Called when the close button is clicked.
|
|
1449
|
+
* @a11y Recommended — the close button exposes an accessible label for keyboard/screen-reader users.
|
|
1450
|
+
*/
|
|
1161
1451
|
onClose: () => void;
|
|
1162
1452
|
};
|
|
1163
1453
|
|
|
@@ -1186,6 +1476,16 @@ type MenuProps = {
|
|
|
1186
1476
|
maxHeight?: string;
|
|
1187
1477
|
/** ARIA id for the listbox panel. */
|
|
1188
1478
|
id?: string;
|
|
1479
|
+
/**
|
|
1480
|
+
* Accessible name for the listbox (use when there is no visible label).
|
|
1481
|
+
* @a11y Recommended — names the listbox when no labelling element is referenced via `aria-labelledby`.
|
|
1482
|
+
*/
|
|
1483
|
+
'aria-label'?: string;
|
|
1484
|
+
/**
|
|
1485
|
+
* Id of an element that labels the listbox (e.g. the trigger's label).
|
|
1486
|
+
* @a11y Recommended — references the trigger's visible label to name the listbox.
|
|
1487
|
+
*/
|
|
1488
|
+
'aria-labelledby'?: string;
|
|
1189
1489
|
/** Menu content — MenuGroup and/or MenuItem. */
|
|
1190
1490
|
children: ReactNode;
|
|
1191
1491
|
};
|
|
@@ -1201,11 +1501,17 @@ type MenuGroupProps = {
|
|
|
1201
1501
|
|
|
1202
1502
|
type MenuItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
1203
1503
|
ref?: Ref<HTMLLIElement>;
|
|
1204
|
-
/**
|
|
1504
|
+
/**
|
|
1505
|
+
* Display text of the item.
|
|
1506
|
+
* @a11y Recommended — provides the option's accessible name.
|
|
1507
|
+
*/
|
|
1205
1508
|
label: string;
|
|
1206
1509
|
/** Optional SVG icon rendered before the label. */
|
|
1207
1510
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
1208
|
-
/**
|
|
1511
|
+
/**
|
|
1512
|
+
* Whether this item is currently selected.
|
|
1513
|
+
* @a11y Recommended — exposes the selected state via `aria-selected`.
|
|
1514
|
+
*/
|
|
1209
1515
|
selected?: boolean;
|
|
1210
1516
|
/** Whether this item has keyboard focus (highlighted via arrow navigation). */
|
|
1211
1517
|
focused?: boolean;
|
|
@@ -1245,5 +1551,5 @@ declare const lightTheme: Theme;
|
|
|
1245
1551
|
|
|
1246
1552
|
declare const darkTheme: Theme;
|
|
1247
1553
|
|
|
1248
|
-
export { Alert, Backdrop, Badge, Box, Button, Card, Checkbox, Dialog, Drawer, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Text, TextField, Tooltip, darkTheme, lightTheme, useDrawerContext };
|
|
1249
|
-
export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, FormProps, GridProps, GridStyleProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, LinkIcon, LinkProps, LinkUnderline, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SwitchColor, SwitchProps, SwitchSize, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
|
|
1554
|
+
export { Alert, Backdrop, Badge, Box, Breadcrumb, Button, Card, Checkbox, Dialog, Drawer, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Tabs, Text, TextField, Tooltip, darkTheme, lightTheme, useDrawerContext };
|
|
1555
|
+
export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, BreadcrumbItemProps, BreadcrumbProps, BreadcrumbSeparator, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, FormProps, GridProps, GridStyleProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, LinkColor, LinkIcon, LinkProps, LinkUnderline, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SwitchColor, SwitchProps, SwitchSize, TabItemProps, TabsListProps, TabsPanelProps, TabsProps, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
|