@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
package/dist/index.js CHANGED
@@ -253,7 +253,7 @@ function applyTheme(sourceColorHex, mode = "light", root = document.documentElem
253
253
  const resolved = resolveMode(mode);
254
254
  const colors = generateM3Theme(sourceColorHex, resolved, options);
255
255
  for (const [key, value] of Object.entries(colors)) {
256
- const kebabKey = key.replace(/[A-Z]/g, (m67) => `-${m67.toLowerCase()}`);
256
+ const kebabKey = key.replace(/[A-Z]/g, (m68) => `-${m68.toLowerCase()}`);
257
257
  root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
258
258
  root.style.setProperty(`--color-m3-${kebabKey}`, value);
259
259
  }
@@ -275,7 +275,7 @@ function createMd3ExpressiveTheme(options) {
275
275
  function schemeToCssVariables(scheme) {
276
276
  const result = {};
277
277
  for (const [key, value] of Object.entries(scheme)) {
278
- const kebabKey = key.replace(/[A-Z]/g, (m67) => `-${m67.toLowerCase()}`);
278
+ const kebabKey = key.replace(/[A-Z]/g, (m68) => `-${m68.toLowerCase()}`);
279
279
  result[`--md-sys-color-${kebabKey}`] = value;
280
280
  }
281
281
  return result;
@@ -1112,8 +1112,8 @@ var RoundedPolygon = class _RoundedPolygon {
1112
1112
  );
1113
1113
  const mid = c.pointOnCurve(0.5);
1114
1114
  const md = distanceSquared(mid.x - this.centerX, mid.y - this.centerY);
1115
- const m67 = Math.max(ad, md);
1116
- if (m67 > maxDistSq) maxDistSq = m67;
1115
+ const m68 = Math.max(ad, md);
1116
+ if (m68 > maxDistSq) maxDistSq = m68;
1117
1117
  }
1118
1118
  const d = Math.sqrt(maxDistSq);
1119
1119
  return [
@@ -7069,12 +7069,6 @@ var WIDTH_MORPH_SPRING = {
7069
7069
  damping: 38,
7070
7070
  mass: 0.85
7071
7071
  };
7072
- var NAVBAR_EXPRESSIVE_SPRING = {
7073
- type: "spring",
7074
- stiffness: 430,
7075
- damping: 38,
7076
- mass: 0.8
7077
- };
7078
7072
  var AnimatedCheckLabel = React59__namespace.memo(function AnimatedCheckLabel2({
7079
7073
  selected,
7080
7074
  size,
@@ -7112,23 +7106,6 @@ var AnimatedCheckLabel = React59__namespace.memo(function AnimatedCheckLabel2({
7112
7106
  }
7113
7107
  );
7114
7108
  });
7115
- var AnimatedNavbarLabel = React59__namespace.memo(function AnimatedNavbarLabel2({
7116
- show,
7117
- children
7118
- }) {
7119
- return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "popLayout", children: show && /* @__PURE__ */ jsxRuntime.jsx(
7120
- react.m.span,
7121
- {
7122
- initial: { width: 0, opacity: 0, scale: 0.8 },
7123
- animate: { width: "auto", opacity: 1, scale: 1 },
7124
- exit: { width: 0, opacity: 0, scale: 0.8 },
7125
- transition: NAVBAR_EXPRESSIVE_SPRING,
7126
- className: "overflow-hidden whitespace-nowrap text-sm font-semibold tracking-[0.01em] ml-1.5",
7127
- children
7128
- },
7129
- "navbar-label"
7130
- ) });
7131
- });
7132
7109
  function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize) {
7133
7110
  const defaults = ButtonGroupDefaults.connectedLeadingButtonShapes(itemSize);
7134
7111
  if (variant !== "connected") return defaults;
@@ -7149,7 +7126,7 @@ function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize)
7149
7126
  }
7150
7127
  return defaults;
7151
7128
  }
7152
- function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck, iconBehavior, labelBehavior) {
7129
+ function resolveIconAndLabel(element, isSelected, itemSize, showCheck, iconBehavior, labelBehavior) {
7153
7130
  let icon = element.props.icon;
7154
7131
  let label = element.props.children;
7155
7132
  const animateCheckInLabel = showCheck && iconBehavior !== "none" && iconBehavior !== "selected" && label !== void 0;
@@ -7165,9 +7142,6 @@ function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck,
7165
7142
  }
7166
7143
  if (animateCheckInLabel && label !== void 0) {
7167
7144
  label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedCheckLabel, { selected: isSelected, size: itemSize, children: label });
7168
- } else if (variant === "navbar" && label !== void 0) {
7169
- const showLabel = !labelBehavior || labelBehavior === "all" || labelBehavior === "selected" && isSelected;
7170
- label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedNavbarLabel, { show: showLabel, children: label });
7171
7145
  }
7172
7146
  return { icon, label };
7173
7147
  }
@@ -7202,13 +7176,11 @@ function resolveFlexTargets(variant, orientation, isSelected, isPressed, hasSele
7202
7176
  function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex, existingAnimate, existingWhileTap) {
7203
7177
  var _a, _b;
7204
7178
  const props = { animate: __spreadValues({}, existingAnimate) };
7205
- if (variant !== "navbar") {
7206
- if (flex.flexGrow !== void 0) {
7207
- props.animate.flexGrow = flex.flexGrow;
7208
- }
7209
- if (flex.paddingInline !== void 0) {
7210
- props.animate.paddingInline = flex.paddingInline;
7211
- }
7179
+ if (flex.flexGrow !== void 0) {
7180
+ props.animate.flexGrow = flex.flexGrow;
7181
+ }
7182
+ if (flex.paddingInline !== void 0) {
7183
+ props.animate.paddingInline = flex.paddingInline;
7212
7184
  }
7213
7185
  if (variant === "standard") {
7214
7186
  const pressedRadius = (_a = PRESSED_RADIUS_MAP[itemSize]) != null ? _a : PRESSED_RADIUS_MAP.sm;
@@ -7259,13 +7231,6 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex
7259
7231
  });
7260
7232
  props.layout = true;
7261
7233
  }
7262
- if (variant === "navbar") {
7263
- props.layout = true;
7264
- props.transition = {
7265
- layout: WIDTH_MORPH_SPRING,
7266
- default: BUTTON_SHAPE_MORPH_SPRING
7267
- };
7268
- }
7269
7234
  return props;
7270
7235
  }
7271
7236
  var ButtonGroupComponent = React59__namespace.forwardRef(
@@ -7305,7 +7270,6 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7305
7270
  const [lockedGroupSize, setLockedGroupSize] = React59__namespace.useState(
7306
7271
  null
7307
7272
  );
7308
- const layoutIdGroup = React59__namespace.useId();
7309
7273
  const rootRef = React59__namespace.useRef(null);
7310
7274
  const setRootRef = React59__namespace.useCallback(
7311
7275
  (node) => {
@@ -7388,7 +7352,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7388
7352
  className: cn(
7389
7353
  "inline-flex p-0 m-0 border-none max-w-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
7390
7354
  orientation === "vertical" ? "flex-col items-stretch overflow-y-auto overflow-x-hidden" : "flex-row overflow-x-auto overflow-y-hidden",
7391
- variant === "standard" ? "gap-3" : variant === "navbar" ? "gap-1.5 h-full" : "gap-0.5",
7355
+ variant === "standard" ? "gap-3" : "gap-0.5",
7392
7356
  fullWidth && "w-full",
7393
7357
  fullWidth && orientation === "vertical" && "h-full",
7394
7358
  className
@@ -7398,7 +7362,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7398
7362
  onPointerUp: handlePointerLeaveAndUp
7399
7363
  }, props), {
7400
7364
  children: childrenArray.map((child, index) => {
7401
- var _a2, _b2, _c;
7365
+ var _a2, _b2;
7402
7366
  const element = child;
7403
7367
  const isSelected = element.props.selected === true;
7404
7368
  const isFirst = index === 0;
@@ -7410,7 +7374,6 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7410
7374
  element,
7411
7375
  isSelected,
7412
7376
  itemSize,
7413
- variant,
7414
7377
  showCheck,
7415
7378
  iconBehavior,
7416
7379
  labelBehavior
@@ -7436,7 +7399,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7436
7399
  basePx
7437
7400
  );
7438
7401
  const dynamicStyle = __spreadValues({}, element.props.style);
7439
- if (variant !== "navbar" && flex.flexGrow !== void 0 && fullWidth) {
7402
+ if (flex.flexGrow !== void 0 && fullWidth) {
7440
7403
  dynamicStyle.flexBasis = 0;
7441
7404
  dynamicStyle.flexShrink = 1;
7442
7405
  dynamicStyle.minWidth = 0;
@@ -7454,13 +7417,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7454
7417
  existingWhileTap
7455
7418
  );
7456
7419
  const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
7457
- const navbarFlexStyle = flex.flexGrow !== void 0 ? {
7458
- flexBasis: fullWidth && labelBehavior !== "selected" ? 0 : "auto",
7459
- flexShrink: fullWidth ? 1 : 0,
7460
- flexGrow: flex.flexGrow,
7461
- minWidth: labelBehavior !== "selected" ? 0 : "fit-content"
7462
- } : {};
7463
- const clonedElement = React59__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
7420
+ const clonedElement = React59__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
7464
7421
  key: (_b2 = element.key) != null ? _b2 : index,
7465
7422
  tabIndex: isFirst ? 0 : -1,
7466
7423
  size: size || element.props.size,
@@ -7469,71 +7426,20 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7469
7426
  }, variant === "connected" && {
7470
7427
  colorStyle: element.props.colorStyle || "tonal",
7471
7428
  selectedColorStyle: element.props.selectedColorStyle || "filled"
7472
- }), variant === "navbar" && {
7473
- colorStyle: "text",
7474
- selectedColorStyle: "text",
7475
- className: cn(
7476
- element.props.className,
7477
- "w-full! h-full! px-3! min-w-0! relative z-20 flex items-center justify-center",
7478
- isSelected ? "text-m3-on-secondary-container! hover:bg-transparent! active:bg-transparent!" : "text-m3-on-surface-variant! hover:bg-transparent! active:bg-transparent!",
7479
- itemClassName
7480
- )
7481
- }), variant !== "navbar" && {
7429
+ }), {
7482
7430
  className: cn(
7483
7431
  element.props.className,
7484
7432
  connectedClasses,
7485
7433
  "focus-visible:z-10 hover:z-10 relative min-w-0",
7486
7434
  orientation === "vertical" && "w-full",
7487
7435
  itemClassName
7488
- )
7489
- }), {
7490
- style: variant === "navbar" ? __spreadProps(__spreadValues({}, dynamicStyle), { minWidth: 0 }) : dynamicStyle,
7436
+ ),
7437
+ style: dynamicStyle,
7491
7438
  onPointerDown: (e) => {
7492
7439
  setPressedIndex(index);
7493
7440
  if (element.props.onPointerDown) element.props.onPointerDown(e);
7494
7441
  }
7495
7442
  }), motionProps));
