@tinybigui/react 0.19.0 → 0.20.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/index.d.cts CHANGED
@@ -5477,10 +5477,19 @@ type SnackbarSeverity = "default" | "error";
5477
5477
  /**
5478
5478
  * Internal animation state machine for the Snackbar.
5479
5479
  *
5480
- * - `entering` → zoom-in start: scale-75 + opacity-0 (no duration, paints before transition)
5481
- * - `visible` → scale-100 + opacity-100 (medium1 / standard-decelerate = 250ms)
5482
- * - `exiting` → scale-75 + opacity-0 (short4 / standard-accelerate = 200ms)
5480
+ * - `entering` → initial paint: opacity-0 + directional translate offset (no duration)
5481
+ * - `visible` → slide in + fade in: translate-y-0 + opacity-100
5482
+ * (spring-standard-default-effects = 200ms, no overshoot)
5483
+ * - `exiting` → slide out + fade out: offset + opacity-0
5484
+ * (spring-standard-fast-effects = 150ms)
5483
5485
  * - `exited` → removed from DOM / stack updated
5486
+ *
5487
+ * The translate direction is position-aware:
5488
+ * bottom positions → slide up from below (translate-y-3 → translate-y-0)
5489
+ * top positions → slide down from above (-translate-y-3 → translate-y-0)
5490
+ *
5491
+ * When `prefers-reduced-motion` is active, the translate offset is suppressed
5492
+ * and only opacity transitions (fade-only).
5484
5493
  */
5485
5494
  type SnackbarAnimationState = "entering" | "visible" | "exiting" | "exited";
5486
5495
  /**
@@ -5679,14 +5688,23 @@ interface SnackbarProviderProps {
5679
5688
  * Renders one of four MD3 Snackbar content configurations:
5680
5689
  * 1. Single-line message only
5681
5690
  * 2. Two-line message + `supportingText`
5682
- * 3. Single-line with text `action` button (styled `Button variant="text"` with
5683
- * `inverse-primary` color per MD3 spec)
5691
+ * 3. Single-line with text `action` button (styled with `inverse-primary` per MD3 spec)
5684
5692
  * 4. Single-line with close icon (or combined with action)
5685
5693
  *
5686
5694
  * Uses `SnackbarHeadless` for all behavioral concerns (ARIA live region,
5687
5695
  * auto-dismiss timer with pause/resume, animation state machine) and CVA
5688
5696
  * variants for MD3-compliant visual styling.
5689
5697
  *
5698
+ * **Motion**: Position-aware slide + fade using spring-standard effects tokens.
5699
+ * Automatically respects `prefers-reduced-motion` (fade-only when reduced motion
5700
+ * is preferred — no translate offset).
5701
+ *
5702
+ * **State layers**: Dedicated slot components (`SnackbarActionButton`,
5703
+ * `SnackbarCloseButton`) replace the shared `Button`/`IconButton` components.
5704
+ * This ensures the state-layer colors are MD3-correct on an `inverse-surface`:
5705
+ * - Action button state layer: `bg-inverse-primary`
5706
+ * - Close button state layer: `bg-inverse-on-surface`
5707
+ *
5690
5708
  * For typical app usage, render inside `SnackbarProvider` and trigger via
5691
5709
  * the `useSnackbar` hook. For declarative/test usage, it can be rendered
5692
5710
  * standalone.
package/dist/index.d.ts CHANGED
@@ -5477,10 +5477,19 @@ type SnackbarSeverity = "default" | "error";
5477
5477
  /**
5478
5478
  * Internal animation state machine for the Snackbar.
5479
5479
  *
5480
- * - `entering` → zoom-in start: scale-75 + opacity-0 (no duration, paints before transition)
5481
- * - `visible` → scale-100 + opacity-100 (medium1 / standard-decelerate = 250ms)
5482
- * - `exiting` → scale-75 + opacity-0 (short4 / standard-accelerate = 200ms)
5480
+ * - `entering` → initial paint: opacity-0 + directional translate offset (no duration)
5481
+ * - `visible` → slide in + fade in: translate-y-0 + opacity-100
5482
+ * (spring-standard-default-effects = 200ms, no overshoot)
5483
+ * - `exiting` → slide out + fade out: offset + opacity-0
5484
+ * (spring-standard-fast-effects = 150ms)
5483
5485
  * - `exited` → removed from DOM / stack updated
5486
+ *
5487
+ * The translate direction is position-aware:
5488
+ * bottom positions → slide up from below (translate-y-3 → translate-y-0)
5489
+ * top positions → slide down from above (-translate-y-3 → translate-y-0)
5490
+ *
5491
+ * When `prefers-reduced-motion` is active, the translate offset is suppressed
5492
+ * and only opacity transitions (fade-only).
5484
5493
  */
