@bug-on/m3-expressive 1.2.1 → 1.2.3

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 (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/buttons.d.mts +26 -5
  3. package/dist/buttons.d.ts +26 -5
  4. package/dist/buttons.js +581 -345
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +573 -345
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core.js +52 -13
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.mjs +52 -13
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/feedback.js +52 -13
  13. package/dist/feedback.js.map +1 -1
  14. package/dist/feedback.mjs +52 -13
  15. package/dist/feedback.mjs.map +1 -1
  16. package/dist/forms.js +4 -1
  17. package/dist/forms.js.map +1 -1
  18. package/dist/forms.mjs +4 -1
  19. package/dist/forms.mjs.map +1 -1
  20. package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
  21. package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
  22. package/dist/index.d.mts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1483 -1027
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +1342 -887
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/layout.js +15 -7
  29. package/dist/layout.js.map +1 -1
  30. package/dist/layout.mjs +15 -7
  31. package/dist/layout.mjs.map +1 -1
  32. package/dist/navigation.d.mts +7 -1
  33. package/dist/navigation.d.ts +7 -1
  34. package/dist/navigation.js +281 -38
  35. package/dist/navigation.js.map +1 -1
  36. package/dist/navigation.mjs +281 -38
  37. package/dist/navigation.mjs.map +1 -1
  38. package/dist/overlays.js +52 -13
  39. package/dist/overlays.js.map +1 -1
  40. package/dist/overlays.mjs +52 -13
  41. package/dist/overlays.mjs.map +1 -1
  42. package/dist/pickers.js +177 -111
  43. package/dist/pickers.js.map +1 -1
  44. package/dist/pickers.mjs +177 -111
  45. package/dist/pickers.mjs.map +1 -1
  46. package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
  47. package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
  48. package/package.json +3 -3
@@ -2578,7 +2578,10 @@ function useRippleState(options = {}) {
2578
2578
  const rect = e.currentTarget.getBoundingClientRect();
2579
2579
  const x = e.clientX - rect.left;
2580
2580
  const y = e.clientY - rect.top;
2581
- const rippleSize = Math.hypot(rect.width, rect.height) * 2;
2581
+ const rippleSize = Math.max(
2582
+ Math.hypot(rect.width, rect.height) * 2.5,
2583
+ 320
2584
+ );
2582
2585
  setRipples((prev) => [
2583
2586
  ...prev,
2584
2587
  { id: Date.now(), x, y, size: rippleSize }
@@ -2659,9 +2662,16 @@ var NavigationBarItemComponent = React36.forwardRef(
2659
2662
  disabled = false,
2660
2663
  badge,
2661
2664
  className,
2662
- "aria-label": ariaLabelProp
2665
+ "aria-label": ariaLabelProp,
2666
+ asChild = false,
2667
+ children
2663
2668
  }, ref) => {
2664
- const { variant, itemLayout, itemClassName: contextItemClassName } = React36.useContext(NavigationBarContext);
2669
+ var _a;
2670
+ const {
2671
+ variant,
2672
+ itemLayout,
2673
+ itemClassName: contextItemClassName
2674
+ } = React36.useContext(NavigationBarContext);
2665
2675
  const isForcedHorizontal = itemLayout === "horizontal";
2666
2676
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
2667
2677
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -2684,6 +2694,101 @@ var NavigationBarItemComponent = React36.forwardRef(
2684
2694
  [disabled, selected, onClick]
2685
2695
  );
2686
2696
  const filledIcon = cloneIconWithFill(icon, selected);
2697
+ const itemClassName = cn(
2698
+ "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
2699
+ variant === "xr" ? isResponsiveHorizontal ? "flex-1 min-[600px]:flex-initial min-[600px]:w-auto" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1",
2700
+ disabled && "pointer-events-none opacity-[0.38]",
2701
+ contextItemClassName,
2702
+ className
2703
+ );
2704
+ if (asChild && children) {
2705
+ const child = React36.Children.only(children);
2706
+ const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
2707
+ /* @__PURE__ */ jsxs(
2708
+ "div",
2709
+ {
2710
+ className: cn(
2711
+ "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
2712
+ isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1.5 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:py-0 min-[600px]:rounded-full min-[600px]:w-auto",
2713
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
2714
+ ),
2715
+ children: [
2716
+ /* @__PURE__ */ jsxs(
2717
+ "div",
2718
+ {
2719
+ className: cn(
2720
+ "absolute inset-0 z-0 hidden",
2721
+ isResponsiveHorizontal && "min-[600px]:block",
2722
+ isForcedHorizontal && "block!"
2723
+ ),
2724
+ children: [
2725
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
2726
+ /* @__PURE__ */ jsx(HoverStateLayer, {}),
2727
+ /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
2728
+ ]
2729
+ }
2730
+ ),
2731
+ /* @__PURE__ */ jsxs(
2732
+ "div",
2733
+ {
2734
+ className: cn(
2735
+ "relative flex items-center justify-center shrink-0 z-10",
2736
+ "h-8 w-16 mx-auto rounded-full",
2737
+ isResponsiveHorizontal && "min-[600px]:size-6 min-[600px]:w-auto min-[600px]:h-auto",
2738
+ isForcedHorizontal && "size-6 w-auto h-auto"
2739
+ ),
2740
+ children: [
2741
+ /* @__PURE__ */ jsxs(
2742
+ "div",
2743
+ {
2744
+ className: cn(
2745
+ "absolute inset-0 z-0",
2746
+ isResponsiveHorizontal && "min-[600px]:hidden",
2747
+ isForcedHorizontal && "hidden"
2748
+ ),
2749
+ children: [
2750
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill, {}) }),
2751
+ /* @__PURE__ */ jsx(HoverStateLayer, {}),
2752
+ /* @__PURE__ */ jsx(RippleLayer, { ripples, onRippleDone: removeRipple })
2753
+ ]
2754
+ }
2755
+ ),
2756
+ /* @__PURE__ */ jsx("div", { className: "relative z-10 flex size-6 items-center justify-center text-current", children: /* @__PURE__ */ jsx(IconContainer, { selected, badge, children: filledIcon }) })
2757
+ ]
2758
+ }
2759
+ ),
2760
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsx(
2761
+ "span",
2762
+ {
2763
+ className: cn(
2764
+ "z-10 transition-all duration-200 truncate px-1",
2765
+ selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
2766
+ "font-medium text-[12px] leading-4 tracking-[0.5px]"
2767
+ ),
2768
+ children: (_a = child.props.children) != null ? _a : label
2769
+ },
2770
+ "nav-label"
2771
+ ) })
2772
+ ]
2773
+ }
2774
+ ),
2775
+ /* @__PURE__ */ jsx(TouchTarget, {})
2776
+ ] });
2777
+ return /* @__PURE__ */ jsx(
2778
+ Slot,
2779
+ {
2780
+ ref,
2781
+ role: "menuitem",
2782
+ "aria-current": selected ? "page" : void 0,
2783
+ "aria-disabled": disabled ? true : void 0,
2784
+ "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
2785
+ onClick: handleClick,
2786
+ onPointerDown,
2787
+ className: itemClassName,
2788
+ children: React36.cloneElement(child, { children: innerContent })
2789
+ }
2790
+ );
2791
+ }
2687
2792
  return /* @__PURE__ */ jsxs(
2688
2793
  m.button,
2689
2794
  {
@@ -2695,13 +2800,7 @@ var NavigationBarItemComponent = React36.forwardRef(
2695
2800
  "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
2696
2801
  onClick: handleClick,
2697
2802
  onPointerDown,
2698
- className: cn(
2699
- "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
2700
- variant === "xr" ? isResponsiveHorizontal ? "flex-1 min-[600px]:flex-initial min-[600px]:w-auto" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1" : isForcedHorizontal ? "flex-initial w-auto" : "flex-1",
2701
- disabled && "pointer-events-none opacity-[0.38]",
2702
- contextItemClassName,
2703
- className
2704
- ),
2803
+ className: itemClassName,
2705
2804
  children: [
2706
2805
  /* @__PURE__ */ jsxs(
2707
2806
  "div",
@@ -2865,7 +2964,12 @@ var NavigationBarComponent = React36.forwardRef(
2865
2964
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
2866
2965
  NavigationBarContext.Provider,
2867
2966
  {
2868
- value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
2967
+ value: {
2968
+ variant,
2969
+ itemLayout,
2970
+ activeIndicatorTransition,
2971
+ itemClassName
2972
+ },
2869
2973
  children: /* @__PURE__ */ jsx(
2870
2974
  m.nav,
2871
2975
  {
@@ -3001,8 +3105,11 @@ var NavigationRailItemComponent = React36.forwardRef(
3001
3105
  disabled = false,
3002
3106
  badge,
3003
3107
  className,
3004
- "aria-label": ariaLabelProp
3108
+ "aria-label": ariaLabelProp,
3109
+ asChild = false,
3110
+ children
3005
3111
  }, ref) => {
3112
+ var _a;
3006
3113
  const { variant, labelVisibility } = React36.useContext(
3007
3114
  NavigationRailContext
3008
3115
  );
@@ -3026,6 +3133,96 @@ var NavigationRailItemComponent = React36.forwardRef(
3026
3133
  );
3027
3134
  const filledIcon = cloneIconWithFill2(icon, selected);
3028
3135
  const labelInitial = isModal ? false : { opacity: 0, x: isExpanded ? -12 : 0, y: isExpanded ? 0 : -8 };
3136
+ const itemClassName = cn(
3137
+ "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none",
3138
+ "focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2 rounded-full",
3139
+ disabled && "pointer-events-none opacity-[0.38]",
3140
+ isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
3141
+ className
3142
+ );
3143
+ if (asChild && children) {
3144
+ const child = React36.Children.only(children);
3145
+ const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
3146
+ /* @__PURE__ */ jsxs(
3147
+ m.div,
3148
+ {
3149
+ layout: enableLayout,
3150
+ className: cn(
3151
+ "relative flex z-10",
3152
+ isExpanded ? "flex-row items-center w-fit h-14 px-4 gap-x-3 rounded-full" : "flex-col items-center justify-center w-full gap-y-1 rounded-full"
3153
+ ),
3154
+ children: [
3155
+ isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
3156
+ ActivePill2,
3157
+ {
3158
+ layoutId: activePillId,
3159
+ disableInitial: isModal
3160
+ }
3161
+ ) }),
3162
+ isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
3163
+ isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
3164
+ /* @__PURE__ */ jsxs(
3165
+ m.div,
3166
+ {
3167
+ layout: enableLayout,
3168
+ className: cn(
3169
+ "relative flex items-center justify-center shrink-0 z-10",
3170
+ isExpanded ? "size-6" : "h-8 w-14 mx-auto"
3171
+ ),
3172
+ style: { borderRadius: 9999 },
3173
+ children: [
3174
+ !isExpanded && /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(ActivePill2, { layoutId: activePillId }) }),
3175
+ !isExpanded && /* @__PURE__ */ jsx(HoverStateLayer2, {}),
3176
+ !isExpanded && /* @__PURE__ */ jsx(RippleLayer2, { ripples, onRippleDone: removeRipple }),
3177
+ /* @__PURE__ */ jsx(
3178
+ m.div,
3179
+ {
3180
+ layout: enableLayout ? "position" : false,
3181
+ className: "relative z-10 flex size-6 items-center justify-center text-current",
3182
+ children: /* @__PURE__ */ jsx(IconContainer2, { selected, badge, children: filledIcon })
3183
+ }
3184
+ )
3185
+ ]
3186
+ }
3187
+ ),
3188
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: showLabel && (label || child.props.children) && /* @__PURE__ */ jsx(
3189
+ m.span,
3190
+ {
3191
+ layout: enableLayout ? "position" : false,
3192
+ initial: labelInitial,
3193
+ animate: { opacity: 1, x: 0, y: 0 },
3194
+ exit: { opacity: 0, transition: { duration: 0.1 } },
3195
+ transition: SPRING_TRANSITION,
3196
+ className: cn(
3197
+ "z-10 transition-colors duration-200 whitespace-nowrap",
3198
+ selected ? "text-m3-on-surface" : "text-m3-on-surface-variant",
3199
+ isExpanded ? "text-sm font-medium tracking-wide text-left" : "text-xs font-medium tracking-wide"
3200
+ ),
3201
+ children: (_a = child.props.children) != null ? _a : label
3202
+ },
3203
+ "rail-label"
3204
+ ) })
3205
+ ]
3206
+ }
3207
+ ),
3208
+ /* @__PURE__ */ jsx(TouchTarget, {})
3209
+ ] });
3210
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
3211
+ Slot,
3212
+ {
3213
+ ref,
3214
+ role: "menuitem",
3215
+ "aria-current": selected ? "page" : void 0,
3216
+ "aria-disabled": disabled ? true : void 0,
3217
+ "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
3218
+ onClick: handleClick,
3219
+ onPointerDown,
3220
+ className: itemClassName,
3221
+ tabIndex: -1,
3222
+ children: React36.cloneElement(child, { children: innerContent })
3223
+ }
3224
+ ) });
3225
+ }
3029
3226
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
3030
3227
  m.button,