7496
- if (variant === "navbar") {
7497
- return /* @__PURE__ */ jsxRuntime.jsxs(
7498
- react.m.div,
7499
- {
7500
- layout: true,
7501
- whileTap: { scale: 0.96 },
7502
- transition: NAVBAR_EXPRESSIVE_SPRING,
7503
- className: "group relative h-full flex items-center justify-center min-w-0",
7504
- style: navbarFlexStyle,
7505
- children: [
7506
- /* @__PURE__ */ jsxRuntime.jsxs(
7507
- "div",
7508
- {
7509
- className: "absolute inset-x-1 inset-y-0 m-auto flex items-center justify-center pointer-events-none",
7510
- style: { zIndex: 1 },
7511
- children: [
7512
- /* @__PURE__ */ jsxRuntime.jsx(
7513
- "div",
7514
- {
7515
- className: "w-full h-[40px] bg-m3-on-surface-variant/8 opacity-0 group-hover:opacity-100 transition-opacity duration-200",
7516
- style: { borderRadius: PILL_BORDER_RADIUS }
7517
- }
7518
- ),
7519
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
7520
- react.m.div,
7521
- {
7522
- layoutId: `navbar-active-indicator-${layoutIdGroup}`,
7523
- className: "absolute inset-0 m-auto w-full h-[40px] bg-m3-secondary-container",
7524
- style: { borderRadius: PILL_BORDER_RADIUS },
7525
- transition: NAVBAR_EXPRESSIVE_SPRING
7526
- }
7527
- ) })
7528
- ]
7529
- }
7530
- ),
7531
- clonedElement
7532
- ]
7533
- },
7534
- (_c = element.key) != null ? _c : index
7535
- );
7536
- }
7537
7443
  return clonedElement;
7538
7444
  })
7539
7445
  })
@@ -7638,6 +7544,8 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7638
7544
  scrollThreshold = 50,
7639
7545
  collapsed,
7640
7546
  onCollapsedChange,
7547
+ asChild = false,
7548
+ children,
7641
7549
  onClick,
7642
7550
  onKeyDown,
7643
7551
  layoutId,
@@ -7657,6 +7565,8 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7657
7565
  "scrollThreshold",
7658
7566
  "collapsed",
7659
7567
  "onCollapsedChange",
7568
+ "asChild",
7569
+ "children",
7660
7570
  "onClick",
7661
7571
  "onKeyDown",
7662
7572
  "layoutId",
@@ -7708,7 +7618,109 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7708
7618
  },
7709
7619
  [loading, onClick, onKeyDown]
7710
7620
  );
7711
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && !(isCollapsed && !hasIcon) && /* @__PURE__ */ jsxRuntime.jsxs(
7621
+ const containerClassName = cn(
7622
+ "relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
7623
+ "transition-[box-shadow,filter] duration-200",
7624
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7625
+ "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7626
+ colors.bg,
7627
+ colors.text,
7628
+ lowered ? "shadow-sm" : "shadow-md",
7629
+ (_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
7630
+ SIZE_TEXT[size],
7631
+ isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
7632
+ hasIcon ? "justify-start" : "justify-center",
7633
+ SIZE_PADDING[size],
7634
+ hasIcon && SIZE_GAP[size]
7635
+ ),
7636
+ dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
7637
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
7638
+ className
7639
+ );
7640
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7641
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
7642
+ hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
7643
+ react.m.span,
7644
+ {
7645
+ layout: "position",
7646
+ className: cn(
7647
+ "flex items-center justify-center shrink-0",
7648
+ sizeIcon.cls
7649
+ ),
7650
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
7651
+ react.m.span,
7652
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7653
+ transition: SPRING_TRANSITION,
7654
+ className: "flex items-center justify-center shrink-0 w-full h-full",
7655
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
7656
+ LoadingIndicator,
7657
+ {
7658
+ size: sizeIcon.px,
7659
+ color: "currentColor",
7660
+ "aria-label": "Loading"
7661
+ }
7662
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7663
+ ProgressIndicator,
7664
+ {
7665
+ variant: "circular",
7666
+ size: sizeIcon.px,
7667
+ color: "currentColor",
7668
+ trackColor: "transparent",
7669
+ "aria-label": "Loading"
7670
+ }
7671
+ )
7672
+ }),
7673
+ "loading"
7674
+ ) : icon && /* @__PURE__ */ jsxRuntime.jsx(
7675
+ react.m.span,
7676
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7677
+ transition: SPRING_TRANSITION,
7678
+ "aria-hidden": "true",
7679
+ className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
7680
+ children: icon
7681
+ }),
7682
+ "icon"
7683
+ ) })
7684
+ }
7685
+ ),
7686
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx(
7687
+ react.m.span,
7688
+ {
7689
+ layout: "position",
7690
+ initial: { opacity: 0, width: 0 },
7691
+ animate: { opacity: 1, width: "auto" },
7692
+ exit: { opacity: 0, width: 0 },
7693
+ transition: {
7694
+ opacity: { duration: 0.15, ease: "linear" },
7695
+ width: SPRING_TRANSITION
7696
+ },
7697
+ className: "overflow-hidden whitespace-nowrap",
7698
+ children: label
7699
+ },
7700
+ "label"
7701
+ ) })
7702
+ ] });
7703
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && !(isCollapsed && !hasIcon) && (asChild ? /* @__PURE__ */ jsxRuntime.jsx(
7704
+ reactSlot.Slot,
7705
+ __spreadProps(__spreadValues({
7706
+ ref: localRef,
7707
+ "aria-label": ariaLabel || label,
7708
+ "aria-busy": loading || void 0,
7709
+ "aria-disabled": loading || restProps.disabled,
7710
+ onClick: handleClick,
7711
+ onPointerDown,
7712
+ onKeyDown: handleKeyDown,
7713
+ style: __spreadProps(__spreadValues({}, style), {
7714
+ borderRadius: `${radiusConfig.default}px`
7715
+ }),
7716
+ className: containerClassName
7717
+ }, restProps), {
7718
+ children: React59__namespace.cloneElement(
7719
+ React59__namespace.Children.only(children),
7720
+ { children: innerContent }
7721
+ )
7722
+ })
7723
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7712
7724
  react.m.button,
7713
7725
  __spreadProps(__spreadValues({
7714
7726
  ref: localRef,
@@ -7740,91 +7752,11 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7740
7752
  opacity: { duration: 0.2, ease: "linear" },
7741
7753
  layout: SPRING_TRANSITION
7742
7754
  },
7743
- className: cn(
7744
- "relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
7745
- "transition-[box-shadow,filter] duration-200",
7746
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7747
- "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7748
- colors.bg,
7749
- colors.text,
7750
- lowered ? "shadow-sm" : "shadow-md",
7751
- (_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
7752
- SIZE_TEXT[size],
7753
- isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
7754
- hasIcon ? "justify-start" : "justify-center",
7755
- SIZE_PADDING[size],
7756
- hasIcon && SIZE_GAP[size]
7757
- ),
7758
- dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
7759
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
7760
- className
7761
- )
7755
+ className: containerClassName
7762
7756
  }, restProps), {
7763
- children: [
7764
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
7765
- hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
7766
- react.m.span,
7767
- {
7768
- layout: "position",
7769
- className: cn(
7770
- "flex items-center justify-center shrink-0",
7771
- sizeIcon.cls
7772
- ),
7773
- children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
7774
- react.m.span,
7775
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7776
- transition: SPRING_TRANSITION,
7777
- className: "flex items-center justify-center shrink-0 w-full h-full",
7778
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
7779
- LoadingIndicator,
7780
- {
7781
- size: sizeIcon.px,
7782
- color: "currentColor",
7783
- "aria-label": "Loading"
7784
- }
7785
- ) : /* @__PURE__ */ jsxRuntime.jsx(
7786
- ProgressIndicator,
7787
- {
7788
- variant: "circular",
7789
- size: sizeIcon.px,
7790
- color: "currentColor",
7791
- trackColor: "transparent",
7792
- "aria-label": "Loading"
7793
- }
7794
- )
7795
- }),
7796
- "loading"
7797
- ) : icon && /* @__PURE__ */ jsxRuntime.jsx(
7798
- react.m.span,
7799
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7800
- transition: SPRING_TRANSITION,
7801
- "aria-hidden": "true",
7802
- className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
7803
- children: icon
7804
- }),
7805
- "icon"
7806
- ) })
7807
- }
7808
- ),
7809
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx(
7810
- react.m.span,
7811
- {
7812
- layout: "position",
7813
- initial: { opacity: 0, width: 0 },
7814
- animate: { opacity: 1, width: "auto" },
7815
- exit: { opacity: 0, width: 0 },
7816
- transition: {
7817
- opacity: { duration: 0.15, ease: "linear" },
7818
- width: SPRING_TRANSITION
7819
- },
7820
- className: "overflow-hidden whitespace-nowrap",
7821
- children: label
7822
- },
7823
- "label"
7824
- ) })
7825
- ]
7757
+ children: innerContent
7826
7758
  })
7827
- ) }) });
7759
+ )) }) });
7828
7760
  }
7829
7761
  );
7830
7762
  ExtendedFABComponent.displayName = "ExtendedFAB";
