@bug-on/m3-expressive 1.2.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 (54) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/buttons.d.mts +2 -2
  3. package/dist/buttons.d.ts +2 -2
  4. package/dist/buttons.js +678 -605
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +677 -604
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core.js +86 -61
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.mjs +86 -61
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/feedback.js +85 -61
  13. package/dist/feedback.js.map +1 -1
  14. package/dist/feedback.mjs +85 -61
  15. package/dist/feedback.mjs.map +1 -1
  16. package/dist/forms.d.mts +2 -2
  17. package/dist/forms.d.ts +2 -2
  18. package/dist/forms.js +70 -8
  19. package/dist/forms.js.map +1 -1
  20. package/dist/forms.mjs +70 -8
  21. package/dist/forms.mjs.map +1 -1
  22. package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
  23. package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
  24. package/dist/index.d.mts +4 -4
  25. package/dist/index.d.ts +4 -4
  26. package/dist/index.js +973 -496
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +967 -497
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/layout.d.mts +18 -1
  31. package/dist/layout.d.ts +18 -1
  32. package/dist/layout.js +65 -8
  33. package/dist/layout.js.map +1 -1
  34. package/dist/layout.mjs +65 -8
  35. package/dist/layout.mjs.map +1 -1
  36. package/dist/navigation.d.mts +134 -9
  37. package/dist/navigation.d.ts +134 -9
  38. package/dist/navigation.js +403 -93
  39. package/dist/navigation.js.map +1 -1
  40. package/dist/navigation.mjs +397 -94
  41. package/dist/navigation.mjs.map +1 -1
  42. package/dist/overlays.js +214 -189
  43. package/dist/overlays.js.map +1 -1
  44. package/dist/overlays.mjs +176 -151
  45. package/dist/overlays.mjs.map +1 -1
  46. package/dist/pickers.js +222 -197
  47. package/dist/pickers.js.map +1 -1
  48. package/dist/pickers.mjs +189 -164
  49. package/dist/pickers.mjs.map +1 -1
  50. package/dist/{split-button-trailing-uncheckable-BkPbiBo3.d.ts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +44 -6
  51. package/dist/{split-button-trailing-uncheckable-D_PLPb-u.d.mts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +44 -6
  52. package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
  53. package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
  54. package/package.json +1 -1
@@ -2684,7 +2684,7 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
2684
2684
  className,
2685
2685
  "aria-label": ariaLabelProp
2686
2686
  }, ref) => {
2687
- const { variant, itemLayout } = React36__namespace.useContext(NavigationBarContext);
2687
+ const { variant, itemLayout, itemClassName: contextItemClassName } = React36__namespace.useContext(NavigationBarContext);
2688
2688
  const isForcedHorizontal = itemLayout === "horizontal";
2689
2689
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
2690
2690
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -2719,9 +2719,10 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
2719
2719
  onClick: handleClick,
2720
2720
  onPointerDown,
2721
2721
  className: cn(
2722
- "group relative flex flex-1 cursor-pointer transition-colors duration-200 outline-none select-none h-full",
2723
- 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",
2722
+ "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
2723
+ 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",
2724
2724
  disabled && "pointer-events-none opacity-[0.38]",
2725
+ contextItemClassName,
2725
2726
  className
2726
2727
  ),
2727
2728
  children: [
@@ -2729,9 +2730,9 @@ var NavigationBarItemComponent = React36__namespace.forwardRef(
2729
2730
  "div",
2730
2731
  {
2731
2732
  className: cn(
2732
- "relative flex items-center justify-center flex-col gap-y-1 w-full",
2733
- 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",
2734
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1 h-10 px-4 rounded-full w-auto max-w-42"
2733
+ "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
2734
+ 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",
2735
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
2735
2736
  ),
2736
2737
  children: [
2737
2738
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -2808,7 +2809,7 @@ var navContainerVariants = classVarianceAuthority.cva(
2808
2809
  variant: {
2809
2810
  flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
2810
2811
  baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
2811
- 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"
2812
+ 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"
2812
2813
  },
2813
2814
  position: {
2814
2815
  fixed: "fixed",
@@ -2836,6 +2837,7 @@ var NavigationBarComponent = React36__namespace.forwardRef(
2836
2837
  scrollContainerRef,
2837
2838
  activeIndicatorTransition,
2838
2839
  children,
2840
+ itemClassName,
2839
2841
  className,
2840
2842
  style
2841
2843
  }, ref) => {
@@ -2886,7 +2888,7 @@ var NavigationBarComponent = React36__namespace.forwardRef(
2886
2888
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2887
2889
  NavigationBarContext.Provider,
2888
2890
  {
2889
- value: { variant, itemLayout, activeIndicatorTransition },
2891
+ value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
2890
2892
  children: /* @__PURE__ */ jsxRuntime.jsx(
2891
2893
  react.m.nav,
2892
2894
  {
@@ -2907,7 +2909,7 @@ var NavigationBarComponent = React36__namespace.forwardRef(
2907
2909
  "aria-orientation": "horizontal",
2908
2910
  className: cn(
2909
2911
  "flex w-full h-full mx-auto",
2910
- variant === "xr" ? "gap-0 min-[600px]:gap-1.5" : "max-w-7xl gap-1.5"
2912
+ variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
2911
2913
  ),
2912
2914
  children
2913
2915
  }
@@ -4761,6 +4763,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
4761
4763
  loading = false,
4762
4764
  loadingVariant = "loading-indicator",
4763
4765
  iconSize,
4766
+ asChild = false,
4764
4767
  children,
4765
4768
  onClick,
4766
4769
  onKeyDown,
@@ -4776,6 +4779,7 @@ var IconButtonComponent = React36__namespace.forwardRef(
4776
4779
  "loading",
4777
4780
  "loadingVariant",
4778
4781
  "iconSize",
4782
+ "asChild",
4779
4783
  "children",
4780
4784
  "onClick",
4781
4785
  "onKeyDown",
@@ -4837,7 +4841,87 @@ var IconButtonComponent = React36__namespace.forwardRef(
4837
4841
  },
4838
4842
  [loading, onClick, onKeyDown]
4839
4843
  );
4840
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
4844
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4845
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
4846
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4847
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
4848
+ react.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__ */ jsxRuntime.jsx(
4857
+ LoadingIndicator,
4858
+ {
4859
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4860
+ color: "currentColor",
4861
+ "aria-label": "Loading"
4862
+ }
4863
+ ) : /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx(
4876
+ react.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: asChild ? React36__namespace.Children.only(children).props.children : children
4890
+ }),
4891
+ "content"
4892
+ ) })
4893
+ ] });
4894
+ const containerClassName = cn(
4895
+ baseIconButtonClasses,
4896
+ resolvedColorClass,
4897
+ outlineWidthClass,
4898
+ disabledBgClass,
4899
+ "overflow-hidden",
4900
+ SIZE_STYLES[size],
4901
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
4902
+ className
4903
+ );
4904
+ if (asChild) {
4905
+ const child = React36__namespace.Children.only(children);
4906
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4907
+ reactSlot.Slot,
4908
+ __spreadProps(__spreadValues({
4909
+ ref,
4910
+ "aria-pressed": isToggle ? isSelected : void 0,
4911
+ "aria-label": ariaLabel,
4912
+ "aria-busy": loading || void 0,
4913
+ "aria-disabled": loading || restProps.disabled,
4914
+ onClick: handleClick,
4915
+ onPointerDown,
4916
+ onKeyDown: handleKeyDown,
4917
+ style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
4918
+ className: containerClassName
4919
+ }, restProps), {
4920
+ children: React36__namespace.cloneElement(child, { children: innerContent })
4921
+ })
4922
+ ) });
4923
+ }
4924
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4841
4925
  react.m.button,
4842
4926
  __spreadProps(__spreadValues({
4843
4927
  ref,
@@ -4853,67 +4937,9 @@ var IconButtonComponent = React36__namespace.forwardRef(
4853
4937
  animate: { borderRadius: animateRadius },
4854
4938
  whileTap: { borderRadius: pressedRadius },
4855
4939
  transition: { borderRadius: SPRING_TRANSITION_FAST },
4856
- className: cn(
4857
- baseIconButtonClasses,
4858
- resolvedColorClass,
4859
- outlineWidthClass,
4860
- disabledBgClass,
4861
- "overflow-hidden",
4862
- SIZE_STYLES[size],
4863
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
4864
- className
4865
- )
4940
+ className: containerClassName
4866
4941
  }, restProps), {
4867
- children: [
4868
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
4869
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4870
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
4871
- react.m.span,
4872
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4873
- transition: SPRING_TRANSITION,
4874
- className: cn(
4875
- "flex items-center justify-center shrink-0",
4876
- iconSize != null ? void 0 : iconClass
4877
- ),
4878
- style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
4879
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
4880
- LoadingIndicator,
4881
- {
4882
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4883
- color: "currentColor",
4884
- "aria-label": "Loading"
4885
- }
4886
- ) : /* @__PURE__ */ jsxRuntime.jsx(
4887
- ProgressIndicator,
4888
- {
4889
- variant: "circular",
4890
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
4891
- color: "currentColor",
4892
- trackColor: "transparent",
4893
- "aria-label": "Loading"
4894
- }
4895
- )
4896
- }),
4897
- "loading"
4898
- ) : /* @__PURE__ */ jsxRuntime.jsx(
4899
- react.m.span,
4900
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
4901
- transition: SPRING_TRANSITION,
4902
- "aria-hidden": "true",
4903
- className: cn(
4904
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
4905
- iconSize != null ? void 0 : iconClass
4906
- ),
4907
- style: {
4908
- fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
4909
- width: isCustomSize ? `${iconSize}px` : void 0,
4910
- height: isCustomSize ? `${iconSize}px` : void 0
4911
- },
4912
- children
4913
- }),
4914
- "content"
4915
- ) })
4916
- ]
4942
+ children: innerContent
4917
4943
  })
