@bug-on/m3-expressive 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +708 -606
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +707 -605
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core-Bc5Wj_pc.d.ts +497 -0
  9. package/dist/core-D4048_K5.d.mts +497 -0
  10. package/dist/core.d.mts +6 -422
  11. package/dist/core.d.ts +6 -422
  12. package/dist/core.js +223 -129
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +224 -130
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/feedback.js +85 -61
  17. package/dist/feedback.js.map +1 -1
  18. package/dist/feedback.mjs +85 -61
  19. package/dist/feedback.mjs.map +1 -1
  20. package/dist/forms.d.mts +2 -2
  21. package/dist/forms.d.ts +2 -2
  22. package/dist/forms.js +70 -8
  23. package/dist/forms.js.map +1 -1
  24. package/dist/forms.mjs +70 -8
  25. package/dist/forms.mjs.map +1 -1
  26. package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
  27. package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
  28. package/dist/index.css +6 -1
  29. package/dist/index.d.mts +68 -6
  30. package/dist/index.d.ts +68 -6
  31. package/dist/index.js +1177 -580
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +1172 -583
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/layout.d.mts +18 -1
  36. package/dist/layout.d.ts +18 -1
  37. package/dist/layout.js +94 -8
  38. package/dist/layout.js.map +1 -1
  39. package/dist/layout.mjs +94 -8
  40. package/dist/layout.mjs.map +1 -1
  41. package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
  42. package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -1
  43. package/dist/navigation.d.mts +134 -9
  44. package/dist/navigation.d.ts +134 -9
  45. package/dist/navigation.js +403 -93
  46. package/dist/navigation.js.map +1 -1
  47. package/dist/navigation.mjs +397 -94
  48. package/dist/navigation.mjs.map +1 -1
  49. package/dist/overlays.js +214 -189
  50. package/dist/overlays.js.map +1 -1
  51. package/dist/overlays.mjs +176 -151
  52. package/dist/overlays.mjs.map +1 -1
  53. package/dist/pickers.js +222 -197
  54. package/dist/pickers.js.map +1 -1
  55. package/dist/pickers.mjs +189 -164
  56. package/dist/pickers.mjs.map +1 -1
  57. package/dist/{split-button-trailing-uncheckable-BRPuTqi1.d.mts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +73 -7
  58. package/dist/{split-button-trailing-uncheckable-CjOFCoyW.d.ts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +73 -7
  59. package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
  60. package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
  61. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@
2
2
  'use strict';
3
3
 
4
4
  var React59 = require('react');
5
- var jsxRuntime = require('react/jsx-runtime');
6
5
  var materialColorUtilities = require('@material/material-color-utilities');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
7
  var clsx = require('clsx');
8
8
  var tailwindMerge = require('tailwind-merge');
9
9
  var RxContextMenu = require('@radix-ui/react-context-menu');
@@ -143,6 +143,143 @@ function useRipple(options = {}) {
143
143
  );
144
144
  return { rippleRef: ref, onPointerDown };
145
145
  }
146
+ function resolveMode(mode) {
147
+ if (mode !== "system") return mode;
148
+ if (typeof window === "undefined") return "light";
149
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
150
+ }
151
+ function createDynamicScheme(sourceColorHex, isDark, variant = "expressive", contrastLevel = 0) {
152
+ const hct = materialColorUtilities.Hct.fromInt(argbFromHex(sourceColorHex));
153
+ const spec = "2025";
154
+ switch (variant) {
155
+ case "tonal_spot":
156
+ return new materialColorUtilities.SchemeTonalSpot(hct, isDark, contrastLevel, spec);
157
+ case "vibrant":
158
+ return new materialColorUtilities.SchemeVibrant(hct, isDark, contrastLevel, spec);
159
+ case "fidelity":
160
+ return new materialColorUtilities.SchemeFidelity(hct, isDark, contrastLevel, spec);
161
+ case "content":
162
+ return new materialColorUtilities.SchemeContent(hct, isDark, contrastLevel, spec);
163
+ case "monochrome":
164
+ return new materialColorUtilities.SchemeMonochrome(hct, isDark, contrastLevel, spec);
165
+ case "neutral":
166
+ return new materialColorUtilities.SchemeNeutral(hct, isDark, contrastLevel, spec);
167
+ default:
168
+ return new materialColorUtilities.SchemeExpressive(hct, isDark, contrastLevel, spec);
169
+ }
170
+ }
171
+ function argbFromHex(hex) {
172
+ const sanitized = hex.replace(/^#/, "");
173
+ const r = Number.parseInt(sanitized.substring(0, 2), 16);
174
+ const g = Number.parseInt(sanitized.substring(2, 4), 16);
175
+ const b = Number.parseInt(sanitized.substring(4, 6), 16);
176
+ return (4278190080 | r << 16 | g << 8 | b) >>> 0;
177
+ }
178
+ function generateM3Theme(sourceColorHex, mode = "light", options = {}) {
179
+ const { variant = "expressive", contrastLevel = 0 } = options;
180
+ const isDark = mode === "dark";
181
+ const scheme = createDynamicScheme(
182
+ sourceColorHex,
183
+ isDark,
184
+ variant,
185
+ contrastLevel
186
+ );
187
+ const hex = (argb) => materialColorUtilities.hexFromArgb(argb);
188
+ return {
189
+ // Primary
190
+ primary: hex(scheme.primary),
191
+ onPrimary: hex(scheme.onPrimary),
192
+ primaryContainer: hex(scheme.primaryContainer),
193
+ onPrimaryContainer: hex(scheme.onPrimaryContainer),
194
+ inversePrimary: hex(scheme.inversePrimary),
195
+ primaryFixed: hex(scheme.primaryFixed),
196
+ primaryFixedDim: hex(scheme.primaryFixedDim),
197
+ onPrimaryFixed: hex(scheme.onPrimaryFixed),
198
+ onPrimaryFixedVariant: hex(scheme.onPrimaryFixedVariant),
199
+ primaryDim: hex(scheme.primaryDim),
200
+ // Secondary
201
+ secondary: hex(scheme.secondary),
202
+ onSecondary: hex(scheme.onSecondary),
203
+ secondaryContainer: hex(scheme.secondaryContainer),
204
+ onSecondaryContainer: hex(scheme.onSecondaryContainer),
205
+ secondaryFixed: hex(scheme.secondaryFixed),
206
+ secondaryFixedDim: hex(scheme.secondaryFixedDim),
207
+ onSecondaryFixed: hex(scheme.onSecondaryFixed),
208
+ onSecondaryFixedVariant: hex(scheme.onSecondaryFixedVariant),
209
+ secondaryDim: hex(scheme.secondaryDim),
210
+ // Tertiary
211
+ tertiary: hex(scheme.tertiary),
212
+ onTertiary: hex(scheme.onTertiary),
213
+ tertiaryContainer: hex(scheme.tertiaryContainer),
214
+ onTertiaryContainer: hex(scheme.onTertiaryContainer),
215
+ tertiaryFixed: hex(scheme.tertiaryFixed),
216
+ tertiaryFixedDim: hex(scheme.tertiaryFixedDim),
217
+ onTertiaryFixed: hex(scheme.onTertiaryFixed),
218
+ onTertiaryFixedVariant: hex(scheme.onTertiaryFixedVariant),
219
+ tertiaryDim: hex(scheme.tertiaryDim),
220
+ // Error
221
+ error: hex(scheme.error),
222
+ onError: hex(scheme.onError),
223
+ errorContainer: hex(scheme.errorContainer),
224
+ onErrorContainer: hex(scheme.onErrorContainer),
225
+ // Surface
226
+ surface: hex(scheme.surface),
227
+ onSurface: hex(scheme.onSurface),
228
+ surfaceVariant: hex(scheme.surfaceVariant),
229
+ onSurfaceVariant: hex(scheme.onSurfaceVariant),
230
+ surfaceTint: hex(scheme.surfaceTint),
231
+ surfaceDim: hex(scheme.surfaceDim),
232
+ surfaceBright: hex(scheme.surfaceBright),
233
+ surfaceContainerLowest: hex(scheme.surfaceContainerLowest),
234
+ surfaceContainerLow: hex(scheme.surfaceContainerLow),
235
+ surfaceContainer: hex(scheme.surfaceContainer),
236
+ surfaceContainerHigh: hex(scheme.surfaceContainerHigh),
237
+ surfaceContainerHighest: hex(scheme.surfaceContainerHighest),
238
+ // Inverse
239
+ inverseSurface: hex(scheme.inverseSurface),
240
+ inverseOnSurface: hex(scheme.inverseOnSurface),
241
+ // Background
242
+ background: hex(scheme.background),
243
+ onBackground: hex(scheme.onBackground),
244
+ // Outline
245
+ outline: hex(scheme.outline),
246
+ outlineVariant: hex(scheme.outlineVariant),
247
+ // Utility
248
+ shadow: hex(scheme.shadow),
249
+ scrim: hex(scheme.scrim)
250
+ };
251
+ }
252
+ function applyTheme(sourceColorHex, mode = "light", root = document.documentElement, options = {}) {
253
+ const resolved = resolveMode(mode);
254
+ const colors = generateM3Theme(sourceColorHex, resolved, options);
255
+ for (const [key, value] of Object.entries(colors)) {
256
+ const kebabKey = key.replace(/[A-Z]/g, (m68) => `-${m68.toLowerCase()}`);
257
+ root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
258
+ root.style.setProperty(`--color-m3-${kebabKey}`, value);
259
+ }
260
+ root.setAttribute("data-theme", resolved);
261
+ }
262
+
263
+ // src/lib/create-theme.ts
264
+ function createMd3ExpressiveTheme(options) {
265
+ const { seedColor, isDark = false, variant, contrastLevel } = options;
266
+ const themeOptions = { variant, contrastLevel };
267
+ const colorScheme = generateM3Theme(
268
+ seedColor,
269
+ isDark ? "dark" : "light",
270
+ themeOptions
271
+ );
272
+ const cssVariables = schemeToCssVariables(colorScheme);
273
+ return { cssVariables, colorScheme };
274
+ }
275
+ function schemeToCssVariables(scheme) {
276
+ const result = {};
277
+ for (const [key, value] of Object.entries(scheme)) {
278
+ const kebabKey = key.replace(/[A-Z]/g, (m68) => `-${m68.toLowerCase()}`);
279
+ result[`--md-sys-color-${kebabKey}`] = value;
280
+ }
281
+ return result;
282
+ }
146
283
  function MaterialSymbolsPreconnect({
147
284
  variants = ["outlined"]
148
285
  }) {
@@ -182,78 +319,6 @@ function MaterialSymbolsPreconnect({
182
319
  )
183
320
  ] });
184
321
  }
