@bug-on/m3-expressive 1.2.5 → 1.2.7

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.
package/dist/overlays.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as RadixDialog from '@radix-ui/react-dialog';
3
- import { m, LazyMotion, domMax, useMotionValue, animate, useAnimationFrame, AnimatePresence, useReducedMotion, useTransform } from 'motion/react';
4
- import * as React9 from 'react';
3
+ import { m, useAnimationFrame, LazyMotion, domMax, useMotionValue, animate, AnimatePresence, useReducedMotion, useTransform } from 'motion/react';
4
+ import * as React2 from 'react';
5
5
  import { useState, useRef, useCallback, useMemo, useEffect, useLayoutEffect } from 'react';
6
6
  import { clsx } from 'clsx';
7
7
  import { twMerge } from 'tailwind-merge';
@@ -89,11 +89,11 @@ var ROTATE_KEY_SPLINES = [
89
89
  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";
90
90
  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";
91
91
  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";
92
- var IndeterminateSvg = React9.memo(function IndeterminateSvg2({
92
+ var IndeterminateSvg = React2.memo(function IndeterminateSvg2({
93
93
  size
94
94
  }) {
95
- const [ready, setReady] = React9.useState(false);
96
- React9.useEffect(() => {
95
+ const [ready, setReady] = React2.useState(false);
96
+ React2.useEffect(() => {
97
97
  const raf = requestAnimationFrame(() => setReady(true));
98
98
  return () => cancelAnimationFrame(raf);
99
99
  }, []);
@@ -138,7 +138,7 @@ var IndeterminateSvg = React9.memo(function IndeterminateSvg2({
138
138
  }
139
139
  );
140
140
  });
141
- var DeterminateSvg = React9.memo(function DeterminateSvg2({
141
+ var DeterminateSvg = React2.memo(function DeterminateSvg2({
142
142
  size,
143
143
  progress
144
144
  }) {
@@ -163,7 +163,7 @@ var DeterminateSvg = React9.memo(function DeterminateSvg2({
163
163
  }
164
164
  );
165
165
  });
166
- var LoadingIndicator = React9.forwardRef(
166
+ var LoadingIndicator = React2.forwardRef(
167
167
  (_a, ref) => {
168
168
  var _b = _a, {
169
169
  variant = "uncontained",
@@ -258,27 +258,47 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
258
258
  if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
259
259
  d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
260
260
  }
261
- d += " Z";
262
- return d;
261
+ return `${d} Z`;
263
262
  }
264
263
  function getSinePath(startX, endX, phase, wl, amp) {
265
264
  if (startX >= endX) return "";
266
- let d = "";
267
- const step = amp === 0 ? Math.max(10, endX - startX) : 1;
268
- const yStart = Math.sin((startX + phase) / wl * 2 * Math.PI) * amp;
269
- d += `M ${startX.toFixed(2)} ${yStart.toFixed(2)}`;
270
- let nextX = Math.ceil(startX / step) * step;
271
- if (nextX === startX) nextX += step;
272
- while (nextX < endX) {
273
- const y = Math.sin((nextX + phase) / wl * 2 * Math.PI) * amp;
274
- d += ` L ${nextX.toFixed(2)} ${y.toFixed(2)}`;
275
- nextX += step;
265
+ if (amp <= 0.01) {
266
+ return `M ${startX.toFixed(2)} 0 L ${endX.toFixed(2)} 0`;
267
+ }
268
+ const safeWl = Math.max(1, wl);
269
+ const k = 2 * Math.PI / safeWl;
270
+ const phi = phase / safeWl * 2 * Math.PI;
271
+ const yAt = (x) => amp * Math.sin(k * x + phi);
272
+ const dyAt = (x) => amp * k * Math.cos(k * x + phi);
273
+ const step = safeWl / 4;
274
+ let d = `M ${startX.toFixed(2)} ${yAt(startX).toFixed(2)}`;
275
+ let currentX = startX;
276
+ while (currentX < endX) {
277
+ const nextX = Math.min(endX, currentX + step);
278
+ const dx = nextX - currentX;
279
+ const scale = dx / 3;
280
+ const y0 = yAt(currentX);
281
+ const dy0 = dyAt(currentX);
282
+ const y1 = yAt(nextX);
283
+ const dy1 = dyAt(nextX);
284
+ const cp1x = currentX + scale;
285
+ const cp1y = y0 + scale * dy0;
286
+ const cp2x = nextX - scale;
287
+ const cp2y = y1 - scale * dy1;
288
+ d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${nextX.toFixed(2)} ${y1.toFixed(2)}`;
289
+ currentX = nextX;
276
290
  }
277
- const yEnd = Math.sin((endX + phase) / wl * 2 * Math.PI) * amp;
278
- d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
279
291
  return d;
280
292
  }
281
- var CircularProgress = React9.forwardRef(
293
+ var GLOBAL_ROTATION_DURATION = 6e3;
294
+ var GLOBAL_ROTATION_TARGET = 1080;
295
+ var ADDITIONAL_ROTATION_CYCLE = 1500;
296
+ var ADDITIONAL_ROTATION_STEP = 90;
297
+ var ADDITIONAL_ROTATION_EASE_DURATION = 500;
298
+ var DEFAULT_MIN_PROGRESS = 0.1;
299
+ var DEFAULT_MAX_PROGRESS = 0.8;
300
+ var PROGRESS_CYCLE_DURATION = 1500;
301
+ var CircularProgress = React2.forwardRef(
282
302
  (_a, ref) => {
283
303
  var _b = _a, {
284
304
  value,
@@ -291,6 +311,10 @@ var CircularProgress = React9.forwardRef(
291
311
  crawlerSpeed = 1,
292
312
  color,
293
313
  trackColor,
314
+ showTrack = "auto",
315
+ minProgress = DEFAULT_MIN_PROGRESS,
316
+ maxProgress = DEFAULT_MAX_PROGRESS,
317
+ amplitudeRange,
294
318
  className,
295
319
  "aria-label": ariaLabel
296
320
  } = _b, restProps = __objRest(_b, [
@@ -304,6 +328,10 @@ var CircularProgress = React9.forwardRef(
304
328
  "crawlerSpeed",
305
329
  "color",
306
330
  "trackColor",
331
+ "showTrack",
332
+ "minProgress",
333
+ "maxProgress",
334
+ "amplitudeRange",
307
335
  "className",
308
336
  "aria-label"
309
337
  ]);
@@ -314,17 +342,22 @@ var CircularProgress = React9.forwardRef(
314
342
  const activeColor = color || "var(--md-sys-color-indicator-active)";
315
343
  const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
316
344
  const isWavy = shape === "wavy";
345
+ const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
317
346
  const BASELINE_SIZE = 48;
318
347
  const scaleFactor = size / BASELINE_SIZE;
319
- const effectiveAmplitude = React9.useMemo(
348
+ const effectiveAmplitude = React2.useMemo(
320
349
  () => amplitude != null ? amplitude : 1.6 * scaleFactor,
321
350
  [amplitude, scaleFactor]
322
351
  );
323
- const effectiveWavelength = React9.useMemo(
352
+ const effectiveWavelength = React2.useMemo(
324
353
  () => wavelength != null ? wavelength : 15 * scaleFactor,
325
354
  [wavelength, scaleFactor]
326
355
  );
327
- const wavyActivePath = React9.useMemo(
356
+ const resolvedAmplitudeRange = React2.useMemo(
357
+ () => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
358
+ [amplitudeRange, effectiveAmplitude]
359
+ );
360
+ const wavyActivePath = React2.useMemo(
328
361
  () => isWavy ? generateWavyCircularPath(
329
362
  center,
330
363
  radius,
@@ -333,8 +366,8 @@ var CircularProgress = React9.forwardRef(
333
366
  ) : null,
334
367
  [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
335
368
  );
336
- const circumference = React9.useMemo(() => 2 * Math.PI * radius, [radius]);
337
- const gapForTrack = React9.useMemo(
369
+ const circumference = React2.useMemo(() => 2 * Math.PI * radius, [radius]);
370
+ const gapForTrack = React2.useMemo(
338
371
  () => (gapSize + trackHeight) / circumference,
339
372
  [gapSize, trackHeight, circumference]
340
373
  );
@@ -343,6 +376,145 @@ var CircularProgress = React9.forwardRef(
343
376
  const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
344
377
  const ActiveCircleElem = m.circle;
345
378
  const ActivePathElem = m.path;
379
+ const indeterminateSvgRef = React2.useRef(null);
380
+ const indeterminateTrackRef = React2.useRef(null);
381
+ const indeterminateActiveRef = React2.useRef(null);
382
+ const indeterminateWavyTrackPathRef = React2.useRef(null);
383
+ const indeterminateWavyActivePathRef = React2.useRef(null);
384
+ const cachedPathLengthRef = React2.useRef(0);
385
+ React2.useLayoutEffect(() => {
386
+ if (!isWavy || !wavyActivePath) {
387
+ cachedPathLengthRef.current = circumference;
388
+ return;
389
+ }
390
+ const el = indeterminateActiveRef.current;
391
+ if (el && "getTotalLength" in el) {
392
+ try {
393
+ const len = el.getTotalLength();
394
+ if (len > 0) {
395
+ cachedPathLengthRef.current = len;
396
+ return;
397
+ }
398
+ } catch (e) {
399
+ }
400
+ }
401
+ cachedPathLengthRef.current = circumference;
402
+ }, [isWavy, circumference, wavyActivePath]);
403
+ useAnimationFrame((time) => {
404
+ if (isDeterminate) return;
405
+ const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
406
+ const scaledTime = time * safeCrawlerSpeed;
407
+ const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
408
+ const globalAngle = globalCycle / GLOBAL_ROTATION_DURATION * GLOBAL_ROTATION_TARGET;
409
+ const additionalFullCycles = Math.floor(
410
+ scaledTime / ADDITIONAL_ROTATION_CYCLE
411
+ );
412
+ const additionalCycleTime = scaledTime % ADDITIONAL_ROTATION_CYCLE;
413
+ const additionalEaseT = Math.min(
414
+ 1,
415
+ additionalCycleTime / ADDITIONAL_ROTATION_EASE_DURATION
416
+ );
417
+ const additionalAngle = (additionalFullCycles + easeInOutCubic(additionalEaseT)) * ADDITIONAL_ROTATION_STEP;
418
+ const totalRotation = globalAngle + additionalAngle;
419
+ if (indeterminateSvgRef.current) {
420
+ indeterminateSvgRef.current.style.transform = `rotate(${totalRotation - 90}deg)`;
421
+ }
422
+ const progressFullCycle = PROGRESS_CYCLE_DURATION * 2;
423
+ const progressCycleTime = scaledTime % progressFullCycle;
424
+ let progress;
425
+ if (progressCycleTime < PROGRESS_CYCLE_DURATION) {
426
+ const t = progressCycleTime / PROGRESS_CYCLE_DURATION;
427
+ progress = minProgress + (maxProgress - minProgress) * easeInOutCubic(t);
428
+ } else {
429
+ const t = (progressCycleTime - PROGRESS_CYCLE_DURATION) / PROGRESS_CYCLE_DURATION;
430
+ progress = maxProgress - (maxProgress - minProgress) * easeInOutCubic(t);
431
+ }
432
+ if (isWavy) {
433
+ const amplitudeT = (progress - minProgress) / (maxProgress - minProgress);
434
+ const currentAmplitude = resolvedAmplitudeRange[0] + (resolvedAmplitudeRange[1] - resolvedAmplitudeRange[0]) * amplitudeT;
435
+ const dynamicPath = generateWavyCircularPath(
436
+ center,
437
+ radius,
438
+ currentAmplitude,
439
+ effectiveWavelength
440
+ );
441
+ if (indeterminateWavyActivePathRef.current) {
442
+ indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
443
+ }
444
+ if (indeterminateWavyTrackPathRef.current) {
445
+ indeterminateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
446
+ }
447
+ const pathEl = indeterminateWavyActivePathRef.current;
448
+ let totalLen = cachedPathLengthRef.current || circumference;
449
+ if (pathEl) {
450
+ try {
451
+ const len = pathEl.getTotalLength();
452
+ if (len > 0) totalLen = len;
453
+ } catch (e) {
454
+ }
455
+ }
456
+ const gapFrac = (gapSize + trackHeight) / totalLen;
457
+ const activeLen = totalLen * progress;
458
+ const activeOff = 0;
459
+ if (indeterminateWavyActivePathRef.current) {
460
+ indeterminateWavyActivePathRef.current.setAttribute(
461
+ "stroke-dasharray",
462
+ `${activeLen} ${totalLen}`
463
+ );
464
+ indeterminateWavyActivePathRef.current.setAttribute(
465
+ "stroke-dashoffset",
466
+ `${activeOff}`
467
+ );
468
+ }
469
+ if (shouldShowIndeterminateTrack && indeterminateWavyTrackPathRef.current) {
470
+ const trackStartFrac = progress + gapFrac;
471
+ const trackLen = Math.max(
472
+ 1e-3,
473
+ totalLen * (1 - progress - 2 * gapFrac)
474
+ );
475
+ const trackOff = -totalLen * trackStartFrac;
476
+ indeterminateWavyTrackPathRef.current.setAttribute(
477
+ "stroke-dasharray",
478
+ `${trackLen} ${totalLen}`
479
+ );
480
+ indeterminateWavyTrackPathRef.current.setAttribute(
481
+ "stroke-dashoffset",
482
+ `${trackOff}`
483
+ );
484
+ }
485
+ } else {
486
+ const totalLen = circumference;
487
+ const activeLen = totalLen * progress;
488
+ const activeOff = 0;
489
+ if (indeterminateActiveRef.current) {
490
+ indeterminateActiveRef.current.setAttribute(
491
+ "stroke-dasharray",
492
+ `${activeLen} ${totalLen}`
493
+ );
494
+ indeterminateActiveRef.current.setAttribute(
495
+ "stroke-dashoffset",
496
+ `${activeOff}`
497
+ );
498
+ }
499
+ if (shouldShowIndeterminateTrack && indeterminateTrackRef.current) {
500
+ const gapFrac = (gapSize + trackHeight) / totalLen;
501
+ const trackStartFrac = progress + gapFrac;
502
+ const trackLen = Math.max(
503
+ 1e-3,
504
+ totalLen * (1 - progress - 2 * gapFrac)
505
+ );
506
+ const trackOff = -totalLen * trackStartFrac;
507
+ indeterminateTrackRef.current.setAttribute(
508
+ "stroke-dasharray",
509
+ `${trackLen} ${totalLen}`
510
+ );
511
+ indeterminateTrackRef.current.setAttribute(
512
+ "stroke-dashoffset",
513
+ `${trackOff}`
514
+ );
515
+ }
516
+ }
517
+ });
346
518
  return /* @__PURE__ */ jsx(
347
519
  "div",
348
520
  __spreadProps(__spreadValues({
@@ -419,9 +591,10 @@ var CircularProgress = React9.forwardRef(
419
591
  ]
420
592
  }
421
593
  ),
422
- !isDeterminate && /* @__PURE__ */ jsxs(
423
- m.svg,
594
+ !isDeterminate && /* @__PURE__ */ jsx(
595
+ "svg",
424
596
  {
597
+ ref: indeterminateSvgRef,
425
598
  width: size,
426
599
  height: size,
427
600
  viewBox: `0 0 ${size} ${size}`,
@@ -430,90 +603,60 @@ var CircularProgress = React9.forwardRef(
430
603
  position: "absolute",
431
604
  inset: 0,
432
605
  overflow: "visible",
433
- rotate: "-90deg",
434
- transformOrigin: "center"
606
+ transformOrigin: "center",
607
+ transform: "rotate(-90deg)"
435
608
  },
436
- animate: { rotate: ["-90deg", "270deg"] },
437
- transition: {
438
- rotate: {
439
- duration: 2 / Math.max(0.1, crawlerSpeed),
440
- repeat: Number.POSITIVE_INFINITY,
441
- ease: "linear"
442
- }
443
- },
444
- children: [
445
- /* @__PURE__ */ jsx(
446
- m.circle,
609
+ children: isWavy ? /* @__PURE__ */ jsxs(Fragment, { children: [
610
+ shouldShowIndeterminateTrack && /* @__PURE__ */ jsx(
611
+ "path",
447
612
  {
448
- cx: center,
449
- cy: center,
450
- r: radius,
613
+ ref: indeterminateWavyTrackPathRef,
614
+ d: wavyActivePath != null ? wavyActivePath : "",
451
615
  fill: "none",
452
616
  stroke: bgTrackColor,
453
617
  strokeWidth: trackHeight,
454
- strokeLinecap: "round",
455
- style: { originX: "50%", originY: "50%" },
456
- animate: {
457
- pathLength: [
458
- Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
459
- Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
460
- Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
461
- ],
462
- rotate: [
463
- `${(0.1 + gapForTrack) * 360}deg`,
464
- `${(1 + gapForTrack) * 360}deg`,
465
- `${(1.1 + gapForTrack) * 360}deg`
466
- ]
467
- },
468
- transition: {
469
- duration: 2 / Math.max(0.1, crawlerSpeed),
470
- repeat: Number.POSITIVE_INFINITY,
471
- ease: [0.4, 0, 0.2, 1]
472
- }
618
+ strokeLinecap: "round"
473
619
  }
474
620
  ),
475
- isWavy ? /* @__PURE__ */ jsx(
476
- ActivePathElem,
621
+ /* @__PURE__ */ jsx(
622
+ "path",
477
623
  {
624
+ ref: indeterminateWavyActivePathRef,
478
625
  d: wavyActivePath != null ? wavyActivePath : "",
479
626
  fill: "none",
480
627
  stroke: activeColor,
481
628
  strokeWidth: trackHeight,
482
- strokeLinecap: "round",
483
- style: { originX: "50%", originY: "50%" },
484
- animate: {
485
- pathLength: [0.1, 0.75, 0.1],
486
- rotate: ["0deg", "90deg", "360deg"]
487
- },
488
- transition: {
489
- duration: 2 / Math.max(0.1, crawlerSpeed),
490
- repeat: Number.POSITIVE_INFINITY,
491
- ease: [0.4, 0, 0.2, 1]
492
- }
629
+ strokeLinecap: "round"
493
630
  }
494
- ) : /* @__PURE__ */ jsx(
495
- ActiveCircleElem,
631
+ )
632
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
633
+ shouldShowIndeterminateTrack && /* @__PURE__ */ jsx(
634
+ "circle",
635
+ {
636
+ ref: indeterminateTrackRef,
637
+ cx: center,
638
+ cy: center,
639
+ r: radius,
640
+ fill: "none",
641
+ stroke: bgTrackColor,
642
+ strokeWidth: trackHeight,
643
+ strokeLinecap: "round"
644
+ }
645
+ ),
646
+ /* @__PURE__ */ jsx(
647
+ "circle",
496
648
  {
649
+ ref: indeterminateActiveRef,
497
650
  cx: center,
498
651
  cy: center,
499
652
  r: radius,
500
653
  fill: "none",
501
654
  stroke: activeColor,
502
655
  strokeWidth: trackHeight,
503
- strokeLinecap: "round",
504
- style: { originX: "50%", originY: "50%" },
505
- animate: {
506
- pathLength: [0.1, 0.75, 0.1],
507
- rotate: ["0deg", "90deg", "360deg"]
508
- },
509
- transition: {
510
- duration: 2 / Math.max(0.1, crawlerSpeed),
511
- repeat: Number.POSITIVE_INFINITY,
512
- ease: [0.4, 0, 0.2, 1]
513
- }
656
+ strokeLinecap: "round"
514
657
  }
515
658
  )
516
- ]
659
+ ] })
517
660
  }
518
661
  )
519
662
  ] })
@@ -523,9 +666,9 @@ var CircularProgress = React9.forwardRef(
523
666
  );
524
667
  CircularProgress.displayName = "CircularProgress";
525
668
  function useContainerWidth() {
526
- const [width, setWidth] = React9.useState(0);
527
- const observerRef = React9.useRef(null);
528
- const ref = React9.useCallback((node) => {
669
+ const [width, setWidth] = React2.useState(0);
670
+ const observerRef = React2.useRef(null);
671
+ const ref = React2.useCallback((node) => {
529
672
  if (observerRef.current) {
530
673
  observerRef.current.disconnect();
531
674
  observerRef.current = null;
@@ -539,7 +682,7 @@ function useContainerWidth() {
539
682
  observerRef.current = obs;
540
683
  }
541
684
  }, []);
542
- React9.useEffect(() => {
685
+ React2.useEffect(() => {
543
686
  return () => {
544
687
  if (observerRef.current) {
545
688
  observerRef.current.disconnect();
@@ -549,7 +692,7 @@ function useContainerWidth() {
549
692
  return [ref, width];
550
693
  }
551
694
  function useMergedRef(...refs) {
552
- return React9.useCallback(
695
+ return React2.useCallback(
553
696
  (node) => {
554
697
  for (const ref of refs) {
555
698
  if (typeof ref === "function") {
@@ -563,7 +706,7 @@ function useMergedRef(...refs) {
563
706
  [refs]
564
707
  );
565
708
  }
566
- var FlatLinearTrack = React9.memo(function FlatLinearTrack2({
709
+ var FlatLinearTrack = React2.memo(function FlatLinearTrack2({
567
710
  trackHeight,
568
711
  activeColor,
569
712
  trackColor,
@@ -639,7 +782,7 @@ var FlatLinearTrack = React9.memo(function FlatLinearTrack2({
639
782
  }
640
783
  );
641
784
  });
642
- var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
785
+ var WavyLinearTrack = React2.memo(function WavyLinearTrack2({
643
786
  trackHeight,
644
787
  svgHeight,
645
788
  amplitude,
@@ -658,13 +801,13 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
658
801
  }) {
659
802
  const isDeterminate = typeof value === "number";
660
803
  const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
661
- const titleId = React9.useId();
804
+ const titleId = React2.useId();
662
805
  const [containerRef, width] = useContainerWidth();
663
- const activePathRef = React9.useRef(null);
664
- const trackPathRef = React9.useRef(null);
806
+ const activePathRef = React2.useRef(null);
807
+ const trackPathRef = React2.useRef(null);
665
808
  const amplitudeMV = useMotionValue(amplitude);
666
809
  const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
667
- React9.useEffect(() => {
810
+ React2.useEffect(() => {
668
811
  if (isDeterminate) {
669
812
  const fraction = clampedValue / 100;
670
813
  let targetAmp = amplitude;
@@ -677,6 +820,12 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
677
820
  duration: 0.5
678
821
  });
679
822
  animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
823
+ } else {
824
+ animate(amplitudeMV, amplitude, {
825
+ type: "spring",
826
+ bounce: 0,
827
+ duration: 0.5
828
+ });
680
829
  }
681
830
  }, [
682
831
  clampedValue,
@@ -690,10 +839,10 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
690
839
  1,
691
840
  isDeterminate ? wavelength : indeterminateWavelength
692
841
  );
693
- const trackAmp = trackShape === "wavy" ? amplitude : 0;
694
842
  useAnimationFrame((time) => {
695
843
  if (width === 0) return;
696
844
  const currentAmp = amplitudeMV.get();
845
+ const trackAmp = trackShape === "wavy" ? amplitude : 0;
697
846
  const phase = time / 1e3 * waveSpeed * activeWavelength;
698
847
  const capWidth = trackHeight / 2;
699
848
  let activePathD = "";
@@ -713,7 +862,7 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
713
862
  currentAmp
714
863
  );
715
864
  } else if (fraction === 0) {
716
- activePathD = `M ${capWidth} 0 L ${capWidth + 0.01} 0`;
865
+ activePathD = "";
717
866
  }
718
867
  const trackStart = adjHead + totalGap;
719
868
  if (trackStart < width - capWidth) {
@@ -745,20 +894,20 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
745
894
  activeLines.push({ tail: l1T, head: l1H });
746
895
  activeLines.push({ tail: l2T, head: l2H });
747
896
  }
748
- const segments = activeLines.map((line) => {
749
- const barTail = line.tail * width;
750
- const barHead = line.head * width;
897
+ const activeSegments = activeLines.map((line) => {
898
+ const rawTail = line.tail * width;
899
+ const rawHead = line.head * width;
751
900
  const adjTail = Math.max(
752
901
  capWidth,
753
- Math.min(width - capWidth, barTail)
902
+ Math.min(width - capWidth, rawTail)
754
903
  );
755
904
  const adjHead = Math.max(
756
905
  capWidth,
757
- Math.min(width - capWidth, barHead)
906
+ Math.min(width - capWidth, rawHead)
758
907
  );
759
908
  return { adjTail, adjHead };
760
909
  }).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
761
- activePathD = segments.map(
910
+ activePathD = activeSegments.map(
762
911
  (seg) => getSinePath(
763
912
  seg.adjTail,
764
913
  seg.adjHead,
@@ -767,13 +916,24 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
767
916
  currentAmp
768
917
  )
769
918
  ).join(" ");
919
+ const validActiveLines = activeLines.filter(
920
+ (line) => line.head > line.tail && line.head * width > 0 && line.tail * width < width
921
+ ).sort((a, b) => a.tail - b.tail);
770
922
  let currentTrackX = capWidth;
771
- for (const seg of segments) {
772
- const trackEnd = seg.adjTail - totalGap;
923
+ for (const line of validActiveLines) {
924
+ const blockStart = line.tail * width - totalGap;
925
+ const blockEnd = line.head * width + totalGap;
926
+ const trackEnd = Math.min(width - capWidth, blockStart);
773
927
  if (trackEnd > currentTrackX) {
774
- trackD += `${getSinePath(currentTrackX, trackEnd, phase, activeWavelength, trackAmp)} `;
928
+ trackD += `${getSinePath(
929
+ currentTrackX,
930
+ trackEnd,
931
+ phase,
932
+ activeWavelength,
933
+ trackAmp
934
+ )} `;
775
935
  }
776
- currentTrackX = Math.max(currentTrackX, seg.adjHead + totalGap);
936
+ currentTrackX = Math.max(currentTrackX, blockEnd);
777
937
  }
778
938
  if (currentTrackX < width - capWidth) {
779
939
  trackD += getSinePath(
@@ -786,15 +946,15 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
786
946
  }
787
947
  }
788
948
  if (activePathRef.current)
789
- activePathRef.current.setAttribute("d", activePathD);
949
+ activePathRef.current.setAttribute("d", activePathD || "");
790
950
  if (trackPathRef.current)
791
- trackPathRef.current.setAttribute("d", trackD.trim());
951
+ trackPathRef.current.setAttribute("d", trackD.trim() || "");
792
952
  });
793
953
  return /* @__PURE__ */ jsx(
794
954
  "div",
795
955
  {
796
956
  ref: containerRef,
797
- className: "relative w-full overflow-hidden",
957
+ className: "relative w-full",
798
958
  style: { height: svgHeight },
799
959
  children: width > 0 && /* @__PURE__ */ jsxs(
800
960
  "svg",
@@ -835,7 +995,7 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
835
995
  }
836
996
  );
837
997
  });
838
- var LinearProgress = React9.forwardRef(
998
+ var LinearProgress = React2.forwardRef(
839
999
  (_a, ref) => {
840
1000
  var _b = _a, {
841
1001
  value,
@@ -848,7 +1008,7 @@ var LinearProgress = React9.forwardRef(
848
1008
  waveSpeed = 1,
849
1009
  crawlerSpeed = 1,
850
1010
  determinateAnimation = "md3",
851
- indeterminateAnimation = "continuous",
1011
+ indeterminateAnimation = "md3",
852
1012
  gapSize = 4,
853
1013
  showStopIndicator = "auto",
854
1014
  color,
@@ -876,33 +1036,35 @@ var LinearProgress = React9.forwardRef(
876
1036
  ]);
877
1037
  const isDeterminate = value !== void 0;
878
1038
  const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
879
- const containerRef = React9.useRef(null);
1039
+ const containerRef = React2.useRef(null);
880
1040
  const mergedRef = useMergedRef(ref, containerRef);
881
- const [isRtl, setIsRtl] = React9.useState(false);
882
- React9.useEffect(() => {
1041
+ const [isRtl, setIsRtl] = React2.useState(false);
1042
+ React2.useEffect(() => {
883
1043
  if (containerRef.current) {
884
1044
  const dir = getComputedStyle(containerRef.current).direction;
885
1045
  setIsRtl(dir === "rtl");
886
1046
  }
887
1047
  }, []);
888
- const isWavy = shape === "wavy";
889
1048
  const resolvedTrackShape = trackShape != null ? trackShape : shape;
890
- const effectiveAmplitude = React9.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
891
- const svgHeight = React9.useMemo(
1049
+ const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
1050
+ const effectiveAmplitude = React2.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
1051
+ const svgHeight = React2.useMemo(
892
1052
  () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
893
1053
  [isWavy, trackHeight, effectiveAmplitude]
894
1054
  );
895
- const shouldShowStop = React9.useMemo(
896
- () => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
1055
+ const shouldShowStop = React2.useMemo(
1056
+ () => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
897
1057
  [isDeterminate, resolvedTrackShape, showStopIndicator]
898
1058
  );
899
- const stopSize = React9.useMemo(
1059
+ const stopSize = React2.useMemo(
900
1060
  () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
901
1061
  [trackHeight]
902
1062
  );
903
1063
  const stopOffset = (trackHeight - stopSize) / 2;
904
1064
  const activeColor = color || "var(--md-sys-color-indicator-active)";
905
1065
  const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
1066
+ const useWavyTrack = isWavy || !isDeterminate;
1067
+ const trackAmp = isWavy ? effectiveAmplitude : 0;
906
1068
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
907
1069
  "div",
908
1070
  __spreadProps(__spreadValues({
@@ -919,12 +1081,12 @@ var LinearProgress = React9.forwardRef(
919
1081
  style: { height: svgHeight }
920
1082
  }, restProps), {
921
1083
  children: [
922
- isWavy ? /* @__PURE__ */ jsx(
1084
+ useWavyTrack ? /* @__PURE__ */ jsx(
923
1085
  WavyLinearTrack,
924
1086
  {
925
1087
  trackHeight,
926
1088
  svgHeight,
927
- amplitude: effectiveAmplitude,
1089
+ amplitude: trackAmp,
928
1090
  wavelength,
929
1091
  indeterminateWavelength,
930
1092
  activeColor,
@@ -969,14 +1131,14 @@ var LinearProgress = React9.forwardRef(
969
1131
  }
970
1132
  );
971
1133
  LinearProgress.displayName = "LinearProgress";
972
- var ProgressIndicator = React9.forwardRef((props, ref) => {
1134
+ var ProgressIndicator = React2.forwardRef((props, ref) => {
973
1135
  if (props.variant === "circular") {
974
1136
  return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
975
1137
  }
976
1138
  return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
977
1139
  });
978
1140
  ProgressIndicator.displayName = "ProgressIndicator";
979
- var RippleItem = React9.memo(function RippleItem2({
1141
+ var RippleItem = React2.memo(function RippleItem2({
980
1142
  ripple,
981
1143
  onDone
982
1144
  }) {
@@ -1020,8 +1182,8 @@ function Ripple({
1020
1182
  }
1021
1183
  function useRippleState(options = {}) {
1022
1184
  const { disabled = false } = options;
1023
- const [ripples, setRipples] = React9.useState([]);
1024
- const onPointerDown = React9.useCallback(
1185
+ const [ripples, setRipples] = React2.useState([]);
1186
+ const onPointerDown = React2.useCallback(
1025
1187
  (e) => {
1026
1188
  if (disabled) return;
1027
1189
  const rect = e.currentTarget.getBoundingClientRect();
@@ -1038,7 +1200,7 @@ function useRippleState(options = {}) {
1038
1200
  },
1039
1201
  [disabled]
1040
1202
  );
1041
- const removeRipple = React9.useCallback((id) => {
1203
+ const removeRipple = React2.useCallback((id) => {
1042
1204
  setRipples((prev) => prev.filter((r) => r.id !== id));
1043
1205
  }, []);
1044
1206
  return { ripples, onPointerDown, removeRipple };
@@ -1273,7 +1435,7 @@ function resolveDisabledBgClass(colorStyle) {
1273
1435
  }
1274
1436
  return "disabled:text-m3-on-surface/[0.38]";
1275
1437
  }
1276
- var IconButtonComponent = React9.forwardRef(
1438
+ var IconButtonComponent = React2.forwardRef(
1277
1439
  (_a, ref) => {
1278
1440
  var _b = _a, {
1279
1441
  className,
@@ -1315,18 +1477,18 @@ var IconButtonComponent = React9.forwardRef(
1315
1477
  var _a2, _b2, _c, _d, _e;
1316
1478
  const isToggle = variant === "toggle";
1317
1479
  const isSelected = isToggle && !!selected;
1318
- const resolvedColorClass = React9.useMemo(
1480
+ const resolvedColorClass = React2.useMemo(
1319
1481
  () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
1320
1482
  [isSelected, colorStyle]
1321
1483
  );
1322
- const outlineWidthClass = React9.useMemo(
1484
+ const outlineWidthClass = React2.useMemo(
1323
1485
  () => {
1324
1486
  var _a3;
1325
1487
  return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
1326
1488
  },
1327
1489
  [colorStyle, isSelected, size]
1328
1490
  );
1329
- const disabledBgClass = React9.useMemo(
1491
+ const disabledBgClass = React2.useMemo(
1330
1492
  () => resolveDisabledBgClass(colorStyle),
1331
1493
  [colorStyle]
1332
1494
  );
@@ -1349,7 +1511,7 @@ var IconButtonComponent = React9.forwardRef(
1349
1511
  const { ripples, onPointerDown, removeRipple } = useRippleState({
1350
1512
  disabled: loading
1351
1513
  });
1352
- const handleClick = React9.useCallback(
1514
+ const handleClick = React2.useCallback(
1353
1515
  (e) => {
1354
1516
  if (loading) {
1355
1517
  e.preventDefault();
@@ -1359,7 +1521,7 @@ var IconButtonComponent = React9.forwardRef(
1359
1521
  },
1360
1522
  [loading, onClick]
1361
1523
  );
1362
- const handleKeyDown = React9.useCallback(
1524
+ const handleKeyDown = React2.useCallback(
1363
1525
  (e) => {
1364
1526
  if (loading) return;
1365
1527
  if ((e.key === "Enter" || e.key === " ") && onClick) {
@@ -1415,7 +1577,7 @@ var IconButtonComponent = React9.forwardRef(
1415
1577
  width: isCustomSize ? `${iconSize}px` : void 0,
1416
1578
  height: isCustomSize ? `${iconSize}px` : void 0
1417
1579
  },
1418
- children: isSelected && selectedIcon ? selectedIcon : asChild ? React9.Children.only(children).props.children : children
1580
+ children: isSelected && selectedIcon ? selectedIcon : asChild ? React2.Children.only(children).props.children : children
1419
1581
  }),
1420
1582
  isSelected && selectedIcon ? "selected-content" : "content"
1421
1583
  ) })
@@ -1432,7 +1594,7 @@ var IconButtonComponent = React9.forwardRef(
1432
1594
  className
1433
1595
  );
1434
1596
  if (asChild) {
1435
- const child = React9.Children.only(children);
1597
+ const child = React2.Children.only(children);
1436
1598
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
1437
1599
  Slot,
1438
1600
  __spreadProps(__spreadValues({
@@ -1449,7 +1611,7 @@ var IconButtonComponent = React9.forwardRef(
1449
1611
  }),
1450
1612
  className: containerClassName
1451
1613
  }, restProps), {
1452
- children: React9.cloneElement(child, { children: innerContent })
1614
+ children: React2.cloneElement(child, { children: innerContent })
1453
1615
  })
1454
1616
  ) });
1455
1617
  }
@@ -1477,13 +1639,13 @@ var IconButtonComponent = React9.forwardRef(
1477
1639
  }
1478
1640
  );
1479
1641
  IconButtonComponent.displayName = "IconButton";
1480
- var IconButton = React9.memo(IconButtonComponent);
1642
+ var IconButton = React2.memo(IconButtonComponent);
1481
1643
  var VARIANT_FONT = {
1482
1644
  outlined: "'Material Symbols Outlined'",
1483
1645
  rounded: "'Material Symbols Rounded'",
1484
1646
  sharp: "'Material Symbols Sharp'"
1485
1647
  };
1486
- var IconComponent = React9.forwardRef(
1648
+ var IconComponent = React2.forwardRef(
1487
1649
  (_a, ref) => {
1488
1650
  var _b = _a, {
1489
1651
  name,
@@ -1549,8 +1711,8 @@ var IconComponent = React9.forwardRef(
1549
1711
  }
1550
1712
  );
1551
1713
  IconComponent.displayName = "Icon";
1552
- var Icon = React9.memo(IconComponent);
1553
- var ScrollArea = React9.forwardRef(
1714
+ var Icon = React2.memo(IconComponent);
1715
+ var ScrollArea = React2.forwardRef(
1554
1716
  (_a, ref) => {
1555
1717
  var _b = _a, {
1556
1718
  className,
@@ -1571,15 +1733,15 @@ var ScrollArea = React9.forwardRef(
1571
1733
  "viewportRef",
1572
1734
  "viewportProps"
1573
1735
  ]);
1574
- const [isTouchDevice, setIsTouchDevice] = React9.useState(false);
1575
- React9.useEffect(() => {
1736
+ const [isTouchDevice, setIsTouchDevice] = React2.useState(false);
1737
+ React2.useEffect(() => {
1576
1738
  if (typeof window !== "undefined") {
1577
1739
  setIsTouchDevice(
1578
1740
  "ontouchstart" in window || navigator.maxTouchPoints > 0
1579
1741
  );
1580
1742
  }
1581
1743
  }, []);
1582
- const resolvedType = React9.useMemo(() => {
1744
+ const resolvedType = React2.useMemo(() => {
1583
1745
  if (type === "hover" && isTouchDevice) {
1584
1746
  return "scroll";
1585
1747
  }
@@ -1630,7 +1792,7 @@ var ScrollArea = React9.forwardRef(
1630
1792
  }
1631
1793
  );
1632
1794
  ScrollArea.displayName = "ScrollArea";
1633
- var ScrollAreaScrollbar = React9.forwardRef((_a, ref) => {
1795
+ var ScrollAreaScrollbar = React2.forwardRef((_a, ref) => {
1634
1796
  var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
1635
1797
  return /* @__PURE__ */ jsx(
1636
1798
  RadixScrollArea.Scrollbar,
@@ -1660,7 +1822,7 @@ var ScrollAreaScrollbar = React9.forwardRef((_a, ref) => {
1660
1822
  );
1661
1823
  });
1662
1824
  ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
1663
- var ScrollAreaCorner = React9.forwardRef((_a, ref) => {
1825
+ var ScrollAreaCorner = React2.forwardRef((_a, ref) => {
1664
1826
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1665
1827
  return /* @__PURE__ */ jsx(
1666
1828
  RadixScrollArea.Corner,
@@ -1702,9 +1864,9 @@ DialogTrigger.displayName = "DialogTrigger";
1702
1864
  var DialogPortal = ({
1703
1865
  open,
1704
1866
  children
1705
- }) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React9.Children.toArray(children) : null }) });
1867
+ }) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React2.Children.toArray(children) : null }) });
1706
1868
  DialogPortal.displayName = "DialogPortal";
1707
- var DialogOverlay = React9.forwardRef((_a, ref) => {
1869
+ var DialogOverlay = React2.forwardRef((_a, ref) => {
1708
1870
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1709
1871
  return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
1710
1872
  m.div,
@@ -1715,7 +1877,7 @@ var DialogOverlay = React9.forwardRef((_a, ref) => {
1715
1877
  ) }));
1716
1878
  });
1717
1879
  DialogOverlay.displayName = "DialogOverlay";
1718
- var DialogContent = React9.forwardRef((_a, ref) => {
1880
+ var DialogContent = React2.forwardRef((_a, ref) => {
1719
1881
  var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
1720
1882
  return /* @__PURE__ */ jsx(
1721
1883
  RadixDialog.Content,
@@ -1755,7 +1917,7 @@ var DialogContent = React9.forwardRef((_a, ref) => {
1755
1917
  );
1756
1918
  });
1757
1919
  DialogContent.displayName = "DialogContent";
1758
- var DialogIcon = React9.forwardRef((_a, ref) => {
1920
+ var DialogIcon = React2.forwardRef((_a, ref) => {
1759
1921
  var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
1760
1922
  return /* @__PURE__ */ jsx(
1761
1923
  "div",
@@ -1778,7 +1940,7 @@ var DialogHeader = (_a) => {
1778
1940
  return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
1779
1941
  };
1780
1942
  DialogHeader.displayName = "DialogHeader";
1781
- var DialogTitle = React9.forwardRef((_a, ref) => {
1943
+ var DialogTitle = React2.forwardRef((_a, ref) => {
1782
1944
  var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
1783
1945
  return /* @__PURE__ */ jsx(
1784
1946
  RadixDialog.Title,
@@ -1793,7 +1955,7 @@ var DialogTitle = React9.forwardRef((_a, ref) => {
1793
1955
  );
1794
1956
  });
1795
1957
  DialogTitle.displayName = "DialogTitle";
1796
- var DialogDescription = React9.forwardRef((_a, ref) => {
1958
+ var DialogDescription = React2.forwardRef((_a, ref) => {
1797
1959
  var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
1798
1960
  return /* @__PURE__ */ jsx(
1799
1961
  RadixDialog.Description,
@@ -1805,7 +1967,7 @@ var DialogDescription = React9.forwardRef((_a, ref) => {
1805
1967
  );
1806
1968
  });
1807
1969
  DialogDescription.displayName = "DialogDescription";
1808
- var DialogBody = React9.forwardRef((_a, ref) => {
1970
+ var DialogBody = React2.forwardRef((_a, ref) => {
1809
1971
  var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
1810
1972
  return /* @__PURE__ */ jsx(
1811
1973
  ScrollArea,
@@ -1836,7 +1998,7 @@ var DialogFooter = (_a) => {
1836
1998
  };
1837
1999
  DialogFooter.displayName = "DialogFooter";
1838
2000
  var DialogClose = RadixDialog.Close;
1839
- var DialogFullScreenContent = React9.forwardRef(
2001
+ var DialogFullScreenContent = React2.forwardRef(
1840
2002
  (_a, ref) => {
1841
2003
  var _b = _a, {
1842
2004
  className,
@@ -1933,7 +2095,7 @@ var DrawerPortal = ({
1933
2095
  open,
1934
2096
  children
1935
2097
  }) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
1936
- var DrawerOverlay = React9.forwardRef((_a, ref) => {
2098
+ var DrawerOverlay = React2.forwardRef((_a, ref) => {
1937
2099
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
1938
2100
  return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
1939
2101
  m.div,
@@ -1944,7 +2106,7 @@ var DrawerOverlay = React9.forwardRef((_a, ref) => {
1944
2106
  ) }));
1945
2107
  });
1946
2108
  DrawerOverlay.displayName = "DrawerOverlay";
1947
- var DrawerContent = React9.forwardRef(
2109
+ var DrawerContent = React2.forwardRef(
1948
2110
  (_a, ref) => {
1949
2111
  var _b = _a, {
1950
2112
  className,
@@ -2023,7 +2185,7 @@ var DrawerFooter = (_a) => {
2023
2185
  return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
2024
2186
  };
2025
2187
  DrawerFooter.displayName = "DrawerFooter";
2026
- var DrawerTitle = React9.forwardRef((_a, ref) => {
2188
+ var DrawerTitle = React2.forwardRef((_a, ref) => {
2027
2189
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
2028
2190
  return /* @__PURE__ */ jsx(
2029
2191
  RadixDialog.Title,
@@ -2037,7 +2199,7 @@ var DrawerTitle = React9.forwardRef((_a, ref) => {
2037
2199
  );
2038
2200
  });
2039
2201
  DrawerTitle.displayName = "DrawerTitle";
2040
- var DrawerDescription = React9.forwardRef((_a, ref) => {
2202
+ var DrawerDescription = React2.forwardRef((_a, ref) => {
2041
2203
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
2042
2204
  return /* @__PURE__ */ jsx(
2043
2205
  RadixDialog.Description,
@@ -2049,7 +2211,7 @@ var DrawerDescription = React9.forwardRef((_a, ref) => {
2049
2211
  });
2050
2212
  DrawerDescription.displayName = "DrawerDescription";
2051
2213
  var INDICATOR = "h-1 w-8 rounded-full bg-m3-on-surface-variant/40";
2052
- var DragHandle = React9.forwardRef(
2214
+ var DragHandle = React2.forwardRef(
2053
2215
  ({ className, onCycle, "aria-label": ariaLabel }, ref) => {
2054
2216
  const isInteractive = Boolean(onCycle);
2055
2217
  if (isInteractive) {
@@ -2602,7 +2764,7 @@ function resolveMaxHeight(maxHeight, snapPoints) {
2602
2764
  return ABSOLUTE_MAX_HEIGHT;
2603
2765
  return maxHeight;
2604
2766
  }
2605
- var BottomSheet = React9.forwardRef(
2767
+ var BottomSheet = React2.forwardRef(
2606
2768
  ({
2607
2769
  isOpen,
2608
2770
  onClose,
@@ -2635,27 +2797,27 @@ var BottomSheet = React9.forwardRef(
2635
2797
  isModal: false,
2636
2798
  maxHeight: resolveMaxHeight(maxHeight, snapPoints)
2637
2799
  });
2638
- React9.useEffect(() => {
2800
+ React2.useEffect(() => {
2639
2801
  const node = scope.current;
2640
2802
  if (node) {
2641
2803
  node.snapTo = snapTo;
2642
2804
  }
2643
2805
  }, [snapTo, scope]);
2644
- const [mounted, setMounted] = React9.useState(false);
2645
- React9.useEffect(() => {
2806
+ const [mounted, setMounted] = React2.useState(false);
2807
+ React2.useEffect(() => {
2646
2808
  setMounted(true);
2647
2809
  }, []);
2648
- const resolvedDividers = React9.useMemo(
2810
+ const resolvedDividers = React2.useMemo(
2649
2811
  () => resolveDividers(divider),
2650
2812
  [divider]
2651
2813
  );
2652
- const resolvedSheetMaxWidth = React9.useMemo(() => {
2814
+ const resolvedSheetMaxWidth = React2.useMemo(() => {
2653
2815
  if (sheetMaxWidth === void 0)
2654
2816
  return "var(--m3-bottom-sheet-max-width, 640px)";
2655
2817
  if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
2656
2818
  return sheetMaxWidth;
2657
2819
  }, [sheetMaxWidth]);
2658
- const mergedRef = React9.useCallback(
2820
+ const mergedRef = React2.useCallback(
2659
2821
  (node) => {
2660
2822
  scope(node);
2661
2823
  if (typeof ref === "function") ref(node);
@@ -2739,7 +2901,7 @@ var SCRIM_ANIM = {
2739
2901
  },
2740
2902
  exit: { opacity: 0, transition: { duration: 0.18, ease: "easeIn" } }
2741
2903
  };
2742
- var Scrim = React9.forwardRef(
2904
+ var Scrim = React2.forwardRef(
2743
2905
  ({ onClick, className, style }, ref) => /* @__PURE__ */ jsx(
2744
2906
  m.div,
2745
2907
  __spreadValues({
@@ -2771,7 +2933,7 @@ function resolveSheetMaxWidth(value) {
2771
2933
  if (typeof value === "number") return `${value}px`;
2772
2934
  return value;
2773
2935
  }
2774
- var BottomSheetModal = React9.forwardRef(
2936
+ var BottomSheetModal = React2.forwardRef(
2775
2937
  ({
2776
2938
  isOpen,
2777
2939
  onClose,
@@ -2810,21 +2972,21 @@ var BottomSheetModal = React9.forwardRef(
2810
2972
  isModal: true,
2811
2973
  maxHeight: resolveMaxHeight2(maxHeight, snapPoints)
2812
2974
  });
2813
- React9.useEffect(() => {
2975
+ React2.useEffect(() => {
2814
2976
  const node = scope.current;
2815
2977
  if (node) {
2816
2978
  node.snapTo = snapTo;
2817
2979
  }
2818
2980
  }, [snapTo, scope]);
2819
- const resolvedDividers = React9.useMemo(
2981
+ const resolvedDividers = React2.useMemo(
2820
2982
  () => resolveDividers(divider),
2821
2983
  [divider]
2822
2984
  );
2823
- const resolvedSheetMaxWidth = React9.useMemo(
2985
+ const resolvedSheetMaxWidth = React2.useMemo(
2824
2986
  () => resolveSheetMaxWidth(sheetMaxWidth),
2825
2987
  [sheetMaxWidth]
2826
2988
  );
2827
- const mergedRef = React9.useCallback(
2989
+ const mergedRef = React2.useCallback(
2828
2990
  (node) => {
2829
2991
  scope(node);
2830
2992
  if (typeof ref === "function") ref(node);
@@ -3023,7 +3185,7 @@ function useBottomSheetScaffold({
3023
3185
  containerRef
3024
3186
  };
3025
3187
  }
3026
- var BottomSheetScaffold = React9.forwardRef(
3188
+ var BottomSheetScaffold = React2.forwardRef(
3027
3189
  ({
3028
3190
  sheetContent,
3029
3191
  children,
@@ -3052,13 +3214,13 @@ var BottomSheetScaffold = React9.forwardRef(
3052
3214
  onStateChange: onSheetStateChange,
3053
3215
  initialState: initialSheetState
3054
3216
  });
3055
- const resolvedSheetMaxWidth = React9.useMemo(() => {
3217
+ const resolvedSheetMaxWidth = React2.useMemo(() => {
3056
3218
  if (sheetMaxWidth === void 0)
3057
3219
  return "var(--m3-bottom-sheet-max-width, 640px)";
3058
3220
  if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
3059
3221
  return sheetMaxWidth;
3060
3222
  }, [sheetMaxWidth]);
3061
- const mergedRef = React9.useCallback(
3223
+ const mergedRef = React2.useCallback(
3062
3224
  (node) => {
3063
3225
  containerRef(node);
3064
3226
  if (typeof ref === "function") ref(node);
@@ -3066,7 +3228,7 @@ var BottomSheetScaffold = React9.forwardRef(
3066
3228
  },
3067
3229
  [containerRef, ref]
3068
3230
  );
3069
- const resolvedDragHandle = React9.useMemo(() => {
3231
+ const resolvedDragHandle = React2.useMemo(() => {
3070
3232
  if (sheetDragHandle === null) return null;
3071
3233
  if (sheetDragHandle !== void 0) return sheetDragHandle;
3072
3234
  return /* @__PURE__ */ jsx(DragHandle, { onCycle: toggle });
@@ -3129,7 +3291,7 @@ var BottomSheetScaffold = React9.forwardRef(
3129
3291
  );
3130
3292
  BottomSheetScaffold.displayName = "BottomSheetScaffold";
3131
3293
  var COPLANAR_TRANSITION = `margin ${getMotionTransitionCSS("default", "spatial")}`;
3132
- var SideSheet = React9.forwardRef(
3294
+ var SideSheet = React2.forwardRef(
3133
3295
  ({
3134
3296
  isOpen,
3135
3297
  children,
@@ -3145,16 +3307,16 @@ var SideSheet = React9.forwardRef(
3145
3307
  divider,
3146
3308
  scrollAreaProps
3147
3309
  }, ref) => {
3148
- const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
3149
- const [mounted, setMounted] = React9.useState(false);
3150
- React9.useEffect(() => {
3310
+ const sheetAnim = React2.useMemo(() => buildSideSheetAnim(edge), [edge]);
3311
+ const [mounted, setMounted] = React2.useState(false);
3312
+ React2.useEffect(() => {
3151
3313
  setMounted(true);
3152
3314
  }, []);
3153
- const resolvedDividers = React9.useMemo(
3315
+ const resolvedDividers = React2.useMemo(
3154
3316
  () => resolveDividers(divider),
3155
3317
  [divider]
3156
3318
  );
3157
- React9.useEffect(() => {
3319
+ React2.useEffect(() => {
3158
3320
  const sibling = coplanarSiblingRef == null ? void 0 : coplanarSiblingRef.current;
3159
3321
  if (!sibling) return;
3160
3322
  sibling.style.transition = COPLANAR_TRANSITION;
@@ -3218,7 +3380,7 @@ var SideSheet = React9.forwardRef(
3218
3380
  }
3219
3381
  );
3220
3382
  SideSheet.displayName = "SideSheet";
3221
- var SideSheetModal = React9.forwardRef(
3383
+ var SideSheetModal = React2.forwardRef(
3222
3384
  ({
3223
3385
  isOpen,
3224
3386
  onClose,
@@ -3233,8 +3395,8 @@ var SideSheetModal = React9.forwardRef(
3233
3395
  divider,
3234
3396
  scrollAreaProps
3235
3397
  }, ref) => {
3236
- const sheetAnim = React9.useMemo(() => buildSideSheetAnim(edge), [edge]);
3237
- const resolvedDividers = React9.useMemo(
3398
+ const sheetAnim = React2.useMemo(() => buildSideSheetAnim(edge), [edge]);
3399
+ const resolvedDividers = React2.useMemo(
3238
3400
  () => resolveDividers(divider),
3239
3401
  [divider]
3240
3402
  );