3031
3228
  {
@@ -3038,13 +3235,7 @@ var NavigationRailItemComponent = React36.forwardRef(
3038
3235
  "aria-label": ariaLabelProp || (typeof label === "string" ? label : void 0),
3039
3236
  onClick: handleClick,
3040
3237
  onPointerDown,
3041
- className: cn(
3042
- "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none",
3043
- "focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2 rounded-full",
3044
- disabled && "pointer-events-none opacity-[0.38]",
3045
- isExpanded ? "w-full flex-row items-center px-3 h-14" : "w-full flex-col justify-center h-14",
3046
- className
3047
- ),
3238
+ className: itemClassName,
3048
3239
  tabIndex: -1,
3049
3240
  children: [
3050
3241
  /* @__PURE__ */ jsxs(
@@ -4629,12 +4820,39 @@ var ProgressIndicator = React36.forwardRef((props, ref) => {
4629
4820
  return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
4630
4821
  });
4631
4822
  ProgressIndicator.displayName = "ProgressIndicator";
4632
- var SIZE_STYLES = {
4633
- xs: "h-8 w-8",
4634
- sm: "h-10 w-10",
4635
- md: "h-14 w-14",
4636
- lg: "h-24 w-24",
4637
- xl: "h-[8.5rem] w-[8.5rem]"
4823
+ var SIZE_HEIGHT_STYLES = {
4824
+ xs: "h-8",
4825
+ sm: "h-10",
4826
+ md: "h-14",
4827
+ lg: "h-24",
4828
+ xl: "h-[8.5rem]"
4829
+ };
4830
+ var WIDTH_SIZE_STYLES = {
4831
+ xs: {
4832
+ default: "w-8",
4833
+ narrow: "w-8",
4834
+ wide: "w-12"
4835
+ },
4836
+ sm: {
4837
+ default: "w-10",
4838
+ narrow: "w-12",
4839
+ wide: "w-[3.25rem]"
4840
+ },
4841
+ md: {
4842
+ default: "w-14",
4843
+ narrow: "w-12",
4844
+ wide: "w-[4.5rem]"
4845
+ },
4846
+ lg: {
4847
+ default: "w-24",
4848
+ narrow: "w-16",
4849
+ wide: "w-32"
4850
+ },
4851
+ xl: {
4852
+ default: "w-[8.5rem]",
4853
+ narrow: "w-[6.5rem]",
4854
+ wide: "w-[11.5rem]"
4855
+ }
4638
4856
  };
4639
4857
  var SIZE_ICON = {
4640
4858
  xs: { cls: "size-5", px: 20 },
@@ -4735,8 +4953,10 @@ var IconButtonComponent = React36.forwardRef(
4735
4953
  variant = "default",
4736
4954
  colorStyle = "standard",
4737
4955
  size = "sm",
4956
+ widthVariant = "default",
4738
4957
  shape = "round",
4739
4958
  selected,
4959
+ selectedIcon,
4740
4960
  loading = false,
4741
4961
  loadingVariant = "loading-indicator",
4742
4962
  iconSize,
@@ -4751,8 +4971,10 @@ var IconButtonComponent = React36.forwardRef(
4751
4971
  "variant",
4752
4972
  "colorStyle",
4753
4973
  "size",
4974
+ "widthVariant",
4754
4975
  "shape",
4755
4976
  "selected",
4977
+ "selectedIcon",
4756
4978
  "loading",
4757
4979
  "loadingVariant",
4758
4980
  "iconSize",
@@ -4762,7 +4984,7 @@ var IconButtonComponent = React36.forwardRef(
4762
4984
  "onKeyDown",
4763
4985
  "aria-label"
4764
4986
  ]);
4765
- var _a2, _b2;
4987
+ var _a2, _b2, _c, _d, _e;
4766
4988
  const isToggle = variant === "toggle";
4767
4989
  const isSelected = isToggle && !!selected;
4768
4990
  const resolvedColorClass = React36.useMemo(
@@ -4793,6 +5015,8 @@ var IconButtonComponent = React36.forwardRef(
4793
5015
  const defaultIconPx = sizeIcon.px;
4794
5016
  const iconPx = iconSize != null ? iconSize : defaultIconPx;
4795
5017
  const isCustomSize = iconSize != null && iconSize !== "inherit";
5018
+ const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
5019
+ const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
4796
5020
  const needsTouchTarget = size === "xs" || size === "sm";
4797
5021
  const { ripples, onPointerDown, removeRipple } = useRippleState({
4798
5022
  disabled: loading
@@ -4855,7 +5079,7 @@ var IconButtonComponent = React36.forwardRef(
4855
5079
  transition: SPRING_TRANSITION,
4856
5080
  "aria-hidden": "true",
4857
5081
  className: cn(
4858
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
5082
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
4859
5083
  iconSize != null ? void 0 : iconClass
4860
5084
  ),
4861
5085
  style: {
@@ -4863,9 +5087,9 @@ var IconButtonComponent = React36.forwardRef(
4863
5087
  width: isCustomSize ? `${iconSize}px` : void 0,
4864
5088
  height: isCustomSize ? `${iconSize}px` : void 0
4865
5089
  },
4866
- children: asChild ? React36.Children.only(children).props.children : children
5090
+ children: isSelected && selectedIcon ? selectedIcon : asChild ? React36.Children.only(children).props.children : children
4867
5091
  }),
4868
- "content"
5092
+ isSelected && selectedIcon ? "selected-content" : "content"
4869
5093
  ) })
4870
5094
  ] });
4871
5095
  const containerClassName = cn(
@@ -4874,7 +5098,8 @@ var IconButtonComponent = React36.forwardRef(
4874
5098
  outlineWidthClass,
4875
5099
  disabledBgClass,
4876
5100
  "overflow-hidden",
4877
- SIZE_STYLES[size],
5101
+ heightClass,
5102
+ widthClass,
4878
5103
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
4879
5104
  className
4880
5105
  );
@@ -4891,7 +5116,9 @@ var IconButtonComponent = React36.forwardRef(
4891
5116
  onClick: handleClick,
4892
5117
  onPointerDown,
4893
5118
  onKeyDown: handleKeyDown,
4894
- style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
5119
+ style: __spreadProps(__spreadValues({}, style), {
5120
+ borderRadius: `${animateRadius}px`
5121
+ }),
4895
5122
  className: containerClassName
4896
5123
  }, restProps), {
4897
5124
  children: React36.cloneElement(child, { children: innerContent })
@@ -6146,6 +6373,12 @@ var BottomDockedToolbar = React36.forwardRef(
6146
6373
  BottomDockedToolbar.displayName = "BottomDockedToolbar";
6147
6374
 
6148
6375
  // src/ui/toolbar/toolbar-tokens.ts
6376
+ var TOOLBAR_SPRING_TRANSITION = {
6377
+ type: "spring",
6378
+ stiffness: 300,
6379
+ damping: 30,
6380
+ mass: 0.8
6381
+ };
6149
6382
  var FloatingToolbarTokens = {
6150
6383
  ContainerBetweenSpace: 4,
6151
6384
  ContainerHeight: 64};
@@ -6340,7 +6573,9 @@ var FloatingToolbarBase = React36.forwardRef(
6340
6573
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
6341
6574
  isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
6342
6575
  ),
6343
- style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
6576
+ style: __spreadValues({
6577
+ gap: itemGap
6578
+ }, isStringPadding ? {} : contentPadding),
6344
6579
  children: [
6345
6580
  /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsx(
6346
6581
  m.div,
@@ -6575,13 +6810,17 @@ var ToolbarIconButton = React36.forwardRef(
6575
6810
  toolbarSize = "default",
6576
6811
  selected,
6577
6812
  asChild,
6578
- className
6813
+ className,
6814
+ transition,
6815
+ whileTap
6579
6816
  } = _b, props = __objRest(_b, [
6580
6817
  "emphasis",
6581
6818
  "toolbarSize",
6582
6819
  "selected",
6583
6820
  "asChild",
6584
- "className"
6821
+ "className",
6822
+ "transition",
6823
+ "whileTap"
6585
6824
  ]);
6586
6825
  const context = useToolbarContext();
6587
6826
  const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
@@ -6592,16 +6831,20 @@ var ToolbarIconButton = React36.forwardRef(
6592
6831
  } : {
6593
6832
  variant: "default"
6594
6833
  };
6834
+ const motionProps = asChild ? __spreadValues(__spreadValues({}, transition !== void 0 && { transition }), whileTap !== void 0 && { whileTap }) : {
6835
+ transition: transition != null ? transition : TOOLBAR_SPRING_TRANSITION,
6836
+ whileTap: whileTap != null ? whileTap : { scale: 0.95 }
6837
+ };
6595
6838
  return /* @__PURE__ */ jsx(
6596
6839
  IconButton,
6597
- __spreadValues(__spreadProps(__spreadValues({
6840
+ __spreadValues(__spreadProps(__spreadValues(__spreadValues({
6598
6841
  ref,
6599
6842
  asChild,
6600
6843
  colorStyle,
6601
6844
  size: "md",
6602
6845
  shape: "round",
6603
6846
  iconSize: ToolbarIconButtonTokens.IconSize
6604
- }, iconButtonProps), {
6847
+ }, motionProps), iconButtonProps), {
6605
6848
  className: cn(
6606
6849
  "h-[48px]",
6607
6850
  widthClass,
@@ -6777,8 +7020,8 @@ var ToolbarToggleButton = React36.forwardRef(
6777
7020
  [pressScale, pressBounceOffset]
6778
7021
  );
6779
7022
  const transitionConfig = React36.useMemo(
6780
- () => ({
6781
- scale: FAST_SPATIAL_SPRING,
7023
+ () => __spreadProps(__spreadValues({}, TOOLBAR_SPRING_TRANSITION), {
7024
+ scale: TOOLBAR_SPRING_TRANSITION,
6782
7025
  x: {
6783
7026
  duration: 0.35,
6784
7027
  ease: "easeInOut"