185
- function resolveMode(mode) {
186
- if (mode !== "system") return mode;
187
- if (typeof window === "undefined") return "light";
188
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
189
- }
190
- function generateM3Theme(sourceColorHex, mode = "light") {
191
- const sourceColor = materialColorUtilities.argbFromHex(sourceColorHex);
192
- const theme = materialColorUtilities.themeFromSourceColor(sourceColor);
193
- const scheme = mode === "light" ? theme.schemes.light : theme.schemes.dark;
194
- const palettes = theme.palettes;
195
- const tone = (palette, t) => materialColorUtilities.hexFromArgb(palette.tone(t));
196
- return {
197
- primary: materialColorUtilities.hexFromArgb(scheme.primary),
198
- onPrimary: materialColorUtilities.hexFromArgb(scheme.onPrimary),
199
- primaryContainer: materialColorUtilities.hexFromArgb(scheme.primaryContainer),
200
- onPrimaryContainer: materialColorUtilities.hexFromArgb(scheme.onPrimaryContainer),
201
- inversePrimary: materialColorUtilities.hexFromArgb(scheme.inversePrimary),
202
- primaryFixed: tone(palettes.primary, 90),
203
- primaryFixedDim: tone(palettes.primary, 80),
204
- onPrimaryFixed: tone(palettes.primary, 10),
205
- onPrimaryFixedVariant: tone(palettes.primary, 30),
206
- secondary: materialColorUtilities.hexFromArgb(scheme.secondary),
207
- onSecondary: materialColorUtilities.hexFromArgb(scheme.onSecondary),
208
- secondaryContainer: materialColorUtilities.hexFromArgb(scheme.secondaryContainer),
209
- onSecondaryContainer: materialColorUtilities.hexFromArgb(scheme.onSecondaryContainer),
210
- secondaryFixed: tone(palettes.secondary, 90),
211
- secondaryFixedDim: tone(palettes.secondary, 80),
212
- onSecondaryFixed: tone(palettes.secondary, 10),
213
- onSecondaryFixedVariant: tone(palettes.secondary, 30),
214
- tertiary: materialColorUtilities.hexFromArgb(scheme.tertiary),
215
- onTertiary: materialColorUtilities.hexFromArgb(scheme.onTertiary),
216
- tertiaryContainer: materialColorUtilities.hexFromArgb(scheme.tertiaryContainer),
217
- onTertiaryContainer: materialColorUtilities.hexFromArgb(scheme.onTertiaryContainer),
218
- tertiaryFixed: tone(palettes.tertiary, 90),
219
- tertiaryFixedDim: tone(palettes.tertiary, 80),
220
- onTertiaryFixed: tone(palettes.tertiary, 10),
221
- onTertiaryFixedVariant: tone(palettes.tertiary, 30),
222
- error: materialColorUtilities.hexFromArgb(scheme.error),
223
- onError: materialColorUtilities.hexFromArgb(scheme.onError),
224
- errorContainer: materialColorUtilities.hexFromArgb(scheme.errorContainer),
225
- onErrorContainer: materialColorUtilities.hexFromArgb(scheme.onErrorContainer),
226
- surface: materialColorUtilities.hexFromArgb(scheme.surface),
227
- onSurface: materialColorUtilities.hexFromArgb(scheme.onSurface),
228
- surfaceVariant: materialColorUtilities.hexFromArgb(scheme.surfaceVariant),
229
- onSurfaceVariant: materialColorUtilities.hexFromArgb(scheme.onSurfaceVariant),
230
- surfaceTint: materialColorUtilities.hexFromArgb(scheme.primary),
231
- // Surface container roles from neutral palette tones
232
- surfaceContainerLowest: mode === "light" ? tone(palettes.neutral, 100) : tone(palettes.neutral, 4),
233
- surfaceContainerLow: mode === "light" ? tone(palettes.neutral, 96) : tone(palettes.neutral, 10),
234
- surfaceContainer: mode === "light" ? tone(palettes.neutral, 94) : tone(palettes.neutral, 12),
235
- surfaceContainerHigh: mode === "light" ? tone(palettes.neutral, 92) : tone(palettes.neutral, 17),
236
- surfaceContainerHighest: mode === "light" ? tone(palettes.neutral, 90) : tone(palettes.neutral, 22),
237
- inverseSurface: materialColorUtilities.hexFromArgb(scheme.inverseSurface),
238
- inverseOnSurface: materialColorUtilities.hexFromArgb(scheme.inverseOnSurface),
239
- background: materialColorUtilities.hexFromArgb(scheme.background),
240
- onBackground: materialColorUtilities.hexFromArgb(scheme.onBackground),
241
- outline: materialColorUtilities.hexFromArgb(scheme.outline),
242
- outlineVariant: materialColorUtilities.hexFromArgb(scheme.outlineVariant),
243
- shadow: materialColorUtilities.hexFromArgb(scheme.shadow),
244
- scrim: materialColorUtilities.hexFromArgb(scheme.scrim)
245
- };
246
- }
247
- function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
248
- const resolved = resolveMode(mode);
249
- const colors = generateM3Theme(sourceColorHex, resolved);
250
- for (const [key, value] of Object.entries(colors)) {
251
- const kebabKey = key.replace(/[A-Z]/g, (m67) => `-${m67.toLowerCase()}`);
252
- root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
253
- root.style.setProperty(`--color-m3-${kebabKey}`, value);
254
- }
255
- root.setAttribute("data-theme", resolved);
256
- }
257
322
  function cn(...inputs) {
258
323
  return tailwindMerge.twMerge(clsx.clsx(inputs));
259
324
  }
@@ -1047,8 +1112,8 @@ var RoundedPolygon = class _RoundedPolygon {
1047
1112
  );
1048
1113
  const mid = c.pointOnCurve(0.5);
1049
1114
  const md = distanceSquared(mid.x - this.centerX, mid.y - this.centerY);
1050
- const m67 = Math.max(ad, md);
1051
- if (m67 > maxDistSq) maxDistSq = m67;
1115
+ const m68 = Math.max(ad, md);
1116
+ if (m68 > maxDistSq) maxDistSq = m68;
1052
1117
  }
1053
1118
  const d = Math.sqrt(maxDistSq);
1054
1119
  return [
@@ -6584,6 +6649,35 @@ var BUTTON_COLOR_TOKENS = {
6584
6649
  default: "bg-transparent text-m3-primary",
6585
6650
  selected: "bg-transparent text-m3-primary",
6586
6651
  unselected: "bg-transparent text-m3-primary"
6652
+ },
6653
+ // ── MD3 Expressive accent variants ──────────────────────────────────────
6654
+ /**
6655
+ * High-chroma tertiary tone. Use for hero CTAs and expressive moments where
6656
+ * a distinct accent beyond primary is needed (e.g., hero chip, highlight fab).
6657
+ */
6658
+ tertiary: {
6659
+ default: "bg-m3-tertiary text-m3-on-tertiary",
6660
+ selected: "bg-m3-tertiary text-m3-on-tertiary",
6661
+ unselected: "bg-m3-tertiary-container text-m3-on-tertiary-container"
6662
+ },
6663
+ /**
6664
+ * Brand-stable primary fixed. Hue stays consistent across light and dark modes.
6665
+ * Ideal for badges, pill chips, and elements that must carry the brand color
6666
+ * regardless of the active theme.
6667
+ */
6668
+ "primary-fixed": {
6669
+ default: "bg-m3-primary-fixed text-m3-on-primary-fixed",
6670
+ selected: "bg-m3-primary-fixed text-m3-on-primary-fixed",
6671
+ unselected: "bg-m3-primary-fixed text-m3-on-primary-fixed-variant"
6672
+ },
6673
+ /**
6674
+ * Brand-stable tertiary fixed. Use for special-state indicators, achievement
6675
+ * badges, or accent pills that need a fixed tertiary hue across themes.
6676
+ */
6677
+ "tertiary-fixed": {
6678
+ default: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed",
6679
+ selected: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed",
6680
+ unselected: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed-variant"
6587
6681
  }
6588
6682
  };