@@ -7913,6 +7845,7 @@ var FABComponent = React59__namespace.forwardRef(
7913
7845
  loading = false,
7914
7846
  loadingVariant = "loading-indicator",
7915
7847
  visible = true,
7848
+ asChild = false,
7916
7849
  onClick,
7917
7850
  onKeyDown,
7918
7851
  "aria-label": ariaLabel
@@ -7928,6 +7861,7 @@ var FABComponent = React59__namespace.forwardRef(
7928
7861
  "loading",
7929
7862
  "loadingVariant",
7930
7863
  "visible",
7864
+ "asChild",
7931
7865
  "onClick",
7932
7866
  "onKeyDown",
7933
7867
  "aria-label"
@@ -7965,19 +7899,116 @@ var FABComponent = React59__namespace.forwardRef(
7965
7899
  },
7966
7900
  [loading, onClick, onKeyDown]
7967
7901
  );
7968
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && /* @__PURE__ */ jsxRuntime.jsxs(
7902
+ const labelContent = asChild ? React59__namespace.Children.only(children).props.children : children;
7903
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7904
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
7905
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
7906
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
7907
+ react.m.span,
7908
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7909
+ transition: SPRING_TRANSITION,
7910
+ className: cn(
7911
+ "flex items-center justify-center shrink-0",
7912
+ iconClass
7913
+ ),
7914
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
7915
+ LoadingIndicator,
7916
+ {
7917
+ size: iconPx,
7918
+ color: "currentColor",
7919
+ "aria-label": "Loading"
7920
+ }
7921
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7922
+ ProgressIndicator,
7923
+ {
7924
+ variant: "circular",
7925
+ size: iconPx,
7926
+ color: "currentColor",
7927
+ trackColor: "transparent",
7928
+ "aria-label": "Loading"
7929
+ }
7930
+ )
7931
+ }),
7932
+ "loading"
7933
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7934
+ react.m.span,
7935
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7936
+ transition: SPRING_TRANSITION,
7937
+ "aria-hidden": "true",
7938
+ className: cn(
7939
+ "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
7940
+ iconClass
7941
+ ),
7942
+ children: icon
7943
+ }),
7944
+ "icon"
7945
+ ) }),
7946
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && labelContent && /* @__PURE__ */ jsxRuntime.jsx(
7947
+ react.m.span,
7948
+ {
7949
+ initial: { width: 0, opacity: 0 },
7950
+ animate: { width: "auto", opacity: 1 },
7951
+ exit: { width: 0, opacity: 0 },
7952
+ transition: SPRING_TRANSITION,
7953
+ className: "overflow-hidden whitespace-nowrap ml-3",
7954
+ children: labelContent
7955
+ },
7956
+ "label"
7957
+ ) })
7958
+ ] });
7959
+ const containerClassName = cn(
7960
+ "relative shrink-0 inline-flex items-center justify-center",
7961
+ "select-none cursor-pointer overflow-hidden",
7962
+ "transition-[box-shadow,opacity,filter] duration-200",
7963
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7964
+ "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7965
+ colors.bg,
7966
+ colors.text,
7967
+ lowered ? "shadow-sm" : colors.shadow,
7968
+ (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
7969
+ extended && "w-auto px-6",
7970
+ SIZE_TEXT_CLASS[size],
7971
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
7972
+ className
7973
+ );
7974
+ const computedAriaLabel = ariaLabel || (typeof children === "string" ? children : void 0);
7975
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: visible && (asChild ? /* @__PURE__ */ jsxRuntime.jsx(
7976
+ reactSlot.Slot,
7977
+ __spreadProps(__spreadValues({
7978
+ ref,
7979
+ "aria-label": computedAriaLabel,
7980
+ "aria-busy": loading || void 0,
7981
+ "aria-disabled": loading || restProps.disabled,
7982
+ onClick: handleClick,
7983
+ onPointerDown,
7984
+ onKeyDown: handleKeyDown,
7985
+ style: __spreadProps(__spreadValues({}, style), {
7986
+ borderRadius: `${animateRadius}px`
7987
+ }),
7988
+ className: containerClassName
7989
+ }, restProps), {
7990
+ children: React59__namespace.cloneElement(
7991
+ React59__namespace.Children.only(children),
7992
+ { children: innerContent }
7993
+ )
7994
+ })
7995
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
7969
7996
  react.m.button,
7970
7997
  __spreadProps(__spreadValues({
7971
7998
  ref,
7972
7999
  type: "button",
7973
- "aria-label": ariaLabel || (typeof children === "string" ? children : void 0),
8000
+ "aria-label": computedAriaLabel,
7974
8001
  "aria-busy": loading || void 0,
7975
8002
  "aria-disabled": loading || restProps.disabled,
7976
8003
  onClick: handleClick,
7977
8004
  onPointerDown,
7978
8005
  onKeyDown: handleKeyDown,
7979
8006
  style,
7980
- initial: { scale: 0.5, opacity: 0, borderRadius: animateRadius },
8007
+ initial: {
8008
+ scale: 0.5,
8009
+ opacity: 0,
8010
+ borderRadius: animateRadius
8011
+ },
7981
8012
  animate: { scale: 1, opacity: 1, borderRadius: animateRadius },
7982
8013
  exit: { scale: 0.5, opacity: 0 },
7983
8014
  whileTap: { borderRadius: pressedRadius },
@@ -7986,80 +8017,11 @@ var FABComponent = React59__namespace.forwardRef(
7986
8017
  scale: SPRING_TRANSITION,
7987
8018
  opacity: { duration: 0.25, ease: "easeOut" }
7988
8019
  },
7989
- className: cn(
7990
- "relative shrink-0 inline-flex items-center justify-center",
7991
- "select-none cursor-pointer overflow-hidden",
7992
- "transition-[box-shadow,opacity,filter] duration-200",
7993
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7994
- "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7995
- colors.bg,
7996
- colors.text,
7997
- lowered ? "shadow-sm" : colors.shadow,
7998
- (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
7999
- extended && "w-auto px-6",
8000
- SIZE_TEXT_CLASS[size],
8001
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
8002
- className
8003
- )
8020
+ className: containerClassName
8004
8021
  }, restProps), {
8005
- children: [
8006
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8007
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8008
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
8009
- react.m.span,
8010
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8011
- transition: SPRING_TRANSITION,
8012
- className: cn(
8013
- "flex items-center justify-center shrink-0",
8014
- iconClass
8015
- ),
8016
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
8017
- LoadingIndicator,
8018
- {
8019
- size: iconPx,
8020
- color: "currentColor",
8021
- "aria-label": "Loading"
8022
- }
8023
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8024
- ProgressIndicator,
8025
- {
8026
- variant: "circular",
8027
- size: iconPx,
8028
- color: "currentColor",
8029
- trackColor: "transparent",
8030
- "aria-label": "Loading"
8031
- }
8032
- )
8033
- }),
8034
- "loading"
8035
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8036
- react.m.span,
8037
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8038
- transition: SPRING_TRANSITION,
8039
- "aria-hidden": "true",
8040
- className: cn(
8041
- "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
8042
- iconClass
8043
- ),
8044
- children: icon
8045
- }),
8046
- "icon"
8047
- ) }),
8048
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && children && /* @__PURE__ */ jsxRuntime.jsx(
8049
- react.m.span,
8050
- {
8051
- initial: { width: 0, opacity: 0 },
8052
- animate: { width: "auto", opacity: 1 },
8053
- exit: { width: 0, opacity: 0 },
8054
- transition: SPRING_TRANSITION,
8055
- className: "overflow-hidden whitespace-nowrap ml-3",
8056
- children
8057
- },
8058
- "label"
8059
- ) })
8060
- ]
8022
+ children: innerContent
8061
8023
  })
8062
- ) }) });
8024
+ )) }) });
8063
8025
  }
8064
8026
  );
8065
8027
  FABComponent.displayName = "FAB";
@@ -8259,7 +8221,9 @@ function FABMenuItem({
8259
8221
  disabled = false,
8260
8222
  colorVariant = "primary",
8261
8223
  className,
8262
- tabIndex = 0
8224
+ tabIndex = 0,
8225
+ asChild = false,
8226
+ children
8263
8227
  }) {
8264
8228
  var _a;
8265
8229
  const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
@@ -8284,7 +8248,55 @@ function FABMenuItem({
8284
8248
  },
8285
8249
  [disabled, onClick]
8286
8250
  );
8287
- return /* @__PURE__ */ jsxRuntime.jsxs(
8251
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8252
+ /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8253
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8254
+ /* @__PURE__ */ jsxRuntime.jsx(
8255
+ "span",
8256
+ {
8257
+ "aria-hidden": "true",
8258
+ className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
8259
+ children: icon
8260
+ }
8261
+ ),
8262
+ label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
8263
+ ] });
8264
+ const containerClassName = cn(
8265
+ "relative inline-flex flex-row items-center",
8266
+ "select-none cursor-pointer overflow-hidden",
8267
+ "whitespace-nowrap",
8268
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
8269
+ MENU_ITEM_STYLES.size,
8270
+ MENU_ITEM_STYLES.gap,
8271
+ label ? MENU_ITEM_STYLES.padding : "px-4",
8272
+ !label && "justify-center",
8273
+ colors.bg,
8274
+ colors.text,
8275
+ disabled && "opacity-[0.38] pointer-events-none",
8276
+ className
8277
+ );
8278
+ const containerStyle = {
8279
+ transformOrigin: "right",
8280
+ borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
8281
+ };
8282
+ if (asChild) {
8283
+ const child = React59__namespace.Children.only(children);
8284
+ return /* @__PURE__ */ jsxRuntime.jsx(react.m.div, { variants: MENU_ITEM_VARIANTS, style: containerStyle, children: /* @__PURE__ */ jsxRuntime.jsx(
8285
+ reactSlot.Slot,
8286
+ {
8287
+ role: "menuitem",
8288
+ tabIndex,
8289
+ "aria-disabled": disabled ? "true" : void 0,
8290
+ "data-disabled": disabled ? "true" : void 0,
8291
+ onClick: handleClick,
8292
+ onPointerDown,
8293
+ onKeyDown: handleKeyDown,
8294
+ className: containerClassName,
8295
+ children: React59__namespace.cloneElement(child, { children: innerContent })
8296
+ }
8297
+ ) });
8298
+ }
8299
+ return /* @__PURE__ */ jsxRuntime.jsx(
8288
8300
  react.m.div,
8289
8301
  {
8290
8302
  role: "menuitem",
@@ -8295,37 +8307,9 @@ function FABMenuItem({
8295
8307
  onPointerDown,
8296
8308
  onKeyDown: handleKeyDown,
8297
8309
  variants: MENU_ITEM_VARIANTS,
8298
- style: {
8299
- transformOrigin: "right",
8300
- borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
8301
- },
8302
- className: cn(
8303
- "relative inline-flex flex-row items-center",
8304
- "select-none cursor-pointer overflow-hidden",
8305
- "whitespace-nowrap",
8306
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
8307
- MENU_ITEM_STYLES.size,
8308
- MENU_ITEM_STYLES.gap,
8309
- label ? MENU_ITEM_STYLES.padding : "px-4",
8310
- !label && "justify-center",
8311
- colors.bg,
8312
- colors.text,
8313
- disabled && "opacity-[0.38] pointer-events-none",
8314
- className
8315
- ),
8316
- children: [
8317
- /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8318
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8319
- /* @__PURE__ */ jsxRuntime.jsx(
8320
- "span",
8321
- {
8322
- "aria-hidden": "true",
8323
- className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
8324
- children: icon
8325
- }
8326
- ),
8327
- label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
8328
- ]
8310
+ style: containerStyle,
8311
+ className: containerClassName,
8312
+ children: innerContent
8329
8313
  }
8330
8314
  );
8331
8315
  }
@@ -8607,6 +8591,7 @@ var IconButtonComponent = React59__namespace.forwardRef(
8607
8591
  loading = false,
8608
8592
  loadingVariant = "loading-indicator",
8609
8593
  iconSize,
8594
+ asChild = false,
8610
8595
  children,
8611
8596
  onClick,
8612
8597
  onKeyDown,
@@ -8622,6 +8607,7 @@ var IconButtonComponent = React59__namespace.forwardRef(
8622
8607
  "loading",
8623
8608
  "loadingVariant",
8624
8609
  "iconSize",
8610
+ "asChild",
8625
8611
  "children",
8626
8612
  "onClick",
8627
8613
  "onKeyDown",
@@ -8683,7 +8669,87 @@ var IconButtonComponent = React59__namespace.forwardRef(
8683
8669
  },
8684
8670
  [loading, onClick, onKeyDown]
8685
8671
  );
8686
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8672
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8673
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8674
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8675
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
8676
+ react.m.span,
8677
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8678
+ transition: SPRING_TRANSITION,
8679
+ className: cn(
8680
+ "flex items-center justify-center shrink-0",
8681
+ iconSize != null ? void 0 : iconClass
8682
+ ),
8683
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
8684
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
8685
+ LoadingIndicator,
8686
+ {
8687
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8688
+ color: "currentColor",
8689
+ "aria-label": "Loading"
8690
+ }
8691
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
8692
+ ProgressIndicator,
8693
+ {
8694
+ variant: "circular",
8695
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8696
+ color: "currentColor",
8697
+ trackColor: "transparent",
8698
+ "aria-label": "Loading"
8699
+ }
8700
+ )
8701
+ }),
8702
+ "loading"
8703
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
8704
+ react.m.span,
8705
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8706
+ transition: SPRING_TRANSITION,
8707
+ "aria-hidden": "true",
8708
+ className: cn(
8709
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
8710
+ iconSize != null ? void 0 : iconClass
8711
+ ),
8712
+ style: {
8713
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
8714
+ width: isCustomSize ? `${iconSize}px` : void 0,
8715
+ height: isCustomSize ? `${iconSize}px` : void 0
8716
+ },
8717
+ children: asChild ? React59__namespace.Children.only(children).props.children : children
8718
+ }),
8719
+ "content"
8720
+ ) })
8721
+ ] });
8722
+ const containerClassName = cn(
8723
+ baseIconButtonClasses,
8724
+ resolvedColorClass,
8725
+ outlineWidthClass,
8726
+ disabledBgClass,
8727
+ "overflow-hidden",
8728
+ SIZE_STYLES2[size],
8729
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
8730
+ className
8731
+ );
8732
+ if (asChild) {
8733
+ const child = React59__namespace.Children.only(children);
8734
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8735
+ reactSlot.Slot,
8736
+ __spreadProps(__spreadValues({
8737
+ ref,
8738
+ "aria-pressed": isToggle ? isSelected : void 0,
8739
+ "aria-label": ariaLabel,
8740
+ "aria-busy": loading || void 0,
8741
+ "aria-disabled": loading || restProps.disabled,
8742
+ onClick: handleClick,
8743
+ onPointerDown,
8744
+ onKeyDown: handleKeyDown,
8745
+ style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
8746
+ className: containerClassName
8747
+ }, restProps), {
8748
+ children: React59__namespace.cloneElement(child, { children: innerContent })
8749
+ })
8750
+ ) });
8751
+ }
8752
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
8687
8753
  react.m.button,
