@bug-on/m3-expressive 1.2.1 → 1.2.2

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 (48) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/buttons.d.mts +26 -5
  3. package/dist/buttons.d.ts +26 -5
  4. package/dist/buttons.js +581 -345
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +573 -345
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core.js +52 -13
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.mjs +52 -13
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/feedback.js +52 -13
  13. package/dist/feedback.js.map +1 -1
  14. package/dist/feedback.mjs +52 -13
  15. package/dist/feedback.mjs.map +1 -1
  16. package/dist/forms.js +4 -1
  17. package/dist/forms.js.map +1 -1
  18. package/dist/forms.mjs +4 -1
  19. package/dist/forms.mjs.map +1 -1
  20. package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
  21. package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
  22. package/dist/index.d.mts +2 -2
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1268 -1005
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +1127 -865
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/layout.js +15 -7
  29. package/dist/layout.js.map +1 -1
  30. package/dist/layout.mjs +15 -7
  31. package/dist/layout.mjs.map +1 -1
  32. package/dist/navigation.d.mts +1 -1
  33. package/dist/navigation.d.ts +1 -1
  34. package/dist/navigation.js +66 -16
  35. package/dist/navigation.js.map +1 -1
  36. package/dist/navigation.mjs +66 -16
  37. package/dist/navigation.mjs.map +1 -1
  38. package/dist/overlays.js +52 -13
  39. package/dist/overlays.js.map +1 -1
  40. package/dist/overlays.mjs +52 -13
  41. package/dist/overlays.mjs.map +1 -1
  42. package/dist/pickers.js +177 -111
  43. package/dist/pickers.js.map +1 -1
  44. package/dist/pickers.mjs +177 -111
  45. package/dist/pickers.mjs.map +1 -1
  46. package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
  47. package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
  48. package/package.json +3 -3
package/dist/buttons.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Slot } from '@radix-ui/react-slot';
3
3
  import { m, LazyMotion, domMax, useMotionValue, animate, useAnimationFrame, AnimatePresence, useReducedMotion, useSpring, useTransform } from 'motion/react';