5485
5494
  type SnackbarAnimationState = "entering" | "visible" | "exiting" | "exited";
5486
5495
  /**
@@ -5679,14 +5688,23 @@ interface SnackbarProviderProps {
5679
5688
  * Renders one of four MD3 Snackbar content configurations:
5680
5689
  * 1. Single-line message only
5681
5690
  * 2. Two-line message + `supportingText`
5682
- * 3. Single-line with text `action` button (styled `Button variant="text"` with
5683
- * `inverse-primary` color per MD3 spec)
5691
+ * 3. Single-line with text `action` button (styled with `inverse-primary` per MD3 spec)
5684
5692
  * 4. Single-line with close icon (or combined with action)
5685
5693
  *
5686
5694
  * Uses `SnackbarHeadless` for all behavioral concerns (ARIA live region,
5687
5695
  * auto-dismiss timer with pause/resume, animation state machine) and CVA
5688
5696
  * variants for MD3-compliant visual styling.
5689
5697
  *
5698
+ * **Motion**: Position-aware slide + fade using spring-standard effects tokens.
5699
+ * Automatically respects `prefers-reduced-motion` (fade-only when reduced motion
5700
+ * is preferred — no translate offset).
5701
+ *
5702
+ * **State layers**: Dedicated slot components (`SnackbarActionButton`,
5703
+ * `SnackbarCloseButton`) replace the shared `Button`/`IconButton` components.
5704
+ * This ensures the state-layer colors are MD3-correct on an `inverse-surface`:
5705
+ * - Action button state layer: `bg-inverse-primary`
5706
+ * - Close button state layer: `bg-inverse-on-surface`
5707
+ *
5690
5708
  * For typical app usage, render inside `SnackbarProvider` and trigger via
5691
5709
  * the `useSnackbar` hook. For declarative/test usage, it can be rendered
5692
5710
  * standalone.
package/dist/index.js CHANGED
@@ -6555,7 +6555,6 @@ var snackbarBaseVariants = cva(
6555
6555
  "min-w-72",
6556
6556
  "max-w-snackbar-max",
6557
6557
  "w-max",
6558
- "min-h-12",
6559
6558
  // Restore pointer events so hover/focus timer pause works
6560
6559
  "pointer-events-auto",
6561
6560
  // Surface
@@ -6566,25 +6565,27 @@ var snackbarBaseVariants = cva(
6566
6565
  "shadow-elevation-3",
6567
6566
  // Layout
6568
6567
  "flex",
6569
- "items-center",
6570
6568
  "gap-x-1",
6571
- "pl-4 pr-2",
6572
- // Typography
6569
+ "pl-4",
6570
+ // Typography base (inherited by message/supporting-text slots)
6573
6571
  "text-body-medium",
6574
6572
  "text-inverse-on-surface",
6575
- // Transition (properties used by both entry and exit)
6573
+ // Slide + fade transition spring-standard effects tokens (no overshoot).
6574
+ // The translate offset is small (12px), so using the effects token pair for
6575
+ // BOTH opacity AND transform is safe: no visible overshoot at this scale.
6576
6576
  "transition-[opacity,transform]",
6577
6577
  "will-change-[opacity,transform]"
6578
6578
  ],
6579
6579
  {
6580
6580
  variants: {
6581
6581
  /**
6582
- * Whether the Snackbar has supporting text (two-line layout).
6583
- * Adjusts vertical padding to MD3 spec for two-line configuration.
6582
+ * Two-line density mode.
6583
+ * false 48dp, items centered (single-line message)
6584
+ * true — 68dp, items top-aligned (message + supporting text)
6584
6585
  */
