@bug-on/m3-expressive 1.1.0 → 1.2.1

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 (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +708 -606
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +707 -605
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core-Bc5Wj_pc.d.ts +497 -0
  9. package/dist/core-D4048_K5.d.mts +497 -0
  10. package/dist/core.d.mts +6 -422
  11. package/dist/core.d.ts +6 -422
  12. package/dist/core.js +223 -129
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +224 -130
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/feedback.js +85 -61
  17. package/dist/feedback.js.map +1 -1
  18. package/dist/feedback.mjs +85 -61
  19. package/dist/feedback.mjs.map +1 -1
  20. package/dist/forms.d.mts +2 -2
  21. package/dist/forms.d.ts +2 -2
  22. package/dist/forms.js +70 -8
  23. package/dist/forms.js.map +1 -1
  24. package/dist/forms.mjs +70 -8
  25. package/dist/forms.mjs.map +1 -1
  26. package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
  27. package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
  28. package/dist/index.css +6 -1
  29. package/dist/index.d.mts +68 -6
  30. package/dist/index.d.ts +68 -6
  31. package/dist/index.js +1177 -580
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +1172 -583
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/layout.d.mts +18 -1
  36. package/dist/layout.d.ts +18 -1
  37. package/dist/layout.js +94 -8
  38. package/dist/layout.js.map +1 -1
  39. package/dist/layout.mjs +94 -8
  40. package/dist/layout.mjs.map +1 -1
  41. package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
  42. package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -1
  43. package/dist/navigation.d.mts +134 -9
  44. package/dist/navigation.d.ts +134 -9
  45. package/dist/navigation.js +403 -93
  46. package/dist/navigation.js.map +1 -1
  47. package/dist/navigation.mjs +397 -94
  48. package/dist/navigation.mjs.map +1 -1
  49. package/dist/overlays.js +214 -189
  50. package/dist/overlays.js.map +1 -1
  51. package/dist/overlays.mjs +176 -151
  52. package/dist/overlays.mjs.map +1 -1
  53. package/dist/pickers.js +222 -197
  54. package/dist/pickers.js.map +1 -1
  55. package/dist/pickers.mjs +189 -164
  56. package/dist/pickers.mjs.map +1 -1
  57. package/dist/{split-button-trailing-uncheckable-BRPuTqi1.d.mts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +73 -7
  58. package/dist/{split-button-trailing-uncheckable-CjOFCoyW.d.ts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +73 -7
  59. package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
  60. package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
  61. package/package.json +4 -4
@@ -2661,7 +2661,7 @@ var NavigationBarItemComponent = React36.forwardRef(
2661
2661
  className,
2662
2662
  "aria-label": ariaLabelProp
2663
2663
  }, ref) => {
2664
- const { variant, itemLayout } = React36.useContext(NavigationBarContext);
2664
+ const { variant, itemLayout, itemClassName: contextItemClassName } = React36.useContext(NavigationBarContext);
2665
2665
  const isForcedHorizontal = itemLayout === "horizontal";
2666
2666
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
2667
2667
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -2696,9 +2696,10 @@ var NavigationBarItemComponent = React36.forwardRef(
2696
2696
  onClick: handleClick,
2697
2697
  onPointerDown,
2698
2698
  className: cn(
2699
- "group relative flex flex-1 cursor-pointer transition-colors duration-200 outline-none select-none h-full",
2700
- variant === "xr" ? "items-center justify-center max-[599px]:min-w-28 max-[599px]:max-w-28 max-[599px]:items-start max-[599px]:pt-3 max-[599px]:pb-4" : "items-center justify-center",
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
2701
  disabled && "pointer-events-none opacity-[0.38]",
2702
+ contextItemClassName,
2702
2703
  className
2703
2704
  ),
2704
2705
  children: [
@@ -2706,9 +2707,9 @@ var NavigationBarItemComponent = React36.forwardRef(
2706
2707
  "div",
2707
2708
  {
2708
2709
  className: cn(
2709
- "relative flex items-center justify-center flex-col gap-y-1 w-full",
2710
- isResponsiveHorizontal && "min-[600px]:flex-row min-[600px]:gap-y-0 min-[600px]:gap-x-1 min-[600px]:h-10 min-[600px]:px-4 min-[600px]:rounded-full min-[600px]:w-auto min-[600px]:max-w-42",
2711
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1 h-10 px-4 rounded-full w-auto max-w-42"
2710
+ "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
2711
+ 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",
2712
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
2712
2713
  ),
2713
2714
  children: [
2714
2715
  /* @__PURE__ */ jsxs(
@@ -2785,7 +2786,7 @@ var navContainerVariants = cva(
2785
2786
  variant: {
2786
2787
  flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
2787
2788
  baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
2788
- xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
2789
+ xr: "bottom-6 left-1/2 -translate-x-1/2 w-auto max-w-[calc(100%-2rem)] min-[600px]:max-w-fit h-20 min-[600px]:h-16 rounded-[48px] px-2"
2789
2790
  },
2790
2791
  position: {
2791
2792
  fixed: "fixed",
@@ -2813,6 +2814,7 @@ var NavigationBarComponent = React36.forwardRef(
2813
2814
  scrollContainerRef,
2814
2815
  activeIndicatorTransition,
2815
2816
  children,
2817
+ itemClassName,
2816
2818
  className,
2817
2819
  style
2818
2820
  }, ref) => {
@@ -2863,7 +2865,7 @@ var NavigationBarComponent = React36.forwardRef(
2863
2865
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
2864
2866
  NavigationBarContext.Provider,
2865
2867
  {
2866
- value: { variant, itemLayout, activeIndicatorTransition },
2868
+ value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
2867
2869
  children: /* @__PURE__ */ jsx(
2868
2870
  m.nav,
2869
2871
  {
@@ -2884,7 +2886,7 @@ var NavigationBarComponent = React36.forwardRef(
2884
2886
  "aria-orientation": "horizontal",
2885
2887
  className: cn(
2886
2888
  "flex w-full h-full mx-auto",
2887
- variant === "xr" ? "gap-0 min-[600px]:gap-1.5" : "max-w-7xl gap-1.5"
2889
+ variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
2888
2890
  ),
2889
2891
  children
2890
2892
  }
@@ -4738,6 +4740,7 @@ var IconButtonComponent = React36.forwardRef(
4738
4740
  loading = false,
4739
4741
  loadingVariant = "loading-indicator",
4740
4742
  iconSize,
4743
+ asChild = false,
4741
4744
  children,
4742
4745
  onClick,
4743
4746
  onKeyDown,
@@ -4753,6 +4756,7 @@ var IconButtonComponent = React36.forwardRef(
4753
4756
  "loading",
4754
4757
  "loadingVariant",
4755
4758
  "iconSize",
4759
+ "asChild",
4756
4760
  "children",
4757
4761
  "onClick",
4758
4762
  "onKeyDown",
@@ -4814,7 +4818,87 @@ var IconButtonComponent = React36.forwardRef(
4814
4818
  },
4815
4819
  [loading, onClick, onKeyDown]
4816
4820
  );
4817
- return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
4821
+ const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
4822
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
4823
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4824
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
4825
+ m.span,
4826
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4827
+ transition: SPRING_TRANSITION,
4828
+ className: cn(
4829
+ "flex items-center justify-center shrink-0",
4830
+ iconSize != null ? void 0 : iconClass
4831
+ ),
4832
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
4833
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
4834
+ LoadingIndicator,
4835
+ {
4836
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4837
+ color: "currentColor",
4838
+ "aria-label": "Loading"
4839
+ }
4840
+ ) : /* @__PURE__ */ jsx(
4841
+ ProgressIndicator,
4842
+ {
4843
+ variant: "circular",
4844
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4845
+ color: "currentColor",
4846
+ trackColor: "transparent",
4847
+ "aria-label": "Loading"
4848
+ }
4849
+ )
4850
+ }),
4851
+ "loading"
4852
+ ) : /* @__PURE__ */ jsx(
4853
+ m.span,
4854
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4855
+ transition: SPRING_TRANSITION,
4856
+ "aria-hidden": "true",
4857
+ className: cn(
4858
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
4859
+ iconSize != null ? void 0 : iconClass
4860
+ ),
4861
+ style: {
4862
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
4863
+ width: isCustomSize ? `${iconSize}px` : void 0,
4864
+ height: isCustomSize ? `${iconSize}px` : void 0
4865
+ },
4866
+ children: asChild ? React36.Children.only(children).props.children : children
4867
+ }),
4868
+ "content"
4869
+ ) })
4870
+ ] });
4871
+ const containerClassName = cn(
4872
+ baseIconButtonClasses,
4873
+ resolvedColorClass,
4874
+ outlineWidthClass,
4875
+ disabledBgClass,
4876
+ "overflow-hidden",
4877
+ SIZE_STYLES[size],
4878
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
4879
+ className
4880
+ );
4881
+ if (asChild) {
4882
+ const child = React36.Children.only(children);
4883
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
4884
+ Slot,
4885
+ __spreadProps(__spreadValues({
4886
+ ref,
4887
+ "aria-pressed": isToggle ? isSelected : void 0,
4888
+ "aria-label": ariaLabel,
4889
+ "aria-busy": loading || void 0,
4890
+ "aria-disabled": loading || restProps.disabled,
4891
+ onClick: handleClick,
4892
+ onPointerDown,
4893
+ onKeyDown: handleKeyDown,
4894
+ style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
4895
+ className: containerClassName
4896
+ }, restProps), {
4897
+ children: React36.cloneElement(child, { children: innerContent })
4898
+ })
4899
+ ) });
4900
+ }
4901
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
4818
4902
  m.button,
4819
4903
  __spreadProps(__spreadValues({
4820
4904
  ref,
@@ -4830,67 +4914,9 @@ var IconButtonComponent = React36.forwardRef(
4830
4914
  animate: { borderRadius: animateRadius },
4831
4915
  whileTap: { borderRadius: pressedRadius },
4832
4916
  transition: { borderRadius: SPRING_TRANSITION_FAST },
4833
- className: cn(
4834
- baseIconButtonClasses,
4835
- resolvedColorClass,
4836
- outlineWidthClass,
4837
- disabledBgClass,
4838
- "overflow-hidden",
4839
- SIZE_STYLES[size],
4840
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
4841
- className
4842
- )
4917
+ className: containerClassName
4843
4918
  }, restProps), {
4844
- children: [
4845
- needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
4846
- /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4847
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
4848
- m.span,
4849
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4850
- transition: SPRING_TRANSITION,
4851
- className: cn(
4852
- "flex items-center justify-center shrink-0",
4853
- iconSize != null ? void 0 : iconClass
4854
- ),
4855
- style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
4856
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
4857
- LoadingIndicator,
4858
- {
4859
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4860
- color: "currentColor",
4861
- "aria-label": "Loading"
4862
- }
4863
- ) : /* @__PURE__ */ jsx(
4864
- ProgressIndicator,
4865
- {
4866
- variant: "circular",
4867
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4868
- color: "currentColor",
4869
- trackColor: "transparent",
4870
- "aria-label": "Loading"
4871
- }
4872
- )
4873
- }),
4874
- "loading"
4875
- ) : /* @__PURE__ */ jsx(
4876
- m.span,
4877
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4878
- transition: SPRING_TRANSITION,
4879
- "aria-hidden": "true",
4880
- className: cn(
4881
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
4882
- iconSize != null ? void 0 : iconClass
4883
- ),
4884
- style: {
4885
- fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
4886
- width: isCustomSize ? `${iconSize}px` : void 0,
4887
- height: isCustomSize ? `${iconSize}px` : void 0
4888
- },
4889
- children
4890
- }),
4891
- "content"
4892
- ) })
4893
- ]
4919
+ children: innerContent
4894
4920
  })