4
- import * as React14 from 'react';
4
+ import * as React16 from 'react';
5
5
  import { clsx } from 'clsx';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -87,11 +87,11 @@ var ROTATE_KEY_SPLINES = [
87
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
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
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 = React14.memo(function IndeterminateSvg2({
90
+ var IndeterminateSvg = React16.memo(function IndeterminateSvg2({
91
91
  size
92
92
  }) {
93
- const [ready, setReady] = React14.useState(false);
94
- React14.useEffect(() => {
93
+ const [ready, setReady] = React16.useState(false);
94
+ React16.useEffect(() => {
95
95
  const raf = requestAnimationFrame(() => setReady(true));
96
96
  return () => cancelAnimationFrame(raf);
97
97
  }, []);
@@ -136,7 +136,7 @@ var IndeterminateSvg = React14.memo(function IndeterminateSvg2({
136
136
  }
137
137
  );
138
138
  });
139
- var DeterminateSvg = React14.memo(function DeterminateSvg2({
139
+ var DeterminateSvg = React16.memo(function DeterminateSvg2({
140
140
  size,
141
141
  progress
142
142
  }) {
@@ -161,7 +161,7 @@ var DeterminateSvg = React14.memo(function DeterminateSvg2({
161
161
  }
162
162
  );
163
163
  });
164
- var LoadingIndicator = React14.forwardRef(
164
+ var LoadingIndicator = React16.forwardRef(
165
165
  (_a, ref) => {
166
166
  var _b = _a, {
167
167
  variant = "uncontained",
@@ -276,7 +276,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
276
276
  d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
277
277
  return d;
278
278
  }
279
- var CircularProgress = React14.forwardRef(
279
+ var CircularProgress = React16.forwardRef(
280
280
  (_a, ref) => {
281
281
  var _b = _a, {
282
282
  value,
@@ -314,15 +314,15 @@ var CircularProgress = React14.forwardRef(
314
314
  const isWavy = shape === "wavy";
315
315
  const BASELINE_SIZE = 48;
316
316
  const scaleFactor = size / BASELINE_SIZE;
317
- const effectiveAmplitude = React14.useMemo(
317
+ const effectiveAmplitude = React16.useMemo(
318
318
  () => amplitude != null ? amplitude : 1.6 * scaleFactor,
319
319
  [amplitude, scaleFactor]
320
320
  );
321
- const effectiveWavelength = React14.useMemo(
321
+ const effectiveWavelength = React16.useMemo(
322
322
  () => wavelength != null ? wavelength : 15 * scaleFactor,
323
323
  [wavelength, scaleFactor]
324
324
  );
325
- const wavyActivePath = React14.useMemo(
325
+ const wavyActivePath = React16.useMemo(
326
326
  () => isWavy ? generateWavyCircularPath(
327
327
  center,
328
328
  radius,
@@ -331,8 +331,8 @@ var CircularProgress = React14.forwardRef(
331
331
  ) : null,
332
332
  [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
333
333
  );
334
- const circumference = React14.useMemo(() => 2 * Math.PI * radius, [radius]);
335
- const gapForTrack = React14.useMemo(
334
+ const circumference = React16.useMemo(() => 2 * Math.PI * radius, [radius]);
335
+ const gapForTrack = React16.useMemo(
336
336
  () => (gapSize + trackHeight) / circumference,
337
337
  [gapSize, trackHeight, circumference]
338
338
  );
@@ -521,9 +521,9 @@ var CircularProgress = React14.forwardRef(
521
521
  );
522
522
  CircularProgress.displayName = "CircularProgress";
523
523
  function useContainerWidth() {
524
- const [width, setWidth] = React14.useState(0);
525
- const observerRef = React14.useRef(null);
526
- const ref = React14.useCallback((node) => {
524
+ const [width, setWidth] = React16.useState(0);
525
+ const observerRef = React16.useRef(null);
526
+ const ref = React16.useCallback((node) => {
527
527
  if (observerRef.current) {
528
528
  observerRef.current.disconnect();
529
529
  observerRef.current = null;
@@ -537,7 +537,7 @@ function useContainerWidth() {
537
537
  observerRef.current = obs;
538
538
  }
539
539
  }, []);
540
- React14.useEffect(() => {
540
+ React16.useEffect(() => {
541
541
  return () => {
542
542
  if (observerRef.current) {
543
543
  observerRef.current.disconnect();
@@ -547,7 +547,7 @@ function useContainerWidth() {
547
547
  return [ref, width];
548
548
  }
549
549
  function useMergedRef(...refs) {
550
- return React14.useCallback(
550
+ return React16.useCallback(
551
551
  (node) => {
552
552
  for (const ref of refs) {
553
553
  if (typeof ref === "function") {
@@ -561,7 +561,7 @@ function useMergedRef(...refs) {
561
561
  [refs]
562
562
  );
563
563
  }
564
- var FlatLinearTrack = React14.memo(function FlatLinearTrack2({
564
+ var FlatLinearTrack = React16.memo(function FlatLinearTrack2({
565
565
  trackHeight,
566
566
  activeColor,
567
567
  trackColor,
@@ -637,7 +637,7 @@ var FlatLinearTrack = React14.memo(function FlatLinearTrack2({
637
637
  }
638
638
  );
639
639
  });
640
- var WavyLinearTrack = React14.memo(function WavyLinearTrack2({
640
+ var WavyLinearTrack = React16.memo(function WavyLinearTrack2({
641
641
  trackHeight,
642
642
  svgHeight,
643
643
  amplitude,
@@ -656,13 +656,13 @@ var WavyLinearTrack = React14.memo(function WavyLinearTrack2({
656
656
  }) {
657
657
  const isDeterminate = typeof value === "number";
658
658
  const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
659
- const titleId = React14.useId();
659
+ const titleId = React16.useId();
660
660
  const [containerRef, width] = useContainerWidth();
661
- const activePathRef = React14.useRef(null);
662
- const trackPathRef = React14.useRef(null);
661
+ const activePathRef = React16.useRef(null);
662
+ const trackPathRef = React16.useRef(null);
663
663
  const amplitudeMV = useMotionValue(amplitude);
664
664
  const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
665
- React14.useEffect(() => {
665
+ React16.useEffect(() => {
666
666
  if (isDeterminate) {
667
667
  const fraction = clampedValue / 100;
668
668
  let targetAmp = amplitude;
@@ -833,7 +833,7 @@ var WavyLinearTrack = React14.memo(function WavyLinearTrack2({
833
833
  }
834
834
  );
835
835
  });
836
- var LinearProgress = React14.forwardRef(
836
+ var LinearProgress = React16.forwardRef(
837
837
  (_a, ref) => {
838
838
  var _b = _a, {
839
839
  value,
@@ -874,10 +874,10 @@ var LinearProgress = React14.forwardRef(
874
874
  ]);
875
875
  const isDeterminate = value !== void 0;
876
876
  const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
877
- const containerRef = React14.useRef(null);
877
+ const containerRef = React16.useRef(null);
878
878
  const mergedRef = useMergedRef(ref, containerRef);
879
- const [isRtl, setIsRtl] = React14.useState(false);
880
- React14.useEffect(() => {
879
+ const [isRtl, setIsRtl] = React16.useState(false);
880
+ React16.useEffect(() => {
881
881
  if (containerRef.current) {
882
882
  const dir = getComputedStyle(containerRef.current).direction;
883
883
  setIsRtl(dir === "rtl");
@@ -885,16 +885,16 @@ var LinearProgress = React14.forwardRef(
885
885
  }, []);
886
886
  const isWavy = shape === "wavy";
887
887
  const resolvedTrackShape = trackShape != null ? trackShape : shape;
888
- const effectiveAmplitude = React14.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
889
- const svgHeight = React14.useMemo(
888
+ const effectiveAmplitude = React16.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
889
+ const svgHeight = React16.useMemo(
890
890
  () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
891
891
  [isWavy, trackHeight, effectiveAmplitude]
892
892
  );
893
- const shouldShowStop = React14.useMemo(
893
+ const shouldShowStop = React16.useMemo(
894
894
  () => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
895
895
  [isDeterminate, resolvedTrackShape, showStopIndicator]
896
896
  );
897
- const stopSize = React14.useMemo(
897
+ const stopSize = React16.useMemo(
898
898
  () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
899
899
  [trackHeight]
900
900
  );
@@ -967,14 +967,14 @@ var LinearProgress = React14.forwardRef(
967
967
  }
968
968
  );
969
969
  LinearProgress.displayName = "LinearProgress";
970
- var ProgressIndicator = React14.forwardRef((props, ref) => {
970
+ var ProgressIndicator = React16.forwardRef((props, ref) => {
971
971
  if (props.variant === "circular") {
972
972
  return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
973
973
  }
974
974
  return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
975
975
  });
976
976
  ProgressIndicator.displayName = "ProgressIndicator";
977
- var RippleItem = React14.memo(function RippleItem2({
977
+ var RippleItem = React16.memo(function RippleItem2({
978
978
  ripple,
979
979
  onDone
980
980
  }) {
@@ -1018,14 +1018,17 @@ function Ripple({
1018
1018
  }
1019
1019
  function useRippleState(options = {}) {
1020
1020
  const { disabled = false } = options;
1021
- const [ripples, setRipples] = React14.useState([]);
1022
- const onPointerDown = React14.useCallback(
1021
+ const [ripples, setRipples] = React16.useState([]);
1022
+ const onPointerDown = React16.useCallback(
1023
1023
  (e) => {
1024
1024
  if (disabled) return;
1025
1025
  const rect = e.currentTarget.getBoundingClientRect();
1026
1026
  const x = e.clientX - rect.left;
1027
1027
  const y = e.clientY - rect.top;
1028
- const rippleSize = Math.hypot(rect.width, rect.height) * 2;
1028
+ const rippleSize = Math.max(
1029
+ Math.hypot(rect.width, rect.height) * 2.5,
1030
+ 320
1031
+ );
1029
1032
  setRipples((prev) => [
1030
1033
  ...prev,
1031
1034
  { id: Date.now(), x, y, size: rippleSize }
@@ -1033,7 +1036,7 @@ function useRippleState(options = {}) {
1033
1036
  },
1034
1037
  [disabled]
1035
1038
  );
1036
- const removeRipple = React14.useCallback((id) => {
1039
+ const removeRipple = React16.useCallback((id) => {
1037
1040
  setRipples((prev) => prev.filter((r) => r.id !== id));
1038
1041
  }, []);
1039
1042
  return { ripples, onPointerDown, removeRipple };
@@ -1289,7 +1292,7 @@ function AnimatedIconSlot({
1289
1292
  }
1290
1293
  );
1291
1294
  }
1292
- var ButtonComponent = React14.forwardRef(
1295
+ var ButtonComponent = React16.forwardRef(
1293
1296
  (_a, ref) => {
1294
1297
  var _b = _a, {
1295
1298
  className,
@@ -1301,6 +1304,7 @@ var ButtonComponent = React14.forwardRef(
1301
1304
  shape = "round",
1302
1305
  selected,
1303
1306
  icon,
1307
+ selectedIcon,
1304
1308
  iconPosition = "leading",
1305
1309
  loading = false,
1306
1310
  loadingVariant = "loading-indicator",
@@ -1322,6 +1326,7 @@ var ButtonComponent = React14.forwardRef(
1322
1326
  "shape",
1323
1327
  "selected",
1324
1328
  "icon",
1329
+ "selectedIcon",
1325
1330
  "iconPosition",
1326
1331
  "loading",
1327
1332
  "loadingVariant",
@@ -1351,9 +1356,9 @@ var ButtonComponent = React14.forwardRef(
1351
1356
  borderWidth: outlineWidth != null ? outlineWidth : colorStyle === "outlined" ? sizeTokens.outlineWidth : 0,
1352
1357
  borderStyle: colorStyle === "outlined" ? "solid" : void 0
1353
1358
  }, style);
1354
- const labelText = React14.useMemo(() => {
1359
+ const labelText = React16.useMemo(() => {
1355
1360
  if (asChild) {
1356
- const child = React14.Children.only(children);
1361
+ const child = React16.Children.only(children);
1357
1362
  return child.props.children;
1358
1363
  }
1359
1364
  return children;
@@ -1361,8 +1366,8 @@ var ButtonComponent = React14.forwardRef(
1361
1366
  const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
1362
1367
  const needsTouchTarget = size === "xs" || size === "sm";
1363
1368
  const motionRadius = useMotionValue(animateRadius);
1364
- const asChildRef = React14.useRef(null);
1365
- const mergedRef = React14.useCallback(
1369
+ const asChildRef = React16.useRef(null);
1370
+ const mergedRef = React16.useCallback(
1366
1371
  (node) => {
1367
1372
  asChildRef.current = node;
1368
1373
  if (typeof ref === "function") ref(node);
@@ -1371,14 +1376,14 @@ var ButtonComponent = React14.forwardRef(
1371
1376
  },
1372
1377
  [ref]
1373
1378
  );
1374
- React14.useEffect(() => {
1379
+ React16.useEffect(() => {
1375
1380
  if (!asChild) return;
1376
1381
  return motionRadius.on("change", (v) => {
1377
1382
  if (asChildRef.current)
1378
1383
  asChildRef.current.style.borderRadius = `${v}px`;
1379
1384
  });
1380
1385
  }, [motionRadius, asChild]);
1381
- React14.useEffect(() => {
1386
+ React16.useEffect(() => {
1382
1387
  if (!asChild) return;
1383
1388
  const controls = springAnimate(motionRadius, animateRadius);
1384
1389
  return () => controls.stop();
@@ -1386,14 +1391,14 @@ var ButtonComponent = React14.forwardRef(
1386
1391
  const { ripples, onPointerDown, removeRipple } = useRippleState({
1387
1392
  disabled: loading
1388
1393
  });
1389
- const handleClick = React14.useCallback(
1394
+ const handleClick = React16.useCallback(
1390
1395
  (e) => {
1391
1396
  if (loading) return e.preventDefault();
1392
1397
  onClick == null ? void 0 : onClick(e);
1393
1398
  },
1394
1399
  [loading, onClick]
1395
1400
  );
1396
- const handleKeyDown = React14.useCallback(
1401
+ const handleKeyDown = React16.useCallback(
1397
1402
  (e) => {
1398
1403
  if (loading) return;
1399
1404
  if (onClick && (e.key === "Enter" || e.key === " ")) {
@@ -1421,10 +1426,11 @@ var ButtonComponent = React14.forwardRef(
1421
1426
  layout: BUTTON_SHAPE_MORPH_SPRING,
1422
1427
  default: SPRING_TRANSITION
1423
1428
  };
1429
+ const activeIcon = isSelected && selectedIcon ? selectedIcon : icon;
1424
1430
  const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
1425
1431
  needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
1426
1432
  /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
1427
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "popLayout", children: (loading || icon && iconPosition === "leading") && /* @__PURE__ */ jsx(
1433
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: (loading || activeIcon && iconPosition === "leading") && /* @__PURE__ */ jsx(
1428
1434
  AnimatedIconSlot,
1429
1435
  {
1430
1436
  iconSize: sizeTokens.iconSize,
@@ -1446,8 +1452,9 @@ var ButtonComponent = React14.forwardRef(
1446
1452
  trackColor: "transparent",
1447
1453
  "aria-label": "Loading"
1448
1454
  }
1449
- ) : icon
1450
- }
1455
+ ) : activeIcon
1456
+ },
1457
+ isSelected && selectedIcon ? "selected-icon" : "icon"
1451
1458
  ) }),
1452
1459
  labelText && /* @__PURE__ */ jsx(
1453
1460
  m.span,
@@ -1458,27 +1465,28 @@ var ButtonComponent = React14.forwardRef(
1458
1465
  children: labelText
1459
1466
  }
1460
1467
  ),
1461
- /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "popLayout", children: icon && iconPosition === "trailing" && /* @__PURE__ */ jsx(
1468
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: !loading && activeIcon && iconPosition === "trailing" && /* @__PURE__ */ jsx(
1462
1469
  AnimatedIconSlot,
1463
1470
  {
1464
1471
  iconSize: sizeTokens.iconSize,
1465
1472
  ariaHidden: true,
1466
1473
  transition: sharedTransition,
1467
- children: icon
1468
- }
1474
+ children: activeIcon
1475
+ },
1476
+ isSelected && selectedIcon ? "selected-icon" : "icon"
1469
1477
  ) })
1470
1478
  ] });
1471
- const handleAsChildPointerDown = React14.useCallback(
1479
+ const handleAsChildPointerDown = React16.useCallback(
1472
1480
  (e) => {
1473
1481
  springAnimate(motionRadius, pressedRadius);
1474
1482
  onPointerDown == null ? void 0 : onPointerDown(e);
1475
1483
  },
1476
1484
  [motionRadius, pressedRadius, onPointerDown]
1477
1485
  );
1478
- const handleAsChildPointerUp = React14.useCallback(() => {
1486
+ const handleAsChildPointerUp = React16.useCallback(() => {
1479
1487
  springAnimate(motionRadius, animateRadius);
1480
1488
  }, [motionRadius, animateRadius]);
1481
- const handlePointerDown = React14.useCallback(
1489
+ const handlePointerDown = React16.useCallback(
1482
1490
  (e) => {
1483
1491
  onPointerDown(e);
1484
1492
  },
@@ -1488,7 +1496,7 @@ var ButtonComponent = React14.forwardRef(
1488
1496
  const strippedProps = __spreadValues({}, restProps);
1489
1497
  for (const key of MOTION_PROP_KEYS) delete strippedProps[key];
1490
1498
  const htmlProps = strippedProps;
1491
- const child = React14.Children.only(children);
1499
+ const child = React16.Children.only(children);
1492
1500
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1493
1501
  Slot,
1494
1502
  __spreadProps(__spreadValues({
@@ -1505,7 +1513,7 @@ var ButtonComponent = React14.forwardRef(
1505
1513
  }),
1506
1514
  className: buttonClassName
1507
1515
  }, htmlProps), {
1508
- children: React14.cloneElement(child, { children: innerContent })
1516
+ children: React16.cloneElement(child, { children: innerContent })
1509
1517
  })
1510
1518
  ) });
1511
1519
  }
@@ -1534,13 +1542,343 @@ var ButtonComponent = React14.forwardRef(
1534
1542
  }
1535
1543
  );
1536
1544
  ButtonComponent.displayName = "Button";
1537
- var Button = React14.memo(ButtonComponent);
1545
+ var Button = React16.memo(ButtonComponent);
1546
+
1547
+ // src/ui/buttons/button-distribute/button-distribute-tokens.ts
1548
+ var DISTRIBUTE_SPRING_TRANSITION = {
1549
+ type: "spring",
1550
+ stiffness: 300,
1551
+ damping: 30,
1552
+ mass: 0.8
1553
+ };
1554
+ var DISTRIBUTE_EASING_BEZIER = "cubic-bezier(0.2, 0.0, 0.0, 1.0)";
1555
+ var DISTRIBUTE_DURATION_MS = 350;
1556
+ var DEFAULT_EXPAND_RATIO = 0.3;
1557
+ var DEFAULT_FIXED_SIZE = 48;
1558
+ var DEFAULT_GAP = "0.5rem";
1559
+ var DISTRIBUTE_RADIUS_TOKENS = {
1560
+ xs: { circleRadius: 16, pillRadius: 16, pressedRadius: 8 },
1561
+ sm: { circleRadius: 20, pillRadius: 20, pressedRadius: 10 },
1562
+ md: { circleRadius: 28, pillRadius: 28, pressedRadius: 16 },
1563
+ lg: { circleRadius: 48, pillRadius: 48, pressedRadius: 28 },
1564
+ xl: { circleRadius: 68, pillRadius: 68, pressedRadius: 40 }
1565
+ };
1566
+ var DISTRIBUTE_HEIGHT_TOKENS = {
1567
+ xs: "h-8",
1568
+ sm: "h-10",
1569
+ md: "h-14",
1570
+ lg: "h-24",
1571
+ xl: "h-[8.5rem]"
1572
+ };
1573
+ function useDistributeWeights({
1574
+ count,
1575
+ weights,
1576
+ activeIndex,
1577
+ expandRatio = DEFAULT_EXPAND_RATIO,
1578
+ mode = "dynamic",
1579
+ isTextItem
1580
+ }) {
1581
+ return React16.useMemo(() => {
1582
+ if (count <= 0) return [];
1583
+ if (mode === "mixed") {
1584
+ const baseWeights2 = new Array(count).fill(0).map((_, idx) => {
1585
+ if (idx === 0 || idx === count - 1) return 0;
1586
+ return weights && weights[idx] !== void 0 ? weights[idx] : 1;
1587
+ });
1588
+ if (activeIndex === null || activeIndex < 0 || activeIndex >= count || count === 1) {
1589
+ return baseWeights2;
1590
+ }
1591
+ const result2 = [...baseWeights2];
1592
+ const expandAmount2 = expandRatio * 1.5;
1593
+ if (activeIndex === 0) {
1594
+ result2[0] = expandAmount2;
1595
+ for (let i = 1; i < count - 1; i++) {
1596
+ result2[i] = Math.max(0.5, baseWeights2[i] - expandRatio * 0.4);
1597
+ }
1598
+ } else if (activeIndex === count - 1) {
1599
+ result2[count - 1] = expandAmount2;
1600
+ for (let i = 1; i < count - 1; i++) {
1601
+ result2[i] = Math.max(0.5, baseWeights2[i] - expandRatio * 0.4);
1602
+ }
1603
+ } else {
1604
+ result2[activeIndex] = baseWeights2[activeIndex] + expandRatio;
1605
+ for (let i = 1; i < count - 1; i++) {
1606
+ if (i !== activeIndex) {
1607
+ result2[i] = Math.max(0.5, baseWeights2[i] - expandRatio * 0.5);
1608
+ }
1609
+ }
1610
+ }
1611
+ return result2;
1612
+ }
1613
+ let baseWeights;
1614
+ if (weights && weights.length === count) {
1615
+ baseWeights = [...weights];
1616
+ } else if (mode === "dynamic" && count === 3) {
1617
+ baseWeights = [1, 2, 1];
1618
+ } else {
1619
+ baseWeights = new Array(count).fill(1);
1620
+ }
1621
+ if (activeIndex === null || activeIndex < 0 || activeIndex >= count || count === 1) {
1622
+ return baseWeights;
1623
+ }
1624
+ const totalWeight = baseWeights.reduce((acc, w) => acc + w, 0);
1625
+ const activeBaseWeight = baseWeights[activeIndex];
1626
+ const expandAmount = expandRatio * totalWeight;
1627
+ const minWeights = baseWeights.map((w, idx) => {
1628
+ if (isTextItem == null ? void 0 : isTextItem[idx]) {
1629
+ return Math.max(0.75, w * 0.65);
1630
+ }
1631
+ return 0.4;
1632
+ });
1633
+ const shrinkCapacity = baseWeights.map(
1634
+ (w, idx) => idx === activeIndex ? 0 : Math.max(0, w - minWeights[idx])
1635
+ );
1636
+ const totalCapacity = shrinkCapacity.reduce((acc, cap) => acc + cap, 0);
1637
+ const result = [...baseWeights];
1638
+ if (totalCapacity > 0) {
1639
+ const actualExpand = Math.min(expandAmount, totalCapacity);
1640
+ result[activeIndex] = activeBaseWeight + actualExpand;
1641
+ for (let i = 0; i < count; i++) {
1642
+ if (i !== activeIndex) {
1643
+ const shrinkAmount = actualExpand * (shrinkCapacity[i] / totalCapacity);
1644
+ result[i] = Math.max(minWeights[i], baseWeights[i] - shrinkAmount);
1645
+ }
1646
+ }
1647
+ }
1648
+ return result;
1649
+ }, [count, weights, activeIndex, expandRatio, mode, isTextItem]);
1650
+ }
1651
+ var ButtonDistribute = React16.forwardRef(
1652
+ (_a, ref) => {
1653
+ var _b = _a, {
1654
+ className,
1655
+ style,
1656
+ mode = "dynamic",
1657
+ weights,
1658
+ expandRatio = 0.3,
1659
+ expandOnHover = false,
1660
+ fixedSize = 48,
1661
+ leadingSize,
1662
+ trailingSize,
1663
+ gap = "0.5rem",
1664
+ size = "sm",
1665
+ itemClassName,
1666
+ children,
1667
+ onMouseLeave
1668
+ } = _b, restProps = __objRest(_b, [
1669
+ "className",
1670
+ "style",
1671
+ "mode",
1672
+ "weights",
1673
+ "expandRatio",
1674
+ "expandOnHover",
1675
+ "fixedSize",
1676
+ "leadingSize",
1677
+ "trailingSize",
1678
+ "gap",
1679
+ "size",
1680
+ "itemClassName",
1681
+ "children",
1682
+ "onMouseLeave"
1683
+ ]);
1684
+ var _a2, _b2;
1685
+ const [activeIndex, setActiveIndex] = React16.useState(null);
1686
+ const [pressedIndex, setPressedIndex] = React16.useState(null);
1687
+ const childrenArray = React16.useMemo(
1688
+ () => React16.Children.toArray(children).filter(React16.isValidElement),
1689
+ [children]
1690
+ );
1691
+ const count = childrenArray.length;
1692
+ const isTextItem = React16.useMemo(() => {
1693
+ return childrenArray.map((child) => {
1694
+ const childEl = child;
1695
+ if (typeof childEl.props.children === "string") return true;
1696
+ if (Array.isArray(childEl.props.children)) {
1697
+ return childEl.props.children.some(
1698
+ (c) => typeof c === "string" && c.trim().length > 0
1699
+ );
1700
+ }
1701
+ return false;
1702
+ });
1703
+ }, [childrenArray]);
1704
+ const calculatedWeights = useDistributeWeights({
1705
+ count,
1706
+ weights,
1707
+ activeIndex,
1708
+ expandRatio,
1709
+ mode,
1710
+ isTextItem
1711
+ });
1712
+ const handleGroupMouseLeave = React16.useCallback(
1713
+ (e) => {
1714
+ setActiveIndex(null);
1715
+ setPressedIndex(null);
1716
+ onMouseLeave == null ? void 0 : onMouseLeave(e);
1717
+ },
1718
+ [onMouseLeave]
1719
+ );
1720
+ const resolvedGap = typeof gap === "number" ? `${gap}px` : gap;
1721
+ const effectiveLeadingSize = typeof (leadingSize != null ? leadingSize : fixedSize) === "number" ? `${leadingSize != null ? leadingSize : fixedSize}px` : leadingSize != null ? leadingSize : fixedSize;
1722
+ const effectiveTrailingSize = typeof (trailingSize != null ? trailingSize : fixedSize) === "number" ? `${trailingSize != null ? trailingSize : fixedSize}px` : trailingSize != null ? trailingSize : fixedSize;
1723
+ const radiusTokens = (_a2 = DISTRIBUTE_RADIUS_TOKENS[size]) != null ? _a2 : DISTRIBUTE_RADIUS_TOKENS.sm;
1724
+ const heightClass = (_b2 = DISTRIBUTE_HEIGHT_TOKENS[size]) != null ? _b2 : DISTRIBUTE_HEIGHT_TOKENS.sm;
1725
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1726
+ "fieldset",
1727
+ __spreadProps(__spreadValues({
1728
+ ref,
1729
+ onMouseLeave: handleGroupMouseLeave,
1730
+ onPointerCancel: () => setPressedIndex(null),
1731
+ className: cn(
1732
+ "inline-flex flex-row items-center border-none p-0 m-0 box-border overflow-hidden select-none w-full",
1733
+ heightClass,
1734
+ className
1735
+ ),
1736
+ style: __spreadValues({
1737
+ gap: resolvedGap
1738
+ }, style)
1739
+ }, restProps), {
1740
+ children: childrenArray.map((child, index) => {
1741
+ var _a3, _b3, _c, _d, _e, _f;
1742
+ const isFirst = index === 0;
1743
+ const isLast = index === count - 1;
1744
+ const childElement = child;
1745
+ const isActive = activeIndex === index;
1746
+ const isPressed = pressedIndex === index;
1747
+ const isSquish = isActive || isPressed;
1748
+ let flexStyle = {};
1749
+ let targetFlexBasis = 0;
1750
+ const parsePx = (val) => {
1751
+ if (typeof val === "number") return val;
1752
+ const parsed = Number.parseFloat(val);
1753
+ return Number.isNaN(parsed) ? 48 : parsed;
1754
+ };
1755
+ const leadingPx = parsePx(effectiveLeadingSize);
1756
+ const trailingPx = parsePx(effectiveTrailingSize);
1757
+ const leadingCompressedPx = Math.max(
1758
+ 40,
1759
+ Math.round(leadingPx * (1 - expandRatio))
1760
+ );
1761
+ const trailingCompressedPx = Math.max(
1762
+ 40,
1763
+ Math.round(trailingPx * (1 - expandRatio))
1764
+ );
1765
+ if (mode === "dynamic" || mode === "fixed") {
1766
+ const currentWeight = (_a3 = calculatedWeights[index]) != null ? _a3 : 1;
1767
+ flexStyle = {
1768
+ flexGrow: currentWeight,
1769
+ flexShrink: 1,
1770
+ flexBasis: 0,
1771
+ minWidth: 0
1772
+ };
1773
+ targetFlexBasis = 0;
1774
+ } else if (mode === "mixed") {
1775
+ const currentWeight = (_b3 = calculatedWeights[index]) != null ? _b3 : 0;
1776
+ if (isFirst) {
1777
+ targetFlexBasis = activeIndex !== null && activeIndex > 0 ? `${leadingCompressedPx}px` : effectiveLeadingSize;
1778
+ flexStyle = {
1779
+ flexBasis: targetFlexBasis,
1780
+ flexGrow: currentWeight,
1781
+ flexShrink: 0,
1782
+ minWidth: 0
1783
+ };
1784
+ } else if (isLast) {
1785
+ targetFlexBasis = activeIndex !== null && activeIndex < count - 1 ? `${trailingCompressedPx}px` : effectiveTrailingSize;
1786
+ flexStyle = {
1787
+ flexBasis: targetFlexBasis,
1788
+ flexGrow: currentWeight,
1789
+ flexShrink: 0,
1790
+ minWidth: 0
1791
+ };
1792
+ } else {
1793
+ targetFlexBasis = 0;
1794
+ flexStyle = {
1795
+ flexBasis: 0,
1796
+ flexGrow: (_c = calculatedWeights[index]) != null ? _c : 1,
1797
+ flexShrink: 1,
1798
+ minWidth: 0
1799
+ };
1800
+ }
1801
+ }
1802
+ const handleMouseEnter = (e) => {
1803
+ var _a4, _b4;
1804
+ if (expandOnHover) {
1805
+ setActiveIndex(index);
1806
+ }
1807
+ (_b4 = (_a4 = childElement.props).onMouseEnter) == null ? void 0 : _b4.call(_a4, e);
1808
+ };
1809
+ const handleFocus = (e) => {
1810
+ var _a4, _b4;
1811
+ setActiveIndex(index);
1812
+ (_b4 = (_a4 = childElement.props).onFocus) == null ? void 0 : _b4.call(_a4, e);
1813
+ };
1814
+ const handlePointerDown = (e) => {
1815
+ var _a4, _b4;
1816
+ setPressedIndex(index);
1817
+ setActiveIndex(index);
1818
+ (_b4 = (_a4 = childElement.props).onPointerDown) == null ? void 0 : _b4.call(_a4, e);
1819
+ };
1820
+ const handlePointerUp = (e) => {
1821
+ var _a4, _b4;
1822
+ setPressedIndex(null);
1823
+ if (!expandOnHover) {
1824
+ setActiveIndex(null);
1825
+ }
1826
+ (_b4 = (_a4 = childElement.props).onPointerUp) == null ? void 0 : _b4.call(_a4, e);
1827
+ };
1828
+ const handleClick = (e) => {
1829
+ var _a4, _b4;
1830
+ setPressedIndex(null);
1831
+ if (!expandOnHover) {
1832
+ setActiveIndex(null);
1833
+ }
1834
+ (_b4 = (_a4 = childElement.props).onClick) == null ? void 0 : _b4.call(_a4, e);
1835
+ };
1836
+ const clonedChild = React16.cloneElement(childElement, {
1837
+ size: (_d = childElement.props.size) != null ? _d : size,
1838
+ className: cn(
1839
+ "w-full! h-full! justify-center items-center flex-1 rounded-[inherit]! px-3! sm:px-4!",
1840
+ childElement.props.className
1841
+ )
1842
+ });
1843
+ return /* @__PURE__ */ jsx(
1844
+ m.div,
1845
+ {
1846
+ layout: true,
1847
+ initial: false,
1848
+ animate: {
1849
+ flexGrow: (_f = flexStyle.flexGrow) != null ? _f : 1,
1850
+ flexBasis: targetFlexBasis,
1851
+ borderRadius: isSquish ? radiusTokens.pressedRadius : radiusTokens.pillRadius
1852
+ },
1853
+ transition: __spreadProps(__spreadValues({}, DISTRIBUTE_SPRING_TRANSITION), {
1854
+ borderRadius: BUTTON_RADIUS_SPRING
1855
+ }),
1856
+ onMouseEnter: handleMouseEnter,
1857
+ onFocus: handleFocus,
1858
+ onPointerDown: handlePointerDown,
1859
+ onPointerUp: handlePointerUp,
1860
+ onClick: handleClick,
1861
+ className: cn(
1862
+ "relative inline-flex items-center justify-center shrink-0 min-w-0 overflow-hidden h-full",
1863
+ itemClassName
1864
+ ),
1865
+ style: flexStyle,
1866
+ children: clonedChild
1867
+ },
1868
+ (_e = childElement.key) != null ? _e : index
1869
+ );
1870
+ })
1871
+ })
1872
+ ) });
1873
+ }
1874
+ );
1875
+ ButtonDistribute.displayName = "ButtonDistribute";
1538
1876
  var VARIANT_FONT = {
1539
1877
  outlined: "'Material Symbols Outlined'",
1540
1878
  rounded: "'Material Symbols Rounded'",
1541
1879
  sharp: "'Material Symbols Sharp'"
1542
1880
  };
1543
- var IconComponent = React14.forwardRef(
1881
+ var IconComponent = React16.forwardRef(
1544
1882
  (_a, ref) => {
1545
1883
  var _b = _a, {
1546
1884
  name,
@@ -1606,7 +1944,7 @@ var IconComponent = React14.forwardRef(
1606
1944
  }
1607
1945
  );
1608
1946
  IconComponent.displayName = "Icon";
1609
- var Icon = React14.memo(IconComponent);
1947
+ var Icon = React16.memo(IconComponent);
1610
1948
  var BUTTON_GROUP_TOKENS = {
1611
1949
  standard: {
1612
1950
  betweenSpace: 12,
@@ -1662,7 +2000,6 @@ function buildConnectedShapes(size, defaultCorners, pressedCorners) {
1662
2000
  };
1663
2001
  }
1664
2002
  var ButtonGroupDefaults = {
1665
- expandedRatio: 0.15,
1666
2003
  connectedLeadingButtonShapes: (size) => buildConnectedShapes(
1667
2004
  size,
1668
2005
  (o, i) => ({ tl: o, tr: i, br: i, bl: o }),
@@ -1691,8 +2028,6 @@ var ButtonGroupDefaults = {
1691
2028
  )
1692
2029
  };
1693
2030
  var PILL_BORDER_RADIUS = 9999;
1694
- var MIN_FLEX_GROW = 0.01;
1695
- var PADDING_EXPAND_MULTIPLIER = 4;
1696
2031
  var CHECK_ICON_SIZE = 24;
1697
2032
  var CHECK_ICON = /* @__PURE__ */ jsx(Icon, { name: "check", variant: "rounded", size: CHECK_ICON_SIZE, weight: 700 });
1698
2033
  var CHECK_ICON_GAP_MAP = {
@@ -1708,13 +2043,7 @@ var CHECK_ICON_MOTION = {
1708
2043
  damping: 34,
1709
2044
  mass: 0.75
1710
2045
  };
1711
- var WIDTH_MORPH_SPRING = {
1712
- type: "spring",
1713
- stiffness: 360,
1714
- damping: 38,
1715
- mass: 0.85
1716
- };
1717
- var AnimatedCheckLabel = React14.memo(function AnimatedCheckLabel2({
2046
+ var AnimatedCheckLabel = React16.memo(function AnimatedCheckLabel2({
1718
2047
  selected,
1719
2048
  size,
1720
2049
  children
@@ -1790,43 +2119,9 @@ function resolveIconAndLabel(element, isSelected, itemSize, showCheck, iconBehav
1790
2119
  }
1791
2120
  return { icon, label };
1792
2121
  }
1793
- function resolveFlexTargets(variant, orientation, isSelected, isPressed, hasSelected, count, fullWidth, activeMorphing, morphingWidth, expandedRatio, basePx) {
1794
- const increment = expandedRatio * PADDING_EXPAND_MULTIPLIER;
1795
- if (activeMorphing) {
1796
- const isFlexLayout = fullWidth || variant === "connected" && orientation === "horizontal";
1797
- if (isFlexLayout) {
1798
- if (isSelected) return { flexGrow: 1 + expandedRatio };
1799
- if (hasSelected && count > 1)
1800
- return {
1801
- flexGrow: Math.max(MIN_FLEX_GROW, 1 - expandedRatio / (count - 1))
1802
- };
1803
- return { flexGrow: 1 };
1804
- }
1805
- if (isSelected)
1806
- return { paddingInline: `calc(${basePx} + ${increment}rem)` };
1807
- if (hasSelected && count > 1) {
1808
- const decrement = increment / (count - 1);
1809
- return { paddingInline: `calc(${basePx} - ${decrement}rem)` };
1810
- }
1811
- return { paddingInline: basePx };
1812
- }
1813
- if (morphingWidth && variant === "standard") {
1814
- if (fullWidth) return { flexGrow: isPressed ? 1 + expandedRatio : 1 };
1815
- return {
1816
- paddingInline: isPressed ? `calc(${basePx} + ${increment}rem)` : basePx
1817
- };
1818
- }
1819
- return {};
1820
- }
1821
- function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex, existingAnimate, existingWhileTap) {
2122
+ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, existingAnimate, existingWhileTap) {
1822
2123
  var _a, _b;
1823
2124
  const props = { animate: __spreadValues({}, existingAnimate) };
1824
- if (flex.flexGrow !== void 0) {
1825
- props.animate.flexGrow = flex.flexGrow;
1826
- }
1827
- if (flex.paddingInline !== void 0) {
1828
- props.animate.paddingInline = flex.paddingInline;
1829
- }
1830
2125
  if (variant === "standard") {
1831
2126
  const pressedRadius = (_a = PRESSED_RADIUS_MAP[itemSize]) != null ? _a : PRESSED_RADIUS_MAP.sm;
1832
2127
  const itemSizeTokens = (_b = BUTTON_SIZE_TOKENS[itemSize]) != null ? _b : BUTTON_SIZE_TOKENS.sm;
@@ -1837,9 +2132,6 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex
1837
2132
  }, existingWhileTap);
1838
2133
  props.transition = {
1839
2134
  borderRadius: BUTTON_RADIUS_SPRING,
1840
- flexGrow: WIDTH_MORPH_SPRING,
1841
- paddingInline: WIDTH_MORPH_SPRING,
1842
- layout: WIDTH_MORPH_SPRING,
1843
2135
  default: BUTTON_SHAPE_MORPH_SPRING
1844
2136
  };
1845
2137
  props.layout = true;
@@ -1866,19 +2158,16 @@ function buildMotionProps(variant, isSelected, isPressed, itemSize, shapes, flex
1866
2158
  borderBottomLeftRadius: shapes.pressed.bl
1867
2159
  }, existingWhileTap);
1868
2160
  props.transition = __spreadProps(__spreadValues({}, BUTTON_SHAPE_MORPH_SPRING), {
1869
- flexGrow: WIDTH_MORPH_SPRING,
1870
- paddingInline: WIDTH_MORPH_SPRING,
1871
2161
  borderTopLeftRadius: BUTTON_RADIUS_SPRING,
1872
2162
  borderTopRightRadius: BUTTON_RADIUS_SPRING,
1873
2163
  borderBottomRightRadius: BUTTON_RADIUS_SPRING,
1874
- borderBottomLeftRadius: BUTTON_RADIUS_SPRING,
1875
- layout: WIDTH_MORPH_SPRING
2164
+ borderBottomLeftRadius: BUTTON_RADIUS_SPRING
1876
2165
  });
1877
2166
  props.layout = true;
1878
2167
  }
1879
2168
  return props;
1880
2169
  }
1881
- var ButtonGroupComponent = React14.forwardRef(
2170
+ var ButtonGroupComponent = React16.forwardRef(
1882
2171
  (_a, ref) => {
1883
2172
  var _b = _a, {
1884
2173
  className,
@@ -1886,10 +2175,7 @@ var ButtonGroupComponent = React14.forwardRef(
1886
2175
  orientation = "horizontal",
1887
2176
  fullWidth = false,
1888
2177
  size,
1889
- morphingWidth = true,
1890
- activeMorphing = false,
1891
2178
  itemClassName,
1892
- expandedRatio = ButtonGroupDefaults.expandedRatio,
1893
2179
  showCheck = false,
1894
2180
  children,
1895
2181
  iconBehavior,
@@ -1901,99 +2187,26 @@ var ButtonGroupComponent = React14.forwardRef(
1901
2187
  "orientation",
1902
2188
  "fullWidth",
1903
2189
  "size",
1904
- "morphingWidth",
1905
- "activeMorphing",
1906
2190
  "itemClassName",
1907
- "expandedRatio",
1908
2191
  "showCheck",
1909
2192
  "children",
1910
2193
  "iconBehavior",
1911
2194
  "labelBehavior",
1912
2195
  "style"
1913
2196
  ]);
1914
- const [pressedIndex, setPressedIndex] = React14.useState(null);
1915
- const [lockedGroupSize, setLockedGroupSize] = React14.useState(
1916
- null
1917
- );
1918
- const rootRef = React14.useRef(null);
1919
- const setRootRef = React14.useCallback(
1920
- (node) => {
1921
- rootRef.current = node;
1922
- if (typeof ref === "function") {
1923
- ref(node);
1924
- } else if (ref) {
1925
- ref.current = node;
1926
- }
1927
- },
1928
- [ref]
1929
- );
1930
- const childrenArray = React14.useMemo(
1931
- () => React14.Children.toArray(children).filter(React14.isValidElement),
2197
+ const [pressedIndex, setPressedIndex] = React16.useState(null);
2198
+ const childrenArray = React16.useMemo(
2199
+ () => React16.Children.toArray(children).filter(React16.isValidElement),
1932
2200
  [children]
1933
2201
  );
1934
2202
  const count = childrenArray.length;
1935
- const groupSizeSignature = React14.useMemo(
1936
- () => `${childrenArray.map((child, index) => {
1937
- var _a2, _b2, _c, _d, _e;
1938
- const element = child;
1939
- const label = typeof element.props.children === "string" || typeof element.props.children === "number" ? element.props.children : (_a2 = element.key) != null ? _a2 : index;
1940
- return [
1941
- (_b2 = element.key) != null ? _b2 : index,
1942
- (_d = (_c = element.props.size) != null ? _c : size) != null ? _d : "",
1943
- label,
1944
- Boolean(element.props.icon),
1945
- (_e = element.props.className) != null ? _e : ""
1946
- ].join(":");
1947
- }).join("|")}|${variant}|${orientation}|${showCheck}`,
1948
- [childrenArray, orientation, showCheck, size, variant]
1949
- );
1950
- const groupSizeSignatureRef = React14.useRef(groupSizeSignature);
1951
- React14.useLayoutEffect(() => {
1952
- if (groupSizeSignatureRef.current !== groupSizeSignature) {
1953
- groupSizeSignatureRef.current = groupSizeSignature;
1954
- setLockedGroupSize(null);
1955
- }
1956
- }, [groupSizeSignature]);
1957
- 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;
1958
- const shouldLockGroupSize = activeMorphing && !fullWidth && !hasExplicitGroupSize && count > 1;
1959
- React14.useLayoutEffect(() => {
1960
- if (!shouldLockGroupSize) {
1961
- if (lockedGroupSize !== null) setLockedGroupSize(null);
1962
- return;
1963
- }
1964
- if (lockedGroupSize !== null) return;
1965
- const node = rootRef.current;
1966
- if (!node) return;
1967
- const rect = node.getBoundingClientRect();
1968
- const nextSize = orientation === "horizontal" ? rect.width : rect.height;
1969
- if (nextSize > 0) {
1970
- setLockedGroupSize(Math.ceil(nextSize * 100) / 100);
1971
- }
1972
- }, [lockedGroupSize, orientation, shouldLockGroupSize]);
1973
- const groupStyle = React14.useMemo(() => {
1974
- const nextStyle = __spreadValues({}, style);
1975
- if (shouldLockGroupSize && lockedGroupSize !== null) {
1976
- if (orientation === "horizontal") {
1977
- nextStyle.inlineSize = `${lockedGroupSize}px`;
1978
- } else {
1979
- nextStyle.blockSize = `${lockedGroupSize}px`;
1980
- }
1981
- }
1982
- return nextStyle;
1983
- }, [lockedGroupSize, orientation, shouldLockGroupSize, style]);
1984
- const hasSelected = React14.useMemo(
1985
- () => childrenArray.some(
1986
- (child) => child.props.selected
1987
- ),
1988
- [childrenArray]
1989
- );
1990
- const handlePointerLeaveAndUp = React14.useCallback(() => {
2203
+ const handlePointerLeaveAndUp = React16.useCallback(() => {
1991
2204
  setPressedIndex(null);
1992
2205
  }, []);
1993
2206
  return /* @__PURE__ */ jsx(
1994
2207
  "fieldset",
1995
2208
  __spreadProps(__spreadValues({
1996
- ref: setRootRef,
2209
+ ref,
1997
2210
  className: cn(
1998
2211
  "inline-flex p-0 m-0 border-none max-w-full [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
1999
2212
  orientation === "vertical" ? "flex-col items-stretch overflow-y-auto overflow-x-hidden" : "flex-row overflow-x-auto overflow-y-hidden",
@@ -2002,18 +2215,17 @@ var ButtonGroupComponent = React14.forwardRef(
2002
2215
  fullWidth && orientation === "vertical" && "h-full",
2003
2216
  className
2004
2217
  ),
2005
- style: groupStyle,
2218
+ style,
2006
2219
  onPointerLeave: handlePointerLeaveAndUp,
2007
2220
  onPointerUp: handlePointerLeaveAndUp
2008
2221
  }, props), {
2009
2222
  children: childrenArray.map((child, index) => {
2010
- var _a2, _b2;
2223
+ var _a2;
2011
2224
  const element = child;
2012
2225
  const isSelected = element.props.selected === true;
2013
2226
  const isFirst = index === 0;
2014
2227
  const isLast = index === count - 1;
2015
2228
  const itemSize = size || element.props.size || "sm";
2016
- const basePx = ((_a2 = BUTTON_SIZE_TOKENS[itemSize]) == null ? void 0 : _a2.leadingSpace) || "1rem";
2017
2229
  const isPressed = pressedIndex === index;
2018
2230
  const { icon: explicitIcon, label: explicitLabel } = resolveIconAndLabel(
2019
2231
  element,
@@ -2030,25 +2242,6 @@ var ButtonGroupComponent = React14.forwardRef(
2030
2242
  isLast,
2031
2243
  itemSize
2032
2244
  );
2033
- const flex = resolveFlexTargets(
2034
- variant,
2035
- orientation,
2036
- isSelected,
2037
- isPressed,
2038
- hasSelected,
2039
- count,
2040
- fullWidth,
2041
- activeMorphing,
2042
- morphingWidth,
2043
- expandedRatio,
2044
- basePx
2045
- );
2046
- const dynamicStyle = __spreadValues({}, element.props.style);
2047
- if (flex.flexGrow !== void 0 && fullWidth) {
2048
- dynamicStyle.flexBasis = 0;
2049
- dynamicStyle.flexShrink = 1;
2050
- dynamicStyle.minWidth = 0;
2051
- }
2052
2245
  const existingAnimate = typeof element.props.animate === "object" && !Array.isArray(element.props.animate) ? element.props.animate : {};
2053
2246
  const existingWhileTap = typeof element.props.whileTap === "object" && !Array.isArray(element.props.whileTap) ? element.props.whileTap : {};
2054
2247
  const motionProps = buildMotionProps(
@@ -2057,13 +2250,12 @@ var ButtonGroupComponent = React14.forwardRef(
2057
2250
  isPressed,
2058
2251
  itemSize,
2059
2252
  shapes,
2060
- flex,
2061
2253
  existingAnimate,
2062
2254
  existingWhileTap
2063
2255
  );
2064
2256
  const connectedClasses = variant === "connected" && isSelected ? "z-20" : "";
2065
- const clonedElement = React14.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
2066
- key: (_b2 = element.key) != null ? _b2 : index,
2257
+ const clonedElement = React16.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
2258
+ key: (_a2 = element.key) != null ? _a2 : index,
2067
2259
  tabIndex: isFirst ? 0 : -1,
2068
2260
  size: size || element.props.size,
2069
2261
  icon: explicitIcon,
@@ -2077,9 +2269,9 @@ var ButtonGroupComponent = React14.forwardRef(
2077
2269
  connectedClasses,
2078
2270
  "focus-visible:z-10 hover:z-10 relative min-w-0",
2079
2271
  orientation === "vertical" && "w-full",
2272
+ fullWidth && "flex-1",
2080
2273
  itemClassName
2081
2274
  ),
2082
- style: dynamicStyle,
2083
2275
  onPointerDown: (e) => {
2084
2276
  setPressedIndex(index);
2085
2277
  if (element.props.onPointerDown) element.props.onPointerDown(e);
@@ -2092,7 +2284,7 @@ var ButtonGroupComponent = React14.forwardRef(
2092
2284
  }
2093
2285
  );
2094
2286
  ButtonGroupComponent.displayName = "ButtonGroup";
2095
- var ButtonGroup = React14.memo(ButtonGroupComponent);
2287
+ var ButtonGroup = React16.memo(ButtonGroupComponent);
2096
2288
  var SIZE_HEIGHT = {
2097
2289
  sm: "h-14",
2098
2290
  md: "h-20",
@@ -2147,9 +2339,9 @@ var COLOR_CLASSES = {
2147
2339
  }
2148
2340
  };
2149
2341
  function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
2150
- const [collapsed, setCollapsed] = React14.useState(false);
2151
- const lastScrollY = React14.useRef(0);
2152
- React14.useEffect(() => {
2342
+ const [collapsed, setCollapsed] = React16.useState(false);
2343
+ const lastScrollY = React16.useRef(0);
2344
+ React16.useEffect(() => {
2153
2345
  if (!enabled || typeof window === "undefined") return;
2154
2346
  lastScrollY.current = window.scrollY;
2155
2347
  const handleScroll = () => {
@@ -2172,7 +2364,7 @@ function useScrollCollapse(enabled, scrollThreshold, onCollapsedChange) {
2172
2364
  }, [enabled, scrollThreshold, collapsed, onCollapsedChange]);
2173
2365
  return collapsed;
2174
2366
  }
2175
- var ExtendedFABComponent = React14.forwardRef(
2367
+ var ExtendedFABComponent = React16.forwardRef(
2176
2368
  (_a, ref) => {
2177
2369
  var _b = _a, {
2178
2370
  className,
@@ -2218,10 +2410,10 @@ var ExtendedFABComponent = React14.forwardRef(
2218
2410
  "aria-label"
2219
2411
  ]);
2220
2412
  var _a2, _b2, _c, _d;
2221
- const localRef = React14.useRef(null);
2222
- React14.useImperativeHandle(ref, () => localRef.current);
2223
- const [dir, setDir] = React14.useState("ltr");
2224
- React14.useEffect(() => {
2413
+ const localRef = React16.useRef(null);
2414
+ React16.useImperativeHandle(ref, () => localRef.current);
2415
+ const [dir, setDir] = React16.useState("ltr");
2416
+ React16.useEffect(() => {
2225
2417
  var _a3;
2226
2418
  if (!localRef.current) return;
2227
2419
  const closestDir = (_a3 = localRef.current.closest("[dir]")) == null ? void 0 : _a3.getAttribute("dir");
@@ -2242,7 +2434,7 @@ var ExtendedFABComponent = React14.forwardRef(
2242
2434
  const { ripples, onPointerDown, removeRipple } = useRippleState({
2243
2435
  disabled: loading
2244
2436
  });
2245
- const handleClick = React14.useCallback(
2437
+ const handleClick = React16.useCallback(
2246
2438
  (e) => {
2247
2439
  if (loading) {
2248
2440
  e.preventDefault();
@@ -2252,7 +2444,7 @@ var ExtendedFABComponent = React14.forwardRef(
2252
2444
  },
2253
2445
  [loading, onClick]
2254
2446
  );
2255
- const handleKeyDown = React14.useCallback(
2447
+ const handleKeyDown = React16.useCallback(
2256
2448
  (e) => {
2257
2449
  if (loading) return;
2258
2450
  if ((e.key === "Enter" || e.key === " ") && onClick) {
@@ -2360,8 +2552,8 @@ var ExtendedFABComponent = React14.forwardRef(
2360
2552
  }),
2361
2553
  className: containerClassName
2362
2554
  }, restProps), {
2363
- children: React14.cloneElement(
2364
- React14.Children.only(children),
2555
+ children: React16.cloneElement(
2556
+ React16.Children.only(children),
2365
2557
  { children: innerContent }
2366
2558
  )
2367
2559
  })
@@ -2405,7 +2597,7 @@ var ExtendedFABComponent = React14.forwardRef(
2405
2597
  }
2406
2598
  );
2407
2599
  ExtendedFABComponent.displayName = "ExtendedFAB";
2408
- var ExtendedFAB = React14.memo(ExtendedFABComponent);
2600
+ var ExtendedFAB = React16.memo(ExtendedFABComponent);
2409
2601
  var SIZE_STYLES = {
2410
2602
  sm: "h-10 w-10",
2411
2603
  md: "h-14 w-14",
@@ -2476,7 +2668,7 @@ function FABPosition({
2476
2668
  }
2477
2669
  );
2478
2670
  }
2479
- var FABComponent = React14.forwardRef(
2671
+ var FABComponent = React16.forwardRef(
2480
2672
  (_a, ref) => {
2481
2673
  var _b = _a, {
2482
2674
  className,
@@ -2523,7 +2715,7 @@ var FABComponent = React14.forwardRef(
2523
2715
  const { ripples, onPointerDown, removeRipple } = useRippleState({
2524
2716
  disabled: loading
2525
2717
  });
2526
- const handleClick = React14.useCallback(
2718
+ const handleClick = React16.useCallback(
2527
2719
  (e) => {
2528
2720
  if (loading) {
2529
2721
  e.preventDefault();
@@ -2533,7 +2725,7 @@ var FABComponent = React14.forwardRef(
2533
2725
  },
2534
2726
  [loading, onClick]
2535
2727
  );
2536
- const handleKeyDown = React14.useCallback(
2728
+ const handleKeyDown = React16.useCallback(
2537
2729
  (e) => {
2538
2730
  if (loading) return;
2539
2731
  if ((e.key === "Enter" || e.key === " ") && onClick) {
@@ -2544,7 +2736,7 @@ var FABComponent = React14.forwardRef(
2544
2736
  },
2545
2737
  [loading, onClick, onKeyDown]
2546
2738
  );
2547
- const labelContent = asChild ? React14.Children.only(children).props.children : children;
2739
+ const labelContent = asChild ? React16.Children.only(children).props.children : children;
2548
2740
  const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
2549
2741
  needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
2550
2742
  /* @__PURE__ */ jsx(Ripple, { ripples, onRippleDone: removeRipple }),
@@ -2632,8 +2824,8 @@ var FABComponent = React14.forwardRef(
2632
2824
  }),
2633
2825
  className: containerClassName
2634
2826
  }, restProps), {
2635
- children: React14.cloneElement(
2636
- React14.Children.only(children),
2827
+ children: React16.cloneElement(
2828
+ React16.Children.only(children),
2637
2829
  { children: innerContent }
2638
2830
  )
2639
2831
  })
@@ -2670,7 +2862,7 @@ var FABComponent = React14.forwardRef(
2670
2862
  }
2671
2863
  );
2672
2864
  FABComponent.displayName = "FAB";
2673
- var FAB = React14.memo(FABComponent);
2865
+ var FAB = React16.memo(FABComponent);
2674
2866
  var SPRING_NORMAL = { stiffness: 700, damping: 40 };
2675
2867
  var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
2676
2868
  var FOCUS_DELAY_MS = 50;
@@ -2778,7 +2970,7 @@ function CloseIcon() {
2778
2970
  function defaultFabIcon(progress) {
2779
2971
  return progress > 0.5 ? /* @__PURE__ */ jsx(CloseIcon, {}) : /* @__PURE__ */ jsx(AddIcon, {});
2780
2972
  }
2781
- var ToggleFABComponent = React14.forwardRef(
2973
+ var ToggleFABComponent = React16.forwardRef(
2782
2974
  ({
2783
2975
  expanded,
2784
2976
  onToggle,
@@ -2796,7 +2988,7 @@ var ToggleFABComponent = React14.forwardRef(
2796
2988
  const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
2797
2989
  const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
2798
2990
  const checkedProgress = useSpring(expanded ? 1 : 0, springConfig);
2799
- React14.useEffect(() => {
2991
+ React16.useEffect(() => {
2800
2992
  checkedProgress.set(expanded ? 1 : 0);
2801
2993
  }, [expanded, checkedProgress]);
2802
2994
  const borderRadius = useTransform(
@@ -2804,12 +2996,12 @@ var ToggleFABComponent = React14.forwardRef(
2804
2996
  [0, 1],
2805
2997
  [`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
2806
2998
  );
2807
- const [iconProgress, setIconProgress] = React14.useState(expanded ? 1 : 0);
2808
- React14.useEffect(() => {
2999
+ const [iconProgress, setIconProgress] = React16.useState(expanded ? 1 : 0);
3000
+ React16.useEffect(() => {
2809
3001
  return checkedProgress.on("change", setIconProgress);
2810
3002
  }, [checkedProgress]);
2811
3003
  const { ripples, onPointerDown, removeRipple } = useRippleState();
2812
- const handleClick = React14.useCallback(() => {
3004
+ const handleClick = React16.useCallback(() => {
2813
3005
  onToggle(!expanded);
2814
3006
  }, [expanded, onToggle]);
2815
3007
  return /* @__PURE__ */ jsxs(
@@ -2858,7 +3050,7 @@ var ToggleFABComponent = React14.forwardRef(
2858
3050
  }
2859
3051
  );
2860
3052
  ToggleFABComponent.displayName = "ToggleFAB";
2861
- var ToggleFAB = React14.memo(ToggleFABComponent);
3053
+ var ToggleFAB = React16.memo(ToggleFABComponent);
2862
3054
  function FABMenuItem({
2863
3055
  icon,
2864
3056
  label,
@@ -2873,7 +3065,7 @@ function FABMenuItem({
2873
3065
  var _a;
2874
3066
  const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
2875
3067
  const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
2876
- const handleClick = React14.useCallback(
3068
+ const handleClick = React16.useCallback(
2877
3069
  (e) => {
2878
3070
  if (disabled) {
2879
3071
  e.preventDefault();
@@ -2883,7 +3075,7 @@ function FABMenuItem({
2883
3075
  },
2884
3076
  [disabled, onClick]
2885
3077
  );
2886
- const handleKeyDown = React14.useCallback(
3078
+ const handleKeyDown = React16.useCallback(
2887
3079
  (e) => {
2888
3080
  if (disabled) return;
2889
3081
  if (e.key === "Enter" || e.key === " ") {
@@ -2925,7 +3117,7 @@ function FABMenuItem({
2925
3117
  borderRadius: `${MENU_ITEM_STYLES.cornerRadius}px`
2926
3118
  };
2927
3119
  if (asChild) {
2928
- const child = React14.Children.only(children);
3120
+ const child = React16.Children.only(children);
2929
3121
  return /* @__PURE__ */ jsx(m.div, { variants: MENU_ITEM_VARIANTS, style: containerStyle, children: /* @__PURE__ */ jsx(
2930
3122
  Slot,
2931
3123
  {
@@ -2937,7 +3129,7 @@ function FABMenuItem({
2937
3129
  onPointerDown,
2938
3130
  onKeyDown: handleKeyDown,
2939
3131
  className: containerClassName,
2940
- children: React14.cloneElement(child, { children: innerContent })
3132
+ children: React16.cloneElement(child, { children: innerContent })
2941
3133
  }
2942
3134
  ) });
2943
3135
  }
@@ -2970,13 +3162,13 @@ function FABMenu({
2970
3162
  focusLast = true,
2971
3163
  "aria-label": ariaLabel
2972
3164
  }) {
2973
- const fabId = React14.useId();
2974
- const menuId = React14.useId();
2975
- const toggleRef = React14.useRef(null);
2976
- const itemRefs = React14.useRef([]);
2977
- const [focusedIndex, setFocusedIndex] = React14.useState(-1);
2978
- const reversedItems = React14.useMemo(() => [...items].reverse(), [items]);
2979
- const focusItem = React14.useCallback((index) => {
3165
+ const fabId = React16.useId();
3166
+ const menuId = React16.useId();
3167
+ const toggleRef = React16.useRef(null);
3168
+ const itemRefs = React16.useRef([]);
3169
+ const [focusedIndex, setFocusedIndex] = React16.useState(-1);
3170
+ const reversedItems = React16.useMemo(() => [...items].reverse(), [items]);
3171
+ const focusItem = React16.useCallback((index) => {
2980
3172
  var _a;
2981
3173
  const clampedIndex = Math.max(
2982
3174
  0,
@@ -2985,8 +3177,8 @@ function FABMenu({
2985
3177
  setFocusedIndex(clampedIndex);
2986
3178
  (_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
2987
3179
  }, []);
2988
- const wasExpandedRef = React14.useRef(false);
2989
- React14.useEffect(() => {
3180
+ const wasExpandedRef = React16.useRef(false);
3181
+ React16.useEffect(() => {
2990
3182
  var _a;
2991
3183
  if (expanded) {
2992
3184
  wasExpandedRef.current = true;
@@ -3001,7 +3193,7 @@ function FABMenu({
3001
3193
  wasExpandedRef.current = false;
3002
3194
  setFocusedIndex(-1);
3003
3195
  }, [expanded, focusLast, items.length, focusItem]);
3004
- const handleMenuKeyDown = React14.useCallback(
3196
+ const handleMenuKeyDown = React16.useCallback(
3005
3197
  (e) => {
3006
3198
  if (!expanded) return;
3007
3199
  const lastIndex = items.length - 1;
@@ -3125,12 +3317,39 @@ function FABMenu({
3125
3317
  )
3126
3318
  ] });
3127
3319
  }
3128
- var SIZE_STYLES2 = {
3129
- xs: "h-8 w-8",
3130
- sm: "h-10 w-10",
3131
- md: "h-14 w-14",
3132
- lg: "h-24 w-24",
3133
- xl: "h-[8.5rem] w-[8.5rem]"
3320
+ var SIZE_HEIGHT_STYLES = {
3321
+ xs: "h-8",
3322
+ sm: "h-10",
3323
+ md: "h-14",
3324
+ lg: "h-24",
3325
+ xl: "h-[8.5rem]"
3326
+ };
3327
+ var WIDTH_SIZE_STYLES = {
3328
+ xs: {
3329
+ default: "w-8",
3330
+ narrow: "w-8",
3331
+ wide: "w-12"
3332
+ },
3333
+ sm: {
3334
+ default: "w-10",
3335
+ narrow: "w-12",
3336
+ wide: "w-[3.25rem]"
3337
+ },
3338
+ md: {
3339
+ default: "w-14",
3340
+ narrow: "w-12",
3341
+ wide: "w-[4.5rem]"
3342
+ },
3343
+ lg: {
3344
+ default: "w-24",
3345
+ narrow: "w-16",
3346
+ wide: "w-32"
3347
+ },
3348
+ xl: {
3349
+ default: "w-[8.5rem]",
3350
+ narrow: "w-[6.5rem]",
3351
+ wide: "w-[11.5rem]"
3352
+ }
3134
3353
  };
3135
3354
  var SIZE_ICON3 = {
3136
3355
  xs: { cls: "size-5", px: 20 },
@@ -3223,7 +3442,7 @@ function resolveDisabledBgClass(colorStyle) {
3223
3442
  }
3224
3443
  return "disabled:text-m3-on-surface/[0.38]";
3225
3444
  }
3226
- var IconButtonComponent = React14.forwardRef(
3445
+ var IconButtonComponent = React16.forwardRef(
3227
3446
  (_a, ref) => {
3228
3447
  var _b = _a, {
3229
3448
  className,
@@ -3231,8 +3450,10 @@ var IconButtonComponent = React14.forwardRef(
3231
3450
  variant = "default",
3232
3451
  colorStyle = "standard",
3233
3452
  size = "sm",
3453
+ widthVariant = "default",
3234
3454
  shape = "round",
3235
3455
  selected,
3456
+ selectedIcon,
3236
3457
  loading = false,
3237
3458
  loadingVariant = "loading-indicator",
3238
3459
  iconSize,
@@ -3247,8 +3468,10 @@ var IconButtonComponent = React14.forwardRef(
3247
3468
  "variant",
3248
3469
  "colorStyle",
3249
3470
  "size",
3471
+ "widthVariant",
3250
3472
  "shape",
3251
3473
  "selected",
3474
+ "selectedIcon",
3252
3475
  "loading",
3253
3476
  "loadingVariant",
3254
3477
  "iconSize",
@@ -3258,21 +3481,21 @@ var IconButtonComponent = React14.forwardRef(
3258
3481
  "onKeyDown",
3259
3482
  "aria-label"
3260
3483
  ]);
3261
- var _a2, _b2;
3484
+ var _a2, _b2, _c, _d, _e;
3262
3485
  const isToggle = variant === "toggle";
3263
3486
  const isSelected = isToggle && !!selected;
3264
- const resolvedColorClass = React14.useMemo(
3487
+ const resolvedColorClass = React16.useMemo(
3265
3488
  () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
3266
3489
  [isSelected, colorStyle]
3267
3490
  );
3268
- const outlineWidthClass = React14.useMemo(
3491
+ const outlineWidthClass = React16.useMemo(
3269
3492
  () => {
3270
3493
  var _a3;
3271
3494
  return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
3272
3495
  },
3273
3496
  [colorStyle, isSelected, size]
3274
3497
  );
3275
- const disabledBgClass = React14.useMemo(
3498
+ const disabledBgClass = React16.useMemo(
3276
3499
  () => resolveDisabledBgClass(colorStyle),
3277
3500
  [colorStyle]
3278
3501
  );
@@ -3289,11 +3512,13 @@ var IconButtonComponent = React14.forwardRef(
3289
3512
  const defaultIconPx = sizeIcon.px;
3290
3513
  const iconPx = iconSize != null ? iconSize : defaultIconPx;
3291
3514
  const isCustomSize = iconSize != null && iconSize !== "inherit";
3515
+ const heightClass = (_c = SIZE_HEIGHT_STYLES[size]) != null ? _c : SIZE_HEIGHT_STYLES.sm;
3516
+ const widthClass = (_e = ((_d = WIDTH_SIZE_STYLES[size]) != null ? _d : WIDTH_SIZE_STYLES.sm)[widthVariant]) != null ? _e : WIDTH_SIZE_STYLES.sm.default;
3292
3517
  const needsTouchTarget = size === "xs" || size === "sm";
3293
3518
  const { ripples, onPointerDown, removeRipple } = useRippleState({
3294
3519
  disabled: loading
3295
3520
  });
3296
- const handleClick = React14.useCallback(
3521
+ const handleClick = React16.useCallback(
3297
3522
  (e) => {
3298
3523
  if (loading) {
3299
3524
  e.preventDefault();
@@ -3303,7 +3528,7 @@ var IconButtonComponent = React14.forwardRef(
3303
3528
  },
3304
3529
  [loading, onClick]
3305
3530
  );
3306
- const handleKeyDown = React14.useCallback(
3531
+ const handleKeyDown = React16.useCallback(
3307
3532
  (e) => {
3308
3533
  if (loading) return;
3309
3534
  if ((e.key === "Enter" || e.key === " ") && onClick) {
@@ -3351,7 +3576,7 @@ var IconButtonComponent = React14.forwardRef(
3351
3576
  transition: SPRING_TRANSITION,
3352
3577
  "aria-hidden": "true",
3353
3578
  className: cn(
3354
- "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]!",
3579
+ "flex items-center justify-center shrink-0 [&_svg]:w-full [&_svg]:h-full [&_.md-icon]:text-[length:inherit]",
3355
3580
  iconSize != null ? void 0 : iconClass
3356
3581
  ),
3357
3582
  style: {
@@ -3359,9 +3584,9 @@ var IconButtonComponent = React14.forwardRef(
3359
3584
  width: isCustomSize ? `${iconSize}px` : void 0,
3360
3585
  height: isCustomSize ? `${iconSize}px` : void 0
3361
3586
  },
3362
- children: asChild ? React14.Children.only(children).props.children : children
3587
+ children: isSelected && selectedIcon ? selectedIcon : asChild ? React16.Children.only(children).props.children : children
3363
3588
  }),
3364
- "content"
3589
+ isSelected && selectedIcon ? "selected-content" : "content"
3365
3590
  ) })
3366
3591
  ] });
3367
3592
  const containerClassName = cn(
@@ -3370,12 +3595,13 @@ var IconButtonComponent = React14.forwardRef(
3370
3595
  outlineWidthClass,
3371
3596
  disabledBgClass,
3372
3597
  "overflow-hidden",
3373
- SIZE_STYLES2[size],
3598
+ heightClass,
3599
+ widthClass,
3374
3600
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
3375
3601
  className
3376
3602
  );
3377
3603
  if (asChild) {
3378
- const child = React14.Children.only(children);
3604
+ const child = React16.Children.only(children);
3379
3605
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
3380
3606
  Slot,
3381
3607
  __spreadProps(__spreadValues({
@@ -3387,10 +3613,12 @@ var IconButtonComponent = React14.forwardRef(
3387
3613
  onClick: handleClick,
3388
3614
  onPointerDown,
3389
3615
  onKeyDown: handleKeyDown,
3390
- style: __spreadProps(__spreadValues({}, style), { borderRadius: `${animateRadius}px` }),
3616
+ style: __spreadProps(__spreadValues({}, style), {
3617
+ borderRadius: `${animateRadius}px`
3618
+ }),
3391
3619
  className: containerClassName
3392
3620
  }, restProps), {
3393
- children: React14.cloneElement(child, { children: innerContent })
3621
+ children: React16.cloneElement(child, { children: innerContent })
3394
3622
  })
3395
3623
  ) });
3396
3624
  }
@@ -3418,12 +3646,12 @@ var IconButtonComponent = React14.forwardRef(
3418
3646
  }
3419
3647
  );
3420
3648
  IconButtonComponent.displayName = "IconButton";
3421
- var IconButton = React14.memo(IconButtonComponent);
3422
- var SplitButtonContext = React14.createContext(null);
3649
+ var IconButton = React16.memo(IconButtonComponent);
3650
+ var SplitButtonContext = React16.createContext(null);
3423
3651
  function useSplitButtonContext() {
3424
- return React14.useContext(SplitButtonContext);
3652
+ return React16.useContext(SplitButtonContext);
3425
3653
  }
3426
- var SplitButtonLayoutComponent = React14.forwardRef(
3654
+ var SplitButtonLayoutComponent = React16.forwardRef(
3427
3655
  (_a, ref) => {
3428
3656
  var _b = _a, {
3429
3657
  leadingButton,
@@ -3440,10 +3668,10 @@ var SplitButtonLayoutComponent = React14.forwardRef(
3440
3668
  "variant",
3441
3669
  "size"
3442
3670
  ]);
3443
- const leadingProps = React14.isValidElement(leadingButton) ? leadingButton.props : {};
3671
+ const leadingProps = React16.isValidElement(leadingButton) ? leadingButton.props : {};
3444
3672
  const size = layoutSize || leadingProps.size;
3445
3673
  const variant = layoutVariant || leadingProps.variant;
3446
- const contextValue = React14.useMemo(
3674
+ const contextValue = React16.useMemo(
3447
3675
  () => ({
3448
3676
  size,
3449
3677
  variant
@@ -3469,8 +3697,8 @@ var SplitButtonLayoutComponent = React14.forwardRef(
3469
3697
  }
3470
3698
  );
3471
3699
  SplitButtonLayoutComponent.displayName = "SplitButtonLayout";
3472
- var SplitButtonLayout = React14.memo(SplitButtonLayoutComponent);
3473
- var StateLayer = React14.forwardRef(
3700
+ var SplitButtonLayout = React16.memo(SplitButtonLayoutComponent);
3701
+ var StateLayer = React16.forwardRef(
3474
3702
  (_a, ref) => {
3475
3703
  var _b = _a, { className, hovered, focused, pressed } = _b, props = __objRest(_b, ["className", "hovered", "focused", "pressed"]);
3476
3704
  let opacity = 0;
@@ -3722,7 +3950,7 @@ var splitButtonVariants = cva(
3722
3950
  }
3723
3951
  }
3724
3952
  );
3725
- var SplitButtonLeadingComponent = React14.forwardRef(
3953
+ var SplitButtonLeadingComponent = React16.forwardRef(
3726
3954
  (_a, ref) => {
3727
3955
  var _b = _a, {
3728
3956
  className,
@@ -3761,9 +3989,9 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3761
3989
  const context = useSplitButtonContext();
3762
3990
  const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
3763
3991
  const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
3764
- const [isHovered, setIsHovered] = React14.useState(false);
3765
- const [isFocused, setIsFocused] = React14.useState(false);
3766
- const [isPressed, setIsPressed] = React14.useState(false);
3992
+ const [isHovered, setIsHovered] = React16.useState(false);
3993
+ const [isFocused, setIsFocused] = React16.useState(false);
3994
+ const [isPressed, setIsPressed] = React16.useState(false);
3767
3995
  const tokens = SPLIT_BUTTON_TOKENS[actualSize];
3768
3996
  const typographyClass = (_c = BUTTON_TYPOGRAPHY_TOKENS[actualSize]) != null ? _c : BUTTON_TYPOGRAPHY_TOKENS.sm;
3769
3997
  const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
@@ -3775,7 +4003,7 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3775
4003
  const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
3776
4004
  const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
3777
4005
  const borderRadius = `${outerRadius}px ${innerCornerRadius}px ${innerCornerRadius}px ${outerRadius}px`;
3778
- const handleClick = React14.useCallback(
4006
+ const handleClick = React16.useCallback(
3779
4007
  (e) => {
3780
4008
  if (disabled) {
3781
4009
  e.preventDefault();
@@ -3785,7 +4013,7 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3785
4013
  },
3786
4014
  [disabled, onClick]
3787
4015
  );
3788
- const handlePointerDown = React14.useCallback(
4016
+ const handlePointerDown = React16.useCallback(
3789
4017
  (e) => {
3790
4018
  onRipplePointerDown(e);
3791
4019
  setIsPressed(true);
@@ -3793,19 +4021,19 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3793
4021
  },
3794
4022
  [onRipplePointerDown, onPointerDown]
3795
4023
  );
3796
- const handlePointerUp = React14.useCallback(
4024
+ const handlePointerUp = React16.useCallback(
3797
4025
  (e) => {
3798
4026
  setIsPressed(false);
3799
4027
  onPointerUp == null ? void 0 : onPointerUp(e);
3800
4028
  },
3801
4029
  [onPointerUp]
3802
4030
  );
3803
- const handlePointerEnter = React14.useCallback(() => {
4031
+ const handlePointerEnter = React16.useCallback(() => {
3804
4032
  if (!disabled) {
3805
4033
  setIsHovered(true);
3806
4034
  }
3807
4035
  }, [disabled]);
3808
- const handlePointerLeave = React14.useCallback(
4036
+ const handlePointerLeave = React16.useCallback(
3809
4037
  (e) => {
3810
4038
  setIsHovered(false);
3811
4039
  setIsPressed(false);
@@ -3813,21 +4041,21 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3813
4041
  },
3814
4042
  [onPointerLeave]
3815
4043
  );
3816
- const handlePointerCancel = React14.useCallback(
4044
+ const handlePointerCancel = React16.useCallback(
3817
4045
  (e) => {
3818
4046
  setIsPressed(false);
3819
4047
  onPointerCancel == null ? void 0 : onPointerCancel(e);
3820
4048
  },
3821
4049
  [onPointerCancel]
3822
4050
  );
3823
- const handleFocus = React14.useCallback(
4051
+ const handleFocus = React16.useCallback(
3824
4052
  (e) => {
3825
4053
  if (!disabled) setIsFocused(true);
3826
4054
  onFocus == null ? void 0 : onFocus(e);
3827
4055
  },
3828
4056
  [disabled, onFocus]
3829
4057
  );
3830
- const handleBlur = React14.useCallback(
4058
+ const handleBlur = React16.useCallback(
3831
4059
  (e) => {
3832
4060
  setIsFocused(false);
3833
4061
  onBlur == null ? void 0 : onBlur(e);
@@ -3835,7 +4063,7 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3835
4063
  [onBlur]
3836
4064
  );
3837
4065
  const leadingIconSize = LEADING_ICON_SIZE_FOR_SIZE[actualSize];
3838
- const labelContent = asChild ? React14.Children.only(children).props.children : children;
4066
+ const labelContent = asChild ? React16.Children.only(children).props.children : children;
3839
4067
  const innerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
3840
4068
  needsTouchTarget && /* @__PURE__ */ jsx(TouchTarget, {}),
3841
4069
  /* @__PURE__ */ jsx(
@@ -3892,8 +4120,8 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3892
4120
  style: mergedStyle,
3893
4121
  className: containerClassName
3894
4122
  }, restProps), {
3895
- children: React14.cloneElement(
3896
- React14.Children.only(children),
4123
+ children: React16.cloneElement(
4124
+ React16.Children.only(children),
3897
4125
  { children: innerContent }
3898
4126
  )
3899
4127
  })
@@ -3926,16 +4154,16 @@ var SplitButtonLeadingComponent = React14.forwardRef(
3926
4154
  }
3927
4155
  );
3928
4156
  SplitButtonLeadingComponent.displayName = "SplitButtonLeading";
3929
- var SplitButtonLeading = React14.memo(SplitButtonLeadingComponent);
3930
- var FilledSplitButtonLeading = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "filled" }, props)));
4157
+ var SplitButtonLeading = React16.memo(SplitButtonLeadingComponent);
4158
+ var FilledSplitButtonLeading = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "filled" }, props)));
3931
4159
  FilledSplitButtonLeading.displayName = "FilledSplitButtonLeading";
3932
- var TonalSplitButtonLeading = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "tonal" }, props)));
4160
+ var TonalSplitButtonLeading = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "tonal" }, props)));
3933
4161
  TonalSplitButtonLeading.displayName = "TonalSplitButtonLeading";
3934
- var ElevatedSplitButtonLeading = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "elevated" }, props)));
4162
+ var ElevatedSplitButtonLeading = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "elevated" }, props)));
3935
4163
  ElevatedSplitButtonLeading.displayName = "ElevatedSplitButtonLeading";
3936
- var OutlinedSplitButtonLeading = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "outlined" }, props)));
4164
+ var OutlinedSplitButtonLeading = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonLeading, __spreadValues({ ref, variant: "outlined" }, props)));
3937
4165
  OutlinedSplitButtonLeading.displayName = "OutlinedSplitButtonLeading";
3938
- var SplitButtonTrailingComponent = React14.forwardRef(
4166
+ var SplitButtonTrailingComponent = React16.forwardRef(
3939
4167
  (_a, ref) => {
3940
4168
  var _b = _a, {
3941
4169
  className,
@@ -3978,9 +4206,9 @@ var SplitButtonTrailingComponent = React14.forwardRef(
3978
4206
  const context = useSplitButtonContext();
3979
4207
  const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
3980
4208
  const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
3981
- const [isHovered, setIsHovered] = React14.useState(false);
3982
- const [isFocused, setIsFocused] = React14.useState(false);
3983
- const [isPressed, setIsPressed] = React14.useState(false);
4209
+ const [isHovered, setIsHovered] = React16.useState(false);
4210
+ const [isFocused, setIsFocused] = React16.useState(false);
4211
+ const [isPressed, setIsPressed] = React16.useState(false);
3984
4212
  const tokens = SPLIT_BUTTON_TOKENS[actualSize];
3985
4213
  const prefersReducedMotion = useReducedMotion();
3986
4214
  const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
@@ -3992,12 +4220,12 @@ var SplitButtonTrailingComponent = React14.forwardRef(
3992
4220
  const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
3993
4221
  const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
3994
4222
  const borderRadius = checked ? `${outerRadius}px ${outerRadius}px ${outerRadius}px ${outerRadius}px` : `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
3995
- const handleToggle = React14.useCallback(() => {
4223
+ const handleToggle = React16.useCallback(() => {
3996
4224
  if (!disabled) {
3997
4225
  onCheckedChange(!checked);
3998
4226
  }
3999
4227
  }, [disabled, checked, onCheckedChange]);
4000
- const handlePointerDown = React14.useCallback(
4228
+ const handlePointerDown = React16.useCallback(
4001
4229
  (e) => {
4002
4230
  onRipplePointerDown(e);
4003
4231
  setIsPressed(true);
@@ -4005,19 +4233,19 @@ var SplitButtonTrailingComponent = React14.forwardRef(
4005
4233
  },
4006
4234
  [onRipplePointerDown, onPointerDown]
4007
4235
  );
4008
- const handlePointerUp = React14.useCallback(
4236
+ const handlePointerUp = React16.useCallback(
4009
4237
  (e) => {
4010
4238
  setIsPressed(false);
4011
4239
  onPointerUp == null ? void 0 : onPointerUp(e);
4012
4240
  },
4013
4241
  [onPointerUp]
4014
4242
  );
4015
- const handlePointerEnter = React14.useCallback(() => {
4243
+ const handlePointerEnter = React16.useCallback(() => {
4016
4244
  if (!disabled) {
4017
4245
  setIsHovered(true);
4018
4246
  }
4019
4247
  }, [disabled]);
4020
- const handlePointerLeave = React14.useCallback(
4248
+ const handlePointerLeave = React16.useCallback(
4021
4249
  (e) => {
4022
4250
  setIsHovered(false);
4023
4251
  setIsPressed(false);
@@ -4025,21 +4253,21 @@ var SplitButtonTrailingComponent = React14.forwardRef(
4025
4253
  },
4026
4254
  [onPointerLeave]
4027
4255
  );
4028
- const handlePointerCancel = React14.useCallback(
4256
+ const handlePointerCancel = React16.useCallback(
4029
4257
  (e) => {
4030
4258
  setIsPressed(false);
4031
4259
  onPointerCancel == null ? void 0 : onPointerCancel(e);
4032
4260
  },
4033
4261
  [onPointerCancel]
4034
4262
  );
4035
- const handleFocus = React14.useCallback(
4263
+ const handleFocus = React16.useCallback(
4036
4264
  (e) => {
4037
4265
  if (!disabled) setIsFocused(true);
4038
4266
  onFocus == null ? void 0 : onFocus(e);
4039
4267
  },
4040
4268
  [disabled, onFocus]
4041
4269
  );
4042
- const handleBlur = React14.useCallback(
4270
+ const handleBlur = React16.useCallback(
4043
4271
  (e) => {
4044
4272
  setIsFocused(false);
4045
4273
  onBlur == null ? void 0 : onBlur(e);
@@ -4108,8 +4336,8 @@ var SplitButtonTrailingComponent = React14.forwardRef(
4108
4336
  style: mergedStyle,
4109
4337
  className: containerClassName
4110
4338
  }, restProps), {
4111
- children: React14.cloneElement(
4112
- React14.Children.only(children),
4339
+ children: React16.cloneElement(
4340
+ React16.Children.only(children),
4113
4341
  { children: innerContent }
4114
4342
  )
4115
4343
  })
@@ -4144,16 +4372,16 @@ var SplitButtonTrailingComponent = React14.forwardRef(
4144
4372
  }
4145
4373
  );
4146
4374
  SplitButtonTrailingComponent.displayName = "SplitButtonTrailing";
4147
- var SplitButtonTrailing = React14.memo(SplitButtonTrailingComponent);
4148
- var FilledSplitButtonTrailing = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "filled" }, props)));
4375
+ var SplitButtonTrailing = React16.memo(SplitButtonTrailingComponent);
4376
+ var FilledSplitButtonTrailing = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "filled" }, props)));
4149
4377
  FilledSplitButtonTrailing.displayName = "FilledSplitButtonTrailing";
4150
- var TonalSplitButtonTrailing = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "tonal" }, props)));
4378
+ var TonalSplitButtonTrailing = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "tonal" }, props)));
4151
4379
  TonalSplitButtonTrailing.displayName = "TonalSplitButtonTrailing";
4152
- var ElevatedSplitButtonTrailing = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "elevated" }, props)));
4380
+ var ElevatedSplitButtonTrailing = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "elevated" }, props)));
4153
4381
  ElevatedSplitButtonTrailing.displayName = "ElevatedSplitButtonTrailing";
4154
- var OutlinedSplitButtonTrailing = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "outlined" }, props)));
4382
+ var OutlinedSplitButtonTrailing = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailing, __spreadValues({ ref, variant: "outlined" }, props)));
4155
4383
  OutlinedSplitButtonTrailing.displayName = "OutlinedSplitButtonTrailing";
4156
- var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4384
+ var SplitButtonTrailingUncheckableComponent = React16.forwardRef(
4157
4385
  (_a, ref) => {
4158
4386
  var _b = _a, {
4159
4387
  className,
@@ -4190,9 +4418,9 @@ var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4190
4418
  const context = useSplitButtonContext();
4191
4419
  const actualSize = (_a2 = context == null ? void 0 : context.size) != null ? _a2 : size;
4192
4420
  const actualVariant = (_b2 = context == null ? void 0 : context.variant) != null ? _b2 : variant;
4193
- const [isHovered, setIsHovered] = React14.useState(false);
4194
- const [isFocused, setIsFocused] = React14.useState(false);
4195
- const [isPressed, setIsPressed] = React14.useState(false);
4421
+ const [isHovered, setIsHovered] = React16.useState(false);
4422
+ const [isFocused, setIsFocused] = React16.useState(false);
4423
+ const [isPressed, setIsPressed] = React16.useState(false);
4196
4424
  const tokens = SPLIT_BUTTON_TOKENS[actualSize];
4197
4425
  const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
4198
4426
  const {
@@ -4203,7 +4431,7 @@ var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4203
4431
  const innerCornerRadius = isPressed || isFocused ? tokens.innerCorner.pressed : isHovered ? tokens.innerCorner.hovered : tokens.innerCorner.default;
4204
4432
  const outerRadius = tokens.containerHeight * tokens.outerCornerPercent / 100;
4205
4433
  const borderRadius = `${innerCornerRadius}px ${outerRadius}px ${outerRadius}px ${innerCornerRadius}px`;
4206
- const handlePointerDown = React14.useCallback(
4434
+ const handlePointerDown = React16.useCallback(
4207
4435
  (e) => {
4208
4436
  onRipplePointerDown(e);
4209
4437
  setIsPressed(true);
@@ -4211,19 +4439,19 @@ var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4211
4439
  },
4212
4440
  [onRipplePointerDown, onPointerDown]
4213
4441
  );
4214
- const handlePointerUp = React14.useCallback(
4442
+ const handlePointerUp = React16.useCallback(
4215
4443
  (e) => {
4216
4444
  setIsPressed(false);
4217
4445
  onPointerUp == null ? void 0 : onPointerUp(e);
4218
4446
  },
4219
4447
  [onPointerUp]
4220
4448
  );
4221
- const handlePointerEnter = React14.useCallback(() => {
4449
+ const handlePointerEnter = React16.useCallback(() => {
4222
4450
  if (!disabled) {
4223
4451
  setIsHovered(true);
4224
4452
  }
4225
4453
  }, [disabled]);
4226
- const handlePointerLeave = React14.useCallback(
4454
+ const handlePointerLeave = React16.useCallback(
4227
4455
  (e) => {
4228
4456
  setIsHovered(false);
4229
4457
  setIsPressed(false);
@@ -4231,21 +4459,21 @@ var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4231
4459
  },
4232
4460
  [onPointerLeave]
4233
4461
  );
4234
- const handlePointerCancel = React14.useCallback(
4462
+ const handlePointerCancel = React16.useCallback(
4235
4463
  (e) => {
4236
4464
  setIsPressed(false);
4237
4465
  onPointerCancel == null ? void 0 : onPointerCancel(e);
4238
4466
  },
4239
4467
  [onPointerCancel]
4240
4468
  );
4241
- const handleFocus = React14.useCallback(
4469
+ const handleFocus = React16.useCallback(
4242
4470
  (e) => {
4243
4471
  if (!disabled) setIsFocused(true);
4244
4472
  onFocus == null ? void 0 : onFocus(e);
4245
4473
  },
4246
4474
  [disabled, onFocus]
4247
4475
  );
4248
- const handleBlur = React14.useCallback(
4476
+ const handleBlur = React16.useCallback(
4249
4477
  (e) => {
4250
4478
  setIsFocused(false);
4251
4479
  onBlur == null ? void 0 : onBlur(e);
@@ -4312,18 +4540,18 @@ var SplitButtonTrailingUncheckableComponent = React14.forwardRef(
4312
4540
  }
4313
4541
  );
4314
4542
  SplitButtonTrailingUncheckableComponent.displayName = "SplitButtonTrailingUncheckable";
4315
- var SplitButtonTrailingUncheckable = React14.memo(
4543
+ var SplitButtonTrailingUncheckable = React16.memo(
4316
4544
  SplitButtonTrailingUncheckableComponent
4317
4545
  );
4318
- var FilledSplitButtonTrailingUncheckable = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "filled" }, props)));
4546
+ var FilledSplitButtonTrailingUncheckable = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "filled" }, props)));
4319
4547
  FilledSplitButtonTrailingUncheckable.displayName = "FilledSplitButtonTrailingUncheckable";
4320
- var TonalSplitButtonTrailingUncheckable = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "tonal" }, props)));
4548
+ var TonalSplitButtonTrailingUncheckable = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "tonal" }, props)));
4321
4549
  TonalSplitButtonTrailingUncheckable.displayName = "TonalSplitButtonTrailingUncheckable";
4322
- var ElevatedSplitButtonTrailingUncheckable = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "elevated" }, props)));
4550
+ var ElevatedSplitButtonTrailingUncheckable = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "elevated" }, props)));
4323
4551
  ElevatedSplitButtonTrailingUncheckable.displayName = "ElevatedSplitButtonTrailingUncheckable";
4324
- var OutlinedSplitButtonTrailingUncheckable = React14.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "outlined" }, props)));
4552
+ var OutlinedSplitButtonTrailingUncheckable = React16.forwardRef((props, ref) => /* @__PURE__ */ jsx(SplitButtonTrailingUncheckable, __spreadValues({ ref, variant: "outlined" }, props)));
4325
4553
  OutlinedSplitButtonTrailingUncheckable.displayName = "OutlinedSplitButtonTrailingUncheckable";
4326
4554
 
4327
- 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 };
4555
+ export { BUTTON_COLOR_TOKENS, BUTTON_GROUP_TOKENS, BUTTON_SIZE_TOKENS, Button, ButtonDistribute, ButtonGroup, ButtonGroupDefaults, DEFAULT_EXPAND_RATIO, DEFAULT_FIXED_SIZE, DEFAULT_GAP, DISTRIBUTE_DURATION_MS, DISTRIBUTE_EASING_BEZIER, DISTRIBUTE_RADIUS_TOKENS, DISTRIBUTE_SPRING_TRANSITION, 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 };
4328
4556
  //# sourceMappingURL=buttons.mjs.map
4329
4557
  //# sourceMappingURL=buttons.mjs.map