6589
6683
  var MOTION_PROP_KEYS = [
@@ -6955,7 +7049,7 @@ var PILL_BORDER_RADIUS = 9999;
6955
7049
  var MIN_FLEX_GROW = 0.01;
6956
7050
  var PADDING_EXPAND_MULTIPLIER = 4;
6957
7051
  var CHECK_ICON_SIZE = 24;
6958
- var CHECK_ICON = /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", size: CHECK_ICON_SIZE, weight: 700 });
7052
+ var CHECK_ICON = /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", variant: "rounded", size: CHECK_ICON_SIZE, weight: 700 });
6959
7053
  var CHECK_ICON_GAP_MAP = {
6960
7054
  xs: 6,
6961
7055
  sm: 8,
@@ -6975,12 +7069,6 @@ var WIDTH_MORPH_SPRING = {
6975
7069
  damping: 38,
6976
7070
  mass: 0.85
6977
7071
  };
6978
- var NAVBAR_EXPRESSIVE_SPRING = {
6979
- type: "spring",
6980
- stiffness: 430,
6981
- damping: 38,
6982
- mass: 0.8
6983
- };
6984
7072
  var AnimatedCheckLabel = React59__namespace.memo(function AnimatedCheckLabel2({
6985
7073
  selected,
6986
7074
  size,
@@ -7018,23 +7106,6 @@ var AnimatedCheckLabel = React59__namespace.memo(function AnimatedCheckLabel2({
7018
7106
  }
7019
7107
  );
7020
7108
  });
7021
- var AnimatedNavbarLabel = React59__namespace.memo(function AnimatedNavbarLabel2({
7022
- show,
7023
- children
7024
- }) {
7025
- return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "popLayout", children: show && /* @__PURE__ */ jsxRuntime.jsx(
7026
- react.m.span,
7027
- {
7028
- initial: { width: 0, opacity: 0, scale: 0.8 },
7029
- animate: { width: "auto", opacity: 1, scale: 1 },
7030
- exit: { width: 0, opacity: 0, scale: 0.8 },
7031
- transition: NAVBAR_EXPRESSIVE_SPRING,
7032
- className: "overflow-hidden whitespace-nowrap text-sm font-semibold tracking-[0.01em] ml-1.5",
7033
- children
7034
- },
7035
- "navbar-label"
7036
- ) });
7037
- });
7038
7109
  function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize) {
7039
7110
  const defaults = ButtonGroupDefaults.connectedLeadingButtonShapes(itemSize);
7040
7111
  if (variant !== "connected") return defaults;
@@ -7055,7 +7126,7 @@ function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize)
7055
7126
  }
7056
7127
  return defaults;
7057
7128
  }
7058
- function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck, iconBehavior, labelBehavior) {
7129
+ function resolveIconAndLabel(element, isSelected, itemSize, showCheck, iconBehavior, labelBehavior) {
7059
7130
  let icon = element.props.icon;
7060
7131
  let label = element.props.children;
7061
7132
  const animateCheckInLabel = showCheck && iconBehavior !== "none" && iconBehavior !== "selected" && label !== void 0;
@@ -7071,9 +7142,6 @@ function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck,
7071
7142
  }
7072
7143
  if (animateCheckInLabel && label !== void 0) {
7073
7144
  label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedCheckLabel, { selected: isSelected, size: itemSize, children: label });
7074
- } else if (variant === "navbar" && label !== void 0) {
7075
- const showLabel = !labelBehavior || labelBehavior === "all" || labelBehavior === "selected" && isSelected;
7076
- label = /* @__PURE__ */ jsxRuntime.jsx(AnimatedNavbarLabel, { show: showLabel, children: label });
7077
7145
  }
7078
7146
  return { icon, label };
7079
7147
  }
@@ -7108,13 +7176,11 @@ function resolveFlexTargets(variant, orientation, isSelected, isPressed, hasSele
7108
7176
  function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex, existingAnimate, existingWhileTap) {
7109
7177
  var _a, _b;
7110
7178
  const props = { animate: __spreadValues({}, existingAnimate) };
7111
- if (variant !== "navbar") {
7112
- if (flex.flexGrow !== void 0) {
7113
- props.animate.flexGrow = flex.flexGrow;
7114
- }
7115
- if (flex.paddingInline !== void 0) {
7116
- props.animate.paddingInline = flex.paddingInline;
7117
- }
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;
7118
7184
  }
7119
7185
  if (variant === "standard") {
7120
7186
  const pressedRadius = (_a = PRESSED_RADIUS_MAP[itemSize]) != null ? _a : PRESSED_RADIUS_MAP.sm;
@@ -7165,13 +7231,6 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex
7165
7231
  });
7166
7232
  props.layout = true;
7167
7233
  }
7168
- if (variant === "navbar") {
7169
- props.layout = true;
7170
- props.transition = {
7171
- layout: WIDTH_MORPH_SPRING,
7172
- default: BUTTON_SHAPE_MORPH_SPRING
7173
- };
7174
- }
7175
7234
  return props;
7176
7235
  }
7177
7236
  var ButtonGroupComponent = React59__namespace.forwardRef(
@@ -7211,7 +7270,6 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7211
7270
  const [lockedGroupSize, setLockedGroupSize] = React59__namespace.useState(
7212
7271
  null
7213
7272
  );
7214
- const layoutIdGroup = React59__namespace.useId();
7215
7273
  const rootRef = React59__namespace.useRef(null);
7216
7274
  const setRootRef = React59__namespace.useCallback(
7217
7275
  (node) => {
@@ -7294,7 +7352,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7294
7352
  className: cn(
7295
7353
  "inline-flex p-0 m-0 border-none max-w-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
7296
7354
  orientation === "vertical" ? "flex-col items-stretch overflow-y-auto overflow-x-hidden" : "flex-row overflow-x-auto overflow-y-hidden",
7297
- variant === "standard" ? "gap-3" : variant === "navbar" ? "gap-1.5 h-full" : "gap-0.5",
7355
+ variant === "standard" ? "gap-3" : "gap-0.5",
7298
7356
  fullWidth && "w-full",
7299
7357
  fullWidth && orientation === "vertical" && "h-full",
7300
7358
  className
@@ -7304,7 +7362,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7304
7362
  onPointerUp: handlePointerLeaveAndUp
7305
7363
  }, props), {
7306
7364
  children: childrenArray.map((child, index) => {
7307
- var _a2, _b2, _c;
7365
+ var _a2, _b2;
7308
7366
  const element = child;
7309
7367
  const isSelected = element.props.selected === true;
7310
7368
  const isFirst = index === 0;
@@ -7316,7 +7374,6 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7316
7374
  element,
7317
7375
  isSelected,
7318
7376
  itemSize,
7319
- variant,
7320
7377
  showCheck,
7321
7378
  iconBehavior,
7322
7379
  labelBehavior
@@ -7342,7 +7399,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7342
7399
  basePx
7343
7400
  );
7344
7401
  const dynamicStyle = __spreadValues({}, element.props.style);
7345
- if (variant !== "navbar" && flex.flexGrow !== void 0 && fullWidth) {
7402
+ if (flex.flexGrow !== void 0 && fullWidth) {
7346
7403
  dynamicStyle.flexBasis = 0;
7347
7404
  dynamicStyle.flexShrink = 1;
7348
7405
  dynamicStyle.minWidth = 0;
@@ -7360,13 +7417,7 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7360
7417
  existingWhileTap
7361
7418
  );
7362
7419
  const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
7363
- const navbarFlexStyle = flex.flexGrow !== void 0 ? {
7364
- flexBasis: fullWidth && labelBehavior !== "selected" ? 0 : "auto",
7365
- flexShrink: fullWidth ? 1 : 0,
7366
- flexGrow: flex.flexGrow,
7367
- minWidth: labelBehavior !== "selected" ? 0 : "fit-content"
7368
- } : {};
7369
- const clonedElement = React59__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
7420
+ const clonedElement = React59__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
7370
7421
  key: (_b2 = element.key) != null ? _b2 : index,
7371
7422
  tabIndex: isFirst ? 0 : -1,
7372
7423
  size: size || element.props.size,
@@ -7375,71 +7426,20 @@ var ButtonGroupComponent = React59__namespace.forwardRef(
7375
7426
  }, variant === "connected" && {
7376
7427
  colorStyle: element.props.colorStyle || "tonal",
7377
7428
  selectedColorStyle: element.props.selectedColorStyle || "filled"
7378
- }), variant === "navbar" && {
7379
- colorStyle: "text",
7380
- selectedColorStyle: "text",
7381
- className: cn(
7382
- element.props.className,
7383
- "w-full! h-full! px-3! min-w-0! relative z-20 flex items-center justify-center",
7384
- isSelected ? "text-m3-on-secondary-container! hover:bg-transparent! active:bg-transparent!" : "text-m3-on-surface-variant! hover:bg-transparent! active:bg-transparent!",
7385
- itemClassName
7386
- )
7387
- }), variant !== "navbar" && {
7429
+ }), {
7388
7430
  className: cn(
7389
7431
  element.props.className,
7390
7432
  connectedClasses,
7391
7433
  "focus-visible:z-10 hover:z-10 relative min-w-0",
7392
7434
  orientation === "vertical" && "w-full",
7393
7435
  itemClassName
7394
- )
7395
- }), {
7396
- style: variant === "navbar" ? __spreadProps(__spreadValues({}, dynamicStyle), { minWidth: 0 }) : dynamicStyle,
7436
+ ),
7437
+ style: dynamicStyle,
7397
7438
  onPointerDown: (e) => {
7398
7439
  setPressedIndex(index);
7399
7440
  if (element.props.onPointerDown) element.props.onPointerDown(e);
7400
7441
  }
7401
7442
  }), motionProps));
7402
- if (variant === "navbar") {
7403
- return /* @__PURE__ */ jsxRuntime.jsxs(
7404
- react.m.div,
7405
- {
7406
- layout: true,
7407
- whileTap: { scale: 0.96 },
7408
- transition: NAVBAR_EXPRESSIVE_SPRING,
7409
- className: "group relative h-full flex items-center justify-center min-w-0",
7410
- style: navbarFlexStyle,
7411
- children: [
7412
- /* @__PURE__ */ jsxRuntime.jsxs(
7413
- "div",
7414
- {
7415
- className: "absolute inset-x-1 inset-y-0 m-auto flex items-center justify-center pointer-events-none",
7416
- style: { zIndex: 1 },
7417
- children: [
7418
- /* @__PURE__ */ jsxRuntime.jsx(
7419
- "div",
7420
- {
7421
- className: "w-full h-[40px] bg-m3-on-surface-variant/8 opacity-0 group-hover:opacity-100 transition-opacity duration-200",
7422
- style: { borderRadius: PILL_BORDER_RADIUS }
7423
- }
7424
- ),
7425
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
7426
- react.m.div,
7427
- {
7428
- layoutId: `navbar-active-indicator-${layoutIdGroup}`,
7429
- className: "absolute inset-0 m-auto w-full h-[40px] bg-m3-secondary-container",
7430
- style: { borderRadius: PILL_BORDER_RADIUS },
7431
- transition: NAVBAR_EXPRESSIVE_SPRING
7432
- }
7433
- ) })
7434
- ]
7435
- }
7436
- ),
7437
- clonedElement
7438
- ]
7439
- },
7440
- (_c = element.key) != null ? _c : index
7441
- );
7442
- }
7443
7443
  return clonedElement;
