@aurora-ds/components 0.24.9 → 0.25.1

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.
Files changed (77) hide show
  1. package/README.md +35 -7
  2. package/dist/cjs/components/actions/button/Button.d.ts +8 -0
  3. package/dist/cjs/components/actions/button/Button.props.d.ts +10 -0
  4. package/dist/cjs/components/actions/button/utils/getButtonSizeStyles.utils.d.ts +12 -0
  5. package/dist/cjs/components/actions/button/utils/getButtonVariantStyles.utils.d.ts +7 -0
  6. package/dist/cjs/components/actions/icon-button/IconButton.d.ts +13 -0
  7. package/dist/cjs/components/actions/icon-button/IconButton.props.d.ts +11 -1
  8. package/dist/cjs/components/actions/icon-button/utils/getIconButtonSizeStyles.utils.d.ts +9 -0
  9. package/dist/cjs/components/data-display/avatar/Avatar.d.ts +16 -1
  10. package/dist/cjs/components/data-display/avatar/Avatar.props.d.ts +18 -4
  11. package/dist/cjs/components/data-display/avatar/utils/getAvatarSizes.utils.d.ts +11 -0
  12. package/dist/cjs/components/data-display/chip/utils/getChipColorStyles.utils.d.ts +12 -0
  13. package/dist/cjs/components/data-display/chip/utils/getChipContentSize.utils.d.ts +6 -0
  14. package/dist/cjs/components/data-display/chip/utils/getChipSizeStyles.utils.d.ts +10 -0
  15. package/dist/cjs/components/data-display/status/utils/getStatusColorStyles.utils.d.ts +7 -0
  16. package/dist/cjs/components/data-display/status/utils/getStatusContentSize.utils.d.ts +8 -0
  17. package/dist/cjs/components/data-display/status/utils/getStatusSizeStyles.utils.d.ts +12 -0
  18. package/dist/cjs/components/forms/date-picker/calendar/calendar-grid/CalendarGrid.props.d.ts +1 -1
  19. package/dist/cjs/components/forms/date-picker/utils/datePicker.utils.d.ts +13 -0
  20. package/dist/cjs/components/forms/input/Input.props.d.ts +9 -1
  21. package/dist/cjs/components/forms/select/Select.d.ts +18 -0
  22. package/dist/cjs/components/forms/select/Select.props.d.ts +14 -0
  23. package/dist/cjs/components/forms/textarea/TextArea.props.d.ts +9 -1
  24. package/dist/cjs/components/foundation/text/Text.props.d.ts +2 -0
  25. package/dist/cjs/components/foundation/text/utils/getTextVariantStyles.utils.d.ts +7 -0
  26. package/dist/cjs/components/foundation/text/utils/getTruncateTextStyles.utils.d.ts +21 -0
  27. package/dist/cjs/components/foundation/text/utils/parseTextWithBold.utils.d.ts +7 -0
  28. package/dist/cjs/components/navigation/breadcrumb/utils/buildBreadcrumbChildren.utils.d.ts +5 -0
  29. package/dist/cjs/components/navigation/breadcrumb/utils/flattenChildren.utils.d.ts +5 -0
  30. package/dist/cjs/components/navigation/breadcrumb/utils/insertSeparators.utils.d.ts +5 -0
  31. package/dist/cjs/components/navigation/breadcrumb/utils/isSeparator.utils.d.ts +5 -0
  32. package/dist/cjs/components/overlay/alert/Alert.d.ts +5 -0
  33. package/dist/cjs/components/overlay/alert/utils/getAlertIcon.utils.d.ts +8 -0
  34. package/dist/cjs/components/overlay/alert/utils/getAlertPositionStyles.utils.d.ts +8 -0
  35. package/dist/cjs/components/overlay/alert/utils/getAlertVariantColors.utils.d.ts +14 -0
  36. package/dist/cjs/components/overlay/modal/Modal.d.ts +24 -0
  37. package/dist/cjs/index.js +234 -28
  38. package/dist/cjs/index.js.map +1 -1
  39. package/dist/esm/components/actions/button/Button.d.ts +8 -0
  40. package/dist/esm/components/actions/button/Button.props.d.ts +10 -0
  41. package/dist/esm/components/actions/button/utils/getButtonSizeStyles.utils.d.ts +12 -0
  42. package/dist/esm/components/actions/button/utils/getButtonVariantStyles.utils.d.ts +7 -0
  43. package/dist/esm/components/actions/icon-button/IconButton.d.ts +13 -0
  44. package/dist/esm/components/actions/icon-button/IconButton.props.d.ts +11 -1
  45. package/dist/esm/components/actions/icon-button/utils/getIconButtonSizeStyles.utils.d.ts +9 -0
  46. package/dist/esm/components/data-display/avatar/Avatar.d.ts +16 -1
  47. package/dist/esm/components/data-display/avatar/Avatar.props.d.ts +18 -4
  48. package/dist/esm/components/data-display/avatar/utils/getAvatarSizes.utils.d.ts +11 -0
  49. package/dist/esm/components/data-display/chip/utils/getChipColorStyles.utils.d.ts +12 -0
  50. package/dist/esm/components/data-display/chip/utils/getChipContentSize.utils.d.ts +6 -0
  51. package/dist/esm/components/data-display/chip/utils/getChipSizeStyles.utils.d.ts +10 -0
  52. package/dist/esm/components/data-display/status/utils/getStatusColorStyles.utils.d.ts +7 -0
  53. package/dist/esm/components/data-display/status/utils/getStatusContentSize.utils.d.ts +8 -0
  54. package/dist/esm/components/data-display/status/utils/getStatusSizeStyles.utils.d.ts +12 -0
  55. package/dist/esm/components/forms/date-picker/calendar/calendar-grid/CalendarGrid.props.d.ts +1 -1
  56. package/dist/esm/components/forms/date-picker/utils/datePicker.utils.d.ts +13 -0
  57. package/dist/esm/components/forms/input/Input.props.d.ts +9 -1
  58. package/dist/esm/components/forms/select/Select.d.ts +18 -0
  59. package/dist/esm/components/forms/select/Select.props.d.ts +14 -0
  60. package/dist/esm/components/forms/textarea/TextArea.props.d.ts +9 -1
  61. package/dist/esm/components/foundation/text/Text.props.d.ts +2 -0
  62. package/dist/esm/components/foundation/text/utils/getTextVariantStyles.utils.d.ts +7 -0
  63. package/dist/esm/components/foundation/text/utils/getTruncateTextStyles.utils.d.ts +21 -0
  64. package/dist/esm/components/foundation/text/utils/parseTextWithBold.utils.d.ts +7 -0
  65. package/dist/esm/components/navigation/breadcrumb/utils/buildBreadcrumbChildren.utils.d.ts +5 -0
  66. package/dist/esm/components/navigation/breadcrumb/utils/flattenChildren.utils.d.ts +5 -0
  67. package/dist/esm/components/navigation/breadcrumb/utils/insertSeparators.utils.d.ts +5 -0
  68. package/dist/esm/components/navigation/breadcrumb/utils/isSeparator.utils.d.ts +5 -0
  69. package/dist/esm/components/overlay/alert/Alert.d.ts +5 -0
  70. package/dist/esm/components/overlay/alert/utils/getAlertIcon.utils.d.ts +8 -0
  71. package/dist/esm/components/overlay/alert/utils/getAlertPositionStyles.utils.d.ts +8 -0
  72. package/dist/esm/components/overlay/alert/utils/getAlertVariantColors.utils.d.ts +14 -0
  73. package/dist/esm/components/overlay/modal/Modal.d.ts +24 -0
  74. package/dist/esm/index.js +235 -29
  75. package/dist/esm/index.js.map +1 -1
  76. package/dist/index.d.ts +153 -8
  77. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { PropsWithChildren, FC, ReactNode, MouseEvent, CSSProperties, FormEvent, FocusEvent, ComponentType, SVGProps, DragEvent, ComponentPropsWithoutRef, ReactElement, RefObject } from 'react';
