@bug-on/m3-expressive 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/buttons.d.mts +1 -1
  3. package/dist/buttons.d.ts +1 -1
  4. package/dist/buttons.js +185 -40
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +186 -41
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core.js +156 -25
  9. package/dist/core.js.map +1 -1
  10. package/dist/core.mjs +157 -26
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/feedback.d.mts +20 -0
  13. package/dist/feedback.d.ts +20 -0
  14. package/dist/feedback.js +156 -25
  15. package/dist/feedback.js.map +1 -1
  16. package/dist/feedback.mjs +157 -26
  17. package/dist/feedback.mjs.map +1 -1
  18. package/dist/forms.d.mts +3 -2
  19. package/dist/forms.d.ts +3 -2
  20. package/dist/forms.js +88 -100
  21. package/dist/forms.js.map +1 -1
  22. package/dist/forms.mjs +88 -100
  23. package/dist/forms.mjs.map +1 -1
  24. package/dist/index.d.mts +3 -3
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +279 -146
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +280 -147
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/layout.js +158 -27
  31. package/dist/layout.js.map +1 -1
  32. package/dist/layout.mjs +159 -28
  33. package/dist/layout.mjs.map +1 -1
  34. package/dist/navigation.js +156 -25
  35. package/dist/navigation.js.map +1 -1
  36. package/dist/navigation.mjs +157 -26
  37. package/dist/navigation.mjs.map +1 -1
  38. package/dist/overlays.js +156 -25
  39. package/dist/overlays.js.map +1 -1
  40. package/dist/overlays.mjs +157 -26
  41. package/dist/overlays.mjs.map +1 -1
  42. package/dist/pickers.js +156 -25
  43. package/dist/pickers.js.map +1 -1
  44. package/dist/pickers.mjs +157 -26
  45. package/dist/pickers.mjs.map +1 -1
  46. package/dist/{split-button-trailing-uncheckable-26qlZvKT.d.mts → split-button-trailing-uncheckable-CIVEYgjY.d.mts} +2 -0
  47. package/dist/{split-button-trailing-uncheckable-CXUVrH64.d.ts → split-button-trailing-uncheckable-DTQJjzsB.d.ts} +2 -0
  48. package/dist/{text-field-DWC7qOvp.d.mts → text-field-CiOmDM_8.d.ts} +52 -51
  49. package/dist/{text-field-DWC7qOvp.d.ts → text-field-Ear3hCSq.d.mts} +52 -51
  50. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { hexFromArgb, Hct, SchemeExpressive, SchemeNeutral, SchemeMonochrome, Sc
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { clsx } from 'clsx';
7
7
  import { twMerge } from 'tailwind-merge';
8
- import { AnimatePresence, m, LazyMotion, domMax, useReducedMotion, useAnimationFrame, useMotionValue, animate, useSpring, useTransform, LayoutGroup, useScroll, useMotionValueEvent } from 'motion/react';
8
+ import { AnimatePresence, m, LazyMotion, domMax, useReducedMotion, useMotionValue, animate, useAnimationFrame, useSpring, useTransform, LayoutGroup, useScroll, useMotionValueEvent } from 'motion/react';
9
9
  import * as RxContextMenu from '@radix-ui/react-context-menu';
10
10
  import { cornerRadius } from '@bug-on/m3-tokens';
11
11
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
@@ -5821,7 +5821,7 @@ LoadingIndicator.displayName = "LoadingIndicator";
5821
5821
  function easeInOutCubic(x) {
5822
5822
  return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
5823
5823
  }
5824
- function generateWavyCircularPath(center, radius, amplitude, wavelength) {
5824
+ function generateWavyCircularPath(center, radius, amplitude, wavelength, phase = 0) {
5825
5825
  const circumference = 2 * Math.PI * radius;
5826
5826
  const numWaves = Math.max(
5827
5827
  3,
@@ -5829,8 +5829,8 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
5829
5829
  );
5830
5830
  const steps = numWaves * 4;
5831
5831
  const dt = 2 * Math.PI / steps;
5832
- const rAt = (t) => radius + amplitude * Math.sin(numWaves * t);
5833
- const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t);
5832
+ const rAt = (t) => radius + amplitude * Math.sin(numWaves * t + phase);
5833
+ const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t + phase);
5834
5834
  const xAt = (t) => center + rAt(t) * Math.cos(t);
5835
5835
  const yAt = (t) => center + rAt(t) * Math.sin(t);
5836
5836
  const dxAt = (t) => drAt(t) * Math.cos(t) - rAt(t) * Math.sin(t);
@@ -5895,15 +5895,18 @@ var CircularProgress = React62.forwardRef(
5895
5895
  size = 48,
5896
5896
  trackHeight = 4,
5897
5897
  shape = "flat",
5898
+ trackShape = "flat",
5898
5899
  amplitude,
5899
5900
  wavelength,
5900
5901
  gapSize = 4,
5902
+ waveSpeed = 1,
5901
5903
  crawlerSpeed = 1,
5902
5904
  color,
5903
5905
  trackColor,
5904
5906
  showTrack = "auto",
5905
5907
  minProgress = DEFAULT_MIN_PROGRESS,
5906
5908
  maxProgress = DEFAULT_MAX_PROGRESS,
5909
+ determinateAnimation = "md3",
5907
5910
  amplitudeRange,
5908
5911
  className,
5909
5912
  "aria-label": ariaLabel
@@ -5912,15 +5915,18 @@ var CircularProgress = React62.forwardRef(
5912
5915
  "size",
5913
5916
  "trackHeight",
5914
5917
  "shape",
5918
+ "trackShape",
5915
5919
  "amplitude",
5916
5920
  "wavelength",
5917
5921
  "gapSize",
5922
+ "waveSpeed",
5918
5923
  "crawlerSpeed",
5919
5924
  "color",
5920
5925
  "trackColor",
5921
5926
  "showTrack",
5922
5927
  "minProgress",
5923
5928
  "maxProgress",
5929
+ "determinateAnimation",
5924
5930
  "amplitudeRange",
5925
5931
  "className",
5926
5932
  "aria-label"
@@ -5933,6 +5939,7 @@ var CircularProgress = React62.forwardRef(
5933
5939
  const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
5934
5940
  const isWavy = shape === "wavy";
5935
5941
  const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
5942
+ const shouldShowDeterminateTrack = showTrack === "auto" ? true : showTrack;
5936
5943
  const BASELINE_SIZE = 48;
5937
5944
  const scaleFactor = size / BASELINE_SIZE;
5938
5945
  const effectiveAmplitude = React62.useMemo(
@@ -5965,19 +5972,50 @@ var CircularProgress = React62.forwardRef(
5965
5972
  const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
5966
5973
  const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
5967
5974
  const ActiveCircleElem = m.circle;
5968
- const ActivePathElem = m.path;
5969
5975
  const indeterminateSvgRef = React62.useRef(null);
5970
5976
  const indeterminateTrackRef = React62.useRef(null);
5971
5977
  const indeterminateActiveRef = React62.useRef(null);
5972
5978
  const indeterminateWavyTrackPathRef = React62.useRef(null);
5973
5979
  const indeterminateWavyActivePathRef = React62.useRef(null);
5980
+ const determinateWavyActivePathRef = React62.useRef(null);
5981
+ const determinateWavyTrackPathRef = React62.useRef(null);
5974
5982
  const cachedPathLengthRef = React62.useRef(0);
5983
+ const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 0);
5984
+ const amplitudeMV = useMotionValue(isWavy ? effectiveAmplitude : 0);
5985
+ React62.useEffect(() => {
5986
+ if (isDeterminate) {
5987
+ animate(fractionMV, clampedValue / 100, {
5988
+ duration: 0.4,
5989
+ ease: [0.2, 0, 0, 1]
5990
+ });
5991
+ }
5992
+ }, [clampedValue, isDeterminate, fractionMV]);
5993
+ React62.useEffect(() => {
5994
+ if (!isDeterminate || !isWavy) return;
5995
+ const fraction = clampedValue / 100;
5996
+ let targetAmp = effectiveAmplitude;
5997
+ if (determinateAnimation === "md3") {
5998
+ targetAmp = fraction <= 0.1 || fraction >= 0.95 ? 0 : effectiveAmplitude;
5999
+ }
6000
+ animate(amplitudeMV, targetAmp, {
6001
+ type: "spring",
6002
+ bounce: 0,
6003
+ duration: 0.5
6004
+ });
6005
+ }, [
6006
+ clampedValue,
6007
+ isDeterminate,
6008
+ isWavy,
6009
+ effectiveAmplitude,
6010
+ amplitudeMV,
6011
+ determinateAnimation
6012
+ ]);
5975
6013
  React62.useLayoutEffect(() => {
5976
6014
  if (!isWavy || !wavyActivePath) {
5977
6015
  cachedPathLengthRef.current = circumference;
5978
6016
  return;
5979
6017
  }
5980
- const el = indeterminateActiveRef.current;
6018
+ const el = indeterminateActiveRef.current || determinateWavyActivePathRef.current;
5981
6019
  if (el && "getTotalLength" in el) {
5982
6020
  try {
5983
6021
  const len = el.getTotalLength();
@@ -5991,7 +6029,65 @@ var CircularProgress = React62.forwardRef(
5991
6029
  cachedPathLengthRef.current = circumference;
5992
6030
  }, [isWavy, circumference, wavyActivePath]);
5993
6031
  useAnimationFrame((time) => {
5994
- if (isDeterminate) return;
6032
+ const safeWaveSpeed = Math.max(0.1, waveSpeed);
6033
+ const wavePhase = time / 1e3 * safeWaveSpeed * 2 * Math.PI;
6034
+ if (isDeterminate) {
6035
+ if (isWavy) {
6036
+ const currentAmp = amplitudeMV.get();
6037
+ const dynamicPath = generateWavyCircularPath(
6038
+ center,
6039
+ radius,
6040
+ currentAmp,
6041
+ effectiveWavelength,
6042
+ wavePhase
6043
+ );
6044
+ if (determinateWavyActivePathRef.current) {
6045
+ determinateWavyActivePathRef.current.setAttribute("d", dynamicPath);
6046
+ }
6047
+ if (trackShape === "wavy" && determinateWavyTrackPathRef.current) {
6048
+ determinateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
6049
+ }
6050
+ const pathEl = determinateWavyActivePathRef.current;
6051
+ let totalLen = cachedPathLengthRef.current || circumference;
6052
+ if (pathEl) {
6053
+ try {
6054
+ const len = pathEl.getTotalLength();
6055
+ if (len > 0) totalLen = len;
6056
+ } catch (e) {
6057
+ }
6058
+ }
6059
+ const activeFrac = Math.max(0, Math.min(1, fractionMV.get()));
6060
+ const activeLen = totalLen * activeFrac;
6061
+ if (determinateWavyActivePathRef.current) {
6062
+ determinateWavyActivePathRef.current.setAttribute(
6063
+ "stroke-dasharray",
6064
+ `${activeLen} ${totalLen}`
6065
+ );
6066
+ determinateWavyActivePathRef.current.setAttribute(
6067
+ "stroke-dashoffset",
6068
+ "0"
6069
+ );
6070
+ }
6071
+ if (shouldShowDeterminateTrack && trackShape === "wavy" && determinateWavyTrackPathRef.current) {
6072
+ const gapFrac = (gapSize + trackHeight) / totalLen;
6073
+ const trackStartFrac = activeFrac + gapFrac;
6074
+ const trackLen = Math.max(
6075
+ 1e-3,
6076
+ totalLen * (1 - activeFrac - 2 * gapFrac)
6077
+ );
6078
+ const trackOff = -totalLen * trackStartFrac;
6079
+ determinateWavyTrackPathRef.current.setAttribute(
6080
+ "stroke-dasharray",
6081
+ `${trackLen} ${totalLen}`
6082
+ );
6083
+ determinateWavyTrackPathRef.current.setAttribute(
6084
+ "stroke-dashoffset",
6085
+ `${trackOff}`
6086
+ );
6087
+ }
6088
+ }
6089
+ return;
6090
+ }
5995
6091
  const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
5996
6092
  const scaledTime = time * safeCrawlerSpeed;
5997
6093
  const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
@@ -6026,7 +6122,8 @@ var CircularProgress = React62.forwardRef(
6026
6122
  center,
6027
6123
  radius,
6028
6124
  currentAmplitude,
6029
- effectiveWavelength
6125
+ effectiveWavelength,
6126
+ wavePhase
6030
6127
  );
6031
6128
  if (indeterminateWavyActivePathRef.current) {
6032
6129
  indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
@@ -6121,7 +6218,7 @@ var CircularProgress = React62.forwardRef(
6121
6218
  style: { width: size, height: size }
6122
6219
  }, restProps), {
6123
6220
  children: /* @__PURE__ */ jsxs(LazyMotion, { features: domMax, strict: true, children: [
6124
- /* @__PURE__ */ jsxs(
6221
+ /* @__PURE__ */ jsx(
6125
6222
  "svg",
6126
6223
  {
6127
6224
  width: size,
@@ -6129,8 +6226,18 @@ var CircularProgress = React62.forwardRef(
6129
6226
  viewBox: `0 0 ${size} ${size}`,
6130
6227
  "aria-hidden": "true",
6131
6228
  style: { transform: "rotate(-90deg)", overflow: "visible" },
6132
- children: [
6133
- isDeterminate ? /* @__PURE__ */ jsx(
6229
+ children: isDeterminate ? isWavy ? /* @__PURE__ */ jsxs(Fragment, { children: [
6230
+ shouldShowDeterminateTrack && (trackShape === "wavy" ? /* @__PURE__ */ jsx(
6231
+ "path",
6232
+ {
6233
+ ref: determinateWavyTrackPathRef,
6234
+ d: wavyActivePath != null ? wavyActivePath : "",
6235
+ fill: "none",
6236
+ stroke: bgTrackColor,
6237
+ strokeWidth: trackHeight,
6238
+ strokeLinecap: "round"
6239
+ }
6240
+ ) : /* @__PURE__ */ jsx(
6134
6241
  m.circle,
6135
6242
  {
6136
6243
  cx: center,
@@ -6139,28 +6246,52 @@ var CircularProgress = React62.forwardRef(
6139
6246
  fill: "none",
6140
6247
  stroke: bgTrackColor,
6141
6248
  strokeWidth: trackHeight,
6142
- initial: { pathLength: trackLength, pathOffset: trackOffset },
6143
- animate: { pathLength: trackLength, pathOffset: trackOffset },
6249
+ initial: {
6250
+ pathLength: trackLength,
6251
+ pathOffset: trackOffset
6252
+ },
6253
+ animate: {
6254
+ pathLength: trackLength,
6255
+ pathOffset: trackOffset
6256
+ },
6144
6257
  transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
6145
6258
  strokeLinecap: "round"
6146
6259
  }
6147
- ) : null,
6148
- isDeterminate && (isWavy ? /* @__PURE__ */ jsx(
6149
- ActivePathElem,
6260
+ )),
6261
+ /* @__PURE__ */ jsx(
6262
+ "path",
6150
6263
  {
6264
+ ref: determinateWavyActivePathRef,
6151
6265
  d: wavyActivePath != null ? wavyActivePath : "",
6152
6266
  fill: "none",
6153
6267
  stroke: activeColor,
6154
6268
  strokeWidth: trackHeight,
6155
- strokeLinecap: "round",
6156
- initial: { pathLength: 0 },
6157
- animate: { pathLength: clampedValue / 100 },
6158
- transition: {
6159
- duration: 0.4,
6160
- ease: [0.2, 0, 0, 1]
6161
- }
6269
+ strokeLinecap: "round"
6162
6270
  }
6163
- ) : /* @__PURE__ */ jsx(
6271
+ )
6272
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6273
+ /* @__PURE__ */ jsx(
6274
+ m.circle,
6275
+ {
6276
+ cx: center,
6277
+ cy: center,
6278
+ r: radius,
6279
+ fill: "none",
6280
+ stroke: bgTrackColor,
6281
+ strokeWidth: trackHeight,
6282
+ initial: {
6283
+ pathLength: trackLength,
6284
+ pathOffset: trackOffset
6285
+ },
6286
+ animate: {
6287
+ pathLength: trackLength,
6288
+ pathOffset: trackOffset
6289
+ },
6290
+ transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
6291
+ strokeLinecap: "round"
6292
+ }
6293
+ ),
6294
+ /* @__PURE__ */ jsx(
6164
6295
  ActiveCircleElem,
6165
6296
  {
6166
6297
  cx: center,
@@ -6177,8 +6308,8 @@ var CircularProgress = React62.forwardRef(
6177
6308
  ease: [0.2, 0, 0, 1]
6178
6309
  }
6179
6310
  }
6180
- ))
6181
- ]
6311
+ )
6312
+ ] }) : null
6182
6313
  }
6183
6314
  ),
6184
6315
  !isDeterminate && /* @__PURE__ */ jsx(
@@ -9341,11 +9472,12 @@ var SplitButtonLayoutComponent = React62.forwardRef(
9341
9472
  "div",
9342
9473
  __spreadProps(__spreadValues({
9343
9474
  ref,
9475
+ role: "group",
9344
9476
  className: cn(
9345
9477
  "inline-flex flex-row items-stretch justify-center w-fit shrink-0 relative",
9346
9478
  className
9347
9479
  ),
9348
- style: { gap: `${spacing}px` }
9480
+ style: __spreadValues({ gap: `${spacing}px` }, restProps.style)
9349
9481
  }, restProps), {
9350
9482
  children: [
9351
9483
  leadingButton,
@@ -9558,11 +9690,11 @@ var LEADING_ICON_SIZE_FOR_SIZE = {
9558
9690
  xl: 40
9559
9691
  };
9560
9692
  var splitButtonSizeVariants = {
9561
- xs: "min-h-[32px]",
9562
- sm: "min-h-[40px]",
9563
- md: "min-h-[56px]",
9564
- lg: "min-h-[96px]",
9565
- xl: "min-h-[136px]"
9693
+ xs: "h-[32px] min-h-[32px]",
9694
+ sm: "h-[40px] min-h-[40px]",
9695
+ md: "h-[56px] min-h-[56px]",
9696
+ lg: "h-[96px] min-h-[96px]",
9697
+ xl: "h-[136px] min-h-[136px]"
9566
9698
  };
9567
9699
  var splitButtonVariants = cva(
9568
9700
  "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",
@@ -9746,7 +9878,7 @@ var SplitButtonLeadingComponent = React62.forwardRef(
9746
9878
  children: icon
9747
9879
  }
9748
9880
  ),
9749
- labelContent && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center h-full gap-[inherit]", children: labelContent })
9881
+ labelContent && /* @__PURE__ */ jsx("span", { className: "inline-flex items-center justify-center gap-[inherit]", children: labelContent })
9750
9882
  ] });
9751
9883
  const containerClassName = cn(
9752
9884
  splitButtonVariants({
@@ -9754,19 +9886,20 @@ var SplitButtonLeadingComponent = React62.forwardRef(
9754
9886
  size: actualSize,
9755
9887
  disabled
9756
9888
  }),
9889
+ "gap-2",
9757
9890
  typographyClass,
9758
9891
  className
9759
9892
  );
9760
9893
  const mergedStyle = __spreadValues({
9761
9894
  paddingInlineStart: tokens.leadingPadding.start,
9762
9895
  paddingInlineEnd: tokens.leadingPadding.end,
9763
- gap: "8px",
9764
9896
  borderRadius
9765
9897
  }, style);
9766
9898
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: asChild ? /* @__PURE__ */ jsx(
9767
9899
  Slot,
9768
9900
  __spreadProps(__spreadValues({
9769
9901
  ref,
9902
+ "data-split-button-part": "leading",
9770
9903
  "aria-disabled": disabled || void 0,
9771
9904
  onClick: handleClick,
9772
9905
  onPointerDown: handlePointerDown,
@@ -9789,6 +9922,7 @@ var SplitButtonLeadingComponent = React62.forwardRef(
9789
9922
  __spreadProps(__spreadValues({
9790
9923
  ref,
9791
9924
  type: "button",
9925
+ "data-split-button-part": "leading",
9792
9926
  disabled,
9793
9927
  onClick: handleClick,
9794
9928
  onPointerDown: handlePointerDown,
@@ -9802,8 +9936,7 @@ var SplitButtonLeadingComponent = React62.forwardRef(
9802
9936
  transition: SPLIT_BUTTON_RADIUS_SPRING,
9803
9937
  style: __spreadValues({
9804
9938
  paddingInlineStart: tokens.leadingPadding.start,
9805
- paddingInlineEnd: tokens.leadingPadding.end,
9806
- gap: "8px"
9939
+ paddingInlineEnd: tokens.leadingPadding.end
9807
9940
  }, style),
9808
9941
  className: containerClassName
9809
9942
  }, restProps), {
@@ -9841,7 +9974,8 @@ var SplitButtonTrailingComponent = React62.forwardRef(
9841
9974
  onBlur,
9842
9975
  asChild = false,
9843
9976
  children,
9844
- "aria-label": ariaLabel
9977
+ "aria-label": ariaLabel,
9978
+ "aria-haspopup": ariaHaspopup = "menu"
9845
9979
  } = _b, restProps = __objRest(_b, [
9846
9980
  "className",
9847
9981
  "style",
@@ -9859,7 +9993,8 @@ var SplitButtonTrailingComponent = React62.forwardRef(
9859
9993
  "onBlur",
9860
9994
  "asChild",
9861
9995
  "children",
9862
- "aria-label"
9996
+ "aria-label",
9997
+ "aria-haspopup"
9863
9998
  ]);
9864
9999
  var _a2, _b2;
9865
10000
  const context = useSplitButtonContext();
@@ -9952,7 +10087,11 @@ var SplitButtonTrailingComponent = React62.forwardRef(
9952
10087
  x: checked ? 0 : tokens.opticalCenterOffset
9953
10088
  },
9954
10089
  transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
9955
- className: "flex items-center justify-center shrink-0",
10090
+ className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
10091
+ style: {
10092
+ width: tokens.trailingIconSize,
10093
+ height: tokens.trailingIconSize
10094
+ },
9956
10095
  children: icon != null ? icon : /* @__PURE__ */ jsx(
9957
10096
  Icon,
9958
10097
  {
@@ -9981,8 +10120,10 @@ var SplitButtonTrailingComponent = React62.forwardRef(
9981
10120
  Slot,
9982
10121
  __spreadProps(__spreadValues({
9983
10122
  ref,
10123
+ "data-split-button-part": "trailing",
9984
10124
  "aria-label": ariaLabel,
9985
10125
  "aria-expanded": checked,
10126
+ "aria-haspopup": ariaHaspopup,
9986
10127
  "aria-disabled": disabled,
9987
10128
  onClick: handleToggle,
9988
10129
  onPointerDown: handlePointerDown,
@@ -10005,8 +10146,10 @@ var SplitButtonTrailingComponent = React62.forwardRef(
10005
10146
  __spreadProps(__spreadValues({
10006
10147
  ref,
10007
10148
  type: "button",
10149
+ "data-split-button-part": "trailing",
10008
10150
  "aria-label": ariaLabel,
10009
10151
  "aria-expanded": checked,
10152
+ "aria-haspopup": ariaHaspopup,
10010
10153
  "aria-disabled": disabled,
10011
10154
  disabled,
10012
10155
  onClick: handleToggle,
@@ -10081,6 +10224,7 @@ var SplitButtonTrailingUncheckableComponent = React62.forwardRef(
10081
10224
  const [isFocused, setIsFocused] = React62.useState(false);
10082
10225
  const [isPressed, setIsPressed] = React62.useState(false);
10083
10226
  const tokens = SPLIT_BUTTON_TOKENS[actualSize];
10227
+ const prefersReducedMotion2 = useReducedMotion();
10084
10228
  const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
10085
10229
  const {
10086
10230
  ripples,
@@ -10144,6 +10288,7 @@ var SplitButtonTrailingUncheckableComponent = React62.forwardRef(
10144
10288
  __spreadProps(__spreadValues({
10145
10289
  ref,
10146
10290
  type: "button",
10291
+ "data-split-button-part": "trailing",
10147
10292
  "aria-label": ariaLabel,
10148
10293
  disabled,
10149
10294
  onClick,
@@ -10155,7 +10300,7 @@ var SplitButtonTrailingUncheckableComponent = React62.forwardRef(
10155
10300
  onFocus: handleFocus,
10156
10301
  onBlur: handleBlur,
10157
10302
  animate: { borderRadius },
10158
- transition: SPLIT_BUTTON_RADIUS_SPRING,
10303
+ transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_RADIUS_SPRING,
10159
10304
  style: __spreadValues({
10160
10305
  paddingInlineStart: tokens.trailingPadding.start,
10161
10306
  paddingInlineEnd: tokens.trailingPadding.end
@@ -10184,7 +10329,7 @@ var SplitButtonTrailingUncheckableComponent = React62.forwardRef(
10184
10329
  m.div,
10185
10330
  {
10186
10331
  animate: { x: tokens.opticalCenterOffset },
10187
- transition: SPLIT_BUTTON_RADIUS_SPRING,
10332
+ transition: prefersReducedMotion2 ? { duration: 0 } : SPLIT_BUTTON_RADIUS_SPRING,
10188
10333
  className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
10189
10334
  style: {
10190
10335
  width: tokens.trailingIconSize,
@@ -14101,7 +14246,7 @@ var DividerImpl = React62.forwardRef(
14101
14246
  insetStart = "standard",
14102
14247
  waveConfig,
14103
14248
  decorative = false,
14104
- animate: animate4 = true,
14249
+ animate: animate5 = true,
14105
14250
  className,
14106
14251
  style
14107
14252
  } = _b, props = __objRest(_b, [
@@ -14117,7 +14262,7 @@ var DividerImpl = React62.forwardRef(
14117
14262
  ]);
14118
14263
  var _a2, _b2, _c;
14119
14264
  const reducedMotion = useReducedMotion();
14120
- const shouldAnimate = animate4 && !reducedMotion;
14265
+ const shouldAnimate = animate5 && !reducedMotion;
14121
14266
  const effectiveShape = shape === "wavy" && orientation === "vertical" ? "flat" : shape;
14122
14267
  if (shape === "wavy" && orientation === "vertical") {
14123
14268
  console.warn(
@@ -19223,7 +19368,7 @@ function useShapeMorph({
19223
19368
  currentProgressRef.current = p;
19224
19369
  setClipPath(interpolatePath(morph, p, width, height));
19225
19370
  }, [scrollProgress, morphOn, morph, width, height]);
19226
- const animate4 = useCallback(
19371
+ const animate5 = useCallback(
19227
19372
  (timestamp) => {
19228
19373
  if (!morph) return;
19229
19374
  const elapsed = timestamp - startTimeRef.current;
@@ -19234,7 +19379,7 @@ function useShapeMorph({
19234
19379
  currentProgressRef.current = progress;
19235
19380
  setClipPath(interpolatePath(morph, progress, width, height));
19236
19381
  if (rawT < 1) {
19237
- animRef.current = requestAnimationFrame(animate4);
19382
+ animRef.current = requestAnimationFrame(animate5);
19238
19383
  } else {
19239
19384
  animRef.current = null;
19240
19385
  }
@@ -19253,9 +19398,9 @@ function useShapeMorph({
19253
19398
  startProgressRef.current = currentProgressRef.current;
19254
19399
  targetProgressRef.current = toProgress;
19255
19400
  startTimeRef.current = performance.now();
19256
- animRef.current = requestAnimationFrame(animate4);
19401
+ animRef.current = requestAnimationFrame(animate5);
19257
19402
  },
19258
- [morph, animate4, width, height]
19403
+ [morph, animate5, width, height]
19259
19404
  );
19260
19405
  useEffect(() => {
19261
19406
  return () => {
@@ -20612,26 +20757,26 @@ var SliderTokens = {
20612
20757
  // ── Track sizes (height for horizontal, width for vertical) ────────────────
20613
20758
  trackSizes: {
20614
20759
  xs: 16,
20615
- s: 24,
20616
- m: 40,
20617
- l: 56,
20760
+ sm: 24,
20761
+ md: 40,
20762
+ lg: 56,
20618
20763
  xl: 96
20619
20764
  },
20620
20765
  // ── Track shapes (border radius) ──────────────────────────────────────────
20621
20766
  trackShapes: {
20622
20767
  xs: 8,
20623
- s: 8,
20624
- m: 12,
20625
- l: 16,
20768
+ sm: 8,
20769
+ md: 12,
20770
+ lg: 16,
20626
20771
  xl: 28
20627
20772
  },
20628
20773
  // ── Thumb (handle) ────────────────────────────────────────────────────────
20629
20774
  /** Thumb height grows with track size */
20630
20775
  thumbHeights: {
20631
20776
  xs: 44,
20632
- s: 44,
20633
- m: 52,
20634
- l: 68,
20777
+ sm: 44,
20778
+ md: 52,
20779
+ lg: 68,
20635
20780
  xl: 108
20636
20781
  },
20637
20782
  /**
@@ -20676,9 +20821,9 @@ var SliderTokens = {
20676
20821
  /** Standard icon size map for inset icons inside the track. */
20677
20822
  insetIconSizes: {
20678
20823
  xs: 0,
20679
- s: 0,
20680
- m: 24,
20681
- l: 24,
20824
+ sm: 0,
20825
+ md: 24,
20826
+ lg: 24,
20682
20827
  xl: 32
20683
20828
  },
20684
20829
  /**
@@ -20712,14 +20857,14 @@ var SliderColors = {
20712
20857
  // ── Ticks ────────────────────────────────────────────────────────────────
20713
20858
  /**
20714
20859
  * Tick on the INACTIVE portion of the track.
20715
- * Maps to TickMarkActiveContainerColor (in spec: primary color stands out).
20860
+ * Maps to TickMarkInactiveContainerColor (in spec: primary color stands out).
20716
20861
  */
20717
20862
  tickOnInactive: "var(--md-sys-color-primary)",
20718
20863
  /**
20719
20864
  * Tick on the ACTIVE portion of the track.
20720
- * Maps to TickMarkInactiveContainerColor (secondary-container blends in).
20865
+ * Maps to TickMarkActiveContainerColor (in spec: on-primary contrasts with filled track).
20721
20866
  */
20722
- tickOnActive: "var(--md-sys-color-secondary-container)",
20867
+ tickOnActive: "var(--md-sys-color-on-primary)",
20723
20868
  disabledTick: "var(--md-sys-color-on-surface)"
20724
20869
  };
20725
20870
  var SLIDER_THUMB_SPRING = {
@@ -20738,11 +20883,11 @@ var ValueIndicator = React62.memo(function ValueIndicator2({
20738
20883
  orientation,
20739
20884
  formatValue,
20740
20885
  prefersReduced,
20741
- trackSize
20886
+ size
20742
20887
  }) {
20743
20888
  const label = formatValue ? formatValue(value) : String(Math.round(value));
20744
20889
  const isHorizontal = orientation === "horizontal";
20745
- const thumbHeight = SliderTokens.thumbHeights[trackSize];
20890
+ const thumbHeight = SliderTokens.thumbHeights[size];
20746
20891
  const offsetFromCenter = thumbHeight / 2 + 8;
20747
20892
  return /* @__PURE__ */ jsx(AnimatePresence, { children: visible && /* @__PURE__ */ jsx(
20748
20893
  m.div,
@@ -20793,7 +20938,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20793
20938
  onValueChangeEnd,
20794
20939
  formatValue,
20795
20940
  thumbId,
20796
- trackSize,
20941
+ size,
20797
20942
  variant,
20798
20943
  zIndex = 1,
20799
20944
  "aria-label": ariaLabel,
@@ -20802,10 +20947,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20802
20947
  var _a;
20803
20948
  const isHorizontal = orientation === "horizontal";
20804
20949
  const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
20805
- const trackInset = Math.min(
20806
- SliderTokens.trackSizes[trackSize] / 2,
20807
- insetLimit
20808
- );
20950
+ const trackInset = Math.min(SliderTokens.trackSizes[size] / 2, insetLimit);
20809
20951
  const posTarget = isHorizontal ? "left" : "bottom";
20810
20952
  const motionStyle = {
20811
20953
  [posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
@@ -20838,7 +20980,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20838
20980
  const space = isHorizontal ? rect.width : rect.height;
20839
20981
  const insetLimit2 = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
20840
20982
  const trackInset2 = Math.min(
20841
- SliderTokens.trackSizes[trackSize] / 2,
20983
+ SliderTokens.trackSizes[size] / 2,
20842
20984
  insetLimit2
20843
20985
  );
20844
20986
  const safeSpace = space - trackInset2 * 2;
@@ -20855,7 +20997,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20855
20997
  const snapped = step > 0 ? Math.round((rawValue - min) / step) * step + min : rawValue;
20856
20998
  return Math.max(min, Math.min(max, snapped));
20857
20999
  },
20858
- [isHorizontal, max, min, percent, step, trackRef, trackSize]
21000
+ [isHorizontal, max, min, percent, step, trackRef, size]
20859
21001
  );
20860
21002
  const handlePointerDown = React62.useCallback(
20861
21003
  (e) => {
@@ -20941,7 +21083,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20941
21083
  orientation,
20942
21084
  formatValue,
20943
21085
  prefersReduced,
20944
- trackSize
21086
+ size
20945
21087
  }
20946
21088
  ),
20947
21089
  /* @__PURE__ */ jsx(
@@ -20974,11 +21116,11 @@ var SliderThumb = React62.memo(function SliderThumb2({
20974
21116
  "focus-visible:outline-(--md-sys-color-secondary)"
20975
21117
  ),
20976
21118
  style: __spreadProps(__spreadValues({}, isHorizontal ? {
20977
- height: SliderTokens.thumbHeights[trackSize],
21119
+ height: SliderTokens.thumbHeights[size],
20978
21120
  width: SliderTokens.thumbWidthDefault,
20979
21121
  willChange: "width"
20980
21122
  } : {
20981
- width: SliderTokens.thumbHeights[trackSize],
21123
+ width: SliderTokens.thumbHeights[size],
20982
21124
  height: SliderTokens.thumbWidthDefault,
20983
21125
  willChange: "height"
20984
21126
  }), {
@@ -20993,7 +21135,7 @@ var SliderThumb = React62.memo(function SliderThumb2({
20993
21135
  var RangeTrack = React62.memo(function RangeTrack2({
20994
21136
  startPercent,
20995
21137
  endPercent,
20996
- trackSize,
21138
+ size,
20997
21139
  orientation,
20998
21140
  variant,
20999
21141
  disabled,
@@ -21005,22 +21147,22 @@ var RangeTrack = React62.memo(function RangeTrack2({
21005
21147
  onTrackPointerDown
21006
21148
  }) {
21007
21149
  const isHorizontal = orientation === "horizontal";
21008
- const size = SliderTokens.trackSizes[trackSize];
21009
- const thumbHeight = SliderTokens.thumbHeights[trackSize];
21150
+ const trackPixelSize = SliderTokens.trackSizes[size];
21151
+ const thumbHeight = SliderTokens.thumbHeights[size];
21010
21152
  const { thumbGap, thumbWidthDefault, tickSize } = SliderTokens;
21011
21153
  const thumbHalfWidth = thumbWidthDefault / 2;
21012
21154
  const activeTrack = disabled ? SliderColors.disabledActiveTrack : `var(--md-sys-color-${variant})`;
21013
21155
  const inactiveTrack = disabled ? SliderColors.disabledInactiveTrack : `var(--md-sys-color-${variant}-container)`;
21014
21156
  const innerR = SliderTokens.trackInnerRadius;
21015
- let outerR = size / 2;
21157
+ let outerR = trackPixelSize / 2;
21016
21158
  if (trackShape === "md3") {
21017
- outerR = Math.min(SliderTokens.trackShapes[trackSize], size / 2);
21159
+ outerR = Math.min(SliderTokens.trackShapes[size], trackPixelSize / 2);
21018
21160
  } else if (typeof trackShape === "number") {
21019
- outerR = Math.min(trackShape, size / 2);
21161
+ outerR = Math.min(trackShape, trackPixelSize / 2);
21020
21162
  }
21021
21163
  if (isHorizontal) {
21022
21164
  const insetLimit2 = thumbGap + thumbWidthDefault / 2;
21023
- const trackInset2 = Math.min(size / 2, insetLimit2);
21165
+ const trackInset2 = Math.min(trackPixelSize / 2, insetLimit2);
21024
21166
  const cxStart = `calc(${trackInset2}px + ${startPercent} * (100% - ${trackInset2 * 2}px))`;
21025
21167
  const cxEnd = `calc(${trackInset2}px + ${endPercent} * (100% - ${trackInset2 * 2}px))`;
21026
21168
  const gapWithThumbStr2 = `${thumbGap + thumbHalfWidth}px`;
@@ -21051,7 +21193,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21051
21193
  top: "50%",
21052
21194
  transform: "translateY(-50%)",
21053
21195
  width: leadingWidth,
21054
- height: size,
21196
+ height: trackPixelSize,
21055
21197
  backgroundColor: inactiveTrack,
21056
21198
  opacity: disabled ? 0.38 : 1,
21057
21199
  borderTopLeftRadius: outerR,
@@ -21071,7 +21213,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21071
21213
  top: "50%",
21072
21214
  transform: "translateY(-50%)",
21073
21215
  width: activeWidth,
21074
- height: size,
21216
+ height: trackPixelSize,
21075
21217
  backgroundColor: activeTrack,
21076
21218
  opacity: disabled ? 0.38 : 1,
21077
21219
  borderTopLeftRadius: startPercent <= 0 ? outerR : innerR,
@@ -21091,7 +21233,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21091
21233
  top: "50%",
21092
21234
  transform: "translateY(-50%)",
21093
21235
  width: trailingWidth,
21094
- height: size,
21236
+ height: trackPixelSize,
21095
21237
  backgroundColor: inactiveTrack,
21096
21238
  opacity: disabled ? 0.38 : 1,
21097
21239
  borderTopLeftRadius: innerR,
@@ -21113,7 +21255,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21113
21255
  width: tickSize,
21114
21256
  height: tickSize,
21115
21257
  borderRadius: "50%",
21116
- backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-${variant}-container)` : `var(--md-sys-color-${variant})`,
21258
+ backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`,
21117
21259
  opacity: disabled ? 0.38 : 1,
21118
21260
  left: `calc(${trackInset2}px + ${tickPct} * (100% - ${trackInset2 * 2}px) - ${tickSize / 2}px)`,
21119
21261
  top: "50%",
@@ -21128,7 +21270,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21128
21270
  );
21129
21271
  }
21130
21272
  const insetLimit = thumbGap + thumbWidthDefault / 2;
21131
- const trackInset = Math.min(size / 2, insetLimit);
21273
+ const trackInset = Math.min(trackPixelSize / 2, insetLimit);
21132
21274
  const cyStart = `calc(${trackInset}px + ${startPercent} * (100% - ${trackInset * 2}px))`;
21133
21275
  const cyEnd = `calc(${trackInset}px + ${endPercent} * (100% - ${trackInset * 2}px))`;
21134
21276
  const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
@@ -21159,7 +21301,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21159
21301
  left: "50%",
21160
21302
  transform: "translateX(-50%)",
21161
21303
  height: leadingHeight,
21162
- width: size,
21304
+ width: trackPixelSize,
21163
21305
  backgroundColor: inactiveTrack,
21164
21306
  opacity: disabled ? 0.38 : 1,
21165
21307
  borderBottomLeftRadius: outerR,
@@ -21179,7 +21321,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21179
21321
  left: "50%",
21180
21322
  transform: "translateX(-50%)",
21181
21323
  height: activeHeight,
21182
- width: size,
21324
+ width: trackPixelSize,
21183
21325
  backgroundColor: activeTrack,
21184
21326
  opacity: disabled ? 0.38 : 1,
21185
21327
  borderBottomLeftRadius: startPercent <= 0 ? outerR : innerR,
@@ -21199,7 +21341,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21199
21341
  left: "50%",
21200
21342
  transform: "translateX(-50%)",
21201
21343
  height: trailingHeight,
21202
- width: size,
21344
+ width: trackPixelSize,
21203
21345
  backgroundColor: inactiveTrack,
21204
21346
  opacity: disabled ? 0.38 : 1,
21205
21347
  borderTopLeftRadius: outerR,
@@ -21221,7 +21363,7 @@ var RangeTrack = React62.memo(function RangeTrack2({
21221
21363
  width: tickSize,
21222
21364
  height: tickSize,
21223
21365
  borderRadius: "50%",
21224
- backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-${variant}-container)` : `var(--md-sys-color-${variant})`,
21366
+ backgroundColor: disabled ? SliderColors.disabledTick : isActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`,
21225
21367
  opacity: disabled ? 0.38 : 1,
21226
21368
  bottom: `calc(${trackInset}px + ${tickPct} * (100% - ${trackInset * 2}px) - ${tickSize / 2}px)`,
21227
21369
  left: "50%",
@@ -21245,7 +21387,7 @@ var RangeSliderComponent = React62.forwardRef(
21245
21387
  max = 100,
21246
21388
  step = 0,
21247
21389
  orientation = "horizontal",
21248
- trackSize = "m",
21390
+ size = "md",
21249
21391
  trackShape = "md3",
21250
21392
  variant = "primary",
21251
21393
  disabled = false,
@@ -21317,7 +21459,7 @@ var RangeSliderComponent = React62.forwardRef(
21317
21459
  let clickPercent;
21318
21460
  const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
21319
21461
  const trackInset = Math.min(
21320
- SliderTokens.trackSizes[trackSize] / 2,
21462
+ SliderTokens.trackSizes[size] / 2,
21321
21463
  insetLimit
21322
21464
  );
21323
21465
  if (isHorizontal) {
@@ -21349,7 +21491,7 @@ var RangeSliderComponent = React62.forwardRef(
21349
21491
  min,
21350
21492
  snap,
21351
21493
  startValue,
21352
- trackSize
21494
+ size
21353
21495
  ]
21354
21496
  );
21355
21497
  const id = React62.useId();
@@ -21370,7 +21512,7 @@ var RangeSliderComponent = React62.forwardRef(
21370
21512
  {
21371
21513
  startPercent,
21372
21514
  endPercent,
21373
- trackSize,
21515
+ size,
21374
21516
  trackShape,
21375
21517
  orientation,
21376
21518
  variant,
@@ -21392,7 +21534,7 @@ var RangeSliderComponent = React62.forwardRef(
21392
21534
  step,
21393
21535
  disabled,
21394
21536
  orientation,
21395
- trackSize,
21537
+ size,
21396
21538
  variant,
21397
21539
  showValueIndicator,
21398
21540
  trackRef,
@@ -21414,7 +21556,7 @@ var RangeSliderComponent = React62.forwardRef(
21414
21556
  step,
21415
21557
  disabled,
21416
21558
  orientation,
21417
- trackSize,
21559
+ size,
21418
21560
  variant,
21419
21561
  showValueIndicator,
21420
21562
  trackRef,
@@ -21477,13 +21619,13 @@ var InsetIcon = React62.memo(function InsetIcon2({
21477
21619
  position,
21478
21620
  orientation,
21479
21621
  trackSize,
21480
- trackSizeToken,
21622
+ sizeToken,
21481
21623
  disabled,
21482
21624
  variant,
21483
21625
  prefersReduced
21484
21626
  }) {
21485
21627
  const iconSize = Math.min(
21486
- SliderTokens.insetIconSizes[trackSizeToken],
21628
+ SliderTokens.insetIconSizes[sizeToken],
21487
21629
  Math.max(4, trackSize - SliderTokens.insetIconPadding * 2)
21488
21630
  );
21489
21631
  const activeColor = `var(--md-sys-color-on-${variant})`;
@@ -21544,7 +21686,7 @@ function Ticks({
21544
21686
  const thumbStart = percent - (thumbGap + thumbWidthDefault / 2) / 100;
21545
21687
  const thumbEnd = percent + (thumbGap + thumbWidthDefault / 2) / 100;
21546
21688
  if (tickPercent > thumbStart && tickPercent < thumbEnd) return null;
21547
- const color = disabled ? SliderColors.disabledTick : isOnActive ? `var(--md-sys-color-${variant}-container)` : `var(--md-sys-color-${variant})`;
21689
+ const color = disabled ? SliderColors.disabledTick : isOnActive ? `var(--md-sys-color-on-${variant})` : `var(--md-sys-color-${variant})`;
21548
21690
  const style = __spreadValues({
21549
21691
  position: "absolute",
21550
21692
  width: tickSize,
@@ -21567,7 +21709,7 @@ function Ticks({
21567
21709
  }
21568
21710
  var SliderTrack = React62.memo(function SliderTrack2({
21569
21711
  percent,
21570
- trackSize,
21712
+ size,
21571
21713
  orientation,
21572
21714
  variant,
21573
21715
  isCentered,
@@ -21586,15 +21728,15 @@ var SliderTrack = React62.memo(function SliderTrack2({
21586
21728
  }) {
21587
21729
  var _a;
21588
21730
  const isHorizontal = orientation === "horizontal";
21589
- const size = SliderTokens.trackSizes[trackSize];
21590
- const thumbHeight = SliderTokens.thumbHeights[trackSize];
21731
+ const trackPixelSize = SliderTokens.trackSizes[size];
21732
+ const thumbHeight = SliderTokens.thumbHeights[size];
21591
21733
  const { thumbGap, thumbWidthDefault, trackInnerRadius } = SliderTokens;
21592
21734
  const innerR = trackInnerRadius;
21593
- let outerR = size / 2;
21735
+ let outerR = trackPixelSize / 2;
21594
21736
  if (trackShape === "md3") {
21595
- outerR = Math.min(SliderTokens.trackShapes[trackSize], size / 2);
21737
+ outerR = Math.min(SliderTokens.trackShapes[size], trackPixelSize / 2);
21596
21738
  } else if (typeof trackShape === "number") {
21597
- outerR = Math.min(trackShape, size / 2);
21739
+ outerR = Math.min(trackShape, trackPixelSize / 2);
21598
21740
  }
21599
21741
  const thumbHalfWidth = thumbWidthDefault / 2;
21600
21742
  const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
@@ -21612,8 +21754,8 @@ var SliderTrack = React62.memo(function SliderTrack2({
21612
21754
  return () => ro.disconnect();
21613
21755
  }, [hasAnyInsetIcon, isHorizontal, trackRef]);
21614
21756
  const activeIconSize = Math.min(
21615
- SliderTokens.insetIconSizes[trackSize],
21616
- Math.max(4, size - SliderTokens.insetIconPadding * 2)
21757
+ SliderTokens.insetIconSizes[size],
21758
+ Math.max(4, trackPixelSize - SliderTokens.insetIconPadding * 2)
21617
21759
  );
21618
21760
  const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
21619
21761
  const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
@@ -21648,7 +21790,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21648
21790
  const activeColor = disabled ? SliderColors.disabledActiveTrack : `var(--md-sys-color-${variant})`;
21649
21791
  const inactiveColor = disabled ? SliderColors.disabledInactiveTrack : `var(--md-sys-color-${variant}-container)`;
21650
21792
  const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
21651
- const trackInset = Math.min(size / 2, insetLimit);
21793
+ const trackInset = Math.min(trackPixelSize / 2, insetLimit);
21652
21794
  const gapTotal = thumbGap + thumbHalfWidth;
21653
21795
  const thumbCenter = `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`;
21654
21796
  const leadingActiveLeft = `${trackInset + SliderTokens.insetIconPadding}px`;
@@ -21673,7 +21815,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21673
21815
  top: "50%",
21674
21816
  transform: "translateY(-50%)",
21675
21817
  width: leftSegmentWidth,
21676
- height: size,
21818
+ height: trackPixelSize,
21677
21819
  backgroundColor: activeColor,
21678
21820
  opacity: disabled ? 0.38 : 1
21679
21821
  }, getHorizontalRadius(true, innerR, outerR))
@@ -21692,7 +21834,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21692
21834
  top: "50%",
21693
21835
  transform: "translateY(-50%)",
21694
21836
  width: rightSegmentWidth,
21695
- height: size,
21837
+ height: trackPixelSize,
21696
21838
  backgroundColor: inactiveColor,
21697
21839
  opacity: disabled ? 0.38 : 1
21698
21840
  }, getHorizontalRadius(false, innerR, outerR))
@@ -21715,7 +21857,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21715
21857
  top: "50%",
21716
21858
  transform: "translateY(-50%)",
21717
21859
  width: leftBaseWidth,
21718
- height: size,
21860
+ height: trackPixelSize,
21719
21861
  backgroundColor: inactiveColor,
21720
21862
  opacity: disabled ? 0.38 : 1
21721
21863
  }, getHorizontalRadius(true, innerR, outerR))
@@ -21736,7 +21878,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21736
21878
  top: "50%",
21737
21879
  transform: "translateY(-50%)",
21738
21880
  width: centerActiveWidth,
21739
- height: size,
21881
+ height: trackPixelSize,
21740
21882
  backgroundColor: activeColor,
21741
21883
  opacity: disabled ? 0.38 : 1
21742
21884
  }, allInnerRadius(innerR))
@@ -21757,7 +21899,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21757
21899
  top: "50%",
21758
21900
  transform: "translateY(-50%)",
21759
21901
  width: rightBaseWidth,
21760
- height: size,
21902
+ height: trackPixelSize,
21761
21903
  backgroundColor: inactiveColor,
21762
21904
  opacity: disabled ? 0.38 : 1
21763
21905
  }, getHorizontalRadius(false, innerR, outerR))
@@ -21778,7 +21920,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21778
21920
  top: "50%",
21779
21921
  transform: "translateY(-50%)",
21780
21922
  width: leftBaseWidth,
21781
- height: size,
21923
+ height: trackPixelSize,
21782
21924
  backgroundColor: inactiveColor,
21783
21925
  opacity: disabled ? 0.38 : 1
21784
21926
  }, getHorizontalRadius(true, innerR, outerR))
@@ -21799,7 +21941,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21799
21941
  top: "50%",
21800
21942
  transform: "translateY(-50%)",
21801
21943
  width: centerActiveWidth,
21802
- height: size,
21944
+ height: trackPixelSize,
21803
21945
  backgroundColor: activeColor,
21804
21946
  opacity: disabled ? 0.38 : 1
21805
21947
  }, allInnerRadius(innerR))
@@ -21820,7 +21962,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21820
21962
  top: "50%",
21821
21963
  transform: "translateY(-50%)",
21822
21964
  width: rightBaseWidth,
21823
- height: size,
21965
+ height: trackPixelSize,
21824
21966
  backgroundColor: inactiveColor,
21825
21967
  opacity: disabled ? 0.38 : 1
21826
21968
  }, getHorizontalRadius(false, innerR, outerR))
@@ -21864,8 +22006,8 @@ var SliderTrack = React62.memo(function SliderTrack2({
21864
22006
  isOnActiveSegment: leadingOnActive,
21865
22007
  position: leadingOnActive ? leadingActiveLeft : leadingInactiveLeft,
21866
22008
  orientation,
21867
- trackSize: size,
21868
- trackSizeToken: trackSize,
22009
+ trackSize: trackPixelSize,
22010
+ sizeToken: size,
21869
22011
  disabled,
21870
22012
  variant,
21871
22013
  prefersReduced
@@ -21879,8 +22021,8 @@ var SliderTrack = React62.memo(function SliderTrack2({
21879
22021
  isOnActiveSegment: trailingOnActive,
21880
22022
  position: trailingOnActive ? trailingActiveLeft : trailingInactiveLeft,
21881
22023
  orientation,
21882
- trackSize: size,
21883
- trackSizeToken: trackSize,
22024
+ trackSize: trackPixelSize,
22025
+ sizeToken: size,
21884
22026
  disabled,
21885
22027
  variant,
21886
22028
  prefersReduced
@@ -21908,7 +22050,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21908
22050
  left: "50%",
21909
22051
  transform: "translateX(-50%)",
21910
22052
  height: bottomSegmentHeight,
21911
- width: size,
22053
+ width: trackPixelSize,
21912
22054
  backgroundColor: activeColor,
21913
22055
  opacity: disabled ? 0.38 : 1
21914
22056
  }, getVerticalRadius(true, innerR, outerR))
@@ -21927,7 +22069,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21927
22069
  left: "50%",
21928
22070
  transform: "translateX(-50%)",
21929
22071
  height: topSegmentHeight,
21930
- width: size,
22072
+ width: trackPixelSize,
21931
22073
  backgroundColor: inactiveColor,
21932
22074
  opacity: disabled ? 0.38 : 1
21933
22075
  }, getVerticalRadius(false, innerR, outerR))
@@ -21950,7 +22092,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21950
22092
  left: "50%",
21951
22093
  transform: "translateX(-50%)",
21952
22094
  height: bottomBaseHeight,
21953
- width: size,
22095
+ width: trackPixelSize,
21954
22096
  backgroundColor: inactiveColor,
21955
22097
  opacity: disabled ? 0.38 : 1
21956
22098
  }, getVerticalRadius(true, innerR, outerR))
@@ -21971,7 +22113,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21971
22113
  left: "50%",
21972
22114
  transform: "translateX(-50%)",
21973
22115
  height: centerActiveHeight,
21974
- width: size,
22116
+ width: trackPixelSize,
21975
22117
  backgroundColor: activeColor,
21976
22118
  opacity: disabled ? 0.38 : 1
21977
22119
  }, allInnerRadius(innerR))
@@ -21992,7 +22134,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
21992
22134
  left: "50%",
21993
22135
  transform: "translateX(-50%)",
21994
22136
  height: topBaseHeight,
21995
- width: size,
22137
+ width: trackPixelSize,
21996
22138
  backgroundColor: inactiveColor,
21997
22139
  opacity: disabled ? 0.38 : 1
21998
22140
  }, getVerticalRadius(false, innerR, outerR))
@@ -22013,7 +22155,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
22013
22155
  left: "50%",
22014
22156
  transform: "translateX(-50%)",
22015
22157
  height: bottomBaseHeight,
22016
- width: size,
22158
+ width: trackPixelSize,
22017
22159
  backgroundColor: inactiveColor,
22018
22160
  opacity: disabled ? 0.38 : 1
22019
22161
  }, getVerticalRadius(true, innerR, outerR))
@@ -22034,7 +22176,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
22034
22176
  left: "50%",
22035
22177
  transform: "translateX(-50%)",
22036
22178
  height: centerActiveHeight,
22037
- width: size,
22179
+ width: trackPixelSize,
22038
22180
  backgroundColor: activeColor,
22039
22181
  opacity: disabled ? 0.38 : 1
22040
22182
  }, allInnerRadius(innerR))
@@ -22055,7 +22197,7 @@ var SliderTrack = React62.memo(function SliderTrack2({
22055
22197
  left: "50%",
22056
22198
  transform: "translateX(-50%)",
22057
22199
  height: topBaseHeight,
22058
- width: size,
22200
+ width: trackPixelSize,
22059
22201
  backgroundColor: inactiveColor,
22060
22202
  opacity: disabled ? 0.38 : 1
22061
22203
  }, getVerticalRadius(false, innerR, outerR))
@@ -22099,8 +22241,8 @@ var SliderTrack = React62.memo(function SliderTrack2({
22099
22241
  isOnActiveSegment: leadingOnActive,
22100
22242
  position: leadingOnActive ? leadingActiveLeft : leadingInactiveLeft,
22101
22243
  orientation,
22102
- trackSize: size,
22103
- trackSizeToken: trackSize,
22244
+ trackSize: trackPixelSize,
22245
+ sizeToken: size,
22104
22246
  disabled,
22105
22247
  variant,
22106
22248
  prefersReduced
@@ -22114,8 +22256,8 @@ var SliderTrack = React62.memo(function SliderTrack2({
22114
22256
  isOnActiveSegment: trailingOnActive,
22115
22257
  position: trailingOnActive ? trailingActiveLeft : trailingInactiveLeft,
22116
22258
  orientation,
22117
- trackSize: size,
22118
- trackSizeToken: trackSize,
22259
+ trackSize: trackPixelSize,
22260
+ sizeToken: size,
22119
22261
  disabled,
22120
22262
  variant,
22121
22263
  prefersReduced
@@ -22136,7 +22278,7 @@ var SliderComponent = React62.forwardRef(
22136
22278
  max = 100,
22137
22279
  step = 0,
22138
22280
  orientation = "horizontal",
22139
- trackSize = "m",
22281
+ size = "md",
22140
22282
  trackShape = "md3",
22141
22283
  variant = "primary",
22142
22284
  isCentered = false,
@@ -22190,7 +22332,7 @@ var SliderComponent = React62.forwardRef(
22190
22332
  let clickPercent;
22191
22333
  const insetLimit = SliderTokens.thumbGap + SliderTokens.thumbWidthDefault / 2;
22192
22334
  const trackInset = Math.min(
22193
- SliderTokens.trackSizes[trackSize] / 2,
22335
+ SliderTokens.trackSizes[size] / 2,
22194
22336
  insetLimit
22195
22337
  );
22196
22338
  if (isHorizontal) {
@@ -22205,20 +22347,11 @@ var SliderComponent = React62.forwardRef(
22205
22347
  const newValue = snap(coerce(rawValue));
22206
22348
  handleValueChange(newValue);
22207
22349
  },
22208
- [
22209
- coerce,
22210
- disabled,
22211
- handleValueChange,
22212
- isHorizontal,
22213
- max,
22214
- min,
22215
- snap,
22216
- trackSize
22217
- ]
22350
+ [coerce, disabled, handleValueChange, isHorizontal, max, min, snap, size]
22218
22351
  );
22219
22352
  const id = React62.useId();
22220
22353
  const thumbId = `slider-thumb-${id}`;
22221
- const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[trackSize] >= 40;
22354
+ const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[size] >= 40;
22222
22355
  const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
22223
22356
  if (hasAnyInsetIcon && !supportsInsetIcon) {
22224
22357
  console.warn(
@@ -22241,7 +22374,7 @@ var SliderComponent = React62.forwardRef(
22241
22374
  SliderTrack,
22242
22375
  {
22243
22376
  percent,
22244
- trackSize,
22377
+ size,
22245
22378
  trackShape,
22246
22379
  orientation,
22247
22380
  isCentered,
@@ -22269,7 +22402,7 @@ var SliderComponent = React62.forwardRef(
22269
22402
  step,
22270
22403
  disabled,
22271
22404
  orientation,
22272
- trackSize,
22405
+ size,
22273
22406
  variant,
22274
22407
  showValueIndicator,
22275
22408
  trackRef,