7444
7444
  })
7445
7445
  })
@@ -7544,6 +7544,8 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7544
7544
  scrollThreshold = 50,
7545
7545
  collapsed,
7546
7546
  onCollapsedChange,
7547
+ asChild = false,
7548
+ children,
7547
7549
  onClick,
7548
7550
  onKeyDown,
7549
7551
  layoutId,
@@ -7563,6 +7565,8 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7563
7565
  "scrollThreshold",
7564
7566
  "collapsed",
7565
7567
  "onCollapsedChange",
7568
+ "asChild",
7569
+ "children",
7566
7570
  "onClick",
7567
7571
  "onKeyDown",
7568
7572
  "layoutId",
@@ -7614,7 +7618,109 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7614
7618
  },
7615
7619
  [loading, onClick, onKeyDown]
7616
7620
  );
7617
- 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(
7618
7724
  react.m.button,
7619
7725
  __spreadProps(__spreadValues({
7620
7726
  ref: localRef,
@@ -7646,91 +7752,11 @@ var ExtendedFABComponent = React59__namespace.forwardRef(
7646
7752
  opacity: { duration: 0.2, ease: "linear" },
7647
7753
  layout: SPRING_TRANSITION
7648
7754
  },
7649
- className: cn(
7650
- "relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
7651
- "transition-[box-shadow,filter] duration-200",
7652
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7653
- "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7654
- colors.bg,
7655
- colors.text,
7656
- lowered ? "shadow-sm" : "shadow-md",
7657
- (_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
7658
- SIZE_TEXT[size],
7659
- isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
7660
- hasIcon ? "justify-start" : "justify-center",
7661
- SIZE_PADDING[size],
7662
- hasIcon && SIZE_GAP[size]
7663
- ),
7664
- dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
7665
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
7666
- className
7667
- )
7755
+ className: containerClassName
7668
7756
  }, restProps), {
7669
- children: [
7670
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
7671
- hasIcon && /* @__PURE__ */ jsxRuntime.jsx(
7672
- react.m.span,
7673
- {
7674
- layout: "position",
7675
- className: cn(
7676
- "flex items-center justify-center shrink-0",
7677
- sizeIcon.cls
7678
- ),
7679
- children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
7680
- react.m.span,
7681
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7682
- transition: SPRING_TRANSITION,
7683
- className: "flex items-center justify-center shrink-0 w-full h-full",
7684
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
7685
- LoadingIndicator,
7686
- {
7687
- size: sizeIcon.px,
7688
- color: "currentColor",
7689
- "aria-label": "Loading"
7690
- }
7691
- ) : /* @__PURE__ */ jsxRuntime.jsx(
7692
- ProgressIndicator,
7693
- {
7694
- variant: "circular",
7695
- size: sizeIcon.px,
7696
- color: "currentColor",
7697
- trackColor: "transparent",
7698
- "aria-label": "Loading"
7699
- }
7700
- )
7701
- }),
7702
- "loading"
7703
- ) : icon && /* @__PURE__ */ jsxRuntime.jsx(
7704
- react.m.span,
7705
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7706
- transition: SPRING_TRANSITION,
7707
- "aria-hidden": "true",
7708
- className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
7709
- children: icon
7710
- }),
7711
- "icon"
7712
- ) })
7713
- }
7714
- ),
7715
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx(
7716
- react.m.span,
7717
- {
7718
- layout: "position",
7719
- initial: { opacity: 0, width: 0 },
7720
- animate: { opacity: 1, width: "auto" },
7721
- exit: { opacity: 0, width: 0 },
7722
- transition: {
7723
- opacity: { duration: 0.15, ease: "linear" },
7724
- width: SPRING_TRANSITION
7725
- },
7726
- className: "overflow-hidden whitespace-nowrap",
7727
- children: label
7728
- },
7729
- "label"
7730
- ) })
7731
- ]
7757
+ children: innerContent
7732
7758
  })
7733
- ) }) });
7759
+ )) }) });
7734
7760
  }
7735
7761
  );
7736
7762
  ExtendedFABComponent.displayName = "ExtendedFAB";
@@ -7819,6 +7845,7 @@ var FABComponent = React59__namespace.forwardRef(
7819
7845
  loading = false,
7820
7846
  loadingVariant = "loading-indicator",
7821
7847
  visible = true,
7848
+ asChild = false,
7822
7849
  onClick,
7823
7850
  onKeyDown,
7824
7851
  "aria-label": ariaLabel
@@ -7834,6 +7861,7 @@ var FABComponent = React59__namespace.forwardRef(
7834
7861
  "loading",
7835
7862
  "loadingVariant",
7836
7863
  "visible",
7864
+ "asChild",
7837
7865
  "onClick",
7838
7866
  "onKeyDown",
7839
7867
  "aria-label"
@@ -7871,19 +7899,116 @@ var FABComponent = React59__namespace.forwardRef(
7871
7899
  },
7872
7900
  [loading, onClick, onKeyDown]
7873
7901
  );
7874
- 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(
7875
7996
  react.m.button,
7876
7997
  __spreadProps(__spreadValues({
7877
7998
  ref,
7878
7999
  type: "button",
7879
- "aria-label": ariaLabel || (typeof children === "string" ? children : void 0),
8000
+ "aria-label": computedAriaLabel,
7880
8001
  "aria-busy": loading || void 0,
7881
8002
  "aria-disabled": loading || restProps.disabled,
7882
8003
  onClick: handleClick,
7883
8004
  onPointerDown,
7884
8005
  onKeyDown: handleKeyDown,
7885
8006
  style,
7886
- initial: { scale: 0.5, opacity: 0, borderRadius: animateRadius },
8007
+ initial: {
8008
+ scale: 0.5,
8009
+ opacity: 0,
8010
+ borderRadius: animateRadius
8011
+ },
7887
8012
  animate: { scale: 1, opacity: 1, borderRadius: animateRadius },
7888
8013
  exit: { scale: 0.5, opacity: 0 },
7889
8014
  whileTap: { borderRadius: pressedRadius },
@@ -7892,80 +8017,11 @@ var FABComponent = React59__namespace.forwardRef(
7892
8017
  scale: SPRING_TRANSITION,
7893
8018
  opacity: { duration: 0.25, ease: "easeOut" }
7894
8019
  },
7895
- className: cn(
7896
- "relative shrink-0 inline-flex items-center justify-center",
7897
- "select-none cursor-pointer overflow-hidden",
7898
- "transition-[box-shadow,opacity,filter] duration-200",
7899
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
7900
- "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
7901
- colors.bg,
7902
- colors.text,
7903
- lowered ? "shadow-sm" : colors.shadow,
7904
- (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
7905
- extended && "w-auto px-6",
7906
- SIZE_TEXT_CLASS[size],
7907
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
7908
- className
7909
- )
8020
+ className: containerClassName
7910
8021
  }, restProps), {
7911
- children: [
7912
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
7913
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
7914
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
7915
- react.m.span,
7916
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7917
- transition: SPRING_TRANSITION,
7918
- className: cn(
7919
- "flex items-center justify-center shrink-0",
7920
- iconClass
7921
- ),
7922
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
7923
- LoadingIndicator,
7924
- {
7925
- size: iconPx,
7926
- color: "currentColor",
7927
- "aria-label": "Loading"
7928
- }
7929
- ) : /* @__PURE__ */ jsxRuntime.jsx(
7930
- ProgressIndicator,
7931
- {
7932
- variant: "circular",
7933
- size: iconPx,
7934
- color: "currentColor",
7935
- trackColor: "transparent",
7936
- "aria-label": "Loading"
7937
- }
7938
- )
7939
- }),
7940
- "loading"
7941
- ) : /* @__PURE__ */ jsxRuntime.jsx(
7942
- react.m.span,
7943
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
7944
- transition: SPRING_TRANSITION,
7945
- "aria-hidden": "true",
7946
- className: cn(
7947
- "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
7948
- iconClass
7949
- ),
7950
- children: icon
7951
- }),
7952
- "icon"
7953
- ) }),
7954
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: extended && children && /* @__PURE__ */ jsxRuntime.jsx(
7955
- react.m.span,
7956
- {
7957
- initial: { width: 0, opacity: 0 },
7958
- animate: { width: "auto", opacity: 1 },
7959
- exit: { width: 0, opacity: 0 },
7960
- transition: SPRING_TRANSITION,
7961
- className: "overflow-hidden whitespace-nowrap ml-3",
7962
- children
7963
- },
7964
- "label"
7965
- ) })
7966
- ]
8022
+ children: innerContent
7967
8023
  })
7968
- ) }) });
8024
+ )) }) });
7969
8025
  }
7970
8026
  );
7971
8027
  FABComponent.displayName = "FAB";