2
+ import { PropsWithChildren, FC, ReactNode, MouseEvent, KeyboardEvent, CSSProperties, FormEvent, FocusEvent, ComponentType, SVGProps, DragEvent, ComponentPropsWithoutRef, ReactElement, RefObject } from 'react';
3
3
 
4
4
  /**
5
5
  * Alert variant types
@@ -404,6 +404,8 @@ type TextProps = PropsWithChildren<{
404
404
  role?: string;
405
405
  /** Tab index for keyboard navigation */
406
406
  tabIndex?: number;
407
+ /** HTML id attribute (used for aria-labelledby / aria-describedby references) */
408
+ id?: string;
407
409
  }>;
408
410
 
409
411
  /**
@@ -471,10 +473,16 @@ declare const Status: FC<StatusProps>;
471
473
  type AvatarProps = {
472
474
  /** Image source URL */
473
475
  image?: string;
474
- /** Fallback text to display when no image */
476
+ /**
477
+ * Fallback text to display when no image (initials, name, etc.)
478
+ * Also used as the image `alt` text for accessibility.
479
+ */
475
480
  label?: string;
476
- /** Click handler */
477
- onClick?: (e: MouseEvent<HTMLDivElement>) => void;
481
+ /**
482
+ * Click handler. When provided, the avatar becomes interactive
483
+ * with `role="button"` and keyboard support (Enter/Space).
484
+ */
485
+ onClick?: (e: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>) => void;
478
486
  /** Size of the avatar */
