@aurora-ds/components 1.7.15 → 1.7.17

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/index.d.ts CHANGED
@@ -693,6 +693,11 @@ type AvatarColor = 'default' | 'primary' | 'secondary' | 'success' | 'warning' |
693
693
  type AvatarGroupOverlap = 'sm' | 'md' | 'lg';
694
694
 
695
695
  type AvatarProps = {
696
+ /**
697
+ * Ref forwarded to the root `<div>` element.
698
+ * Pass a `useRef<HTMLDivElement>()` to use the avatar as `anchorEl` for a `Menu`.
699
+ */
700
+ ref?: Ref<HTMLDivElement>;
696
701
  /**
697
702
  * URL of the image to display.
698
703
  * Falls back to `initials` (or first letters of `name`) if the image fails to load.
@@ -726,6 +731,26 @@ type AvatarProps = {
726
731
  onClick?: () => void;
727
732
  /** Accessible label. Defaults to `name` when set, otherwise `'Avatar'`. */
728
733
  ariaLabel?: string;
734
+ /**
735
+ * HTML `id` attribute on the root element.
736
+ * Useful as `aria-labelledby` target for an associated `Menu`.
737
+ */
738
+ id?: string;
739
+ /**
740
+ * Indicates that this element controls a popup (e.g. a menu).
741
+ * Set to `'menu'` when the avatar acts as a menu trigger.
742
+ */
743
+ 'aria-haspopup'?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
744
+ /**
745
+ * Communicates whether the controlled popup is currently open.
746
+ * Pair with `aria-haspopup` when using the avatar as a menu trigger.
747
+ */
748
+ 'aria-expanded'?: boolean;
749
+ /**
750
+ * `aria-controls` pointing to the id of the controlled popup panel
751
+ * (e.g. the `Menu` panel id).
752
+ */
753
+ 'aria-controls'?: string;
729
754
  };
730
755
 
731
756
  /**
@@ -1137,7 +1162,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
1137
1162
  static getDerivedStateFromError: (error: Error) => ErrorBoundaryState;
1138
1163
  componentDidCatch(error: Error, info: ErrorInfo): void;
1139
1164
  private reset;
1140
- render(): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
1165
+ render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | null | undefined;
1141
1166
  }
1142
1167
 
1143
1168
  type DefaultErrorFallbackProps = {
@@ -2866,6 +2891,8 @@ type MenuGroupProps = {
2866
2891
 
2867
2892
  /** ARIA role of a menu item. */
2868
2893
  type MenuItemRole = 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option';
2894
+ /** Height variant of a menu item. */
2895
+ type MenuItemSize = 'default' | 'compact';
2869
2896
  type MenuItemProps = HTMLAttributes<HTMLLIElement> & {
2870
2897
  ref?: Ref<HTMLLIElement>;
2871
2898
  /**
@@ -2902,6 +2929,13 @@ type MenuItemProps = HTMLAttributes<HTMLLIElement> & {
2902
2929
  focused?: boolean;
2903
2930
  /** Whether the item is non-interactive. */
2904
2931
  disabled?: boolean;
2932
+ /**
2933
+ * Height variant of the item.
2934
+ * - `'default'` — fixed height of 40 px, matching `DrawerItem` (default).
2935
+ * - `'compact'` — height driven by padding only; used inside `Select`.
2936
+ * @default 'default'
2937
+ */
2938
+ size?: MenuItemSize;
2905
2939
  /**
2906
2940
  * Whether clicking the item closes the whole menu (in addition to running
2907
2941
  * `onClick`).
@@ -2947,13 +2981,19 @@ declare const Menu: MenuComponent;
2947
2981
  declare const Tooltip: FC<TooltipProps>;
2948
2982
 
2949
2983
  /**
2950
- * Locks scrolling on `document.body` while `active` is true.
2984
+ * Locks **all** currently scrollable elements while `active` is true.
2985
+ *
2986
+ * Instead of assuming the scroll lives on `document.body`, this hook discovers
2987
+ * every element with real overflow and freezes it with `overflow: hidden`.
2988
+ * Elements marked `data-scroll-lock-ignore` — and their entire subtrees — are
2989
+ * skipped so overlays (menus, dialogs, drawers…) remain scrollable internally.
2990
+ *
2991
+ * For `<html>`, `paddingRight` is compensated when a native scrollbar is present
2992
+ * to prevent horizontal layout shift.
2951
2993
  *
2952
- * Preserves the current scroll position and keeps the scrollbar gutter
2953
- * (`overflow-y: scroll`) to avoid horizontal layout shift when the scrollbar
2954
- * disappears. The original styles and scroll position are restored on cleanup.
2994
+ * All original styles are restored on cleanup.
2955
2995
  *
2956
- * @example useBodyScrollLock(isDialogOpen)
2996
+ * @example useBodyScrollLock(isMenuOpen)
2957
2997
  */
2958
2998
  declare const useBodyScrollLock: (active: boolean) => void;
2959
2999
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-ds/components",
3
- "version": "1.7.15",
3
+ "version": "1.7.17",
4
4
  "type": "module",
5
5
  "description": "Aurora DS - React Components Library",
6
6
  "main": "dist/cjs/index.js",