@@ -8165,7 +8221,9 @@ function FABMenuItem({
8165
8221
  disabled = false,
8166
8222
  colorVariant = "primary",
8167
8223
  className,
8168
- tabIndex = 0
8224
+ tabIndex = 0,
8225
+ asChild = false,
8226
+ children
8169
8227
  }) {
8170
8228
  var _a;
8171
8229
  const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
@@ -8190,7 +8248,55 @@ function FABMenuItem({
8190
8248
  },
8191
8249
  [disabled, onClick]
8192
8250
  );
8193
- 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(
8194
8300
  react.m.div,
8195
8301
  {
8196
8302
  role: "menuitem",
@@ -8201,37 +8307,9 @@ function FABMenuItem({
8201
8307
  onPointerDown,
8202
8308
  onKeyDown: handleKeyDown,
8203
8309
  variants: MENU_ITEM_VARIANTS,
8204
- style: {
8205
- transformOrigin: "right",
8206
- borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
8207
- },
8208
- className: cn(
8209
- "relative inline-flex flex-row items-center",
8210
- "select-none cursor-pointer overflow-hidden",
8211
- "whitespace-nowrap",
8212
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
8213
- MENU_ITEM_STYLES.size,
8214
- MENU_ITEM_STYLES.gap,
8215
- label ? MENU_ITEM_STYLES.padding : "px-4",
8216
- !label && "justify-center",
8217
- colors.bg,
8218
- colors.text,
8219
- disabled && "opacity-[0.38] pointer-events-none",
8220
- className
8221
- ),
8222
- children: [
8223
- /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8224
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8225
- /* @__PURE__ */ jsxRuntime.jsx(
8226
- "span",
8227
- {
8228
- "aria-hidden": "true",
8229
- className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
8230
- children: icon
8231
- }
8232
- ),
8233
- label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
8234
- ]
8310
+ style: containerStyle,
8311
+ className: containerClassName,
8312
+ children: innerContent
8235
8313
  }
8236
8314
  );
8237
8315
  }
@@ -8513,6 +8591,7 @@ var IconButtonComponent = React59__namespace.forwardRef(
8513
8591
  loading = false,
8514
8592
  loadingVariant = "loading-indicator",
8515
8593
  iconSize,
8594
+ asChild = false,
8516
8595
  children,
8517
8596
  onClick,
8518
8597
  onKeyDown,
@@ -8528,6 +8607,7 @@ var IconButtonComponent = React59__namespace.forwardRef(
8528
8607
  "loading",
8529
8608
  "loadingVariant",
8530
8609
  "iconSize",
8610
+ "asChild",
8531
8611
  "children",
8532
8612
  "onClick",
8533
8613
  "onKeyDown",
@@ -8589,7 +8669,87 @@ var IconButtonComponent = React59__namespace.forwardRef(
8589
8669
  },
8590
8670
  [loading, onClick, onKeyDown]
8591
8671
  );
8592
- 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(
8593
8753
  react.m.button,
8594
8754
  __spreadProps(__spreadValues({
8595
8755
  ref,
@@ -8605,67 +8765,9 @@ var IconButtonComponent = React59__namespace.forwardRef(
8605
8765
  animate: { borderRadius: animateRadius },
8606
8766
  whileTap: { borderRadius: pressedRadius },
8607
8767
  transition: { borderRadius: SPRING_TRANSITION_FAST },
8608
- className: cn(
8609
- baseIconButtonClasses,
8610
- resolvedColorClass,
8611
- outlineWidthClass,
8612
- disabledBgClass,
8613
- "overflow-hidden",
8614
- SIZE_STYLES2[size],
8615
- loading && "pointer-events-none opacity-75 cursor-not-allowed",
8616
- className
8617
- )
8768
+ className: containerClassName
8618
8769
  }, restProps), {
8619
- children: [
8620
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
8621
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
8622
- /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
8623
- react.m.span,
8624
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8625
- transition: SPRING_TRANSITION,
8626
- className: cn(
8627
- "flex items-center justify-center shrink-0",
8628
- iconSize != null ? void 0 : iconClass
8629
- ),
8630
- style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
8631
- children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
8632
- LoadingIndicator,
8633
- {
8634
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8635
- color: "currentColor",
8636
- "aria-label": "Loading"
8637
- }
8638
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8639
- ProgressIndicator,
8640
- {
8641
- variant: "circular",
8642
- size: typeof iconPx === "number" ? iconPx : defaultIconPx,
8643
- color: "currentColor",
8644
- trackColor: "transparent",
8645
- "aria-label": "Loading"
8646
- }
8647
- )
8648
- }),
8649
- "loading"
8650
- ) : /* @__PURE__ */ jsxRuntime.jsx(
8651
- react.m.span,
8652
- __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
8653
- transition: SPRING_TRANSITION,
8654
- "aria-hidden": "true",
8655
- className: cn(
8656
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
8657
- iconSize != null ? void 0 : iconClass
8658
- ),
8659
- style: {
8660
- fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
8661
- width: isCustomSize ? `${iconSize}px` : void 0,
8662
- height: isCustomSize ? `${iconSize}px` : void 0
8663
- },
8664
- children
8665
- }),
8666
- "content"
8667
- ) })
8668
- ]
8770
+ children: innerContent
8669
8771
  })
8670
8772
  ) });
8671
8773
  }
@@ -8985,6 +9087,7 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
8985
9087
  icon,
8986
9088
  children,
8987
9089
  disabled,
9090
+ asChild = false,
8988
9091
  onClick,
8989
9092
  onPointerDown,
8990
9093
  onPointerUp,
@@ -9000,6 +9103,7 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9000
9103
  "icon",
9001
9104
  "children",
9002
9105
  "disabled",
9106
+ "asChild",
9003
9107
  "onClick",
9004
9108
  "onPointerDown",
9005
9109
  "onPointerUp",
@@ -9086,12 +9190,73 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9086
9190
  [onBlur]
9087
9191
  );
9088
9192
  const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
9089
- 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(
9090
9256
  react.m.button,
9091
9257
  __spreadProps(__spreadValues({
9092
9258
  ref,
9093
9259
  type: "button",
9094
- "aria-disabled": disabled,
9095
9260
  disabled,
9096
9261
  onClick: handleClick,
9097
9262
  onPointerDown: handlePointerDown,
@@ -9108,41 +9273,9 @@ var SplitButtonLeadingComponent = React59__namespace.forwardRef(
9108
9273
  paddingInlineEnd: tokens.leadingPadding.end,
9109
9274
  gap: "8px"
9110
9275
  }, style),
9111
- className: cn(
9112
- splitButtonVariants({
9113
- variant: actualVariant,
9114
- size: actualSize,
9115
- disabled
9116
- }),
9117
- typographyClass,
9118
- className
9119
- )
9276
+ className: containerClassName
9120
9277
  }, restProps), {
9121
- children: [
9122
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9123
- /* @__PURE__ */ jsxRuntime.jsx(
9124
- StateLayer,
9125
- {
9126
- hovered: isHovered,
9127
- focused: isFocused,
9128
- pressed: isPressed
9129
- }
9130
- ),
9131
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9132
- icon && /* @__PURE__ */ jsxRuntime.jsx(
9133
- "span",
9134
- {
9135
- className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
9136
- style: {
9137
- fontSize: leadingIconSize,
9138
- width: leadingIconSize,
9139
- height: leadingIconSize
9140
- },
9141
- children: icon
9142
- }
9143
- ),
9144
- children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children })
9145
- ]
9278
+ children: innerContent
9146
9279
  })
9147
9280
  ) });
9148
9281
  }
@@ -9174,6 +9307,8 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9174
9307
  onPointerCancel,
9175
9308
  onFocus,
9176
9309
  onBlur,
9310
+ asChild = false,
9311
+ children,
9177
9312
  "aria-label": ariaLabel
9178
9313
  } = _b, restProps = __objRest(_b, [
9179
9314
  "className",
@@ -9190,6 +9325,8 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9190
9325
  "onPointerCancel",
9191
9326
  "onFocus",
9192
9327
  "onBlur",
9328
+ "asChild",
9329
+ "children",
9193
9330
  "aria-label"
9194
9331
  ]);
9195
9332
  var _a2, _b2;
@@ -9264,14 +9401,81 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9264
9401
  },
9265
9402
  [onBlur]
9266
9403
  );
9267
- 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(
9268
9472
  react.m.button,
9269
9473
  __spreadProps(__spreadValues({
9270
9474
  ref,
9271
9475
  type: "button",
9272
- "aria-pressed": checked,
9273
- "aria-expanded": checked,
9274
9476
  "aria-label": ariaLabel,
9477
+ "aria-expanded": checked,
9478
+ "aria-disabled": disabled,
9275
9479
  disabled,
9276
9480
  onClick: handleToggle,
9277
9481
  onPointerDown: handlePointerDown,
@@ -9287,46 +9491,9 @@ var SplitButtonTrailingComponent = React59__namespace.forwardRef(
9287
9491
  paddingInlineStart: tokens.trailingPadding.start,
9288
9492
  paddingInlineEnd: tokens.trailingPadding.end
9289
9493
  }, style),
9290
- className: cn(
9291
- splitButtonVariants({
9292
- variant: actualVariant,
9293
- size: actualSize,
9294
- disabled
9295
- }),
9296
- className
9297
- )
9494
+ className: containerClassName
9298
9495
  }, restProps), {
9299
- children: [
9300
- needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
9301
- /* @__PURE__ */ jsxRuntime.jsx(
9302
- StateLayer,
9303
- {
9304
- hovered: isHovered,
9305
- focused: isFocused,
9306
- pressed: isPressed
9307
- }
9308
- ),
9309
- /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
9310
- /* @__PURE__ */ jsxRuntime.jsx(
9311
- react.m.div,
9312
- {
9313
- animate: {
9314
- rotate: checked ? 180 : 0,
9315
- x: checked ? 0 : tokens.opticalCenterOffset
9316
- },
9317
- transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
9318
- className: "flex items-center justify-center shrink-0",
9319
- children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
9320
- Icon,
9321
- {
9322
- name: "arrow_drop_down",
9323
- size: tokens.trailingIconSize,
9324
- opticalSize: 24
9325
- }
9326
- )
9327
- }
9328
- )
9329
- ]
9496
+ children: innerContent
9330
9497
  })
9331
9498
  ) });