479
487
  size?: AvatarSize;
480
488
  /** Text color for the label */
@@ -483,12 +491,34 @@ type AvatarProps = {
483
491
  borderColor?: string;
484
492
  /** Background color */
485
493
  backgroundColor?: string;
494
+ /**
495
+ * Accessibility label for screen readers.
496
+ * Defaults to `label` prop when not provided.
497
+ */
498
+ ariaLabel?: string;
499
+ /** Tab index for keyboard navigation (auto-set when onClick is provided) */
500
+ tabIndex?: number;
486
501
  };
487
502
 
488
503
  /**
489
504
  * Avatar component
490
505
  *
491
- * Displays a user's avatar with optional image or fallback text.
506
+ * Displays a user's avatar with an optional image or fallback initials.
507
+ *
508
+ * **Accessibility:**
509
+ * - When `onClick` is provided, the avatar becomes a focusable button
510
+ * with keyboard support (Enter/Space activates the click)
511
+ * - Provide `label` or `ariaLabel` for screen readers
512
+ * - For decorative avatars, both can be omitted
513
+ *
514
+ * @example
515
+ * ```tsx
516
+ * // Static avatar with image
517
+ * <Avatar image="/user.jpg" label="Jane Doe" />
518
+ *
519
+ * // Interactive avatar (clickable)
520
+ * <Avatar label="JD" onClick={() => openProfile()} ariaLabel="Open Jane's profile" />
521
+ * ```
492
522
  */
493
523
  declare const Avatar: FC<AvatarProps>;
494
524
 
@@ -553,6 +583,16 @@ type ButtonProps = {
553
583
  role?: string;
554
584
  /** Tab index for keyboard navigation */
555
585
  tabIndex?: number;
586
+ /** Whether the button is in a pressed/active state (for toggle buttons) */
587
+ ariaPressed?: boolean;
588
+ /** Whether the button is in a loading/busy state */
589
+ ariaBusy?: boolean;
590
+ /** Whether the button controls an expandable section */
591
+ ariaExpanded?: boolean;
592
+ /** Whether the button has a popup (menu, dialog, etc.) */
593
+ ariaHasPopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
594
+ /** ID of the element controlled by this button */
595
+ ariaControls?: string;
556
596
  };
557
597
 
558
598
  /**
@@ -562,6 +602,14 @@ type ButtonProps = {
562
602
  * - `contained`: Solid background button (default)
563
603
  * - `outlined`: Border only button
564
604
  * - `text`: Text only button without background
605
+ * - `destructive`: Danger/delete action button
606
+ *
607
+ * **Accessibility:**
608
+ * - Use `ariaLabel` when the button has no visible text or the label is unclear
609
+ * - Use `ariaPressed` for toggle buttons to indicate their state
610
+ * - Use `ariaBusy` when the button triggers an async action
611
+ * - Use `ariaExpanded` when the button controls a collapsible section
612
+ * - Use `ariaControls` to reference the controlled element
565
613
  */