4918
4944
  ) });
4919
4945
  }
@@ -5987,6 +6013,47 @@ var vibrantFloatingToolbarColors = {
5987
6013
  fabContainerColor: "var(--md-sys-color-tertiary-container)",
5988
6014
  fabContentColor: "var(--md-sys-color-on-tertiary-container)"
5989
6015
  };
6016
+ var surfaceContainerHighFloatingToolbarColors = {
6017
+ toolbarContainerColor: "var(--md-sys-color-surface-container-high)",
6018
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
6019
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
6020
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
6021
+ };
6022
+ var surfaceContainerHighestFloatingToolbarColors = {
6023
+ toolbarContainerColor: "var(--md-sys-color-surface-container-highest)",
6024
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
6025
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
6026
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
6027
+ };
6028
+ var tertiaryContainerFloatingToolbarColors = {
6029
+ toolbarContainerColor: "var(--md-sys-color-tertiary-container)",
6030
+ toolbarContentColor: "var(--md-sys-color-on-tertiary-container)",
6031
+ fabContainerColor: "var(--md-sys-color-primary-container)",
6032
+ fabContentColor: "var(--md-sys-color-on-primary-container)"
6033
+ };
6034
+ var xrFloatingToolbarColors = {
6035
+ toolbarContainerColor: "color-mix(in srgb, var(--md-sys-color-surface-container-high) 80%, transparent)",
6036
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
6037
+ fabContainerColor: "color-mix(in srgb, var(--md-sys-color-secondary-container) 85%, transparent)",
6038
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
6039
+ };
6040
+ function getToolbarColors(variant = "standard", customColors) {
6041
+ if (customColors) return customColors;
6042
+ switch (variant) {
6043
+ case "vibrant":
6044
+ return vibrantFloatingToolbarColors;
6045
+ case "surface-high":
6046
+ return surfaceContainerHighFloatingToolbarColors;
6047
+ case "surface-highest":
6048
+ return surfaceContainerHighestFloatingToolbarColors;
6049
+ case "tertiary":
6050
+ return tertiaryContainerFloatingToolbarColors;
6051
+ case "xr":
6052
+ return xrFloatingToolbarColors;
6053
+ default:
6054
+ return standardFloatingToolbarColors;
6055
+ }
6056
+ }
5990
6057
  var ToolbarContext = React36__namespace.createContext(
5991
6058
  null
5992
6059
  );