4895
4921
  ) });
4896
4922
  }
@@ -5964,6 +5990,47 @@ var vibrantFloatingToolbarColors = {
5964
5990
  fabContainerColor: "var(--md-sys-color-tertiary-container)",
5965
5991
  fabContentColor: "var(--md-sys-color-on-tertiary-container)"
5966
5992
  };
5993
+ var surfaceContainerHighFloatingToolbarColors = {
5994
+ toolbarContainerColor: "var(--md-sys-color-surface-container-high)",
5995
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
5996
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
5997
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
5998
+ };
5999
+ var surfaceContainerHighestFloatingToolbarColors = {
6000
+ toolbarContainerColor: "var(--md-sys-color-surface-container-highest)",
6001
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
6002
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
6003
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
6004
+ };
6005
+ var tertiaryContainerFloatingToolbarColors = {
6006
+ toolbarContainerColor: "var(--md-sys-color-tertiary-container)",
6007
+ toolbarContentColor: "var(--md-sys-color-on-tertiary-container)",
6008
+ fabContainerColor: "var(--md-sys-color-primary-container)",
6009
+ fabContentColor: "var(--md-sys-color-on-primary-container)"
6010
+ };
6011
+ var xrFloatingToolbarColors = {
6012
+ toolbarContainerColor: "color-mix(in srgb, var(--md-sys-color-surface-container-high) 80%, transparent)",
6013
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
6014
+ fabContainerColor: "color-mix(in srgb, var(--md-sys-color-secondary-container) 85%, transparent)",
6015
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
6016
+ };
6017
+ function getToolbarColors(variant = "standard", customColors) {
6018
+ if (customColors) return customColors;
6019
+ switch (variant) {
6020
+ case "vibrant":
6021
+ return vibrantFloatingToolbarColors;
6022
+ case "surface-high":
6023
+ return surfaceContainerHighFloatingToolbarColors;
6024
+ case "surface-highest":
6025
+ return surfaceContainerHighestFloatingToolbarColors;
6026
+ case "tertiary":
6027
+ return tertiaryContainerFloatingToolbarColors;
6028
+ case "xr":
6029
+ return xrFloatingToolbarColors;
6030
+ default:
6031
+ return standardFloatingToolbarColors;
6032
+ }
6033
+ }
5967
6034
  var ToolbarContext = React36.createContext(
5968
6035
  null
5969
6036
  );