566
614
  declare const Button: FC<ButtonProps>;
567
615
 
@@ -588,7 +636,7 @@ type IconButtonProps = {
588
636
  activeBackgroundColor?: keyof ThemeContract['colors'];
589
637
  /** Size of the icon button */
590
638
  size?: IconButtonSizes;
591
- /** Accessibility label for screen readers */
639
+ /** Accessibility label for screen readers (strongly recommended for icon-only buttons) */
592
640
  ariaLabel?: string;
593
641
  /** ID of element that labels this button */
594
642
  ariaLabelledBy?: string;
@@ -598,8 +646,31 @@ type IconButtonProps = {
598
646
  role?: string;
599
647
  /** Tab index for keyboard navigation */
600
648
  tabIndex?: number;
649
+ /** Whether the button is in a pressed/active state (for toggle buttons) */
650
+ ariaPressed?: boolean;
651
+ /** Whether the button is in a loading/busy state */
652
+ ariaBusy?: boolean;
653
+ /** Whether the button controls an expandable section */
654
+ ariaExpanded?: boolean;
655
+ /** Whether the button has a popup (menu, dialog, etc.) */
656
+ ariaHasPopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
657
+ /** ID of the element controlled by this button */
658
+ ariaControls?: string;
601
659
  };
602
660
 
661
+ /**
662
+ * IconButton component
663
+ *
664
+ * A button that displays only an icon without text.
665
+ *
666
+ * **⚠️ Accessibility:** Always provide an `ariaLabel` for icon-only buttons
667
+ * so screen readers can describe the action.
668
+ *
669
+ * @example
670
+ * ```tsx
671
+ * <IconButton icon={<CloseIcon />} ariaLabel="Close dialog" onClick={onClose} />
672
+ * ```
673
+ */
603
674
  declare const IconButton: FC<IconButtonProps>;
604
675
 
605
676
  type ButtonToggleProps = {
@@ -719,7 +790,7 @@ type InputProps = {
719
790
  disabled?: boolean;
720
791
  /** Input type */
721
792
  type?: 'text' | 'password' | 'email' | 'number';
722
- /** Accessibility label */
793
+ /** Accessibility label (defaults to `label` if not provided) */
723
794
  ariaLabel?: string;
724
795
  /** Icon to display before the input */
725
796
  startIcon?: ReactNode;
@@ -727,6 +798,13 @@ type InputProps = {
727
798
  endIcon?: ReactNode;
728
799
  /** Custom width for the input */
729
800
  width?: CSSProperties['width'];
801
+ /**
802
+ * Error message to display below the input.
803
+ * When provided, `aria-invalid="true"` and `aria-errormessage` are set automatically.
804
+ */
805
+ error?: string;
806
+ /** Unique HTML id for the input element (required when using `error`) */
807
+ id?: string;
730
808
  };
731
809
 
732
810
  declare const _default$2: react.MemoExoticComponent<react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>>;
@@ -748,7 +826,7 @@ type TextAreaProps = {
748
826
  placeholder?: string;
749
827
  /** Whether the textarea is disabled */
750
828
  disabled?: boolean;
751
- /** Accessibility label */
829
+ /** Accessibility label (defaults to `label` if not provided) */
752
830
  ariaLabel?: string;
753
831
  /** Custom width for the textarea */
754
832
  width?: CSSProperties['width'];
@@ -756,6 +834,13 @@ type TextAreaProps = {
756
834
  minRows?: number;
757
835
  /** Maximum number of visible text lines (adds scroll when exceeded) */
758
836
  maxRows?: number;
837
+ /**
838
+ * Error message to display below the textarea.
839
+ * When provided, `aria-invalid="true"` and `aria-errormessage` are set automatically.
840
+ */
841
+ error?: string;
842
+ /** Unique HTML id for the textarea element (required when using `error`) */
843
+ id?: string;
759
844
  };
760
845
 
761
846
  declare const _default$1: react.MemoExoticComponent<react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>>;
@@ -793,10 +878,41 @@ type SelectProps = {
793
878
  * Width of the select
794
879
  */
795
880
  width?: string | number;
881
+ /**
882
+ * Error message to display below the select.
883
+ * When provided, `aria-invalid="true"` and `aria-errormessage` are set automatically.
884
+ */
885
+ error?: string;
886
+ /**
887
+ * Unique HTML id for the select trigger (required when using `error`)
888
+ */
889
+ id?: string;
890
+ /**
891
+ * Accessibility label for screen readers (defaults to `label`)
892
+ */
893
+ ariaLabel?: string;
796
894
  };
797
895
 
798
896
  /**
799
897
  * Select component that uses Menu for dropdown
898
+ *
899
+ * **Accessibility:**
900
+ * - Uses `role="combobox"` with `aria-expanded` and `aria-haspopup="listbox"`
901
+ * - Keyboard support: Enter/Space opens, Escape closes
902
+ * - When `error` is provided, `aria-invalid="true"` and `aria-errormessage` are set
903
+ * - `mandatory` adds `aria-required="true"`
904
+ *
905
+ * @example
906
+ * ```tsx
907
+ * <Select
908
+ * options={[{ value: 'fr', label: 'France' }]}
909
+ * value={country}
910
+ * onChange={setCountry}
911
+ * label="Country"
912
+ * mandatory
913
+ * error={countryError}
914
+ * />
915
+ * ```
800
916
  */
801
917
  declare const Select: FC<SelectProps>;
802
918
 
@@ -1516,6 +1632,11 @@ interface AlertProps {
1516
1632
  * - Smooth animations
1517
1633
  * - Dynamic height calculation for proper stacking
1518
1634
  *
1635
+ * **Accessibility:**
1636
+ * - Uses `role="alert"` for screen reader announcements
1637
+ * - Error alerts use `aria-live="assertive"` for urgent announcements
1638
+ * - Other variants use `aria-live="polite"` to avoid interrupting users
1639
+ *
1519
1640
  * @example
1520
1641
  * ```tsx
1521
1642
  * <Alert
@@ -1576,6 +1697,30 @@ type ModalProps = {
1576
1697
  action?: ButtonProps;
1577
1698
  };
1578
1699
 
1700
+ /**
1701
+ * Modal component
1702
+ *
1703
+ * An overlay dialog for focused interactions.
1704
+ *
1705
+ * **Accessibility:**
1706
+ * - Uses `role="dialog"` and `aria-modal="true"` for screen readers
1707
+ * - `aria-labelledby` links to the modal title
1708
+ * - Focus is trapped inside the modal while it is open
1709
+ * - Focus returns to the triggering element when closed
1710
+ * - Escape key closes the modal
1711
+ *
1712
+ * @example
1713
+ * ```tsx
1714
+ * <Modal
1715
+ * isOpen={isOpen}
1716
+ * onClose={() => setIsOpen(false)}
1717
+ * label="Confirm deletion"
1718
+ * action={{ label: 'Delete', onClick: handleDelete }}
1719
+ * >
1720
+ * <Text>Are you sure you want to delete this item?</Text>
1721
+ * </Modal>
1722
+ * ```
1723
+ */
1579
1724
  declare const Modal: FC<ModalProps>;
1580
1725
 
1581
1726
  type DrawerItemProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-ds/components",
3
- "version": "0.24.9",
3
+ "version": "0.25.1",
4
4
  "type": "module",
5
5
  "description": "Aurora DS - React Components Library",
6
6
  "main": "dist/cjs/index.js",
@@ -24,7 +24,7 @@
24
24
  "react-dom": "^18.0.0 || ^19.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@aurora-ds/theme": "^3.2.0",
27
+ "@aurora-ds/theme": "^3.2.9",
28
28
  "@babel/core": "^7.23.0",
29
29
  "@babel/preset-env": "^7.23.0",
30
30
  "@babel/preset-react": "^7.23.0",