@@ -6022,7 +6089,7 @@ var BottomDockedToolbar = React36__namespace.forwardRef(
6022
6089
  "className",
6023
6090
  "aria-label"
6024
6091
  ]);
6025
- const colors = customColors || (variant === "vibrant" ? vibrantFloatingToolbarColors : standardFloatingToolbarColors);
6092
+ const colors = getToolbarColors(variant, customColors);
6026
6093
  const { scrollY } = react.useScroll(
6027
6094
  scrollContainerRef ? { container: scrollContainerRef } : void 0
6028
6095
  );
@@ -6051,6 +6118,7 @@ var BottomDockedToolbar = React36__namespace.forwardRef(
6051
6118
  full: "rounded-full"
6052
6119
  };
6053
6120
  const justifyClass = justify === "center" ? "justify-center gap-4" : "justify-between";
6121
+ const isXr = variant === "xr";
6054
6122
  return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation: "horizontal" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
6055
6123
  react.m.div,
6056
6124
  __spreadProps(__spreadValues({
@@ -6071,11 +6139,12 @@ var BottomDockedToolbar = React36__namespace.forwardRef(
6071
6139
  paddingRight: paddingX
6072
6140
  }),
6073
6141
  className: cn(
6074
- "fixed bottom-0 left-0 right-0 w-full z-40",
6142
+ "fixed bottom-0 left-0 right-0 w-full z-40 text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
6075
6143
  "flex items-center h-16",
6076
6144
  justifyClass,
6077
6145
  SHAPE_CLASSES[shape],
6078
- "shadow-[0_-1px_3px_rgba(0,0,0,0.1)] pointer-events-auto",
6146
+ isXr ? "backdrop-blur-md border-t border-white/10 shadow-lg" : "shadow-[0_-1px_3px_rgba(0,0,0,0.1)]",
6147
+ "pointer-events-auto",
6079
6148
  className
6080
6149
  )
6081
6150
  }, props), {
@@ -6122,6 +6191,13 @@ var ToolbarIconButtonTokens = {
6122
6191
  /** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
6123
6192
  IconSize: 28
6124
6193
  };
6194
+ var ToolbarToggleButtonTokens = {
6195
+ Height: 48,
6196
+ MinWidth: 95,
6197
+ IconSize: 24,
6198
+ PaddingX: 16,
6199
+ Gap: 8
6200
+ };
6125
6201
  var ALIGNMENT_CLASS = {
6126
6202
  start: "justify-start",
6127
6203
  center: "justify-center",
@@ -6180,7 +6256,8 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6180
6256
  var _b = _a, {
6181
6257
  expanded,
6182
6258
  orientation = "horizontal",
6183
- colors = standardFloatingToolbarColors,
6259
+ variant = "standard",
6260
+ colors: customColors,
6184
6261
  shape = "full",
6185
6262
  contentPadding,
6186
6263
  scrollBehavior,
@@ -6198,6 +6275,7 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6198
6275
  } = _b, props = __objRest(_b, [
6199
6276
  "expanded",
6200
6277
  "orientation",
6278
+ "variant",
6201
6279
  "colors",
6202
6280
  "shape",
6203
6281
  "contentPadding",
@@ -6214,6 +6292,7 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6214
6292
  "style",
6215
6293
  "aria-label"
6216
6294
  ]);
6295
+ const colors = getToolbarColors(variant, customColors);
6217
6296
  const isHorizontal = orientation === "horizontal";
6218
6297
  const isStringPadding = typeof contentPadding === "string";
6219
6298
  const cssVars = __spreadValues(__spreadValues({
@@ -6222,7 +6301,8 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6222
6301
  "--toolbar-size": `${FloatingToolbarTokens.ContainerHeight}px`
6223
6302
  }, isStringPadding ? {} : contentPadding), style);
6224
6303
  const isScrolledOff = scrollBehavior && scrollBehavior.offset < 0;
6225
- const shadowClass = expanded ? "shadow-md" : "shadow-sm";
6304
+ const isXr = variant === "xr";
6305
+ const shadowClass = isXr ? "shadow-lg border border-white/10 backdrop-blur-md" : expanded ? "shadow-md" : "shadow-sm";
6226
6306
  const containerShapeClass = shape === "full" ? "rounded-full" : "rounded-2xl";
6227
6307
  const leadingVariants = buildSlotVariants(
6228
6308
  isHorizontal ? "-100%" : 0,
@@ -6239,7 +6319,7 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6239
6319
  scrollBehavior,
6240
6320
  disableScrollTranslation
6241
6321
  );
6242
- return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation }, children: /* @__PURE__ */ jsxRuntime.jsx(
6322
+ return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation, itemClassName }, children: /* @__PURE__ */ jsxRuntime.jsx(
6243
6323
  react.m.div,
6244
6324
  {
6245
6325
  ref,
@@ -6261,8 +6341,8 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6261
6341
  color: "var(--toolbar-color)"
6262
6342
  }),
6263
6343
  className: cn(
6264
- "flex pointer-events-auto relative",
6265
- isHorizontal ? "max-w-[90vw] h-(--toolbar-size)" : "max-h-[90vh] w-(--toolbar-size) h-fit",
6344
+ "flex pointer-events-auto relative text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
6345
+ isHorizontal ? "max-w-[min(90vw,100%)] h-(--toolbar-size)" : "max-h-[min(90vh,100%)] w-(--toolbar-size) h-fit",
6266
6346
  containerShapeClass,
6267
6347
  shadowClass,
6268
6348
  className
@@ -6279,11 +6359,11 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6279
6359
  "div",
6280
6360
  {
6281
6361
  className: cn(
6282
- "flex items-center gap-1 min-w-0 min-h-0",
6362
+ "flex items-center min-w-0 min-h-0",
6283
6363
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
6284
- isStringPadding ? contentPadding : isHorizontal ? "px-4" : "py-6"
6364
+ isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
6285
6365
  ),
6286
- style: isStringPadding ? void 0 : contentPadding,
6366
+ style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
6287
6367
  children: [
6288
6368
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsxRuntime.jsx(
6289
6369
  react.m.div,
@@ -6293,9 +6373,10 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6293
6373
  animate: "visible",
6294
6374
  exit: "hidden",
6295
6375
  className: cn(
6296
- "flex shrink-0 overflow-hidden",
6376
+ "flex shrink-0 items-center overflow-hidden",
6297
6377
  isHorizontal ? "flex-row" : "flex-col"
6298
6378
  ),
6379
+ style: { gap: itemGap },
6299
6380
  children: processNodes(startContent)
6300
6381
  },
6301
6382
  "start"
@@ -6320,9 +6401,10 @@ var FloatingToolbarBase = React36__namespace.forwardRef(
6320
6401
  animate: "visible",
6321
6402
  exit: "hidden",
6322
6403
  className: cn(
6323
- "flex shrink-0 overflow-hidden",
6404
+ "flex shrink-0 items-center overflow-hidden",
6324
6405
  isHorizontal ? "flex-row" : "flex-col"
6325
6406
  ),
6407
+ style: { gap: itemGap },
6326
6408
  children: processNodes(endContent)
6327
6409
  },
6328
6410
  "end"
@@ -6348,7 +6430,8 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
6348
6430
  var _b = _a, {
6349
6431
  expanded,
6350
6432
  orientation = "horizontal",
6351
- colors = standardFloatingToolbarColors,
6433
+ variant = "standard",
6434
+ colors: customColors,
6352
6435
  floatingActionButton,
6353
6436
  fabPosition = orientation === "horizontal" ? "end" : "bottom",
6354
6437
  animationDuration = 0.3,
@@ -6359,6 +6442,7 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
6359
6442
  } = _b, props = __objRest(_b, [
6360
6443
  "expanded",
6361
6444
  "orientation",
6445
+ "variant",
6362
6446
  "colors",
6363
6447
  "floatingActionButton",
6364
6448
  "fabPosition",
@@ -6368,6 +6452,7 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
6368
6452
  "className",
6369
6453
  "style"
6370
6454
  ]);
6455
+ const colors = getToolbarColors(variant, customColors);
6371
6456
  const isHorizontal = orientation === "horizontal";
6372
6457
  const effectiveExpanded = expanded && (!scrollBehavior || scrollBehavior.isExpanded);
6373
6458
  const isFabBefore = fabPosition === "start" || fabPosition === "top";
@@ -6445,7 +6530,8 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
6445
6530
  expanded,
6446
6531
  colors,
6447
6532
  disableScrollTranslation: true,
6448
- disableLayoutAnimation: true
6533
+ disableLayoutAnimation: true,
6534
+ className: className ? cn("h-full", className) : void 0
6449
6535
  }, props)
6450
6536
  ) : /* @__PURE__ */ jsxRuntime.jsx(
6451
6537
  VerticalFloatingToolbar,
@@ -6453,7 +6539,8 @@ var FloatingToolbarWithFabBase = React36__namespace.forwardRef(
6453
6539
  expanded,
6454
6540
  colors,
6455
6541
  disableScrollTranslation: true,
6456
- disableLayoutAnimation: true
6542
+ disableLayoutAnimation: true,
6543
+ className: className ? cn("w-full", className) : void 0
6457
6544
  }, props)
6458
6545
  )
6459
6546
  },
