@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
@@ -0,0 +1,4227 @@
1
+ "use client";
2
+ import { Slot } from '@radix-ui/react-slot';
3
+ import { m, LazyMotion, domMax, useMotionValue, animate, useAnimationFrame, AnimatePresence, useReducedMotion, useSpring, useTransform } from 'motion/react';
4
+ import * as React11 from 'react';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+ import { cornerRadius } from '@bug-on/m3-tokens';
9
+ import { cva } from 'class-variance-authority';
10
+
11
+ var __defProp = Object.defineProperty;
12
+ var __defProps = Object.defineProperties;
13
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
14
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
17
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ if (__getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(b)) {
24
+ if (__propIsEnum.call(b, prop))
25
+ __defNormalProp(a, prop, b[prop]);
26
+ }
27
+ return a;
28
+ };
29
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
30
+ var __objRest = (source, exclude) => {
31
+ var target = {};
32
+ for (var prop in source)
33
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
34
+ target[prop] = source[prop];
35
+ if (source != null && __getOwnPropSymbols)
36
+ for (var prop of __getOwnPropSymbols(source)) {
37
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
38
+ target[prop] = source[prop];
39
+ }
40
+ return target;
41
+ };
42
+ function cn(...inputs) {
43
+ return twMerge(clsx(inputs));
44
+ }
45
+ 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";
46
+ var SHAPE_KEY_SPLINES = [
47
+ "0.5 0.2 0 0.8",
48
+ "0.5 0.2 0 0.8",
49
+ "0.5 0.2 0 0.8",
50
+ "0.5 0.2 0 0.8",
51
+ "0.5 0.2 0 0.8",
52
+ "0.5 0.2 0 0.8",
53
+ "0.5 0.2 0 0.8",
54
+ "0.5 0.2 0 0.8",
55
+ "0.5 0.2 0 0.8",
56
+ "0.5 0.2 0 0.8",
57
+ "0.5 0.2 0 0.8",
58
+ "0.5 0.2 0 0.8",
59
+ "0.5 0.2 0 0.8"
60
+ ].join("; ");
61
+ var SHAPE_VALUES = [
62
+ "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",
63
+ "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",
64
+ "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",
65
+ "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",
66
+ "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",
67
+ "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",
68
+ "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",
69
+ "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",
70
+ "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",
71
+ "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",
72
+ "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",
73
+ "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",
74
+ "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",
75
+ "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"
76
+ ].join(";");
77
+ var ROTATE_KEY_TIMES = "0; 0.14; 0.29; 0.43; 0.57; 0.71; 0.86; 1";
78
+ var ROTATE_KEY_SPLINES = [
79
+ "0.5 0.2 0 0.8",
80
+ "0.5 0.2 0 0.8",
81
+ "0.5 0.2 0 0.8",
82
+ "0.5 0.2 0 0.8",
83
+ "0.5 0.2 0 0.8",
84
+ "0.5 0.2 0 0.8",
85
+ "0.5 0.2 0 0.8"
86
+ ].join("; ");
87
+ 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";
88
+ 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";
89
+ 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";
90
+ var IndeterminateSvg = React11.memo(function IndeterminateSvg2({
91
+ size
92
+ }) {
93
+ const [ready, setReady] = React11.useState(false);
94
+ React11.useEffect(() => {
95
+ const raf = requestAnimationFrame(() => setReady(true));
96
+ return () => cancelAnimationFrame(raf);
97
+ }, []);
98
+ return /* @__PURE__ */ jsx(
99
+ "svg",
100
+ {
101
+ viewBox: "4 4 40 40",
102
+ width: size,
103
+ height: size,
104
+ fill: "currentColor",
105
+ xmlns: "http://www.w3.org/2000/svg",
106
+ "aria-hidden": "true",
107
+ focusable: "false",
108
+ children: /* @__PURE__ */ jsx("path", { d: SHAPE_VALUES.split(";")[0], children: ready && /* @__PURE__ */ jsxs(Fragment, { children: [
109
+ /* @__PURE__ */ jsx(
110
+ "animate",
111
+ {
112
+ attributeName: "d",
113
+ dur: "5s",
114
+ repeatCount: "indefinite",
115
+ calcMode: "spline",
116
+ keySplines: SHAPE_KEY_SPLINES,
117
+ keyTimes: SHAPE_KEY_TIMES,
118
+ values: SHAPE_VALUES
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsx(
122
+ "animateTransform",
123
+ {
124
+ attributeName: "transform",
125
+ attributeType: "XML",
126
+ type: "rotate",
127
+ dur: "5s",
128
+ repeatCount: "indefinite",
129
+ calcMode: "spline",
130
+ keySplines: ROTATE_KEY_SPLINES,
131
+ keyTimes: ROTATE_KEY_TIMES,
132
+ values: ROTATE_VALUES
133
+ }
134
+ )
135
+ ] }) })
136
+ }
137
+ );
138
+ });
139
+ var DeterminateSvg = React11.memo(function DeterminateSvg2({
140
+ size,
141
+ progress
142
+ }) {
143
+ const p = Math.min(1, Math.max(0, progress));
144
+ const rotation = -180 * p;
145
+ const pathD = p < 0.5 ? DETERMINATE_CIRCLE : DETERMINATE_SOFT_BURST;
146
+ return /* @__PURE__ */ jsx(
147
+ "svg",
148
+ {
149
+ viewBox: "4 4 40 40",
150
+ width: size,
151
+ height: size,
152
+ fill: "currentColor",
153
+ xmlns: "http://www.w3.org/2000/svg",
154
+ "aria-hidden": "true",
155
+ focusable: "false",
156
+ style: {
157
+ transform: `rotate(${rotation}deg)`,
158
+ transition: "transform 0.3s ease"
159
+ },
160
+ children: /* @__PURE__ */ jsx("path", { d: pathD, style: { transition: "d 0.3s ease" } })
161
+ }
162
+ );
163
+ });
164
+ var LoadingIndicator = React11.forwardRef(
165
+ (_a, ref) => {
166
+ var _b = _a, {
167
+ variant = "uncontained",
168
+ size = 48,
169
+ progress,
170
+ color,
171
+ className,
172
+ "aria-label": ariaLabel,
173
+ style
174
+ } = _b, restProps = __objRest(_b, [
175
+ "variant",
176
+ "size",
177
+ "progress",
178
+ "color",
179
+ "className",
180
+ "aria-label",
181
+ "style"
182
+ ]);
183
+ const isContained = variant === "contained";
184
+ const isDeterminate = progress !== void 0;
185
+ const clampedSize = Math.min(240, Math.max(24, size));
186
+ const scaleFactor = clampedSize / 48;
187
+ const containerSize = isContained ? 38 * scaleFactor : void 0;
188
+ const indicatorSize = isContained ? 24 * scaleFactor : clampedSize;
189
+ const activeColor = isContained ? color != null ? color : "var(--md-sys-color-indicator-contained-active)" : color != null ? color : "var(--md-sys-color-indicator-active)";
190
+ const ariaNow = isDeterminate ? Math.round(Math.min(1, Math.max(0, progress)) * 100) : void 0;
191
+ return /* @__PURE__ */ jsx(
192
+ "div",
193
+ __spreadProps(__spreadValues({
194
+ ref,
195
+ role: "progressbar",
196
+ "aria-label": ariaLabel,
197
+ "aria-valuemin": 0,
198
+ "aria-valuemax": 100,
199
+ "aria-valuenow": ariaNow,
200
+ className: cn(
201
+ "inline-flex items-center justify-center shrink-0",
202
+ className
203
+ ),
204
+ style: __spreadValues({
205
+ width: clampedSize,
206
+ height: clampedSize,
207
+ color: activeColor
208
+ }, style)
209
+ }, restProps), {
210
+ children: isContained ? /* @__PURE__ */ jsx(
211
+ "div",
212
+ {
213
+ className: "flex items-center justify-center rounded-full",
214
+ style: {
215
+ width: containerSize,
216
+ height: containerSize,
217
+ backgroundColor: "var(--md-sys-color-indicator-contained-container)"
218
+ },
219
+ children: isDeterminate ? /* @__PURE__ */ jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsx(IndeterminateSvg, { size: indicatorSize })
220
+ }
221
+ ) : isDeterminate ? /* @__PURE__ */ jsx(DeterminateSvg, { size: indicatorSize, progress }) : /* @__PURE__ */ jsx(IndeterminateSvg, { size: indicatorSize })
222
+ })
223
+ );
224
+ }
225
+ );
226
+ LoadingIndicator.displayName = "LoadingIndicator";
227
+
228
+ // src/ui/progress-indicator/utils.ts
229
+ function easeInOutCubic(x) {
230
+ return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
231
+ }
232
+ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
233
+ const circumference = 2 * Math.PI * radius;
234
+ const numWaves = Math.max(
235
+ 3,
236
+ Math.round(circumference / Math.max(1, wavelength))
237
+ );
238
+ const steps = numWaves * 4;
239
+ const dt = 2 * Math.PI / steps;
240
+ const rAt = (t) => radius + amplitude * Math.sin(numWaves * t);
241
+ const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t);
242
+ const xAt = (t) => center + rAt(t) * Math.cos(t);
243
+ const yAt = (t) => center + rAt(t) * Math.sin(t);
244
+ const dxAt = (t) => drAt(t) * Math.cos(t) - rAt(t) * Math.sin(t);
245
+ const dyAt = (t) => drAt(t) * Math.sin(t) + rAt(t) * Math.cos(t);
246
+ let d = "";
247
+ const tStart = 0;
248
+ for (let i = 0; i < steps; i++) {
249
+ const t0 = tStart + i * dt;
250
+ const t1 = tStart + (i + 1) * dt;
251
+ const scale = dt / 3;
252
+ const cp1x = xAt(t0) + scale * dxAt(t0);
253
+ const cp1y = yAt(t0) + scale * dyAt(t0);
254
+ const cp2x = xAt(t1) - scale * dxAt(t1);
255
+ const cp2y = yAt(t1) - scale * dyAt(t1);
256
+ if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
257
+ d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
258
+ }
259
+ d += " Z";
260
+ return d;
261
+ }
262
+ function getSinePath(startX, endX, phase, wl, amp) {
263
+ if (startX >= endX) return "";
264
+ let d = "";
265
+ const step = amp === 0 ? Math.max(10, endX - startX) : 1;
266
+ const yStart = Math.sin((startX + phase) / wl * 2 * Math.PI) * amp;
267
+ d += `M ${startX.toFixed(2)} ${yStart.toFixed(2)}`;
268
+ let nextX = Math.ceil(startX / step) * step;
269
+ if (nextX === startX) nextX += step;
270
+ while (nextX < endX) {
271
+ const y = Math.sin((nextX + phase) / wl * 2 * Math.PI) * amp;
272
+ d += ` L ${nextX.toFixed(2)} ${y.toFixed(2)}`;
273
+ nextX += step;
274
+ }
275
+ const yEnd = Math.sin((endX + phase) / wl * 2 * Math.PI) * amp;
276
+ d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
277
+ return d;
278
+ }
279
+ var CircularProgress = React11.forwardRef(
280
+ (_a, ref) => {
281
+ var _b = _a, {
282
+ value,
283
+ size = 48,
284
+ trackHeight = 4,
285
+ shape = "flat",
286
+ amplitude,
287
+ wavelength,
288
+ gapSize = 4,
289
+ crawlerSpeed = 1,
290
+ color,
291
+ trackColor,
292
+ className,
293
+ "aria-label": ariaLabel
294
+ } = _b, restProps = __objRest(_b, [
295
+ "value",
296
+ "size",
297
+ "trackHeight",
298
+ "shape",
299
+ "amplitude",
300
+ "wavelength",
301
+ "gapSize",
302
+ "crawlerSpeed",
303
+ "color",
304
+ "trackColor",
305
+ "className",
306
+ "aria-label"
307
+ ]);
308
+ const isDeterminate = value !== void 0;
309
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
310
+ const radius = (size - trackHeight) / 2;
311
+ const center = size / 2;
312
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
313
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
314
+ const isWavy = shape === "wavy";
315
+ const BASELINE_SIZE = 48;
316
+ const scaleFactor = size / BASELINE_SIZE;
317
+ const effectiveAmplitude = React11.useMemo(
318
+ () => amplitude != null ? amplitude : 1.6 * scaleFactor,
319
+ [amplitude, scaleFactor]
320
+ );
321
+ const effectiveWavelength = React11.useMemo(
322
+ () => wavelength != null ? wavelength : 15 * scaleFactor,
323
+ [wavelength, scaleFactor]
324
+ );
325
+ const wavyActivePath = React11.useMemo(
326
+ () => isWavy ? generateWavyCircularPath(
327
+ center,
328
+ radius,
329
+ effectiveAmplitude,
330
+ effectiveWavelength
331
+ ) : null,
332
+ [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
333
+ );
334
+ const circumference = React11.useMemo(() => 2 * Math.PI * radius, [radius]);
335
+ const gapForTrack = React11.useMemo(
336
+ () => (gapSize + trackHeight) / circumference,
337
+ [gapSize, trackHeight, circumference]
338
+ );
339
+ const activeAngularFraction = isDeterminate ? clampedValue / 100 : 0;
340
+ const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
341
+ const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
342
+ const ActiveCircleElem = m.circle;
343
+ const ActivePathElem = m.path;
344
+ return /* @__PURE__ */ jsx(
345
+ "div",
346
+ __spreadProps(__spreadValues({
347
+ ref,
348
+ role: "progressbar",
349
+ "aria-label": ariaLabel,
350
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
351
+ "aria-valuemin": 0,
352
+ "aria-valuemax": 100,
353
+ className: cn(
354
+ "relative inline-flex items-center justify-center shrink-0",
355
+ className
356
+ ),
357
+ style: { width: size, height: size }
358
+ }, restProps), {
359
+ children: /* @__PURE__ */ jsxs(LazyMotion, { features: domMax, strict: true, children: [
360
+ /* @__PURE__ */ jsxs(
361
+ "svg",
362
+ {
363
+ width: size,
364
+ height: size,
365
+ viewBox: `0 0 ${size} ${size}`,
366
+ "aria-hidden": "true",
367
+ style: { transform: "rotate(-90deg)", overflow: "visible" },
368
+ children: [
369
+ isDeterminate ? /* @__PURE__ */ jsx(
370
+ m.circle,
371
+ {
372
+ cx: center,
373
+ cy: center,
374
+ r: radius,
375
+ fill: "none",
376
+ stroke: bgTrackColor,
377
+ strokeWidth: trackHeight,
378
+ initial: { pathLength: trackLength, pathOffset: trackOffset },
379
+ animate: { pathLength: trackLength, pathOffset: trackOffset },
380
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
381
+ strokeLinecap: "round"
382
+ }
383
+ ) : null,
384
+ isDeterminate && (isWavy ? /* @__PURE__ */ jsx(
385
+ ActivePathElem,
386
+ {
387
+ d: wavyActivePath != null ? wavyActivePath : "",
388
+ fill: "none",
389
+ stroke: activeColor,
390
+ strokeWidth: trackHeight,
391
+ strokeLinecap: "round",
392
+ initial: { pathLength: 0 },
393
+ animate: { pathLength: clampedValue / 100 },
394
+ transition: {
395
+ duration: 0.4,
396
+ ease: [0.2, 0, 0, 1]
397
+ }
398
+ }
399
+ ) : /* @__PURE__ */ jsx(
400
+ ActiveCircleElem,
401
+ {
402
+ cx: center,
403
+ cy: center,
404
+ r: radius,
405
+ fill: "none",
406
+ stroke: activeColor,
407
+ strokeWidth: trackHeight,
408
+ strokeLinecap: "round",
409
+ initial: { pathLength: 0 },
410
+ animate: { pathLength: clampedValue / 100 },
411
+ transition: {
412
+ duration: 0.4,
413
+ ease: [0.2, 0, 0, 1]
414
+ }
415
+ }
416
+ ))
417
+ ]
418
+ }
419
+ ),
420
+ !isDeterminate && /* @__PURE__ */ jsxs(
421
+ m.svg,
422
+ {
423
+ width: size,
424
+ height: size,
425
+ viewBox: `0 0 ${size} ${size}`,
426
+ "aria-hidden": "true",
427
+ style: {
428
+ position: "absolute",
429
+ inset: 0,
430
+ overflow: "visible",
431
+ rotate: "-90deg",
432
+ transformOrigin: "center"
433
+ },
434
+ animate: { rotate: ["-90deg", "270deg"] },
435
+ transition: {
436
+ rotate: {
437
+ duration: 2 / Math.max(0.1, crawlerSpeed),
438
+ repeat: Number.POSITIVE_INFINITY,
439
+ ease: "linear"
440
+ }
441
+ },
442
+ children: [
443
+ /* @__PURE__ */ jsx(
444
+ m.circle,
445
+ {
446
+ cx: center,
447
+ cy: center,
448
+ r: radius,
449
+ fill: "none",
450
+ stroke: bgTrackColor,
451
+ strokeWidth: trackHeight,
452
+ strokeLinecap: "round",
453
+ style: { originX: "50%", originY: "50%" },
454
+ animate: {
455
+ pathLength: [
456
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
457
+ Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
458
+ Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
459
+ ],
460
+ rotate: [
461
+ `${(0.1 + gapForTrack) * 360}deg`,
462
+ `${(1 + gapForTrack) * 360}deg`,
463
+ `${(1.1 + gapForTrack) * 360}deg`
464
+ ]
465
+ },
466
+ transition: {
467
+ duration: 2 / Math.max(0.1, crawlerSpeed),
468
+ repeat: Number.POSITIVE_INFINITY,
469
+ ease: [0.4, 0, 0.2, 1]
470
+ }
471
+ }
472
+ ),
473
+ isWavy ? /* @__PURE__ */ jsx(
474
+ ActivePathElem,
475
+ {
476
+ d: wavyActivePath != null ? wavyActivePath : "",
477
+ fill: "none",
478
+ stroke: activeColor,
479
+ strokeWidth: trackHeight,
480
+ strokeLinecap: "round",
481
+ style: { originX: "50%", originY: "50%" },
482
+ animate: {
483
+ pathLength: [0.1, 0.75, 0.1],
484
+ rotate: ["0deg", "90deg", "360deg"]
485
+ },
486
+ transition: {
487
+ duration: 2 / Math.max(0.1, crawlerSpeed),
488
+ repeat: Number.POSITIVE_INFINITY,
489
+ ease: [0.4, 0, 0.2, 1]
490
+ }
491
+ }
492
+ ) : /* @__PURE__ */ jsx(
493
+ ActiveCircleElem,
494
+ {
495
+ cx: center,
496
+ cy: center,
497
+ r: radius,
498
+ fill: "none",
499
+ stroke: activeColor,
500
+ strokeWidth: trackHeight,
501
+ strokeLinecap: "round",
502
+ style: { originX: "50%", originY: "50%" },
503
+ animate: {
504
+ pathLength: [0.1, 0.75, 0.1],
505
+ rotate: ["0deg", "90deg", "360deg"]
506
+ },
507
+ transition: {
508
+ duration: 2 / Math.max(0.1, crawlerSpeed),
509
+ repeat: Number.POSITIVE_INFINITY,
510
+ ease: [0.4, 0, 0.2, 1]
511
+ }
512
+ }
513
+ )
514
+ ]
515
+ }
516
+ )
517
+ ] })
518
+ })
519
+ );
520
+ }
521
+ );
522
+ CircularProgress.displayName = "CircularProgress";
523
+ function useContainerWidth() {
524
+ const [width, setWidth] = React11.useState(0);
525
+ const observerRef = React11.useRef(null);
526
+ const ref = React11.useCallback((node) => {
527
+ if (observerRef.current) {
528
+ observerRef.current.disconnect();
529
+ observerRef.current = null;
530
+ }
531
+ if (node) {
532
+ const obs = new ResizeObserver((entries) => {
533
+ const contentRect = entries[0].contentRect;
534
+ setWidth(contentRect.width);
535
+ });
536
+ obs.observe(node);
537
+ observerRef.current = obs;
538
+ }
539
+ }, []);
540
+ React11.useEffect(() => {
541
+ return () => {
542
+ if (observerRef.current) {
543
+ observerRef.current.disconnect();
544
+ }
545
+ };
546
+ }, []);
547
+ return [ref, width];
548
+ }
549
+ function useMergedRef(...refs) {
550
+ return React11.useCallback(
551
+ (node) => {
552
+ for (const ref of refs) {
553
+ if (typeof ref === "function") {
554
+ ref(node);
555
+ } else if (ref && typeof ref === "object") {
556
+ ref.current = node;
557
+ }
558
+ }
559
+ },
560
+ // eslint-disable-next-line react-hooks/exhaustive-deps
561
+ [refs]
562
+ );
563
+ }
564
+ var FlatLinearTrack = React11.memo(function FlatLinearTrack2({
565
+ trackHeight,
566
+ activeColor,
567
+ trackColor,
568
+ value,
569
+ isRtl,
570
+ gapSize,
571
+ crawlerSpeed
572
+ }) {
573
+ const isDeterminate = value !== void 0;
574
+ const radius = trackHeight / 2;
575
+ const minActiveWidth = trackHeight;
576
+ return /* @__PURE__ */ jsx(
577
+ "div",
578
+ {
579
+ className: "relative w-full overflow-hidden",
580
+ style: { height: trackHeight, borderRadius: radius },
581
+ children: isDeterminate ? /* @__PURE__ */ jsxs(Fragment, { children: [
582
+ /* @__PURE__ */ jsx(
583
+ m.div,
584
+ {
585
+ className: "absolute inset-y-0",
586
+ style: {
587
+ backgroundColor: trackColor,
588
+ borderRadius: radius,
589
+ width: "100%"
590
+ },
591
+ initial: {
592
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, 0%) + ${gapSize}px)`
593
+ },
594
+ animate: {
595
+ [isRtl ? "right" : "left"]: `calc(max(${minActiveWidth}px, ${value}%) + ${gapSize}px)`
596
+ },
597
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
598
+ }
599
+ ),
600
+ /* @__PURE__ */ jsx(
601
+ m.div,
602
+ {
603
+ className: "absolute inset-y-0",
604
+ style: __spreadValues({
605
+ backgroundColor: activeColor,
606
+ borderRadius: radius,
607
+ minWidth: minActiveWidth
608
+ }, isRtl ? { right: 0 } : { left: 0 }),
609
+ initial: { width: `${minActiveWidth}px` },
610
+ animate: { width: `${value}%` },
611
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] }
612
+ }
613
+ )
614
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
615
+ /* @__PURE__ */ jsx(
616
+ "div",
617
+ {
618
+ className: "absolute inset-0",
619
+ style: { backgroundColor: trackColor, borderRadius: radius }
620
+ }
621
+ ),
622
+ /* @__PURE__ */ jsx(
623
+ m.div,
624
+ {
625
+ className: "absolute inset-y-0",
626
+ style: { backgroundColor: activeColor, borderRadius: radius },
627
+ initial: { left: "-40%", width: "40%" },
628
+ animate: { left: ["-40%", "100%"], width: ["40%", "20%", "40%"] },
629
+ transition: {
630
+ duration: 2 / Math.max(0.1, crawlerSpeed),
631
+ repeat: Number.POSITIVE_INFINITY,
632
+ ease: "easeInOut"
633
+ }
634
+ }
635
+ )
636
+ ] })
637
+ }
638
+ );
639
+ });
640
+ var WavyLinearTrack = React11.memo(function WavyLinearTrack2({
641
+ trackHeight,
642
+ svgHeight,
643
+ amplitude,
644
+ wavelength,
645
+ indeterminateWavelength,
646
+ activeColor,
647
+ trackColor,
648
+ value,
649
+ isRtl,
650
+ gapSize,
651
+ waveSpeed,
652
+ crawlerSpeed,
653
+ determinateAnimation,
654
+ indeterminateAnimation,
655
+ trackShape
656
+ }) {
657
+ const isDeterminate = typeof value === "number";
658
+ const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
659
+ const titleId = React11.useId();
660
+ const [containerRef, width] = useContainerWidth();
661
+ const activePathRef = React11.useRef(null);
662
+ const trackPathRef = React11.useRef(null);
663
+ const amplitudeMV = useMotionValue(amplitude);
664
+ const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
665
+ React11.useEffect(() => {
666
+ if (isDeterminate) {
667
+ const fraction = clampedValue / 100;
668
+ let targetAmp = amplitude;
669
+ if (determinateAnimation === "md3") {
670
+ targetAmp = fraction <= 0.1 || fraction >= 0.95 ? 0 : amplitude;
671
+ }
672
+ animate(amplitudeMV, targetAmp, {
673
+ type: "spring",
674
+ bounce: 0,
675
+ duration: 0.5
676
+ });
677
+ animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
678
+ }
679
+ }, [
680
+ clampedValue,
681
+ isDeterminate,
682
+ amplitude,
683
+ amplitudeMV,
684
+ fractionMV,
685
+ determinateAnimation
686
+ ]);
687
+ const activeWavelength = Math.max(
688
+ 1,
689
+ isDeterminate ? wavelength : indeterminateWavelength
690
+ );
691
+ const trackAmp = trackShape === "wavy" ? amplitude : 0;
692
+ useAnimationFrame((time) => {
693
+ if (width === 0) return;
694
+ const currentAmp = amplitudeMV.get();
695
+ const phase = time / 1e3 * waveSpeed * activeWavelength;
696
+ const capWidth = trackHeight / 2;
697
+ let activePathD = "";
698
+ let trackD = "";
699
+ const totalGap = gapSize + trackHeight;
700
+ if (isDeterminate) {
701
+ const fraction = fractionMV.get();
702
+ const barHead = fraction * width;
703
+ const adjHead = Math.max(capWidth, Math.min(width - capWidth, barHead));
704
+ const adjTail = capWidth;
705
+ if (fraction > 0 && adjHead - adjTail > 0.1) {
706
+ activePathD = getSinePath(
707
+ adjTail,
708
+ adjHead,
709
+ phase,
710
+ activeWavelength,
711
+ currentAmp
712
+ );
713
+ } else if (fraction === 0) {
714
+ activePathD = `M ${capWidth} 0 L ${capWidth + 0.01} 0`;
715
+ }
716
+ const trackStart = adjHead + totalGap;
717
+ if (trackStart < width - capWidth) {
718
+ trackD = getSinePath(
719
+ trackStart,
720
+ width - capWidth,
721
+ phase,
722
+ activeWavelength,
723
+ trackAmp
724
+ );
725
+ }
726
+ } else {
727
+ const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
728
+ const activeLines = [];
729
+ if (indeterminateAnimation === "continuous") {
730
+ const cycle = 2e3 / safeCrawlerSpeed;
731
+ const fraction = time % cycle / cycle;
732
+ activeLines.push({
733
+ tail: easeInOutCubic(Math.max(0, fraction * 1.5 - 0.5)),
734
+ head: easeInOutCubic(Math.min(1, fraction * 1.5))
735
+ });
736
+ } else {
737
+ const cycle = 1750 / safeCrawlerSpeed;
738
+ const t = time % cycle * safeCrawlerSpeed;
739
+ const l1H = easeInOutCubic(Math.max(0, Math.min(1, t / 1e3)));
740
+ const l1T = easeInOutCubic(Math.max(0, Math.min(1, (t - 250) / 1e3)));
741
+ const l2H = easeInOutCubic(Math.max(0, Math.min(1, (t - 650) / 850)));
742
+ const l2T = easeInOutCubic(Math.max(0, Math.min(1, (t - 900) / 850)));
743
+ activeLines.push({ tail: l1T, head: l1H });
744
+ activeLines.push({ tail: l2T, head: l2H });
745
+ }
746
+ const segments = activeLines.map((line) => {
747
+ const barTail = line.tail * width;
748
+ const barHead = line.head * width;
749
+ const adjTail = Math.max(
750
+ capWidth,
751
+ Math.min(width - capWidth, barTail)
752
+ );
753
+ const adjHead = Math.max(
754
+ capWidth,
755
+ Math.min(width - capWidth, barHead)
756
+ );
757
+ return { adjTail, adjHead };
758
+ }).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
759
+ activePathD = segments.map(
760
+ (seg) => getSinePath(
761
+ seg.adjTail,
762
+ seg.adjHead,
763
+ phase,
764
+ activeWavelength,
765
+ currentAmp
766
+ )
767
+ ).join(" ");
768
+ let currentTrackX = capWidth;
769
+ for (const seg of segments) {
770
+ const trackEnd = seg.adjTail - totalGap;
771
+ if (trackEnd > currentTrackX) {
772
+ trackD += `${getSinePath(currentTrackX, trackEnd, phase, activeWavelength, trackAmp)} `;
773
+ }
774
+ currentTrackX = Math.max(currentTrackX, seg.adjHead + totalGap);
775
+ }
776
+ if (currentTrackX < width - capWidth) {
777
+ trackD += getSinePath(
778
+ currentTrackX,
779
+ width - capWidth,
780
+ phase,
781
+ activeWavelength,
782
+ trackAmp
783
+ );
784
+ }
785
+ }
786
+ if (activePathRef.current)
787
+ activePathRef.current.setAttribute("d", activePathD);
788
+ if (trackPathRef.current)
789
+ trackPathRef.current.setAttribute("d", trackD.trim());
790
+ });
791
+ return /* @__PURE__ */ jsx(
792
+ "div",
793
+ {
794
+ ref: containerRef,
795
+ className: "relative w-full overflow-hidden",
796
+ style: { height: svgHeight },
797
+ children: width > 0 && /* @__PURE__ */ jsxs(
798
+ "svg",
799
+ {
800
+ className: "absolute inset-0 w-full h-full",
801
+ style: {
802
+ overflow: "visible",
803
+ transform: isRtl ? "scaleX(-1)" : void 0
804
+ },
805
+ "aria-labelledby": titleId,
806
+ children: [
807
+ /* @__PURE__ */ jsx("title", { id: titleId, children: isDeterminate ? `Progress: ${clampedValue}%` : "Indeterminate loading progress" }),
808
+ /* @__PURE__ */ jsxs("g", { transform: `translate(0, ${svgHeight / 2})`, children: [
809
+ /* @__PURE__ */ jsx(
810
+ "path",
811
+ {
812
+ ref: trackPathRef,
813
+ fill: "none",
814
+ stroke: trackColor,
815
+ strokeWidth: trackHeight,
816
+ strokeLinecap: "round"
817
+ }
818
+ ),
819
+ /* @__PURE__ */ jsx(
820
+ "path",
821
+ {
822
+ ref: activePathRef,
823
+ fill: "none",
824
+ stroke: activeColor,
825
+ strokeWidth: trackHeight,
826
+ strokeLinecap: "round"
827
+ }
828
+ )
829
+ ] })
830
+ ]
831
+ }
832
+ )
833
+ }
834
+ );
835
+ });
836
+ var LinearProgress = React11.forwardRef(
837
+ (_a, ref) => {
838
+ var _b = _a, {
839
+ value,
840
+ shape = "flat",
841
+ trackShape,
842
+ trackHeight = 4,
843
+ amplitude,
844
+ wavelength = 40,
845
+ indeterminateWavelength = 20,
846
+ waveSpeed = 1,
847
+ crawlerSpeed = 1,
848
+ determinateAnimation = "md3",
849
+ indeterminateAnimation = "continuous",
850
+ gapSize = 4,
851
+ showStopIndicator = "auto",
852
+ color,
853
+ trackColor,
854
+ className,
855
+ "aria-label": ariaLabel
856
+ } = _b, restProps = __objRest(_b, [
857
+ "value",
858
+ "shape",
859
+ "trackShape",
860
+ "trackHeight",
861
+ "amplitude",
862
+ "wavelength",
863
+ "indeterminateWavelength",
864
+ "waveSpeed",
865
+ "crawlerSpeed",
866
+ "determinateAnimation",
867
+ "indeterminateAnimation",
868
+ "gapSize",
869
+ "showStopIndicator",
870
+ "color",
871
+ "trackColor",
872
+ "className",
873
+ "aria-label"
874
+ ]);
875
+ const isDeterminate = value !== void 0;
876
+ const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
877
+ const containerRef = React11.useRef(null);
878
+ const mergedRef = useMergedRef(ref, containerRef);
879
+ const [isRtl, setIsRtl] = React11.useState(false);
880
+ React11.useEffect(() => {
881
+ if (containerRef.current) {
882
+ const dir = getComputedStyle(containerRef.current).direction;
883
+ setIsRtl(dir === "rtl");
884
+ }
885
+ }, []);
886
+ const isWavy = shape === "wavy";
887
+ const resolvedTrackShape = trackShape != null ? trackShape : shape;
888
+ const effectiveAmplitude = React11.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
889
+ const svgHeight = React11.useMemo(
890
+ () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
891
+ [isWavy, trackHeight, effectiveAmplitude]
892
+ );
893
+ const shouldShowStop = React11.useMemo(
894
+ () => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
895
+ [isDeterminate, resolvedTrackShape, showStopIndicator]
896
+ );
897
+ const stopSize = React11.useMemo(
898
+ () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
899
+ [trackHeight]
900
+ );
901
+ const stopOffset = (trackHeight - stopSize) / 2;
902
+ const activeColor = color || "var(--md-sys-color-indicator-active)";
903
+ const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
904
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
905
+ "div",
906
+ __spreadProps(__spreadValues({
907
+ ref: mergedRef,
908
+ role: "progressbar",
909
+ "aria-label": ariaLabel,
910
+ "aria-valuenow": isDeterminate ? clampedValue : void 0,
911
+ "aria-valuemin": 0,
912
+ "aria-valuemax": 100,
913
+ className: cn(
914
+ "relative flex w-full flex-col justify-center",
915
+ className
916
+ ),
917
+ style: { height: svgHeight }
918
+ }, restProps), {
919
+ children: [
920
+ isWavy ? /* @__PURE__ */ jsx(
921
+ WavyLinearTrack,
922
+ {
923
+ trackHeight,
924
+ svgHeight,
925
+ amplitude: effectiveAmplitude,
926
+ wavelength,
927
+ indeterminateWavelength,
928
+ activeColor,
929
+ trackColor: bgTrackColor,
930
+ value: isDeterminate ? clampedValue : void 0,
931
+ isRtl,
932
+ gapSize,
933
+ waveSpeed,
934
+ crawlerSpeed,
935
+ determinateAnimation,
936
+ indeterminateAnimation,
937
+ trackShape: resolvedTrackShape
938
+ }
939
+ ) : /* @__PURE__ */ jsx(
940
+ FlatLinearTrack,
941
+ {
942
+ trackHeight,
943
+ activeColor,
944
+ trackColor: bgTrackColor,
945
+ value: isDeterminate ? clampedValue : void 0,
946
+ isRtl,
947
+ gapSize,
948
+ crawlerSpeed
949
+ }
950
+ ),
951
+ shouldShowStop && /* @__PURE__ */ jsx(
952
+ "div",
953
+ {
954
+ "aria-hidden": "true",
955
+ className: "absolute rounded-full",
956
+ style: __spreadValues({
957
+ width: stopSize,
958
+ height: stopSize,
959
+ backgroundColor: "var(--md-sys-color-indicator-stop)",
960
+ top: svgHeight / 2 - stopSize / 2
961
+ }, isRtl ? { left: stopOffset } : { right: stopOffset })
962
+ }
963
+ )
964
+ ]
965
+ })
966
+ ) });
967
+ }
968
+ );
969
+ LinearProgress.displayName = "LinearProgress";
970
+ var ProgressIndicator = React11.forwardRef((props, ref) => {
971
+ if (props.variant === "circular") {
972
+ return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
973
+ }
974
+ return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
975
+ });
976
+ ProgressIndicator.displayName = "ProgressIndicator";
977
+ var RippleItem = React11.memo(function RippleItem2({
978
+ ripple,
979
+ onDone
980
+ }) {
981
+ return /* @__PURE__ */ jsx(
982
+ m.span,
983
+ {
984
+ "aria-hidden": "true",
985
+ style: {
986
+ position: "absolute",
987
+ left: ripple.x - ripple.size / 2,
988
+ top: ripple.y - ripple.size / 2,
989
+ width: ripple.size,
990
+ height: ripple.size,
991
+ borderRadius: "50%",
992
+ backgroundColor: "currentColor",
993
+ pointerEvents: "none",
994
+ transformOrigin: "center"
995
+ },
996
+ initial: { scale: 0, opacity: 0.12 },
997
+ animate: { scale: 1, opacity: 0 },
998
+ exit: { opacity: 0 },
999
+ transition: {
1000
+ scale: { duration: 0.5, ease: [0.2, 0, 0, 1] },
1001
+ opacity: { duration: 0.4, ease: "easeOut", delay: 0.1 }
1002
+ },
1003
+ onAnimationComplete: () => onDone(ripple.id)
1004
+ },
1005
+ ripple.id
1006
+ );
1007
+ });
1008
+ function Ripple({
1009
+ ripples,
1010
+ onRippleDone,
1011
+ disabled = false,
1012
+ respectSystemMotion = true
1013
+ }) {
1014
+ const prefersReduced = useReducedMotion();
1015
+ if (disabled) return null;
1016
+ if (respectSystemMotion && prefersReduced) return null;
1017
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: ripples.map((r) => /* @__PURE__ */ jsx(RippleItem, { ripple: r, onDone: onRippleDone }, r.id)) });
1018
+ }
1019
+ function useRippleState(options = {}) {
1020
+ const { disabled = false } = options;
1021
+ const [ripples, setRipples] = React11.useState([]);
1022
+ const onPointerDown = React11.useCallback(
1023
+ (e) => {
1024
+ if (disabled) return;
1025
+ const rect = e.currentTarget.getBoundingClientRect();
1026
+ const x = e.clientX - rect.left;
1027
+ const y = e.clientY - rect.top;
1028
+ const rippleSize = Math.hypot(rect.width, rect.height) * 2;
1029
+ setRipples((prev) => [
1030
+ ...prev,
1031
+ { id: Date.now(), x, y, size: rippleSize }
1032
+ ]);
1033
+ },
1034
+ [disabled]
1035
+ );
1036
+ const removeRipple = React11.useCallback((id) => {
1037
+ setRipples((prev) => prev.filter((r) => r.id !== id));
1038
+ }, []);
1039
+ return { ripples, onPointerDown, removeRipple };
1040
+ }
1041
+
1042
+ // src/ui/shared/motion-tokens.ts
1043
+ var FAST_SPATIAL_SPRING = {
1044
+ type: "spring",
1045
+ stiffness: 800,
1046
+ damping: 33.94
1047
+ };
1048
+ var FAST_EFFECTS_SPRING = {
1049
+ type: "spring",
1050
+ stiffness: 3800,
1051
+ damping: 123.29
1052
+ };
1053
+ var DEFAULT_EFFECTS_SPRING = {
1054
+ type: "spring",
1055
+ stiffness: 1600,
1056
+ damping: 80
1057
+ };
1058
+
1059
+ // src/ui/shared/constants.ts
1060
+ var SPRING_TRANSITION_FAST = FAST_EFFECTS_SPRING;
1061
+ var SPRING_TRANSITION = DEFAULT_EFFECTS_SPRING;
1062
+ var ICON_SPAN_VARIANTS = {
1063
+ initial: { scale: 0.01 },
1064
+ animate: { scale: 1 },
1065
+ exit: { scale: 0.01 }
1066
+ };
1067
+ function TouchTarget() {
1068
+ return /* @__PURE__ */ jsx(
1069
+ "span",
1070
+ {
1071
+ "aria-hidden": "true",
1072
+ 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"
1073
+ }
1074
+ );
1075
+ }
1076
+ var BUTTON_SHAPE_MORPH_SPRING = FAST_SPATIAL_SPRING;
1077
+ var BUTTON_RADIUS_SPRING = FAST_EFFECTS_SPRING;
1078
+ var BUTTON_SIZE_TOKENS = {
1079
+ xs: {
1080
+ height: "2rem",
1081
+ // 32dp
1082
+ leadingSpace: "1rem",
1083
+ // 16dp
1084
+ trailingSpace: "1rem",
1085
+ // 16dp
1086
+ iconSize: "1.25rem",
1087
+ // 20dp
1088
+ iconLabelSpace: "0.5rem",
1089
+ // 8dp
1090
+ outlineWidth: 1,
1091
+ // 1dp
1092
+ squareShapeRadius: cornerRadius.medium,
1093
+ // 12dp
1094
+ pressedShapeRadius: cornerRadius.small,
1095
+ // 8dp
1096
+ roundShapeRadius: 16
1097
+ },
1098
+ sm: {
1099
+ height: "2.5rem",
1100
+ // 40dp
1101
+ leadingSpace: "1rem",
1102
+ // 16dp
1103
+ trailingSpace: "1rem",
1104
+ // 16dp
1105
+ iconSize: "1.25rem",
1106
+ // 20dp
1107
+ iconLabelSpace: "0.5rem",
1108
+ // 8dp
1109
+ outlineWidth: 1,
1110
+ // 1dp
1111
+ squareShapeRadius: cornerRadius.medium,
1112
+ // 12dp
1113
+ pressedShapeRadius: cornerRadius.small,
1114
+ // 8dp
1115
+ roundShapeRadius: 20
1116
+ },
1117
+ md: {
1118
+ height: "3.5rem",
1119
+ // 56dp
1120
+ leadingSpace: "1.5rem",
1121
+ // 24dp
1122
+ trailingSpace: "1.5rem",
1123
+ // 24dp
1124
+ iconSize: "1.5rem",
1125
+ // 24dp
1126
+ iconLabelSpace: "0.5rem",
1127
+ // 8dp
1128
+ outlineWidth: 1,
1129
+ // 1dp
1130
+ squareShapeRadius: cornerRadius.large,
1131
+ // 16dp
1132
+ pressedShapeRadius: cornerRadius.medium,
1133
+ // 12dp
1134
+ roundShapeRadius: 28
1135
+ },
1136
+ lg: {
1137
+ height: "6rem",
1138
+ // 96dp
1139
+ leadingSpace: "3rem",
1140
+ // 48dp
1141
+ trailingSpace: "3rem",
1142
+ // 48dp
1143
+ iconSize: "2rem",
1144
+ // 32dp
1145
+ iconLabelSpace: "0.75rem",
1146
+ // 12dp
1147
+ outlineWidth: 2,
1148
+ // 2dp
1149
+ squareShapeRadius: cornerRadius.extraLarge,
1150
+ // 28dp
1151
+ pressedShapeRadius: cornerRadius.large,
1152
+ // 16dp
1153
+ roundShapeRadius: 48
1154
+ },
1155
+ xl: {
1156
+ height: "8.5rem",
1157
+ // 136dp
1158
+ leadingSpace: "4rem",
1159
+ // 64dp
1160
+ trailingSpace: "4rem",
1161
+ // 64dp
1162
+ iconSize: "2.5rem",
1163
+ // 40dp
1164
+ iconLabelSpace: "1rem",
1165
+ // 16dp
1166
+ outlineWidth: 3,
1167
+ // 3dp
1168
+ squareShapeRadius: cornerRadius.extraLarge,
1169
+ // 28dp
1170
+ pressedShapeRadius: cornerRadius.large,
1171
+ // 16dp
1172
+ roundShapeRadius: 68
1173
+ }
1174
+ };
1175
+ var BUTTON_TYPOGRAPHY_TOKENS = {
1176
+ xs: "text-sm font-medium tracking-wide",
1177
+ // labelLarge
1178
+ sm: "text-sm font-medium tracking-wide",
1179
+ // labelLarge
1180
+ md: "text-base font-medium",
1181
+ // titleMedium
1182
+ lg: "text-xl font-normal",
1183
+ // headlineSmall
1184
+ xl: "text-[2rem] font-normal leading-none"
1185
+ // headlineLarge
1186
+ };
1187
+ var BUTTON_COLOR_TOKENS = {
1188
+ elevated: {
1189
+ default: "bg-m3-surface-container-low text-m3-primary shadow-md",
1190
+ selected: "bg-m3-primary text-m3-on-primary shadow-md",
1191
+ unselected: "bg-m3-surface-container-low text-m3-primary shadow-md"
1192
+ },
1193
+ filled: {
1194
+ default: "bg-m3-primary text-m3-on-primary",
1195
+ selected: "bg-m3-primary text-m3-on-primary",
1196
+ unselected: "bg-m3-surface-container text-m3-on-surface-variant"
1197
+ },
1198
+ tonal: {
1199
+ default: "bg-m3-secondary-container text-m3-on-secondary-container",
1200
+ selected: "bg-m3-secondary text-m3-on-secondary",
1201
+ unselected: "bg-m3-secondary-container text-m3-on-secondary-container"
1202
+ },
1203
+ outlined: {
1204
+ default: "bg-transparent text-m3-on-surface-variant border-m3-outline-variant",
1205
+ selected: "bg-m3-inverse-surface text-m3-inverse-on-surface border-transparent",
1206
+ unselected: "bg-transparent text-m3-on-surface-variant border-m3-outline-variant"
1207
+ },
1208
+ text: {
1209
+ default: "bg-transparent text-m3-primary",
1210
+ selected: "bg-transparent text-m3-primary",
1211
+ unselected: "bg-transparent text-m3-primary"
1212
+ }
1213
+ };
1214
+ var MOTION_PROP_KEYS = [
1215
+ "animate",
1216
+ "exit",
1217
+ "initial",
1218
+ "transition",
1219
+ "variants",
1220
+ "whileHover",
1221
+ "whileTap",
1222
+ "whileFocus",
1223
+ "whileDrag",
1224
+ "whileInView",
1225
+ "onAnimationStart",
1226
+ "onAnimationComplete",
1227
+ "onUpdate",
1228
+ "onDragStart",
1229
+ "onDragEnd",
1230
+ "onDrag",
1231
+ "onDirectionLock",
1232
+ "onDragTransitionEnd",
1233
+ "layout",
1234
+ "layoutId",
1235
+ "onLayoutAnimationComplete"
1236
+ ];
1237
+ function springAnimate(value, to) {
1238
+ return animate(value, to, __spreadProps(__spreadValues({}, BUTTON_RADIUS_SPRING), { type: "spring" }));
1239
+ }
1240
+ function AnimatedIconSlot({
1241
+ iconSize,
1242
+ children,
1243
+ ariaHidden,
1244
+ transition
1245
+ }) {
1246
+ return /* @__PURE__ */ jsx(
1247
+ m.span,
1248
+ {
1249
+ layout: "position",
1250
+ initial: { width: 0, opacity: 0, scale: 0.5 },
1251
+ animate: { width: iconSize, opacity: 1, scale: 1 },
1252
+ exit: { width: 0, opacity: 0, scale: 0.5 },
1253
+ transition,
1254
+ "aria-hidden": ariaHidden ? "true" : void 0,
1255
+ style: { height: iconSize },
1256
+ className: cn(
1257
+ "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden"
1258
+ ),
1259
+ children
1260
+ }
1261
+ );
1262
+ }
1263
+ var ButtonComponent = React11.forwardRef(
1264
+ (_a, ref) => {
1265
+ var _b = _a, {
1266
+ className,
1267
+ style,
1268
+ variant = "default",
1269
+ colorStyle = "filled",
1270
+ selectedColorStyle: _selectedColorStyle,
1271
+ size: size = "sm",
1272
+ shape = "round",
1273
+ selected,
1274
+ icon,
1275
+ iconPosition = "leading",
1276
+ loading = false,
1277
+ loadingVariant = "loading-indicator",
1278
+ asChild = false,
1279
+ outlineWidth,
1280
+ children,
1281
+ onClick,
1282
+ onKeyDown,
1283
+ "aria-label": ariaLabelProp,
1284
+ transition: customTransition
1285
+ } = _b, restProps = __objRest(_b, [
1286
+ "className",
1287
+ "style",
1288
+ "variant",
1289
+ "colorStyle",
1290
+ "selectedColorStyle",
1291
+ // Deprecated — destructured to strip from restProps
1292
+ "size",
1293
+ "shape",
1294
+ "selected",
1295
+ "icon",
1296
+ "iconPosition",
1297
+ "loading",
1298
+ "loadingVariant",
1299
+ "asChild",
1300
+ "outlineWidth",
1301
+ "children",
1302
+ "onClick",
1303
+ "onKeyDown",
1304
+ "aria-label",
1305
+ "transition"
1306
+ ]);
1307
+ var _a2, _b2;
1308
+ const isToggle = variant === "toggle";
1309
+ const isSelected = isToggle ? !!selected : false;
1310
+ const effectiveShape = isSelected ? shape === "round" ? "square" : "round" : shape;
1311
+ const sizeTokens = (_a2 = BUTTON_SIZE_TOKENS[size]) != null ? _a2 : BUTTON_SIZE_TOKENS.sm;
1312
+ const animateRadius = effectiveShape === "round" ? sizeTokens.roundShapeRadius : sizeTokens.squareShapeRadius;
1313
+ const pressedRadius = sizeTokens.pressedShapeRadius;
1314
+ const colorState = isToggle ? isSelected ? "selected" : "unselected" : "default";
1315
+ const colorClass = BUTTON_COLOR_TOKENS[colorStyle][colorState];
1316
+ const typographyClass = (_b2 = BUTTON_TYPOGRAPHY_TOKENS[size]) != null ? _b2 : BUTTON_TYPOGRAPHY_TOKENS.sm;
1317
+ const mergedStyle = __spreadValues({
1318
+ height: sizeTokens.height,
1319
+ paddingInlineStart: sizeTokens.leadingSpace,
1320
+ paddingInlineEnd: sizeTokens.trailingSpace,
1321
+ gap: sizeTokens.iconLabelSpace,
1322
+ borderWidth: outlineWidth != null ? outlineWidth : colorStyle === "outlined" ? sizeTokens.outlineWidth : 0,
1323
+ borderStyle: colorStyle === "outlined" ? "solid" : void 0
1324
+ }, style);
1325
+ const labelText = React11.useMemo(() => {
1326
+ if (asChild) {
1327
+ const child = React11.Children.only(children);
1328
+ return child.props.children;
1329
+ }
1330
+ return children;
1331
+ }, [children, asChild]);
1332
+ const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
1333
+ const needsTouchTarget = size === "xs" || size === "sm";
1334
+ const motionRadius = useMotionValue(animateRadius);
1335
+ const asChildRef = React11.useRef(null);
1336
+ const mergedRef = React11.useCallback(
1337
+ (node) => {
1338
+ asChildRef.current = node;
1339
+ if (typeof ref === "function") ref(node);
1340
+ else if (ref)
1341
+ ref.current = node;
1342
+ },
1343
+ [ref]
1344
+ );
1345
+ React11.useEffect(() => {
1346
+ if (!asChild) return;
1347
+ return motionRadius.on("change", (v) => {
1348
+ if (asChildRef.current)
1349
+ asChildRef.current.style.borderRadius = `${v}px`;
1350
+ });
1351
+ }, [motionRadius, asChild]);
1352
+ React11.useEffect(() => {
1353
+ if (!asChild) return;
1354
+ const controls = springAnimate(motionRadius, animateRadius);
1355
+ return () => controls.stop();
1356
+ }, [animateRadius, motionRadius, asChild]);
1357
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
1358
+ disabled: loading
1359
+ });
1360
+ const handleClick = React11.useCallback(
1361
+ (e) => {
1362
+ if (loading) return e.preventDefault();
1363
+ onClick == null ? void 0 : onClick(e);
1364
+ },
1365
+ [loading, onClick]
1366
+ );
1367
+ const handleKeyDown = React11.useCallback(
1368
+ (e) => {
1369
+ if (loading) return;
1370
+ if (onClick && (e.key === "Enter" || e.key === " ")) {
1371
+ e.preventDefault();
1372
+ e.currentTarget.click();
1373
+ }
1374
+ onKeyDown == null ? void 0 : onKeyDown(e);
1375
+ },
1376
+ [loading, onClick, onKeyDown]
1377
+ );
1378
+ const buttonClassName = cn(
1379
+ "relative w-fit shrink-0 inline-flex flex-row items-center justify-center",
1380
+ "whitespace-nowrap select-none cursor-pointer",
1381
+ "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
1382
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
1383
+ "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
1384
+ colorClass,
1385
+ "overflow-hidden",
1386
+ typographyClass,
1387
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
1388
+ className
1389
+ );
1390
+ const sharedTransition = customTransition != null ? customTransition : {
1391
+ borderRadius: BUTTON_RADIUS_SPRING,
1392
+ layout: BUTTON_SHAPE_MORPH_SPRING,
1393
+ default: SPRING_TRANSITION
1394
+ };
1395
+ const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
1396
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
1397
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1398
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "popLayout", children: (loading || icon && iconPosition === "leading") && /* @__PURE__ */ jsx(
1399
+ AnimatedIconSlot,
1400
+ {
1401
+ iconSize: sizeTokens.iconSize,
1402
+ ariaHidden: !loading,
1403
+ transition: sharedTransition,
1404
+ children: loading ? loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
1405
+ LoadingIndicator,
1406
+ {
1407
+ size: parseFloat(sizeTokens.iconSize) * 16,
1408
+ color: "currentColor",
1409
+ "aria-label": "Loading"
1410
+ }
1411
+ ) : /* @__PURE__ */ jsx(
1412
+ ProgressIndicator,
1413
+ {
1414
+ variant: "circular",
1415
+ size: parseFloat(sizeTokens.iconSize) * 16,
1416
+ color: "currentColor",
1417
+ trackColor: "transparent",
1418
+ "aria-label": "Loading"
1419
+ }
1420
+ ) : icon
1421
+ }
1422
+ ) }),
1423
+ labelText && /* @__PURE__ */ jsx(
1424
+ m.span,
1425
+ {
1426
+ layout: "position",
1427
+ className: "inline-flex items-center h-full gap-[inherit]",
1428
+ transition: sharedTransition,
1429
+ children: labelText
1430
+ }
1431
+ ),
1432
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "popLayout", children: icon && iconPosition === "trailing" && /* @__PURE__ */ jsx(
1433
+ AnimatedIconSlot,
1434
+ {
1435
+ iconSize: sizeTokens.iconSize,
1436
+ ariaHidden: true,
1437
+ transition: sharedTransition,
1438
+ children: icon
1439
+ }
1440
+ ) })
1441
+ ] });
1442
+ const handleAsChildPointerDown = React11.useCallback(
1443
+ (e) => {
1444
+ springAnimate(motionRadius, pressedRadius);
1445
+ onPointerDown == null ? void 0 : onPointerDown(e);
1446
+ },
1447
+ [motionRadius, pressedRadius, onPointerDown]
1448
+ );
1449
+ const handleAsChildPointerUp = React11.useCallback(() => {
1450
+ springAnimate(motionRadius, animateRadius);
1451
+ }, [motionRadius, animateRadius]);
1452
+ const handlePointerDown = React11.useCallback(
1453
+ (e) => {
1454
+ onPointerDown(e);
1455
+ },
1456
+ [onPointerDown]
1457
+ );
1458
+ if (asChild) {
1459
+ const strippedProps = __spreadValues({}, restProps);
1460
+ for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
1461
+ const htmlProps = strippedProps;
1462
+ const child = React11.Children.only(children);
1463
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1464
+ Slot,
1465
+ __spreadProps(__spreadValues({
1466
+ ref: mergedRef,
1467
+ "aria-label": computedAriaLabel,
1468
+ onClick: handleClick,
1469
+ onPointerDown: handleAsChildPointerDown,
1470
+ onPointerUp: handleAsChildPointerUp,
1471
+ onPointerLeave: handleAsChildPointerUp,
1472
+ onPointerCancel: handleAsChildPointerUp,
1473
+ onKeyDown: handleKeyDown,
1474
+ style: __spreadProps(__spreadValues({}, mergedStyle), {
1475
+ borderRadius: `${animateRadius}px`
1476
+ }),
1477
+ className: buttonClassName
1478
+ }, htmlProps), {
1479
+ children: React11.cloneElement(child, { children: innerContent })
1480
+ })
1481
+ ) });
1482
+ }
1483
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1484
+ m.button,
1485
+ __spreadProps(__spreadValues({
1486
+ ref,
1487
+ layout: true,
1488
+ type: "button",
1489
+ "aria-pressed": isToggle ? isSelected : void 0,
1490
+ "aria-label": computedAriaLabel,
1491
+ "aria-busy": loading ? true : void 0,
1492
+ "aria-disabled": loading ? true : restProps.disabled,
1493
+ onClick: handleClick,
1494
+ onPointerDown: handlePointerDown,
1495
+ onKeyDown: handleKeyDown,
1496
+ style: mergedStyle,
1497
+ animate: { borderRadius: animateRadius },
1498
+ whileTap: { borderRadius: pressedRadius },
1499
+ transition: sharedTransition,
1500
+ className: buttonClassName
1501
+ }, restProps), {
1502
+ children: innerContent
1503
+ })
1504
+ ) });
1505
+ }
1506
+ );
1507
+ ButtonComponent.displayName = "Button";
1508
+ var Button = React11.memo(ButtonComponent);
1509
+ var VARIANT_FONT = {
1510
+ outlined: "'Material Symbols Outlined'",
1511
+ rounded: "'Material Symbols Rounded'",
1512
+ sharp: "'Material Symbols Sharp'"
1513
+ };
1514
+ var IconComponent = React11.forwardRef(
1515
+ (_a, ref) => {
1516
+ var _b = _a, {
1517
+ name,
1518
+ variant = "outlined",
1519
+ fill = 0,
1520
+ weight = 400,
1521
+ grade = 0,
1522
+ opticalSize = 24,
1523
+ size,
1524
+ animateFill = false,
1525
+ className,
1526
+ style
1527
+ } = _b, restProps = __objRest(_b, [
1528
+ "name",
1529
+ "variant",
1530
+ "fill",
1531
+ "weight",
1532
+ "grade",
1533
+ "opticalSize",
1534
+ "size",
1535
+ "animateFill",
1536
+ "className",
1537
+ "style"
1538
+ ]);
1539
+ const fontVariationSettings = `'FILL' ${fill}, 'wght' ${weight}, 'GRAD' ${grade}, 'opsz' ${opticalSize}`;
1540
+ const computedStyle = __spreadValues({
1541
+ fontFamily: VARIANT_FONT[variant],
1542
+ fontSize: size === "inherit" ? "inherit" : size != null ? `${size}px` : `${opticalSize}px`,
1543
+ fontVariationSettings
1544
+ }, style);
1545
+ if (animateFill) {
1546
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1547
+ m.span,
1548
+ __spreadProps(__spreadValues({
1549
+ ref,
1550
+ className: cn(
1551
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
1552
+ className
1553
+ ),
1554
+ "aria-hidden": "true",
1555
+ animate: { fontVariationSettings },
1556
+ transition: SPRING_TRANSITION_FAST,
1557
+ style: computedStyle
1558
+ }, restProps), {
1559
+ children: name
1560
+ })
1561
+ ) });
1562
+ }
1563
+ return /* @__PURE__ */ jsx(
1564
+ "span",
1565
+ __spreadProps(__spreadValues({
1566
+ ref,
1567
+ className: cn(
1568
+ "md-icon inline-flex items-center justify-center shrink-0 select-none",
1569
+ className
1570
+ ),
1571
+ "aria-hidden": "true",
1572
+ style: computedStyle
1573
+ }, restProps), {
1574
+ children: name
1575
+ })
1576
+ );
1577
+ }
1578
+ );
1579
+ IconComponent.displayName = "Icon";
1580
+ var Icon = React11.memo(IconComponent);
1581
+ var BUTTON_GROUP_TOKENS = {
1582
+ standard: {
1583
+ betweenSpace: 12,
1584
+ // 12dp / 0.75rem / gap-3
1585
+ containerHeight: 40
1586
+ // 40dp / 2.5rem
1587
+ },
1588
+ connected: {
1589
+ betweenSpace: 2,
1590
+ // 2dp / 0.125rem / gap-0.5
1591
+ containerHeight: 40,
1592
+ // 40dp / 2.5rem
1593
+ containerShape: cornerRadius.full,
1594
+ // 9999px
1595
+ innerCorner: cornerRadius.small,
1596
+ // 8dp
1597
+ pressedInnerCorner: cornerRadius.extraSmall,
1598
+ // 4dp
1599
+ selectedCornerPercent: 50
1600
+ // 50% -> full pill
1601
+ }
1602
+ };
1603
+
1604
+ // src/ui/buttons/button-group/button-group-defaults.ts
1605
+ var PILL_RADIUS_MAP = {
1606
+ xs: 16,
1607
+ sm: 20,
1608
+ md: 28,
1609
+ lg: 48,
1610
+ xl: 68
1611
+ };
1612
+ var PRESSED_RADIUS_MAP = {
1613
+ xs: 8,
1614
+ sm: 10,
1615
+ md: 16,
1616
+ lg: 28,
1617
+ xl: 40
1618
+ };
1619
+ var PILL_CORNERS = {
1620
+ tl: 9999,
1621
+ tr: 9999,
1622
+ br: 9999,
1623
+ bl: 9999
1624
+ };
1625
+ function buildConnectedShapes(size, defaultCorners, pressedCorners) {
1626
+ const outer = PILL_RADIUS_MAP[size];
1627
+ const inner = BUTTON_GROUP_TOKENS.connected.innerCorner;
1628
+ const pressedInner = BUTTON_GROUP_TOKENS.connected.pressedInnerCorner;
1629
+ return {
1630
+ default: defaultCorners(outer, inner),
1631
+ pressed: pressedCorners(outer, pressedInner),
1632
+ checked: __spreadValues({}, PILL_CORNERS)
1633
+ };
1634
+ }
1635
+ var ButtonGroupDefaults = {
1636
+ expandedRatio: 0.15,
1637
+ connectedLeadingButtonShapes: (size) => buildConnectedShapes(
1638
+ size,
1639
+ (o, i) => ({ tl: o, tr: i, br: i, bl: o }),
1640
+ (o, pi) => ({ tl: o, tr: pi, br: pi, bl: o })
1641
+ ),
1642
+ connectedMiddleButtonShapes: (size) => buildConnectedShapes(
1643
+ size,
1644
+ (_o, i) => ({ tl: i, tr: i, br: i, bl: i }),
1645
+ (_o, pi) => ({ tl: pi, tr: pi, br: pi, bl: pi })
1646
+ ),
1647
+ connectedTrailingButtonShapes: (size) => buildConnectedShapes(
1648
+ size,
1649
+ (o, i) => ({ tl: i, tr: o, br: o, bl: i }),
1650
+ (o, pi) => ({ tl: pi, tr: o, br: o, bl: pi })
1651
+ ),
1652
+ /** For orientation="vertical". */
1653
+ connectedTopButtonShapes: (size) => buildConnectedShapes(
1654
+ size,
1655
+ (o, i) => ({ tl: o, tr: o, br: i, bl: i }),
1656
+ (o, pi) => ({ tl: o, tr: o, br: pi, bl: pi })
1657
+ ),
1658
+ connectedBottomButtonShapes: (size) => buildConnectedShapes(
1659
+ size,
1660
+ (o, i) => ({ tl: i, tr: i, br: o, bl: o }),
1661
+ (o, pi) => ({ tl: pi, tr: pi, br: o, bl: o })
1662
+ )
1663
+ };
1664
+ var PILL_BORDER_RADIUS = 9999;
1665
+ var MIN_FLEX_GROW = 0.01;
1666
+ var PADDING_EXPAND_MULTIPLIER = 4;
1667
+ var CHECK_ICON_SIZE = 24;
1668
+ var CHECK_ICON = /* @__PURE__ */ jsx(Icon, { name: "check", size: CHECK_ICON_SIZE, weight: 700 });
1669
+ var CHECK_ICON_GAP_MAP = {
1670
+ xs: 6,
1671
+ sm: 8,
1672
+ md: 8,
1673
+ lg: 12,
1674
+ xl: 12
1675
+ };
1676
+ var CHECK_ICON_MOTION = {
1677
+ type: "spring",
1678
+ stiffness: 420,
1679
+ damping: 34,
1680
+ mass: 0.75
1681
+ };
1682
+ var WIDTH_MORPH_SPRING = {
1683
+ type: "spring",
1684
+ stiffness: 360,
1685
+ damping: 38,
1686
+ mass: 0.85
1687
+ };
1688
+ var NAVBAR_EXPRESSIVE_SPRING = {
1689
+ type: "spring",
1690
+ stiffness: 430,
1691
+ damping: 38,
1692
+ mass: 0.8
1693
+ };
1694
+ var AnimatedCheckLabel = React11.memo(function AnimatedCheckLabel2({
1695
+ selected,
1696
+ size,
1697
+ children
1698
+ }) {
1699
+ var _a;
1700
+ const gap = (_a = CHECK_ICON_GAP_MAP[size]) != null ? _a : CHECK_ICON_GAP_MAP.sm;
1701
+ return /* @__PURE__ */ jsxs(
1702
+ m.span,
1703
+ {
1704
+ layout: true,
1705
+ className: "inline-flex min-w-0 items-center justify-center whitespace-nowrap align-middle",
1706
+ children: [
1707
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: selected && /* @__PURE__ */ jsx(
1708
+ m.span,
1709
+ {
1710
+ "aria-hidden": "true",
1711
+ initial: { width: 0, opacity: 0, marginRight: 0, x: -4 },
1712
+ animate: {
1713
+ width: CHECK_ICON_SIZE,
1714
+ opacity: 1,
1715
+ marginRight: gap,
1716
+ x: 0
1717
+ },
1718
+ exit: { width: 0, opacity: 0, marginRight: 0, x: -4 },
1719
+ transition: CHECK_ICON_MOTION,
1720
+ className: "inline-flex shrink-0 items-center justify-center overflow-hidden",
1721
+ style: { willChange: "width, opacity, transform, margin-right" },
1722
+ children: /* @__PURE__ */ jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center", children: CHECK_ICON })
1723
+ },
1724
+ "selected-check"
1725
+ ) }),
1726
+ /* @__PURE__ */ jsx(m.span, { layout: "position", className: "min-w-0 truncate", children })
1727
+ ]
1728
+ }
1729
+ );
1730
+ });
1731
+ var AnimatedNavbarLabel = React11.memo(function AnimatedNavbarLabel2({
1732
+ show,
1733
+ children
1734
+ }) {
1735
+ return /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "popLayout", children: show && /* @__PURE__ */ jsx(
1736
+ m.span,
1737
+ {
1738
+ initial: { width: 0, opacity: 0, scale: 0.8 },
1739
+ animate: { width: "auto", opacity: 1, scale: 1 },
1740
+ exit: { width: 0, opacity: 0, scale: 0.8 },
1741
+ transition: NAVBAR_EXPRESSIVE_SPRING,
1742
+ className: "overflow-hidden whitespace-nowrap text-sm font-semibold tracking-[0.01em] ml-1.5",
1743
+ children
1744
+ },
1745
+ "navbar-label"
1746
+ ) });
1747
+ });
1748
+ function resolveConnectedShapes(variant, orientation, isFirst, isLast, itemSize) {
1749
+ const defaults = ButtonGroupDefaults.connectedLeadingButtonShapes(itemSize);
1750
+ if (variant !== "connected") return defaults;
1751
+ if (orientation === "horizontal") {
1752
+ if (isFirst && !isLast)
1753
+ return ButtonGroupDefaults.connectedLeadingButtonShapes(itemSize);
1754
+ if (!isFirst && isLast)
1755
+ return ButtonGroupDefaults.connectedTrailingButtonShapes(itemSize);
1756
+ if (!isFirst && !isLast)
1757
+ return ButtonGroupDefaults.connectedMiddleButtonShapes(itemSize);
1758
+ } else {
1759
+ if (isFirst && !isLast)
1760
+ return ButtonGroupDefaults.connectedTopButtonShapes(itemSize);
1761
+ if (!isFirst && isLast)
1762
+ return ButtonGroupDefaults.connectedBottomButtonShapes(itemSize);
1763
+ if (!isFirst && !isLast)
1764
+ return ButtonGroupDefaults.connectedMiddleButtonShapes(itemSize);
1765
+ }
1766
+ return defaults;
1767
+ }
1768
+ function resolveIconAndLabel(element, isSelected, itemSize, variant, showCheck, iconBehavior, labelBehavior) {
1769
+ let icon = element.props.icon;
1770
+ let label = element.props.children;
1771
+ const animateCheckInLabel = showCheck && iconBehavior !== "none" && iconBehavior !== "selected" && label !== void 0;
1772
+ if (iconBehavior === "none" || animateCheckInLabel) {
1773
+ icon = void 0;
1774
+ } else if (iconBehavior === "selected") {
1775
+ icon = isSelected ? element.props.icon : void 0;
1776
+ }
1777
+ if (labelBehavior === "none") {
1778
+ label = void 0;
1779
+ } else if (labelBehavior === "selected") {
1780
+ label = isSelected ? element.props.children : void 0;
1781
+ }
1782
+ if (animateCheckInLabel && label !== void 0) {
1783
+ label = /* @__PURE__ */ jsx(AnimatedCheckLabel, { selected: isSelected, size: itemSize, children: label });
1784
+ } else if (variant === "navbar" && label !== void 0) {
1785
+ const showLabel = !labelBehavior || labelBehavior === "all" || labelBehavior === "selected" && isSelected;
1786
+ label = /* @__PURE__ */ jsx(AnimatedNavbarLabel, { show: showLabel, children: label });
1787
+ }
1788
+ return { icon, label };
1789
+ }
1790
+ function resolveFlexTargets(variant, orientation, isSelected, isPressed, hasSelected, count, fullWidth, activeMorphing, morphingWidth, expandedRatio, basePx) {
1791
+ const increment = expandedRatio * PADDING_EXPAND_MULTIPLIER;
1792
+ if (activeMorphing) {
1793
+ const isFlexLayout = fullWidth || variant === "connected" && orientation === "horizontal";
1794
+ if (isFlexLayout) {
1795
+ if (isSelected) return { flexGrow: 1 + expandedRatio };
1796
+ if (hasSelected && count > 1)
1797
+ return {
1798
+ flexGrow: Math.max(MIN_FLEX_GROW, 1 - expandedRatio / (count - 1))
1799
+ };
1800
+ return { flexGrow: 1 };
1801
+ }
1802
+ if (isSelected)
1803
+ return { paddingInline: `calc(${basePx} + ${increment}rem)` };
1804
+ if (hasSelected && count > 1) {
1805
+ const decrement = increment / (count - 1);
1806
+ return { paddingInline: `calc(${basePx} - ${decrement}rem)` };
1807
+ }
1808
+ return { paddingInline: basePx };
1809
+ }
1810
+ if (morphingWidth && variant === "standard") {
1811
+ if (fullWidth) return { flexGrow: isPressed ? 1 + expandedRatio : 1 };
1812
+ return {
1813
+ paddingInline: isPressed ? `calc(${basePx} + ${increment}rem)` : basePx
1814
+ };
1815
+ }
1816
+ return {};
1817
+ }
1818
+ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex, existingAnimate, existingWhileTap) {
1819
+ var _a, _b;
1820
+ const props = { animate: __spreadValues({}, existingAnimate) };
1821
+ if (variant !== "navbar") {
1822
+ if (flex.flexGrow !== void 0) {
1823
+ props.animate.flexGrow = flex.flexGrow;
1824
+ }
1825
+ if (flex.paddingInline !== void 0) {
1826
+ props.animate.paddingInline = flex.paddingInline;
1827
+ }
1828
+ }
1829
+ if (variant === "standard") {
1830
+ const pressedRadius = (_a = PRESSED_RADIUS_MAP[itemSize]) != null ? _a : PRESSED_RADIUS_MAP.sm;
1831
+ const itemSizeTokens = (_b = BUTTON_SIZE_TOKENS[itemSize]) != null ? _b : BUTTON_SIZE_TOKENS.sm;
1832
+ const isSquish = isSelected || isPressed;
1833
+ props.animate.borderRadius = isSquish ? pressedRadius : itemSizeTokens.roundShapeRadius;
1834
+ props.whileTap = __spreadValues({
1835
+ scale: 0.98
1836
+ }, existingWhileTap);
1837
+ props.transition = {
1838
+ borderRadius: BUTTON_RADIUS_SPRING,
1839
+ flexGrow: WIDTH_MORPH_SPRING,
1840
+ paddingInline: WIDTH_MORPH_SPRING,
1841
+ layout: WIDTH_MORPH_SPRING,
1842
+ default: BUTTON_SHAPE_MORPH_SPRING
1843
+ };
1844
+ props.layout = true;
1845
+ }
1846
+ if (variant === "connected") {
1847
+ const { tl, tr, br, bl } = isSelected ? {
1848
+ tl: PILL_BORDER_RADIUS,
1849
+ tr: PILL_BORDER_RADIUS,
1850
+ br: PILL_BORDER_RADIUS,
1851
+ bl: PILL_BORDER_RADIUS
1852
+ } : shapes.default;
1853
+ props.animate = __spreadProps(__spreadValues({}, props.animate), {
1854
+ borderRadius: void 0,
1855
+ borderTopLeftRadius: tl,
1856
+ borderTopRightRadius: tr,
1857
+ borderBottomRightRadius: br,
1858
+ borderBottomLeftRadius: bl
1859
+ });
1860
+ props.whileTap = __spreadValues({
1861
+ borderRadius: void 0,
1862
+ borderTopLeftRadius: shapes.pressed.tl,
1863
+ borderTopRightRadius: shapes.pressed.tr,
1864
+ borderBottomRightRadius: shapes.pressed.br,
1865
+ borderBottomLeftRadius: shapes.pressed.bl
1866
+ }, existingWhileTap);
1867
+ props.transition = __spreadProps(__spreadValues({}, BUTTON_SHAPE_MORPH_SPRING), {
1868
+ flexGrow: WIDTH_MORPH_SPRING,
1869
+ paddingInline: WIDTH_MORPH_SPRING,
1870
+ borderTopLeftRadius: BUTTON_RADIUS_SPRING,
1871
+ borderTopRightRadius: BUTTON_RADIUS_SPRING,
1872
+ borderBottomRightRadius: BUTTON_RADIUS_SPRING,
1873
+ borderBottomLeftRadius: BUTTON_RADIUS_SPRING,
1874
+ layout: WIDTH_MORPH_SPRING
1875
+ });
1876
+ props.layout = true;
1877
+ }
1878
+ if (variant === "navbar") {
1879
+ props.layout = true;
1880
+ props.transition = {
1881
+ layout: WIDTH_MORPH_SPRING,
1882
+ default: BUTTON_SHAPE_MORPH_SPRING
1883
+ };
1884
+ }
1885
+ return props;
1886
+ }
1887
+ var ButtonGroupComponent = React11.forwardRef(
1888
+ (_a, ref) => {
1889
+ var _b = _a, {
1890
+ className,
1891
+ variant = "standard",
1892
+ orientation = "horizontal",
1893
+ fullWidth = false,
1894
+ size,
1895
+ morphingWidth = true,
1896
+ activeMorphing = false,
1897
+ itemClassName,
1898
+ expandedRatio = ButtonGroupDefaults.expandedRatio,
1899
+ showCheck = false,
1900
+ children,
1901
+ iconBehavior,
1902
+ labelBehavior,
1903
+ style
1904
+ } = _b, props = __objRest(_b, [
1905
+ "className",
1906
+ "variant",
1907
+ "orientation",
1908
+ "fullWidth",
1909
+ "size",
1910
+ "morphingWidth",
1911
+ "activeMorphing",
1912
+ "itemClassName",
1913
+ "expandedRatio",
1914
+ "showCheck",
1915
+ "children",
1916
+ "iconBehavior",
1917
+ "labelBehavior",
1918
+ "style"
1919
+ ]);
1920
+ const [pressedIndex, setPressedIndex] = React11.useState(null);
1921
+ const [lockedGroupSize, setLockedGroupSize] = React11.useState(
1922
+ null
1923
+ );
1924
+ const layoutIdGroup = React11.useId();
1925
+ const rootRef = React11.useRef(null);
1926
+ const setRootRef = React11.useCallback(
1927
+ (node) => {
1928
+ rootRef.current = node;
1929
+ if (typeof ref === "function") {
1930
+ ref(node);
1931
+ } else if (ref) {
1932
+ ref.current = node;
1933
+ }
1934
+ },
1935
+ [ref]
1936
+ );
1937
+ const childrenArray = React11.useMemo(
1938
+ () => React11.Children.toArray(children).filter(React11.isValidElement),
1939
+ [children]
1940
+ );
1941
+ const count = childrenArray.length;
1942
+ const groupSizeSignature = React11.useMemo(
1943
+ () => `${childrenArray.map((child, index) => {
1944
+ var _a2, _b2, _c, _d, _e;
1945
+ const element = child;
1946
+ const label = typeof element.props.children === "string" || typeof element.props.children === "number" ? element.props.children : (_a2 = element.key) != null ? _a2 : index;
1947
+ return [
1948
+ (_b2 = element.key) != null ? _b2 : index,
1949
+ (_d = (_c = element.props.size) != null ? _c : size) != null ? _d : "",
1950
+ label,
1951
+ Boolean(element.props.icon),
1952
+ (_e = element.props.className) != null ? _e : ""
1953
+ ].join(":");
1954
+ }).join("|")}|${variant}|${orientation}|${showCheck}`,
1955
+ [childrenArray, orientation, showCheck, size, variant]
1956
+ );
1957
+ const groupSizeSignatureRef = React11.useRef(groupSizeSignature);
1958
+ React11.useLayoutEffect(() => {
1959
+ if (groupSizeSignatureRef.current !== groupSizeSignature) {
1960
+ groupSizeSignatureRef.current = groupSizeSignature;
1961
+ setLockedGroupSize(null);
1962
+ }
1963
+ }, [groupSizeSignature]);
1964
+ const hasExplicitGroupSize = orientation === "horizontal" ? (style == null ? void 0 : style.width) !== void 0 || (style == null ? void 0 : style.inlineSize) !== void 0 : (style == null ? void 0 : style.height) !== void 0 || (style == null ? void 0 : style.blockSize) !== void 0;
1965
+ const shouldLockGroupSize = activeMorphing && !fullWidth && !hasExplicitGroupSize && count > 1;
1966
+ React11.useLayoutEffect(() => {
1967
+ if (!shouldLockGroupSize) {
1968
+ if (lockedGroupSize !== null) setLockedGroupSize(null);
1969
+ return;
1970
+ }
1971
+ if (lockedGroupSize !== null) return;
1972
+ const node = rootRef.current;
1973
+ if (!node) return;
1974
+ const rect = node.getBoundingClientRect();
1975
+ const nextSize = orientation === "horizontal" ? rect.width : rect.height;
1976
+ if (nextSize > 0) {
1977
+ setLockedGroupSize(Math.ceil(nextSize * 100) / 100);
1978
+ }
1979
+ }, [lockedGroupSize, orientation, shouldLockGroupSize]);
1980
+ const groupStyle = React11.useMemo(() => {
1981
+ const nextStyle = __spreadValues({}, style);
1982
+ if (shouldLockGroupSize && lockedGroupSize !== null) {
1983
+ if (orientation === "horizontal") {
1984
+ nextStyle.inlineSize = `${lockedGroupSize}px`;
1985
+ } else {
1986
+ nextStyle.blockSize = `${lockedGroupSize}px`;
1987
+ }
1988
+ }
1989
+ return nextStyle;
1990
+ }, [lockedGroupSize, orientation, shouldLockGroupSize, style]);
1991
+ const hasSelected = React11.useMemo(
1992
+ () => childrenArray.some(
1993
+ (child) => child.props.selected
1994
+ ),
1995
+ [childrenArray]
1996
+ );
1997
+ const handlePointerLeaveAndUp = React11.useCallback(() => {
1998
+ setPressedIndex(null);
1999
+ }, []);
2000
+ return /* @__PURE__ */ jsx(
2001
+ "fieldset",
2002
+ __spreadProps(__spreadValues({
2003
+ ref: setRootRef,
2004
+ className: cn(
2005
+ "inline-flex p-0 m-0 border-none max-w-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
2006
+ orientation === "vertical" ? "flex-col items-stretch overflow-y-auto overflow-x-hidden" : "flex-row overflow-x-auto overflow-y-hidden",
2007
+ variant === "standard" ? "gap-3" : variant === "navbar" ? "gap-1.5 h-full" : "gap-0.5",
2008
+ fullWidth && "w-full",
2009
+ fullWidth && orientation === "vertical" && "h-full",
2010
+ className
2011
+ ),
2012
+ style: groupStyle,
2013
+ onPointerLeave: handlePointerLeaveAndUp,
2014
+ onPointerUp: handlePointerLeaveAndUp
2015
+ }, props), {
2016
+ children: childrenArray.map((child, index) => {
2017
+ var _a2, _b2, _c;
2018
+ const element = child;
2019
+ const isSelected = element.props.selected === true;
2020
+ const isFirst = index === 0;
2021
+ const isLast = index === count - 1;
2022
+ const itemSize = size || element.props.size || "sm";
2023
+ const basePx = ((_a2 = BUTTON_SIZE_TOKENS[itemSize]) == null ? void 0 : _a2.leadingSpace) || "1rem";
2024
+ const isPressed = pressedIndex === index;
2025
+ const { icon: explicitIcon, label: explicitLabel } = resolveIconAndLabel(
2026
+ element,
2027
+ isSelected,
2028
+ itemSize,
2029
+ variant,
2030
+ showCheck,
2031
+ iconBehavior,
2032
+ labelBehavior
2033
+ );
2034
+ const shapes = resolveConnectedShapes(
2035
+ variant,
2036
+ orientation,
2037
+ isFirst,
2038
+ isLast,
2039
+ itemSize
2040
+ );
2041
+ const flex = resolveFlexTargets(
2042
+ variant,
2043
+ orientation,
2044
+ isSelected,
2045
+ isPressed,
2046
+ hasSelected,
2047
+ count,
2048
+ fullWidth,
2049
+ activeMorphing,
2050
+ morphingWidth,
2051
+ expandedRatio,
2052
+ basePx
2053
+ );
2054
+ const dynamicStyle = __spreadValues({}, element.props.style);
2055
+ if (variant !== "navbar" && flex.flexGrow !== void 0 && fullWidth) {
2056
+ dynamicStyle.flexBasis = 0;
2057
+ dynamicStyle.flexShrink = 1;
2058
+ dynamicStyle.minWidth = 0;
2059
+ }
2060
+ const existingAnimate = typeof element.props.animate === "object" && !Array.isArray(element.props.animate) ? element.props.animate : {};
2061
+ const existingWhileTap = typeof element.props.whileTap === "object" && !Array.isArray(element.props.whileTap) ? element.props.whileTap : {};
2062
+ const motionProps = buildMotionProps(
2063
+ variant,
2064
+ isSelected,
2065
+ isPressed,
2066
+ itemSize,
2067
+ shapes,
2068
+ flex,
2069
+ existingAnimate,
2070
+ existingWhileTap
2071
+ );
2072
+ const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
2073
+ const navbarFlexStyle = flex.flexGrow !== void 0 ? {
2074
+ flexBasis: fullWidth && labelBehavior !== "selected" ? 0 : "auto",
2075
+ flexShrink: fullWidth ? 1 : 0,
2076
+ flexGrow: flex.flexGrow,
2077
+ minWidth: labelBehavior !== "selected" ? 0 : "fit-content"
2078
+ } : {};
2079
+ const clonedElement = React11.cloneElement(element, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
2080
+ key: (_b2 = element.key) != null ? _b2 : index,
2081
+ tabIndex: isFirst ? 0 : -1,
2082
+ size: size || element.props.size,
2083
+ icon: explicitIcon,
2084
+ children: explicitLabel
2085
+ }, variant === "connected" && {
2086
+ colorStyle: element.props.colorStyle || "tonal",
2087
+ selectedColorStyle: element.props.selectedColorStyle || "filled"
2088
+ }), variant === "navbar" && {
2089
+ colorStyle: "text",
2090
+ selectedColorStyle: "text",
2091
+ className: cn(
2092
+ element.props.className,
2093
+ "w-full! h-full! px-3! min-w-0! relative z-20 flex items-center justify-center",
2094
+ isSelected ? "text-m3-on-secondary-container! hover:bg-transparent! active:bg-transparent!" : "text-m3-on-surface-variant! hover:bg-transparent! active:bg-transparent!",
2095
+ itemClassName
2096
+ )
2097
+ }), variant !== "navbar" && {
2098
+ className: cn(
2099
+ element.props.className,
2100
+ connectedClasses,
2101
+ "focus-visible:z-10 hover:z-10 relative min-w-0",
2102
+ orientation === "vertical" && "w-full",
2103
+ itemClassName
2104
+ )
2105
+ }), {
2106
+ style: variant === "navbar" ? __spreadProps(__spreadValues({}, dynamicStyle), { minWidth: 0 }) : dynamicStyle,
2107
+ onPointerDown: (e) => {
2108
+ setPressedIndex(index);
2109
+ if (element.props.onPointerDown) element.props.onPointerDown(e);
2110
+ }
2111
+ }), motionProps));
2112
+ if (variant === "navbar") {
2113
+ return /* @__PURE__ */ jsxs(
2114
+ m.div,
2115
+ {
2116
+ layout: true,
2117
+ whileTap: { scale: 0.96 },
2118
+ transition: NAVBAR_EXPRESSIVE_SPRING,
2119
+ className: "group relative h-full flex items-center justify-center min-w-0",
2120
+ style: navbarFlexStyle,
2121
+ children: [
2122
+ /* @__PURE__ */ jsxs(
2123
+ "div",
2124
+ {
2125
+ className: "absolute inset-x-1 inset-y-0 m-auto flex items-center justify-center pointer-events-none",
2126
+ style: { zIndex: 1 },
2127
+ children: [
2128
+ /* @__PURE__ */ jsx(
2129
+ "div",
2130
+ {
2131
+ className: "w-full h-[40px] bg-m3-on-surface-variant/8 opacity-0 group-hover:opacity-100 transition-opacity duration-200",
2132
+ style: { borderRadius: PILL_BORDER_RADIUS }
2133
+ }
2134
+ ),
2135
+ /* @__PURE__ */ jsx(AnimatePresence, { children: isSelected && /* @__PURE__ */ jsx(
2136
+ m.div,
2137
+ {
2138
+ layoutId: `navbar-active-indicator-${layoutIdGroup}`,
2139
+ className: "absolute inset-0 m-auto w-full h-[40px] bg-m3-secondary-container",
2140
+ style: { borderRadius: PILL_BORDER_RADIUS },
2141
+ transition: NAVBAR_EXPRESSIVE_SPRING
2142
+ }
2143
+ ) })
2144
+ ]
2145
+ }
2146
+ ),
2147
+ clonedElement
2148
+ ]
2149
+ },
2150
+ (_c = element.key) != null ? _c : index
2151
+ );
2152
+ }
2153
+ return clonedElement;
2154
+ })
2155
+ })
2156
+ );
2157
+ }
2158
+ );
2159
+ ButtonGroupComponent.displayName = "ButtonGroup";
2160
+ var ButtonGroup = React11.memo(ButtonGroupComponent);
2161
+ var SIZE_HEIGHT = {
2162
+ sm: "h-14",
2163
+ md: "h-20",
2164
+ lg: "h-24"
2165
+ };
2166
+ var SIZE_WIDTH_COLLAPSED = {
2167
+ sm: "w-14",
2168
+ md: "w-20",
2169
+ lg: "w-24"
2170
+ };
2171
+ var SIZE_PADDING = {
2172
+ sm: "px-4",
2173
+ md: "px-[26px]",
2174
+ lg: "px-7"
2175
+ };
2176
+ var SIZE_GAP = {
2177
+ sm: "gap-2",
2178
+ md: "gap-3",
2179
+ lg: "gap-4"
2180
+ };
2181
+ var SIZE_ICON = {
2182
+ sm: { cls: "size-6", px: 24 },
2183
+ md: { cls: "size-7", px: 28 },
2184
+ lg: { cls: "size-9", px: 36 }
2185
+ };
2186
+ var SIZE_TEXT = {
2187
+ sm: "text-base font-medium",
2188
+ md: "text-lg font-medium",
2189
+ lg: "text-xl font-normal"
2190
+ };
2191
+ var MORPH_RADIUS = {
2192
+ sm: { default: 16, pressed: 10 },
2193
+ md: { default: 20, pressed: 14 },
2194
+ lg: { default: 28, pressed: 18 }
2195
+ };
2196
+ var COLOR_CLASSES = {
2197
+ primary: {
2198
+ bg: "bg-m3-primary-container",
2199
+ text: "text-m3-on-primary-container"
2200
+ },
2201
+ secondary: {
2202
+ bg: "bg-m3-secondary-container",
2203
+ text: "text-m3-on-secondary-container"
2204
+ },
2205
+ tertiary: {
2206
+ bg: "bg-m3-tertiary-container",
2207
+ text: "text-m3-on-tertiary-container"
2208
+ },
2209
+ surface: {
2210
+ bg: "bg-m3-surface-container-high",
2211
+ text: "text-m3-on-surface"
2212
+ }
2213
+ };
2214
+ function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
2215
+ const [collapsed, setCollapsed] = React11.useState(false);
2216
+ const lastScrollY = React11.useRef(0);
2217
+ React11.useEffect(() => {
2218
+ if (!enabled || typeof window === "undefined") return;
2219
+ lastScrollY.current = window.scrollY;
2220
+ const handleScroll = () => {
2221
+ const currentScrollY = window.scrollY;
2222
+ const diff = currentScrollY - lastScrollY.current;
2223
+ if (Math.abs(diff) < scrollThreshold) return;
2224
+ if (diff > 0 && !collapsed) {
2225
+ setCollapsed(true);
2226
+ onCollapsedChange == null ? void 0 : onCollapsedChange(true);
2227
+ } else if (diff < 0 && collapsed) {
2228
+ setCollapsed(false);
2229
+ onCollapsedChange == null ? void 0 : onCollapsedChange(false);
2230
+ }
2231
+ lastScrollY.current = currentScrollY;
2232
+ };
2233
+ window.addEventListener("scroll", handleScroll, { passive: true });
2234
+ return () => {
2235
+ window.removeEventListener("scroll", handleScroll);
2236
+ };
2237
+ }, [enabled, scrollThreshold, collapsed, onCollapsedChange]);
2238
+ return collapsed;
2239
+ }
2240
+ var ExtendedFABComponent = React11.forwardRef(
2241
+ (_a, ref) => {
2242
+ var _b = _a, {
2243
+ className,
2244
+ style,
2245
+ label,
2246
+ icon,
2247
+ size = "sm",
2248
+ colorStyle = "primary",
2249
+ lowered = false,
2250
+ loading = false,
2251
+ loadingVariant = "loading-indicator",
2252
+ visible = true,
2253
+ collapseOnScroll = false,
2254
+ scrollThreshold = 50,
2255
+ collapsed,
2256
+ onCollapsedChange,
2257
+ onClick,
2258
+ onKeyDown,
2259
+ layoutId,
2260
+ "aria-label": ariaLabel
2261
+ } = _b, restProps = __objRest(_b, [
2262
+ "className",
2263
+ "style",
2264
+ "label",
2265
+ "icon",
2266
+ "size",
2267
+ "colorStyle",
2268
+ "lowered",
2269
+ "loading",
2270
+ "loadingVariant",
2271
+ "visible",
2272
+ "collapseOnScroll",
2273
+ "scrollThreshold",
2274
+ "collapsed",
2275
+ "onCollapsedChange",
2276
+ "onClick",
2277
+ "onKeyDown",
2278
+ "layoutId",
2279
+ "aria-label"
2280
+ ]);
2281
+ var _a2, _b2, _c, _d;
2282
+ const localRef = React11.useRef(null);
2283
+ React11.useImperativeHandle(ref, () => localRef.current);
2284
+ const [dir, setDir] = React11.useState("ltr");
2285
+ React11.useEffect(() => {
2286
+ var _a3;
2287
+ if (!localRef.current) return;
2288
+ const closestDir = (_a3 = localRef.current.closest("[dir]")) == null ? void 0 : _a3.getAttribute("dir");
2289
+ if (closestDir === "rtl" || closestDir === "ltr") {
2290
+ setDir(closestDir);
2291
+ }
2292
+ }, []);
2293
+ const internalCollapsed = useScrollCollapse(
2294
+ collapseOnScroll,
2295
+ scrollThreshold,
2296
+ onCollapsedChange
2297
+ );
2298
+ const isCollapsed = collapsed !== void 0 ? collapsed : internalCollapsed;
2299
+ const hasIcon = !!icon || loading;
2300
+ const colors = (_a2 = COLOR_CLASSES[colorStyle]) != null ? _a2 : COLOR_CLASSES.primary;
2301
+ const radiusConfig = (_b2 = MORPH_RADIUS[size]) != null ? _b2 : MORPH_RADIUS.sm;
2302
+ const sizeIcon = (_c = SIZE_ICON[size]) != null ? _c : SIZE_ICON.sm;
2303
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
2304
+ disabled: loading
2305
+ });
2306
+ const handleClick = React11.useCallback(
2307
+ (e) => {
2308
+ if (loading) {
2309
+ e.preventDefault();
2310
+ return;
2311
+ }
2312
+ onClick == null ? void 0 : onClick(e);
2313
+ },
2314
+ [loading, onClick]
2315
+ );
2316
+ const handleKeyDown = React11.useCallback(
2317
+ (e) => {
2318
+ if (loading) return;
2319
+ if ((e.key === "Enter" || e.key === " ") && onClick) {
2320
+ e.preventDefault();
2321
+ e.currentTarget.click();
2322
+ }
2323
+ onKeyDown == null ? void 0 : onKeyDown(e);
2324
+ },
2325
+ [loading, onClick, onKeyDown]
2326
+ );
2327
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: visible && !(isCollapsed && !hasIcon) && /* @__PURE__ */ jsxs(
2328
+ m.button,
2329
+ __spreadProps(__spreadValues({
2330
+ ref: localRef,
2331
+ type: "button",
2332
+ layout: true,
2333
+ layoutId,
2334
+ "aria-label": ariaLabel || label,
2335
+ "aria-busy": loading || void 0,
2336
+ "aria-disabled": loading || restProps.disabled,
2337
+ onClick: handleClick,
2338
+ onPointerDown,
2339
+ onKeyDown: handleKeyDown,
2340
+ style,
2341
+ initial: {
2342
+ scale: 0.6,
2343
+ opacity: 0,
2344
+ borderRadius: radiusConfig.default
2345
+ },
2346
+ animate: {
2347
+ scale: 1,
2348
+ opacity: 1,
2349
+ borderRadius: radiusConfig.default
2350
+ },
2351
+ exit: { scale: 0.6, opacity: 0 },
2352
+ whileTap: { borderRadius: radiusConfig.pressed },
2353
+ transition: {
2354
+ borderRadius: { type: "spring", stiffness: 500, damping: 30 },
2355
+ scale: SPRING_TRANSITION,
2356
+ opacity: { duration: 0.2, ease: "linear" },
2357
+ layout: SPRING_TRANSITION
2358
+ },
2359
+ className: cn(
2360
+ "relative shrink-0 inline-flex items-center select-none cursor-pointer overflow-hidden",
2361
+ "transition-[box-shadow,filter] duration-200",
2362
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
2363
+ "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
2364
+ colors.bg,
2365
+ colors.text,
2366
+ lowered ? "shadow-sm" : "shadow-md",
2367
+ (_d = SIZE_HEIGHT[size]) != null ? _d : "h-14",
2368
+ SIZE_TEXT[size],
2369
+ isCollapsed ? cn("px-0 justify-center", SIZE_WIDTH_COLLAPSED[size]) : cn(
2370
+ hasIcon ? "justify-start" : "justify-center",
2371
+ SIZE_PADDING[size],
2372
+ hasIcon && SIZE_GAP[size]
2373
+ ),
2374
+ dir === "rtl" || restProps.dir === "rtl" ? "flex-row-reverse" : "flex-row",
2375
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
2376
+ className
2377
+ )
2378
+ }, restProps), {
2379
+ children: [
2380
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
2381
+ hasIcon && /* @__PURE__ */ jsx(
2382
+ m.span,
2383
+ {
2384
+ layout: "position",
2385
+ className: cn(
2386
+ "flex items-center justify-center shrink-0",
2387
+ sizeIcon.cls
2388
+ ),
2389
+ children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
2390
+ m.span,
2391
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
2392
+ transition: SPRING_TRANSITION,
2393
+ className: "flex items-center justify-center shrink-0 w-full h-full",
2394
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
2395
+ LoadingIndicator,
2396
+ {
2397
+ size: sizeIcon.px,
2398
+ color: "currentColor",
2399
+ "aria-label": "Loading"
2400
+ }
2401
+ ) : /* @__PURE__ */ jsx(
2402
+ ProgressIndicator,
2403
+ {
2404
+ variant: "circular",
2405
+ size: sizeIcon.px,
2406
+ color: "currentColor",
2407
+ trackColor: "transparent",
2408
+ "aria-label": "Loading"
2409
+ }
2410
+ )
2411
+ }),
2412
+ "loading"
2413
+ ) : icon && /* @__PURE__ */ jsx(
2414
+ m.span,
2415
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
2416
+ transition: SPRING_TRANSITION,
2417
+ "aria-hidden": "true",
2418
+ className: "flex items-center justify-center shrink-0 w-full h-full [&>svg]:w-full [&>svg]:h-full",
2419
+ children: icon
2420
+ }),
2421
+ "icon"
2422
+ ) })
2423
+ }
2424
+ ),
2425
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsx(
2426
+ m.span,
2427
+ {
2428
+ layout: "position",
2429
+ initial: { opacity: 0, width: 0 },
2430
+ animate: { opacity: 1, width: "auto" },
2431
+ exit: { opacity: 0, width: 0 },
2432
+ transition: {
2433
+ opacity: { duration: 0.15, ease: "linear" },
2434
+ width: SPRING_TRANSITION
2435
+ },
2436
+ className: "overflow-hidden whitespace-nowrap",
2437
+ children: label
2438
+ },
2439
+ "label"
2440
+ ) })
2441
+ ]
2442
+ })
2443
+ ) }) });
2444
+ }
2445
+ );
2446
+ ExtendedFABComponent.displayName = "ExtendedFAB";
2447
+ var ExtendedFAB = React11.memo(ExtendedFABComponent);
2448
+ var SIZE_STYLES = {
2449
+ sm: "h-10 w-10",
2450
+ md: "h-14 w-14",
2451
+ lg: "h-24 w-24",
2452
+ xl: "h-[8.5rem] w-[8.5rem]"
2453
+ };
2454
+ var SIZE_ICON2 = {
2455
+ sm: { cls: "size-6", px: 24 },
2456
+ md: { cls: "size-6", px: 24 },
2457
+ lg: { cls: "size-8", px: 32 },
2458
+ xl: { cls: "size-10", px: 40 }
2459
+ };
2460
+ var SIZE_TEXT_CLASS = {
2461
+ sm: "text-sm font-medium",
2462
+ md: "text-base font-medium",
2463
+ lg: "text-xl font-semibold",
2464
+ xl: "text-2xl font-semibold"
2465
+ };
2466
+ var MORPH_RADIUS2 = {
2467
+ sm: { default: 12, pressed: 8, extended: 12, extended_pressed: 8 },
2468
+ md: { default: 16, pressed: 10, extended: 16, extended_pressed: 10 },
2469
+ lg: { default: 28, pressed: 20, extended: 28, extended_pressed: 20 },
2470
+ xl: { default: 40, pressed: 28, extended: 40, extended_pressed: 28 }
2471
+ };
2472
+ var COLOR_CLASSES2 = {
2473
+ primary: {
2474
+ bg: "bg-m3-primary-container",
2475
+ text: "text-m3-on-primary-container",
2476
+ shadow: "shadow-md"
2477
+ },
2478
+ secondary: {
2479
+ bg: "bg-m3-secondary-container",
2480
+ text: "text-m3-on-secondary-container",
2481
+ shadow: "shadow-md"
2482
+ },
2483
+ tertiary: {
2484
+ bg: "bg-m3-tertiary-container",
2485
+ text: "text-m3-on-tertiary-container",
2486
+ shadow: "shadow-md"
2487
+ },
2488
+ surface: {
2489
+ bg: "bg-m3-surface-container-high",
2490
+ text: "text-m3-primary",
2491
+ shadow: "shadow-md"
2492
+ }
2493
+ };
2494
+ var POSITION_CLASS = {
2495
+ "bottom-right": "bottom-4 right-4 sm:bottom-6 sm:right-6",
2496
+ "bottom-left": "bottom-4 left-4 sm:bottom-6 sm:left-6",
2497
+ "top-right": "top-4 right-4 sm:top-6 sm:right-6",
2498
+ "top-left": "top-4 left-4 sm:top-6 sm:left-6"
2499
+ };
2500
+ function FABPosition({
2501
+ position = "bottom-right",
2502
+ children,
2503
+ className
2504
+ }) {
2505
+ var _a;
2506
+ return /* @__PURE__ */ jsx(
2507
+ "div",
2508
+ {
2509
+ className: cn(
2510
+ "absolute z-10",
2511
+ (_a = POSITION_CLASS[position]) != null ? _a : POSITION_CLASS["bottom-right"],
2512
+ className
2513
+ ),
2514
+ children
2515
+ }
2516
+ );
2517
+ }
2518
+ var FABComponent = React11.forwardRef(
2519
+ (_a, ref) => {
2520
+ var _b = _a, {
2521
+ className,
2522
+ style,
2523
+ icon,
2524
+ size = "md",
2525
+ colorStyle = "primary",
2526
+ extended = false,
2527
+ children,
2528
+ lowered = false,
2529
+ loading = false,
2530
+ loadingVariant = "loading-indicator",
2531
+ visible = true,
2532
+ onClick,
2533
+ onKeyDown,
2534
+ "aria-label": ariaLabel
2535
+ } = _b, restProps = __objRest(_b, [
2536
+ "className",
2537
+ "style",
2538
+ "icon",
2539
+ "size",
2540
+ "colorStyle",
2541
+ "extended",
2542
+ "children",
2543
+ "lowered",
2544
+ "loading",
2545
+ "loadingVariant",
2546
+ "visible",
2547
+ "onClick",
2548
+ "onKeyDown",
2549
+ "aria-label"
2550
+ ]);
2551
+ var _a2, _b2, _c, _d;
2552
+ const colors = (_a2 = COLOR_CLASSES2[colorStyle]) != null ? _a2 : COLOR_CLASSES2.primary;
2553
+ const radiusConfig = (_b2 = MORPH_RADIUS2[size]) != null ? _b2 : MORPH_RADIUS2.md;
2554
+ const animateRadius = extended ? radiusConfig.extended : radiusConfig.default;
2555
+ const pressedRadius = extended ? radiusConfig.extended_pressed : radiusConfig.pressed;
2556
+ const sizeIcon = (_c = SIZE_ICON2[size]) != null ? _c : SIZE_ICON2.md;
2557
+ const iconClass = sizeIcon.cls;
2558
+ const iconPx = sizeIcon.px;
2559
+ const needsTouchTarget = size === "sm";
2560
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
2561
+ disabled: loading
2562
+ });
2563
+ const handleClick = React11.useCallback(
2564
+ (e) => {
2565
+ if (loading) {
2566
+ e.preventDefault();
2567
+ return;
2568
+ }
2569
+ onClick == null ? void 0 : onClick(e);
2570
+ },
2571
+ [loading, onClick]
2572
+ );
2573
+ const handleKeyDown = React11.useCallback(
2574
+ (e) => {
2575
+ if (loading) return;
2576
+ if ((e.key === "Enter" || e.key === " ") && onClick) {
2577
+ e.preventDefault();
2578
+ e.currentTarget.click();
2579
+ }
2580
+ onKeyDown == null ? void 0 : onKeyDown(e);
2581
+ },
2582
+ [loading, onClick, onKeyDown]
2583
+ );
2584
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: visible && /* @__PURE__ */ jsxs(
2585
+ m.button,
2586
+ __spreadProps(__spreadValues({
2587
+ ref,
2588
+ type: "button",
2589
+ "aria-label": ariaLabel || (typeof children === "string" ? children : void 0),
2590
+ "aria-busy": loading || void 0,
2591
+ "aria-disabled": loading || restProps.disabled,
2592
+ onClick: handleClick,
2593
+ onPointerDown,
2594
+ onKeyDown: handleKeyDown,
2595
+ style,
2596
+ initial: { scale: 0.5, opacity: 0, borderRadius: animateRadius },
2597
+ animate: { scale: 1, opacity: 1, borderRadius: animateRadius },
2598
+ exit: { scale: 0.5, opacity: 0 },
2599
+ whileTap: { borderRadius: pressedRadius },
2600
+ transition: {
2601
+ borderRadius: SPRING_TRANSITION_FAST,
2602
+ scale: SPRING_TRANSITION,
2603
+ opacity: { duration: 0.25, ease: "easeOut" }
2604
+ },
2605
+ className: cn(
2606
+ "relative shrink-0 inline-flex items-center justify-center",
2607
+ "select-none cursor-pointer overflow-hidden",
2608
+ "transition-[box-shadow,opacity,filter] duration-200",
2609
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
2610
+ "disabled:pointer-events-none disabled:opacity-[0.38] disabled:shadow-none",
2611
+ colors.bg,
2612
+ colors.text,
2613
+ lowered ? "shadow-sm" : colors.shadow,
2614
+ (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
2615
+ extended && "w-auto px-6",
2616
+ SIZE_TEXT_CLASS[size],
2617
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
2618
+ className
2619
+ )
2620
+ }, restProps), {
2621
+ children: [
2622
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
2623
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
2624
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
2625
+ m.span,
2626
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
2627
+ transition: SPRING_TRANSITION,
2628
+ className: cn(
2629
+ "flex items-center justify-center shrink-0",
2630
+ iconClass
2631
+ ),
2632
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
2633
+ LoadingIndicator,
2634
+ {
2635
+ size: iconPx,
2636
+ color: "currentColor",
2637
+ "aria-label": "Loading"
2638
+ }
2639
+ ) : /* @__PURE__ */ jsx(
2640
+ ProgressIndicator,
2641
+ {
2642
+ variant: "circular",
2643
+ size: iconPx,
2644
+ color: "currentColor",
2645
+ trackColor: "transparent",
2646
+ "aria-label": "Loading"
2647
+ }
2648
+ )
2649
+ }),
2650
+ "loading"
2651
+ ) : /* @__PURE__ */ jsx(
2652
+ m.span,
2653
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
2654
+ transition: SPRING_TRANSITION,
2655
+ "aria-hidden": "true",
2656
+ className: cn(
2657
+ "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
2658
+ iconClass
2659
+ ),
2660
+ children: icon
2661
+ }),
2662
+ "icon"
2663
+ ) }),
2664
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: extended && children && /* @__PURE__ */ jsx(
2665
+ m.span,
2666
+ {
2667
+ initial: { width: 0, opacity: 0 },
2668
+ animate: { width: "auto", opacity: 1 },
2669
+ exit: { width: 0, opacity: 0 },
2670
+ transition: SPRING_TRANSITION,
2671
+ className: "overflow-hidden whitespace-nowrap ml-3",
2672
+ children
2673
+ },
2674
+ "label"
2675
+ ) })
2676
+ ]
2677
+ })
2678
+ ) }) });
2679
+ }
2680
+ );
2681
+ FABComponent.displayName = "FAB";
2682
+ var FAB = React11.memo(FABComponent);
2683
+ var SPRING_NORMAL = { stiffness: 700, damping: 40 };
2684
+ var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
2685
+ var FOCUS_DELAY_MS = 50;
2686
+ var TOGGLE_FAB_COLORS = {
2687
+ primary: {
2688
+ containerBg: "bg-m3-primary-container",
2689
+ containerText: "text-m3-on-primary-container",
2690
+ checkedBg: "bg-m3-primary",
2691
+ checkedText: "text-m3-on-primary"
2692
+ },
2693
+ secondary: {
2694
+ containerBg: "bg-m3-secondary-container",
2695
+ containerText: "text-m3-on-secondary-container",
2696
+ checkedBg: "bg-m3-secondary",
2697
+ checkedText: "text-m3-on-secondary"
2698
+ },
2699
+ tertiary: {
2700
+ containerBg: "bg-m3-tertiary-container",
2701
+ containerText: "text-m3-on-tertiary-container",
2702
+ checkedBg: "bg-m3-tertiary",
2703
+ checkedText: "text-m3-on-tertiary"
2704
+ }
2705
+ };
2706
+ var TOGGLE_FAB_SIZES = {
2707
+ baseline: { sizeClass: "h-14 w-14", initialRadius: 16, finalRadius: 28 },
2708
+ medium: { sizeClass: "h-20 w-20", initialRadius: 20, finalRadius: 40 },
2709
+ large: { sizeClass: "h-24 w-24", initialRadius: 28, finalRadius: 48 }
2710
+ };
2711
+ var MENU_ITEM_STYLES = {
2712
+ padding: "ps-4 pe-6",
2713
+ gap: "gap-3",
2714
+ size: "h-14 min-w-14",
2715
+ cornerRadius: 999
2716
+ };
2717
+ var MENU_ITEM_COLORS = {
2718
+ primary: {
2719
+ bg: "bg-m3-primary-container",
2720
+ text: "text-m3-on-primary-container"
2721
+ },
2722
+ secondary: {
2723
+ bg: "bg-m3-secondary-container",
2724
+ text: "text-m3-on-secondary-container"
2725
+ },
2726
+ tertiary: {
2727
+ bg: "bg-m3-tertiary-container",
2728
+ text: "text-m3-on-tertiary-container"
2729
+ }
2730
+ };
2731
+ var ALIGNMENT_CONTAINER_CLASSES = {
2732
+ end: "items-end bottom-4 right-4 sm:bottom-6 sm:right-6",
2733
+ start: "items-start bottom-4 left-4 sm:bottom-6 sm:left-6",
2734
+ center: "items-center bottom-4 left-1/2 -translate-x-1/2 sm:bottom-6"
2735
+ };
2736
+ var ALIGNMENT_ITEMS_CLASSES = {
2737
+ end: "items-end",
2738
+ start: "items-start",
2739
+ center: "items-center"
2740
+ };
2741
+ var ALIGNMENT_TRANSFORM_ORIGIN = {
2742
+ end: "right",
2743
+ start: "left",
2744
+ center: "bottom"
2745
+ };
2746
+ var ITEM_SPRING = { type: "spring", stiffness: 700, damping: 25 };
2747
+ var MENU_CONTAINER_VARIANTS = {
2748
+ open: { transition: { staggerChildren: 0.033, staggerDirection: 1 } },
2749
+ closed: { transition: { staggerChildren: 0.02, staggerDirection: -1 } }
2750
+ };
2751
+ var MENU_ITEM_VARIANTS = {
2752
+ open: { scaleX: 1, opacity: 1, transition: ITEM_SPRING },
2753
+ closed: { scaleX: 0, opacity: 0, transition: ITEM_SPRING }
2754
+ };
2755
+ function AddIcon() {
2756
+ return /* @__PURE__ */ jsxs(
2757
+ "svg",
2758
+ {
2759
+ "aria-hidden": "true",
2760
+ viewBox: "0 0 24 24",
2761
+ fill: "currentColor",
2762
+ width: "24",
2763
+ height: "24",
2764
+ children: [
2765
+ /* @__PURE__ */ jsx("title", { children: "Add" }),
2766
+ /* @__PURE__ */ jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
2767
+ ]
2768
+ }
2769
+ );
2770
+ }
2771
+ function CloseIcon() {
2772
+ return /* @__PURE__ */ jsxs(
2773
+ "svg",
2774
+ {
2775
+ "aria-hidden": "true",
2776
+ viewBox: "0 0 24 24",
2777
+ fill: "currentColor",
2778
+ width: "24",
2779
+ height: "24",
2780
+ children: [
2781
+ /* @__PURE__ */ jsx("title", { children: "Close" }),
2782
+ /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" })
2783
+ ]
2784
+ }
2785
+ );
2786
+ }
2787
+ function defaultFabIcon(progress) {
2788
+ return progress > 0.5 ? /* @__PURE__ */ jsx(CloseIcon, {}) : /* @__PURE__ */ jsx(AddIcon, {});
2789
+ }
2790
+ var ToggleFABComponent = React11.forwardRef(
2791
+ ({
2792
+ expanded,
2793
+ onToggle,
2794
+ icon,
2795
+ colorVariant = "primary",
2796
+ fabSize = "baseline",
2797
+ className,
2798
+ id,
2799
+ "aria-label": ariaLabel,
2800
+ "aria-controls": ariaControls
2801
+ }, ref) => {
2802
+ var _a, _b;
2803
+ const prefersReduced = useReducedMotion();
2804
+ const colors = (_a = TOGGLE_FAB_COLORS[colorVariant]) != null ? _a : TOGGLE_FAB_COLORS.primary;
2805
+ const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
2806
+ const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
2807
+ const checkedProgress = useSpring(expanded ? 1 : 0, springConfig);
2808
+ React11.useEffect(() => {
2809
+ checkedProgress.set(expanded ? 1 : 0);
2810
+ }, [expanded, checkedProgress]);
2811
+ const borderRadius = useTransform(
2812
+ checkedProgress,
2813
+ [0, 1],
2814
+ [`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
2815
+ );
2816
+ const [iconProgress, setIconProgress] = React11.useState(expanded ? 1 : 0);
2817
+ React11.useEffect(() => {
2818
+ return checkedProgress.on("change", setIconProgress);
2819
+ }, [checkedProgress]);
2820
+ const { ripples, onPointerDown, removeRipple } = useRippleState();
2821
+ const handleClick = React11.useCallback(() => {
2822
+ onToggle(!expanded);
2823
+ }, [expanded, onToggle]);
2824
+ return /* @__PURE__ */ jsxs(
2825
+ m.button,
2826
+ {
2827
+ ref,
2828
+ id,
2829
+ type: "button",
2830
+ "aria-expanded": expanded,
2831
+ "aria-haspopup": "menu",
2832
+ "aria-label": ariaLabel != null ? ariaLabel : expanded ? "Close menu" : "Open menu",
2833
+ "aria-controls": ariaControls,
2834
+ "data-expanded": expanded ? "true" : "false",
2835
+ onClick: handleClick,
2836
+ onPointerDown,
2837
+ style: { borderRadius },
2838
+ animate: {
2839
+ boxShadow: expanded ? "0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)" : "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"
2840
+ },
2841
+ whileTap: { scale: 0.95, transition: SPRING_TRANSITION_FAST },
2842
+ transition: { boxShadow: SPRING_TRANSITION },
2843
+ className: cn(
2844
+ "relative shrink-0 inline-flex items-center justify-center",
2845
+ "select-none cursor-pointer overflow-hidden",
2846
+ "transition-colors duration-200",
2847
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
2848
+ sizeTokens.sizeClass,
2849
+ expanded ? colors.checkedBg : colors.containerBg,
2850
+ expanded ? colors.checkedText : colors.containerText,
2851
+ className
2852
+ ),
2853
+ children: [
2854
+ /* @__PURE__ */ jsx(TouchTarget, {}),
2855
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
2856
+ /* @__PURE__ */ jsx(
2857
+ "span",
2858
+ {
2859
+ "aria-hidden": "true",
2860
+ className: "relative z-10 flex items-center justify-center size-6 pointer-events-none",
2861
+ children: icon(iconProgress)
2862
+ }
2863
+ )
2864
+ ]
2865
+ }
2866
+ );
2867
+ }
2868
+ );
2869
+ ToggleFABComponent.displayName = "ToggleFAB";
2870
+ var ToggleFAB = React11.memo(ToggleFABComponent);
2871
+ function FABMenuItem({
2872
+ icon,
2873
+ label,
2874
+ onClick,
2875
+ disabled = false,
2876
+ colorVariant = "primary",
2877
+ className,
2878
+ tabIndex = 0
2879
+ }) {
2880
+ var _a;
2881
+ const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
2882
+ const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
2883
+ const handleClick = React11.useCallback(
2884
+ (e) => {
2885
+ if (disabled) {
2886
+ e.preventDefault();
2887
+ return;
2888
+ }
2889
+ onClick();
2890
+ },
2891
+ [disabled, onClick]
2892
+ );
2893
+ const handleKeyDown = React11.useCallback(
2894
+ (e) => {
2895
+ if (disabled) return;
2896
+ if (e.key === "Enter" || e.key === " ") {
2897
+ e.preventDefault();
2898
+ onClick();
2899
+ }
2900
+ },
2901
+ [disabled, onClick]
2902
+ );
2903
+ return /* @__PURE__ */ jsxs(
2904
+ m.div,
2905
+ {
2906
+ role: "menuitem",
2907
+ tabIndex,
2908
+ "aria-disabled": disabled ? "true" : void 0,
2909
+ "data-disabled": disabled ? "true" : void 0,
2910
+ onClick: handleClick,
2911
+ onPointerDown,
2912
+ onKeyDown: handleKeyDown,
2913
+ variants: MENU_ITEM_VARIANTS,
2914
+ style: {
2915
+ transformOrigin: "right",
2916
+ borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
2917
+ },
2918
+ className: cn(
2919
+ "relative inline-flex flex-row items-center",
2920
+ "select-none cursor-pointer overflow-hidden",
2921
+ "whitespace-nowrap",
2922
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-1",
2923
+ MENU_ITEM_STYLES.size,
2924
+ MENU_ITEM_STYLES.gap,
2925
+ label ? MENU_ITEM_STYLES.padding : "px-4",
2926
+ !label && "justify-center",
2927
+ colors.bg,
2928
+ colors.text,
2929
+ disabled && "opacity-[0.38] pointer-events-none",
2930
+ className
2931
+ ),
2932
+ children: [
2933
+ /* @__PURE__ */ jsx(TouchTarget, {}),
2934
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
2935
+ /* @__PURE__ */ jsx(
2936
+ "span",
2937
+ {
2938
+ "aria-hidden": "true",
2939
+ className: "relative z-10 flex items-center justify-center size-6 shrink-0 [&>svg]:w-full [&>svg]:h-full pointer-events-none",
2940
+ children: icon
2941
+ }
2942
+ ),
2943
+ label && /* @__PURE__ */ jsx("span", { className: "relative z-10 text-base font-medium leading-none pointer-events-none", children: label })
2944
+ ]
2945
+ }
2946
+ );
2947
+ }
2948
+ function FABMenu({
2949
+ expanded,
2950
+ onToggle,
2951
+ items,
2952
+ colorVariant = "primary",
2953
+ fabSize = "baseline",
2954
+ alignment = "end",
2955
+ className,
2956
+ closeOnBackdropClick = true,
2957
+ focusLast = true,
2958
+ "aria-label": ariaLabel
2959
+ }) {
2960
+ const fabId = React11.useId();
2961
+ const menuId = React11.useId();
2962
+ const toggleRef = React11.useRef(null);
2963
+ const itemRefs = React11.useRef([]);
2964
+ const [focusedIndex, setFocusedIndex] = React11.useState(-1);
2965
+ const reversedItems = React11.useMemo(() => [...items].reverse(), [items]);
2966
+ const focusItem = React11.useCallback((index) => {
2967
+ var _a;
2968
+ const clampedIndex = Math.max(
2969
+ 0,
2970
+ Math.min(index, itemRefs.current.length - 1)
2971
+ );
2972
+ setFocusedIndex(clampedIndex);
2973
+ (_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
2974
+ }, []);
2975
+ const wasExpandedRef = React11.useRef(false);
2976
+ React11.useEffect(() => {
2977
+ var _a;
2978
+ if (expanded) {
2979
+ wasExpandedRef.current = true;
2980
+ const timer = setTimeout(() => {
2981
+ focusItem(focusLast ? items.length - 1 : 0);
2982
+ }, FOCUS_DELAY_MS);
2983
+ return () => clearTimeout(timer);
2984
+ }
2985
+ if (wasExpandedRef.current) {
2986
+ (_a = toggleRef.current) == null ? void 0 : _a.focus();
2987
+ }
2988
+ wasExpandedRef.current = false;
2989
+ setFocusedIndex(-1);
2990
+ }, [expanded, focusLast, items.length, focusItem]);
2991
+ const handleMenuKeyDown = React11.useCallback(
2992
+ (e) => {
2993
+ if (!expanded) return;
2994
+ const lastIndex = items.length - 1;
2995
+ switch (e.key) {
2996
+ case "Escape":
2997
+ e.preventDefault();
2998
+ onToggle(false);
2999
+ break;
3000
+ case "ArrowUp": {
3001
+ e.preventDefault();
3002
+ focusItem(focusedIndex <= 0 ? lastIndex : focusedIndex - 1);
3003
+ break;
3004
+ }
3005
+ case "ArrowDown": {
3006
+ e.preventDefault();
3007
+ focusItem(focusedIndex >= lastIndex ? 0 : focusedIndex + 1);
3008
+ break;
3009
+ }
3010
+ case "Tab": {
3011
+ e.preventDefault();
3012
+ if (e.shiftKey) {
3013
+ focusItem(focusedIndex <= 0 ? lastIndex : focusedIndex - 1);
3014
+ } else {
3015
+ focusItem(focusedIndex >= lastIndex ? 0 : focusedIndex + 1);
3016
+ }
3017
+ break;
3018
+ }
3019
+ }
3020
+ },
3021
+ [expanded, focusedIndex, items.length, focusItem, onToggle]
3022
+ );
3023
+ return /* @__PURE__ */ jsxs(LazyMotion, { features: domMax, strict: true, children: [
3024
+ expanded && closeOnBackdropClick && /* @__PURE__ */ jsx(
3025
+ "div",
3026
+ {
3027
+ "aria-hidden": "true",
3028
+ className: "fixed inset-0 z-40",
3029
+ onClick: () => onToggle(false)
3030
+ }
3031
+ ),
3032
+ /* @__PURE__ */ jsxs(
3033
+ "div",
3034
+ {
3035
+ role: "group",
3036
+ "aria-label": ariaLabel != null ? ariaLabel : "Actions menu",
3037
+ className: cn(
3038
+ "fixed z-50 flex flex-col gap-2",
3039
+ ALIGNMENT_CONTAINER_CLASSES[alignment],
3040
+ "*:shrink-0",
3041
+ className
3042
+ ),
3043
+ onKeyDown: handleMenuKeyDown,
3044
+ children: [
3045
+ /* @__PURE__ */ jsx(AnimatePresence, { children: expanded && /* @__PURE__ */ jsx(
3046
+ m.div,
3047
+ {
3048
+ id: menuId,
3049
+ role: "menu",
3050
+ "aria-labelledby": fabId,
3051
+ "aria-orientation": "vertical",
3052
+ variants: MENU_CONTAINER_VARIANTS,
3053
+ initial: "closed",
3054
+ animate: "open",
3055
+ exit: "closed",
3056
+ className: cn(
3057
+ "flex flex-col-reverse gap-2",
3058
+ ALIGNMENT_ITEMS_CLASSES[alignment]
3059
+ ),
3060
+ children: reversedItems.map((item, reversedIndex) => {
3061
+ var _a;
3062
+ const originalIndex = items.length - 1 - reversedIndex;
3063
+ return /* @__PURE__ */ jsx(
3064
+ m.div,
3065
+ {
3066
+ variants: MENU_ITEM_VARIANTS,
3067
+ style: {
3068
+ transformOrigin: (_a = ALIGNMENT_TRANSFORM_ORIGIN[alignment]) != null ? _a : "right"
3069
+ },
3070
+ ref: (el) => {
3071
+ itemRefs.current[originalIndex] = el;
3072
+ },
3073
+ children: /* @__PURE__ */ jsx(
3074
+ FABMenuItem,
3075
+ {
3076
+ icon: item.icon,
3077
+ label: item.label,
3078
+ onClick: () => {
3079
+ if (!item.disabled) {
3080
+ item.onClick();
3081
+ onToggle(false);
3082
+ }
3083
+ },
3084
+ disabled: item.disabled,
3085
+ colorVariant,
3086
+ className: item.className,
3087
+ tabIndex: expanded ? 0 : -1
3088
+ }
3089
+ )
3090
+ },
3091
+ item.id
3092
+ );
3093
+ })
3094
+ }
3095
+ ) }),
3096
+ /* @__PURE__ */ jsx(
3097
+ ToggleFAB,
3098
+ {
3099
+ ref: toggleRef,
3100
+ id: fabId,
3101
+ expanded,
3102
+ onToggle,
3103
+ colorVariant,
3104
+ fabSize,
3105
+ "aria-label": ariaLabel != null ? ariaLabel : expanded ? "Close actions menu" : "Open actions menu",
3106
+ "aria-controls": menuId,
3107
+ icon: defaultFabIcon
3108
+ }
3109
+ )
3110
+ ]
3111
+ }
3112
+ )
3113
+ ] });
3114
+ }
3115
+ var SIZE_STYLES2 = {
3116
+ xs: "h-8 w-8",
3117
+ sm: "h-10 w-10",
3118
+ md: "h-14 w-14",
3119
+ lg: "h-24 w-24",
3120
+ xl: "h-[8.5rem] w-[8.5rem]"
3121
+ };
3122
+ var SIZE_ICON3 = {
3123
+ xs: { cls: "size-5", px: 20 },
3124
+ sm: { cls: "size-6", px: 24 },
3125
+ md: { cls: "size-6", px: 24 },
3126
+ lg: { cls: "size-8", px: 32 },
3127
+ xl: { cls: "size-10", px: 40 }
3128
+ };
3129
+ var RADIUS_MAP = {
3130
+ xs: {
3131
+ round: 16,
3132
+ square: 12,
3133
+ pressed: 8,
3134
+ selectedRound: 12,
3135
+ selectedSquare: 16
3136
+ },
3137
+ sm: {
3138
+ round: 20,
3139
+ square: 12,
3140
+ pressed: 8,
3141
+ selectedRound: 12,
3142
+ selectedSquare: 20
3143
+ },
3144
+ md: {
3145
+ round: 28,
3146
+ square: 16,
3147
+ pressed: 12,
3148
+ selectedRound: 16,
3149
+ selectedSquare: 28
3150
+ },
3151
+ lg: {
3152
+ round: 48,
3153
+ square: 28,
3154
+ pressed: 16,
3155
+ selectedRound: 28,
3156
+ selectedSquare: 48
3157
+ },
3158
+ xl: {
3159
+ round: 68,
3160
+ square: 28,
3161
+ pressed: 16,
3162
+ selectedRound: 28,
3163
+ selectedSquare: 68
3164
+ }
3165
+ };
3166
+ var SIZE_OUTLINE_WIDTH = {
3167
+ xs: "border",
3168
+ sm: "border",
3169
+ md: "border",
3170
+ lg: "border-2",
3171
+ xl: "border-[3px]"
3172
+ };
3173
+ var colorStyles = {
3174
+ standard: {
3175
+ default: "text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
3176
+ selected: "text-m3-primary hover:bg-m3-primary/8 active:bg-m3-primary/12"
3177
+ },
3178
+ filled: {
3179
+ default: "bg-m3-surface-container text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
3180
+ selected: "bg-m3-primary text-m3-on-primary hover:brightness-95 active:brightness-90"
3181
+ },
3182
+ tonal: {
3183
+ default: "bg-m3-secondary-container text-m3-on-secondary-container hover:bg-m3-on-secondary-container/8 active:bg-m3-on-secondary-container/12",
3184
+ selected: "bg-m3-secondary text-m3-on-secondary hover:brightness-95 active:brightness-90"
3185
+ },
3186
+ outlined: {
3187
+ default: "border-m3-outline-variant text-m3-on-surface-variant hover:bg-m3-on-surface-variant/8 active:bg-m3-on-surface-variant/12",
3188
+ selected: "bg-m3-inverse-surface text-m3-inverse-on-surface border-transparent hover:brightness-95 active:brightness-90"
3189
+ }
3190
+ };
3191
+ var baseIconButtonClasses = [
3192
+ "relative shrink-0 inline-flex items-center justify-center",
3193
+ "select-none cursor-pointer",
3194
+ "transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200",
3195
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
3196
+ "disabled:pointer-events-none disabled:opacity-[0.38]"
3197
+ ];
3198
+ function resolveAnimateRadius(radiusConfig, shape, isToggle, isSelected) {
3199
+ if (isToggle && isSelected) {
3200
+ return shape === "round" ? radiusConfig.selectedRound : radiusConfig.selectedSquare;
3201
+ }
3202
+ return shape === "round" ? radiusConfig.round : radiusConfig.square;
3203
+ }
3204
+ function resolveDisabledBgClass(colorStyle) {
3205
+ if (colorStyle === "filled" || colorStyle === "tonal") {
3206
+ return "disabled:bg-m3-on-surface/12 disabled:text-m3-on-surface/[0.38]";
3207
+ }
3208
+ if (colorStyle === "outlined") {
3209
+ return "disabled:text-m3-on-surface/[0.38] disabled:border-m3-on-surface/[0.12]";
3210
+ }
3211
+ return "disabled:text-m3-on-surface/[0.38]";
3212
+ }
3213
+ var IconButtonComponent = React11.forwardRef(
3214
+ (_a, ref) => {
3215
+ var _b = _a, {
3216
+ className,
3217
+ style,
3218
+ variant = "default",
3219
+ colorStyle = "standard",
3220
+ size = "sm",
3221
+ shape = "round",
3222
+ selected,
3223
+ loading = false,
3224
+ loadingVariant = "loading-indicator",
3225
+ iconSize,
3226
+ children,
3227
+ onClick,
3228
+ onKeyDown,
3229
+ "aria-label": ariaLabel
3230
+ } = _b, restProps = __objRest(_b, [
3231
+ "className",
3232
+ "style",
3233
+ "variant",
3234
+ "colorStyle",
3235
+ "size",
3236
+ "shape",
3237
+ "selected",
3238
+ "loading",
3239
+ "loadingVariant",
3240
+ "iconSize",
3241
+ "children",
3242
+ "onClick",
3243
+ "onKeyDown",
3244
+ "aria-label"
3245
+ ]);
3246
+ var _a2, _b2;
3247
+ const isToggle = variant === "toggle";
3248
+ const isSelected = isToggle && !!selected;
3249
+ const resolvedColorClass = React11.useMemo(
3250
+ () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
3251
+ [isSelected, colorStyle]
3252
+ );
3253
+ const outlineWidthClass = React11.useMemo(
3254
+ () => {
3255
+ var _a3;
3256
+ return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
3257
+ },
3258
+ [colorStyle, isSelected, size]
3259
+ );
3260
+ const disabledBgClass = React11.useMemo(
3261
+ () => resolveDisabledBgClass(colorStyle),
3262
+ [colorStyle]
3263
+ );
3264
+ const radiusConfig = (_a2 = RADIUS_MAP[size]) != null ? _a2 : RADIUS_MAP.sm;
3265
+ const animateRadius = resolveAnimateRadius(
3266
+ radiusConfig,
3267
+ shape,
3268
+ isToggle,
3269
+ isSelected
3270
+ );
3271
+ const pressedRadius = radiusConfig.pressed;
3272
+ const sizeIcon = (_b2 = SIZE_ICON3[size]) != null ? _b2 : SIZE_ICON3.sm;
3273
+ const iconClass = sizeIcon.cls;
3274
+ const defaultIconPx = sizeIcon.px;
3275
+ const iconPx = iconSize != null ? iconSize : defaultIconPx;
3276
+ const isCustomSize = iconSize != null && iconSize !== "inherit";
3277
+ const needsTouchTarget = size === "xs" || size === "sm";
3278
+ const { ripples, onPointerDown, removeRipple } = useRippleState({
3279
+ disabled: loading
3280
+ });
3281
+ const handleClick = React11.useCallback(
3282
+ (e) => {
3283
+ if (loading) {
3284
+ e.preventDefault();
3285
+ return;
3286
+ }
3287
+ onClick == null ? void 0 : onClick(e);
3288
+ },
3289
+ [loading, onClick]
3290
+ );
3291
+ const handleKeyDown = React11.useCallback(
3292
+ (e) => {
3293
+ if (loading) return;
3294
+ if ((e.key === "Enter" || e.key === " ") && onClick) {
3295
+ e.preventDefault();
3296
+ e.currentTarget.click();
3297
+ }
3298
+ onKeyDown == null ? void 0 : onKeyDown(e);
3299
+ },
3300
+ [loading, onClick, onKeyDown]
3301
+ );
3302
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
3303
+ m.button,
3304
+ __spreadProps(__spreadValues({
3305
+ ref,
3306
+ type: "button",
3307
+ "aria-pressed": isToggle ? isSelected : void 0,
3308
+ "aria-label": ariaLabel,
3309
+ "aria-busy": loading || void 0,
3310
+ "aria-disabled": loading || restProps.disabled,
3311
+ onClick: handleClick,
3312
+ onPointerDown,
3313
+ onKeyDown: handleKeyDown,
3314
+ style,
3315
+ animate: { borderRadius: animateRadius },
3316
+ whileTap: { borderRadius: pressedRadius },
3317
+ transition: { borderRadius: SPRING_TRANSITION_FAST },
3318
+ className: cn(
3319
+ baseIconButtonClasses,
3320
+ resolvedColorClass,
3321
+ outlineWidthClass,
3322
+ disabledBgClass,
3323
+ "overflow-hidden",
3324
+ SIZE_STYLES2[size],
3325
+ loading && "pointer-events-none opacity-75 cursor-not-allowed",
3326
+ className
3327
+ )
3328
+ }, restProps), {
3329
+ children: [
3330
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
3331
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
3332
+ /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", initial: false, children: loading ? /* @__PURE__ */ jsx(
3333
+ m.span,
3334
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
3335
+ transition: SPRING_TRANSITION,
3336
+ className: cn(
3337
+ "flex items-center justify-center shrink-0",
3338
+ iconSize != null ? void 0 : iconClass
3339
+ ),
3340
+ style: isCustomSize ? { width: `${iconSize}px`, height: `${iconSize}px` } : void 0,
3341
+ children: loadingVariant === "loading-indicator" ? /* @__PURE__ */ jsx(
3342
+ LoadingIndicator,
3343
+ {
3344
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
3345
+ color: "currentColor",
3346
+ "aria-label": "Loading"
3347
+ }
3348
+ ) : /* @__PURE__ */ jsx(
3349
+ ProgressIndicator,
3350
+ {
3351
+ variant: "circular",
3352
+ size: typeof iconPx === "number" ? iconPx : defaultIconPx,
3353
+ color: "currentColor",
3354
+ trackColor: "transparent",
3355
+ "aria-label": "Loading"
3356
+ }
3357
+ )
3358
+ }),
3359
+ "loading"
3360
+ ) : /* @__PURE__ */ jsx(
3361
+ m.span,
3362
+ __spreadProps(__spreadValues({}, ICON_SPAN_VARIANTS), {
3363
+ transition: SPRING_TRANSITION,
3364
+ "aria-hidden": "true",
3365
+ className: cn(
3366
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
3367
+ iconSize != null ? void 0 : iconClass
3368
+ ),
3369
+ style: {
3370
+ fontSize: typeof iconPx === "number" ? `${iconPx}px` : iconPx,
3371
+ width: isCustomSize ? `${iconSize}px` : void 0,
3372
+ height: isCustomSize ? `${iconSize}px` : void 0
3373
+ },
3374
+ children
3375
+ }),
3376
+ "content"
3377
+ ) })
3378
+ ]
3379
+ })
3380
+ ) });
3381
+ }
3382
+ );
3383
+ IconButtonComponent.displayName = "IconButton";
3384
+ var IconButton = React11.memo(IconButtonComponent);
3385
+ var SplitButtonContext = React11.createContext(null);
3386
+ function useSplitButtonContext() {
3387
+ return React11.useContext(SplitButtonContext);
3388
+ }
3389
+ var SplitButtonLayoutComponent = React11.forwardRef(
3390
+ (_a, ref) => {
3391
+ var _b = _a, {
3392
+ leadingButton,
3393
+ trailingButton,
3394
+ className,
3395
+ spacing = 2,
3396
+ variant: layoutVariant,
3397
+ size: layoutSize
3398
+ } = _b, restProps = __objRest(_b, [
3399
+ "leadingButton",
3400
+ "trailingButton",
3401
+ "className",
3402
+ "spacing",
3403
+ "variant",
3404
+ "size"
3405
+ ]);
3406
+ const leadingProps = React11.isValidElement(leadingButton) ? leadingButton.props : {};
3407
+ const size = layoutSize || leadingProps.size;
3408
+ const variant = layoutVariant || leadingProps.variant;
3409
+ const contextValue = React11.useMemo(
3410
+ () => ({
3411
+ size,
3412
+ variant
3413
+ }),
3414
+ [size, variant]
3415
+ );
3416
+ return /* @__PURE__ */ jsx(SplitButtonContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(
3417
+ "div",
3418
+ __spreadProps(__spreadValues({
3419
+ ref,
3420
+ className: cn(
3421
+ "inline-flex flex-row items-stretch justify-center w-fit shrink-0 relative",
3422
+ className
3423
+ ),
3424
+ style: { gap: `${spacing}px` }
3425
+ }, restProps), {
3426
+ children: [
3427
+ leadingButton,
3428
+ trailingButton
3429
+ ]
3430
+ })
3431
+ ) });
3432
+ }
3433
+ );
3434
+ SplitButtonLayoutComponent.displayName = "SplitButtonLayout";
3435
+ var SplitButtonLayout = React11.memo(SplitButtonLayoutComponent);
3436
+ var StateLayer = React11.forwardRef(
3437
+ (_a, ref) => {
3438
+ var _b = _a, { className, hovered, focused, pressed } = _b, props = __objRest(_b, ["className", "hovered", "focused", "pressed"]);
3439
+ let opacity = 0;
3440
+ if (pressed) {
3441
+ opacity = 0.12;
3442
+ } else if (focused) {
3443
+ opacity = 0.1;
3444
+ } else if (hovered) {
3445
+ opacity = 0.08;
3446
+ }
3447
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
3448
+ m.div,
3449
+ __spreadValues({
3450
+ ref,
3451
+ className: cn(
3452
+ "absolute inset-0 bg-current pointer-events-none rounded-[inherit]",
3453
+ className
3454
+ ),
3455
+ initial: false,
3456
+ animate: { opacity },
3457
+ transition: { duration: 0.2 },
3458
+ "aria-hidden": "true"
3459
+ }, props)
3460
+ ) });
3461
+ }
3462
+ );
3463
+ StateLayer.displayName = "StateLayer";
3464
+ var SPLIT_BUTTON_CHEVRON_SPRING = {
3465
+ type: "spring",
3466
+ stiffness: 200,
3467
+ damping: 20,
3468
+ mass: 1
3469
+ };
3470
+ var SPLIT_BUTTON_RADIUS_SPRING = FAST_EFFECTS_SPRING;
3471
+ var SPLIT_BUTTON_TOKENS = {
3472
+ xs: {
3473
+ containerHeight: 32,
3474
+ // XSmallTokens: ContainerHeight = 32.0.dp
3475
+ betweenSpace: 2,
3476
+ // XSmallTokens: BetweenSpace = 2.0.dp
3477
+ innerCorner: {
3478
+ default: cornerRadius.extraSmall,
3479
+ // 4dp
3480
+ hovered: cornerRadius.small,
3481
+ // 8dp
3482
+ pressed: cornerRadius.small
3483
+ // 8dp
3484
+ },
3485
+ outerCornerPercent: 50,
3486
+ // XSmallTokens: OuterCornerCornerSizePercent = 50.0f → full pill
3487
+ leadingPadding: {
3488
+ start: 12,
3489
+ // XSmallTokens: LeadingButtonLeadingSpace = 12.0.dp
3490
+ end: 10
3491
+ // XSmallTokens: LeadingButtonTrailingSpace = 10.0.dp
3492
+ },
3493
+ trailingPadding: {
3494
+ start: 13,
3495
+ // XSmallTokens: TrailingButtonLeadingSpace = 13.0.dp
3496
+ end: 13
3497
+ // XSmallTokens: TrailingButtonTrailingSpace = 13.0.dp
3498
+ },
3499
+ trailingIconSize: 22,
3500
+ // XSmallTokens: TrailingIconSize = 22.0.dp
3501
+ opticalCenterOffset: -1
3502
+ // Spec: XS = -1dp from center
3503
+ },
3504
+ sm: {
3505
+ containerHeight: 40,
3506
+ // SmallTokens: ContainerHeight = 40.0.dp
3507
+ betweenSpace: 2,
3508
+ // SmallTokens: BetweenSpace = 2.0.dp
3509
+ innerCorner: {
3510
+ default: cornerRadius.extraSmall,
3511
+ // 4dp
3512
+ hovered: cornerRadius.medium,
3513
+ // 12dp
3514
+ pressed: cornerRadius.medium
3515
+ // 12dp
3516
+ },
3517
+ outerCornerPercent: 50,
3518
+ leadingPadding: {
3519
+ start: 16,
3520
+ // SmallTokens: LeadingButtonLeadingSpace = 16.0.dp
3521
+ end: 12
3522
+ // SmallTokens: LeadingButtonTrailingSpace = 12.0.dp
3523
+ },
3524
+ trailingPadding: {
3525
+ start: 13,
3526
+ // SmallTokens: TrailingButtonLeadingSpace = 13.0.dp
3527
+ end: 13
3528
+ // SmallTokens: TrailingButtonTrailingSpace = 13.0.dp
3529
+ },
3530
+ trailingIconSize: 22,
3531
+ // SmallTokens: TrailingIconSize = 22.0.dp
3532
+ opticalCenterOffset: -1
3533
+ // Spec: S = -1dp from center
3534
+ },
3535
+ md: {
3536
+ containerHeight: 56,
3537
+ // MediumTokens: ContainerHeight = 56.0.dp
3538
+ betweenSpace: 2,
3539
+ // MediumTokens: BetweenSpace = 2.0.dp
3540
+ innerCorner: {
3541
+ default: cornerRadius.extraSmall,
3542
+ // 4dp
3543
+ hovered: cornerRadius.medium,
3544
+ // 12dp
3545
+ pressed: cornerRadius.medium
3546
+ // 12dp
3547
+ },
3548
+ outerCornerPercent: 50,
3549
+ leadingPadding: {
3550
+ start: 24,
3551
+ // MediumTokens: LeadingButtonLeadingSpace = 24.0.dp
3552
+ end: 24
3553
+ // MediumTokens: LeadingButtonTrailingSpace = 24.0.dp
3554
+ },
3555
+ trailingPadding: {
3556
+ start: 15,
3557
+ // MediumTokens: TrailingButtonLeadingSpace = 15.0.dp
3558
+ end: 15
3559
+ // MediumTokens: TrailingButtonTrailingSpace = 15.0.dp
3560
+ },
3561
+ trailingIconSize: 26,
3562
+ // MediumTokens: TrailingIconSize = 26.0.dp
3563
+ opticalCenterOffset: -2
3564
+ // Spec: M = -2dp from center
3565
+ },
3566
+ lg: {
3567
+ containerHeight: 96,
3568
+ // LargeTokens: ContainerHeight = 96.0.dp
3569
+ betweenSpace: 2,
3570
+ // LargeTokens: BetweenSpace = 2.0.dp
3571
+ innerCorner: {
3572
+ default: cornerRadius.small,
3573
+ // 8dp
3574
+ hovered: 28,
3575
+ // LargeTokens: InnerHoveredCornerCornerSize = CornerValueLargeIncreased (28dp)
3576
+ pressed: 28
3577
+ // LargeTokens: InnerPressedCornerCornerSize = CornerValueLargeIncreased (28dp)
3578
+ },
3579
+ outerCornerPercent: 50,
3580
+ leadingPadding: {
3581
+ start: 48,
3582
+ // LargeTokens: LeadingButtonLeadingSpace = 48.0.dp
3583
+ end: 48
3584
+ // LargeTokens: LeadingButtonTrailingSpace = 48.0.dp
3585
+ },
3586
+ trailingPadding: {
3587
+ start: 29,
3588
+ // LargeTokens: TrailingButtonLeadingSpace = 29.0.dp
3589
+ end: 29
3590
+ // LargeTokens: TrailingButtonTrailingSpace = 29.0.dp
3591
+ },
3592
+ trailingIconSize: 38,
3593
+ // LargeTokens: TrailingIconSize = 38.0.dp
3594
+ opticalCenterOffset: -3
3595
+ // Spec: L = -3dp from center
3596
+ },
3597
+ xl: {
3598
+ containerHeight: 136,
3599
+ // XLargeTokens: ContainerHeight = 136.0.dp
3600
+ betweenSpace: 2,
3601
+ // XLargeTokens: BetweenSpace = 2.0.dp
3602
+ innerCorner: {
3603
+ default: cornerRadius.medium,
3604
+ // 12dp
3605
+ hovered: 28,
3606
+ // XLargeTokens: InnerHoveredCornerCornerSize = CornerValueLargeIncreased (28dp)
3607
+ pressed: 28
3608
+ // XLargeTokens: InnerPressedCornerCornerSize = CornerValueLargeIncreased (28dp)
3609
+ },
3610
+ outerCornerPercent: 50,
3611
+ leadingPadding: {
3612
+ start: 64,
3613
+ // XLargeTokens: LeadingButtonLeadingSpace = 64.0.dp
3614
+ end: 64
3615
+ // XLargeTokens: LeadingButtonTrailingSpace = 64.0.dp
3616
+ },
3617
+ trailingPadding: {
3618
+ start: 43,
3619
+ // XLargeTokens: TrailingButtonLeadingSpace = 43.0.dp
3620
+ end: 43
3621
+ // XLargeTokens: TrailingButtonTrailingSpace = 43.0.dp
3622
+ },
3623
+ trailingIconSize: 50,
3624
+ // XLargeTokens: TrailingIconSize = 50.0.dp
3625
+ opticalCenterOffset: -6
3626
+ // Spec: XL = -6dp from center
3627
+ }
3628
+ };
3629
+ var LEADING_ICON_SIZE_FOR_SIZE = {
3630
+ xs: 18,
3631
+ sm: 20,
3632
+ md: 24,
3633
+ lg: 32,
3634
+ xl: 40
3635
+ };
3636
+ var splitButtonSizeVariants = {
3637
+ xs: "min-h-[32px]",
3638
+ sm: "min-h-[40px]",
3639
+ md: "min-h-[56px]",
3640
+ lg: "min-h-[96px]",
3641
+ xl: "min-h-[136px]"
3642
+ };
3643
+ var splitButtonVariants = cva(
3644
+ "group relative w-fit shrink-0 inline-flex flex-row items-center justify-center whitespace-nowrap select-none cursor-pointer transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary z-10 overflow-hidden",
3645
+ {
3646
+ variants: {
3647
+ variant: {
3648
+ filled: "bg-m3-primary text-m3-on-primary",
3649
+ tonal: "bg-m3-secondary-container text-m3-on-secondary-container",
3650
+ elevated: "bg-m3-surface-container-low text-m3-primary shadow-md hover:shadow-lg",
3651
+ outlined: "bg-transparent text-m3-primary border border-m3-outline"
3652
+ },
3653
+ size: splitButtonSizeVariants,
3654
+ disabled: {
3655
+ true: "pointer-events-none",
3656
+ false: ""
3657
+ }
3658
+ },
3659
+ compoundVariants: [
3660
+ {
3661
+ variant: "filled",
3662
+ disabled: true,
3663
+ className: "bg-m3-on-surface/10 text-m3-on-surface/[0.38]"
3664
+ },
3665
+ {
3666
+ variant: "tonal",
3667
+ disabled: true,
3668
+ className: "bg-m3-on-surface/10 text-m3-on-surface/[0.38]"
3669
+ },
3670
+ {
3671
+ variant: "elevated",
3672
+ disabled: true,
3673
+ className: "bg-m3-on-surface/10 text-m3-on-surface/[0.38] shadow-none"
3674
+ },
3675
+ {
3676
+ variant: "outlined",
3677
+ disabled: true,
3678
+ className: "text-m3-on-surface/[0.38] border-m3-on-surface/[0.12]"
3679
+ }
3680
+ ],
3681
+ defaultVariants: {
3682
+ variant: "filled",
3683
+ size: "sm",
3684
+ disabled: false
3685
+ }
3686
+ }
3687
+ );
3688
+ var SplitButtonLeadingComponent = React11.forwardRef(
3689
+ (_a, ref) => {
3690
+ var _b = _a, {
3691
+ className,
3692
+ style,
3693
+ variant = "filled",
3694
+ size = "sm",
3695
+ icon,
3696
+ children,
3697
+ disabled,
3698
+ onClick,
3699
+ onPointerDown,
3700
+ onPointerUp,
3701
+ onPointerLeave,
3702
+ onPointerCancel,
3703
+ onFocus,
3704
+ onBlur
3705
+ } = _b, restProps = __objRest(_b, [
3706
+ "className",
3707
+ "style",
3708
+ "variant",
3709
+ "size",
3710
+ "icon",
3711
+ "children",
3712
+ "disabled",
3713
+ "onClick",
3714
+ "onPointerDown",
3715
+ "onPointerUp",
3716
+ "onPointerLeave",
3717
+ "onPointerCancel",
3718
+ "onFocus",
3719
+ "onBlur"
3720
+ ]);
3721
+ var _a2, _b2, _c;
3722
+ const context = useSplitButtonContext();
3723
+ const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
3724
+ const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
3725
+ const [isHovered, setIsHovered] = React11.useState(false);
3726
+ const [isFocused, setIsFocused] = React11.useState(false);
3727
+ const [isPressed, setIsPressed] = React11.useState(false);
3728
+ const tokens = SPLIT_BUTTON_TOKENS[actualSize];
3729
+ const typographyClass = (_c = BUTTON_TYPOGRAPHY_TOKENS[actualSize]) != null ? _c : BUTTON_TYPOGRAPHY_TOKENS.sm;
3730
+ const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
3731
+ const {
3732
+ ripples,
3733
+ onPointerDown: onRipplePointerDown,
3734
+ removeRipple
3735
+ } = useRippleState({ disabled });
3736
+ const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
3737
+ const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
3738
+ const borderRadius = `${outerRadius}px ${innerCornerRadius}px ${innerCornerRadius}px ${outerRadius}px`;
3739
+ const handleClick = React11.useCallback(
3740
+ (e) => {
3741
+ if (disabled) {
3742
+ e.preventDefault();
3743
+ return;
3744
+ }
3745
+ onClick == null ? void 0 : onClick(e);
3746
+ },
3747
+ [disabled, onClick]
3748
+ );
3749
+ const handlePointerDown = React11.useCallback(
3750
+ (e) => {
3751
+ onRipplePointerDown(e);
3752
+ setIsPressed(true);
3753
+ onPointerDown == null ? void 0 : onPointerDown(e);
3754
+ },
3755
+ [onRipplePointerDown, onPointerDown]
3756
+ );
3757
+ const handlePointerUp = React11.useCallback(
3758
+ (e) => {
3759
+ setIsPressed(false);
3760
+ onPointerUp == null ? void 0 : onPointerUp(e);
3761
+ },
3762
+ [onPointerUp]
3763
+ );
3764
+ const handlePointerEnter = React11.useCallback(() => {
3765
+ if (!disabled) {
3766
+ setIsHovered(true);
3767
+ }
3768
+ }, [disabled]);
3769
+ const handlePointerLeave = React11.useCallback(
3770
+ (e) => {
3771
+ setIsHovered(false);
3772
+ setIsPressed(false);
3773
+ onPointerLeave == null ? void 0 : onPointerLeave(e);
3774
+ },
3775
+ [onPointerLeave]
3776
+ );
3777
+ const handlePointerCancel = React11.useCallback(
3778
+ (e) => {
3779
+ setIsPressed(false);
3780
+ onPointerCancel == null ? void 0 : onPointerCancel(e);
3781
+ },
3782
+ [onPointerCancel]
3783
+ );
3784
+ const handleFocus = React11.useCallback(
3785
+ (e) => {
3786
+ if (!disabled) setIsFocused(true);
3787
+ onFocus == null ? void 0 : onFocus(e);
3788
+ },
3789
+ [disabled, onFocus]
3790
+ );
3791
+ const handleBlur = React11.useCallback(
3792
+ (e) => {
3793
+ setIsFocused(false);
3794
+ onBlur == null ? void 0 : onBlur(e);
3795
+ },
3796
+ [onBlur]
3797
+ );
3798
+ const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
3799
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
3800
+ m.button,
3801
+ __spreadProps(__spreadValues({
3802
+ ref,
3803
+ type: "button",
3804
+ "aria-disabled": disabled,
3805
+ disabled,
3806
+ onClick: handleClick,
3807
+ onPointerDown: handlePointerDown,
3808
+ onPointerUp: handlePointerUp,
3809
+ onPointerEnter: handlePointerEnter,
3810
+ onPointerLeave: handlePointerLeave,
3811
+ onPointerCancel: handlePointerCancel,
3812
+ onFocus: handleFocus,
3813
+ onBlur: handleBlur,
3814
+ animate: { borderRadius },
3815
+ transition: SPLIT_BUTTON_RADIUS_SPRING,
3816
+ style: __spreadValues({
3817
+ paddingInlineStart: tokens.leadingPadding.start,
3818
+ paddingInlineEnd: tokens.leadingPadding.end,
3819
+ gap: "8px"
3820
+ }, style),
3821
+ className: cn(
3822
+ splitButtonVariants({
3823
+ variant: actualVariant,
3824
+ size: actualSize,
3825
+ disabled
3826
+ }),
3827
+ typographyClass,
3828
+ className
3829
+ )
3830
+ }, restProps), {
3831
+ children: [
3832
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
3833
+ /* @__PURE__ */ jsx(
3834
+ StateLayer,
3835
+ {
3836
+ hovered: isHovered,
3837
+ focused: isFocused,
3838
+ pressed: isPressed
3839
+ }
3840
+ ),
3841
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
3842
+ icon && /* @__PURE__ */ jsx(
3843
+ "span",
3844
+ {
3845
+ className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full overflow-hidden [&_.md-icon]:text-[length:inherit]!",
3846
+ style: {
3847
+ fontSize: leadingIconSize,
3848
+ width: leadingIconSize,
3849
+ height: leadingIconSize
3850
+ },
3851
+ children: icon
3852
+ }
3853
+ ),
3854
+ children && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children })
3855
+ ]
3856
+ })
3857
+ ) });
3858
+ }
3859
+ );
3860
+ SplitButtonLeadingComponent.displayName = "SplitButtonLeading";
3861
+ var SplitButtonLeading = React11.memo(SplitButtonLeadingComponent);
3862
+ var FilledSplitButtonLeading = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "filled" }, props)));
3863
+ FilledSplitButtonLeading.displayName = "FilledSplitButtonLeading";
3864
+ var TonalSplitButtonLeading = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "tonal" }, props)));
3865
+ TonalSplitButtonLeading.displayName = "TonalSplitButtonLeading";
3866
+ var ElevatedSplitButtonLeading = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "elevated" }, props)));
3867
+ ElevatedSplitButtonLeading.displayName = "ElevatedSplitButtonLeading";
3868
+ var OutlinedSplitButtonLeading = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "outlined" }, props)));
3869
+ OutlinedSplitButtonLeading.displayName = "OutlinedSplitButtonLeading";
3870
+ var SplitButtonTrailingComponent = React11.forwardRef(
3871
+ (_a, ref) => {
3872
+ var _b = _a, {
3873
+ className,
3874
+ style,
3875
+ variant = "filled",
3876
+ size = "sm",
3877
+ checked,
3878
+ onCheckedChange,
3879
+ icon,
3880
+ disabled,
3881
+ onPointerDown,
3882
+ onPointerUp,
3883
+ onPointerLeave,
3884
+ onPointerCancel,
3885
+ onFocus,
3886
+ onBlur,
3887
+ "aria-label": ariaLabel
3888
+ } = _b, restProps = __objRest(_b, [
3889
+ "className",
3890
+ "style",
3891
+ "variant",
3892
+ "size",
3893
+ "checked",
3894
+ "onCheckedChange",
3895
+ "icon",
3896
+ "disabled",
3897
+ "onPointerDown",
3898
+ "onPointerUp",
3899
+ "onPointerLeave",
3900
+ "onPointerCancel",
3901
+ "onFocus",
3902
+ "onBlur",
3903
+ "aria-label"
3904
+ ]);
3905
+ var _a2, _b2;
3906
+ const context = useSplitButtonContext();
3907
+ const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
3908
+ const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
3909
+ const [isHovered, setIsHovered] = React11.useState(false);
3910
+ const [isFocused, setIsFocused] = React11.useState(false);
3911
+ const [isPressed, setIsPressed] = React11.useState(false);
3912
+ const tokens = SPLIT_BUTTON_TOKENS[actualSize];
3913
+ const prefersReducedMotion = useReducedMotion();
3914
+ const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
3915
+ const {
3916
+ ripples,
3917
+ onPointerDown: onRipplePointerDown,
3918
+ removeRipple
3919
+ } = useRippleState({ disabled });
3920
+ const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
3921
+ const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
3922
+ const borderRadius = checked ? `${outerRadius}px ${outerRadius}px ${outerRadius}px ${outerRadius}px` : `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
3923
+ const handleToggle = React11.useCallback(() => {
3924
+ if (!disabled) {
3925
+ onCheckedChange(!checked);
3926
+ }
3927
+ }, [disabled, checked, onCheckedChange]);
3928
+ const handlePointerDown = React11.useCallback(
3929
+ (e) => {
3930
+ onRipplePointerDown(e);
3931
+ setIsPressed(true);
3932
+ onPointerDown == null ? void 0 : onPointerDown(e);
3933
+ },
3934
+ [onRipplePointerDown, onPointerDown]
3935
+ );
3936
+ const handlePointerUp = React11.useCallback(
3937
+ (e) => {
3938
+ setIsPressed(false);
3939
+ onPointerUp == null ? void 0 : onPointerUp(e);
3940
+ },
3941
+ [onPointerUp]
3942
+ );
3943
+ const handlePointerEnter = React11.useCallback(() => {
3944
+ if (!disabled) {
3945
+ setIsHovered(true);
3946
+ }
3947
+ }, [disabled]);
3948
+ const handlePointerLeave = React11.useCallback(
3949
+ (e) => {
3950
+ setIsHovered(false);
3951
+ setIsPressed(false);
3952
+ onPointerLeave == null ? void 0 : onPointerLeave(e);
3953
+ },
3954
+ [onPointerLeave]
3955
+ );
3956
+ const handlePointerCancel = React11.useCallback(
3957
+ (e) => {
3958
+ setIsPressed(false);
3959
+ onPointerCancel == null ? void 0 : onPointerCancel(e);
3960
+ },
3961
+ [onPointerCancel]
3962
+ );
3963
+ const handleFocus = React11.useCallback(
3964
+ (e) => {
3965
+ if (!disabled) setIsFocused(true);
3966
+ onFocus == null ? void 0 : onFocus(e);
3967
+ },
3968
+ [disabled, onFocus]
3969
+ );
3970
+ const handleBlur = React11.useCallback(
3971
+ (e) => {
3972
+ setIsFocused(false);
3973
+ onBlur == null ? void 0 : onBlur(e);
3974
+ },
3975
+ [onBlur]
3976
+ );
3977
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
3978
+ m.button,
3979
+ __spreadProps(__spreadValues({
3980
+ ref,
3981
+ type: "button",
3982
+ "aria-pressed": checked,
3983
+ "aria-expanded": checked,
3984
+ "aria-label": ariaLabel,
3985
+ disabled,
3986
+ onClick: handleToggle,
3987
+ onPointerDown: handlePointerDown,
3988
+ onPointerUp: handlePointerUp,
3989
+ onPointerEnter: handlePointerEnter,
3990
+ onPointerLeave: handlePointerLeave,
3991
+ onPointerCancel: handlePointerCancel,
3992
+ onFocus: handleFocus,
3993
+ onBlur: handleBlur,
3994
+ animate: { borderRadius },
3995
+ transition: SPLIT_BUTTON_RADIUS_SPRING,
3996
+ style: __spreadValues({
3997
+ paddingInlineStart: tokens.trailingPadding.start,
3998
+ paddingInlineEnd: tokens.trailingPadding.end
3999
+ }, style),
4000
+ className: cn(
4001
+ splitButtonVariants({
4002
+ variant: actualVariant,
4003
+ size: actualSize,
4004
+ disabled
4005
+ }),
4006
+ className
4007
+ )
4008
+ }, restProps), {
4009
+ children: [
4010
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
4011
+ /* @__PURE__ */ jsx(
4012
+ StateLayer,
4013
+ {
4014
+ hovered: isHovered,
4015
+ focused: isFocused,
4016
+ pressed: isPressed
4017
+ }
4018
+ ),
4019
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4020
+ /* @__PURE__ */ jsx(
4021
+ m.div,
4022
+ {
4023
+ animate: {
4024
+ rotate: checked ? 180 : 0,
4025
+ x: checked ? 0 : tokens.opticalCenterOffset
4026
+ },
4027
+ transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
4028
+ className: "flex items-center justify-center shrink-0",
4029
+ children: icon != null ? icon : /* @__PURE__ */ jsx(
4030
+ Icon,
4031
+ {
4032
+ name: "arrow_drop_down",
4033
+ size: tokens.trailingIconSize,
4034
+ opticalSize: 24
4035
+ }
4036
+ )
4037
+ }
4038
+ )
4039
+ ]
4040
+ })
4041
+ ) });
4042
+ }
4043
+ );
4044
+ SplitButtonTrailingComponent.displayName = "SplitButtonTrailing";
4045
+ var SplitButtonTrailing = React11.memo(SplitButtonTrailingComponent);
4046
+ var FilledSplitButtonTrailing = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "filled" }, props)));
4047
+ FilledSplitButtonTrailing.displayName = "FilledSplitButtonTrailing";
4048
+ var TonalSplitButtonTrailing = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "tonal" }, props)));
4049
+ TonalSplitButtonTrailing.displayName = "TonalSplitButtonTrailing";
4050
+ var ElevatedSplitButtonTrailing = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "elevated" }, props)));
4051
+ ElevatedSplitButtonTrailing.displayName = "ElevatedSplitButtonTrailing";
4052
+ var OutlinedSplitButtonTrailing = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "outlined" }, props)));
4053
+ OutlinedSplitButtonTrailing.displayName = "OutlinedSplitButtonTrailing";
4054
+ var SplitButtonTrailingUncheckableComponent = React11.forwardRef(
4055
+ (_a, ref) => {
4056
+ var _b = _a, {
4057
+ className,
4058
+ style,
4059
+ variant = "filled",
4060
+ size = "sm",
4061
+ icon,
4062
+ disabled,
4063
+ onClick,
4064
+ onPointerDown,
4065
+ onPointerUp,
4066
+ onPointerLeave,
4067
+ onPointerCancel,
4068
+ onFocus,
4069
+ onBlur,
4070
+ "aria-label": ariaLabel
4071
+ } = _b, restProps = __objRest(_b, [
4072
+ "className",
4073
+ "style",
4074
+ "variant",
4075
+ "size",
4076
+ "icon",
4077
+ "disabled",
4078
+ "onClick",
4079
+ "onPointerDown",
4080
+ "onPointerUp",
4081
+ "onPointerLeave",
4082
+ "onPointerCancel",
4083
+ "onFocus",
4084
+ "onBlur",
4085
+ "aria-label"
4086
+ ]);
4087
+ var _a2, _b2;
4088
+ const context = useSplitButtonContext();
4089
+ const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
4090
+ const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
4091
+ const [isHovered, setIsHovered] = React11.useState(false);
4092
+ const [isFocused, setIsFocused] = React11.useState(false);
4093
+ const [isPressed, setIsPressed] = React11.useState(false);
4094
+ const tokens = SPLIT_BUTTON_TOKENS[actualSize];
4095
+ const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
4096
+ const {
4097
+ ripples,
4098
+ onPointerDown: onRipplePointerDown,
4099
+ removeRipple
4100
+ } = useRippleState({ disabled });
4101
+ const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
4102
+ const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
4103
+ const borderRadius = `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
4104
+ const handlePointerDown = React11.useCallback(
4105
+ (e) => {
4106
+ onRipplePointerDown(e);
4107
+ setIsPressed(true);
4108
+ onPointerDown == null ? void 0 : onPointerDown(e);
4109
+ },
4110
+ [onRipplePointerDown, onPointerDown]
4111
+ );
4112
+ const handlePointerUp = React11.useCallback(
4113
+ (e) => {
4114
+ setIsPressed(false);
4115
+ onPointerUp == null ? void 0 : onPointerUp(e);
4116
+ },
4117
+ [onPointerUp]
4118
+ );
4119
+ const handlePointerEnter = React11.useCallback(() => {
4120
+ if (!disabled) {
4121
+ setIsHovered(true);
4122
+ }
4123
+ }, [disabled]);
4124
+ const handlePointerLeave = React11.useCallback(
4125
+ (e) => {
4126
+ setIsHovered(false);
4127
+ setIsPressed(false);
4128
+ onPointerLeave == null ? void 0 : onPointerLeave(e);
4129
+ },
4130
+ [onPointerLeave]
4131
+ );
4132
+ const handlePointerCancel = React11.useCallback(
4133
+ (e) => {
4134
+ setIsPressed(false);
4135
+ onPointerCancel == null ? void 0 : onPointerCancel(e);
4136
+ },
4137
+ [onPointerCancel]
4138
+ );
4139
+ const handleFocus = React11.useCallback(
4140
+ (e) => {
4141
+ if (!disabled) setIsFocused(true);
4142
+ onFocus == null ? void 0 : onFocus(e);
4143
+ },
4144
+ [disabled, onFocus]
4145
+ );
4146
+ const handleBlur = React11.useCallback(
4147
+ (e) => {
4148
+ setIsFocused(false);
4149
+ onBlur == null ? void 0 : onBlur(e);
4150
+ },
4151
+ [onBlur]
4152
+ );
4153
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
4154
+ m.button,
4155
+ __spreadProps(__spreadValues({
4156
+ ref,
4157
+ type: "button",
4158
+ "aria-label": ariaLabel,
4159
+ disabled,
4160
+ onClick,
4161
+ onPointerDown: handlePointerDown,
4162
+ onPointerUp: handlePointerUp,
4163
+ onPointerEnter: handlePointerEnter,
4164
+ onPointerLeave: handlePointerLeave,
4165
+ onPointerCancel: handlePointerCancel,
4166
+ onFocus: handleFocus,
4167
+ onBlur: handleBlur,
4168
+ animate: { borderRadius },
4169
+ transition: SPLIT_BUTTON_RADIUS_SPRING,
4170
+ style: __spreadValues({
4171
+ paddingInlineStart: tokens.trailingPadding.start,
4172
+ paddingInlineEnd: tokens.trailingPadding.end
4173
+ }, style),
4174
+ className: cn(
4175
+ splitButtonVariants({
4176
+ variant: actualVariant,
4177
+ size: actualSize,
4178
+ disabled
4179
+ }),
4180
+ className
4181
+ )
4182
+ }, restProps), {
4183
+ children: [
4184
+ needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
4185
+ /* @__PURE__ */ jsx(
4186
+ StateLayer,
4187
+ {
4188
+ hovered: isHovered,
4189
+ focused: isFocused,
4190
+ pressed: isPressed
4191
+ }
4192
+ ),
4193
+ /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
4194
+ /* @__PURE__ */ jsx(
4195
+ m.div,
4196
+ {
4197
+ animate: { x: tokens.opticalCenterOffset },
4198
+ transition: SPLIT_BUTTON_RADIUS_SPRING,
4199
+ className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
4200
+ style: {
4201
+ width: tokens.trailingIconSize,
4202
+ height: tokens.trailingIconSize
4203
+ },
4204
+ children: icon
4205
+ }
4206
+ )
4207
+ ]
4208
+ })
4209
+ ) });
4210
+ }
4211
+ );
4212
+ SplitButtonTrailingUncheckableComponent.displayName = "SplitButtonTrailingUncheckable";
4213
+ var SplitButtonTrailingUncheckable = React11.memo(
4214
+ SplitButtonTrailingUncheckableComponent
4215
+ );
4216
+ var FilledSplitButtonTrailingUncheckable = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "filled" }, props)));
4217
+ FilledSplitButtonTrailingUncheckable.displayName = "FilledSplitButtonTrailingUncheckable";
4218
+ var TonalSplitButtonTrailingUncheckable = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "tonal" }, props)));
4219
+ TonalSplitButtonTrailingUncheckable.displayName = "TonalSplitButtonTrailingUncheckable";
4220
+ var ElevatedSplitButtonTrailingUncheckable = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "elevated" }, props)));
4221
+ ElevatedSplitButtonTrailingUncheckable.displayName = "ElevatedSplitButtonTrailingUncheckable";
4222
+ var OutlinedSplitButtonTrailingUncheckable = React11.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "outlined" }, props)));
4223
+ OutlinedSplitButtonTrailingUncheckable.displayName = "OutlinedSplitButtonTrailingUncheckable";
4224
+
4225
+ export { BUTTON_COLOR_TOKENS, BUTTON_GROUP_TOKENS, BUTTON_SIZE_TOKENS, Button, ButtonGroup, ButtonGroupDefaults, ElevatedSplitButtonLeading, ElevatedSplitButtonTrailing, ElevatedSplitButtonTrailingUncheckable, ExtendedFAB, FAB, FABMenu, FABMenuItem, FABPosition, FilledSplitButtonLeading, FilledSplitButtonTrailing, FilledSplitButtonTrailingUncheckable, IconButton, LEADING_ICON_SIZE_FOR_SIZE, OutlinedSplitButtonLeading, OutlinedSplitButtonTrailing, OutlinedSplitButtonTrailingUncheckable, SPLIT_BUTTON_CHEVRON_SPRING, SPLIT_BUTTON_RADIUS_SPRING, SPLIT_BUTTON_TOKENS, SplitButtonLayout, SplitButtonLeading, SplitButtonTrailing, SplitButtonTrailingUncheckable, ToggleFAB, TonalSplitButtonLeading, TonalSplitButtonTrailing, TonalSplitButtonTrailingUncheckable, splitButtonVariants };
4226
+ //# sourceMappingURL=buttons.mjs.map
4227
+ //# sourceMappingURL=buttons.mjs.map