6585
6586
  twoLine: {
6586
- true: "py-1",
6587
- false: "py-1"
6587
+ false: ["min-h-12", "items-center", "pr-1"],
6588
+ true: ["min-h-[4.25rem]", "items-start", "pr-1"]
6588
6589
  }
6589
6590
  },
6590
6591
  defaultVariants: {
@@ -6610,53 +6611,211 @@ cva("", {
6610
6611
  var snackbarAnimationVariants = cva("", {
6611
6612
  variants: {
6612
6613
  animationState: {
6613
- entering: ["opacity-0", "scale-75"],
6614
- visible: ["scale-100", "opacity-100", "duration-medium1", "ease-emphasized-decelerate"],
6615
- exiting: ["scale-75", "opacity-0", "duration-short4", "ease-standard-accelerate"],
6616
- exited: ["scale-75", "opacity-0", "duration-short4", "ease-standard-accelerate"]
6614
+ entering: [],
6615
+ visible: [],
6616
+ exiting: [],
6617
+ exited: []
6617
6618
  },
6618
6619
  enterDirection: {
6619
- up: ["origin-bottom"],
6620
- down: ["origin-top"]
6620
+ up: [],
6621
+ down: []
6621
6622
  }
6622
6623
  },
6623
- defaultVariants: {
6624
- animationState: "entering",
6625
- enterDirection: "up"
6626
- }
6627
- });
6628
- cva([...snackbarBaseVariants()], {
6629
- variants: {
6630
- animationState: {
6631
- entering: ["opacity-0", "scale-75"],
6632
- visible: ["scale-100", "opacity-100", "duration-medium1", "ease-emphasized-decelerate"],
6633
- exiting: ["scale-75", "opacity-0", "duration-short4", "ease-standard-accelerate"],
6634
- exited: ["scale-75", "opacity-0", "duration-short4", "ease-standard-accelerate"]
6624
+ compoundVariants: [
6625
+ // ── entering ──────────────────────────────────────────────────────────────
6626
+ // No transition duration — instant jump to offset state before first paint.
6627
+ {
6628
+ animationState: "entering",
6629
+ enterDirection: "up",
6630
+ className: ["opacity-0", "translate-y-3"]
6635
6631
  },
6636
- enterDirection: {
6637
- up: ["origin-bottom"],
6638
- down: ["origin-top"]
6632
+ {
6633
+ animationState: "entering",
6634
+ enterDirection: "down",
6635
+ className: ["opacity-0", "-translate-y-3"]
6639
6636
  },
6640
- position: {
6641
- "bottom-center": ["bottom-4", "left-1/2", "-translate-x-1/2"],
6642
- "bottom-left": ["bottom-4", "left-4"],
6643
- "bottom-right": ["bottom-4", "right-4"],
6644
- "top-center": ["top-4", "left-1/2", "-translate-x-1/2"],
6645
- "top-left": ["top-4", "left-4"],
6646
- "top-right": ["top-4", "right-4"]
6637
+ // ── visible ───────────────────────────────────────────────────────────────
6638
+ // spring-standard default effects = 200ms, no overshoot.
6639
+ {
6640
+ animationState: "visible",
6641
+ enterDirection: "up",
6642
+ className: [
6643
+ "opacity-100",
6644
+ "translate-y-0",
6645
+ "duration-spring-standard-default-effects",
6646
+ "ease-spring-standard-default-effects"
6647
+ ]
6648
+ },
6649
+ {
6650
+ animationState: "visible",
6651
+ enterDirection: "down",
6652
+ className: [
6653
+ "opacity-100",
6654
+ "translate-y-0",
6655
+ "duration-spring-standard-default-effects",
6656
+ "ease-spring-standard-default-effects"
6657
+ ]
6658
+ },
6659
+ // ── exiting ───────────────────────────────────────────────────────────────
6660
+ // spring-standard fast effects = 150ms (quicker exit).
6661
+ {
6662
+ animationState: "exiting",
6663
+ enterDirection: "up",
6664
+ className: [
6665
+ "opacity-0",
6666
+ "translate-y-3",
6667
+ "duration-spring-standard-fast-effects",
6668
+ "ease-spring-standard-fast-effects"
6669
+ ]
6647
6670
  },
6648
- twoLine: {
6649
- true: "py-1",
6650
- false: "py-1"
6671
+ {
6672
+ animationState: "exiting",
6673
+ enterDirection: "down",
6674
+ className: [
6675
+ "opacity-0",
6676
+ "-translate-y-3",
6677
+ "duration-spring-standard-fast-effects",
6678
+ "ease-spring-standard-fast-effects"
6679
+ ]
6680
+ },
6681
+ // ── exited ────────────────────────────────────────────────────────────────
6682
+ // Hold final position — element is removed from DOM shortly after.
6683
+ {
6684
+ animationState: "exited",
6685
+ enterDirection: "up",
6686
+ className: ["opacity-0", "translate-y-3"]
6687
+ },
6688
+ {
6689
+ animationState: "exited",
6690
+ enterDirection: "down",
6691
+ className: ["opacity-0", "-translate-y-3"]
6651
6692
  }
6652
- },
6693
+ ],
6653
6694
  defaultVariants: {
6654
6695
  animationState: "entering",
6655
- enterDirection: "up",
6656
- position: "bottom-center",
6657
- twoLine: false
6696
+ enterDirection: "up"
6658
6697
  }
6659
6698
  });
6699
+ cva(
6700
+ [
6701
+ "min-w-72",
6702
+ "max-w-snackbar-max",
6703
+ "w-max",
6704
+ "pointer-events-auto",
6705
+ "bg-inverse-surface",
6706
+ "rounded-xs",
6707
+ "shadow-elevation-3",
6708
+ "flex",
6709
+ "gap-x-1",
6710
+ "pl-4",
6711
+ "text-body-medium",
6712
+ "text-inverse-on-surface",
6713
+ "transition-[opacity,transform]",
6714
+ "will-change-[opacity,transform]"
6715
+ ],
6716
+ {
6717
+ variants: {
6718
+ twoLine: {
6719
+ false: ["min-h-12", "items-center", "pr-1"],
6720
+ true: ["min-h-[4.25rem]", "items-start", "pr-1"]
6721
+ },
6722
+ animationState: {
6723
+ entering: [],
6724
+ visible: [],
6725
+ exiting: [],
6726
+ exited: []
6727
+ },
6728
+ enterDirection: {
6729
+ up: [],
6730
+ down: []
6731
+ },
6732
+ position: {
6733
+ "bottom-center": ["bottom-4", "left-1/2", "-translate-x-1/2"],
6734
+ "bottom-left": ["bottom-4", "left-4"],
6735
+ "bottom-right": ["bottom-4", "right-4"],
6736
+ "top-center": ["top-4", "left-1/2", "-translate-x-1/2"],
6737
+ "top-left": ["top-4", "left-4"],
6738
+ "top-right": ["top-4", "right-4"]
6739
+ }
6740
+ },
6741
+ compoundVariants: [
6742
+ {
6743
+ animationState: "entering",
6744
+ enterDirection: "up",
6745
+ className: ["opacity-0", "translate-y-3"]
6746
+ },
6747
+ {
6748
+ animationState: "entering",
6749
+ enterDirection: "down",
6750
+ className: ["opacity-0", "-translate-y-3"]
6751
+ },
6752
+ {
6753
+ animationState: "visible",
6754
+ enterDirection: "up",
6755
+ className: [
6756
+ "opacity-100",
6757
+ "translate-y-0",
6758
+ "duration-spring-standard-default-effects",
6759
+ "ease-spring-standard-default-effects"
6760
+ ]
6761
+ },
6762
+ {
6763
+ animationState: "visible",
6764
+ enterDirection: "down",
6765
+ className: [
6766
+ "opacity-100",
6767
+ "translate-y-0",
6768
+ "duration-spring-standard-default-effects",
6769
+ "ease-spring-standard-default-effects"
6770
+ ]
6771
+ },
6772
+ {
6773
+ animationState: "exiting",
6774
+ enterDirection: "up",
6775
+ className: [
6776
+ "opacity-0",
6777
+ "translate-y-3",
6778
+ "duration-spring-standard-fast-effects",
6779
+ "ease-spring-standard-fast-effects"
6780
+ ]
6781
+ },
6782
+ {
6783
+ animationState: "exiting",
6784
+ enterDirection: "down",
6785
+ className: [
6786
+ "opacity-0",
6787
+ "-translate-y-3",
6788
+ "duration-spring-standard-fast-effects",
6789
+ "ease-spring-standard-fast-effects"
6790
+ ]
6791
+ },
6792
+ {
6793
+ animationState: "exited",
6794
+ enterDirection: "up",
6795
+ className: ["opacity-0", "translate-y-3"]
6796
+ },
6797
+ {
6798
+ animationState: "exited",
6799
+ enterDirection: "down",
6800
+ className: ["opacity-0", "-translate-y-3"]
6801
+ }
6802
+ ],
6803
+ defaultVariants: {
6804
+ animationState: "entering",
6805
+ enterDirection: "up",
6806
+ position: "bottom-center",
6807
+ twoLine: false
6808
+ }
6809
+ }
6810
+ );
6811
+ var snackbarContentVariants = cva([
6812
+ "flex",
6813
+ "flex-col",
6814
+ "flex-1",
6815
+ "min-w-0",
6816
+ "py-3",
6817
+ "pr-2"
6818
+ ]);
6660
6819
  var snackbarMessageVariants = cva([
6661
6820
  "flex-1",
6662
6821
  "text-body-medium",
@@ -6665,15 +6824,83 @@ var snackbarMessageVariants = cva([
6665
6824
  var snackbarSupportingTextVariants = cva([
6666
6825
  "text-body-medium",
6667
6826
  "text-inverse-on-surface",
6668
- "opacity-80"
6827
+ "mt-1"
6669
6828
  ]);
6670
- var snackbarActionVariants = cva(["shrink-0", "text-inverse-primary"]);
6671
- var snackbarCloseVariants = cva(["shrink-0", "text-inverse-on-surface"]);
6672
- var snackbarContentVariants = cva(["flex", "flex-col", "flex-1", "min-w-0 py-2 pr-2"]);
6673
- cva(["scale-75", "opacity-0"]);
6829
+ cva(["opacity-0"]);
6674
6830
  function getEnterDirection(position) {
6675
6831
  return position.startsWith("top") ? "down" : "up";
6676
6832
  }
6833
+ var snackbarActionVariants = cva([
6834
+ // Layout
6835
+ "relative inline-flex items-center justify-center shrink-0",
6836
+ "h-9 px-3",
6837
+ "rounded-full cursor-pointer select-none",
6838
+ // Typography (MD3 text button: label-large)
6839
+ "text-label-large",
6840
+ "text-inverse-primary",
6841
+ // Effects transition (color)
6842
+ "transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6843
+ // Disabled
6844
+ "data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none",
6845
+ "data-[disabled]:text-on-surface/38"
6846
+ ]);
6847
+ var snackbarActionStateLayerVariants = cva([
6848
+ "absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
6849
+ "bg-inverse-primary",
6850
+ "transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6851
+ // Hover: 8%
6852
+ "group-data-[hovered]/snackbar-action:opacity-8",
6853
+ // Focus: 10%
6854
+ "group-data-[focus-visible]/snackbar-action:opacity-10",
6855
+ // Pressed: 10%, doubled selector wins over hover
6856
+ "group-data-[pressed]/snackbar-action:group-data-[pressed]/snackbar-action:opacity-10",
6857
+ // No state layer when disabled
6858
+ "group-data-[disabled]/snackbar-action:hidden"
6859
+ ]);
6860
+ var snackbarActionFocusRingVariants = cva([
6861
+ "pointer-events-none absolute inset-[-3px] rounded-full",
6862
+ "outline outline-2 outline-offset-0 outline-inverse-primary",
6863
+ "transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6864
+ "opacity-0",
6865
+ "group-data-[focus-visible]/snackbar-action:opacity-100"
6866
+ ]);
6867
+ var snackbarCloseVariants = cva([
6868
+ // Layout
6869
+ "relative inline-flex items-center justify-center shrink-0",
6870
+ "size-8",
6871
+ "rounded-full cursor-pointer select-none",
6872
+ // Color
6873
+ "text-inverse-on-surface",
6874
+ // Effects transition (color)
6875
+ "transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6876
+ // Disabled
6877
+ "data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none",
6878
+ "data-[disabled]:text-on-surface/38"
6879
+ ]);
6880
+ var snackbarCloseStateLayerVariants = cva([
6881
+ "absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
6882
+ "bg-inverse-on-surface",
6883
+ "transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6884
+ // Hover: 8%
6885
+ "group-data-[hovered]/snackbar-close:opacity-8",
6886
+ // Focus: 10%
6887
+ "group-data-[focus-visible]/snackbar-close:opacity-10",
6888
+ // Pressed: 10%, doubled selector wins over hover
6889
+ "group-data-[pressed]/snackbar-close:group-data-[pressed]/snackbar-close:opacity-10",
6890
+ // No state layer when disabled
6891
+ "group-data-[disabled]/snackbar-close:hidden"
6892
+ ]);
6893
+ var snackbarCloseFocusRingVariants = cva([
6894
+ "pointer-events-none absolute inset-[-3px] rounded-full",
6895
+ "outline outline-2 outline-offset-0 outline-inverse-on-surface",
6896
+ "transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
6897
+ "opacity-0",
6898
+ "group-data-[focus-visible]/snackbar-close:opacity-100"
6899
+ ]);
6900
+ var snackbarCloseIconVariants = cva([
6901
+ "relative z-10 inline-flex shrink-0 items-center justify-center",
6902
+ "size-6"
6903
+ ]);
6677
6904
  function CloseIcon() {
6678
6905
  return /* @__PURE__ */ jsx(
6679
6906
  "svg",
@@ -6688,6 +6915,52 @@ function CloseIcon() {
6688
6915
  }
6689
6916
  );
6690
6917
  }
6918
+ function SnackbarActionButton({ label, onAction }) {
6919
+ const ref = useRef(null);
6920
+ const { buttonProps, isPressed } = useButton({ onPress: onAction }, ref);
6921
+ const { isHovered, hoverProps } = useHover({});
6922
+ const { isFocusVisible, focusProps } = useFocusRing();
6923
+ const { onMouseDown, ripples } = useRipple();
6924
+ return /* @__PURE__ */ jsxs(
6925
+ "button",
6926
+ {
6927
+ type: "button",
6928
+ ...mergeProps$1(buttonProps, hoverProps, focusProps, { onMouseDown }),
6929
+ ref,
6930
+ className: cn(snackbarActionVariants(), "group/snackbar-action"),
6931
+ ...getInteractionDataAttributes({ isHovered, isFocusVisible, isPressed }),
6932
+ children: [
6933
+ ripples,
6934
+ /* @__PURE__ */ jsx("span", { className: snackbarActionStateLayerVariants(), "aria-hidden": "true" }),
6935
+ /* @__PURE__ */ jsx("span", { className: snackbarActionFocusRingVariants(), "aria-hidden": "true" }),
6936
+ /* @__PURE__ */ jsx("span", { className: "relative z-10", children: label })
6937
+ ]
6938
+ }
6939
+ );
6940
+ }
6941
+ function SnackbarCloseButton({ onPress }) {
6942
+ const ref = useRef(null);
6943
+ const { buttonProps, isPressed } = useButton({ onPress, "aria-label": "Close" }, ref);
6944
+ const { isHovered, hoverProps } = useHover({});
6945
+ const { isFocusVisible, focusProps } = useFocusRing();
6946
+ const { onMouseDown, ripples } = useRipple();
6947
+ return /* @__PURE__ */ jsxs(
6948
+ "button",
6949
+ {
6950
+ type: "button",
6951
+ ...mergeProps$1(buttonProps, hoverProps, focusProps, { onMouseDown }),
6952
+ ref,
6953
+ className: cn(snackbarCloseVariants(), "group/snackbar-close"),
6954
+ ...getInteractionDataAttributes({ isHovered, isFocusVisible, isPressed }),
6955
+ children: [
6956
+ ripples,
6957
+ /* @__PURE__ */ jsx("span", { className: snackbarCloseStateLayerVariants(), "aria-hidden": "true" }),
6958
+ /* @__PURE__ */ jsx("span", { className: snackbarCloseFocusRingVariants(), "aria-hidden": "true" }),
6959
+ /* @__PURE__ */ jsx("span", { className: snackbarCloseIconVariants(), "aria-hidden": "true", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
6960
+ ]
6961
+ }
6962
+ );
6963
+ }
6691
6964
  var Snackbar = forwardRef(function Snackbar2({
6692
6965
  message,
6693
6966
  supportingText,
@@ -6700,6 +6973,7 @@ var Snackbar = forwardRef(function Snackbar2({
6700
6973
  className
6701
6974
  }, ref) {
6702
6975
  const isTwoLine = Boolean(supportingText);
6976
+ const reducedMotion = useReducedMotion();
6703
6977
  const baseClassName = cn(snackbarBaseVariants({ twoLine: isTwoLine }), className);
6704
6978
  return /* @__PURE__ */ jsx(
6705
6979
  SnackbarHeadless,
@@ -6714,31 +6988,22 @@ var Snackbar = forwardRef(function Snackbar2({
6714
6988
  position,
6715
6989
  ...onClose !== void 0 && { onClose },
6716
6990
  className: baseClassName,
6717
- getAnimationClassName: (state, pos) => snackbarAnimationVariants({ animationState: state, enterDirection: getEnterDirection(pos) }),
6991
+ getAnimationClassName: (state, pos) => {
6992
+ if (reducedMotion) {
6993
+ return state === "visible" ? "opacity-100 duration-spring-standard-default-effects ease-spring-standard-default-effects" : "opacity-0";
6994
+ }
6995
+ return snackbarAnimationVariants({
6996
+ animationState: state,
6997
+ enterDirection: getEnterDirection(pos)
6998
+ });
6999
+ },
6718
7000
  children: ({ onClose: triggerClose }) => /* @__PURE__ */ jsxs(Fragment, { children: [
6719
7001
  /* @__PURE__ */ jsxs("div", { className: snackbarContentVariants(), children: [
6720
7002
  /* @__PURE__ */ jsx("span", { className: snackbarMessageVariants(), children: message }),
6721
7003
  supportingText && /* @__PURE__ */ jsx("span", { className: snackbarSupportingTextVariants(), children: supportingText })
6722
7004
  ] }),
6723
- action && /* @__PURE__ */ jsx("span", { className: snackbarActionVariants(), children: /* @__PURE__ */ jsx(
6724
- Button,
6725
- {
6726
- variant: "text",
6727
- onPress: action.onAction,
6728
- className: "text-inverse-primary hover:text-inverse-primary px-3",
6729
- children: action.label
6730
- }
6731
- ) }),
6732
- showClose && /* @__PURE__ */ jsx("span", { className: snackbarCloseVariants(), children: /* @__PURE__ */ jsx(
6733
- IconButton,
6734
- {
6735
- variant: "standard",
6736
- "aria-label": "Close",
6737
- onPress: triggerClose,
6738
- className: "text-inverse-on-surface hover:text-inverse-on-surface",
6739
- children: /* @__PURE__ */ jsx(CloseIcon, {})
6740
- }
6741
- ) })
7005
+ action && /* @__PURE__ */ jsx(SnackbarActionButton, { label: action.label, onAction: action.onAction }),
7006
+ showClose && /* @__PURE__ */ jsx(SnackbarCloseButton, { onPress: triggerClose })
6742
7007
  ] })
6743
7008
  }
6744
7009
  );