@@ -6483,7 +6570,7 @@ var ToolbarDivider = ({
6483
6570
  "aria-orientation": isHorizontalToolbar ? "vertical" : "horizontal",
6484
6571
  className: cn(
6485
6572
  "shrink-0 bg-current opacity-30 border-none",
6486
- isHorizontalToolbar ? "w-px h-8 self-center mx-2" : "h-px w-8 self-center my-2",
6573
+ isHorizontalToolbar ? "w-px h-8 self-center mx-1" : "h-px w-8 self-center my-1",
6487
6574
  className
6488
6575
  ),
6489
6576
  style: {
@@ -6506,20 +6593,47 @@ var VARIANT_TO_COLOR_STYLE = {
6506
6593
  };
6507
6594
  var ToolbarIconButton = React36__namespace.forwardRef(
6508
6595
  (_a, ref) => {
6509
- var _b = _a, { emphasis = "standard", toolbarSize = "default", className } = _b, props = __objRest(_b, ["emphasis", "toolbarSize", "className"]);
6596
+ var _b = _a, {
6597
+ emphasis = "standard",
6598
+ toolbarSize = "default",
6599
+ selected,
6600
+ asChild,
6601
+ className
6602
+ } = _b, props = __objRest(_b, [
6603
+ "emphasis",
6604
+ "toolbarSize",
6605
+ "selected",
6606
+ "asChild",
6607
+ "className"
6608
+ ]);
6609
+ const context = useToolbarContext();
6510
6610
  const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
6511
6611
  const colorStyle = VARIANT_TO_COLOR_STYLE[emphasis];
6612
+ const iconButtonProps = selected !== void 0 ? {
6613
+ variant: "toggle",
6614
+ selected: Boolean(selected)
6615
+ } : {
6616
+ variant: "default"
6617
+ };
6512
6618
  return /* @__PURE__ */ jsxRuntime.jsx(
6513
6619
  IconButton,
6514
- __spreadValues({
6620
+ __spreadValues(__spreadProps(__spreadValues({
6515
6621
  ref,
6516
- variant: "default",
6622
+ asChild,
6517
6623
  colorStyle,
6518
6624
  size: "md",
6519
6625
  shape: "round",
6520
- iconSize: ToolbarIconButtonTokens.IconSize,
6521
- className: cn("h-[48px]", widthClass, className)
6522
- }, props)
6626
+ iconSize: ToolbarIconButtonTokens.IconSize
6627
+ }, iconButtonProps), {
6628
+ className: cn(
6629
+ "h-[48px]",
6630
+ widthClass,
6631
+ emphasis === "standard" && !selected && "text-current hover:bg-current/8 active:bg-current/12",
6632
+ emphasis === "standard" && selected && "bg-current/16 text-current hover:bg-current/20 active:bg-current/24",
6633
+ context == null ? void 0 : context.itemClassName,
6634
+ className
6635
+ )
6636
+ }), props)
6523
6637
  );
6524
6638
  }
6525
6639
  );
@@ -6590,6 +6704,195 @@ function useFloatingToolbarScrollBehavior(options = {}) {
6590
6704
  exitDirection
6591
6705
  };
6592
6706
  }
6707
+ var MOTION_PROP_KEYS = [
6708
+ "animate",
6709
+ "exit",
6710
+ "initial",
6711
+ "transition",
6712
+ "variants",
6713
+ "whileHover",
6714
+ "whileTap",
6715
+ "whileFocus",
6716
+ "whileDrag",
6717
+ "whileInView",
6718
+ "onAnimationStart",
6719
+ "onAnimationComplete",
6720
+ "onUpdate",
6721
+ "onDragStart",
6722
+ "onDragEnd",
6723
+ "onDrag",
6724
+ "onDirectionLock",
6725
+ "onDragTransitionEnd",
6726
+ "layout",
6727
+ "layoutId",
6728
+ "onLayoutAnimationComplete"
6729
+ ];
6730
+ var ToolbarToggleButton = React36__namespace.forwardRef(
6731
+ (_a, ref) => {
6732
+ var _b = _a, {
6733
+ emphasis = "standard",
6734
+ selected = false,
6735
+ icon,
6736
+ children,
6737
+ pressScale = 0.95,
6738
+ pressBounceOffset = 6,
6739
+ ripple = true,
6740
+ asChild = false,
6741
+ className,
6742
+ type = "button",
6743
+ disabled,
6744
+ onPointerDown: onPointerDownProp
6745
+ } = _b, props = __objRest(_b, [
6746
+ "emphasis",
6747
+ "selected",
6748
+ "icon",
6749
+ "children",
6750
+ "pressScale",
6751
+ "pressBounceOffset",
6752
+ "ripple",
6753
+ "asChild",
6754
+ "className",
6755
+ "type",
6756
+ "disabled",
6757
+ "onPointerDown"
6758
+ ]);
6759
+ const context = useToolbarContext();
6760
+ const {
6761
+ ripples,
6762
+ onPointerDown: handleRipplePointerDown,
6763
+ removeRipple
6764
+ } = useRippleState({
6765
+ disabled: Boolean(disabled) || !ripple
6766
+ });
6767
+ const handlePointerDown = React36__namespace.useCallback(
6768
+ (e) => {
6769
+ if (!disabled && ripple) {
6770
+ handleRipplePointerDown(e);
6771
+ }
6772
+ onPointerDownProp == null ? void 0 : onPointerDownProp(e);
6773
+ },
6774
+ [disabled, ripple, handleRipplePointerDown, onPointerDownProp]
6775
+ );
6776
+ 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";
6777
+ const variantClasses = {
6778
+ 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",
6779
+ 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",
6780
+ 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"
6781
+ };
6782
+ const combinedClassName = cn(
6783
+ baseClasses,
6784
+ variantClasses[emphasis],
6785
+ context == null ? void 0 : context.itemClassName,
6786
+ className
6787
+ );
6788
+ const whileTapConfig = React36__namespace.useMemo(
6789
+ () => ({
6790
+ scale: pressScale,
6791
+ x: pressBounceOffset ? [
6792
+ 0,
6793
+ -pressBounceOffset,
6794
+ pressBounceOffset,
6795
+ -pressBounceOffset / 2,
6796
+ pressBounceOffset / 2,
6797
+ 0
6798
+ ] : 0
6799
+ }),
6800
+ [pressScale, pressBounceOffset]
6801
+ );
6802
+ const transitionConfig = React36__namespace.useMemo(
6803
+ () => ({
6804
+ scale: FAST_SPATIAL_SPRING,
6805
+ x: {
6806
+ duration: 0.35,
6807
+ ease: "easeInOut"
6808
+ }
6809
+ }),
6810
+ []
6811
+ );
6812
+ const mainContent = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center justify-center h-full gap-2", children: [
6813
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
6814
+ "span",
6815
+ {
6816
+ className: "shrink-0 inline-flex items-center justify-center",
6817
+ style: {
6818
+ width: ToolbarToggleButtonTokens.IconSize,
6819
+ height: ToolbarToggleButtonTokens.IconSize
6820
+ },
6821
+ children: icon
6822
+ }
6823
+ ),
6824
+ children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children)
6825
+ ] });
6826
+ if (asChild) {
6827
+ const child = React36__namespace.Children.only(children);
6828
+ const childContent = child.props.children;
6829
+ const innerChildContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6830
+ ripple && /* @__PURE__ */ jsxRuntime.jsx(
6831
+ Ripple,
6832
+ {
6833
+ ripples,
6834
+ onRippleDone: removeRipple,
6835
+ disabled
6836
+ }
6837
+ ),
6838
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center h-full gap-2", children: icon ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6839
+ /* @__PURE__ */ jsxRuntime.jsx(
6840
+ "span",
6841
+ {
6842
+ className: "shrink-0 inline-flex items-center justify-center",
6843
+ style: {
6844
+ width: ToolbarToggleButtonTokens.IconSize,
6845
+ height: ToolbarToggleButtonTokens.IconSize
6846
+ },
6847
+ children: icon
6848
+ }
6849
+ ),
6850
+ typeof childContent === "string" || typeof childContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: childContent }) : childContent
6851
+ ] }) : childContent })
6852
+ ] });
6853
+ const strippedProps = __spreadValues({}, props);
6854
+ for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
6855
+ delete strippedProps.children;
6856
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
6857
+ reactSlot.Slot,
6858
+ __spreadProps(__spreadValues({
6859
+ ref,
6860
+ "aria-pressed": selected,
6861
+ className: combinedClassName,
6862
+ onPointerDown: handlePointerDown
6863
+ }, strippedProps), {
6864
+ children: React36__namespace.cloneElement(child, { children: innerChildContent })
6865
+ })
6866
+ ) });
6867
+ }
6868
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
6869
+ react.m.button,
6870
+ __spreadProps(__spreadValues({
6871
+ ref,
6872
+ type,
6873
+ "aria-pressed": selected,
6874
+ disabled,
6875
+ whileTap: whileTapConfig,
6876
+ transition: transitionConfig,
6877
+ onPointerDown: handlePointerDown,
6878
+ className: combinedClassName
6879
+ }, props), {
6880
+ children: [
6881
+ ripple && /* @__PURE__ */ jsxRuntime.jsx(
6882
+ Ripple,
6883
+ {
6884
+ ripples,
6885
+ onRippleDone: removeRipple,
6886
+ disabled
6887
+ }
6888
+ ),
6889
+ mainContent
6890
+ ]
6891
+ })
6892
+ ) });
6893
+ }
6894
+ );
6895
+ ToolbarToggleButton.displayName = "ToolbarToggleButton";
6593
6896
 