@@ -5999,7 +6066,7 @@ var BottomDockedToolbar = React36.forwardRef(
5999
6066
  "className",
6000
6067
  "aria-label"
6001
6068
  ]);
6002
- const colors = customColors || (variant === "vibrant" ? vibrantFloatingToolbarColors : standardFloatingToolbarColors);
6069
+ const colors = getToolbarColors(variant, customColors);
6003
6070
  const { scrollY } = useScroll(
6004
6071
  scrollContainerRef ? { container: scrollContainerRef } : void 0
6005
6072
  );
@@ -6028,6 +6095,7 @@ var BottomDockedToolbar = React36.forwardRef(
6028
6095
  full: "rounded-full"
6029
6096
  };
6030
6097
  const justifyClass = justify === "center" ? "justify-center gap-4" : "justify-between";
6098
+ const isXr = variant === "xr";
6031
6099
  return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation: "horizontal" }, children: /* @__PURE__ */ jsxs(
6032
6100
  m.div,
6033
6101
  __spreadProps(__spreadValues({
@@ -6048,11 +6116,12 @@ var BottomDockedToolbar = React36.forwardRef(
6048
6116
  paddingRight: paddingX
6049
6117
  }),
6050
6118
  className: cn(
6051
- "fixed bottom-0 left-0 right-0 w-full z-40",
6119
+ "fixed bottom-0 left-0 right-0 w-full z-40 text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
6052
6120
  "flex items-center h-16",
6053
6121
  justifyClass,
6054
6122
  SHAPE_CLASSES[shape],
6055
- "shadow-[0_-1px_3px_rgba(0,0,0,0.1)] pointer-events-auto",
6123
+ isXr ? "backdrop-blur-md border-t border-white/10 shadow-lg" : "shadow-[0_-1px_3px_rgba(0,0,0,0.1)]",
6124
+ "pointer-events-auto",
6056
6125
  className
6057
6126
  )
6058
6127
  }, props), {
@@ -6099,6 +6168,13 @@ var ToolbarIconButtonTokens = {
6099
6168
  /** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
6100
6169
  IconSize: 28
6101
6170
  };
6171
+ var ToolbarToggleButtonTokens = {
6172
+ Height: 48,
6173
+ MinWidth: 95,
6174
+ IconSize: 24,
6175
+ PaddingX: 16,
6176
+ Gap: 8
6177
+ };
6102
6178
  var ALIGNMENT_CLASS = {
6103
6179
  start: "justify-start",
6104
6180
  center: "justify-center",
@@ -6157,7 +6233,8 @@ var FloatingToolbarBase = React36.forwardRef(
6157
6233
  var _b = _a, {
6158
6234
  expanded,
6159
6235
  orientation = "horizontal",
6160
- colors = standardFloatingToolbarColors,
6236
+ variant = "standard",
6237
+ colors: customColors,
6161
6238
  shape = "full",
6162
6239
  contentPadding,
6163
6240
  scrollBehavior,
@@ -6175,6 +6252,7 @@ var FloatingToolbarBase = React36.forwardRef(
6175
6252
  } = _b, props = __objRest(_b, [
6176
6253
  "expanded",
6177
6254
  "orientation",
6255
+ "variant",
6178
6256
  "colors",
6179
6257
  "shape",
6180
6258
  "contentPadding",
@@ -6191,6 +6269,7 @@ var FloatingToolbarBase = React36.forwardRef(
6191
6269
  "style",
6192
6270
  "aria-label"
6193
6271
  ]);
6272
+ const colors = getToolbarColors(variant, customColors);
6194
6273
  const isHorizontal = orientation === "horizontal";
6195
6274
  const isStringPadding = typeof contentPadding === "string";
6196
6275
  const cssVars = __spreadValues(__spreadValues({
@@ -6199,7 +6278,8 @@ var FloatingToolbarBase = React36.forwardRef(
6199
6278
  "--toolbar-size": `${FloatingToolbarTokens.ContainerHeight}px`
6200
6279
  }, isStringPadding ? {} : contentPadding), style);
6201
6280
  const isScrolledOff = scrollBehavior && scrollBehavior.offset < 0;
6202
- const shadowClass = expanded ? "shadow-md" : "shadow-sm";
6281
+ const isXr = variant === "xr";
6282
+ const shadowClass = isXr ? "shadow-lg border border-white/10 backdrop-blur-md" : expanded ? "shadow-md" : "shadow-sm";
6203
6283
  const containerShapeClass = shape === "full" ? "rounded-full" : "rounded-2xl";
6204
6284
  const leadingVariants = buildSlotVariants(
6205
6285
  isHorizontal ? "-100%" : 0,
@@ -6216,7 +6296,7 @@ var FloatingToolbarBase = React36.forwardRef(
6216
6296
  scrollBehavior,
6217
6297
  disableScrollTranslation
6218
6298
  );
6219
- return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation }, children: /* @__PURE__ */ jsx(
6299
+ return /* @__PURE__ */ jsx(ToolbarContext.Provider, { value: { orientation, itemClassName }, children: /* @__PURE__ */ jsx(
6220
6300
  m.div,
6221
6301
  {
6222
6302
  ref,
@@ -6238,8 +6318,8 @@ var FloatingToolbarBase = React36.forwardRef(
6238
6318
  color: "var(--toolbar-color)"
6239
6319
  }),
6240
6320
  className: cn(
6241
- "flex pointer-events-auto relative",
6242
- isHorizontal ? "max-w-[90vw] h-(--toolbar-size)" : "max-h-[90vh] w-(--toolbar-size) h-fit",
6321
+ "flex pointer-events-auto relative text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
6322
+ isHorizontal ? "max-w-[min(90vw,100%)] h-(--toolbar-size)" : "max-h-[min(90vh,100%)] w-(--toolbar-size) h-fit",
6243
6323
  containerShapeClass,
6244
6324
  shadowClass,
6245
6325
  className
@@ -6256,11 +6336,11 @@ var FloatingToolbarBase = React36.forwardRef(
6256
6336
  "div",
6257
6337
  {
6258
6338
  className: cn(
6259
- "flex items-center gap-1 min-w-0 min-h-0",
6339
+ "flex items-center min-w-0 min-h-0",
6260
6340
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
6261
- isStringPadding ? contentPadding : isHorizontal ? "px-4" : "py-6"
6341
+ isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
6262
6342
  ),
6263
- style: isStringPadding ? void 0 : contentPadding,
6343
+ style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
6264
6344
  children: [
6265
6345
  /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsx(
6266
6346
  m.div,
@@ -6270,9 +6350,10 @@ var FloatingToolbarBase = React36.forwardRef(
6270
6350
  animate: "visible",
6271
6351
  exit: "hidden",
6272
6352
  className: cn(
6273
- "flex shrink-0 overflow-hidden",
6353
+ "flex shrink-0 items-center overflow-hidden",
6274
6354
  isHorizontal ? "flex-row" : "flex-col"
6275
6355
  ),
6356
+ style: { gap: itemGap },
6276
6357
  children: processNodes(startContent)
6277
6358
  },
6278
6359
  "start"
@@ -6297,9 +6378,10 @@ var FloatingToolbarBase = React36.forwardRef(
6297
6378
  animate: "visible",
6298
6379
  exit: "hidden",
6299
6380
  className: cn(
6300
- "flex shrink-0 overflow-hidden",
6381
+ "flex shrink-0 items-center overflow-hidden",
6301
6382
  isHorizontal ? "flex-row" : "flex-col"
6302
6383
  ),
6384
+ style: { gap: itemGap },
6303
6385
  children: processNodes(endContent)
6304
6386
  },
6305
6387
  "end"
@@ -6325,7 +6407,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
6325
6407
  var _b = _a, {
6326
6408
  expanded,
6327
6409
  orientation = "horizontal",
6328
- colors = standardFloatingToolbarColors,
6410
+ variant = "standard",
6411
+ colors: customColors,
6329
6412
  floatingActionButton,
6330
6413
  fabPosition = orientation === "horizontal" ? "end" : "bottom",
6331
6414
  animationDuration = 0.3,
@@ -6336,6 +6419,7 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
6336
6419
  } = _b, props = __objRest(_b, [
6337
6420
  "expanded",
6338
6421
  "orientation",
6422
+ "variant",
6339
6423
  "colors",
6340
6424
  "floatingActionButton",
6341
6425
  "fabPosition",
@@ -6345,6 +6429,7 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
6345
6429
  "className",
6346
6430
  "style"
6347
6431
  ]);
6432
+ const colors = getToolbarColors(variant, customColors);
6348
6433
  const isHorizontal = orientation === "horizontal";
6349
6434
  const effectiveExpanded = expanded && (!scrollBehavior || scrollBehavior.isExpanded);
6350
6435
  const isFabBefore = fabPosition === "start" || fabPosition === "top";
@@ -6422,7 +6507,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
6422
6507
  expanded,
6423
6508
  colors,
6424
6509
  disableScrollTranslation: true,
6425
- disableLayoutAnimation: true
6510
+ disableLayoutAnimation: true,
6511
+ className: className ? cn("h-full", className) : void 0
6426
6512
  }, props)
6427
6513
  ) : /* @__PURE__ */ jsx(
6428
6514
  VerticalFloatingToolbar,
@@ -6430,7 +6516,8 @@ var FloatingToolbarWithFabBase = React36.forwardRef(
6430
6516
  expanded,
6431
6517
  colors,
6432
6518
  disableScrollTranslation: true,
6433
- disableLayoutAnimation: true
6519
+ disableLayoutAnimation: true,
6520
+ className: className ? cn("w-full", className) : void 0
6434
6521
  }, props)
6435
6522
  )
6436
6523
  },
@@ -6460,7 +6547,7 @@ var ToolbarDivider = ({
6460
6547
  "aria-orientation": isHorizontalToolbar ? "vertical" : "horizontal",
6461
6548
  className: cn(
6462
6549
  "shrink-0 bg-current opacity-30 border-none",
6463
- isHorizontalToolbar ? "w-px h-8 self-center mx-2" : "h-px w-8 self-center my-2",
6550
+ isHorizontalToolbar ? "w-px h-8 self-center mx-1" : "h-px w-8 self-center my-1",
6464
6551
  className
6465
6552
  ),
6466
6553
  style: {
@@ -6483,20 +6570,47 @@ var VARIANT_TO_COLOR_STYLE = {
6483
6570
  };
6484
6571
  var ToolbarIconButton = React36.forwardRef(
6485
6572
  (_a, ref) => {
6486
- var _b = _a, { emphasis = "standard", toolbarSize = "default", className } = _b, props = __objRest(_b, ["emphasis", "toolbarSize", "className"]);
6573
+ var _b = _a, {
6574
+ emphasis = "standard",
6575
+ toolbarSize = "default",
6576
+ selected,
6577
+ asChild,
6578
+ className
6579
+ } = _b, props = __objRest(_b, [
6580
+ "emphasis",
6581
+ "toolbarSize",
6582
+ "selected",
6583
+ "asChild",
6584
+ "className"
6585
+ ]);
6586
+ const context = useToolbarContext();
6487
6587
  const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
6488
6588
  const colorStyle = VARIANT_TO_COLOR_STYLE[emphasis];
6589
+ const iconButtonProps = selected !== void 0 ? {
6590
+ variant: "toggle",
6591
+ selected: Boolean(selected)
6592
+ } : {
6593
+ variant: "default"
6594
+ };
6489
6595
  return /* @__PURE__ */ jsx(
6490
6596
  IconButton,
6491
- __spreadValues({
6597
+ __spreadValues(__spreadProps(__spreadValues({
6492
6598
  ref,
6493
- variant: "default",
6599
+ asChild,
6494
6600
  colorStyle,
6495
6601
  size: "md",
6496
6602
  shape: "round",
6497
- iconSize: ToolbarIconButtonTokens.IconSize,
6498
- className: cn("h-[48px]", widthClass, className)
6499
- }, props)
6603
+ iconSize: ToolbarIconButtonTokens.IconSize
6604
+ }, iconButtonProps), {
6605
+ className: cn(
6606
+ "h-[48px]",
6607
+ widthClass,
6608
+ emphasis === "standard" && !selected && "text-current hover:bg-current/8 active:bg-current/12",
6609
+ emphasis === "standard" && selected && "bg-current/16 text-current hover:bg-current/20 active:bg-current/24",
6610
+ context == null ? void 0 : context.itemClassName,
6611
+ className
6612
+ )
6613
+ }), props)
6500
6614
  );
6501
6615
  }
6502
6616
  );
@@ -6567,7 +6681,196 @@ function useFloatingToolbarScrollBehavior(options = {}) {
6567
6681
  exitDirection
6568
6682
  };
6569
6683
  }
6684
+ var MOTION_PROP_KEYS = [
6685
+ "animate",
6686
+ "exit",
6687
+ "initial",
6688
+ "transition",
6689
+ "variants",
6690
+ "whileHover",
6691
+ "whileTap",
6692
+ "whileFocus",
6693
+ "whileDrag",
6694
+ "whileInView",
6695
+ "onAnimationStart",
6696
+ "onAnimationComplete",
6697
+ "onUpdate",
6698
+ "onDragStart",
6699
+ "onDragEnd",
6700
+ "onDrag",
6701
+ "onDirectionLock",
6702
+ "onDragTransitionEnd",
6703
+ "layout",
6704
+ "layoutId",
6705
+ "onLayoutAnimationComplete"
6706
+ ];
6707
+ var ToolbarToggleButton = React36.forwardRef(
6708
+ (_a, ref) => {
6709
+ var _b = _a, {
6710
+ emphasis = "standard",
6711
+ selected = false,
6712
+ icon,
6713
+ children,
6714
+ pressScale = 0.95,
6715
+ pressBounceOffset = 6,
6716
+ ripple = true,
6717
+ asChild = false,
6718
+ className,
6719
+ type = "button",
6720
+ disabled,
6721
+ onPointerDown: onPointerDownProp
6722
+ } = _b, props = __objRest(_b, [
6723
+ "emphasis",
6724
+ "selected",
6725
+ "icon",
6726
+ "children",
6727
+ "pressScale",
6728
+ "pressBounceOffset",
6729
+ "ripple",
6730
+ "asChild",
6731
+ "className",
6732
+ "type",
6733
+ "disabled",
6734
+ "onPointerDown"
6735
+ ]);
6736
+ const context = useToolbarContext();
6737
+ const {
6738
+ ripples,
6739
+ onPointerDown: handleRipplePointerDown,
6740
+ removeRipple
6741
+ } = useRippleState({
6742
+ disabled: Boolean(disabled) || !ripple
6743
+ });
6744
+ const handlePointerDown = React36.useCallback(
6745
+ (e) => {
6746
+ if (!disabled && ripple) {
6747
+ handleRipplePointerDown(e);
6748
+ }
6749
+ onPointerDownProp == null ? void 0 : onPointerDownProp(e);
6750
+ },
6751
+ [disabled, ripple, handleRipplePointerDown, onPointerDownProp]
6752
+ );
6753
+ const baseClasses = "relative overflow-hidden inline-flex items-center justify-center min-w-[95px] h-[48px] px-4 rounded-full text-sm font-medium transition-colors select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/40 disabled:pointer-events-none disabled:opacity-38";
6754
+ const variantClasses = {
6755
+ standard: selected ? "bg-current/16 text-current hover:bg-current/20 active:bg-current/24" : "bg-transparent text-current hover:bg-current/8 active:bg-current/12",
6756
+ tonal: selected ? "bg-m3-secondary-container text-m3-on-secondary-container hover:shadow-sm" : "bg-m3-surface-container-high text-m3-on-surface hover:bg-m3-surface-container-highest",
6757
+ filled: selected ? "bg-m3-primary text-m3-on-primary hover:shadow-sm" : "bg-m3-surface-container-highest text-m3-on-surface hover:bg-m3-surface-container-high"
6758
+ };
6759
+ const combinedClassName = cn(
6760
+ baseClasses,
6761
+ variantClasses[emphasis],
6762
+ context == null ? void 0 : context.itemClassName,
6763
+ className
6764
+ );
6765
+ const whileTapConfig = React36.useMemo(
6766
+ () => ({
6767
+ scale: pressScale,
6768
+ x: pressBounceOffset ? [
6769
+ 0,
6770
+ -pressBounceOffset,
6771
+ pressBounceOffset,
6772
+ -pressBounceOffset / 2,
6773
+ pressBounceOffset / 2,
6774
+ 0
6775
+ ] : 0
6776
+ }),
6777
+ [pressScale, pressBounceOffset]
6778
+ );
6779
+ const transitionConfig = React36.useMemo(
6780
+ () => ({
6781
+ scale: FAST_SPATIAL_SPRING,
6782
+ x: {
6783
+ duration: 0.35,
6784
+ ease: "easeInOut"
6785
+ }
6786
+ }),
6787
+ []
6788
+ );
6789
+ const mainContent = /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center justify-center h-full gap-2", children: [
6790
+ icon && /* @__PURE__ */ jsx(
6791
+ "span",
6792
+ {
6793
+ className: "shrink-0 inline-flex items-center justify-center",
6794
+ style: {
6795
+ width: ToolbarToggleButtonTokens.IconSize,
6796
+ height: ToolbarToggleButtonTokens.IconSize
6797
+ },
6798
+ children: icon
6799
+ }
6800
+ ),
6801
+ children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx("span", { children }) : children)
6802
+ ] });
6803
+ if (asChild) {
6804
+ const child = React36.Children.only(children);
6805
+ const childContent = child.props.children;
6806
+ const innerChildContent = /* @__PURE__ */ jsxs(Fragment, { children: [
6807
+ ripple && /* @__PURE__ */ jsx(
6808
+ Ripple,
6809
+ {
6810
+ ripples,
6811
+ onRippleDone: removeRipple,
6812
+ disabled
6813
+ }
6814
+ ),
6815
+ /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center h-full gap-2", children: icon ? /* @__PURE__ */ jsxs(Fragment, { children: [
6816
+ /* @__PURE__ */ jsx(
6817
+ "span",
6818
+ {
6819
+ className: "shrink-0 inline-flex items-center justify-center",
6820
+ style: {
6821
+ width: ToolbarToggleButtonTokens.IconSize,
6822
+ height: ToolbarToggleButtonTokens.IconSize
6823
+ },
6824
+ children: icon
6825
+ }
6826
+ ),
6827
+ typeof childContent === "string" || typeof childContent === "number" ? /* @__PURE__ */ jsx("span", { children: childContent }) : childContent
6828
+ ] }) : childContent })
6829
+ ] });
6830
+ const strippedProps = __spreadValues({}, props);
6831
+ for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
6832
+ delete strippedProps.children;
6833
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
6834
+ Slot,
6835
+ __spreadProps(__spreadValues({
6836
+ ref,
6837
+ "aria-pressed": selected,
6838
+ className: combinedClassName,
6839
+ onPointerDown: handlePointerDown
6840
+ }, strippedProps), {
6841
+ children: React36.cloneElement(child, { children: innerChildContent })
6842
+ })
6843
+ ) });
6844
+ }
6845
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
6846
+ m.button,
6847
+ __spreadProps(__spreadValues({
6848
+ ref,
6849
+ type,
6850
+ "aria-pressed": selected,
6851
+ disabled,
6852
+ whileTap: whileTapConfig,
6853
+ transition: transitionConfig,
6854
+ onPointerDown: handlePointerDown,
6855
+ className: combinedClassName
6856
+ }, props), {
6857
+ children: [
6858
+ ripple && /* @__PURE__ */ jsx(
6859
+ Ripple,
6860
+ {
6861
+ ripples,
6862
+ onRippleDone: removeRipple,
6863
+ disabled
6864
+ }
6865
+ ),
6866
+ mainContent
6867
+ ]
6868
+ })
6869
+ ) });
6870
+ }
6871
+ );
6872
+ ToolbarToggleButton.displayName = "ToolbarToggleButton";
6570
6873
 
