@aurora-ds/components 1.7.11 → 1.7.12

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. */
@@ -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
 
@@ -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
  /**