6594
6897
  exports.APP_BAR_BOTTOM_SPRING = APP_BAR_BOTTOM_SPRING;
6595
6898
  exports.APP_BAR_COLORS = APP_BAR_COLORS;
@@ -6665,6 +6968,8 @@ exports.ToolbarDivider = ToolbarDivider;
6665
6968
  exports.ToolbarDividerTokens = ToolbarDividerTokens;
6666
6969
  exports.ToolbarIconButton = ToolbarIconButton;
6667
6970
  exports.ToolbarIconButtonTokens = ToolbarIconButtonTokens;
6971
+ exports.ToolbarToggleButton = ToolbarToggleButton;
6972
+ exports.ToolbarToggleButtonTokens = ToolbarToggleButtonTokens;
6668
6973
  exports.VIBRANT_COLORS = VIBRANT_COLORS;
6669
6974
  exports.VerticalFloatingToolbar = VerticalFloatingToolbar;
6670
6975
  exports.VerticalFloatingToolbarWithFab = VerticalFloatingToolbarWithFab;
@@ -6673,12 +6978,17 @@ exports.VerticalMenuContent = VerticalMenuContent;
6673
6978
  exports.VerticalMenuDivider = VerticalMenuDivider;
6674
6979
  exports.VerticalMenuGroup = VerticalMenuGroup;