6571
- export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, BottomAppBar, BottomDockedToolbar, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, ContextMenuTrigger, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, MenuContent, MenuDivider, MenuGroup, MenuItem, MenuProvider, MenuTrigger, NavigationBar, NavigationBarComponent, NavigationBarItem, NavigationRail, NavigationRailItem, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, SearchBar, SearchTokens, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, SmallAppBar, SubMenu, Tab, Tabs, TabsColors, TabsContent, TabsList, TabsTokens, ToolbarDivider, ToolbarDividerTokens, ToolbarIconButton, ToolbarIconButtonTokens, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, VerticalMenuDivider, VerticalMenuGroup, appBarTypography, standardFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors };
6874
+ export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, BottomAppBar, BottomDockedToolbar, CHECK_ICON_VARIANTS, ContextMenu, ContextMenuContent, ContextMenuTrigger, DIVIDER_COLOR, DIVIDER_PADDING, DockedToolbar, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, GROUP_SHAPES, HorizontalFloatingToolbar, HorizontalFloatingToolbarWithFab, ITEM_SHAPE_CLASSES, LargeFlexibleAppBar, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MediumFlexibleAppBar, Menu, MenuContent, MenuDivider, MenuGroup, MenuItem, MenuProvider, MenuTrigger, NavigationBar, NavigationBarComponent, NavigationBarItem, NavigationRail, NavigationRailItem, SEARCH_BAR_EXIT_SPRING, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, Search, SearchAppBar, SearchBar, SearchTokens, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, SmallAppBar, SubMenu, Tab, Tabs, TabsColors, TabsContent, TabsList, TabsTokens, ToolbarDivider, ToolbarDividerTokens, ToolbarIconButton, ToolbarIconButtonTokens, ToolbarToggleButton, ToolbarToggleButtonTokens, VIBRANT_COLORS, VerticalFloatingToolbar, VerticalFloatingToolbarWithFab, VerticalMenu, VerticalMenuContent, VerticalMenuDivider, VerticalMenuGroup, appBarTypography, getToolbarColors, standardFloatingToolbarColors, surfaceContainerHighFloatingToolbarColors, surfaceContainerHighestFloatingToolbarColors, tertiaryContainerFloatingToolbarColors, useAppBarScroll, useFloatingToolbarScrollBehavior, useMenuContext, useSearch, useSearchKeyboard, vibrantFloatingToolbarColors, xrFloatingToolbarColors };
6572
6875
  //# sourceMappingURL=navigation.mjs.map
6573
6876
  //# sourceMappingURL=navigation.mjs.map