9332
9499
  }
@@ -9580,6 +9747,7 @@ var CardImpl = React59__namespace.forwardRef(
9580
9747
  target,
9581
9748
  rel: relProp,
9582
9749
  onClick,
9750
+ asChild = false,
9583
9751
  children
9584
9752
  } = _b, props = __objRest(_b, [
9585
9753
  "className",
@@ -9590,10 +9758,11 @@ var CardImpl = React59__namespace.forwardRef(
9590
9758
  "target",
9591
9759
  "rel",
9592
9760
  "onClick",
9761
+ "asChild",
9593
9762
  "children"
9594
9763
  ]);
9595
9764
  const safeVariant = variant;
9596
- const isInteractive = !!onClick || !!href || interactive;
9765
+ const isInteractive = !!onClick || !!href || interactive || asChild;
9597
9766
  const elevationProps = useCardElevation(safeVariant, disabled);
9598
9767
  const { ripples, onPointerDown, removeRipple } = useRippleState();
9599
9768
  const baseClass = cn(
@@ -9614,6 +9783,26 @@ var CardImpl = React59__namespace.forwardRef(
9614
9783
  // Outlined interactive card: change border color to m3-outline on focus/press/hover
9615
9784
  variant === "outlined" && "hover:border-m3-outline focus-visible:border-m3-outline active:border-m3-outline"
9616
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
+ }
9617
9806
  if (!isInteractive) {
9618
9807
  return /* @__PURE__ */ jsxRuntime.jsx(
9619
9808
  "div",
@@ -10080,7 +10269,9 @@ var ChipImpl = React59__namespace.forwardRef(
10080
10269
  avatar,
10081
10270
  onRemove,
10082
10271
  className,
10083
- onClick
10272
+ onClick,
10273
+ asChild = false,
10274
+ children
10084
10275
  } = _b, props = __objRest(_b, [
10085
10276
  "variant",
10086
10277
  "elevated",
@@ -10092,7 +10283,9 @@ var ChipImpl = React59__namespace.forwardRef(
10092
10283
  "avatar",
10093
10284
  "onRemove",
10094
10285
  "className",
10095
- "onClick"
10286
+ "onClick",
10287
+ "asChild",
10288
+ "children"
10096
10289
  ]);
10097
10290
  const { ripples, onPointerDown, removeRipple } = useRippleState({
10098
10291
  disabled
@@ -10207,6 +10400,63 @@ var ChipImpl = React59__namespace.forwardRef(
10207
10400
  ) : null }),
10208
10401
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: label })
10209
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
+ }
10210
10460
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
10211
10461
  Root8,
10212
10462
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({
@@ -13148,7 +13398,7 @@ var TimePickerDialog = ({
13148
13398
  TimePickerDialog.displayName = "TimePickerDialog";
13149
13399
  var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
13150
13400
  var isValidHourInput = (h, is24hour) => is24hour ? h >= 0 && h <= 23 : h >= 1 && h <= 12;
13151
- var isValidMinuteInput = (m67) => m67 >= 0 && m67 <= 59;
13401
+ var isValidMinuteInput = (m68) => m68 >= 0 && m68 <= 59;
13152
13402
  var to24Hour = (hour12, isPm) => {
13153
13403
  if (isPm) {
13154
13404
  return hour12 === 12 ? 12 : hour12 + 12;
@@ -13184,8 +13434,8 @@ var useTimePickerState = (options) => {
13184
13434
  },
13185
13435
  [is24hour]
13186
13436
  );
13187
- const setMinute = React59.useCallback((m67) => {
13188
- const clamped = clamp(m67, 0, 59);
13437
+ const setMinute = React59.useCallback((m68) => {
13438
+ const clamped = clamp(m68, 0, 59);
13189
13439
  setMinuteState(clamped);
13190
13440
  setMinuteInputState(clamped);
13191
13441
  }, []);
@@ -13199,10 +13449,10 @@ var useTimePickerState = (options) => {
13199
13449
  },
13200
13450
  [is24hour, isPm]
13201
13451
  );
13202
- const setMinuteInput = React59.useCallback((m67) => {
13203
- setMinuteInputState(m67);
13204
- if (isValidMinuteInput(m67)) {
13205
- setMinuteState(m67);
13452
+ const setMinuteInput = React59.useCallback((m68) => {
13453
+ setMinuteInputState(m68);
13454
+ if (isValidMinuteInput(m68)) {
13455
+ setMinuteState(m68);
13206
13456
  }
13207
13457
  }, []);
13208
13458
  const setSelection = React59.useCallback((mode) => {
@@ -15342,7 +15592,7 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15342
15592
  className,
15343
15593
  "aria-label": ariaLabelProp
15344
15594
  }, ref) => {
15345
- const { variant, itemLayout } = React59__namespace.useContext(NavigationBarContext);
15595
+ const { variant, itemLayout, itemClassName: contextItemClassName } = React59__namespace.useContext(NavigationBarContext);
15346
15596
  const isForcedHorizontal = itemLayout === "horizontal";
15347
15597
  const isResponsiveHorizontal = (variant === "flexible" || variant === "xr") && itemLayout === void 0;
15348
15598
  const { ripples, onPointerDown, removeRipple } = useRippleState({
@@ -15377,9 +15627,10 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15377
15627
  onClick: handleClick,
15378
15628
  onPointerDown,
15379
15629
  className: cn(
15380
- "group relative flex flex-1 cursor-pointer transition-colors duration-200 outline-none select-none h-full",
15381
- 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",
15382
15632
  disabled && "pointer-events-none opacity-[0.38]",
15633
+ contextItemClassName,
15383
15634
  className
15384
15635
  ),
15385
15636
  children: [
@@ -15387,9 +15638,9 @@ var NavigationBarItemComponent = React59__namespace.forwardRef(
15387
15638
  "div",
15388
15639
  {
15389
15640
  className: cn(
15390
- "relative flex items-center justify-center flex-col gap-y-1 w-full",
15391
- 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",
15392
- 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"
15393
15644
  ),
15394
15645
  children: [
15395
15646
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -15466,7 +15717,7 @@ var navContainerVariants = classVarianceAuthority.cva(
15466
15717
  variant: {
15467
15718
  flexible: "bottom-0 left-0 right-0 w-full h-16 pb-safe",
15468
15719
  baseline: "bottom-0 left-0 right-0 w-full h-20 pb-safe",
15469
- 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"
15470
15721
  },
15471
15722
  position: {
15472
15723
  fixed: "fixed",
@@ -15494,6 +15745,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15494
15745
  scrollContainerRef,
15495
15746
  activeIndicatorTransition,
15496
15747
  children,
15748
+ itemClassName,
15497
15749
  className,
15498
15750
  style
15499
15751
  }, ref) => {
@@ -15544,7 +15796,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15544
15796
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
15545
15797
  NavigationBarContext.Provider,
15546
15798
  {
15547
- value: { variant, itemLayout, activeIndicatorTransition },
15799
+ value: { variant, itemLayout, activeIndicatorTransition, itemClassName },
15548
15800
  children: /* @__PURE__ */ jsxRuntime.jsx(
15549
15801
  react.m.nav,
15550
15802
  {
@@ -15565,7 +15817,7 @@ var NavigationBarComponent = React59__namespace.forwardRef(
15565
15817
  "aria-orientation": "horizontal",
15566
15818
  className: cn(
15567
15819
  "flex w-full h-full mx-auto",
15568
- 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"
15569
15821
  ),
15570
15822
  children
15571
15823
  }
@@ -20661,6 +20913,7 @@ var TabsList = React59__namespace.memo(TabsListComponent);
20661
20913
  var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface", {
20662
20914
  variants: {
20663
20915
  variant: {
20916
+ // Short hyphenated
20664
20917
  "display-lg": "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
20665
20918
  "display-md": "text-[45px] leading-[52px] font-normal tracking-[0px]",
20666
20919
  "display-sm": "text-[36px] leading-[44px] font-normal tracking-[0px]",
@@ -20675,7 +20928,39 @@ var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface"
20675
20928
  "label-sm": "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
20676
20929
  "body-lg": "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
20677
20930
  "body-md": "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
20678
- "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]"
20679
20964
  }
20680
20965
  },
20681
20966
  defaultVariants: {
@@ -20684,19 +20969,21 @@ var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface"
20684
20969
  });
20685
20970
  var Text = React59__namespace.forwardRef(
20686
20971
  (_a, ref) => {
20687
- 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"]);
20688
20973
  const defaultComponent = React59__namespace.useMemo(() => {
20689
- if ((variant == null ? void 0 : variant.startsWith("display")) || (variant == null ? void 0 : variant.startsWith("headline")))
20690
- return "h1";
20691
- 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";
20692
20977
  return "p";
20693
20978
  }, [variant]);
20694
20979
  const Tag = Component || defaultComponent;
20980
+ const customStyle = __spreadValues(__spreadValues(__spreadValues({}, style), color ? { color } : {}), weight ? { fontWeight: weight } : {});
20695
20981
  return /* @__PURE__ */ jsxRuntime.jsx(
20696
20982
  Tag,
20697
20983
  __spreadValues({
20698
20984
  ref,
20699
- className: cn(typographyVariants({ variant, className }))
20985
+ className: cn(typographyVariants({ variant, className })),
20986
+ style: customStyle
20700
20987
  }, props)
20701
20988
  );
20702
20989
  }
@@ -20821,7 +21108,6 @@ var FloatingLabel = React59__namespace.memo(function FloatingLabel2({
20821
21108
  "absolute pointer-events-none select-none origin-[left_center] leading-6 text-base whitespace-nowrap",
20822
21109
  "px-1 -mx-1",
20823
21110
  // Clear the notch gap and keep text aligned
20824
- variant === "outlined" && isFloated && "bg-m3-surface",
20825
21111
  "left-4",
20826
21112
  isDisabled && "opacity-[0.38]"
20827
21113
  ),
@@ -20897,7 +21183,8 @@ var OutlineContainer = React59__namespace.memo(function OutlineContainer2({
20897
21183
  );
20898
21184
  const borderWidth = isFocused || isError ? TF_SIZE.outlineThick : TF_SIZE.outlineThin;
20899
21185
  const leftSegmentWidth = TF_SIZE.paddingStart;
20900
- 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;
20901
21188
  const borderTransition = { duration: colorDuration, ease };
20902
21189
  const notchTransition = { duration: notchDuration, ease };
20903
21190
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -20935,7 +21222,7 @@ var OutlineContainer = React59__namespace.memo(function OutlineContainer2({
20935
21222
  style: { height: borderWidth },
20936
21223
  animate: {
20937
21224
  borderTopColor: borderColor,
20938
- opacity: isFloated ? 0 : 1,
21225
+ opacity: isNotched ? 0 : 1,
20939
21226
  borderTopWidth: borderWidth,
20940
21227
  borderTopStyle: "solid"
20941
21228
  },
@@ -21387,7 +21674,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21387
21674
  const computedDescribedby = [hasSupporting ? supportingId : "", ariaDescribedby != null ? ariaDescribedby : ""].filter(Boolean).join(" ") || void 0;
21388
21675
  const inputClass = cn(
21389
21676
  "bg-transparent outline-none w-full",
21390
- isInToolbar ? "self-center" : "self-end",
21677
+ !resolvedLabel || isInToolbar ? "self-center" : "self-end",
21391
21678
  "text-base leading-6 text-m3-on-surface",
21392
21679
  "caret-[var(--color-m3-primary)]",
21393
21680
  "placeholder:text-m3-on-surface-variant/60",
@@ -21398,7 +21685,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21398
21685
  id: inputId,
21399
21686
  name,
21400
21687
  value: currentValue,
21401
- placeholder: isFloated ? placeholder != null ? placeholder : "" : "",
21688
+ placeholder: !resolvedLabel || isFloated ? placeholder != null ? placeholder : "" : "",
21402
21689
  disabled,
21403
21690
  readOnly,
21404
21691
  required,
@@ -21430,7 +21717,7 @@ var TextFieldComponent = React59__namespace.forwardRef(
21430
21717
  "relative flex flex-col flex-1 min-w-0 h-full",
21431
21718
  paddingStart,
21432
21719
  paddingEnd,
21433
- 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"
21434
21721
  );
21435
21722
  const wrapperClass = cn(
21436
21723
  "group/tf inline-flex flex-col",
@@ -22339,6 +22626,8 @@ function MD3ThemeProvider({
22339
22626
  sourceColor: initialSourceColor = "#6750A4",
22340
22627
  defaultMode = "light",
22341
22628
  persistToLocalStorage = false,
22629
+ variant = "expressive",
22630
+ contrastLevel = 0,
22342
22631
  typography: typographyProp,
22343
22632
  fontFamily,
22344
22633
  fontVariationAxes,
@@ -22347,6 +22636,17 @@ function MD3ThemeProvider({
22347
22636
  const [sourceColor, setSourceColor] = React59.useState(initialSourceColor);
22348
22637
  const [mode, setMode] = React59.useState(defaultMode);
22349
22638
  const [isHydrated, setIsHydrated] = React59.useState(!persistToLocalStorage);
22639
+ const [systemMode, setSystemMode] = React59.useState("light");
22640
+ React59.useEffect(() => {
22641
+ if (typeof window === "undefined") return;
22642
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
22643
+ const updateSystemMode = () => {
22644
+ setSystemMode(mediaQuery.matches ? "dark" : "light");
22645
+ };
22646
+ updateSystemMode();
22647
+ mediaQuery.addEventListener("change", updateSystemMode);
22648
+ return () => mediaQuery.removeEventListener("change", updateSystemMode);
22649
+ }, []);
22350
22650
  React59.useEffect(() => {
22351
22651
  if (!persistToLocalStorage) return;
22352
22652
  const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
@@ -22358,25 +22658,37 @@ function MD3ThemeProvider({
22358
22658
  setMode(savedMode);
22359
22659
  setIsHydrated(true);
22360
22660
  }, [persistToLocalStorage]);
22661
+ const effectiveMode = mode === "system" ? systemMode : mode;
22361
22662
  React59.useEffect(() => {
22362
22663
  if (!isHydrated) return;
22363
- applyTheme(sourceColor, mode);
22664
+ applyTheme(sourceColor, effectiveMode, document.documentElement, {
22665
+ variant,
22666
+ contrastLevel
22667
+ });
22364
22668
  if (persistToLocalStorage) {
22365
22669
  localStorage.setItem(STORAGE_KEY_COLOR, sourceColor);
22366
22670
  localStorage.setItem(STORAGE_KEY_MODE, mode);
22367
22671
  }
22368
- }, [sourceColor, mode, persistToLocalStorage, isHydrated]);
22369
- React59.useEffect(() => {
22370
- if (mode !== "system" || typeof window === "undefined") return;
22371
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
22372
- const handleChange = () => applyTheme(sourceColor, "system");
22373
- mediaQuery.addEventListener("change", handleChange);
22374
- return () => mediaQuery.removeEventListener("change", handleChange);
22375
- }, [mode, sourceColor]);
22376
- const effectiveMode = resolveMode(mode);
22672
+ }, [
22673
+ sourceColor,
22674
+ mode,
22675
+ effectiveMode,
22676
+ persistToLocalStorage,
22677
+ isHydrated,
22678
+ variant,
22679
+ contrastLevel
22680
+ ]);
22377
22681
  const themeValue = React59.useMemo(
22378
- () => ({ sourceColor, setSourceColor, mode, setMode, effectiveMode }),
22379
- [sourceColor, mode, effectiveMode]
22682
+ () => ({
22683
+ sourceColor,
22684
+ setSourceColor,
22685
+ mode,
22686
+ setMode,
22687
+ effectiveMode,
22688
+ variant,
22689
+ contrastLevel
22690
+ }),
22691
+ [sourceColor, mode, effectiveMode, variant, contrastLevel]
22380
22692
  );
22381
22693
  const typographyValue = React59.useMemo(() => {
22382
22694
  if (typographyProp) return typographyProp;
@@ -22489,6 +22801,47 @@ var vibrantFloatingToolbarColors = {
22489
22801
  fabContainerColor: "var(--md-sys-color-tertiary-container)",
22490
22802
  fabContentColor: "var(--md-sys-color-on-tertiary-container)"
22491
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
+ }
22492
22845
  var BottomDockedToolbar = React59__namespace.forwardRef(
22493
22846
  (_a, ref) => {
22494
22847
  var _b = _a, {
@@ -22518,7 +22871,7 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22518
22871
  "className",
22519
22872
  "aria-label"
22520
22873
  ]);
22521
- const colors = customColors || (variant === "vibrant" ? vibrantFloatingToolbarColors : standardFloatingToolbarColors);
22874
+ const colors = getToolbarColors(variant, customColors);
22522
22875
  const { scrollY } = react.useScroll(
22523
22876
  scrollContainerRef ? { container: scrollContainerRef } : void 0
22524
22877
  );
@@ -22547,6 +22900,7 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22547
22900
  full: "rounded-full"
22548
22901
  };
22549
22902
  const justifyClass = justify === "center" ? "justify-center gap-4" : "justify-between";
22903
+ const isXr = variant === "xr";
22550
22904
  return /* @__PURE__ */ jsxRuntime.jsx(ToolbarContext.Provider, { value: { orientation: "horizontal" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
22551
22905
  react.m.div,
22552
22906
  __spreadProps(__spreadValues({
@@ -22567,11 +22921,12 @@ var BottomDockedToolbar = React59__namespace.forwardRef(
22567
22921
  paddingRight: paddingX
22568
22922
  }),
22569
22923
  className: cn(
22570
- "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",
22571
22925
  "flex items-center h-16",
22572
22926
  justifyClass,
22573
22927
  SHAPE_CLASSES[shape],
22574
- "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",
22575
22930
  className
22576
22931
  )
22577
22932
  }, props), {
@@ -22618,6 +22973,13 @@ var ToolbarIconButtonTokens = {
22618
22973
  /** Icon size in dp — larger than standard 24dp to fill the 48dp button properly */
22619
22974
  IconSize: 28
22620
22975
  };
22976
+ var ToolbarToggleButtonTokens = {
22977
+ Height: 48,
22978
+ MinWidth: 95,
22979
+ IconSize: 24,
22980
+ PaddingX: 16,
22981
+ Gap: 8
22982
+ };
22621
22983
  var ALIGNMENT_CLASS = {
22622
22984
  start: "justify-start",
22623
22985
  center: "justify-center",
@@ -22676,7 +23038,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22676
23038
  var _b = _a, {
22677
23039
  expanded,
22678
23040
  orientation = "horizontal",
22679
- colors = standardFloatingToolbarColors,
23041
+ variant = "standard",
23042
+ colors: customColors,
22680
23043
  shape = "full",
22681
23044
  contentPadding,
22682
23045
  scrollBehavior,
@@ -22694,6 +23057,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22694
23057
  } = _b, props = __objRest(_b, [
22695
23058
  "expanded",
22696
23059
  "orientation",
23060
+ "variant",
22697
23061
  "colors",
22698
23062
  "shape",
22699
23063
  "contentPadding",
@@ -22710,6 +23074,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22710
23074
  "style",
22711
23075
  "aria-label"
22712
23076
  ]);
23077
+ const colors = getToolbarColors(variant, customColors);
22713
23078
  const isHorizontal = orientation === "horizontal";
22714
23079
  const isStringPadding = typeof contentPadding === "string";
22715
23080
  const cssVars = __spreadValues(__spreadValues({
@@ -22718,7 +23083,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22718
23083
  "--toolbar-size": `${FloatingToolbarTokens.ContainerHeight}px`
22719
23084
  }, isStringPadding ? {} : contentPadding), style);
22720
23085
  const isScrolledOff = scrollBehavior && scrollBehavior.offset < 0;
22721
- 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";
22722
23088
  const containerShapeClass = shape === "full" ? "rounded-full" : "rounded-2xl";
22723
23089
  const leadingVariants = buildSlotVariants(
22724
23090
  isHorizontal ? "-100%" : 0,
@@ -22735,7 +23101,7 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22735
23101
  scrollBehavior,
22736
23102
  disableScrollTranslation
22737
23103
  );
22738
- 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(
22739
23105
  react.m.div,
22740
23106
  {
22741
23107
  ref,
@@ -22757,8 +23123,8 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22757
23123
  color: "var(--toolbar-color)"
22758
23124
  }),
22759
23125
  className: cn(
22760
- "flex pointer-events-auto relative",
22761
- 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",
22762
23128
  containerShapeClass,
22763
23129
  shadowClass,
22764
23130
  className
@@ -22775,11 +23141,11 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22775
23141
  "div",
22776
23142
  {
22777
23143
  className: cn(
22778
- "flex items-center gap-1 min-w-0 min-h-0",
23144
+ "flex items-center min-w-0 min-h-0",
22779
23145
  isHorizontal ? "flex-row h-full" : "flex-col w-full",
22780
- isStringPadding ? contentPadding : isHorizontal ? "px-4" : "py-6"
23146
+ isStringPadding ? contentPadding : isHorizontal ? "px-2" : "py-2"
22781
23147
  ),
22782
- style: isStringPadding ? void 0 : contentPadding,
23148
+ style: __spreadValues({ gap: itemGap }, isStringPadding ? {} : contentPadding),
22783
23149
  children: [
22784
23150
  /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, children: expanded && startContent && /* @__PURE__ */ jsxRuntime.jsx(
22785
23151
  react.m.div,
@@ -22789,9 +23155,10 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22789
23155
  animate: "visible",
22790
23156
  exit: "hidden",
22791
23157
  className: cn(
22792
- "flex shrink-0 overflow-hidden",
23158
+ "flex shrink-0 items-center overflow-hidden",
22793
23159
  isHorizontal ? "flex-row" : "flex-col"
22794
23160
  ),
23161
+ style: { gap: itemGap },
22795
23162
  children: processNodes(startContent)
22796
23163
  },
22797
23164
  "start"
@@ -22816,9 +23183,10 @@ var FloatingToolbarBase = React59__namespace.forwardRef(
22816
23183
  animate: "visible",
22817
23184
  exit: "hidden",
22818
23185
  className: cn(
22819
- "flex shrink-0 overflow-hidden",
23186
+ "flex shrink-0 items-center overflow-hidden",
22820
23187
  isHorizontal ? "flex-row" : "flex-col"
22821
23188
  ),
23189
+ style: { gap: itemGap },
22822
23190
  children: processNodes(endContent)
22823
23191
  },
22824
23192
  "end"
@@ -22844,7 +23212,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22844
23212
  var _b = _a, {
22845
23213
  expanded,
22846
23214
  orientation = "horizontal",
22847
- colors = standardFloatingToolbarColors,
23215
+ variant = "standard",
23216
+ colors: customColors,
22848
23217
  floatingActionButton,
22849
23218
  fabPosition = orientation === "horizontal" ? "end" : "bottom",
22850
23219
  animationDuration = 0.3,
@@ -22855,6 +23224,7 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22855
23224
  } = _b, props = __objRest(_b, [
22856
23225
  "expanded",
22857
23226
  "orientation",
23227
+ "variant",
22858
23228
  "colors",
22859
23229
  "floatingActionButton",
22860
23230
  "fabPosition",
@@ -22864,6 +23234,7 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22864
23234
  "className",
22865
23235
  "style"
22866
23236
  ]);
23237
+ const colors = getToolbarColors(variant, customColors);
22867
23238
  const isHorizontal = orientation === "horizontal";
22868
23239
  const effectiveExpanded = expanded && (!scrollBehavior || scrollBehavior.isExpanded);
22869
23240
  const isFabBefore = fabPosition === "start" || fabPosition === "top";
@@ -22941,7 +23312,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22941
23312
  expanded,
22942
23313
  colors,
22943
23314
  disableScrollTranslation: true,
22944
- disableLayoutAnimation: true
23315
+ disableLayoutAnimation: true,
23316
+ className: className ? cn("h-full", className) : void 0
22945
23317
  }, props)
22946
23318
  ) : /* @__PURE__ */ jsxRuntime.jsx(
22947
23319
  VerticalFloatingToolbar,
@@ -22949,7 +23321,8 @@ var FloatingToolbarWithFabBase = React59__namespace.forwardRef(
22949
23321
  expanded,
22950
23322
  colors,
22951
23323
  disableScrollTranslation: true,
22952
- disableLayoutAnimation: true
23324
+ disableLayoutAnimation: true,
23325
+ className: className ? cn("w-full", className) : void 0
22953
23326
  }, props)
22954
23327
  )
22955
23328
  },
@@ -22979,7 +23352,7 @@ var ToolbarDivider = ({
22979
23352
  "aria-orientation": isHorizontalToolbar ? "vertical" : "horizontal",
22980
23353
  className: cn(
22981
23354
  "shrink-0 bg-current opacity-30 border-none",
22982
- 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",
22983
23356
  className
22984
23357
  ),
22985
23358
  style: {
@@ -23002,20 +23375,47 @@ var VARIANT_TO_COLOR_STYLE = {
23002
23375
  };
23003
23376
  var ToolbarIconButton = React59__namespace.forwardRef(
23004
23377
  (_a, ref) => {
23005
- 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();
23006
23392
  const widthClass = TOOLBAR_ICON_BUTTON_WIDTH[toolbarSize];
23007
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
+ };
23008
23400
  return /* @__PURE__ */ jsxRuntime.jsx(
23009
23401
  IconButton,
23010
- __spreadValues({
23402
+ __spreadValues(__spreadProps(__spreadValues({
23011
23403
  ref,
23012
- variant: "default",
23404
+ asChild,
23013
23405
  colorStyle,
23014
23406
  size: "md",
23015
23407
  shape: "round",
23016
- iconSize: ToolbarIconButtonTokens.IconSize,
23017
- className: cn("h-[48px]", widthClass, className)
23018
- }, 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)
23019
23419
  );
23020
23420
  }
23021
23421
  );
@@ -23086,6 +23486,195 @@ function useFloatingToolbarScrollBehavior(options = {}) {
23086
23486
  exitDirection
23087
23487
  };
23088
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";
23089
23678
 
23090
23679
  // src/ui/tooltip/tooltip.tokens.ts
23091
23680
  var TooltipTokens = {
@@ -23883,6 +24472,8 @@ exports.ToolbarDivider = ToolbarDivider;
23883
24472
  exports.ToolbarDividerTokens = ToolbarDividerTokens;
23884
24473
  exports.ToolbarIconButton = ToolbarIconButton;
23885
24474
  exports.ToolbarIconButtonTokens = ToolbarIconButtonTokens;
24475
+ exports.ToolbarToggleButton = ToolbarToggleButton;
24476
+ exports.ToolbarToggleButtonTokens = ToolbarToggleButtonTokens;
23886
24477
  exports.TooltipBox = TooltipBox;
23887
24478
  exports.TooltipCaretShape = TooltipCaretShape;
23888
24479
  exports.TooltipTokens = TooltipTokens;
@@ -23912,6 +24503,7 @@ exports.convex = convex;
23912
24503
  exports.cornerFeature = cornerFeature;
23913
24504
  exports.cornerRounding = cornerRounding;
23914
24505
  exports.createDoubleMapper = createDoubleMapper;
24506
+ exports.createMd3ExpressiveTheme = createMd3ExpressiveTheme;
23915
24507
  exports.directionVector = directionVector;
23916
24508
  exports.distance = distance;
23917
24509
  exports.distanceSquared = distanceSquared;
@@ -23925,6 +24517,7 @@ exports.getDistance = getDistance;
23925
24517
  exports.getDistanceSquared = getDistanceSquared;
23926
24518
  exports.getExpressiveShape = getExpressiveShape;
23927
24519
  exports.getListItemHeight = getListItemHeight;
24520
+ exports.getToolbarColors = getToolbarColors;
23928
24521
  exports.interpolate = interpolate;
23929
24522
  exports.interpolatePath = interpolatePath;
23930
24523
  exports.lerpPoint = lerpPoint;
@@ -23942,6 +24535,9 @@ exports.square = square;
23942
24535
  exports.standardFloatingToolbarColors = standardFloatingToolbarColors;
23943
24536
  exports.star = star;
23944
24537
  exports.subtractPoints = subtractPoints;
24538
+ exports.surfaceContainerHighFloatingToolbarColors = surfaceContainerHighFloatingToolbarColors;
24539
+ exports.surfaceContainerHighestFloatingToolbarColors = surfaceContainerHighestFloatingToolbarColors;
24540
+ exports.tertiaryContainerFloatingToolbarColors = tertiaryContainerFloatingToolbarColors;
23945
24541
  exports.toClipPath = toClipPath;
23946
24542
  exports.toSvgPath = toSvgPath;
23947
24543
  exports.transformFeature = transformFeature;
@@ -23968,5 +24564,6 @@ exports.useTooltipPosition = useTooltipPosition;
23968
24564
  exports.useTooltipState = useTooltipState;
23969
24565
  exports.useTypography = useTypography;
23970
24566
  exports.vibrantFloatingToolbarColors = vibrantFloatingToolbarColors;
24567
+ exports.xrFloatingToolbarColors = xrFloatingToolbarColors;
23971
24568
  //# sourceMappingURL=index.js.map
23972
24569
  //# sourceMappingURL=index.js.map