8688
8754
  __spreadProps(__spreadValues({
8689
8755
  ref,
@@ -8699,67 +8765,9 @@ var IconButtonComponent = React59__namespace.forwardRef(
8699
8765
  animate: { borderRadius: animateRadius },
8700
8766
  whileTap: { borderRadius: pressedRadius },
8701
8767
  transition: { borderRadius: SPRING_TRANSITION_FAST },
8702
- className: cn(
8703
- baseIconButtonClasses,
8704
- resolvedColorClass,
8705
- outlineWidthClass,
8706
- disabledBgClass,
8707
- "overflow-hidden",
8708
- SIZE_STYLES2[size],
8709
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
8710
- className
8711
- )
8768
+ className: containerClassName
8712
8769
  }, restProps), {
8713
- children: [
8714
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8715
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8716
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
8717
- react.m.span,
8718
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8719
- transition: SPRING_TRANSITION,
8720
- className: cn(
8721
- "flex items-center justify-center shrink-0",
8722
- iconSize != null ? void 0 : iconClass
8723
- ),
8724
- style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
8725
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
8726
- LoadingIndicator,
8727
- {
8728
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8729
- color: "currentColor",
8730
- "aria-label": "Loading"
8731
- }
8732
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8733
- ProgressIndicator,
8734
- {
8735
- variant: "circular",
8736
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8737
- color: "currentColor",
8738
- trackColor: "transparent",
8739
- "aria-label": "Loading"
8740
- }
8741
- )
8742
- }),
8743
- "loading"
8744
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8745
- react.m.span,
8746
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8747
- transition: SPRING_TRANSITION,
8748
- "aria-hidden": "true",
8749
- className: cn(
8750
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
8751
- iconSize != null ? void 0 : iconClass
8752
- ),
8753
- style: {
8754
- fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
8755
- width: isCustomSize ? `${iconSize}px` : void 0,
8756
- height: isCustomSize ? `${iconSize}px` : void 0
8757
- },
8758
- children
8759
- }),
8760
- "content"
8761
- ) })
8762
- ]
8770
+ children: innerContent
8763
8771
  })
8764
8772
  ) });
8765
8773
  }
@@ -9079,6 +9087,7 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9079
9087
  icon,
9080
9088
  children,
9081
9089
  disabled,
9090
+ asChild = false,
9082
9091
  onClick,
9083
9092
  onPointerDown,
9084
9093
  onPointerUp,
@@ -9094,6 +9103,7 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9094
9103
  "icon",
9095
9104
  "children",
9096
9105
  "disabled",
9106
+ "asChild",
9097
9107
  "onClick",
9098
9108
  "onPointerDown",
9099
9109
  "onPointerUp",
@@ -9180,12 +9190,73 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9180
9190
  [onBlur]
9181
9191
  );
9182
9192
  const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
9183
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
9193
+ const labelContent = asChild ? React59__namespace.Children.only(children).props.children : children;
9194
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9195
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9196
+ /* @__PURE__ */ jsxRuntime.jsx(
9197
+ StateLayer,
9198
+ {
9199
+ hovered: isHovered,
9200
+ focused: isFocused,
9201
+ pressed: isPressed
9202
+ }
9203
+ ),
9204
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9205
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
9206
+ "span",
9207
+ {
9208
+ className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
9209
+ style: {
9210
+ fontSize: leadingIconSize,
9211
+ width: leadingIconSize,
9212
+ height: leadingIconSize
9213
+ },
9214
+ children: icon
9215
+ }
9216
+ ),
9217
+ labelContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children: labelContent })
9218
+ ] });
9219
+ const containerClassName = cn(
9220
+ splitButtonVariants({
9221
+ variant: actualVariant,
9222
+ size: actualSize,
9223
+ disabled
9224
+ }),
9225
+ typographyClass,
9226
+ className
9227
+ );
9228
+ const mergedStyle = __spreadValues({
9229
+ paddingInlineStart: tokens.leadingPadding.start,
9230
+ paddingInlineEnd: tokens.leadingPadding.end,
9231
+ gap: "8px",
9232
+ borderRadius
9233
+ }, style);
9234
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(
9235
+ reactSlot.Slot,
9236
+ __spreadProps(__spreadValues({
9237
+ ref,
9238
+ "aria-disabled": disabled || void 0,
9239
+ onClick: handleClick,
9240
+ onPointerDown: handlePointerDown,
9241
+ onPointerUp: handlePointerUp,
9242
+ onPointerEnter: handlePointerEnter,
9243
+ onPointerLeave: handlePointerLeave,
9244
+ onPointerCancel: handlePointerCancel,
9245
+ onFocus: handleFocus,
9246
+ onBlur: handleBlur,
9247
+ style: mergedStyle,
9248
+ className: containerClassName
9249
+ }, restProps), {
9250
+ children: React59__namespace.cloneElement(
9251
+ React59__namespace.Children.only(children),
9252
+ { children: innerContent }
9253
+ )
9254
+ })
9255
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
9184
9256
  react.m.button,
9185
9257
  __spreadProps(__spreadValues({
9186
9258
  ref,
9187
9259
  type: "button",
9188
- "aria-disabled": disabled,
9189
9260
  disabled,
9190
9261
  onClick: handleClick,
9191
9262
  onPointerDown: handlePointerDown,
@@ -9202,41 +9273,9 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9202
9273
  paddingInlineEnd: tokens.leadingPadding.end,
9203
9274
  gap: "8px"
9204
9275
  }, style),
9205
- className: cn(
9206
- splitButtonVariants({
9207
- variant: actualVariant,
9208
- size: actualSize,
9209
- disabled
9210
- }),
9211
- typographyClass,
9212
- className
9213
- )
9276
+ className: containerClassName
9214
9277
  }, restProps), {
9215
- children: [
9216
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9217
- /* @__PURE__ */ jsxRuntime.jsx(
9218
- StateLayer,
9219
- {
9220
- hovered: isHovered,
9221
- focused: isFocused,
9222
- pressed: isPressed
9223
- }
9224
- ),
9225
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9226
- icon && /* @__PURE__ */ jsxRuntime.jsx(
9227
- "span",
9228
- {
9229
- className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
9230
- style: {
9231
- fontSize: leadingIconSize,
9232
- width: leadingIconSize,
9233
- height: leadingIconSize
9234
- },
9235
- children: icon
9236
- }
9237
- ),
9238
- children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children })
9239
- ]
9278
+ children: innerContent
9240
9279
  })
9241
9280
  ) });
9242
9281
  }
@@ -9268,6 +9307,8 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9268
9307
  onPointerCancel,
9269
9308
  onFocus,
9270
9309
  onBlur,
9310
+ asChild = false,
9311
+ children,
9271
9312
  "aria-label": ariaLabel
9272
9313
  } = _b, restProps = __objRest(_b, [
9273
9314
  "className",
@@ -9284,6 +9325,8 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9284
9325
  "onPointerCancel",
9285
9326
  "onFocus",
9286
9327
  "onBlur",
9328
+ "asChild",
9329
+ "children",
9287
9330
  "aria-label"
9288
9331
  ]);
9289
9332
  var _a2, _b2;
@@ -9358,14 +9401,81 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9358
9401
  },
9359
9402
  [onBlur]
9360
9403
  );
9361
- return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
9404
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9405
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9406
+ /* @__PURE__ */ jsxRuntime.jsx(
9407
+ StateLayer,
9408
+ {
9409
+ hovered: isHovered,
9410
+ focused: isFocused,
9411
+ pressed: isPressed
9412
+ }
9413
+ ),
9414
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9415
+ /* @__PURE__ */ jsxRuntime.jsx(
9416
+ react.m.div,
9417
+ {
9418
+ animate: {
9419
+ rotate: checked ? 180 : 0,
9420
+ x: checked ? 0 : tokens.opticalCenterOffset
9421
+ },
9422
+ transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
9423
+ className: "flex items-center justify-center shrink-0",
9424
+ children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
9425
+ Icon,
9426
+ {
9427
+ name: "arrow_drop_down",
9428
+ size: tokens.trailingIconSize,
9429
+ opticalSize: 24
9430
+ }
9431
+ )
9432
+ }
9433
+ )
9434
+ ] });
9435
+ const containerClassName = cn(
9436
+ splitButtonVariants({
9437
+ variant: actualVariant,
9438
+ size: actualSize,
9439
+ disabled
9440
+ }),
9441
+ className
9442
+ );
9443
+ const mergedStyle = __spreadValues({
9444
+ paddingInlineStart: tokens.trailingPadding.start,
9445
+ paddingInlineEnd: tokens.trailingPadding.end,
9446
+ borderRadius
9447
+ }, style);
9448
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(
9449
+ reactSlot.Slot,
9450
+ __spreadProps(__spreadValues({
9451
+ ref,
9452
+ "aria-label": ariaLabel,
9453
+ "aria-expanded": checked,
9454
+ "aria-disabled": disabled,
9455
+ onClick: handleToggle,
9456
+ onPointerDown: handlePointerDown,
9457
+ onPointerUp: handlePointerUp,
9458
+ onPointerEnter: handlePointerEnter,
9459
+ onPointerLeave: handlePointerLeave,
9460
+ onPointerCancel: handlePointerCancel,
9461
+ onFocus: handleFocus,
9462
+ onBlur: handleBlur,
9463
+ style: mergedStyle,
9464
+ className: containerClassName
9465
+ }, restProps), {
9466
+ children: React59__namespace.cloneElement(
9467
+ React59__namespace.Children.only(children),
9468
+ { children: innerContent }
9469
+ )
9470
+ })
9471
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
9362
9472
  react.m.button,
9363
9473
  __spreadProps(__spreadValues({
9364
9474
  ref,
9365
9475
  type: "button",
9366
- "aria-pressed": checked,
9367
- "aria-expanded": checked,
9368
9476
  "aria-label": ariaLabel,
9477
+ "aria-expanded": checked,
9478
+ "aria-disabled": disabled,
9369
9479
  disabled,
9370
9480
  onClick: handleToggle,
9371
9481
  onPointerDown: handlePointerDown,
@@ -9381,46 +9491,9 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9381
9491
  paddingInlineStart: tokens.trailingPadding.start,
9382
9492
  paddingInlineEnd: tokens.trailingPadding.end
9383
9493
  }, style),
9384
- className: cn(
9385
- splitButtonVariants({
9386
- variant: actualVariant,
9387
- size: actualSize,
9388
- disabled
9389
- }),
9390
- className
9391
- )
9494
+ className: containerClassName
9392
9495
  }, restProps), {
9393
- children: [
9394
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9395
- /* @__PURE__ */ jsxRuntime.jsx(
9396
- StateLayer,
9397
- {
9398
- hovered: isHovered,
9399
- focused: isFocused,
9400
- pressed: isPressed
9401
- }
9402
- ),
9403
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9404
- /* @__PURE__ */ jsxRuntime.jsx(
9405
- react.m.div,
9406
- {
9407
- animate: {
9408
- rotate: checked ? 180 : 0,
9409
- x: checked ? 0 : tokens.opticalCenterOffset
9410
- },
9411
- transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
9412
- className: "flex items-center justify-center shrink-0",
9413
- children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
9414
- Icon,
9415
- {
9416
- name: "arrow_drop_down",
9417
- size: tokens.trailingIconSize,
9418
- opticalSize: 24
9419
- }
9420
- )
9421
- }
9422
- )
9423
- ]
9496
+ children: innerContent
9424
9497
  })
