@aurora-ds/components 1.1.7 → 1.2.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 +59 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +59 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +241 -54
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -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;
|
|
@@ -337,10 +343,29 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
337
343
|
ref?: Ref<HTMLAnchorElement>;
|
|
338
344
|
/** Controls when the underline is visible. @default 'hover' */
|
|
339
345
|
underline?: LinkUnderline;
|
|
340
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Open in a new tab with `rel="noopener noreferrer"`.
|
|
348
|
+
* @a11y Recommended — warn users that a new tab will open (via visible text or `aria-label`).
|
|
349
|
+
*/
|
|
341
350
|
external?: boolean;
|
|
342
|
-
/**
|
|
351
|
+
/**
|
|
352
|
+
* Prevent navigation and style as inactive.
|
|
353
|
+
* @a11y Sets `aria-disabled`, removes the element from the tab order.
|
|
354
|
+
*/
|
|
343
355
|
disabled?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* The URL to navigate to. When omitted (SPA navigation via `onClick`),
|
|
358
|
+
* the component automatically adds `role="link"`, `tabIndex={0}` and
|
|
359
|
+
* handles Enter-key activation so that accessibility is preserved.
|
|
360
|
+
*
|
|
361
|
+
* @example
|
|
362
|
+
* // Standard href
|
|
363
|
+
* <Link href="/about">About</Link>
|
|
364
|
+
*
|
|
365
|
+
* // React Router (no href)
|
|
366
|
+
* <Link onClick={() => navigate('/about')}>About</Link>
|
|
367
|
+
*/
|
|
368
|
+
href?: string;
|
|
344
369
|
/** SVG icon rendered before the text. */
|
|
345
370
|
startIcon?: LinkIcon;
|
|
346
371
|
/** SVG icon rendered after the text. */
|
|
@@ -350,10 +375,15 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
350
375
|
/**
|
|
351
376
|
* Theme-aware anchor element with optional icons and underline control.
|
|
352
377
|
*
|
|
378
|
+
* Supports SPA navigation (e.g. React Router) via `onClick` without `href`.
|
|
379
|
+
* In that case the component stays accessible: it gets `role="link"`,
|
|
380
|
+
* `tabIndex={0}` and keyboard Enter support automatically.
|
|
381
|
+
*
|
|
353
382
|
* @example <Link href='/about'>About</Link>
|
|
354
383
|
* @example <Link href='https://example.com' external>External site</Link>
|
|
355
384
|
* @example <Link href='/profile' underline='always' startIcon={UserIcon}>Profile</Link>
|
|
356
385
|
* @example <Link href='/terms' underline='none'>Terms</Link>
|
|
386
|
+
* @example <Link onClick={() => navigate('/about')}>About (SPA)</Link>
|
|
357
387
|
*/
|
|
358
388
|
declare const Link: FC<LinkProps>;
|
|
359
389
|
|
|
@@ -382,7 +412,10 @@ type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
|
|
|
382
412
|
endIcon?: BadgeIcon;
|
|
383
413
|
/** @deprecated Use `startIcon` instead. */
|
|
384
414
|
icon?: BadgeIcon;
|
|
385
|
-
/**
|
|
415
|
+
/**
|
|
416
|
+
* Render as a small colored dot indicator — children and icons are ignored. @default false
|
|
417
|
+
* @a11y Recommended — a dot conveys meaning visually only; add `role="img"` + `aria-label` (via the spread props) to describe it.
|
|
418
|
+
*/
|
|
386
419
|
dot?: boolean;
|
|
387
420
|
};
|
|
388
421
|
|
|
@@ -400,7 +433,10 @@ type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
|
400
433
|
interface TooltipProps {
|
|
401
434
|
/** Content that triggers the tooltip on hover/focus. */
|
|
402
435
|
children: ReactNode;
|
|
403
|
-
/**
|
|
436
|
+
/**
|
|
437
|
+
* Text displayed inside the tooltip bubble.
|
|
438
|
+
* @a11y Recommended — exposed to assistive tech; keep it concise as it describes the trigger.
|
|
439
|
+
*/
|
|
404
440
|
label: string;
|
|
405
441
|
/** Placement of the tooltip relative to the trigger element. @default 'right' */
|
|
406
442
|
placement?: TooltipPlacement;
|
|
@@ -439,7 +475,10 @@ interface TooltipProps {
|
|
|
439
475
|
}
|
|
440
476
|
|
|
441
477
|
interface InfoBubbleProps {
|
|
442
|
-
/**
|
|
478
|
+
/**
|
|
479
|
+
* Text displayed inside the tooltip bubble.
|
|
480
|
+
* @a11y Recommended — provides the accessible name/description of the info trigger.
|
|
481
|
+
*/
|
|
443
482
|
label: string;
|
|
444
483
|
/** Placement of the tooltip relative to the info icon. @default 'top' */
|
|
445
484
|
placement?: TooltipPlacement;
|
|
@@ -476,7 +515,10 @@ declare const InfoBubble: FC<InfoBubbleProps>;
|
|
|
476
515
|
|
|
477
516
|
type IconProps = HTMLAttributes<HTMLDivElement> & {
|
|
478
517
|
ref?: Ref<HTMLDivElement>;
|
|
479
|
-
/**
|
|
518
|
+
/**
|
|
519
|
+
* SVG component to render — import with `?react` (e.g. `import MyIcon from './my-icon.svg?react'`).
|
|
520
|
+
* @a11y Recommended — decorative by default (`aria-hidden`). When meaningful, pass `role="img"` + `aria-label` through the spread props.
|
|
521
|
+
*/
|
|
480
522
|
icon: ComponentType<SVGProps<SVGSVGElement>>;
|
|
481
523
|
/** Size token mapped to `theme.fontSize`. Controls both width and height. @default 'md' */
|
|
482
524
|
size?: keyof Theme['fontSize'];
|
|
@@ -519,7 +561,10 @@ type SkeletonAnimation = 'shimmer' | false;
|
|
|
519
561
|
|
|
520
562
|
type SkeletonProps = HTMLAttributes<HTMLSpanElement> & {
|
|
521
563
|
ref?: Ref<HTMLSpanElement>;
|
|
522
|
-
/**
|
|
564
|
+
/**
|
|
565
|
+
* Shape of the placeholder: `'text'` | `'circular'` | `'rectangular'` | `'rounded'`. @default 'rounded'
|
|
566
|
+
* @a11y Recommended — convey loading state to assistive tech by wrapping the region with `aria-busy="true"` (or `role="status"`).
|
|
567
|
+
*/
|
|
523
568
|
variant?: SkeletonVariant;
|
|
524
569
|
/** Loading animation: `'shimmer'` (default) or `false` to disable. */
|
|
525
570
|
animation?: SkeletonAnimation;
|
|
@@ -560,9 +605,15 @@ type TextVariantStyle = {
|
|
|
560
605
|
|
|
561
606
|
type TextProps = HTMLAttributes<HTMLElement> & {
|
|
562
607
|
ref?: Ref<HTMLElement>;
|
|
563
|
-
/**
|
|
608
|
+
/**
|
|
609
|
+
* Semantic variant — determines the rendered HTML tag and baseline styles. @default 'span'
|
|
610
|
+
* @a11y Recommended — pick the variant matching the document outline (e.g. `h1`–`h6`, `p`) so semantics are conveyed to assistive tech.
|
|
611
|
+
*/
|
|
564
612
|
variant?: TextVariants;
|
|
565
|
-
/**
|
|
613
|
+
/**
|
|
614
|
+
* Override the rendered HTML tag while keeping variant styles (e.g. `variant="h1" as="h2"`).
|
|
615
|
+
* @a11y Recommended — keep the rendered tag consistent with the heading level expected by the page outline.
|
|
616
|
+
*/
|
|
566
617
|
as?: string;
|
|
567
618
|
/** Theme color token — e.g. `'textPrimary'`, `'errorMain'`, `'linkHover'`. @default 'inherit' */
|
|
568
619
|
color?: keyof Theme['colors'];
|
|
@@ -588,7 +639,10 @@ type TextProps = HTMLAttributes<HTMLElement> & {
|
|
|
588
639
|
noWrap?: boolean;
|
|
589
640
|
/** Preserve whitespace and line breaks (`white-space: pre-wrap`). */
|
|
590
641
|
preserveWhitespace?: boolean;
|
|
591
|
-
/**
|
|
642
|
+
/**
|
|
643
|
+
* Associates a `<label>` with an input — only meaningful when `variant` or `as` is `"label"`.
|
|
644
|
+
* @a11y Recommended — link the label to its control's `id` so clicking the label focuses the input.
|
|
645
|
+
*/
|
|
592
646
|
htmlFor?: string;
|
|
593
647
|
/** Explicit CSS width applied as a style property (not an HTML attribute). */
|
|
594
648
|
width?: CSSProperties['width'];
|
|
@@ -633,9 +687,15 @@ type FormProps = {
|
|
|
633
687
|
children: ReactNode;
|
|
634
688
|
/** Called when the form is submitted. Receives the native submit event. */
|
|
635
689
|
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
636
|
-
/**
|
|
690
|
+
/**
|
|
691
|
+
* Accessible name for the form.
|
|
692
|
+
* @a11y Recommended — names the form landmark; use `aria-labelledby` instead when a visible heading exists.
|
|
693
|
+
*/
|
|
637
694
|
'aria-label'?: string;
|
|
638
|
-
/**
|
|
695
|
+
/**
|
|
696
|
+
* Id of an element that labels the form.
|
|
697
|
+
* @a11y Recommended — references a visible heading to name the form landmark.
|
|
698
|
+
*/
|
|
639
699
|
'aria-labelledby'?: string;
|
|
640
700
|
};
|
|
641
701
|
|
|
@@ -656,7 +716,10 @@ type SwitchColor = 'primary' | 'success' | 'error' | 'warning' | 'info' | 'neutr
|
|
|
656
716
|
|
|
657
717
|
type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> & {
|
|
658
718
|
ref?: Ref<HTMLInputElement>;
|
|
659
|
-
/**
|
|
719
|
+
/**
|
|
720
|
+
* Visible label rendered next to the switch.
|
|
721
|
+
* @a11y Recommended — provides the switch's accessible name. Without it, set `aria-label` instead.
|
|
722
|
+
*/
|
|
660
723
|
label?: string;
|
|
661
724
|
/** Size variant. @default 'md' */
|
|
662
725
|
size?: SwitchSize;
|
|
@@ -681,13 +744,22 @@ type TextFieldStatus = 'default' | 'error' | 'success' | 'warning';
|
|
|
681
744
|
|
|
682
745
|
type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
683
746
|
ref?: Ref<HTMLInputElement>;
|
|
684
|
-
/**
|
|
747
|
+
/**
|
|
748
|
+
* Visible label rendered above the field.
|
|
749
|
+
* @a11y Recommended — provides the input's accessible name (linked via `htmlFor`/`id`).
|
|
750
|
+
*/
|
|
685
751
|
label?: string;
|
|
686
|
-
/**
|
|
752
|
+
/**
|
|
753
|
+
* Helper text or validation message rendered below the field.
|
|
754
|
+
* @a11y Recommended — linked to the input via `aria-describedby` (and `aria-errormessage` when `status='error'`).
|
|
755
|
+
*/
|
|
687
756
|
helperText?: string;
|
|
688
757
|
/** Size variant controlling height, padding and font size. @default 'md' */
|
|
689
758
|
size?: TextFieldSize;
|
|
690
|
-
/**
|
|
759
|
+
/**
|
|
760
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
761
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` on the input.
|
|
762
|
+
*/
|
|
691
763
|
status?: TextFieldStatus;
|
|
692
764
|
/** SVG icon component rendered on the left inside the field. */
|
|
693
765
|
startIcon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -738,19 +810,31 @@ type SelectProps = {
|
|
|
738
810
|
onChange?: (value: string) => void;
|
|
739
811
|
/** List of options. */
|
|
740
812
|
options?: SelectOption[];
|
|
741
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* Label rendered above the trigger.
|
|
815
|
+
* @a11y Recommended — associates an accessible name with the combobox via `aria-labelledby`.
|
|
816
|
+
*/
|
|
742
817
|
label?: string;
|
|
743
|
-
/**
|
|
818
|
+
/**
|
|
819
|
+
* Helper text or validation message rendered below the trigger.
|
|
820
|
+
* @a11y Recommended — linked to the trigger via `aria-describedby` (and `aria-errormessage` when `status='error'`).
|
|
821
|
+
*/
|
|
744
822
|
helperText?: string;
|
|
745
823
|
/** Placeholder shown when no option is selected. */
|
|
746
824
|
placeholder?: string;
|
|
747
825
|
/** Size variant. @default 'md' */
|
|
748
826
|
size?: TextFieldSize;
|
|
749
|
-
/**
|
|
827
|
+
/**
|
|
828
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
829
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` and links the error message.
|
|
830
|
+
*/
|
|
750
831
|
status?: TextFieldStatus;
|
|
751
832
|
/** Whether the select is disabled. */
|
|
752
833
|
disabled?: boolean;
|
|
753
|
-
/**
|
|
834
|
+
/**
|
|
835
|
+
* Whether the field is required.
|
|
836
|
+
* @a11y Recommended — sets `aria-required` on the combobox and shows the visual asterisk on the label.
|
|
837
|
+
*/
|
|
754
838
|
required?: boolean;
|
|
755
839
|
/** Fixed width for the select. Defaults to 100% of its container. */
|
|
756
840
|
width?: string | number;
|
|
@@ -762,15 +846,27 @@ declare const Select: FC<SelectProps>;
|
|
|
762
846
|
|
|
763
847
|
type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> & {
|
|
764
848
|
ref?: Ref<HTMLInputElement>;
|
|
765
|
-
/**
|
|
849
|
+
/**
|
|
850
|
+
* Visible label rendered next to the checkbox.
|
|
851
|
+
* @a11y Recommended — provides the checkbox's accessible name (clickable to toggle it).
|
|
852
|
+
*/
|
|
766
853
|
label?: ReactNode;
|
|
767
|
-
/**
|
|
854
|
+
/**
|
|
855
|
+
* Helper text or validation message rendered below the checkbox row.
|
|
856
|
+
* @a11y Recommended — linked to the input via `aria-describedby`.
|
|
857
|
+
*/
|
|
768
858
|
helperText?: string;
|
|
769
859
|
/** Size variant controlling checkbox box size and text scale. @default 'md' */
|
|
770
860
|
size?: TextFieldSize;
|
|
771
|
-
/**
|
|
861
|
+
/**
|
|
862
|
+
* Semantic status affecting border and helper text color. @default 'default'
|
|
863
|
+
* @a11y Recommended — `status='error'` sets `aria-invalid` on the input.
|
|
864
|
+
*/
|
|
772
865
|
status?: TextFieldStatus;
|
|
773
|
-
/**
|
|
866
|
+
/**
|
|
867
|
+
* Sets the native checkbox in indeterminate (mixed) state.
|
|
868
|
+
* @a11y Recommended — exposes the mixed state via `aria-checked="mixed"`.
|
|
869
|
+
*/
|
|
774
870
|
indeterminate?: boolean;
|
|
775
871
|
/** @deprecated Use `status='error'` instead. Kept for backward compatibility. */
|
|
776
872
|
error?: boolean;
|
|
@@ -983,44 +1079,80 @@ type DrawerProps = {
|
|
|
983
1079
|
onClose?: () => void;
|
|
984
1080
|
/** ARIA role applied to the root navigation container. @default 'navigation' */
|
|
985
1081
|
role?: AriaRole;
|
|
986
|
-
/**
|
|
1082
|
+
/**
|
|
1083
|
+
* Accessible name for the drawer landmark. @default 'Navigation'
|
|
1084
|
+
* @a11y Recommended — distinguishes this landmark when several navigation regions exist on the page.
|
|
1085
|
+
*/
|
|
987
1086
|
ariaLabel?: string;
|
|
988
|
-
/**
|
|
1087
|
+
/**
|
|
1088
|
+
* Id of the element that labels the drawer landmark.
|
|
1089
|
+
* @a11y Recommended — references a visible heading to name the landmark (alternative to `ariaLabel`).
|
|
1090
|
+
*/
|
|
989
1091
|
ariaLabelledBy?: string;
|
|
990
|
-
/**
|
|
1092
|
+
/**
|
|
1093
|
+
* Id of the element that describes the drawer landmark.
|
|
1094
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1095
|
+
*/
|
|
991
1096
|
ariaDescribedBy?: string;
|
|
992
1097
|
};
|
|
993
1098
|
|
|
994
1099
|
type DrawerHeaderProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
995
1100
|
/** ARIA role applied to the header container. */
|
|
996
1101
|
role?: AriaRole;
|
|
997
|
-
/**
|
|
1102
|
+
/**
|
|
1103
|
+
* Accessible name for the header region.
|
|
1104
|
+
* @a11y Recommended — names the header region for assistive tech.
|
|
1105
|
+
*/
|
|
998
1106
|
ariaLabel?: string;
|
|
999
|
-
/**
|
|
1107
|
+
/**
|
|
1108
|
+
* Id of the element that labels the header region.
|
|
1109
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1110
|
+
*/
|
|
1000
1111
|
ariaLabelledBy?: string;
|
|
1001
|
-
/**
|
|
1112
|
+
/**
|
|
1113
|
+
* Id of the element that describes the header region.
|
|
1114
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1115
|
+
*/
|
|
1002
1116
|
ariaDescribedBy?: string;
|
|
1003
1117
|
};
|
|
1004
1118
|
|
|
1005
1119
|
type DrawerBodyProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
1006
1120
|
/** ARIA role applied to the body container. */
|
|
1007
1121
|
role?: AriaRole;
|
|
1008
|
-
/**
|
|
1122
|
+
/**
|
|
1123
|
+
* Accessible name for the body region.
|
|
1124
|
+
* @a11y Recommended — names the body region for assistive tech.
|
|
1125
|
+
*/
|
|
1009
1126
|
ariaLabel?: string;
|
|
1010
|
-
/**
|
|
1127
|
+
/**
|
|
1128
|
+
* Id of the element that labels the body region.
|
|
1129
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1130
|
+
*/
|
|
1011
1131
|
ariaLabelledBy?: string;
|
|
1012
|
-
/**
|
|
1132
|
+
/**
|
|
1133
|
+
* Id of the element that describes the body region.
|
|
1134
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1135
|
+
*/
|
|
1013
1136
|
ariaDescribedBy?: string;
|
|
1014
1137
|
};
|
|
1015
1138
|
|
|
1016
1139
|
type DrawerFooterProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
|
|
1017
1140
|
/** ARIA role applied to the footer container. */
|
|
1018
1141
|
role?: AriaRole;
|
|
1019
|
-
/**
|
|
1142
|
+
/**
|
|
1143
|
+
* Accessible name for the footer region.
|
|
1144
|
+
* @a11y Recommended — names the footer region for assistive tech.
|
|
1145
|
+
*/
|
|
1020
1146
|
ariaLabel?: string;
|
|
1021
|
-
/**
|
|
1147
|
+
/**
|
|
1148
|
+
* Id of the element that labels the footer region.
|
|
1149
|
+
* @a11y Recommended — references a visible heading via `aria-labelledby`.
|
|
1150
|
+
*/
|
|
1022
1151
|
ariaLabelledBy?: string;
|
|
1023
|
-
/**
|
|
1152
|
+
/**
|
|
1153
|
+
* Id of the element that describes the footer region.
|
|
1154
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1155
|
+
*/
|
|
1024
1156
|
ariaDescribedBy?: string;
|
|
1025
1157
|
};
|
|
1026
1158
|
|
|
@@ -1029,7 +1161,10 @@ type DrawerItemIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
|
1029
1161
|
type DrawerItemProps = {
|
|
1030
1162
|
/** SVG icon shown in both expanded and collapsed states. */
|
|
1031
1163
|
startIcon: DrawerItemIcon;
|
|
1032
|
-
/**
|
|
1164
|
+
/**
|
|
1165
|
+
* Text label — visible when expanded, shown as tooltip when collapsed.
|
|
1166
|
+
* @a11y Recommended — provides the item's accessible name in both expanded and collapsed states.
|
|
1167
|
+
*/
|
|
1033
1168
|
label: string;
|
|
1034
1169
|
/** Marks the item as selected/active. @default false */
|
|
1035
1170
|
selected?: boolean;
|
|
@@ -1041,19 +1176,40 @@ type DrawerItemProps = {
|
|
|
1041
1176
|
onClick?: () => void;
|
|
1042
1177
|
/** Prevents interaction and dims the item. @default false */
|
|
1043
1178
|
disabled?: boolean;
|
|
1044
|
-
/**
|
|
1179
|
+
/**
|
|
1180
|
+
* Accessible label override (by default uses `label` when collapsed).
|
|
1181
|
+
* @a11y Recommended — override the accessible name when `label` is not descriptive enough.
|
|
1182
|
+
*/
|
|
1045
1183
|
ariaLabel?: string;
|
|
1046
|
-
/**
|
|
1184
|
+
/**
|
|
1185
|
+
* Id of the element that labels this item.
|
|
1186
|
+
* @a11y Recommended — references an external label via `aria-labelledby`.
|
|
1187
|
+
*/
|
|
1047
1188
|
ariaLabelledBy?: string;
|
|
1048
|
-
/**
|
|
1189
|
+
/**
|
|
1190
|
+
* Id of the element that describes this item.
|
|
1191
|
+
* @a11y Recommended — references descriptive text via `aria-describedby`.
|
|
1192
|
+
*/
|
|
1049
1193
|
ariaDescribedBy?: string;
|
|
1050
|
-
/**
|
|
1194
|
+
/**
|
|
1195
|
+
* Id of the element controlled by this item.
|
|
1196
|
+
* @a11y Recommended — set with `ariaExpanded` when the item toggles a submenu/panel.
|
|
1197
|
+
*/
|
|
1051
1198
|
ariaControls?: string;
|
|
1052
|
-
/**
|
|
1199
|
+
/**
|
|
1200
|
+
* Whether the controlled element is expanded/collapsed.
|
|
1201
|
+
* @a11y Recommended — exposes the expanded state of the controlled element via `aria-expanded`.
|
|
1202
|
+
*/
|
|
1053
1203
|
ariaExpanded?: boolean;
|
|
1054
|
-
/**
|
|
1204
|
+
/**
|
|
1205
|
+
* Indicates popup behavior when item triggers a menu/dialog/listbox/tree/grid.
|
|
1206
|
+
* @a11y Recommended — set `aria-haspopup` when the item opens an overlay.
|
|
1207
|
+
*/
|
|
1055
1208
|
ariaHasPopup?: AriaAttributes['aria-haspopup'];
|
|
1056
|
-
/**
|
|
1209
|
+
/**
|
|
1210
|
+
* Explicit current state. Defaults to `page` when `selected` is true.
|
|
1211
|
+
* @a11y Recommended — exposes the active item to assistive tech via `aria-current`.
|
|
1212
|
+
*/
|
|
1057
1213
|
ariaCurrent?: AriaAttributes['aria-current'];
|
|
1058
1214
|
};
|
|
1059
1215
|
|
|
@@ -1073,7 +1229,10 @@ type DrawerContextValue = {
|
|
|
1073
1229
|
declare const useDrawerContext: () => DrawerContextValue;
|
|
1074
1230
|
|
|
1075
1231
|
type AlertProps = {
|
|
1076
|
-
/**
|
|
1232
|
+
/**
|
|
1233
|
+
* Visual style of the alert. @default 'default'
|
|
1234
|
+
* @a11y Recommended — `'error'` renders `role="alert"` + `aria-live="assertive"`; other variants use `role="status"` + `aria-live="polite"`.
|
|
1235
|
+
*/
|
|
1077
1236
|
variant?: AlertVariant;
|
|
1078
1237
|
/** Alert sub-components: Alert.Title and/or Alert.Body. */
|
|
1079
1238
|
children?: ReactNode;
|
|
@@ -1134,7 +1293,10 @@ declare const Backdrop: FC<BackdropProps>;
|
|
|
1134
1293
|
type DialogProps = {
|
|
1135
1294
|
/** Whether the dialog is visible. */
|
|
1136
1295
|
open: boolean;
|
|
1137
|
-
/**
|
|
1296
|
+
/**
|
|
1297
|
+
* Called when the dialog should close (Escape key or close button).
|
|
1298
|
+
* @a11y Recommended — enables closing via Escape, which assistive-tech users expect.
|
|
1299
|
+
*/
|
|
1138
1300
|
onClose: () => void;
|
|
1139
1301
|
/** Whether clicking the backdrop closes the dialog. @default false */
|
|
1140
1302
|
closeOnBackdropClick?: boolean;
|
|
@@ -1148,16 +1310,25 @@ type DialogProps = {
|
|
|
1148
1310
|
minHeight?: number | string;
|
|
1149
1311
|
/** Whether the dialog takes the full viewport height on mobile (bottom-sheet variant). @default false */
|
|
1150
1312
|
fullscreen?: boolean;
|
|
1151
|
-
/**
|
|
1313
|
+
/**
|
|
1314
|
+
* Accessible label — use when Dialog.Header is not present.
|
|
1315
|
+
* @a11y Recommended — provides the dialog's accessible name when there is no `Dialog.Header` title to reference.
|
|
1316
|
+
*/
|
|
1152
1317
|
'aria-label'?: string;
|
|
1153
1318
|
/** Dialog content. Typically Dialog.Header + Dialog.Body. */
|
|
1154
1319
|
children: ReactNode;
|
|
1155
1320
|
};
|
|
1156
1321
|
|
|
1157
1322
|
type DialogHeaderProps = {
|
|
1158
|
-
/**
|
|
1323
|
+
/**
|
|
1324
|
+
* Dialog title displayed in the header.
|
|
1325
|
+
* @a11y Recommended — labels the dialog via `aria-labelledby` (the accessible name).
|
|
1326
|
+
*/
|
|
1159
1327
|
title: string;
|
|
1160
|
-
/**
|
|
1328
|
+
/**
|
|
1329
|
+
* Called when the close button is clicked.
|
|
1330
|
+
* @a11y Recommended — the close button exposes an accessible label for keyboard/screen-reader users.
|
|
1331
|
+
*/
|
|
1161
1332
|
onClose: () => void;
|
|
1162
1333
|
};
|
|
1163
1334
|
|
|
@@ -1186,6 +1357,16 @@ type MenuProps = {
|
|
|
1186
1357
|
maxHeight?: string;
|
|
1187
1358
|
/** ARIA id for the listbox panel. */
|
|
1188
1359
|
id?: string;
|
|
1360
|
+
/**
|
|
1361
|
+
* Accessible name for the listbox (use when there is no visible label).
|
|
1362
|
+
* @a11y Recommended — names the listbox when no labelling element is referenced via `aria-labelledby`.
|
|
1363
|
+
*/
|
|
1364
|
+
'aria-label'?: string;
|
|
1365
|
+
/**
|
|
1366
|
+
* Id of an element that labels the listbox (e.g. the trigger's label).
|
|
1367
|
+
* @a11y Recommended — references the trigger's visible label to name the listbox.
|
|
1368
|
+
*/
|
|
1369
|
+
'aria-labelledby'?: string;
|
|
1189
1370
|
/** Menu content — MenuGroup and/or MenuItem. */
|
|
1190
1371
|
children: ReactNode;
|
|
1191
1372
|
};
|
|
@@ -1201,11 +1382,17 @@ type MenuGroupProps = {
|
|
|
1201
1382
|
|
|
1202
1383
|
type MenuItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
1203
1384
|
ref?: Ref<HTMLLIElement>;
|
|
1204
|
-
/**
|
|
1385
|
+
/**
|
|
1386
|
+
* Display text of the item.
|
|
1387
|
+
* @a11y Recommended — provides the option's accessible name.
|
|
1388
|
+
*/
|
|
1205
1389
|
label: string;
|
|
1206
1390
|
/** Optional SVG icon rendered before the label. */
|
|
1207
1391
|
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
1208
|
-
/**
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether this item is currently selected.
|
|
1394
|
+
* @a11y Recommended — exposes the selected state via `aria-selected`.
|
|
1395
|
+
*/
|
|
1209
1396
|
selected?: boolean;
|
|
1210
1397
|
/** Whether this item has keyboard focus (highlighted via arrow navigation). */
|
|
1211
1398
|
focused?: boolean;
|