@aurora-ds/components 1.7.11 → 1.7.13

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.
@@ -0,0 +1 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");*,:after,:before{box-sizing:border-box}body{font-family:Inter,sans-serif}
package/dist/esm/index.js CHANGED
@@ -254,7 +254,7 @@ const skeletonShimmerAnimation = keyframes({
254
254
  });
255
255
 
256
256
  /** Default duration in milliseconds for mount/unmount transition animations. */
257
- const DEFAULT_TRANSITION_DURATION_MS = 250;
257
+ const DEFAULT_TRANSITION_DURATION_MS = 150;
258
258
  const DEFAULT_BUTTON_HEIGHT = 40;
259
259
  const DEFAULT_DRAWER_ITEM_SIZE = 40;
260
260
  /** Drawer widths (px) — single source of truth for both the Drawer and its items. */
@@ -5648,7 +5648,7 @@ const DRAWER_STYLES = createStyles((theme) => ({
5648
5648
  display: 'flex',
5649
5649
  flexDirection: 'column',
5650
5650
  width: isExpanded ? EXPANDED_DRAWER_WIDTH : COLLAPSED_DRAWER_WIDTH,
5651
- transition: `width ${theme.transition.fast}`,
5651
+ transition: `width ${theme.transition.normal}`,
5652
5652
  overflow: 'hidden',
5653
5653
  backgroundColor: theme.colors.surfacePaper,
5654
5654
  borderRight: `1px solid ${theme.colors.borderMain}`,
@@ -5756,6 +5756,12 @@ const BACKDROP_STYLES = createStyles((theme) => ({
5756
5756
  const Backdrop = ({ visible, onClick }) => (jsx("div", { className: cx(BACKDROP_STYLES.root, visible && BACKDROP_STYLES.visible), onClick: onClick, "aria-hidden": true }));
5757
5757
  Backdrop.displayName = 'Backdrop';
5758
5758
 
5759
+ /**
5760
+ * Returns `true` if the user has requested reduced motion at the OS/browser level.
5761
+ * Falls back to `false` in environments where `matchMedia` is unavailable (SSR, tests).
5762
+ */
5763
+ const getPrefersReducedMotion = () => typeof window !== 'undefined' &&
5764
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches;
5759
5765
  /**
5760
5766
  * Manages mount/unmount transitions with a two-phase approach (visible → fading-in).
5761
5767
  *
@@ -5769,10 +5775,15 @@ Backdrop.displayName = 'Backdrop';
5769
5775
  * Closing sequence:
5770
5776
  * `isFadingIn=false` → CSS transition plays → after `duration` ms → `isVisible=false`.
5771
5777
  *
5778
+ * When `prefers-reduced-motion: reduce` is active the effective duration is forced to
5779
+ * `0` so the element is removed from the DOM immediately after hiding, in sync with
5780
+ * the near-instant CSS transition set by the global `globals.css` rule.
5781
+ *
5772
5782
  * @param isOpen - Whether the element should be shown.
5773
5783
  * @param duration - Transition duration in milliseconds (defaults to `DEFAULT_TRANSITION_DURATION_MS`).
5774
5784
  */
5775
5785
  const useTransitionRender = (isOpen, duration = DEFAULT_TRANSITION_DURATION_MS) => {
5786
+ const effectiveDuration = getPrefersReducedMotion() ? 0 : duration;
5776
5787
  const [isVisible, setIsVisible] = useState(isOpen);
5777
5788
  const [isFadingIn, setIsFadingIn] = useState(isOpen);
5778
5789
  // Mount synchronously before paint so the element is in the DOM at opacity:0
@@ -5797,10 +5808,10 @@ const useTransitionRender = (isOpen, duration = DEFAULT_TRANSITION_DURATION_MS)
5797
5808
  }
5798
5809
  else {
5799
5810
  setIsFadingIn(false);
5800
- const timeout = setTimeout(() => setIsVisible(false), duration);
5811
+ const timeout = setTimeout(() => setIsVisible(false), effectiveDuration);
5801
5812
  return () => clearTimeout(timeout);
5802
5813
  }
5803
- }, [isOpen, duration]);
5814
+ }, [isOpen, effectiveDuration]);
5804
5815
  return { isVisible, isFadingIn };
5805
5816
  };
5806
5817
 
@@ -5833,7 +5844,7 @@ const DRAWER_ITEM_STYLES = createStyles((theme) => ({
5833
5844
  outline: 'none',
5834
5845
  textDecoration: 'none',
5835
5846
  boxSizing: 'border-box',
5836
- transition: `width ${theme.transition.fast}, background-color ${theme.transition.fast}, color ${theme.transition.fast}`,
5847
+ transition: `width ${theme.transition.normal}, background-color ${theme.transition.fast}, color ${theme.transition.fast}`,
5837
5848
  whiteSpace: 'nowrap',
5838
5849
  overflow: 'hidden',
5839
5850
  height: DEFAULT_DRAWER_ITEM_SIZE,
@@ -5897,7 +5908,7 @@ const DRAWER_ITEM_STYLES = createStyles((theme) => ({
5897
5908
  */
5898
5909
  const DrawerItem = ({ startIcon, label, selected = false, endContent, href, onClick, disabled = false, ariaLabel, ariaLabelledBy, ariaDescribedBy, ariaControls, ariaExpanded, ariaHasPopup, ariaCurrent, }) => {
5899
5910
  const { isExpanded } = useDrawerContext();
5900
- const { isVisible: isLabelVisible, isFadingIn: isLabelFadingIn } = useTransitionRender(isExpanded);
5911
+ const { isVisible: isLabelVisible, isFadingIn: isLabelFadingIn } = useTransitionRender(isExpanded, 200);
5901
5912
  const rootClassName = DRAWER_ITEM_STYLES.root({ selected, isExpanded });
5902
5913
  const computedAriaLabel = ariaLabel ?? (!isExpanded ? label : undefined);
5903
5914
  const computedAriaCurrent = ariaCurrent ?? (selected ? 'page' : undefined);
@@ -7188,9 +7199,9 @@ const themeSpacing = {
7188
7199
  * Default transition tokens
7189
7200
  */
7190
7201
  const themeTransition = {
7191
- fast: '150ms ease-in-out',
7192
- normal: '250ms ease-in-out',
7193
- slow: '350ms ease-in-out',
7202
+ fast: '100ms ease-in-out',
7203
+ normal: '200ms ease-in-out',
7204
+ slow: '300ms ease-in-out',
7194
7205
  };
7195
7206
 
7196
7207
  /**