9425
9498
  ) });
9426
9499
  }
@@ -9674,6 +9747,7 @@ var CardImpl = React59__namespace.forwardRef(
9674
9747
  target,
9675
9748
  rel: relProp,
9676
9749
  onClick,
9750
+ asChild = false,
9677
9751
  children
9678
9752
  } = _b, props = __objRest(_b, [
9679
9753
  "className",
@@ -9684,10 +9758,11 @@ var CardImpl = React59__namespace.forwardRef(
9684
9758
  "target",
9685
9759
  "rel",
9686
9760
  "onClick",
9761
+ "asChild",
9687
9762
  "children"
9688
9763
  ]);
9689
9764
  const safeVariant = variant;
9690
- const isInteractive = !!onClick || !!href || interactive;
9765
+ const isInteractive = !!onClick || !!href || interactive || asChild;
9691
9766
  const elevationProps = useCardElevation(safeVariant, disabled);
9692
9767
  const { ripples, onPointerDown, removeRipple } = useRippleState();
9693
9768
  const baseClass = cn(
@@ -9708,6 +9783,26 @@ var CardImpl = React59__namespace.forwardRef(
9708
9783
  // Outlined interactive card: change border color to m3-outline on focus/press/hover
9709
9784
  variant === "outlined" && "hover:border-m3-outline focus-visible:border-m3-outline active:border-m3-outline"
9710
9785
  );
9786
+ if (asChild) {
9787
+ const child = React59__namespace.Children.only(children);
9788
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9789
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9790
+ child.props.children
9791
+ ] });
9792
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
9793
+ reactSlot.Slot,
9794
+ __spreadProps(__spreadValues({
9795
+ ref,
9796
+ className: cn(baseClass, interactiveClass),
9797
+ "aria-disabled": disabled ? true : void 0,
9798
+ tabIndex: disabled ? -1 : 0,
9799
+ onPointerDown,
9800
+ onClick
9801
+ }, props), {
9802
+ children: React59__namespace.cloneElement(child, { children: innerContent })
9803
+ })
9804
+ ) });
9805
+ }
9711
9806
  if (!isInteractive) {
9712
9807
  return /* @__PURE__ */ jsxRuntime.jsx(
9713
9808
  "div",
@@ -10174,7 +10269,9 @@ var ChipImpl = React59__namespace.forwardRef(
10174
10269
  avatar,
10175
10270
  onRemove,
10176
10271
  className,
10177
- onClick
10272
+ onClick,
10273
+ asChild = false,
10274
+ children
10178
10275
  } = _b, props = __objRest(_b, [
10179
10276
  "variant",
10180
10277
  "elevated",
@@ -10186,7 +10283,9 @@ var ChipImpl = React59__namespace.forwardRef(
10186
10283
  "avatar",
10187
10284
  "onRemove",
10188
10285
  "className",
10189
- "onClick"
10286
+ "onClick",
10287
+ "asChild",
10288
+ "children"
10190
10289
  ]);
10191
10290
  const { ripples, onPointerDown, removeRipple } = useRippleState({
10192
10291
  disabled
@@ -10301,6 +10400,63 @@ var ChipImpl = React59__namespace.forwardRef(
10301
10400
  ) : null }),
10302
10401
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: label })
10303
10402
  ] });
10403
+ if (asChild) {
10404
+ const child = React59__namespace.Children.only(children);
10405
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10406
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
10407
+ mainContent,
10408
+ hasTrailingContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center shrink-0", children: onRemove ? /* @__PURE__ */ jsxRuntime.jsx(
10409
+ "button",
10410
+ {
10411
+ type: "button",
10412
+ tabIndex: disabled ? -1 : 0,
10413
+ "aria-label": typeof label === "string" ? `Remove ${label}` : "Remove",
10414
+ onClick: (e) => {
10415
+ e.stopPropagation();
10416
+ onRemove(e);
10417
+ },
10418
+ onPointerDown: (e) => e.stopPropagation(),
10419
+ className: cn(
10420
+ "flex items-center justify-center w-8.5 h-full",
10421
+ "cursor-pointer focus-visible:outline-none",
10422
+ "transition-all duration-150",
10423
+ "relative overflow-hidden rounded-r-[7px] rounded-l-none",
10424
+ "before:absolute before:-inset-px before:pointer-events-none before:bg-current",
10425
+ "before:transition-opacity before:duration-200 before:opacity-0 before:rounded-r-[7px]",
10426
+ "hover:before:opacity-[0.08] active:before:opacity-[0.12]",
10427
+ selected ? "text-m3-on-secondary-container" : "text-m3-on-surface-variant"
10428
+ ),
10429
+ children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon3, {})
10430
+ }
10431
+ ) : trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(
10432
+ "span",
10433
+ {
10434
+ className: cn(
10435
+ "flex items-center justify-center w-4.5 h-4.5 [&_.md-icon]:text-[length:inherit]!",
10436
+ selected ? "text-m3-on-secondary-container" : "text-m3-on-surface-variant"
10437
+ ),
10438
+ style: { fontSize: 18 },
10439
+ "aria-hidden": "true",
10440
+ children: trailingIcon
10441
+ }
10442
+ ) : null })
10443
+ ] });
10444
+ const strippedProps = __spreadValues({}, props);
10445
+ delete strippedProps.children;
10446
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
10447
+ reactSlot.Slot,
10448
+ __spreadProps(__spreadValues({
10449
+ ref,
10450
+ "aria-disabled": disabled || void 0,
10451
+ tabIndex: disabled ? -1 : 0,
10452
+ onClick,
10453
+ onPointerDown,
10454
+ className: containerClass
10455
+ }, strippedProps), {
10456
+ children: React59__namespace.cloneElement(child, { children: innerContent })
10457
+ })
10458
+ ) });
10459
+ }
10304
10460
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
10305
10461
  Root8,
