@bug-on/m3-expressive 1.0.0

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 (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +110 -0
  3. package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
  4. package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  5. package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  6. package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  7. package/dist/assets/loading-indicator.svg +19 -0
  8. package/dist/assets/material-symbols-cdn.css +65 -0
  9. package/dist/assets/material-symbols-self-hosted.css +94 -0
  10. package/dist/buttons.d.mts +180 -0
  11. package/dist/buttons.d.ts +180 -0
  12. package/dist/buttons.js +4282 -0
  13. package/dist/buttons.js.map +1 -0
  14. package/dist/buttons.mjs +4227 -0
  15. package/dist/buttons.mjs.map +1 -0
  16. package/dist/core.d.mts +422 -0
  17. package/dist/core.d.ts +422 -0
  18. package/dist/core.js +2581 -0
  19. package/dist/core.js.map +1 -0
  20. package/dist/core.mjs +2547 -0
  21. package/dist/core.mjs.map +1 -0
  22. package/dist/feedback.d.mts +600 -0
  23. package/dist/feedback.d.ts +600 -0
  24. package/dist/feedback.js +2357 -0
  25. package/dist/feedback.js.map +1 -0
  26. package/dist/feedback.mjs +2321 -0
  27. package/dist/feedback.mjs.map +1 -0
  28. package/dist/forms.d.mts +40 -0
  29. package/dist/forms.d.ts +40 -0
  30. package/dist/forms.js +4263 -0
  31. package/dist/forms.js.map +1 -0
  32. package/dist/forms.mjs +4228 -0
  33. package/dist/forms.mjs.map +1 -0
  34. package/dist/icon-button-D-gs0gfj.d.mts +136 -0
  35. package/dist/icon-button-D-gs0gfj.d.ts +136 -0
  36. package/dist/index.css +309 -0
  37. package/dist/index.css.d.ts +2 -0
  38. package/dist/index.d.mts +24 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.js +23972 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +23668 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/layout.d.mts +610 -0
  45. package/dist/layout.d.ts +610 -0
  46. package/dist/layout.js +5091 -0
  47. package/dist/layout.js.map +1 -0
  48. package/dist/layout.mjs +5042 -0
  49. package/dist/layout.mjs.map +1 -0
  50. package/dist/material-symbols-cdn.css +65 -0
  51. package/dist/material-symbols-cdn.css.d.ts +2 -0
  52. package/dist/material-symbols-self-hosted.css +94 -0
  53. package/dist/material-symbols-self-hosted.css.d.ts +2 -0
  54. package/dist/md3-DFhj-NZj.d.mts +17 -0
  55. package/dist/md3-DFhj-NZj.d.ts +17 -0
  56. package/dist/navigation.d.mts +2766 -0
  57. package/dist/navigation.d.ts +2766 -0
  58. package/dist/navigation.js +6684 -0
  59. package/dist/navigation.js.map +1 -0
  60. package/dist/navigation.mjs +6573 -0
  61. package/dist/navigation.mjs.map +1 -0
  62. package/dist/overlays.d.mts +161 -0
  63. package/dist/overlays.d.ts +161 -0
  64. package/dist/overlays.js +3298 -0
  65. package/dist/overlays.js.map +1 -0
  66. package/dist/overlays.mjs +3244 -0
  67. package/dist/overlays.mjs.map +1 -0
  68. package/dist/pickers.d.mts +1074 -0
  69. package/dist/pickers.d.ts +1074 -0
  70. package/dist/pickers.js +4240 -0
  71. package/dist/pickers.js.map +1 -0
  72. package/dist/pickers.mjs +4200 -0
  73. package/dist/pickers.mjs.map +1 -0
  74. package/dist/plugin.d.mts +1 -0
  75. package/dist/plugin.d.ts +1 -0
  76. package/dist/plugin.js +13 -0
  77. package/dist/plugin.js.map +1 -0
  78. package/dist/plugin.mjs +3 -0
  79. package/dist/plugin.mjs.map +1 -0
  80. package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
  81. package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
  82. package/dist/shapes.d.mts +1119 -0
  83. package/dist/shapes.d.ts +1119 -0
  84. package/dist/shapes.js +2941 -0
  85. package/dist/shapes.js.map +1 -0
  86. package/dist/shapes.mjs +2889 -0
  87. package/dist/shapes.mjs.map +1 -0
  88. package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
  89. package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
  90. package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
  91. package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
  92. package/dist/text-field-eAIpz9z1.d.mts +1038 -0
  93. package/dist/text-field-eAIpz9z1.d.ts +1038 -0
  94. package/dist/typography-339RV6v7.d.mts +486 -0
  95. package/dist/typography-339RV6v7.d.ts +486 -0
  96. package/dist/typography.css +22 -0
  97. package/dist/typography.css.d.ts +2 -0
  98. package/package.json +207 -0
package/dist/core.js ADDED
@@ -0,0 +1,2581 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var React11 = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var materialColorUtilities = require('@material/material-color-utilities');
7
+ var clsx = require('clsx');
8
+ var tailwindMerge = require('tailwind-merge');
9
+ var react = require('motion/react');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var React11__namespace = /*#__PURE__*/_interopNamespace(React11);
30
+
31
+ var __defProp = Object.defineProperty;
32
+ var __defProps = Object.defineProperties;
33
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
34
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
35
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
36
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
37
+ var __typeError = (msg) => {
38
+ throw TypeError(msg);
39
+ };
40
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
41
+ var __spreadValues = (a, b) => {
42
+ for (var prop in b || (b = {}))
43
+ if (__hasOwnProp.call(b, prop))
44
+ __defNormalProp(a, prop, b[prop]);
45
+ if (__getOwnPropSymbols)
46
+ for (var prop of __getOwnPropSymbols(b)) {
47
+ if (__propIsEnum.call(b, prop))
48
+ __defNormalProp(a, prop, b[prop]);
49
+ }
50
+ return a;
51
+ };
52
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
53
+ var __objRest = (source, exclude) => {
54
+ var target = {};
55
+ for (var prop in source)
56
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
57
+ target[prop] = source[prop];
58
+ if (source != null && __getOwnPropSymbols)
59
+ for (var prop of __getOwnPropSymbols(source)) {
60
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
61
+ target[prop] = source[prop];
62
+ }
63
+ return target;
64
+ };
65
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
66
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
67
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
68
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
69
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
70
+ function useMediaQuery(query) {
71
+ const [matches, setMatches] = React11.useState(false);
72
+ React11.useEffect(() => {
73
+ const mql = window.matchMedia(query);
74
+ const handler = (e) => setMatches(e.matches);
75
+ setMatches(mql.matches);
76
+ mql.addEventListener("change", handler);
77
+ return () => mql.removeEventListener("change", handler);
78
+ }, [query]);
79
+ return matches;
80
+ }
81
+ function useRipple(options = {}) {
82
+ const {
83
+ duration = 600,
84
+ color = "currentColor",
85
+ opacity = 0.12,
86
+ disabled = false
87
+ } = options;
88
+ const ref = React11.useRef(null);
89
+ const onPointerDown = React11.useCallback(
90
+ (event) => {
91
+ if (disabled || !ref.current) return;
92
+ const el = ref.current;
93
+ const rect = el.getBoundingClientRect();
94
+ const size = Math.max(rect.width, rect.height) * 2;
95
+ const x = event.clientX - rect.left - size / 2;
96
+ const y = event.clientY - rect.top - size / 2;
97
+ const ripple = document.createElement("span");
98
+ ripple.setAttribute("aria-hidden", "true");
99
+ Object.assign(ripple.style, {
100
+ position: "absolute",
101
+ borderRadius: "50%",
102
+ pointerEvents: "none",
103
+ width: `${size}px`,
104
+ height: `${size}px`,
105
+ left: `${x}px`,
106
+ top: `${y}px`,
107
+ background: color,
108
+ opacity: String(opacity),
109
+ transform: "scale(0)",
110
+ transition: `transform ${duration}ms cubic-bezier(0.2, 0, 0, 1), opacity ${duration * 0.6}ms ease-out`
111
+ });
112
+ el.appendChild(ripple);
113
+ requestAnimationFrame(() => {
114
+ ripple.style.transform = "scale(1)";
115
+ });
116
+ const cleanup = () => {
117
+ ripple.style.opacity = "0";
118
+ setTimeout(() => {
119
+ if (el.contains(ripple)) el.removeChild(ripple);
120
+ }, duration * 0.6);
121
+ el.removeEventListener("pointerup", cleanup);
122
+ el.removeEventListener("pointerleave", cleanup);
123
+ };
124
+ el.addEventListener("pointerup", cleanup, { once: true });
125
+ el.addEventListener("pointerleave", cleanup, { once: true });
126
+ },
127
+ [disabled, duration, color, opacity]
128
+ );
129
+ return { rippleRef: ref, onPointerDown };
130
+ }
131
+ function MaterialSymbolsPreconnect({
132
+ variants = ["outlined"]
133
+ }) {
134
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
135
+ /* @__PURE__ */ jsxRuntime.jsx("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }),
136
+ /* @__PURE__ */ jsxRuntime.jsx(
137
+ "link",
138
+ {
139
+ rel: "preconnect",
140
+ href: "https://fonts.gstatic.com",
141
+ crossOrigin: "anonymous"
142
+ }
143
+ ),
144
+ variants.includes("outlined") && /* @__PURE__ */ jsxRuntime.jsx(
145
+ "link",
146
+ {
147
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
148
+ rel: "stylesheet",
149
+ precedence: "default"
150
+ }
151
+ ),
152
+ variants.includes("rounded") && /* @__PURE__ */ jsxRuntime.jsx(
153
+ "link",
154
+ {
155
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
156
+ rel: "stylesheet",
157
+ precedence: "default"
158
+ }
159
+ ),
160
+ variants.includes("sharp") && /* @__PURE__ */ jsxRuntime.jsx(
161
+ "link",
162
+ {
163
+ href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap",
164
+ rel: "stylesheet",
165
+ precedence: "default"
166
+ }
167
+ )
168
+ ] });
169
+ }
170
+ function resolveMode(mode) {
171
+ if (mode !== "system") return mode;
172
+ if (typeof window === "undefined") return "light";
173
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
174
+ }
175
+ function generateM3Theme(sourceColorHex, mode = "light") {
176
+ const sourceColor = materialColorUtilities.argbFromHex(sourceColorHex);
177
+ const theme = materialColorUtilities.themeFromSourceColor(sourceColor);
178
+ const scheme = mode === "light" ? theme.schemes.light : theme.schemes.dark;
179
+ const palettes = theme.palettes;
180
+ const tone = (palette, t) => materialColorUtilities.hexFromArgb(palette.tone(t));
181
+ return {
182
+ primary: materialColorUtilities.hexFromArgb(scheme.primary),
183
+ onPrimary: materialColorUtilities.hexFromArgb(scheme.onPrimary),
184
+ primaryContainer: materialColorUtilities.hexFromArgb(scheme.primaryContainer),
185
+ onPrimaryContainer: materialColorUtilities.hexFromArgb(scheme.onPrimaryContainer),
186
+ inversePrimary: materialColorUtilities.hexFromArgb(scheme.inversePrimary),
187
+ primaryFixed: tone(palettes.primary, 90),
188
+ primaryFixedDim: tone(palettes.primary, 80),
189
+ onPrimaryFixed: tone(palettes.primary, 10),
190
+ onPrimaryFixedVariant: tone(palettes.primary, 30),
191
+ secondary: materialColorUtilities.hexFromArgb(scheme.secondary),
192
+ onSecondary: materialColorUtilities.hexFromArgb(scheme.onSecondary),
193
+ secondaryContainer: materialColorUtilities.hexFromArgb(scheme.secondaryContainer),
194
+ onSecondaryContainer: materialColorUtilities.hexFromArgb(scheme.onSecondaryContainer),
195
+ secondaryFixed: tone(palettes.secondary, 90),
196
+ secondaryFixedDim: tone(palettes.secondary, 80),
197
+ onSecondaryFixed: tone(palettes.secondary, 10),
198
+ onSecondaryFixedVariant: tone(palettes.secondary, 30),
199
+ tertiary: materialColorUtilities.hexFromArgb(scheme.tertiary),
200
+ onTertiary: materialColorUtilities.hexFromArgb(scheme.onTertiary),
201
+ tertiaryContainer: materialColorUtilities.hexFromArgb(scheme.tertiaryContainer),
202
+ onTertiaryContainer: materialColorUtilities.hexFromArgb(scheme.onTertiaryContainer),
203
+ tertiaryFixed: tone(palettes.tertiary, 90),
204
+ tertiaryFixedDim: tone(palettes.tertiary, 80),
205
+ onTertiaryFixed: tone(palettes.tertiary, 10),
206
+ onTertiaryFixedVariant: tone(palettes.tertiary, 30),
207
+ error: materialColorUtilities.hexFromArgb(scheme.error),
208
+ onError: materialColorUtilities.hexFromArgb(scheme.onError),
209
+ errorContainer: materialColorUtilities.hexFromArgb(scheme.errorContainer),
210
+ onErrorContainer: materialColorUtilities.hexFromArgb(scheme.onErrorContainer),
211
+ surface: materialColorUtilities.hexFromArgb(scheme.surface),
212
+ onSurface: materialColorUtilities.hexFromArgb(scheme.onSurface),
213
+ surfaceVariant: materialColorUtilities.hexFromArgb(scheme.surfaceVariant),
214
+ onSurfaceVariant: materialColorUtilities.hexFromArgb(scheme.onSurfaceVariant),
215
+ surfaceTint: materialColorUtilities.hexFromArgb(scheme.primary),
216
+ // Surface container roles from neutral palette tones
217
+ surfaceContainerLowest: mode === "light" ? tone(palettes.neutral, 100) : tone(palettes.neutral, 4),
218
+ surfaceContainerLow: mode === "light" ? tone(palettes.neutral, 96) : tone(palettes.neutral, 10),
219
+ surfaceContainer: mode === "light" ? tone(palettes.neutral, 94) : tone(palettes.neutral, 12),
220
+ surfaceContainerHigh: mode === "light" ? tone(palettes.neutral, 92) : tone(palettes.neutral, 17),
221
+ surfaceContainerHighest: mode === "light" ? tone(palettes.neutral, 90) : tone(palettes.neutral, 22),
222
+ inverseSurface: materialColorUtilities.hexFromArgb(scheme.inverseSurface),
223
+ inverseOnSurface: materialColorUtilities.hexFromArgb(scheme.inverseOnSurface),
224
+ background: materialColorUtilities.hexFromArgb(scheme.background),
225
+ onBackground: materialColorUtilities.hexFromArgb(scheme.onBackground),
226
+ outline: materialColorUtilities.hexFromArgb(scheme.outline),
227
+ outlineVariant: materialColorUtilities.hexFromArgb(scheme.outlineVariant),
228
+ shadow: materialColorUtilities.hexFromArgb(scheme.shadow),
229
+ scrim: materialColorUtilities.hexFromArgb(scheme.scrim)
230
+ };
231
+ }
232
+ function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
233
+ const resolved = resolveMode(mode);
234
+ const colors = generateM3Theme(sourceColorHex, resolved);
235
+ for (const [key, value] of Object.entries(colors)) {
236
+ const kebabKey = key.replace(/[A-Z]/g, (m7) => `-${m7.toLowerCase()}`);
237
+ root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
238
+ root.style.setProperty(`--color-m3-${kebabKey}`, value);
239
+ }
240
+ root.setAttribute("data-theme", resolved);
241
+ }
242
+ function cn(...inputs) {
243
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
244
+ }
245
+
246
+ // src/ui/shared/motion-tokens.ts
247
+ var DEFAULT_SPATIAL_SPRING = {
248
+ type: "spring",
249
+ stiffness: 380,
250
+ damping: 31.19
251
+ };
252
+ var FAST_EFFECTS_SPRING = {
253
+ type: "spring",
254
+ stiffness: 3800,
255
+ damping: 123.29
256
+ };
257
+ var DEFAULT_EFFECTS_SPRING = {
258
+ type: "spring",
259
+ stiffness: 1600,
260
+ damping: 80
261
+ };
262
+
263
+ // src/ui/shared/constants.ts
264
+ var SPRING_TRANSITION_FAST = FAST_EFFECTS_SPRING;
265
+ var SPRING_TRANSITION = DEFAULT_EFFECTS_SPRING;
266
+ var ICON_SPAN_VARIANTS = {
267
+ initial: { scale: 0.01 },
268
+ animate: { scale: 1 },
269
+ exit: { scale: 0.01 }
270
+ };
271
+ var VARIANT_FONT = {
272
+ outlined: "'Material Symbols Outlined'",
273
+ rounded: "'Material Symbols Rounded'",
274
+ sharp: "'Material Symbols Sharp'"
275
+ };
276
+ var IconComponent = React11__namespace.forwardRef(
277
+ (_a, ref) => {
278
+ var _b = _a, {
279
+ name,
280
+ variant = "outlined",
281
+ fill = 0,
282
+ weight = 400,
283
+ grade = 0,
284
+ opticalSize = 24,
285
+ size,
286
+ animateFill = false,
287
+ className,
288
+ style
289
+ } = _b, restProps = __objRest(_b, [
290
+ "name",
291
+ "variant",
292
+ "fill",
293
+ "weight",
294
+ "grade",
295
+ "opticalSize",
296
+ "size",
297
+ "animateFill",
298
+ "className",
299
+ "style"
300
+ ]);
301
+ const fontVariationSettings = `'FILL' ${fill}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opticalSize}`;
302
+ const computedStyle = __spreadValues({
303
+ fontFamily: VARIANT_FONT[variant],
304
+ fontSize: size === "inherit" ? "inherit" : size != null ? `${size}px` : `${opticalSize}px`,
305
+ fontVariationSettings
306
+ }, style);
307
+ if (animateFill) {
308
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
309
+ react.m.span,
310
+ __spreadProps(__spreadValues({
311
+ ref,
312
+ className: cn(
313
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
314
+ className
315
+ ),
316
+ "aria-hidden": "true",
317
+ animate: { fontVariationSettings },
318
+ transition: SPRING_TRANSITION_FAST,
319
+ style: computedStyle
320
+ }, restProps), {
321
+ children: name
322
+ })
323
+ ) });
324
+ }
325
+ return /* @__PURE__ */ jsxRuntime.jsx(
326
+ "span",
327
+ __spreadProps(__spreadValues({
328
+ ref,
329
+ className: cn(
330
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
331
+ className
332
+ ),
333
+ "aria-hidden": "true",
334
+ style: computedStyle
335
+ }, restProps), {
336
+ children: name
337
+ })
338
+ );
339
+ }
340
+ );
341
+ IconComponent.displayName = "Icon";
342
+ var Icon = React11__namespace.memo(IconComponent);
343
+ var RippleItem = React11__namespace.memo(function RippleItem2({
344
+ ripple,
345
+ onDone
346
+ }) {
347
+ return /* @__PURE__ */ jsxRuntime.jsx(
348
+ react.m.span,
349
+ {
350
+ "aria-hidden": "true",
351
+ style: {
352
+ position: "absolute",
353
+ left: ripple.x - ripple.size / 2,
354
+ top: ripple.y - ripple.size / 2,
355
+ width: ripple.size,
356
+ height: ripple.size,
357
+ borderRadius: "50%",
358
+ backgroundColor: "currentColor",
359
+ pointerEvents: "none",
360
+ transformOrigin: "center"
361
+ },
362
+ initial: { scale: 0, opacity: 0.12 },
363
+ animate: { scale: 1, opacity: 0 },
364
+ exit: { opacity: 0 },
365
+ transition: {
366
+ scale: { duration: 0.5, ease: [0.2, 0, 0, 1] },
367
+ opacity: { duration: 0.4, ease: "easeOut", delay: 0.1 }
368
+ },
369
+ onAnimationComplete: () => onDone(ripple.id)
370
+ },
371
+ ripple.id
372
+ );
373
+ });
374
+ function Ripple({
375
+ ripples,
376
+ onRippleDone,
377
+ disabled = false,
378
+ respectSystemMotion = true
379
+ }) {
380
+ const prefersReduced = react.useReducedMotion();
381
+ if (disabled) return null;
382
+ if (respectSystemMotion && prefersReduced) return null;
383
+ return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: ripples.map((r) => /* @__PURE__ */ jsxRuntime.jsx(RippleItem, { ripple: r, onDone: onRippleDone }, r.id)) });
384
+ }
385
+ function useRippleState(options = {}) {
386
+ const { disabled = false } = options;
387
+ const [ripples, setRipples] = React11__namespace.useState([]);
388
+ const onPointerDown = React11__namespace.useCallback(
389
+ (e) => {
390
+ if (disabled) return;
391
+ const rect = e.currentTarget.getBoundingClientRect();
392
+ const x = e.clientX - rect.left;
393
+ const y = e.clientY - rect.top;
394
+ const rippleSize = Math.hypot(rect.width, rect.height) * 2;
395
+ setRipples((prev) => [
396
+ ...prev,
397
+ { id: Date.now(), x, y, size: rippleSize }
398
+ ]);
399
+ },
400
+ [disabled]
401
+ );
402
+ const removeRipple = React11__namespace.useCallback((id) => {
403
+ setRipples((prev) => prev.filter((r) => r.id !== id));
404
+ }, []);
405
+ return { ripples, onPointerDown, removeRipple };
406
+ }
407
+ var useRipple2 = useRippleState;
408
+ var SHAPE_KEY_TIMES = "0; 0.14; 0.14; 0.29; 0.29; 0.43; 0.43; 0.57; 0.57; 0.71; 0.71; 0.86; 0.86; 1";
409
+ var SHAPE_KEY_SPLINES = [
410
+ "0.5 0.2 0 0.8",
411
+ "0.5 0.2 0 0.8",
412
+ "0.5 0.2 0 0.8",
413
+ "0.5 0.2 0 0.8",
414
+ "0.5 0.2 0 0.8",
415
+ "0.5 0.2 0 0.8",
416
+ "0.5 0.2 0 0.8",
417
+ "0.5 0.2 0 0.8",
418
+ "0.5 0.2 0 0.8",
419
+ "0.5 0.2 0 0.8",
420
+ "0.5 0.2 0 0.8",
421
+ "0.5 0.2 0 0.8",
422
+ "0.5 0.2 0 0.8"
423
+ ].join("; ");
424
+ var SHAPE_VALUES = [
425
+ "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z",
426
+ "M20.3 8.6 21.1 8 22 7.6 23 7.3 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.2 15.5 37.6 16.5 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8 17.6 9.8 18.6 9.6 19.5 9.2Z",
427
+ "M18.6 9.6 19.5 9.2 20.3 8.6 21.1 8 22 7.6 23 7.3 24 7.2 25 7.3 25.9 7.5 26.8 8 27.6 8.6 28.4 9.1 29.3 9.6 30.3 9.8 31.3 9.9 32.3 10 33.3 10.2 34.2 10.6 35 11.2 35.7 11.9 36.3 12.7 36.7 13.6 36.9 14.6 37.2 15.5 37.6 16.4 38.2 17.3 38.9 18 39.6 18.7 40.2 19.5 40.6 20.4 40.9 21.3 41 22.3 40.9 23.3 40.6 24.3 40.2 25.2 39.8 26.1 39.5 27 39.4 28 39.5 29 39.6 30 39.5 31 39.3 32 38.9 32.9 38.3 33.7 37.6 34.4 36.8 35 35.9 35.4 35 35.8 34.1 36.3 33.4 37 32.9 37.9 32.3 38.7 31.6 39.4 30.8 40 29.9 40.4 28.9 40.7 27.9 40.8 27 40.7 26 40.4 25 40.1 24 40 23 40.1 22.1 40.4 21.1 40.7 20.1 40.8 19.1 40.7 18.2 40.5 17.3 40 16.4 39.5 15.7 38.8 15.2 37.9 14.6 37.1 13.9 36.4 13.1 35.8 12.2 35.4 11.3 35 10.5 34.4 9.7 33.8 9.1 32.9 8.7 32 8.5 31.1 8.4 30.1 8.5 29.1 8.6 28.1 8.5 27.1 8.3 26.1 7.8 25.2 7.4 24.3 7.1 23.4 7 22.4 7.1 21.4 7.3 20.4 7.8 19.5 8.3 18.7 9.1 18 9.8 17.3 10.4 16.5 10.8 15.6 11 14.6 11.3 13.7 11.7 12.8 12.2 11.9 12.9 11.2 13.8 10.7 14.7 10.2 15.6 10 16.6 9.9 17.6 9.8Z",
428
+ "M18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.2 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 33.7 13.1 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.5 30.5 39.5 30 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7.1 21.7 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8 15.4 12.3 16.2 11.7 17 11.1 17.8 10.5Z",
429
+ "M15.4 12.3 16.2 11.7 17 11.1 17.8 10.5 18.6 9.9 19.5 9.4 20.3 8.8 21.1 8.3 22 7.8 23 7.6 23.9 7.5 24.9 7.6 25.9 7.8 26.8 8.2 27.6 8.7 28.5 9.3 29.3 9.9 30.1 10.5 30.9 11 31.7 11.6 32.5 12.2 33.3 12.8 34.1 13.3 34.9 13.9 35.7 14.5 36.6 15 37.4 15.6 38.2 16.2 39 16.8 39.7 17.5 40.2 18.3 40.7 19.2 40.9 20.1 41 21.1 40.9 22.1 40.7 23.1 40.3 24 40 24.9 39.7 25.9 39.4 26.8 39 27.8 38.7 28.7 38.4 29.6 38.1 30.6 37.8 31.5 37.5 32.5 37.2 33.4 36.9 34.4 36.6 35.3 36.2 36.2 35.7 37.1 35 37.8 34.3 38.4 33.4 38.9 32.5 39.3 31.5 39.4 30.5 39.5 29.5 39.5 28.5 39.5 27.5 39.5 26.5 39.5 25.5 39.4 24.5 39.4 23.6 39.4 22.6 39.4 21.6 39.5 20.6 39.5 19.6 39.5 18.6 39.5 17.6 39.5 16.6 39.5 15.6 39.3 14.7 39 13.8 38.5 13.1 37.9 12.4 37.2 11.9 36.3 11.5 35.4 11.2 34.5 10.9 33.5 10.6 32.6 10.3 31.6 10 30.7 9.7 29.7 9.3 28.8 9 27.9 8.7 26.9 8.4 26 8 25 7.7 24.1 7.4 23.2 7.1 22.2 7 21.2 7.1 20.2 7.3 19.3 7.7 18.4 8.3 17.5 8.9 16.8 9.7 16.2 10.5 15.6 11.4 15.1 12.2 14.5 13 14 13.8 13.4 14.6 12.8Z",
430
+ "M17 12.8 17.7 12.1 18.5 11.5 19.3 10.9 20.1 10.5 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 25 9 26 9 27 9 27.6 9.1 28 9.1 28.9 9.3 29.9 9.6 30.9 9.9 31.8 10.3 32.6 10.8 33.5 11.3 34.3 11.9 34.6 12.2 35 12.6 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.6 18.5 38.6 18.7 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.3 38.2 26.4 37.8 27.3 37.4 28.2 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.8 32.5 33.5 32.8 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.2 37.3 27.9 37.5 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 22.5 39 21.5 39 20.5 38.9 20.4 38.9 19.5 38.8 18.6 38.6 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.4 35.8 13.3 35.8 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.6 30 9.4 29.3 9.3 29 9.1 28 9 27 9 26 9 25 9.2 24 9.4 23 9.6 22.1 9.8 21.7 10 21.1 10.4 20.2 10.9 19.4 11.4 18.5 12.1 17.8 12.7 17 13.4 16.3 14.2 15.6 14.2 15.5 14.9 14.9 15.6 14.2 16.3 13.5Z",
431
+ "M33.5 11.3 34.3 11.9 35 12.6 35.3 12.8 35.7 13.3 36.4 14.1 36.9 14.9 37.4 15.8 37.9 16.6 38.3 17.6 38.3 17.7 38.6 18.5 38.8 19.5 38.9 20.5 39 21.5 39 22.5 38.9 23.5 38.9 23.5 38.7 24.5 38.5 25.4 38.2 26.4 37.8 27.3 37.4 28.2 36.9 28.9 36.8 29.1 36.2 29.9 35.6 30.6 34.9 31.3 34.2 32 33.5 32.8 33.1 33.2 32.8 33.5 32.1 34.2 31.4 34.9 30.7 35.6 29.9 36.2 29.1 36.8 28.7 37 28.2 37.3 27.4 37.8 26.4 38.2 25.5 38.5 24.5 38.7 23.5 38.9 23.3 38.9 22.5 39 21.5 39 20.5 38.9 19.5 38.8 18.6 38.6 17.6 38.3 17.6 38.3 16.7 37.9 15.8 37.5 14.9 37 14.1 36.4 13.3 35.8 12.7 35.2 12.6 35.1 12 34.3 11.3 33.5 10.8 32.7 10.3 31.8 9.9 30.9 9.7 30.3 9.6 29.9 9.3 29 9.1 28 9 27 9 26 9 25 9.1 24.5 9.2 24 9.4 23 9.6 22.1 10 21.1 10.4 20.2 10.9 19.4 11.1 19.1 11.5 18.5 12.1 17.7 12.7 17 13.5 16.3 14.2 15.6 14.9 14.9 14.9 14.8 15.6 14.2 16.3 13.5 17 12.8 17.7 12.1 18.5 11.5 19.3 11 19.3 10.9 20.2 10.4 21.1 10 22 9.7 23 9.4 24 9.2 24.7 9.1 25 9 26 9 27 9 28 9.1 28.9 9.3 29.9 9.6 30.4 9.7 30.9 9.9 31.8 10.3 32.6 10.8Z",
432
+ "M33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.8 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.6 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7 27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1Z",
433
+ "M27.7 9.4 28.5 10 29.3 10.6 30.2 10.9 31.2 11 32.2 11.1 33.2 11.1 34.2 11.2 35.1 11.4 36 11.9 36.6 12.7 36.8 13.7 36.9 14.7 36.9 15.7 37 16.7 37.1 17.7 37.3 18.6 37.9 19.4 38.5 20.2 39.2 20.9 39.8 21.7 40.5 22.4 40.9 23.3 41 24.3 40.7 25.2 40.1 26 39.4 26.8 38.8 27.5 38.1 28.3 37.5 29.1 37.1 30 37 31 37 31.9 36.9 32.9 36.8 33.9 36.7 34.9 36.2 35.8 35.5 36.4 34.5 36.8 33.6 36.9 32.6 36.9 31.6 37 30.6 37.1 29.6 37.2 28.8 37.7 28 38.4 27.3 39 26.5 39.7 25.8 40.3 24.9 40.8 23.9 41 23 40.8 22.1 40.2 21.4 39.6 20.6 38.9 19.9 38.3 19.1 37.6 18.3 37.2 17.3 37 16.3 37 15.3 36.9 14.3 36.8 13.3 36.7 12.4 36.4 11.7 35.7 11.3 34.8 11.2 33.8 11.1 32.8 11 31.8 11 30.8 10.9 29.9 10.4 29 9.8 28.2 9.1 27.5 8.5 26.7 7.8 26 7.3 25.1 7 24.2 7.1 23.2 7.6 22.3 8.2 21.6 8.9 20.8 9.5 20.1 10.2 19.3 10.7 18.5 10.9 17.5 11 16.5 11.1 15.6 11.1 14.6 11.2 13.6 11.5 12.6 12.1 11.9 13 11.4 13.9 11.2 14.9 11.1 15.9 11 16.9 11 17.9 10.9 18.8 10.6 19.6 10 20.4 9.3 21.1 8.6 21.9 8 22.6 7.4 23.6 7 24.6 7.1 25.5 7.5 26.2 8.1 27 8.7Z",
434
+ "M27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 34.8 11.3 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.9 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.4 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35 36 35.7 35.3 36.4 34.4 37 34.1 37.2 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.6 10 30.1 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10 16.6 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 20.9 11 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11Z",
435
+ "M36 35.7 35.3 36.4 34.4 37 33.6 37.4 32.6 37.8 31.6 37.9 30.6 38 29.7 37.9 28.7 37.7 27.8 37.3 26.8 36.9 25.9 36.6 24.9 36.4 23.9 36.4 22.9 36.4 22 36.6 21 37 20.1 37.4 19.2 37.7 18.2 37.9 17.2 38 16.2 37.9 15.3 37.7 14.3 37.4 13.4 36.9 12.6 36.3 11.9 35.6 11.3 34.9 10.8 34 10.4 33.1 10.1 32.1 10 31.1 10 30.2 10.2 29.2 10.5 28.2 10.9 27.3 11.2 26.4 11.5 25.4 11.6 24.4 11.6 23.4 11.5 22.5 11.2 21.5 10.8 20.6 10.4 19.7 10.2 18.7 10 17.7 10 16.7 10.2 15.7 10.4 14.8 10.8 13.9 11.4 13 12 12.3 12.7 11.6 13.6 11 14.4 10.6 15.4 10.2 16.4 10.1 17.4 10 18.3 10.1 19.3 10.3 20.2 10.7 21.2 11.1 22.1 11.4 23.1 11.6 24.1 11.6 25.1 11.6 26 11.4 27 11 27.9 10.6 28.8 10.3 29.8 10.1 30.8 10 31.8 10.1 32.7 10.3 33.7 10.6 34.6 11.1 35.4 11.7 36.1 12.4 36.7 13.1 37.2 14 37.6 14.9 37.9 15.9 38 16.9 38 17.8 37.8 18.8 37.5 19.8 37.1 20.7 36.8 21.6 36.5 22.6 36.4 23.6 36.4 24.6 36.5 25.5 36.8 26.5 37.2 27.4 37.6 28.3 37.8 29.3 38 30.3 38 31.3 37.8 32.3 37.6 33.2 37.2 34.1 36.6 35Z",
436
+ "M32.1 32.1 31.4 32.8 30.7 33.5 29.9 34.1 29.1 34.7 28.3 35.3 27.6 35.8 27.5 35.8 26.6 36.4 25.8 36.8 24.9 37.3 24 37.7 23.1 38 22.1 38.3 21.2 38.6 20.2 38.8 19.2 38.9 18.2 39 17.2 39 16.6 38.9 16.3 38.9 15.3 38.7 14.3 38.4 13.4 38 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10 34.6 9.6 33.7 9.3 32.7 9.1 31.7 9.1 31.4 9 30.8 9 29.8 9.1 28.8 9.2 27.8 9.4 26.8 9.7 25.9 10 24.9 10.3 24 10.7 23.1 11.2 22.2 11.6 21.4 12.2 20.5 12.2 20.4 12.7 19.7 13.3 18.9 13.9 18.1 14.5 17.3 15.2 16.6 15.9 15.9 16.6 15.2 17.3 14.5 18.1 13.9 18.9 13.3 19.7 12.7 20.4 12.2 20.5 12.2 21.4 11.6 22.2 11.2 23.1 10.7 24 10.3 24.9 10 25.9 9.7 26.8 9.4 27.8 9.2 28.8 9.1 29.8 9 30.8 9 31.4 9.1 31.7 9.1 32.7 9.3 33.7 9.6 34.6 10 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 38 13.4 38.4 14.3 38.7 15.3 38.9 16.3 38.9 16.6 39 17.2 39 18.2 38.9 19.2 38.8 20.2 38.6 21.2 38.3 22.1 38 23.1 37.7 24 37.3 24.9 36.8 25.8 36.4 26.6 35.8 27.5 35.8 27.6 35.3 28.3 34.7 29.1 34.1 29.9 33.5 30.7 32.8 31.4Z",
437
+ "M24.3 10.2 24.9 10 25.9 9.7 26.8 9.4 27.1 9.4 27.8 9.2 28.8 9.1 29.8 9 29.9 9 30.8 9 31.7 9.1 32.7 9.3 32.8 9.3 33.7 9.6 34.6 10 35.5 10.5 35.5 10.5 36.3 11.1 36.9 11.7 37.5 12.5 37.5 12.5 38 13.4 38.4 14.3 38.7 15.2 38.7 15.3 38.9 16.3 39 17.2 39 18.1 39 18.2 38.9 19.2 38.8 20.2 38.6 20.9 38.6 21.2 38.3 22.1 38 23.1 37.8 23.7 37.7 24 37.3 24.9 36.8 25.8 36.5 26.4 36.4 26.6 35.8 27.5 35.3 28.3 35 28.8 34.7 29.1 34.1 29.9 33.5 30.7 33.1 31.1 32.8 31.4 32.1 32.1 31.4 32.8 31.1 33.1 30.7 33.5 29.9 34.1 29.1 34.7 28.8 35 28.3 35.3 27.5 35.8 26.6 36.4 26.4 36.5 25.8 36.8 24.9 37.3 24 37.7 23.7 37.8 23.1 38 22.1 38.3 21.2 38.6 20.9 38.6 20.2 38.8 19.2 38.9 18.2 39 18.1 39 17.2 39 16.3 38.9 15.3 38.7 15.2 38.7 14.3 38.4 13.4 38 12.5 37.5 12.5 37.5 11.7 36.9 11.1 36.3 10.5 35.5 10.5 35.5 10 34.6 9.6 33.7 9.3 32.8 9.3 32.7 9.1 31.7 9 30.8 9 29.9 9 29.8 9.1 28.8 9.2 27.8 9.4 27.1 9.4 26.8 9.7 25.9 10 24.9 10.2 24.3 10.3 24 10.7 23.1 11.2 22.2 11.5 21.6 11.6 21.4 12.2 20.5 12.7 19.7 13 19.2 13.3 18.9 13.9 18.1 14.5 17.3 14.9 16.9 15.2 16.6 15.9 15.9 16.6 15.2 16.9 14.9 17.3 14.5 18.1 13.9 18.9 13.3 19.2 13 19.7 12.7 20.5 12.2 21.4 11.6 21.6 11.5 22.2 11.2 23.1 10.7 24 10.3Z",
438
+ "M22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.3 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.4 38.9 26.2 39.6 27 40.2 27.7 40.5 28.6 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.8 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.6 9.1 21.8 8.4 21 7.8 20.3 7.5 19.4 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.2 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1 20.9 10.4 21.4 9.5 21.9 8.7Z"
439
+ ].join(";");
440
+ var ROTATE_KEY_TIMES = "0; 0.14; 0.29; 0.43; 0.57; 0.71; 0.86; 1";
441
+ var ROTATE_KEY_SPLINES = [
442
+ "0.5 0.2 0 0.8",
443
+ "0.5 0.2 0 0.8",
444
+ "0.5 0.2 0 0.8",
445
+ "0.5 0.2 0 0.8",
446
+ "0.5 0.2 0 0.8",
447
+ "0.5 0.2 0 0.8",
448
+ "0.5 0.2 0 0.8"
449
+ ].join("; ");
450
+ var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
451
+ var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
452
+ var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
453
+ var IndeterminateSvg = React11__namespace.memo(function IndeterminateSvg2({
454
+ size
455
+ }) {
456
+ const [ready, setReady] = React11__namespace.useState(false);
457
+ React11__namespace.useEffect(() => {
458
+ const raf = requestAnimationFrame(() => setReady(true));
459
+ return () => cancelAnimationFrame(raf);
460
+ }, []);
461
+ return /* @__PURE__ */ jsxRuntime.jsx(
462
+ "svg",
463
+ {
464
+ viewBox: "4 4 40 40",
465
+ width: size,
466
+ height: size,
467
+ fill: "currentColor",
468
+ xmlns: "http://www.w3.org/2000/svg",
469
+ "aria-hidden": "true",
470
+ focusable: "false",
471
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: SHAPE_VALUES.split(";")[0], children: ready && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
472
+ /* @__PURE__ */ jsxRuntime.jsx(
473
+ "animate",
474
+ {
475
+ attributeName: "d",
476
+ dur: "5s",
477
+ repeatCount: "indefinite",
478
+ calcMode: "spline",
479
+ keySplines: SHAPE_KEY_SPLINES,
480
+ keyTimes: SHAPE_KEY_TIMES,
481
+ values: SHAPE_VALUES
482
+ }
483
+ ),
484
+ /* @__PURE__ */ jsxRuntime.jsx(
485
+ "animateTransform",
486
+ {
487
+ attributeName: "transform",
488
+ attributeType: "XML",
489
+ type: "rotate",
490
+ dur: "5s",
491
+ repeatCount: "indefinite",
492
+ calcMode: "spline",
493
+ keySplines: ROTATE_KEY_SPLINES,
494
+ keyTimes: ROTATE_KEY_TIMES,
495
+ values: ROTATE_VALUES
496
+ }
497
+ )
498
+ ] }) })
499
+ }
500
+ );
501
+ });
502
+ var DeterminateSvg = React11__namespace.memo(function DeterminateSvg2({
503
+ size,
504
+ progress
505
+ }) {
506
+ const p = Math.min(1, Math.max(0, progress));
507
+ const rotation = -180 * p;
508
+ const pathD = p < 0.5 ? DETERMINATE_CIRCLE : DETERMINATE_SOFT_BURST;
509
+ return /* @__PURE__ */ jsxRuntime.jsx(
510
+ "svg",
511
+ {
512
+ viewBox: "4 4 40 40",
513
+ width: size,
514
+ height: size,
515
+ fill: "currentColor",
516
+ xmlns: "http://www.w3.org/2000/svg",
517
+ "aria-hidden": "true",
518
+ focusable: "false",
519
+ style: {
520
+ transform: `rotate(${rotation}deg)`,
521
+ transition: "transform 0.3s ease"
522
+ },
523
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: pathD, style: { transition: "d 0.3s ease" } })
524
+ }
525
+ );
526
+ });
527
+ var LoadingIndicator = React11__namespace.forwardRef(
528
+ (_a, ref) => {
529
+ var _b = _a, {
530
+ variant = "uncontained",
531
+ size = 48,
532
+ progress,
533
+ color,
534
+ className,
535
+ "aria-label": ariaLabel,
536
+ style
537
+ } = _b, restProps = __objRest(_b, [
538
+ "variant",
539
+ "size",
540
+ "progress",
541
+ "color",
542
+ "className",
543
+ "aria-label",
544
+ "style"
545
+ ]);
546
+ const isContained = variant === "contained";
547
+ const isDeterminate = progress !== void 0;
548
+ const clampedSize = Math.min(240, Math.max(24, size));
549
+ const scaleFactor = clampedSize / 48;
550
+ const containerSize = isContained ? 38 * scaleFactor : void 0;
551
+ const indicatorSize = isContained ? 24 * scaleFactor : clampedSize;
552
+ const activeColor = isContained ? color != null ? color : "var(--md-sys-color-indicator-contained-active)" : color != null ? color : "var(--md-sys-color-indicator-active)";
553
+ const ariaNow = isDeterminate ? Math.round(Math.min(1, Math.max(0, progress)) * 100) : void 0;
554
+ return /* @__PURE__ */ jsxRuntime.jsx(
555
+ "div",
556
+ __spreadProps(__spreadValues({
557
+ ref,
558
+ role: "progressbar",
559
+ "aria-label": ariaLabel,
560
+ "aria-valuemin": 0,
561
+ "aria-valuemax": 100,
562
+ "aria-valuenow": ariaNow,
563
+ className: cn(
564
+ "inline-flex items-center justify-center shrink-0",
565
+ className
566
+ ),
567
+ style: __spreadValues({
568
+ width: clampedSize,
569
+ height: clampedSize,
570
+ color: activeColor
571
+ }, style)
572
+ }, restProps), {
573
+ children: isContained ? /* @__PURE__ */ jsxRuntime.jsx(
574
+ "div",
575
+ {
576
+ className: "flex items-center justify-center rounded-full",
577
+ style: {
578
+ width: containerSize,
579
+ height: containerSize,
580
+ backgroundColor: "var(--md-sys-color-indicator-contained-container)"
581
+ },
582
+ children: isDeterminate ? /* @__PURE__ */ jsxRuntime.jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsxRuntime.jsx(IndeterminateSvg, { size: indicatorSize })
583
+ }
584
+ ) : isDeterminate ? /* @__PURE__ */ jsxRuntime.jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsxRuntime.jsx(IndeterminateSvg, { size: indicatorSize })
585
+ })
586
+ );
587
+ }
588
+ );
589
+ LoadingIndicator.displayName = "LoadingIndicator";
590
+
591
+ // src/ui/progress-indicator/utils.ts
592
+ function easeInOutCubic(x) {
593
+ return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
594
+ }
595
+ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
596
+ const circumference = 2 * Math.PI * radius;
597
+ const numWaves = Math.max(
598
+ 3,
599
+ Math.round(circumference / Math.max(1, wavelength))
600
+ );
601
+ const steps = numWaves * 4;
602
+ const dt = 2 * Math.PI / steps;
603
+ const rAt = (t) => radius + amplitude * Math.sin(numWaves * t);
604
+ const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t);
605
+ const xAt = (t) => center + rAt(t) * Math.cos(t);
606
+ const yAt = (t) => center + rAt(t) * Math.sin(t);
607
+ const dxAt = (t) => drAt(t) * Math.cos(t) - rAt(t) * Math.sin(t);
608
+ const dyAt = (t) => drAt(t) * Math.sin(t) + rAt(t) * Math.cos(t);
609
+ let d = "";
610
+ const tStart = 0;
611
+ for (let i = 0; i < steps; i++) {
612
+ const t0 = tStart + i * dt;
613
+ const t1 = tStart + (i + 1) * dt;
614
+ const scale = dt / 3;
615
+ const cp1x = xAt(t0) + scale * dxAt(t0);
616
+ const cp1y = yAt(t0) + scale * dyAt(t0);
617
+ const cp2x = xAt(t1) - scale * dxAt(t1);
618
+ const cp2y = yAt(t1) - scale * dyAt(t1);
619
+ if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
620
+ d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
621
+ }
622
+ d += " Z";
623
+ return d;
624
+ }
625
+ function getSinePath(startX, endX, phase, wl, amp) {
626
+ if (startX >= endX) return "";
627
+ let d = "";
628
+ const step = amp === 0 ? Math.max(10, endX - startX) : 1;
629
+ const yStart = Math.sin((startX + phase) / wl * 2 * Math.PI) * amp;
630
+ d += `M ${startX.toFixed(2)} ${yStart.toFixed(2)}`;
631
+ let nextX = Math.ceil(startX / step) * step;
632
+ if (nextX === startX) nextX += step;
633
+ while (nextX < endX) {
634
+ const y = Math.sin((nextX + phase) / wl * 2 * Math.PI) * amp;
635
+ d += ` L ${nextX.toFixed(2)} ${y.toFixed(2)}`;
636
+ nextX += step;
637
+ }
638
+ const yEnd = Math.sin((endX + phase) / wl * 2 * Math.PI) * amp;
639
+ d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
640
+ return d;
641
+ }
642
+ var CircularProgress = React11__namespace.forwardRef(
643
+ (_a, ref) => {
644
+ var _b = _a, {
645
+ value,
646
+ size = 48,
647
+ trackHeight = 4,
648
+ shape = "flat",
649
+ amplitude,
650
+ wavelength,
651
+ gapSize = 4,
652
+ crawlerSpeed = 1,
653
+ color,
654
+ trackColor,
655
+ className,
656
+ "aria-label": ariaLabel
657
+ } = _b, restProps = __objRest(_b, [
658
+ "value",
659
+ "size",
660
+ "trackHeight",
661
+ "shape",
662
+ "amplitude",
663
+ "wavelength",
664
+ "gapSize",
665
+ "crawlerSpeed",
666
+ "color",
667
+ "trackColor",
668
+ "className",
669
+ "aria-label"
670
+ ]);
671
+ const isDeterminate = value !== void 0;
672
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
673
+ const radius = (size - trackHeight) / 2;
674
+ const center = size / 2;
675
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
676
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
677
+ const isWavy = shape === "wavy";
678
+ const BASELINE_SIZE = 48;
679
+ const scaleFactor = size / BASELINE_SIZE;
680
+ const effectiveAmplitude = React11__namespace.useMemo(
681
+ () => amplitude != null ? amplitude : 1.6 * scaleFactor,
682
+ [amplitude, scaleFactor]
683
+ );
684
+ const effectiveWavelength = React11__namespace.useMemo(
685
+ () => wavelength != null ? wavelength : 15 * scaleFactor,
686
+ [wavelength, scaleFactor]
687
+ );
688
+ const wavyActivePath = React11__namespace.useMemo(
689
+ () => isWavy ? generateWavyCircularPath(
690
+ center,
691
+ radius,
692
+ effectiveAmplitude,
693
+ effectiveWavelength
694
+ ) : null,
695
+ [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
696
+ );
697
+ const circumference = React11__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
698
+ const gapForTrack = React11__namespace.useMemo(
699
+ () => (gapSize + trackHeight) / circumference,
700
+ [gapSize, trackHeight, circumference]
701
+ );
702
+ const activeAngularFraction = isDeterminate ? clampedValue / 100 : 0;
703
+ const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
704
+ const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
705
+ const ActiveCircleElem = react.m.circle;
706
+ const ActivePathElem = react.m.path;
707
+ return /* @__PURE__ */ jsxRuntime.jsx(
708
+ "div",
709
+ __spreadProps(__spreadValues({
710
+ ref,
711
+ role: "progressbar",
712
+ "aria-label": ariaLabel,
713
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
714
+ "aria-valuemin": 0,
715
+ "aria-valuemax": 100,
716
+ className: cn(
717
+ "relative inline-flex items-center justify-center shrink-0",
718
+ className
719
+ ),
720
+ style: { width: size, height: size }
721
+ }, restProps), {
722
+ children: /* @__PURE__ */ jsxRuntime.jsxs(react.LazyMotion, { features: react.domMax, strict: true, children: [
723
+ /* @__PURE__ */ jsxRuntime.jsxs(
724
+ "svg",
725
+ {
726
+ width: size,
727
+ height: size,
728
+ viewBox: `0 0 ${size} ${size}`,
729
+ "aria-hidden": "true",
730
+ style: { transform: "rotate(-90deg)", overflow: "visible" },
731
+ children: [
732
+ isDeterminate ? /* @__PURE__ */ jsxRuntime.jsx(
733
+ react.m.circle,
734
+ {
735
+ cx: center,
736
+ cy: center,
737
+ r: radius,
738
+ fill: "none",
739
+ stroke: bgTrackColor,
740
+ strokeWidth: trackHeight,
741
+ initial: { pathLength: trackLength, pathOffset: trackOffset },
742
+ animate: { pathLength: trackLength, pathOffset: trackOffset },
743
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
744
+ strokeLinecap: "round"
745
+ }
746
+ ) : null,
747
+ isDeterminate && (isWavy ? /* @__PURE__ */ jsxRuntime.jsx(
748
+ ActivePathElem,
749
+ {
750
+ d: wavyActivePath != null ? wavyActivePath : "",
751
+ fill: "none",
752
+ stroke: activeColor,
753
+ strokeWidth: trackHeight,
754
+ strokeLinecap: "round",
755
+ initial: { pathLength: 0 },
756
+ animate: { pathLength: clampedValue / 100 },
757
+ transition: {
758
+ duration: 0.4,
759
+ ease: [0.2, 0, 0, 1]
760
+ }
761
+ }
762
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
763
+ ActiveCircleElem,
764
+ {
765
+ cx: center,
766
+ cy: center,
767
+ r: radius,
768
+ fill: "none",
769
+ stroke: activeColor,
770
+ strokeWidth: trackHeight,
771
+ strokeLinecap: "round",
772
+ initial: { pathLength: 0 },
773
+ animate: { pathLength: clampedValue / 100 },
774
+ transition: {
775
+ duration: 0.4,
776
+ ease: [0.2, 0, 0, 1]
777
+ }
778
+ }
779
+ ))
780
+ ]
781
+ }
782
+ ),
783
+ !isDeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
784
+ react.m.svg,
785
+ {
786
+ width: size,
787
+ height: size,
788
+ viewBox: `0 0 ${size} ${size}`,
789
+ "aria-hidden": "true",
790
+ style: {
791
+ position: "absolute",
792
+ inset: 0,
793
+ overflow: "visible",
794
+ rotate: "-90deg",
795
+ transformOrigin: "center"
796
+ },
797
+ animate: { rotate: ["-90deg", "270deg"] },
798
+ transition: {
799
+ rotate: {
800
+ duration: 2 / Math.max(0.1, crawlerSpeed),
801
+ repeat: Number.POSITIVE_INFINITY,
802
+ ease: "linear"
803
+ }
804
+ },
805
+ children: [
806
+ /* @__PURE__ */ jsxRuntime.jsx(
807
+ react.m.circle,
808
+ {
809
+ cx: center,
810
+ cy: center,
811
+ r: radius,
812
+ fill: "none",
813
+ stroke: bgTrackColor,
814
+ strokeWidth: trackHeight,
815
+ strokeLinecap: "round",
816
+ style: { originX: "50%", originY: "50%" },
817
+ animate: {
818
+ pathLength: [
819
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
820
+ Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
821
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
822
+ ],
823
+ rotate: [
824
+ `${(0.1 + gapForTrack) * 360}deg`,
825
+ `${(1 + gapForTrack) * 360}deg`,
826
+ `${(1.1 + gapForTrack) * 360}deg`
827
+ ]
828
+ },
829
+ transition: {
830
+ duration: 2 / Math.max(0.1, crawlerSpeed),
831
+ repeat: Number.POSITIVE_INFINITY,
832
+ ease: [0.4, 0, 0.2, 1]
833
+ }
834
+ }
835
+ ),
836
+ isWavy ? /* @__PURE__ */ jsxRuntime.jsx(
837
+ ActivePathElem,
838
+ {
839
+ d: wavyActivePath != null ? wavyActivePath : "",
840
+ fill: "none",
841
+ stroke: activeColor,
842
+ strokeWidth: trackHeight,
843
+ strokeLinecap: "round",
844
+ style: { originX: "50%", originY: "50%" },
845
+ animate: {
846
+ pathLength: [0.1, 0.75, 0.1],
847
+ rotate: ["0deg", "90deg", "360deg"]
848
+ },
849
+ transition: {
850
+ duration: 2 / Math.max(0.1, crawlerSpeed),
851
+ repeat: Number.POSITIVE_INFINITY,
852
+ ease: [0.4, 0, 0.2, 1]
853
+ }
854
+ }
855
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
856
+ ActiveCircleElem,
857
+ {
858
+ cx: center,
859
+ cy: center,
860
+ r: radius,
861
+ fill: "none",
862
+ stroke: activeColor,
863
+ strokeWidth: trackHeight,
864
+ strokeLinecap: "round",
865
+ style: { originX: "50%", originY: "50%" },
866
+ animate: {
867
+ pathLength: [0.1, 0.75, 0.1],
868
+ rotate: ["0deg", "90deg", "360deg"]
869
+ },
870
+ transition: {
871
+ duration: 2 / Math.max(0.1, crawlerSpeed),
872
+ repeat: Number.POSITIVE_INFINITY,
873
+ ease: [0.4, 0, 0.2, 1]
874
+ }
875
+ }
876
+ )
877
+ ]
878
+ }
879
+ )
880
+ ] })
881
+ })
882
+ );
883
+ }
884
+ );
885
+ CircularProgress.displayName = "CircularProgress";
886
+ function useContainerWidth() {
887
+ const [width, setWidth] = React11__namespace.useState(0);
888
+ const observerRef = React11__namespace.useRef(null);
889
+ const ref = React11__namespace.useCallback((node) => {
890
+ if (observerRef.current) {
891
+ observerRef.current.disconnect();
892
+ observerRef.current = null;
893
+ }
894
+ if (node) {
895
+ const obs = new ResizeObserver((entries) => {
896
+ const contentRect = entries[0].contentRect;
897
+ setWidth(contentRect.width);
898
+ });
899
+ obs.observe(node);
900
+ observerRef.current = obs;
901
+ }
902
+ }, []);
903
+ React11__namespace.useEffect(() => {
904
+ return () => {
905
+ if (observerRef.current) {
906
+ observerRef.current.disconnect();
907
+ }
908
+ };
909
+ }, []);
910
+ return [ref, width];
911
+ }
912
+ function useMergedRef(...refs) {
913
+ return React11__namespace.useCallback(
914
+ (node) => {
915
+ for (const ref of refs) {
916
+ if (typeof ref === "function") {
917
+ ref(node);
918
+ } else if (ref && typeof ref === "object") {
919
+ ref.current = node;
920
+ }
921
+ }
922
+ },
923
+ // eslint-disable-next-line react-hooks/exhaustive-deps
924
+ [refs]
925
+ );
926
+ }
927
+ var FlatLinearTrack = React11__namespace.memo(function FlatLinearTrack2({
928
+ trackHeight,
929
+ activeColor,
930
+ trackColor,
931
+ value,
932
+ isRtl,
933
+ gapSize,
934
+ crawlerSpeed
935
+ }) {
936
+ const isDeterminate = value !== void 0;
937
+ const radius = trackHeight / 2;
938
+ const minActiveWidth = trackHeight;
939
+ return /* @__PURE__ */ jsxRuntime.jsx(
940
+ "div",
941
+ {
942
+ className: "relative w-full overflow-hidden",
943
+ style: { height: trackHeight, borderRadius: radius },
944
+ children: isDeterminate ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
945
+ /* @__PURE__ */ jsxRuntime.jsx(
946
+ react.m.div,
947
+ {
948
+ className: "absolute inset-y-0",
949
+ style: {
950
+ backgroundColor: trackColor,
951
+ borderRadius: radius,
952
+ width: "100%"
953
+ },
954
+ initial: {
955
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, 0%) + ${gapSize}px)`
956
+ },
957
+ animate: {
958
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, ${value}%) + ${gapSize}px)`
959
+ },
960
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
961
+ }
962
+ ),
963
+ /* @__PURE__ */ jsxRuntime.jsx(
964
+ react.m.div,
965
+ {
966
+ className: "absolute inset-y-0",
967
+ style: __spreadValues({
968
+ backgroundColor: activeColor,
969
+ borderRadius: radius,
970
+ minWidth: minActiveWidth
971
+ }, isRtl ? { right: 0 } : { left: 0 }),
972
+ initial: { width: `${minActiveWidth}px` },
973
+ animate: { width: `${value}%` },
974
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
975
+ }
976
+ )
977
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
978
+ /* @__PURE__ */ jsxRuntime.jsx(
979
+ "div",
980
+ {
981
+ className: "absolute inset-0",
982
+ style: { backgroundColor: trackColor, borderRadius: radius }
983
+ }
984
+ ),
985
+ /* @__PURE__ */ jsxRuntime.jsx(
986
+ react.m.div,
987
+ {
988
+ className: "absolute inset-y-0",
989
+ style: { backgroundColor: activeColor, borderRadius: radius },
990
+ initial: { left: "-40%", width: "40%" },
991
+ animate: { left: ["-40%", "100%"], width: ["40%", "20%", "40%"] },
992
+ transition: {
993
+ duration: 2 / Math.max(0.1, crawlerSpeed),
994
+ repeat: Number.POSITIVE_INFINITY,
995
+ ease: "easeInOut"
996
+ }
997
+ }
998
+ )
999
+ ] })
1000
+ }
1001
+ );
1002
+ });
1003
+ var WavyLinearTrack = React11__namespace.memo(function WavyLinearTrack2({
1004
+ trackHeight,
1005
+ svgHeight,
1006
+ amplitude,
1007
+ wavelength,
1008
+ indeterminateWavelength,
1009
+ activeColor,
1010
+ trackColor,
1011
+ value,
1012
+ isRtl,
1013
+ gapSize,
1014
+ waveSpeed,
1015
+ crawlerSpeed,
1016
+ determinateAnimation,
1017
+ indeterminateAnimation,
1018
+ trackShape
1019
+ }) {
1020
+ const isDeterminate = typeof value === "number";
1021
+ const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
1022
+ const titleId = React11__namespace.useId();
1023
+ const [containerRef, width] = useContainerWidth();
1024
+ const activePathRef = React11__namespace.useRef(null);
1025
+ const trackPathRef = React11__namespace.useRef(null);
1026
+ const amplitudeMV = react.useMotionValue(amplitude);
1027
+ const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
1028
+ React11__namespace.useEffect(() => {
1029
+ if (isDeterminate) {
1030
+ const fraction = clampedValue / 100;
1031
+ let targetAmp = amplitude;
1032
+ if (determinateAnimation === "md3") {
1033
+ targetAmp = fraction <= 0.1 || fraction >= 0.95 ? 0 : amplitude;
1034
+ }
1035
+ react.animate(amplitudeMV, targetAmp, {
1036
+ type: "spring",
1037
+ bounce: 0,
1038
+ duration: 0.5
1039
+ });
1040
+ react.animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
1041
+ }
1042
+ }, [
1043
+ clampedValue,
1044
+ isDeterminate,
1045
+ amplitude,
1046
+ amplitudeMV,
1047
+ fractionMV,
1048
+ determinateAnimation
1049
+ ]);
1050
+ const activeWavelength = Math.max(
1051
+ 1,
1052
+ isDeterminate ? wavelength : indeterminateWavelength
1053
+ );
1054
+ const trackAmp = trackShape === "wavy" ? amplitude : 0;
1055
+ react.useAnimationFrame((time) => {
1056
+ if (width === 0) return;
1057
+ const currentAmp = amplitudeMV.get();
1058
+ const phase = time / 1e3 * waveSpeed * activeWavelength;
1059
+ const capWidth = trackHeight / 2;
1060
+ let activePathD = "";
1061
+ let trackD = "";
1062
+ const totalGap = gapSize + trackHeight;
1063
+ if (isDeterminate) {
1064
+ const fraction = fractionMV.get();
1065
+ const barHead = fraction * width;
1066
+ const adjHead = Math.max(capWidth, Math.min(width - capWidth, barHead));
1067
+ const adjTail = capWidth;
1068
+ if (fraction > 0 && adjHead - adjTail > 0.1) {
1069
+ activePathD = getSinePath(
1070
+ adjTail,
1071
+ adjHead,
1072
+ phase,
1073
+ activeWavelength,
1074
+ currentAmp
1075
+ );
1076
+ } else if (fraction === 0) {
1077
+ activePathD = `M ${capWidth} 0 L ${capWidth + 0.01} 0`;
1078
+ }
1079
+ const trackStart = adjHead + totalGap;
1080
+ if (trackStart < width - capWidth) {
1081
+ trackD = getSinePath(
1082
+ trackStart,
1083
+ width - capWidth,
1084
+ phase,
1085
+ activeWavelength,
1086
+ trackAmp
1087
+ );
1088
+ }
1089
+ } else {
1090
+ const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
1091
+ const activeLines = [];
1092
+ if (indeterminateAnimation === "continuous") {
1093
+ const cycle = 2e3 / safeCrawlerSpeed;
1094
+ const fraction = time % cycle / cycle;
1095
+ activeLines.push({
1096
+ tail: easeInOutCubic(Math.max(0, fraction * 1.5 - 0.5)),
1097
+ head: easeInOutCubic(Math.min(1, fraction * 1.5))
1098
+ });
1099
+ } else {
1100
+ const cycle = 1750 / safeCrawlerSpeed;
1101
+ const t = time % cycle * safeCrawlerSpeed;
1102
+ const l1H = easeInOutCubic(Math.max(0, Math.min(1, t / 1e3)));
1103
+ const l1T = easeInOutCubic(Math.max(0, Math.min(1, (t - 250) / 1e3)));
1104
+ const l2H = easeInOutCubic(Math.max(0, Math.min(1, (t - 650) / 850)));
1105
+ const l2T = easeInOutCubic(Math.max(0, Math.min(1, (t - 900) / 850)));
1106
+ activeLines.push({ tail: l1T, head: l1H });
1107
+ activeLines.push({ tail: l2T, head: l2H });
1108
+ }
1109
+ const segments = activeLines.map((line) => {
1110
+ const barTail = line.tail * width;
1111
+ const barHead = line.head * width;
1112
+ const adjTail = Math.max(
1113
+ capWidth,
1114
+ Math.min(width - capWidth, barTail)
1115
+ );
1116
+ const adjHead = Math.max(
1117
+ capWidth,
1118
+ Math.min(width - capWidth, barHead)
1119
+ );
1120
+ return { adjTail, adjHead };
1121
+ }).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
1122
+ activePathD = segments.map(
1123
+ (seg) => getSinePath(
1124
+ seg.adjTail,
1125
+ seg.adjHead,
1126
+ phase,
1127
+ activeWavelength,
1128
+ currentAmp
1129
+ )
1130
+ ).join(" ");
1131
+ let currentTrackX = capWidth;
1132
+ for (const seg of segments) {
1133
+ const trackEnd = seg.adjTail - totalGap;
1134
+ if (trackEnd > currentTrackX) {
1135
+ trackD += `${getSinePath(currentTrackX, trackEnd, phase, activeWavelength, trackAmp)} `;
1136
+ }
1137
+ currentTrackX = Math.max(currentTrackX, seg.adjHead + totalGap);
1138
+ }
1139
+ if (currentTrackX < width - capWidth) {
1140
+ trackD += getSinePath(
1141
+ currentTrackX,
1142
+ width - capWidth,
1143
+ phase,
1144
+ activeWavelength,
1145
+ trackAmp
1146
+ );
1147
+ }
1148
+ }
1149
+ if (activePathRef.current)
1150
+ activePathRef.current.setAttribute("d", activePathD);
1151
+ if (trackPathRef.current)
1152
+ trackPathRef.current.setAttribute("d", trackD.trim());
1153
+ });
1154
+ return /* @__PURE__ */ jsxRuntime.jsx(
1155
+ "div",
1156
+ {
1157
+ ref: containerRef,
1158
+ className: "relative w-full overflow-hidden",
1159
+ style: { height: svgHeight },
1160
+ children: width > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
1161
+ "svg",
1162
+ {
1163
+ className: "absolute inset-0 w-full h-full",
1164
+ style: {
1165
+ overflow: "visible",
1166
+ transform: isRtl ? "scaleX(-1)" : void 0
1167
+ },
1168
+ "aria-labelledby": titleId,
1169
+ children: [
1170
+ /* @__PURE__ */ jsxRuntime.jsx("title", { id: titleId, children: isDeterminate ? `Progress: ${clampedValue}%` : "Indeterminate loading progress" }),
1171
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: `translate(0, ${svgHeight / 2})`, children: [
1172
+ /* @__PURE__ */ jsxRuntime.jsx(
1173
+ "path",
1174
+ {
1175
+ ref: trackPathRef,
1176
+ fill: "none",
1177
+ stroke: trackColor,
1178
+ strokeWidth: trackHeight,
1179
+ strokeLinecap: "round"
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ jsxRuntime.jsx(
1183
+ "path",
1184
+ {
1185
+ ref: activePathRef,
1186
+ fill: "none",
1187
+ stroke: activeColor,
1188
+ strokeWidth: trackHeight,
1189
+ strokeLinecap: "round"
1190
+ }
1191
+ )
1192
+ ] })
1193
+ ]
1194
+ }
1195
+ )
1196
+ }
1197
+ );
1198
+ });
1199
+ var LinearProgress = React11__namespace.forwardRef(
1200
+ (_a, ref) => {
1201
+ var _b = _a, {
1202
+ value,
1203
+ shape = "flat",
1204
+ trackShape,
1205
+ trackHeight = 4,
1206
+ amplitude,
1207
+ wavelength = 40,
1208
+ indeterminateWavelength = 20,
1209
+ waveSpeed = 1,
1210
+ crawlerSpeed = 1,
1211
+ determinateAnimation = "md3",
1212
+ indeterminateAnimation = "continuous",
1213
+ gapSize = 4,
1214
+ showStopIndicator = "auto",
1215
+ color,
1216
+ trackColor,
1217
+ className,
1218
+ "aria-label": ariaLabel
1219
+ } = _b, restProps = __objRest(_b, [
1220
+ "value",
1221
+ "shape",
1222
+ "trackShape",
1223
+ "trackHeight",
1224
+ "amplitude",
1225
+ "wavelength",
1226
+ "indeterminateWavelength",
1227
+ "waveSpeed",
1228
+ "crawlerSpeed",
1229
+ "determinateAnimation",
1230
+ "indeterminateAnimation",
1231
+ "gapSize",
1232
+ "showStopIndicator",
1233
+ "color",
1234
+ "trackColor",
1235
+ "className",
1236
+ "aria-label"
1237
+ ]);
1238
+ const isDeterminate = value !== void 0;
1239
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
1240
+ const containerRef = React11__namespace.useRef(null);
1241
+ const mergedRef = useMergedRef(ref, containerRef);
1242
+ const [isRtl, setIsRtl] = React11__namespace.useState(false);
1243
+ React11__namespace.useEffect(() => {
1244
+ if (containerRef.current) {
1245
+ const dir = getComputedStyle(containerRef.current).direction;
1246
+ setIsRtl(dir === "rtl");
1247
+ }
1248
+ }, []);
1249
+ const isWavy = shape === "wavy";
1250
+ const resolvedTrackShape = trackShape != null ? trackShape : shape;
1251
+ const effectiveAmplitude = React11__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
1252
+ const svgHeight = React11__namespace.useMemo(
1253
+ () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
1254
+ [isWavy, trackHeight, effectiveAmplitude]
1255
+ );
1256
+ const shouldShowStop = React11__namespace.useMemo(
1257
+ () => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
1258
+ [isDeterminate, resolvedTrackShape, showStopIndicator]
1259
+ );
1260
+ const stopSize = React11__namespace.useMemo(
1261
+ () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
1262
+ [trackHeight]
1263
+ );
1264
+ const stopOffset = (trackHeight - stopSize) / 2;
1265
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
1266
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
1267
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1268
+ "div",
1269
+ __spreadProps(__spreadValues({
1270
+ ref: mergedRef,
1271
+ role: "progressbar",
1272
+ "aria-label": ariaLabel,
1273
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
1274
+ "aria-valuemin": 0,
1275
+ "aria-valuemax": 100,
1276
+ className: cn(
1277
+ "relative flex w-full flex-col justify-center",
1278
+ className
1279
+ ),
1280
+ style: { height: svgHeight }
1281
+ }, restProps), {
1282
+ children: [
1283
+ isWavy ? /* @__PURE__ */ jsxRuntime.jsx(
1284
+ WavyLinearTrack,
1285
+ {
1286
+ trackHeight,
1287
+ svgHeight,
1288
+ amplitude: effectiveAmplitude,
1289
+ wavelength,
1290
+ indeterminateWavelength,
1291
+ activeColor,
1292
+ trackColor: bgTrackColor,
1293
+ value: isDeterminate ? clampedValue : void 0,
1294
+ isRtl,
1295
+ gapSize,
1296
+ waveSpeed,
1297
+ crawlerSpeed,
1298
+ determinateAnimation,
1299
+ indeterminateAnimation,
1300
+ trackShape: resolvedTrackShape
1301
+ }
1302
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1303
+ FlatLinearTrack,
1304
+ {
1305
+ trackHeight,
1306
+ activeColor,
1307
+ trackColor: bgTrackColor,
1308
+ value: isDeterminate ? clampedValue : void 0,
1309
+ isRtl,
1310
+ gapSize,
1311
+ crawlerSpeed
1312
+ }
1313
+ ),
1314
+ shouldShowStop && /* @__PURE__ */ jsxRuntime.jsx(
1315
+ "div",
1316
+ {
1317
+ "aria-hidden": "true",
1318
+ className: "absolute rounded-full",
1319
+ style: __spreadValues({
1320
+ width: stopSize,
1321
+ height: stopSize,
1322
+ backgroundColor: "var(--md-sys-color-indicator-stop)",
1323
+ top: svgHeight / 2 - stopSize / 2
1324
+ }, isRtl ? { left: stopOffset } : { right: stopOffset })
1325
+ }
1326
+ )
1327
+ ]
1328
+ })
1329
+ ) });
1330
+ }
1331
+ );
1332
+ LinearProgress.displayName = "LinearProgress";
1333
+ var ProgressIndicator = React11__namespace.forwardRef((props, ref) => {
1334
+ if (props.variant === "circular") {
1335
+ return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
1336
+ }
1337
+ return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
1338
+ });
1339
+ ProgressIndicator.displayName = "ProgressIndicator";
1340
+ function TouchTarget() {
1341
+ return /* @__PURE__ */ jsxRuntime.jsx(
1342
+ "span",
1343
+ {
1344
+ "aria-hidden": "true",
1345
+ className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 min-w-12 min-h-12 cursor-pointer pointer-events-none"
1346
+ }
1347
+ );
1348
+ }
1349
+ var SIZE_STYLES = {
1350
+ xs: "h-8 w-8",
1351
+ sm: "h-10 w-10",
1352
+ md: "h-14 w-14",
1353
+ lg: "h-24 w-24",
1354
+ xl: "h-[8.5rem] w-[8.5rem]"
1355
+ };
1356
+ var SIZE_ICON = {
1357
+ xs: { cls: "size-5", px: 20 },
1358
+ sm: { cls: "size-6", px: 24 },
1359
+ md: { cls: "size-6", px: 24 },
1360
+ lg: { cls: "size-8", px: 32 },
1361
+ xl: { cls: "size-10", px: 40 }
1362
+ };
1363
+ var RADIUS_MAP = {
1364
+ xs: {
1365
+ round: 16,
1366
+ square: 12,
1367
+ pressed: 8,
1368
+ selectedRound: 12,
1369
+ selectedSquare: 16
1370
+ },
1371
+ sm: {
1372
+ round: 20,
1373
+ square: 12,
1374
+ pressed: 8,
1375
+ selectedRound: 12,
1376
+ selectedSquare: 20
1377
+ },
1378
+ md: {
1379
+ round: 28,
1380
+ square: 16,
1381
+ pressed: 12,
1382
+ selectedRound: 16,
1383
+ selectedSquare: 28
1384
+ },
1385
+ lg: {
1386
+ round: 48,
1387
+ square: 28,
1388
+ pressed: 16,
1389
+ selectedRound: 28,
1390
+ selectedSquare: 48
1391
+ },
1392
+ xl: {
1393
+ round: 68,
1394
+ square: 28,
1395
+ pressed: 16,
1396
+ selectedRound: 28,
1397
+ selectedSquare: 68
1398
+ }
1399
+ };
1400
+ var SIZE_OUTLINE_WIDTH = {
1401
+ xs: "border",
1402
+ sm: "border",
1403
+ md: "border",
1404
+ lg: "border-2",
1405
+ xl: "border-[3px]"
1406
+ };
1407
+ var colorStyles = {
1408
+ standard: {
1409
+ default: "text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1410
+ selected: "text-m3-primary hover:bg-m3-primary/8 active:bg-m3-primary/12"
1411
+ },
1412
+ filled: {
1413
+ default: "bg-m3-surface-container text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1414
+ selected: "bg-m3-primary text-m3-on-primary hover:brightness-95 active:brightness-90"
1415
+ },
1416
+ tonal: {
1417
+ default: "bg-m3-secondary-container text-m3-on-secondary-container hover:bg-m3-on-secondary-container/8 active:bg-m3-on-secondary-container/12",
1418
+ selected: "bg-m3-secondary text-m3-on-secondary hover:brightness-95 active:brightness-90"
1419
+ },
1420
+ outlined: {
1421
+ default: "border-m3-outline-variant text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
1422
+ selected: "bg-m3-inverse-surface text-m3-inverse-on-surface border-transparent hover:brightness-95 active:brightness-90"
1423
+ }
1424
+ };
1425
+ var baseIconButtonClasses = [
1426
+ "relative shrink-0 inline-flex items-center justify-center",
1427
+ "select-none cursor-pointer",
1428
+ "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
1429
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
1430
+ "disabled:pointer-events-none disabled:opacity-[0.38]"
1431
+ ];
1432
+ function resolveAnimateRadius(radiusConfig, shape, isToggle, isSelected) {
1433
+ if (isToggle && isSelected) {
1434
+ return shape === "round" ? radiusConfig.selectedRound : radiusConfig.selectedSquare;
1435
+ }
1436
+ return shape === "round" ? radiusConfig.round : radiusConfig.square;
1437
+ }
1438
+ function resolveDisabledBgClass(colorStyle) {
1439
+ if (colorStyle === "filled" || colorStyle === "tonal") {
1440
+ return "disabled:bg-m3-on-surface/12 disabled:text-m3-on-surface/[0.38]";
1441
+ }
1442
+ if (colorStyle === "outlined") {
1443
+ return "disabled:text-m3-on-surface/[0.38] disabled:border-m3-on-surface/[0.12]";
1444
+ }
1445
+ return "disabled:text-m3-on-surface/[0.38]";
1446
+ }
1447
+ var IconButtonComponent = React11__namespace.forwardRef(
1448
+ (_a, ref) => {
1449
+ var _b = _a, {
1450
+ className,
1451
+ style,
1452
+ variant = "default",
1453
+ colorStyle = "standard",
1454
+ size = "sm",
1455
+ shape = "round",
1456
+ selected,
1457
+ loading = false,
1458
+ loadingVariant = "loading-indicator",
1459
+ iconSize,
1460
+ children,
1461
+ onClick,
1462
+ onKeyDown,
1463
+ "aria-label": ariaLabel
1464
+ } = _b, restProps = __objRest(_b, [
1465
+ "className",
1466
+ "style",
1467
+ "variant",
1468
+ "colorStyle",
1469
+ "size",
1470
+ "shape",
1471
+ "selected",
1472
+ "loading",
1473
+ "loadingVariant",
1474
+ "iconSize",
1475
+ "children",
1476
+ "onClick",
1477
+ "onKeyDown",
1478
+ "aria-label"
1479
+ ]);
1480
+ var _a2, _b2;
1481
+ const isToggle = variant === "toggle";
1482
+ const isSelected = isToggle && !!selected;
1483
+ const resolvedColorClass = React11__namespace.useMemo(
1484
+ () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
1485
+ [isSelected, colorStyle]
1486
+ );
1487
+ const outlineWidthClass = React11__namespace.useMemo(
1488
+ () => {
1489
+ var _a3;
1490
+ return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
1491
+ },
1492
+ [colorStyle, isSelected, size]
1493
+ );
1494
+ const disabledBgClass = React11__namespace.useMemo(
1495
+ () => resolveDisabledBgClass(colorStyle),
1496
+ [colorStyle]
1497
+ );
1498
+ const radiusConfig = (_a2 = RADIUS_MAP[size]) != null ? _a2 : RADIUS_MAP.sm;
1499
+ const animateRadius = resolveAnimateRadius(
1500
+ radiusConfig,
1501
+ shape,
1502
+ isToggle,
1503
+ isSelected
1504
+ );
1505
+ const pressedRadius = radiusConfig.pressed;
1506
+ const sizeIcon = (_b2 = SIZE_ICON[size]) != null ? _b2 : SIZE_ICON.sm;
1507
+ const iconClass = sizeIcon.cls;
1508
+ const defaultIconPx = sizeIcon.px;
1509
+ const iconPx = iconSize != null ? iconSize : defaultIconPx;
1510
+ const isCustomSize = iconSize != null && iconSize !== "inherit";
1511
+ const needsTouchTarget = size === "xs" || size === "sm";
1512
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
1513
+ disabled: loading
1514
+ });
1515
+ const handleClick = React11__namespace.useCallback(
1516
+ (e) => {
1517
+ if (loading) {
1518
+ e.preventDefault();
1519
+ return;
1520
+ }
1521
+ onClick == null ? void 0 : onClick(e);
1522
+ },
1523
+ [loading, onClick]
1524
+ );
1525
+ const handleKeyDown = React11__namespace.useCallback(
1526
+ (e) => {
1527
+ if (loading) return;
1528
+ if ((e.key === "Enter" || e.key === " ") && onClick) {
1529
+ e.preventDefault();
1530
+ e.currentTarget.click();
1531
+ }
1532
+ onKeyDown == null ? void 0 : onKeyDown(e);
1533
+ },
1534
+ [loading, onClick, onKeyDown]
1535
+ );
1536
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
1537
+ react.m.button,
1538
+ __spreadProps(__spreadValues({
1539
+ ref,
1540
+ type: "button",
1541
+ "aria-pressed": isToggle ? isSelected : void 0,
1542
+ "aria-label": ariaLabel,
1543
+ "aria-busy": loading || void 0,
1544
+ "aria-disabled": loading || restProps.disabled,
1545
+ onClick: handleClick,
1546
+ onPointerDown,
1547
+ onKeyDown: handleKeyDown,
1548
+ style,
1549
+ animate: { borderRadius: animateRadius },
1550
+ whileTap: { borderRadius: pressedRadius },
1551
+ transition: { borderRadius: SPRING_TRANSITION_FAST },
1552
+ className: cn(
1553
+ baseIconButtonClasses,
1554
+ resolvedColorClass,
1555
+ outlineWidthClass,
1556
+ disabledBgClass,
1557
+ "overflow-hidden",
1558
+ SIZE_STYLES[size],
1559
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
1560
+ className
1561
+ )
1562
+ }, restProps), {
1563
+ children: [
1564
+ needsTouchTarget && /* @__PURE__ */ jsxRuntime.jsx(TouchTarget, {}),
1565
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1566
+ /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsxRuntime.jsx(
1567
+ react.m.span,
1568
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1569
+ transition: SPRING_TRANSITION,
1570
+ className: cn(
1571
+ "flex items-center justify-center shrink-0",
1572
+ iconSize != null ? void 0 : iconClass
1573
+ ),
1574
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
1575
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsxRuntime.jsx(
1576
+ LoadingIndicator,
1577
+ {
1578
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1579
+ color: "currentColor",
1580
+ "aria-label": "Loading"
1581
+ }
1582
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1583
+ ProgressIndicator,
1584
+ {
1585
+ variant: "circular",
1586
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
1587
+ color: "currentColor",
1588
+ trackColor: "transparent",
1589
+ "aria-label": "Loading"
1590
+ }
1591
+ )
1592
+ }),
1593
+ "loading"
1594
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1595
+ react.m.span,
1596
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
1597
+ transition: SPRING_TRANSITION,
1598
+ "aria-hidden": "true",
1599
+ className: cn(
1600
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
1601
+ iconSize != null ? void 0 : iconClass
1602
+ ),
1603
+ style: {
1604
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
1605
+ width: isCustomSize ? `${iconSize}px` : void 0,
1606
+ height: isCustomSize ? `${iconSize}px` : void 0
1607
+ },
1608
+ children
1609
+ }),
1610
+ "content"
1611
+ ) })
1612
+ ]
1613
+ })
1614
+ ) });
1615
+ }
1616
+ );
1617
+ IconButtonComponent.displayName = "IconButton";
1618
+ var IconButton = React11__namespace.memo(IconButtonComponent);
1619
+ var DURATION_MAP = {
1620
+ short: 4e3,
1621
+ long: 7e3
1622
+ };
1623
+ var RESULT = {
1624
+ ACTION: "action-performed",
1625
+ DISMISSED: "dismissed"
1626
+ };
1627
+ var SNACKBAR_SPRING = DEFAULT_SPATIAL_SPRING;
1628
+ var SNACKBAR_ANIM = {
1629
+ initial: { opacity: 0, y: 56, scale: 0.9 },
1630
+ animate: {
1631
+ opacity: 1,
1632
+ y: 0,
1633
+ scale: 1,
1634
+ transition: SNACKBAR_SPRING
1635
+ },
1636
+ exit: {
1637
+ opacity: 0,
1638
+ y: 24,
1639
+ scale: 0.95,
1640
+ transition: { duration: 0.2, ease: "easeIn" }
1641
+ }
1642
+ };
1643
+ var REDUCED_MOTION_ANIM = {
1644
+ initial: { opacity: 0 },
1645
+ animate: { opacity: 1 },
1646
+ exit: { opacity: 0 }
1647
+ };
1648
+ function resolveDuration(duration) {
1649
+ if (duration === void 0) return DURATION_MAP.short;
1650
+ if (typeof duration === "number") return duration;
1651
+ return DURATION_MAP[duration];
1652
+ }
1653
+ function generateId() {
1654
+ return typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : Math.random().toString(36).slice(2);
1655
+ }
1656
+ function toSnackbarData(item) {
1657
+ return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
1658
+ }
1659
+ function useSnackbarState() {
1660
+ const [current, setCurrent] = React11__namespace.useState(null);
1661
+ const queueRef = React11__namespace.useRef([]);
1662
+ const showSnackbar = React11__namespace.useCallback(
1663
+ (visuals) => {
1664
+ return new Promise((resolve) => {
1665
+ const item = { visuals, resolve };
1666
+ setCurrent((prev) => {
1667
+ if (prev === null) return toSnackbarData(item);
1668
+ queueRef.current.push(item);
1669
+ return prev;
1670
+ });
1671
+ });
1672
+ },
1673
+ []
1674
+ );
1675
+ const _dismiss = React11__namespace.useCallback((result) => {
1676
+ setCurrent((prev) => {
1677
+ if (prev) prev.resolve(result);
1678
+ const next = queueRef.current.shift();
1679
+ return next ? toSnackbarData(next) : null;
1680
+ });
1681
+ }, []);
1682
+ React11__namespace.useEffect(() => {
1683
+ return () => {
1684
+ for (const item of queueRef.current) {
1685
+ item.resolve(RESULT.DISMISSED);
1686
+ }
1687
+ queueRef.current = [];
1688
+ };
1689
+ }, []);
1690
+ return { current, showSnackbar, _dismiss };
1691
+ }
1692
+ var Snackbar = React11__namespace.memo(function Snackbar2({
1693
+ data,
1694
+ className
1695
+ }) {
1696
+ const { visuals, resolve } = data;
1697
+ const {
1698
+ message,
1699
+ actionLabel,
1700
+ withDismissAction = false,
1701
+ actionOnNewLine = false,
1702
+ duration
1703
+ } = visuals;
1704
+ const reducedMotion = react.useReducedMotion();
1705
+ const durationMs = resolveDuration(duration);
1706
+ React11__namespace.useEffect(() => {
1707
+ const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
1708
+ return () => clearTimeout(timer);
1709
+ }, [resolve, durationMs]);
1710
+ const handleAction = React11__namespace.useCallback(
1711
+ () => resolve(RESULT.ACTION),
1712
+ [resolve]
1713
+ );
1714
+ const handleDismiss = React11__namespace.useCallback(
1715
+ () => resolve(RESULT.DISMISSED),
1716
+ [resolve]
1717
+ );
1718
+ const hasActions = actionLabel || withDismissAction;
1719
+ const anim = reducedMotion ? REDUCED_MOTION_ANIM : SNACKBAR_ANIM;
1720
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1721
+ react.m.div,
1722
+ __spreadProps(__spreadValues({
1723
+ role: "status",
1724
+ "aria-live": "polite",
1725
+ "aria-atomic": "true"
1726
+ }, anim), {
1727
+ className: cn(
1728
+ "flex items-center gap-2",
1729
+ "min-w-72 max-w-142 w-max",
1730
+ "rounded-sm px-4 py-3 shadow-md",
1731
+ "text-m3-inverse-on-surface bg-m3-inverse-surface",
1732
+ actionOnNewLine ? "flex-col items-start" : "flex-row",
1733
+ className,
1734
+ visuals.className
1735
+ ),
1736
+ children: [
1737
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-sm leading-5 font-normal", children: message }),
1738
+ hasActions && /* @__PURE__ */ jsxRuntime.jsxs(
1739
+ "div",
1740
+ {
1741
+ className: cn(
1742
+ "flex shrink-0 items-center gap-1",
1743
+ actionOnNewLine && "self-end"
1744
+ ),
1745
+ children: [
1746
+ actionLabel && /* @__PURE__ */ jsxRuntime.jsx(
1747
+ "button",
1748
+ {
1749
+ type: "button",
1750
+ onClick: handleAction,
1751
+ className: cn(
1752
+ "text-sm font-medium",
1753
+ "px-2 py-1 rounded-sm",
1754
+ "focus-visible:outline-none focus-visible:ring-2",
1755
+ "transition-colors whitespace-nowrap",
1756
+ "text-m3-inverse-primary"
1757
+ ),
1758
+ children: actionLabel
1759
+ }
1760
+ ),
1761
+ withDismissAction && /* @__PURE__ */ jsxRuntime.jsx(
1762
+ IconButton,
1763
+ {
1764
+ size: "sm",
1765
+ colorStyle: "filled",
1766
+ "aria-label": "Dismiss notification",
1767
+ onClick: handleDismiss,
1768
+ className: "text-m3-inverse-on-surface bg-m3-inverse-surface",
1769
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "close", "aria-hidden": "true" })
1770
+ }
1771
+ )
1772
+ ]
1773
+ }
1774
+ )
1775
+ ]
1776
+ })
1777
+ );
1778
+ });
1779
+ Snackbar.displayName = "Snackbar";
1780
+ function SnackbarHost({ state, className }) {
1781
+ const { current, _dismiss } = state;
1782
+ const wrappedData = React11__namespace.useMemo(() => {
1783
+ if (!current) return null;
1784
+ return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
1785
+ }, [current, _dismiss]);
1786
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1787
+ "section",
1788
+ {
1789
+ "aria-label": "Snackbar notifications",
1790
+ className: cn(
1791
+ "fixed bottom-4 left-1/2 -translate-x-1/2 z-50",
1792
+ "flex flex-col items-center pointer-events-none",
1793
+ className
1794
+ ),
1795
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: wrappedData && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-auto", children: /* @__PURE__ */ jsxRuntime.jsx(Snackbar, { data: wrappedData }) }, wrappedData.id) })
1796
+ }
1797
+ ) });
1798
+ }
1799
+ SnackbarHost.displayName = "SnackbarHost";
1800
+ var SnackbarContext = React11__namespace.createContext(
1801
+ null
1802
+ );
1803
+
1804
+ // src/ui/typography/type-scale-tokens.ts
1805
+ var font = "'Google Sans Flex', system-ui, sans-serif";
1806
+ var TypeScaleTokens = {
1807
+ // ─── DISPLAY ────────────────────────────────────────────────────────────────
1808
+ DisplayLargeFont: font,
1809
+ DisplayLargeWeight: 400,
1810
+ DisplayLargeSize: "3.571rem",
1811
+ // 57sp → ~57px / 14 = 4.071, MD3 uses 57px on 16px base → 3.5625rem
1812
+ DisplayLargeLineHeight: "4rem",
1813
+ // 64px
1814
+ DisplayLargeTracking: "-0.25px",
1815
+ DisplayMediumFont: font,
1816
+ DisplayMediumWeight: 400,
1817
+ DisplayMediumSize: "2.857rem",
1818
+ // 45px
1819
+ DisplayMediumLineHeight: "3.286rem",
1820
+ // 52px
1821
+ DisplayMediumTracking: "0px",
1822
+ DisplaySmallFont: font,
1823
+ DisplaySmallWeight: 400,
1824
+ DisplaySmallSize: "2.571rem",
1825
+ // 36px
1826
+ DisplaySmallLineHeight: "3.143rem",
1827
+ // 44px
1828
+ DisplaySmallTracking: "0px",
1829
+ // ─── HEADLINE ───────────────────────────────────────────────────────────────
1830
+ HeadlineLargeFont: font,
1831
+ HeadlineLargeWeight: 400,
1832
+ HeadlineLargeSize: "2.286rem",
1833
+ // 32px
1834
+ HeadlineLargeLineHeight: "2.857rem",
1835
+ // 40px
1836
+ HeadlineLargeTracking: "0px",
1837
+ HeadlineMediumFont: font,
1838
+ HeadlineMediumWeight: 400,
1839
+ HeadlineMediumSize: "2rem",
1840
+ // 28px
1841
+ HeadlineMediumLineHeight: "2.571rem",
1842
+ // 36px
1843
+ HeadlineMediumTracking: "0px",
1844
+ HeadlineSmallFont: font,
1845
+ HeadlineSmallWeight: 400,
1846
+ HeadlineSmallSize: "1.714rem",
1847
+ // 24px
1848
+ HeadlineSmallLineHeight: "2.286rem",
1849
+ // 32px
1850
+ HeadlineSmallTracking: "0px",
1851
+ // ─── TITLE ──────────────────────────────────────────────────────────────────
1852
+ TitleLargeFont: font,
1853
+ TitleLargeWeight: 400,
1854
+ TitleLargeSize: "1.571rem",
1855
+ // 22px
1856
+ TitleLargeLineHeight: "2rem",
1857
+ // 28px
1858
+ TitleLargeTracking: "0px",
1859
+ TitleMediumFont: font,
1860
+ TitleMediumWeight: 500,
1861
+ TitleMediumSize: "1.143rem",
1862
+ // 16px
1863
+ TitleMediumLineHeight: "1.714rem",
1864
+ // 24px
1865
+ TitleMediumTracking: "0.15px",
1866
+ TitleSmallFont: font,
1867
+ TitleSmallWeight: 500,
1868
+ TitleSmallSize: "1rem",
1869
+ // 14px
1870
+ TitleSmallLineHeight: "1.429rem",
1871
+ // 20px
1872
+ TitleSmallTracking: "0.1px",
1873
+ // ─── BODY ───────────────────────────────────────────────────────────────────
1874
+ BodyLargeFont: font,
1875
+ BodyLargeWeight: 400,
1876
+ BodyLargeSize: "1.143rem",
1877
+ // 16px
1878
+ BodyLargeLineHeight: "1.714rem",
1879
+ // 24px
1880
+ BodyLargeTracking: "0.5px",
1881
+ BodyMediumFont: font,
1882
+ BodyMediumWeight: 400,
1883
+ BodyMediumSize: "1rem",
1884
+ // 14px
1885
+ BodyMediumLineHeight: "1.429rem",
1886
+ // 20px
1887
+ BodyMediumTracking: "0.25px",
1888
+ BodySmallFont: font,
1889
+ BodySmallWeight: 400,
1890
+ BodySmallSize: "0.857rem",
1891
+ // 12px
1892
+ BodySmallLineHeight: "1.143rem",
1893
+ // 16px
1894
+ BodySmallTracking: "0.4px",
1895
+ // ─── LABEL ──────────────────────────────────────────────────────────────────
1896
+ LabelLargeFont: font,
1897
+ LabelLargeWeight: 500,
1898
+ LabelLargeSize: "1rem",
1899
+ // 14px
1900
+ LabelLargeLineHeight: "1.429rem",
1901
+ // 20px
1902
+ LabelLargeTracking: "0.1px",
1903
+ LabelMediumFont: font,
1904
+ LabelMediumWeight: 500,
1905
+ LabelMediumSize: "0.857rem",
1906
+ // 12px
1907
+ LabelMediumLineHeight: "1.143rem",
1908
+ // 16px
1909
+ LabelMediumTracking: "0.5px",
1910
+ LabelSmallFont: font,
1911
+ LabelSmallWeight: 500,
1912
+ LabelSmallSize: "0.786rem",
1913
+ // 11px
1914
+ LabelSmallLineHeight: "1.143rem",
1915
+ // 16px
1916
+ LabelSmallTracking: "0.5px",
1917
+ // ─── EMPHASIZED (MD3 Expressive) ────────────────────────────────────────────
1918
+ // Emphasized styles share Font/Size/LineHeight/Tracking with baseline.
1919
+ // Only fontWeight is elevated to create visual emphasis.
1920
+ // Source: TypographyTokens.kt (Emphasized entries reference same scale)
1921
+ DisplayLargeEmphasizedFont: font,
1922
+ DisplayLargeEmphasizedWeight: 800,
1923
+ DisplayLargeEmphasizedSize: "3.571rem",
1924
+ DisplayLargeEmphasizedLineHeight: "4rem",
1925
+ DisplayLargeEmphasizedTracking: "-0.25px",
1926
+ DisplayMediumEmphasizedFont: font,
1927
+ DisplayMediumEmphasizedWeight: 800,
1928
+ DisplayMediumEmphasizedSize: "2.857rem",
1929
+ DisplayMediumEmphasizedLineHeight: "3.286rem",
1930
+ DisplayMediumEmphasizedTracking: "0px",
1931
+ DisplaySmallEmphasizedFont: font,
1932
+ DisplaySmallEmphasizedWeight: 800,
1933
+ DisplaySmallEmphasizedSize: "2.571rem",
1934
+ DisplaySmallEmphasizedLineHeight: "3.143rem",
1935
+ DisplaySmallEmphasizedTracking: "0px",
1936
+ HeadlineLargeEmphasizedFont: font,
1937
+ HeadlineLargeEmphasizedWeight: 800,
1938
+ HeadlineLargeEmphasizedSize: "2.286rem",
1939
+ HeadlineLargeEmphasizedLineHeight: "2.857rem",
1940
+ HeadlineLargeEmphasizedTracking: "0px",
1941
+ HeadlineMediumEmphasizedFont: font,
1942
+ HeadlineMediumEmphasizedWeight: 800,
1943
+ HeadlineMediumEmphasizedSize: "2rem",
1944
+ HeadlineMediumEmphasizedLineHeight: "2.571rem",
1945
+ HeadlineMediumEmphasizedTracking: "0px",
1946
+ HeadlineSmallEmphasizedFont: font,
1947
+ HeadlineSmallEmphasizedWeight: 800,
1948
+ HeadlineSmallEmphasizedSize: "1.714rem",
1949
+ HeadlineSmallEmphasizedLineHeight: "2.286rem",
1950
+ HeadlineSmallEmphasizedTracking: "0px",
1951
+ TitleLargeEmphasizedFont: font,
1952
+ TitleLargeEmphasizedWeight: 700,
1953
+ TitleLargeEmphasizedSize: "1.571rem",
1954
+ TitleLargeEmphasizedLineHeight: "2rem",
1955
+ TitleLargeEmphasizedTracking: "0px",
1956
+ TitleMediumEmphasizedFont: font,
1957
+ TitleMediumEmphasizedWeight: 700,
1958
+ TitleMediumEmphasizedSize: "1.143rem",
1959
+ TitleMediumEmphasizedLineHeight: "1.714rem",
1960
+ TitleMediumEmphasizedTracking: "0.15px",
1961
+ TitleSmallEmphasizedFont: font,
1962
+ TitleSmallEmphasizedWeight: 700,
1963
+ TitleSmallEmphasizedSize: "1rem",
1964
+ TitleSmallEmphasizedLineHeight: "1.429rem",
1965
+ TitleSmallEmphasizedTracking: "0.1px",
1966
+ BodyLargeEmphasizedFont: font,
1967
+ BodyLargeEmphasizedWeight: 700,
1968
+ BodyLargeEmphasizedSize: "1.143rem",
1969
+ BodyLargeEmphasizedLineHeight: "1.714rem",
1970
+ BodyLargeEmphasizedTracking: "0.5px",
1971
+ BodyMediumEmphasizedFont: font,
1972
+ BodyMediumEmphasizedWeight: 700,
1973
+ BodyMediumEmphasizedSize: "1rem",
1974
+ BodyMediumEmphasizedLineHeight: "1.429rem",
1975
+ BodyMediumEmphasizedTracking: "0.25px",
1976
+ BodySmallEmphasizedFont: font,
1977
+ BodySmallEmphasizedWeight: 700,
1978
+ BodySmallEmphasizedSize: "0.857rem",
1979
+ BodySmallEmphasizedLineHeight: "1.143rem",
1980
+ BodySmallEmphasizedTracking: "0.4px",
1981
+ LabelLargeEmphasizedFont: font,
1982
+ LabelLargeEmphasizedWeight: 800,
1983
+ LabelLargeEmphasizedSize: "1rem",
1984
+ LabelLargeEmphasizedLineHeight: "1.429rem",
1985
+ LabelLargeEmphasizedTracking: "0.1px",
1986
+ LabelMediumEmphasizedFont: font,
1987
+ LabelMediumEmphasizedWeight: 800,
1988
+ LabelMediumEmphasizedSize: "0.857rem",
1989
+ LabelMediumEmphasizedLineHeight: "1.143rem",
1990
+ LabelMediumEmphasizedTracking: "0.5px",
1991
+ LabelSmallEmphasizedFont: font,
1992
+ LabelSmallEmphasizedWeight: 800,
1993
+ LabelSmallEmphasizedSize: "0.786rem",
1994
+ LabelSmallEmphasizedLineHeight: "1.143rem",
1995
+ LabelSmallEmphasizedTracking: "0.5px"
1996
+ };
1997
+
1998
+ // src/ui/typography/typography-tokens.ts
1999
+ var DEFAULT_FONT_VARIATION_AXES = Object.freeze({ ROND: 100 });
2000
+ function serializeFontVariationAxes(axes) {
2001
+ return Object.entries(axes).filter(([, v]) => v !== void 0).map(([k, v]) => `"${k}" ${v}`).join(", ");
2002
+ }
2003
+ var MD3_EXPRESSIVE_FONT_VARIATION = serializeFontVariationAxes(
2004
+ DEFAULT_FONT_VARIATION_AXES
2005
+ );
2006
+ function buildStyle(prefix, fontFamily, fontVariationSettings) {
2007
+ const t = TypeScaleTokens;
2008
+ return Object.freeze({
2009
+ fontFamily: fontFamily != null ? fontFamily : t[`${prefix}Font`],
2010
+ fontWeight: t[`${prefix}Weight`],
2011
+ fontSize: t[`${prefix}Size`],
2012
+ lineHeight: t[`${prefix}LineHeight`],
2013
+ letterSpacing: t[`${prefix}Tracking`],
2014
+ fontVariationSettings
2015
+ });
2016
+ }
2017
+ var _fontFamily, _fontVariationSettings, _cache, _TypographyTokens_instances, get_fn;
2018
+ var TypographyTokens = class {
2019
+ constructor(options = {}) {
2020
+ __privateAdd(this, _TypographyTokens_instances);
2021
+ __privateAdd(this, _fontFamily);
2022
+ __privateAdd(this, _fontVariationSettings);
2023
+ // Helper to lazily build + cache a style on first access
2024
+ __privateAdd(this, _cache, /* @__PURE__ */ new Map());
2025
+ if (typeof options === "string") {
2026
+ __privateSet(this, _fontFamily, options);
2027
+ __privateSet(this, _fontVariationSettings, MD3_EXPRESSIVE_FONT_VARIATION);
2028
+ } else {
2029
+ __privateSet(this, _fontFamily, options.fontFamily);
2030
+ const axes = options.fontVariationAxes ? __spreadValues(__spreadValues({}, DEFAULT_FONT_VARIATION_AXES), options.fontVariationAxes) : DEFAULT_FONT_VARIATION_AXES;
2031
+ __privateSet(this, _fontVariationSettings, serializeFontVariationAxes(axes));
2032
+ }
2033
+ }
2034
+ // ─── Baseline Styles (15) ──────────────────────────────────────────────────
2035
+ /** Display Large – `57px`, weight 400 */
2036
+ get DisplayLarge() {
2037
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayLarge");
2038
+ }
2039
+ /** Display Medium – `45px`, weight 400 */
2040
+ get DisplayMedium() {
2041
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayMedium");
2042
+ }
2043
+ /** Display Small – `36px`, weight 400 */
2044
+ get DisplaySmall() {
2045
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplaySmall");
2046
+ }
2047
+ /** Headline Large – `32px`, weight 400 */
2048
+ get HeadlineLarge() {
2049
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineLarge");
2050
+ }
2051
+ /** Headline Medium – `28px`, weight 400 */
2052
+ get HeadlineMedium() {
2053
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineMedium");
2054
+ }
2055
+ /** Headline Small – `24px`, weight 400 */
2056
+ get HeadlineSmall() {
2057
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineSmall");
2058
+ }
2059
+ /** Title Large – `22px`, weight 400 */
2060
+ get TitleLarge() {
2061
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleLarge");
2062
+ }
2063
+ /** Title Medium – `16px`, weight 500 */
2064
+ get TitleMedium() {
2065
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleMedium");
2066
+ }
2067
+ /** Title Small – `14px`, weight 500 */
2068
+ get TitleSmall() {
2069
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleSmall");
2070
+ }
2071
+ /** Body Large – `16px`, weight 400 */
2072
+ get BodyLarge() {
2073
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyLarge");
2074
+ }
2075
+ /** Body Medium – `14px`, weight 400 */
2076
+ get BodyMedium() {
2077
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyMedium");
2078
+ }
2079
+ /** Body Small – `12px`, weight 400 */
2080
+ get BodySmall() {
2081
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodySmall");
2082
+ }
2083
+ /** Label Large – `14px`, weight 500 */
2084
+ get LabelLarge() {
2085
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelLarge");
2086
+ }
2087
+ /** Label Medium – `12px`, weight 500 */
2088
+ get LabelMedium() {
2089
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelMedium");
2090
+ }
2091
+ /** Label Small – `11px`, weight 500 */
2092
+ get LabelSmall() {
2093
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelSmall");
2094
+ }
2095
+ // ─── Emphasized Styles (15) – MD3 Expressive ──────────────────────────────
2096
+ /** Display Large Emphasized – `57px`, weight 800 */
2097
+ get DisplayLargeEmphasized() {
2098
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayLargeEmphasized");
2099
+ }
2100
+ /** Display Medium Emphasized – `45px`, weight 800 */
2101
+ get DisplayMediumEmphasized() {
2102
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplayMediumEmphasized");
2103
+ }
2104
+ /** Display Small Emphasized – `36px`, weight 800 */
2105
+ get DisplaySmallEmphasized() {
2106
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "DisplaySmallEmphasized");
2107
+ }
2108
+ /** Headline Large Emphasized – `32px`, weight 800 */
2109
+ get HeadlineLargeEmphasized() {
2110
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineLargeEmphasized");
2111
+ }
2112
+ /** Headline Medium Emphasized – `28px`, weight 800 */
2113
+ get HeadlineMediumEmphasized() {
2114
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineMediumEmphasized");
2115
+ }
2116
+ /** Headline Small Emphasized – `24px`, weight 800 */
2117
+ get HeadlineSmallEmphasized() {
2118
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "HeadlineSmallEmphasized");
2119
+ }
2120
+ /** Title Large Emphasized – `22px`, weight 700 */
2121
+ get TitleLargeEmphasized() {
2122
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleLargeEmphasized");
2123
+ }
2124
+ /** Title Medium Emphasized – `16px`, weight 700 */
2125
+ get TitleMediumEmphasized() {
2126
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleMediumEmphasized");
2127
+ }
2128
+ /** Title Small Emphasized – `14px`, weight 700 */
2129
+ get TitleSmallEmphasized() {
2130
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "TitleSmallEmphasized");
2131
+ }
2132
+ /** Body Large Emphasized – `16px`, weight 700 */
2133
+ get BodyLargeEmphasized() {
2134
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyLargeEmphasized");
2135
+ }
2136
+ /** Body Medium Emphasized – `14px`, weight 700 */
2137
+ get BodyMediumEmphasized() {
2138
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodyMediumEmphasized");
2139
+ }
2140
+ /** Body Small Emphasized – `12px`, weight 700 */
2141
+ get BodySmallEmphasized() {
2142
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "BodySmallEmphasized");
2143
+ }
2144
+ /** Label Large Emphasized – `14px`, weight 800 */
2145
+ get LabelLargeEmphasized() {
2146
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelLargeEmphasized");
2147
+ }
2148
+ /** Label Medium Emphasized – `12px`, weight 800 */
2149
+ get LabelMediumEmphasized() {
2150
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelMediumEmphasized");
2151
+ }
2152
+ /** Label Small Emphasized – `11px`, weight 800 */
2153
+ get LabelSmallEmphasized() {
2154
+ return __privateMethod(this, _TypographyTokens_instances, get_fn).call(this, "LabelSmallEmphasized");
2155
+ }
2156
+ };
2157
+ _fontFamily = new WeakMap();
2158
+ _fontVariationSettings = new WeakMap();
2159
+ _cache = new WeakMap();
2160
+ _TypographyTokens_instances = new WeakSet();
2161
+ get_fn = function(prefix) {
2162
+ let style = __privateGet(this, _cache).get(prefix);
2163
+ if (!style) {
2164
+ style = buildStyle(prefix, __privateGet(this, _fontFamily), __privateGet(this, _fontVariationSettings));
2165
+ __privateGet(this, _cache).set(prefix, style);
2166
+ }
2167
+ return style;
2168
+ };
2169
+ var _tokens;
2170
+ var Typography = class {
2171
+ constructor(tokens = defaultTokens) {
2172
+ __privateAdd(this, _tokens);
2173
+ __privateSet(this, _tokens, tokens);
2174
+ }
2175
+ // ─── Baseline Styles ────────────────────────────────────────────────────────
2176
+ /** Display Large text style (`57px`, weight `400`). */
2177
+ get displayLarge() {
2178
+ return __privateGet(this, _tokens).DisplayLarge;
2179
+ }
2180
+ /** Display Medium text style (`45px`, weight `400`). */
2181
+ get displayMedium() {
2182
+ return __privateGet(this, _tokens).DisplayMedium;
2183
+ }
2184
+ /** Display Small text style (`36px`, weight `400`). */
2185
+ get displaySmall() {
2186
+ return __privateGet(this, _tokens).DisplaySmall;
2187
+ }
2188
+ /** Headline Large text style (`32px`, weight `400`). */
2189
+ get headlineLarge() {
2190
+ return __privateGet(this, _tokens).HeadlineLarge;
2191
+ }
2192
+ /** Headline Medium text style (`28px`, weight `400`). */
2193
+ get headlineMedium() {
2194
+ return __privateGet(this, _tokens).HeadlineMedium;
2195
+ }
2196
+ /** Headline Small text style (`24px`, weight `400`). */
2197
+ get headlineSmall() {
2198
+ return __privateGet(this, _tokens).HeadlineSmall;
2199
+ }
2200
+ /** Title Large text style (`22px`, weight `400`). */
2201
+ get titleLarge() {
2202
+ return __privateGet(this, _tokens).TitleLarge;
2203
+ }
2204
+ /** Title Medium text style (`16px`, weight `500`). */
2205
+ get titleMedium() {
2206
+ return __privateGet(this, _tokens).TitleMedium;
2207
+ }
2208
+ /** Title Small text style (`14px`, weight `500`). */
2209
+ get titleSmall() {
2210
+ return __privateGet(this, _tokens).TitleSmall;
2211
+ }
2212
+ /** Body Large text style (`16px`, weight `400`). */
2213
+ get bodyLarge() {
2214
+ return __privateGet(this, _tokens).BodyLarge;
2215
+ }
2216
+ /** Body Medium text style (`14px`, weight `400`). */
2217
+ get bodyMedium() {
2218
+ return __privateGet(this, _tokens).BodyMedium;
2219
+ }
2220
+ /** Body Small text style (`12px`, weight `400`). */
2221
+ get bodySmall() {
2222
+ return __privateGet(this, _tokens).BodySmall;
2223
+ }
2224
+ /** Label Large text style (`14px`, weight `500`). */
2225
+ get labelLarge() {
2226
+ return __privateGet(this, _tokens).LabelLarge;
2227
+ }
2228
+ /** Label Medium text style (`12px`, weight `500`). */
2229
+ get labelMedium() {
2230
+ return __privateGet(this, _tokens).LabelMedium;
2231
+ }
2232
+ /** Label Small text style (`11px`, weight `500`). */
2233
+ get labelSmall() {
2234
+ return __privateGet(this, _tokens).LabelSmall;
2235
+ }
2236
+ // ─── Emphasized Styles (MD3 Expressive) ─────────────────────────────────────
2237
+ /** Display Large Emphasized text style (`57px`, weight `800`). */
2238
+ get displayLargeEmphasized() {
2239
+ return __privateGet(this, _tokens).DisplayLargeEmphasized;
2240
+ }
2241
+ /** Display Medium Emphasized text style (`45px`, weight `800`). */
2242
+ get displayMediumEmphasized() {
2243
+ return __privateGet(this, _tokens).DisplayMediumEmphasized;
2244
+ }
2245
+ /** Display Small Emphasized text style (`36px`, weight `800`). */
2246
+ get displaySmallEmphasized() {
2247
+ return __privateGet(this, _tokens).DisplaySmallEmphasized;
2248
+ }
2249
+ /** Headline Large Emphasized text style (`32px`, weight `800`). */
2250
+ get headlineLargeEmphasized() {
2251
+ return __privateGet(this, _tokens).HeadlineLargeEmphasized;
2252
+ }
2253
+ /** Headline Medium Emphasized text style (`28px`, weight `800`). */
2254
+ get headlineMediumEmphasized() {
2255
+ return __privateGet(this, _tokens).HeadlineMediumEmphasized;
2256
+ }
2257
+ /** Headline Small Emphasized text style (`24px`, weight `800`). */
2258
+ get headlineSmallEmphasized() {
2259
+ return __privateGet(this, _tokens).HeadlineSmallEmphasized;
2260
+ }
2261
+ /** Title Large Emphasized text style (`22px`, weight `700`). */
2262
+ get titleLargeEmphasized() {
2263
+ return __privateGet(this, _tokens).TitleLargeEmphasized;
2264
+ }
2265
+ /** Title Medium Emphasized text style (`16px`, weight `700`). */
2266
+ get titleMediumEmphasized() {
2267
+ return __privateGet(this, _tokens).TitleMediumEmphasized;
2268
+ }
2269
+ /** Title Small Emphasized text style (`14px`, weight `700`). */
2270
+ get titleSmallEmphasized() {
2271
+ return __privateGet(this, _tokens).TitleSmallEmphasized;
2272
+ }
2273
+ /** Body Large Emphasized text style (`16px`, weight `700`). */
2274
+ get bodyLargeEmphasized() {
2275
+ return __privateGet(this, _tokens).BodyLargeEmphasized;
2276
+ }
2277
+ /** Body Medium Emphasized text style (`14px`, weight `700`). */
2278
+ get bodyMediumEmphasized() {
2279
+ return __privateGet(this, _tokens).BodyMediumEmphasized;
2280
+ }
2281
+ /** Body Small Emphasized text style (`12px`, weight `700`). */
2282
+ get bodySmallEmphasized() {
2283
+ return __privateGet(this, _tokens).BodySmallEmphasized;
2284
+ }
2285
+ /** Label Large Emphasized text style (`14px`, weight `800`). */
2286
+ get labelLargeEmphasized() {
2287
+ return __privateGet(this, _tokens).LabelLargeEmphasized;
2288
+ }
2289
+ /** Label Medium Emphasized text style (`12px`, weight `800`). */
2290
+ get labelMediumEmphasized() {
2291
+ return __privateGet(this, _tokens).LabelMediumEmphasized;
2292
+ }
2293
+ /** Label Small Emphasized text style (`11px`, weight `800`). */
2294
+ get labelSmallEmphasized() {
2295
+ return __privateGet(this, _tokens).LabelSmallEmphasized;
2296
+ }
2297
+ // ─── Methods ─────────────────────────────────────────────────────────────────
2298
+ /**
2299
+ * Returns the `TextStyle` corresponding to the given {@link TypographyKeyTokens}.
2300
+ *
2301
+ * Port of `internal fun Typography.fromToken(value: TypographyKeyTokens): TextStyle`.
2302
+ *
2303
+ * @example
2304
+ * ```ts
2305
+ * const style = typography.fromToken(TypographyKeyTokens.BodyLarge);
2306
+ * ```
2307
+ */
2308
+ fromToken(value) {
2309
+ return this[TOKEN_TO_PROP[value]];
2310
+ }
2311
+ /**
2312
+ * Creates a new `Typography` instance with the specified property overrides
2313
+ * merged on top of the current instance's styles.
2314
+ *
2315
+ * Port of Compose's `fun Typography.copy(...)`.
2316
+ *
2317
+ * Unlike a shallow `Object.assign`, this method preserves the lazy-getter
2318
+ * architecture — overridden styles are stored separately and looked up first
2319
+ * on each property access, while non-overridden styles continue to be
2320
+ * resolved from the underlying {@link TypographyTokens}.
2321
+ *
2322
+ * @param overrides - Map of camelCase property names to partial `TextStyle` overrides.
2323
+ * @returns A new `Typography` instance. The original is never mutated.
2324
+ *
2325
+ * @example
2326
+ * ```ts
2327
+ * const custom = typography.copy({ bodyLarge: { fontSize: "2rem" } });
2328
+ * custom.bodyLarge.fontSize; // "2rem"
2329
+ * custom.bodySmall.fontSize; // original token value — untouched
2330
+ * ```
2331
+ */
2332
+ copy(overrides) {
2333
+ return new OverriddenTypography(__privateGet(this, _tokens), this, overrides);
2334
+ }
2335
+ };
2336
+ _tokens = new WeakMap();
2337
+ var _base, _overrides, _OverriddenTypography_instances, resolve_fn;
2338
+ var OverriddenTypography = class extends Typography {
2339
+ constructor(tokens, base, overrides) {
2340
+ super(tokens);
2341
+ __privateAdd(this, _OverriddenTypography_instances);
2342
+ __privateAdd(this, _base);
2343
+ __privateAdd(this, _overrides);
2344
+ __privateSet(this, _base, base);
2345
+ __privateSet(this, _overrides, overrides);
2346
+ }
2347
+ // ─── Baseline
2348
+ get displayLarge() {
2349
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayLarge");
2350
+ }
2351
+ get displayMedium() {
2352
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayMedium");
2353
+ }
2354
+ get displaySmall() {
2355
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displaySmall");
2356
+ }
2357
+ get headlineLarge() {
2358
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineLarge");
2359
+ }
2360
+ get headlineMedium() {
2361
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineMedium");
2362
+ }
2363
+ get headlineSmall() {
2364
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineSmall");
2365
+ }
2366
+ get titleLarge() {
2367
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleLarge");
2368
+ }
2369
+ get titleMedium() {
2370
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleMedium");
2371
+ }
2372
+ get titleSmall() {
2373
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleSmall");
2374
+ }
2375
+ get bodyLarge() {
2376
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyLarge");
2377
+ }
2378
+ get bodyMedium() {
2379
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyMedium");
2380
+ }
2381
+ get bodySmall() {
2382
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodySmall");
2383
+ }
2384
+ get labelLarge() {
2385
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelLarge");
2386
+ }
2387
+ get labelMedium() {
2388
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelMedium");
2389
+ }
2390
+ get labelSmall() {
2391
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelSmall");
2392
+ }
2393
+ // ─── Emphasized
2394
+ get displayLargeEmphasized() {
2395
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayLargeEmphasized");
2396
+ }
2397
+ get displayMediumEmphasized() {
2398
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displayMediumEmphasized");
2399
+ }
2400
+ get displaySmallEmphasized() {
2401
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "displaySmallEmphasized");
2402
+ }
2403
+ get headlineLargeEmphasized() {
2404
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineLargeEmphasized");
2405
+ }
2406
+ get headlineMediumEmphasized() {
2407
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineMediumEmphasized");
2408
+ }
2409
+ get headlineSmallEmphasized() {
2410
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "headlineSmallEmphasized");
2411
+ }
2412
+ get titleLargeEmphasized() {
2413
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleLargeEmphasized");
2414
+ }
2415
+ get titleMediumEmphasized() {
2416
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleMediumEmphasized");
2417
+ }
2418
+ get titleSmallEmphasized() {
2419
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "titleSmallEmphasized");
2420
+ }
2421
+ get bodyLargeEmphasized() {
2422
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyLargeEmphasized");
2423
+ }
2424
+ get bodyMediumEmphasized() {
2425
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodyMediumEmphasized");
2426
+ }
2427
+ get bodySmallEmphasized() {
2428
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "bodySmallEmphasized");
2429
+ }
2430
+ get labelLargeEmphasized() {
2431
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelLargeEmphasized");
2432
+ }
2433
+ get labelMediumEmphasized() {
2434
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelMediumEmphasized");
2435
+ }
2436
+ get labelSmallEmphasized() {
2437
+ return __privateMethod(this, _OverriddenTypography_instances, resolve_fn).call(this, "labelSmallEmphasized");
2438
+ }
2439
+ };
2440
+ _base = new WeakMap();
2441
+ _overrides = new WeakMap();
2442
+ _OverriddenTypography_instances = new WeakSet();
2443
+ resolve_fn = function(key) {
2444
+ const override = __privateGet(this, _overrides)[key];
2445
+ const base = __privateGet(this, _base)[key];
2446
+ return override ? __spreadValues(__spreadValues({}, base), override) : base;
2447
+ };
2448
+ var TOKEN_TO_PROP = {
2449
+ ["DisplayLarge" /* DisplayLarge */]: "displayLarge",
2450
+ ["DisplayMedium" /* DisplayMedium */]: "displayMedium",
2451
+ ["DisplaySmall" /* DisplaySmall */]: "displaySmall",
2452
+ ["HeadlineLarge" /* HeadlineLarge */]: "headlineLarge",
2453
+ ["HeadlineMedium" /* HeadlineMedium */]: "headlineMedium",
2454
+ ["HeadlineSmall" /* HeadlineSmall */]: "headlineSmall",
2455
+ ["TitleLarge" /* TitleLarge */]: "titleLarge",
2456
+ ["TitleMedium" /* TitleMedium */]: "titleMedium",
2457
+ ["TitleSmall" /* TitleSmall */]: "titleSmall",
2458
+ ["BodyLarge" /* BodyLarge */]: "bodyLarge",
2459
+ ["BodyMedium" /* BodyMedium */]: "bodyMedium",
2460
+ ["BodySmall" /* BodySmall */]: "bodySmall",
2461
+ ["LabelLarge" /* LabelLarge */]: "labelLarge",
2462
+ ["LabelMedium" /* LabelMedium */]: "labelMedium",
2463
+ ["LabelSmall" /* LabelSmall */]: "labelSmall",
2464
+ ["DisplayLargeEmphasized" /* DisplayLargeEmphasized */]: "displayLargeEmphasized",
2465
+ ["DisplayMediumEmphasized" /* DisplayMediumEmphasized */]: "displayMediumEmphasized",
2466
+ ["DisplaySmallEmphasized" /* DisplaySmallEmphasized */]: "displaySmallEmphasized",
2467
+ ["HeadlineLargeEmphasized" /* HeadlineLargeEmphasized */]: "headlineLargeEmphasized",
2468
+ ["HeadlineMediumEmphasized" /* HeadlineMediumEmphasized */]: "headlineMediumEmphasized",
2469
+ ["HeadlineSmallEmphasized" /* HeadlineSmallEmphasized */]: "headlineSmallEmphasized",
2470
+ ["TitleLargeEmphasized" /* TitleLargeEmphasized */]: "titleLargeEmphasized",
2471
+ ["TitleMediumEmphasized" /* TitleMediumEmphasized */]: "titleMediumEmphasized",
2472
+ ["TitleSmallEmphasized" /* TitleSmallEmphasized */]: "titleSmallEmphasized",
2473
+ ["BodyLargeEmphasized" /* BodyLargeEmphasized */]: "bodyLargeEmphasized",
2474
+ ["BodyMediumEmphasized" /* BodyMediumEmphasized */]: "bodyMediumEmphasized",
2475
+ ["BodySmallEmphasized" /* BodySmallEmphasized */]: "bodySmallEmphasized",
2476
+ ["LabelLargeEmphasized" /* LabelLargeEmphasized */]: "labelLargeEmphasized",
2477
+ ["LabelMediumEmphasized" /* LabelMediumEmphasized */]: "labelMediumEmphasized",
2478
+ ["LabelSmallEmphasized" /* LabelSmallEmphasized */]: "labelSmallEmphasized"
2479
+ };
2480
+ var defaultTokens = new TypographyTokens();
2481
+ var defaultTypography = new Typography();
2482
+ var TypographyContext = React11.createContext(defaultTypography);
2483
+ var ThemeContext = React11.createContext(void 0);
2484
+ var STORAGE_KEY_COLOR = "md3-source-color";
2485
+ var STORAGE_KEY_MODE = "md3-theme-mode";
2486
+ var defaultTokens2 = new TypographyTokens();
2487
+ var defaultTypography2 = new Typography(defaultTokens2);
2488
+ function MD3ThemeProvider({
2489
+ children,
2490
+ sourceColor: initialSourceColor = "#6750A4",
2491
+ defaultMode = "light",
2492
+ persistToLocalStorage = false,
2493
+ typography: typographyProp,
2494
+ fontFamily,
2495
+ fontVariationAxes,
2496
+ enableSnackbar = false
2497
+ }) {
2498
+ const [sourceColor, setSourceColor] = React11.useState(initialSourceColor);
2499
+ const [mode, setMode] = React11.useState(defaultMode);
2500
+ const [isHydrated, setIsHydrated] = React11.useState(!persistToLocalStorage);
2501
+ React11.useEffect(() => {
2502
+ if (!persistToLocalStorage) return;
2503
+ const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
2504
+ const savedMode = localStorage.getItem(
2505
+ STORAGE_KEY_MODE
2506
+ );
2507
+ if (savedColor) setSourceColor(savedColor);
2508
+ if (savedMode === "light" || savedMode === "dark" || savedMode === "system")
2509
+ setMode(savedMode);
2510
+ setIsHydrated(true);
2511
+ }, [persistToLocalStorage]);
2512
+ React11.useEffect(() => {
2513
+ if (!isHydrated) return;
2514
+ applyTheme(sourceColor, mode);
2515
+ if (persistToLocalStorage) {
2516
+ localStorage.setItem(STORAGE_KEY_COLOR, sourceColor);
2517
+ localStorage.setItem(STORAGE_KEY_MODE, mode);
2518
+ }
2519
+ }, [sourceColor, mode, persistToLocalStorage, isHydrated]);
2520
+ React11.useEffect(() => {
2521
+ if (mode !== "system" || typeof window === "undefined") return;
2522
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
2523
+ const handleChange = () => applyTheme(sourceColor, "system");
2524
+ mediaQuery.addEventListener("change", handleChange);
2525
+ return () => mediaQuery.removeEventListener("change", handleChange);
2526
+ }, [mode, sourceColor]);
2527
+ const effectiveMode = resolveMode(mode);
2528
+ const themeValue = React11.useMemo(
2529
+ () => ({ sourceColor, setSourceColor, mode, setMode, effectiveMode }),
2530
+ [sourceColor, mode, effectiveMode]
2531
+ );
2532
+ const typographyValue = React11.useMemo(() => {
2533
+ if (typographyProp) return typographyProp;
2534
+ if (fontFamily != null ? fontFamily : fontVariationAxes) {
2535
+ return new Typography(
2536
+ new TypographyTokens({ fontFamily, fontVariationAxes })
2537
+ );
2538
+ }
2539
+ return defaultTypography2;
2540
+ }, [typographyProp, fontFamily, fontVariationAxes]);
2541
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, children: /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: themeValue, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyContext.Provider, { value: typographyValue, children: enableSnackbar ? /* @__PURE__ */ jsxRuntime.jsx(SnackbarMountedProvider, { children }) : children }) }) });
2542
+ }
2543
+ function SnackbarMountedProvider({ children }) {
2544
+ const state = useSnackbarState();
2545
+ const contextValue = React11.useMemo(
2546
+ () => ({ showSnackbar: state.showSnackbar }),
2547
+ [state.showSnackbar]
2548
+ );
2549
+ return /* @__PURE__ */ jsxRuntime.jsxs(SnackbarContext.Provider, { value: contextValue, children: [
2550
+ children,
2551
+ /* @__PURE__ */ jsxRuntime.jsx(SnackbarHost, { state })
2552
+ ] });
2553
+ }
2554
+ function useTheme() {
2555
+ const context = React11.useContext(ThemeContext);
2556
+ if (!context) {
2557
+ throw new Error("useTheme must be used within <MD3ThemeProvider>.");
2558
+ }
2559
+ return context;
2560
+ }
2561
+ function useThemeMode() {
2562
+ const { mode, setMode, effectiveMode } = useTheme();
2563
+ return { mode, setMode, effectiveMode };
2564
+ }
2565
+
2566
+ exports.Icon = Icon;
2567
+ exports.MD3ThemeProvider = MD3ThemeProvider;
2568
+ exports.MaterialSymbolsPreconnect = MaterialSymbolsPreconnect;
2569
+ exports.Ripple = Ripple;
2570
+ exports.applyTheme = applyTheme;
2571
+ exports.cn = cn;
2572
+ exports.generateM3Theme = generateM3Theme;
2573
+ exports.resolveMode = resolveMode;
2574
+ exports.useDOMRipple = useRipple;
2575
+ exports.useMediaQuery = useMediaQuery;
2576
+ exports.useRipple = useRipple2;
2577
+ exports.useRippleState = useRippleState;
2578
+ exports.useTheme = useTheme;
2579
+ exports.useThemeMode = useThemeMode;
2580
+ //# sourceMappingURL=core.js.map
2581
+ //# sourceMappingURL=core.js.map