6675
6980
  exports.appBarTypography = appBarTypography;
6981
+ exports.getToolbarColors = getToolbarColors;
6676
6982
  exports.standardFloatingToolbarColors = standardFloatingToolbarColors;
6983
+ exports.surfaceContainerHighFloatingToolbarColors = surfaceContainerHighFloatingToolbarColors;
6984
+ exports.surfaceContainerHighestFloatingToolbarColors = surfaceContainerHighestFloatingToolbarColors;
6985
+ exports.tertiaryContainerFloatingToolbarColors = tertiaryContainerFloatingToolbarColors;
6677
6986
  exports.useAppBarScroll = useAppBarScroll;
6678
6987
  exports.useFloatingToolbarScrollBehavior = useFloatingToolbarScrollBehavior;
6679
6988
  exports.useMenuContext = useMenuContext;
6680
6989
  exports.useSearch = useSearch;
6681
6990
  exports.useSearchKeyboard = useSearchKeyboard;
6682
6991
  exports.vibrantFloatingToolbarColors = vibrantFloatingToolbarColors;
6992
+ exports.xrFloatingToolbarColors = xrFloatingToolbarColors;
6683
6993
  //# sourceMappingURL=navigation.js.map
6684
6994
  //# sourceMappingURL=navigation.js.map