10306
10462
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({
@@ -13242,7 +13398,7 @@ var TimePickerDialog = ({
13242
13398
  TimePickerDialog.displayName = "TimePickerDialog";
13243
13399
  var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
13244
13400
  var isValidHourInput = (h, is24hour) => is24hour ? h >= 0 && h <= 23 : h >= 1 && h <= 12;
13245
- var isValidMinuteInput = (m67) => m67 >= 0 && m67 <= 59;
13401
+ var isValidMinuteInput = (m68) => m68 >= 0 && m68 <= 59;
13246
13402
  var to24Hour = (hour12, isPm) => {
13247
13403
  if (isPm) {
13248
13404
  return hour12 === 12 ? 12 : hour12 + 12;
@@ -13278,8 +13434,8 @@ var useTimePickerState = (options) => {
13278
13434
  },
13279
13435
  [is24hour]
13280
13436
  );
13281
- const setMinute = React59.useCallback((m67) => {
13282
- const clamped = clamp(m67, 0, 59);
13437
+ const setMinute = React59.useCallback((m68) => {
13438
+ const clamped = clamp(m68, 0, 59);
13283
13439
  setMinuteState(clamped);
13284
13440
  setMinuteInputState(clamped);
13285
13441
  }, []);
@@ -13293,10 +13449,10 @@ var useTimePickerState = (options) => {
13293
13449
  },
13294
13450
  [is24hour, isPm]
13295
13451
  );
13296
- const setMinuteInput = React59.useCallback((m67) => {
13297
- setMinuteInputState(m67);
13298
- if (isValidMinuteInput(m67)) {
13299
- setMinuteState(m67);
13452
+ const setMinuteInput = React59.useCallback((m68) => {
13453
+ setMinuteInputState(m68);
13454
+ if (isValidMinuteInput(m68)) {
13455
+ setMinuteState(m68);
13300
13456
  }
13301
13457
  }, []);
13302
13458
  const setSelection = React59.useCallback((mode) => {
@@ -15436,7 +15592,7 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15436
15592
  className,
15437
15593
  "aria-label": ariaLabelProp
15438
15594
  }, ref) => {
15439
- const { variant, itemLayout } = React59__namespace.useContext(NavigationBarContext);
15595
+ const { variant, itemLayout, itemClassName: contextItemClassName } = React59__namespace.useContext(NavigationBarContext);
15440
15596
  const isForcedHorizontal = itemLayout === "horizontal";
15441
15597
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
15442
15598
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -15471,9 +15627,10 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15471
15627
  onClick: handleClick,
15472
15628
  onPointerDown,
15473
15629
  className: cn(
15474
- "group relative flex flex-1 cursor-pointer transition-colors duration-200 outline-none select-none h-full",
15475
- 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",
15630
+ "group relative flex cursor-pointer transition-colors duration-200 outline-none select-none h-full items-center justify-center min-w-0",
15631
+ 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",
15476
15632
  disabled && "pointer-events-none opacity-[0.38]",
15633
+ contextItemClassName,
15477
15634
  className
15478
15635
  ),
15479
15636
  children: [
@@ -15481,9 +15638,9 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15481
15638
  "div",
15482
15639
  {
15483
15640
  className: cn(
15484
- "relative flex items-center justify-center flex-col gap-y-1 w-full",
15485
- 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",
15486
- isForcedHorizontal && "flex-row gap-y-0 gap-x-1 h-10 px-4 rounded-full w-auto max-w-42"
15641
+ "relative flex items-center justify-center flex-col gap-y-1 w-full px-1 py-1.5",
15642
+ 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",
15643
+ isForcedHorizontal && "flex-row gap-y-0 gap-x-1.5 h-10 px-4 py-0 rounded-full w-auto"
15487
15644
  ),
15488
15645
  children: [
15489
15646
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -15560,7 +15717,7 @@ var navContainerVariants = classVarianceAuthority.cva(
15560
15717
  variant: {
15561
15718
  flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
15562
15719
  baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
15563
- 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"
15720
+ 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"
15564
15721
  },
15565
15722
  position: {
15566
15723
  fixed: "fixed",
@@ -15588,6 +15745,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15588
15745
  scrollContainerRef,
15589
15746
  activeIndicatorTransition,
15590
15747
  children,
15748
+ itemClassName,
15591
15749
  className,
15592
15750
  style
15593
15751
  }, ref) => {
@@ -15638,7 +15796,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15638
15796
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
15639
15797
  NavigationBarContext.Provider,
15640
15798
  {
15641
- value: { variant, itemLayout, activeIndicatorTransition },
15799
+ value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
15642
15800
  children: /* @__PURE__ */ jsxRuntime.jsx(
15643
15801
  react.m.nav,
15644
15802
  {
@@ -15659,7 +15817,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15659
15817
  "aria-orientation": "horizontal",
15660
15818
  className: cn(
15661
15819
  "flex w-full h-full mx-auto",
15662
- variant === "xr" ? "gap-0 min-[600px]:gap-1.5" : "max-w-7xl gap-1.5"
15820
+ variant === "xr" ? "gap-0 min-[600px]:gap-1.5 items-center justify-center px-1" : "max-w-7xl gap-1.5"
15663
15821
  ),
15664
15822
  children
15665
15823
  }
@@ -20755,6 +20913,7 @@ var TabsList = React59__namespace.memo(TabsListComponent);
20755
20913
  var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface", {
20756
20914
  variants: {
20757
20915
  variant: {
20916
+ // Short hyphenated
20758
20917
  "display-lg": "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
20759
20918
  "display-md": "text-[45px] leading-[52px] font-normal tracking-[0px]",
20760
20919
  "display-sm": "text-[36px] leading-[44px] font-normal tracking-[0px]",
@@ -20769,7 +20928,39 @@ var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface"
20769
20928
  "label-sm": "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
20770
20929
  "body-lg": "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
20771
20930
  "body-md": "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
20772
- "body-sm": "text-[12px] leading-[16px] font-normal tracking-[0.4px]"
20931
+ "body-sm": "text-[12px] leading-[16px] font-normal tracking-[0.4px]",
20932
+ // Full hyphenated aliases
20933
+ "display-large": "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
20934
+ "display-medium": "text-[45px] leading-[52px] font-normal tracking-[0px]",
20935
+ "display-small": "text-[36px] leading-[44px] font-normal tracking-[0px]",
20936
+ "headline-large": "text-[32px] leading-[40px] font-normal tracking-[0px]",
20937
+ "headline-medium": "text-[28px] leading-[36px] font-normal tracking-[0px]",
20938
+ "headline-small": "text-[24px] leading-[32px] font-normal tracking-[0px]",
20939
+ "title-large": "text-[22px] leading-[28px] font-normal tracking-[0px]",
20940
+ "title-medium": "text-[16px] leading-[24px] font-medium tracking-[0.15px]",
20941
+ "title-small": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
20942
+ "label-large": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
20943
+ "label-medium": "text-[12px] leading-[16px] font-medium tracking-[0.5px]",
20944
+ "label-small": "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
20945
+ "body-large": "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
20946
+ "body-medium": "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
20947
+ "body-small": "text-[12px] leading-[16px] font-normal tracking-[0.4px]",
20948
+ // CamelCase aliases
20949
+ displayLarge: "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
20950
+ displayMedium: "text-[45px] leading-[52px] font-normal tracking-[0px]",
20951
+ displaySmall: "text-[36px] leading-[44px] font-normal tracking-[0px]",
20952
+ headlineLarge: "text-[32px] leading-[40px] font-normal tracking-[0px]",
20953
+ headlineMedium: "text-[28px] leading-[36px] font-normal tracking-[0px]",
20954
+ headlineSmall: "text-[24px] leading-[32px] font-normal tracking-[0px]",
20955
+ titleLarge: "text-[22px] leading-[28px] font-normal tracking-[0px]",
20956
+ titleMedium: "text-[16px] leading-[24px] font-medium tracking-[0.15px]",
20957
+ titleSmall: "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
20958
+ labelLarge: "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
20959
+ labelMedium: "text-[12px] leading-[16px] font-medium tracking-[0.5px]",
20960
+ labelSmall: "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
20961
+ bodyLarge: "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
20962
+ bodyMedium: "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
20963
+ bodySmall: "text-[12px] leading-[16px] font-normal tracking-[0.4px]"
20773
20964
  }
20774
20965
  },
20775
20966
  defaultVariants: {
@@ -20778,19 +20969,21 @@ var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface"
20778
20969
  });
20779
20970
  var Text = React59__namespace.forwardRef(
20780
20971
  (_a, ref) => {
20781
- var _b = _a, { className, variant, as: Component } = _b, props = __objRest(_b, ["className", "variant", "as"]);
20972
+ var _b = _a, { className, variant, as: Component, color, weight, style } = _b, props = __objRest(_b, ["className", "variant", "as", "color", "weight", "style"]);
20782
20973
  const defaultComponent = React59__namespace.useMemo(() => {
20783
- if ((variant == null ? void 0 : variant.startsWith("display")) || (variant == null ? void 0 : variant.startsWith("headline")))
20784
- return "h1";
20785
- if (variant == null ? void 0 : variant.startsWith("title")) return "h2";
20974
+ const v = variant ? String(variant).toLowerCase() : "";
20975
+ if (v.startsWith("display") || v.startsWith("headline")) return "h1";
20976
+ if (v.startsWith("title")) return "h2";
20786
20977
  return "p";
20787
20978
  }, [variant]);
20788
20979
  const Tag = Component || defaultComponent;
20980
+ const customStyle = __spreadValues(__spreadValues(__spreadValues({}, style), color ? { color } : {}), weight ? { fontWeight: weight } : {});
20789
20981
  return /* @__PURE__ */ jsxRuntime.jsx(
20790
20982
  Tag,
20791
20983
  __spreadValues({
20792
20984
  ref,
20793
- className: cn(typographyVariants({ variant, className }))
20985
+ className: cn(typographyVariants({ variant, className })),
20986
+ style: customStyle
20794
20987
  }, props)
20795
20988
  );
20796
20989
  }
@@ -20915,7 +21108,6 @@ var FloatingLabel = React59__namespace.memo(function FloatingLabel2({
20915
21108
  "absolute pointer-events-none select-none origin-[left_center] leading-6 text-base whitespace-nowrap",
20916
21109
  "px-1 -mx-1",
20917
21110
  // Clear the notch gap and keep text aligned
20918
- variant === "outlined" && isFloated && "bg-m3-surface",
20919
21111
  "left-4",
20920
21112
  isDisabled && "opacity-[0.38]"
20921
21113
  ),
@@ -20991,7 +21183,8 @@ var OutlineContainer = React59__namespace.memo(function OutlineContainer2({
20991
21183
  );
20992
21184
  const borderWidth = isFocused || isError ? TF_SIZE.outlineThick : TF_SIZE.outlineThin;
20993
21185
  const leftSegmentWidth = TF_SIZE.paddingStart;
20994
- const notchWidth = isFloated ? labelWidth * TF_TYPOGRAPHY.labelScaleRatio + TF_SIZE.notchPadding * 2 : 0;
21186
+ const isNotched = isFloated && labelWidth > 0;
21187
+ const notchWidth = isNotched ? labelWidth * TF_TYPOGRAPHY.labelScaleRatio + TF_SIZE.notchPadding * 2 : 0;
20995
21188
  const borderTransition = { duration: colorDuration, ease };
20996
21189
  const notchTransition = { duration: notchDuration, ease };
20997
21190
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -21029,7 +21222,7 @@ var OutlineContainer = React59__namespace.memo(function OutlineContainer2({
21029
21222
  style: { height: borderWidth },
21030
21223
  animate: {
21031
21224
  borderTopColor: borderColor,
21032
- opacity: isFloated ? 0 : 1,
21225
+ opacity: isNotched ? 0 : 1,
21033
21226
  borderTopWidth: borderWidth,
21034
21227
  borderTopStyle: "solid"
21035
21228
  },
@@ -21481,7 +21674,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21481
21674
  const computedDescribedby = [hasSupporting ? supportingId : "", ariaDescribedby != null ? ariaDescribedby : ""].filter(Boolean).join(" ") || void 0;
21482
21675
  const inputClass = cn(
21483
21676
  "bg-transparent outline-none w-full",
21484
- isInToolbar ? "self-center" : "self-end",
21677
+ !resolvedLabel || isInToolbar ? "self-center" : "self-end",
21485
21678
  "text-base leading-6 text-m3-on-surface",
21486
21679
  "caret-[var(--color-m3-primary)]",
21487
21680
  "placeholder:text-m3-on-surface-variant/60",
@@ -21492,7 +21685,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21492
21685
  id: inputId,
21493
21686
  name,
21494
21687
  value: currentValue,
21495
- placeholder: isFloated ? placeholder != null ? placeholder : "" : "",
21688
+ placeholder: !resolvedLabel || isFloated ? placeholder != null ? placeholder : "" : "",
21496
21689
  disabled,
21497
21690
  readOnly,
21498
21691
  required,
@@ -21524,7 +21717,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21524
21717
  "relative flex flex-col flex-1 min-w-0 h-full",
21525
21718
  paddingStart,
21526
21719
  paddingEnd,
21527
- isInToolbar ? "justify-center" : variant === "filled" ? resolvedDense ? "pt-5 pb-2" : "pt-6 pb-2" : resolvedDense ? "py-3" : "py-4"
21720
+ isInToolbar || !resolvedLabel ? "justify-center" : variant === "filled" ? resolvedDense ? "pt-5 pb-2" : "pt-6 pb-2" : resolvedDense ? "py-3" : "py-4"
21528
21721
  );
21529
21722
  const wrapperClass = cn(
21530
21723
  "group/tf inline-flex flex-col",
@@ -22608,6 +22801,47 @@ var vibrantFloatingToolbarColors = {
22608
22801
  fabContainerColor: "var(--md-sys-color-tertiary-container)",
22609
22802
  fabContentColor: "var(--md-sys-color-on-tertiary-container)"
22610
22803
  };
22804
+ var surfaceContainerHighFloatingToolbarColors = {
22805
+ toolbarContainerColor: "var(--md-sys-color-surface-container-high)",
22806
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
22807
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
22808
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
22809
+ };
22810
+ var surfaceContainerHighestFloatingToolbarColors = {
22811
+ toolbarContainerColor: "var(--md-sys-color-surface-container-highest)",
22812
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
22813
+ fabContainerColor: "var(--md-sys-color-secondary-container)",
22814
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
22815
+ };
22816
+ var tertiaryContainerFloatingToolbarColors = {
22817
+ toolbarContainerColor: "var(--md-sys-color-tertiary-container)",
22818
+ toolbarContentColor: "var(--md-sys-color-on-tertiary-container)",
22819
+ fabContainerColor: "var(--md-sys-color-primary-container)",
22820
+ fabContentColor: "var(--md-sys-color-on-primary-container)"
22821
+ };
22822
+ var xrFloatingToolbarColors = {
22823
+ toolbarContainerColor: "color-mix(in srgb, var(--md-sys-color-surface-container-high) 80%, transparent)",
22824
+ toolbarContentColor: "var(--md-sys-color-on-surface)",
22825
+ fabContainerColor: "color-mix(in srgb, var(--md-sys-color-secondary-container) 85%, transparent)",
22826
+ fabContentColor: "var(--md-sys-color-on-secondary-container)"
22827
+ };
22828
+ function getToolbarColors(variant = "standard", customColors) {
22829
+ if (customColors) return customColors;
22830
+ switch (variant) {
22831
+ case "vibrant":
22832
+ return vibrantFloatingToolbarColors;
22833
+ case "surface-high":
22834
+ return surfaceContainerHighFloatingToolbarColors;
22835
+ case "surface-highest":
22836
+ return surfaceContainerHighestFloatingToolbarColors;
22837
+ case "tertiary":
22838
+ return tertiaryContainerFloatingToolbarColors;
22839
+ case "xr":
22840
+ return xrFloatingToolbarColors;
22841
+ default:
22842
+ return standardFloatingToolbarColors;
22843
+ }
22844
+ }
22611
22845
  var BottomDockedToolbar = React59__namespace.forwardRef(
22612
22846
  (_a, ref) => {
22613
22847
  var _b = _a, {
@@ -22637,7 +22871,7 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22637
22871
  "className",
22638
22872
  "aria-label"
22639
22873
  ]);
22640
- const colors = customColors || (variant === "vibrant" ? vibrantFloatingToolbarColors : standardFloatingToolbarColors);
22874
+ const colors = getToolbarColors(variant, customColors);
22641
22875
  const { scrollY } = react.useScroll(
22642
22876
  scrollContainerRef ? { container: scrollContainerRef } : void 0
22643
22877
  );
@@ -22666,6 +22900,7 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22666
22900
  full: "rounded-full"
22667
22901
  };
22668
22902
  const justifyClass = justify === "center" ? "justify-center gap-4" : "justify-between";
22903
+ const isXr = variant === "xr";
22669
22904
  return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation: "horizontal" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
22670
22905
  react.m.div,
22671
22906
  __spreadProps(__spreadValues({
@@ -22686,11 +22921,12 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22686
22921
  paddingRight: paddingX
22687
22922
  }),
22688
22923
  className: cn(
22689
- "fixed bottom-0 left-0 right-0 w-full z-40",
22924
+ "fixed bottom-0 left-0 right-0 w-full z-40 text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
22690
22925
  "flex items-center h-16",
22691
22926
  justifyClass,
22692
22927
  SHAPE_CLASSES[shape],
22693
- "shadow-[0_-1px_3px_rgba(0,0,0,0.1)] pointer-events-auto",
22928
+ isXr ? "backdrop-blur-md border-t border-white/10 shadow-lg" : "shadow-[0_-1px_3px_rgba(0,0,0,0.1)]",
22929
+ "pointer-events-auto",
22694
22930
  className
22695
22931
  )
22696
22932
  }, props), {
@@ -22737,6 +22973,13 @@ var ToolbarIconButtonTokens = {
22737
22973
  /** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
22738
22974
  IconSize: 28
22739
22975
  };
22976
+ var ToolbarToggleButtonTokens = {
22977
+ Height: 48,
22978
+ MinWidth: 95,
22979
+ IconSize: 24,
22980
+ PaddingX: 16,
22981
+ Gap: 8
22982
+ };
22740
22983
  var ALIGNMENT_CLASS = {
22741
22984
  start: "justify-start",
22742
22985
  center: "justify-center",
@@ -22795,7 +23038,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22795
23038
  var _b = _a, {
22796
23039
  expanded,
22797
23040
  orientation = "horizontal",
22798
- colors = standardFloatingToolbarColors,
23041
+ variant = "standard",
23042
+ colors: customColors,
22799
23043
  shape = "full",
22800
23044
  contentPadding,
22801
23045
  scrollBehavior,
@@ -22813,6 +23057,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22813
23057
  } = _b, props = __objRest(_b, [
22814
23058
  "expanded",
22815
23059
  "orientation",
23060
+ "variant",
22816
23061
  "colors",
22817
23062
  "shape",
22818
23063
  "contentPadding",
@@ -22829,6 +23074,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22829
23074
  "style",
22830
23075
  "aria-label"
22831
23076
  ]);
23077
+ const colors = getToolbarColors(variant, customColors);
22832
23078
  const isHorizontal = orientation === "horizontal";
22833
23079
  const isStringPadding = typeof contentPadding === "string";
22834
23080
  const cssVars = __spreadValues(__spreadValues({
@@ -22837,7 +23083,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22837
23083
  "--toolbar-size": `${FloatingToolbarTokens.ContainerHeight}px`
22838
23084
  }, isStringPadding ? {} : contentPadding), style);
22839
23085
  const isScrolledOff = scrollBehavior && scrollBehavior.offset < 0;
22840
- const shadowClass = expanded ? "shadow-md" : "shadow-sm";
23086
+ const isXr = variant === "xr";
23087
+ const shadowClass = isXr ? "shadow-lg border border-white/10 backdrop-blur-md" : expanded ? "shadow-md" : "shadow-sm";
22841
23088
  const containerShapeClass = shape === "full" ? "rounded-full" : "rounded-2xl";
22842
23089
  const leadingVariants = buildSlotVariants(
22843
23090
  isHorizontal ? "-100%" : 0,
@@ -22854,7 +23101,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22854
23101
  scrollBehavior,
22855
23102
  disableScrollTranslation
22856
23103
  );
22857
- return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation }, children: /* @__PURE__ */ jsxRuntime.jsx(
23104
+ return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation, itemClassName }, children: /* @__PURE__ */ jsxRuntime.jsx(
22858
23105
  react.m.div,
22859
23106
  {
22860
23107
  ref,
@@ -22876,8 +23123,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22876
23123
  color: "var(--toolbar-color)"
22877
23124
  }),
22878
23125
  className: cn(
22879
- "flex pointer-events-auto relative",
22880
- isHorizontal ? "max-w-[90vw] h-(--toolbar-size)" : "max-h-[90vh] w-(--toolbar-size) h-fit",
23126
+ "flex pointer-events-auto relative text-(--toolbar-color) [&_.text-m3-on-surface-variant]:text-current",
23127
+ isHorizontal ? "max-w-[min(90vw,100%)] h-(--toolbar-size)" : "max-h-[min(90vh,100%)] w-(--toolbar-size) h-fit",
22881
23128
  containerShapeClass,
22882
23129
  shadowClass,
22883
23130
  className
@@ -22894,11 +23141,11 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22894
23141
  "div",
22895
23142
  {
22896
23143
  className: cn(
22897
- "flex items-center gap-1 min-w-0 min-h-0",
23144
+ "flex items-center min-w-0 min-h-0",
22898
23145
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
22899
- isStringPadding ? contentPadding : isHorizontal ? "px-4" : "py-6"
23146
+ isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
22900
23147
  ),
22901
- style: isStringPadding ? void 0 : contentPadding,
23148
+ style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
22902
23149
  children: [
22903
23150
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsxRuntime.jsx(
22904
23151
  react.m.div,
@@ -22908,9 +23155,10 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22908
23155
  animate: "visible",
22909
23156
  exit: "hidden",
22910
23157
  className: cn(
22911
- "flex shrink-0 overflow-hidden",
23158
+ "flex shrink-0 items-center overflow-hidden",
22912
23159
  isHorizontal ? "flex-row" : "flex-col"
22913
23160
  ),
23161
+ style: { gap: itemGap },
22914
23162
  children: processNodes(startContent)
22915
23163
  },
22916
23164
  "start"
@@ -22935,9 +23183,10 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22935
23183
  animate: "visible",
22936
23184
  exit: "hidden",
22937
23185
  className: cn(
22938
- "flex shrink-0 overflow-hidden",
23186
+ "flex shrink-0 items-center overflow-hidden",
22939
23187
  isHorizontal ? "flex-row" : "flex-col"
22940
23188
  ),
23189
+ style: { gap: itemGap },
22941
23190
  children: processNodes(endContent)
22942
23191
  },
22943
23192
  "end"
@@ -22963,7 +23212,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22963
23212
  var _b = _a, {
22964
23213
  expanded,
22965
23214
  orientation = "horizontal",
22966
- colors = standardFloatingToolbarColors,
23215
+ variant = "standard",
23216
+ colors: customColors,
22967
23217
  floatingActionButton,
22968
23218
  fabPosition = orientation === "horizontal" ? "end" : "bottom",
22969
23219
  animationDuration = 0.3,
@@ -22974,6 +23224,7 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22974
23224
  } = _b, props = __objRest(_b, [
22975
23225
  "expanded",
22976
23226
  "orientation",
23227
+ "variant",
22977
23228
  "colors",
22978
23229
  "floatingActionButton",
22979
23230
  "fabPosition",
@@ -22983,6 +23234,7 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22983
23234
  "className",
22984
23235
  "style"
22985
23236
  ]);
23237
+ const colors = getToolbarColors(variant, customColors);
22986
23238
  const isHorizontal = orientation === "horizontal";
22987
23239
  const effectiveExpanded = expanded && (!scrollBehavior || scrollBehavior.isExpanded);
22988
23240
  const isFabBefore = fabPosition === "start" || fabPosition === "top";
@@ -23060,7 +23312,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
23060
23312
  expanded,
23061
23313
  colors,
23062
23314
  disableScrollTranslation: true,
23063
- disableLayoutAnimation: true
23315
+ disableLayoutAnimation: true,
23316
+ className: className ? cn("h-full", className) : void 0
23064
23317
  }, props)
23065
23318
  ) : /* @__PURE__ */ jsxRuntime.jsx(
23066
23319
  VerticalFloatingToolbar,
@@ -23068,7 +23321,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
23068
23321
  expanded,
23069
23322
  colors,
23070
23323
  disableScrollTranslation: true,
23071
- disableLayoutAnimation: true
23324
+ disableLayoutAnimation: true,
23325
+ className: className ? cn("w-full", className) : void 0
23072
23326
  }, props)
23073
23327
  )
23074
23328
  },
@@ -23098,7 +23352,7 @@ var ToolbarDivider = ({
23098
23352
  "aria-orientation": isHorizontalToolbar ? "vertical" : "horizontal",
23099
23353
  className: cn(
23100
23354
  "shrink-0 bg-current opacity-30 border-none",
23101
- isHorizontalToolbar ? "w-px h-8 self-center mx-2" : "h-px w-8 self-center my-2",
23355
+ isHorizontalToolbar ? "w-px h-8 self-center mx-1" : "h-px w-8 self-center my-1",
23102
23356
  className
23103
23357
  ),
23104
23358
  style: {
@@ -23121,20 +23375,47 @@ var VARIANT_TO_COLOR_STYLE = {
23121
23375
  };
23122
23376
  var ToolbarIconButton = React59__namespace.forwardRef(
23123
23377
  (_a, ref) => {
23124
- var _b = _a, { emphasis = "standard", toolbarSize = "default", className } = _b, props = __objRest(_b, ["emphasis", "toolbarSize", "className"]);
23378
+ var _b = _a, {
23379
+ emphasis = "standard",
23380
+ toolbarSize = "default",
23381
+ selected,
23382
+ asChild,
23383
+ className
23384
+ } = _b, props = __objRest(_b, [
23385
+ "emphasis",
23386
+ "toolbarSize",
23387
+ "selected",
23388
+ "asChild",
23389
+ "className"
23390
+ ]);
23391
+ const context = useToolbarContext();
23125
23392
  const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
23126
23393
  const colorStyle = VARIANT_TO_COLOR_STYLE[emphasis];
23394
+ const iconButtonProps = selected !== void 0 ? {
23395
+ variant: "toggle",
23396
+ selected: Boolean(selected)
23397
+ } : {
23398
+ variant: "default"
23399
+ };
23127
23400
  return /* @__PURE__ */ jsxRuntime.jsx(
23128
23401
  IconButton,
23129
- __spreadValues({
23402
+ __spreadValues(__spreadProps(__spreadValues({
23130
23403
  ref,
23131
- variant: "default",
23404
+ asChild,
23132
23405
  colorStyle,
23133
23406
  size: "md",
23134
23407
  shape: "round",
23135
- iconSize: ToolbarIconButtonTokens.IconSize,
23136
- className: cn("h-[48px]", widthClass, className)
23137
- }, props)
23408
+ iconSize: ToolbarIconButtonTokens.IconSize
23409
+ }, iconButtonProps), {
23410
+ className: cn(
23411
+ "h-[48px]",
23412
+ widthClass,
23413
+ emphasis === "standard" && !selected && "text-current hover:bg-current/8 active:bg-current/12",
23414
+ emphasis === "standard" && selected && "bg-current/16 text-current hover:bg-current/20 active:bg-current/24",
23415
+ context == null ? void 0 : context.itemClassName,
23416
+ className
23417
+ )
23418
+ }), props)
23138
23419
  );
23139
23420
  }
23140
23421
  );
@@ -23205,6 +23486,195 @@ function useFloatingToolbarScrollBehavior(options = {}) {
23205
23486
  exitDirection
23206
23487
  };
23207
23488
  }
23489
+ var MOTION_PROP_KEYS2 = [
23490
+ "animate",
23491
+ "exit",
23492
+ "initial",
23493
+ "transition",
23494
+ "variants",
23495
+ "whileHover",
23496
+ "whileTap",
23497
+ "whileFocus",
23498
+ "whileDrag",
23499
+ "whileInView",
23500
+ "onAnimationStart",
23501
+ "onAnimationComplete",
23502
+ "onUpdate",
23503
+ "onDragStart",
23504
+ "onDragEnd",
23505
+ "onDrag",
23506
+ "onDirectionLock",
23507
+ "onDragTransitionEnd",
23508
+ "layout",
23509
+ "layoutId",
23510
+ "onLayoutAnimationComplete"
23511
+ ];
23512
+ var ToolbarToggleButton = React59__namespace.forwardRef(
23513
+ (_a, ref) => {
23514
+ var _b = _a, {
23515
+ emphasis = "standard",
23516
+ selected = false,
23517
+ icon,
23518
+ children,
23519
+ pressScale = 0.95,
23520
+ pressBounceOffset = 6,
23521
+ ripple = true,
23522
+ asChild = false,
23523
+ className,
23524
+ type = "button",
23525
+ disabled,
23526
+ onPointerDown: onPointerDownProp
23527
+ } = _b, props = __objRest(_b, [
23528
+ "emphasis",
23529
+ "selected",
23530
+ "icon",
23531
+ "children",
23532
+ "pressScale",
23533
+ "pressBounceOffset",
23534
+ "ripple",
23535
+ "asChild",
23536
+ "className",
23537
+ "type",
23538
+ "disabled",
23539
+ "onPointerDown"
23540
+ ]);
23541
+ const context = useToolbarContext();
23542
+ const {
23543
+ ripples,
23544
+ onPointerDown: handleRipplePointerDown,
23545
+ removeRipple
23546
+ } = useRippleState({
23547
+ disabled: Boolean(disabled) || !ripple
23548
+ });
23549
+ const handlePointerDown = React59__namespace.useCallback(
23550
+ (e) => {
23551
+ if (!disabled && ripple) {
23552
+ handleRipplePointerDown(e);
23553
+ }
23554
+ onPointerDownProp == null ? void 0 : onPointerDownProp(e);
23555
+ },
23556
+ [disabled, ripple, handleRipplePointerDown, onPointerDownProp]
23557
+ );
23558
+ 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";
23559
+ const variantClasses = {
23560
+ 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",
23561
+ 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",
23562
+ 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"
23563
+ };
23564
+ const combinedClassName = cn(
23565
+ baseClasses,
23566
+ variantClasses[emphasis],
23567
+ context == null ? void 0 : context.itemClassName,
23568
+ className
23569
+ );
23570
+ const whileTapConfig = React59__namespace.useMemo(
23571
+ () => ({
23572
+ scale: pressScale,
23573
+ x: pressBounceOffset ? [
23574
+ 0,
23575
+ -pressBounceOffset,
23576
+ pressBounceOffset,
23577
+ -pressBounceOffset / 2,
23578
+ pressBounceOffset / 2,
23579
+ 0
23580
+ ] : 0
23581
+ }),
23582
+ [pressScale, pressBounceOffset]
23583
+ );
23584
+ const transitionConfig = React59__namespace.useMemo(
23585
+ () => ({
23586
+ scale: FAST_SPATIAL_SPRING,
23587
+ x: {
23588
+ duration: 0.35,
23589
+ ease: "easeInOut"
23590
+ }
23591
+ }),
23592
+ []
23593
+ );
23594
+ const mainContent = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center justify-center h-full gap-2", children: [
23595
+ icon && /* @__PURE__ */ jsxRuntime.jsx(
23596
+ "span",
23597
+ {
23598
+ className: "shrink-0 inline-flex items-center justify-center",
23599
+ style: {
23600
+ width: ToolbarToggleButtonTokens.IconSize,
23601
+ height: ToolbarToggleButtonTokens.IconSize
23602
+ },
23603
+ children: icon
23604
+ }
23605
+ ),
23606
+ children && (typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : children)
23607
+ ] });
23608
+ if (asChild) {
23609
+ const child = React59__namespace.Children.only(children);
23610
+ const childContent = child.props.children;
23611
+ const innerChildContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23612
+ ripple && /* @__PURE__ */ jsxRuntime.jsx(
23613
+ Ripple,
23614
+ {
23615
+ ripples,
23616
+ onRippleDone: removeRipple,
23617
+ disabled
23618
+ }
23619
+ ),
23620
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center h-full gap-2", children: icon ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
23621
+ /* @__PURE__ */ jsxRuntime.jsx(
23622
+ "span",
23623
+ {
23624
+ className: "shrink-0 inline-flex items-center justify-center",
23625
+ style: {
23626
+ width: ToolbarToggleButtonTokens.IconSize,
23627
+ height: ToolbarToggleButtonTokens.IconSize
23628
+ },
23629
+ children: icon
23630
+ }
23631
+ ),
23632
+ typeof childContent === "string" || typeof childContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: childContent }) : childContent
23633
+ ] }) : childContent })
23634
+ ] });
23635
+ const strippedProps = __spreadValues({}, props);
23636
+ for (const key of MOTION_PROP_KEYS2) delete strippedProps[key];
23637
+ delete strippedProps.children;
23638
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
23639
+ reactSlot.Slot,
23640
+ __spreadProps(__spreadValues({
23641
+ ref,
23642
+ "aria-pressed": selected,
23643
+ className: combinedClassName,
23644
+ onPointerDown: handlePointerDown
23645
+ }, strippedProps), {
23646
+ children: React59__namespace.cloneElement(child, { children: innerChildContent })
23647
+ })
23648
+ ) });
23649
+ }
23650
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
23651
+ react.m.button,
23652
+ __spreadProps(__spreadValues({
23653
+ ref,
23654
+ type,
23655
+ "aria-pressed": selected,
23656
+ disabled,
23657
+ whileTap: whileTapConfig,
23658
+ transition: transitionConfig,
23659
+ onPointerDown: handlePointerDown,
23660
+ className: combinedClassName
23661
+ }, props), {
23662
+ children: [
23663
+ ripple && /* @__PURE__ */ jsxRuntime.jsx(
23664
+ Ripple,
23665
+ {
23666
+ ripples,
23667
+ onRippleDone: removeRipple,
23668
+ disabled
23669
+ }
23670
+ ),
23671
+ mainContent
23672
+ ]
23673
+ })
23674
+ ) });
23675
+ }
23676
+ );
23677
+ ToolbarToggleButton.displayName = "ToolbarToggleButton";
23208
23678
 
23209
23679
  // src/ui/tooltip/tooltip.tokens.ts
23210
23680
  var TooltipTokens = {
@@ -24002,6 +24472,8 @@ exports.ToolbarDivider = ToolbarDivider;
24002
24472
  exports.ToolbarDividerTokens = ToolbarDividerTokens;
24003
24473
  exports.ToolbarIconButton = ToolbarIconButton;
24004
24474
  exports.ToolbarIconButtonTokens = ToolbarIconButtonTokens;
24475
+ exports.ToolbarToggleButton = ToolbarToggleButton;
24476
+ exports.ToolbarToggleButtonTokens = ToolbarToggleButtonTokens;
24005
24477
  exports.TooltipBox = TooltipBox;
24006
24478
  exports.TooltipCaretShape = TooltipCaretShape;
24007
24479
  exports.TooltipTokens = TooltipTokens;
@@ -24045,6 +24517,7 @@ exports.getDistance = getDistance;
24045
24517
  exports.getDistanceSquared = getDistanceSquared;
24046
24518
  exports.getExpressiveShape = getExpressiveShape;
24047
24519
  exports.getListItemHeight = getListItemHeight;
24520
+ exports.getToolbarColors = getToolbarColors;
24048
24521
  exports.interpolate = interpolate;
24049
24522
  exports.interpolatePath = interpolatePath;
24050
24523
  exports.lerpPoint = lerpPoint;
@@ -24062,6 +24535,9 @@ exports.square = square;
24062
24535
  exports.standardFloatingToolbarColors = standardFloatingToolbarColors;
24063
24536
  exports.star = star;
24064
24537
  exports.subtractPoints = subtractPoints;
24538
+ exports.surfaceContainerHighFloatingToolbarColors = surfaceContainerHighFloatingToolbarColors;
24539
+ exports.surfaceContainerHighestFloatingToolbarColors = surfaceContainerHighestFloatingToolbarColors;
24540
+ exports.tertiaryContainerFloatingToolbarColors = tertiaryContainerFloatingToolbarColors;
24065
24541
  exports.toClipPath = toClipPath;
24066
24542
  exports.toSvgPath = toSvgPath;
24067
24543
  exports.transformFeature = transformFeature;
@@ -24088,5 +24564,6 @@ exports.useTooltipPosition = useTooltipPosition;
24088
24564
  exports.useTooltipState = useTooltipState;
24089
24565
  exports.useTypography = useTypography;
24090
24566
  exports.vibrantFloatingToolbarColors = vibrantFloatingToolbarColors;
24567
+ exports.xrFloatingToolbarColors = xrFloatingToolbarColors;
24091
24568
  //# sourceMappingURL=index.js.map
24092
24569
  //# sourceMappingURL=index.js.map