@bug-on/m3-expressive 1.2.6 → 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/feedback.js CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var react = require('motion/react');
5
- var React12 = require('react');
5
+ var React3 = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
8
8
  var jsxRuntime = require('react/jsx-runtime');
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
27
27
  return Object.freeze(n);
28
28
  }
29
29
 
30
- var React12__namespace = /*#__PURE__*/_interopNamespace(React12);
30
+ var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
31
31
 
32
32
  var __defProp = Object.defineProperty;
33
33
  var __defProps = Object.defineProperties;
@@ -99,9 +99,9 @@ function formatBadgeLabel(children, max) {
99
99
  return "";
100
100
  }
101
101
  function detectBadgeHasContent(badge) {
102
- return React12__namespace.isValidElement(badge) && badge.props.children != null;
102
+ return React3__namespace.isValidElement(badge) && badge.props.children != null;
103
103
  }
104
- var BadgeImpl = React12__namespace.forwardRef(
104
+ var BadgeImpl = React3__namespace.forwardRef(
105
105
  (_a, ref) => {
106
106
  var _b = _a, {
107
107
  children,
@@ -155,7 +155,7 @@ var BadgeImpl = React12__namespace.forwardRef(
155
155
  }
156
156
  );
157
157
  BadgeImpl.displayName = "Badge";
158
- var Badge = React12__namespace.memo(BadgeImpl);
158
+ var Badge = React3__namespace.memo(BadgeImpl);
159
159
  function BadgedBox({
160
160
  badge,
161
161
  children,
@@ -221,11 +221,11 @@ var ROTATE_KEY_SPLINES = [
221
221
  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";
222
222
  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";
223
223
  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";
224
- var IndeterminateSvg = React12__namespace.memo(function IndeterminateSvg2({
224
+ var IndeterminateSvg = React3__namespace.memo(function IndeterminateSvg2({
225
225
  size
226
226
  }) {
227
- const [ready, setReady] = React12__namespace.useState(false);
228
- React12__namespace.useEffect(() => {
227
+ const [ready, setReady] = React3__namespace.useState(false);
228
+ React3__namespace.useEffect(() => {
229
229
  const raf = requestAnimationFrame(() => setReady(true));
230
230
  return () => cancelAnimationFrame(raf);
231
231
  }, []);
@@ -270,7 +270,7 @@ var IndeterminateSvg = React12__namespace.memo(function IndeterminateSvg2({
270
270
  }
271
271
  );
272
272
  });
273
- var DeterminateSvg = React12__namespace.memo(function DeterminateSvg2({
273
+ var DeterminateSvg = React3__namespace.memo(function DeterminateSvg2({
274
274
  size,
275
275
  progress
276
276
  }) {
@@ -295,7 +295,7 @@ var DeterminateSvg = React12__namespace.memo(function DeterminateSvg2({
295
295
  }
296
296
  );
297
297
  });
298
- var LoadingIndicator = React12__namespace.forwardRef(
298
+ var LoadingIndicator = React3__namespace.forwardRef(
299
299
  (_a, ref) => {
300
300
  var _b = _a, {
301
301
  variant = "uncontained",
@@ -390,7 +390,7 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
390
390
  if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
391
391
  d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
392
392
  }
393
- return d;
393
+ return `${d} Z`;
394
394
  }
395
395
  function getSinePath(startX, endX, phase, wl, amp) {
396
396
  if (startX >= endX) return "";
@@ -422,7 +422,15 @@ function getSinePath(startX, endX, phase, wl, amp) {
422
422
  }
423
423
  return d;
424
424
  }
425
- var CircularProgress = React12__namespace.forwardRef(
425
+ var GLOBAL_ROTATION_DURATION = 6e3;
426
+ var GLOBAL_ROTATION_TARGET = 1080;
427
+ var ADDITIONAL_ROTATION_CYCLE = 1500;
428
+ var ADDITIONAL_ROTATION_STEP = 90;
429
+ var ADDITIONAL_ROTATION_EASE_DURATION = 500;
430
+ var DEFAULT_MIN_PROGRESS = 0.1;
431
+ var DEFAULT_MAX_PROGRESS = 0.8;
432
+ var PROGRESS_CYCLE_DURATION = 1500;
433
+ var CircularProgress = React3__namespace.forwardRef(
426
434
  (_a, ref) => {
427
435
  var _b = _a, {
428
436
  value,
@@ -435,6 +443,10 @@ var CircularProgress = React12__namespace.forwardRef(
435
443
  crawlerSpeed = 1,
436
444
  color,
437
445
  trackColor,
446
+ showTrack = "auto",
447
+ minProgress = DEFAULT_MIN_PROGRESS,
448
+ maxProgress = DEFAULT_MAX_PROGRESS,
449
+ amplitudeRange,
438
450
  className,
439
451
  "aria-label": ariaLabel
440
452
  } = _b, restProps = __objRest(_b, [
@@ -448,6 +460,10 @@ var CircularProgress = React12__namespace.forwardRef(
448
460
  "crawlerSpeed",
449
461
  "color",
450
462
  "trackColor",
463
+ "showTrack",
464
+ "minProgress",
465
+ "maxProgress",
466
+ "amplitudeRange",
451
467
  "className",
452
468
  "aria-label"
453
469
  ]);
@@ -458,17 +474,22 @@ var CircularProgress = React12__namespace.forwardRef(
458
474
  const activeColor = color || "var(--md-sys-color-indicator-active)";
459
475
  const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
460
476
  const isWavy = shape === "wavy";
477
+ const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
461
478
  const BASELINE_SIZE = 48;
462
479
  const scaleFactor = size / BASELINE_SIZE;
463
- const effectiveAmplitude = React12__namespace.useMemo(
480
+ const effectiveAmplitude = React3__namespace.useMemo(
464
481
  () => amplitude != null ? amplitude : 1.6 * scaleFactor,
465
482
  [amplitude, scaleFactor]
466
483
  );
467
- const effectiveWavelength = React12__namespace.useMemo(
484
+ const effectiveWavelength = React3__namespace.useMemo(
468
485
  () => wavelength != null ? wavelength : 15 * scaleFactor,
469
486
  [wavelength, scaleFactor]
470
487
  );
471
- const wavyActivePath = React12__namespace.useMemo(
488
+ const resolvedAmplitudeRange = React3__namespace.useMemo(
489
+ () => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
490
+ [amplitudeRange, effectiveAmplitude]
491
+ );
492
+ const wavyActivePath = React3__namespace.useMemo(
472
493
  () => isWavy ? generateWavyCircularPath(
473
494
  center,
474
495
  radius,
@@ -477,8 +498,8 @@ var CircularProgress = React12__namespace.forwardRef(
477
498
  ) : null,
478
499
  [isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
479
500
  );
480
- const circumference = React12__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
481
- const gapForTrack = React12__namespace.useMemo(
501
+ const circumference = React3__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
502
+ const gapForTrack = React3__namespace.useMemo(
482
503
  () => (gapSize + trackHeight) / circumference,
483
504
  [gapSize, trackHeight, circumference]
484
505
  );
@@ -487,6 +508,145 @@ var CircularProgress = React12__namespace.forwardRef(
487
508
  const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
488
509
  const ActiveCircleElem = react.m.circle;
489
510
  const ActivePathElem = react.m.path;
511
+ const indeterminateSvgRef = React3__namespace.useRef(null);
512
+ const indeterminateTrackRef = React3__namespace.useRef(null);
513
+ const indeterminateActiveRef = React3__namespace.useRef(null);
514
+ const indeterminateWavyTrackPathRef = React3__namespace.useRef(null);
515
+ const indeterminateWavyActivePathRef = React3__namespace.useRef(null);
516
+ const cachedPathLengthRef = React3__namespace.useRef(0);
517
+ React3__namespace.useLayoutEffect(() => {
518
+ if (!isWavy || !wavyActivePath) {
519
+ cachedPathLengthRef.current = circumference;
520
+ return;
521
+ }
522
+ const el = indeterminateActiveRef.current;
523
+ if (el && "getTotalLength" in el) {
524
+ try {
525
+ const len = el.getTotalLength();
526
+ if (len > 0) {
527
+ cachedPathLengthRef.current = len;
528
+ return;
529
+ }
530
+ } catch (e) {
531
+ }
532
+ }
533
+ cachedPathLengthRef.current = circumference;
534
+ }, [isWavy, circumference, wavyActivePath]);
535
+ react.useAnimationFrame((time) => {
536
+ if (isDeterminate) return;
537
+ const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
538
+ const scaledTime = time * safeCrawlerSpeed;
539
+ const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
540
+ const globalAngle = globalCycle / GLOBAL_ROTATION_DURATION * GLOBAL_ROTATION_TARGET;
541
+ const additionalFullCycles = Math.floor(
542
+ scaledTime / ADDITIONAL_ROTATION_CYCLE
543
+ );
544
+ const additionalCycleTime = scaledTime % ADDITIONAL_ROTATION_CYCLE;
545
+ const additionalEaseT = Math.min(
546
+ 1,
547
+ additionalCycleTime / ADDITIONAL_ROTATION_EASE_DURATION
548
+ );
549
+ const additionalAngle = (additionalFullCycles + easeInOutCubic(additionalEaseT)) * ADDITIONAL_ROTATION_STEP;
550
+ const totalRotation = globalAngle + additionalAngle;
551
+ if (indeterminateSvgRef.current) {
552
+ indeterminateSvgRef.current.style.transform = `rotate(${totalRotation - 90}deg)`;
553
+ }
554
+ const progressFullCycle = PROGRESS_CYCLE_DURATION * 2;
555
+ const progressCycleTime = scaledTime % progressFullCycle;
556
+ let progress;
557
+ if (progressCycleTime < PROGRESS_CYCLE_DURATION) {
558
+ const t = progressCycleTime / PROGRESS_CYCLE_DURATION;
559
+ progress = minProgress + (maxProgress - minProgress) * easeInOutCubic(t);
560
+ } else {
561
+ const t = (progressCycleTime - PROGRESS_CYCLE_DURATION) / PROGRESS_CYCLE_DURATION;
562
+ progress = maxProgress - (maxProgress - minProgress) * easeInOutCubic(t);
563
+ }
564
+ if (isWavy) {
565
+ const amplitudeT = (progress - minProgress) / (maxProgress - minProgress);
566
+ const currentAmplitude = resolvedAmplitudeRange[0] + (resolvedAmplitudeRange[1] - resolvedAmplitudeRange[0]) * amplitudeT;
567
+ const dynamicPath = generateWavyCircularPath(
568
+ center,
569
+ radius,
570
+ currentAmplitude,
571
+ effectiveWavelength
572
+ );
573
+ if (indeterminateWavyActivePathRef.current) {
574
+ indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
575
+ }
576
+ if (indeterminateWavyTrackPathRef.current) {
577
+ indeterminateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
578
+ }
579
+ const pathEl = indeterminateWavyActivePathRef.current;
580
+ let totalLen = cachedPathLengthRef.current || circumference;
581
+ if (pathEl) {
582
+ try {
583
+ const len = pathEl.getTotalLength();
584
+ if (len > 0) totalLen = len;
585
+ } catch (e) {
586
+ }
587
+ }
588
+ const gapFrac = (gapSize + trackHeight) / totalLen;
589
+ const activeLen = totalLen * progress;
590
+ const activeOff = 0;
591
+ if (indeterminateWavyActivePathRef.current) {
592
+ indeterminateWavyActivePathRef.current.setAttribute(
593
+ "stroke-dasharray",
594
+ `${activeLen} ${totalLen}`
595
+ );
596
+ indeterminateWavyActivePathRef.current.setAttribute(
597
+ "stroke-dashoffset",
598
+ `${activeOff}`
599
+ );
600
+ }
601
+ if (shouldShowIndeterminateTrack && indeterminateWavyTrackPathRef.current) {
602
+ const trackStartFrac = progress + gapFrac;
603
+ const trackLen = Math.max(
604
+ 1e-3,
605
+ totalLen * (1 - progress - 2 * gapFrac)
606
+ );
607
+ const trackOff = -totalLen * trackStartFrac;
608
+ indeterminateWavyTrackPathRef.current.setAttribute(
609
+ "stroke-dasharray",
610
+ `${trackLen} ${totalLen}`
611
+ );
612
+ indeterminateWavyTrackPathRef.current.setAttribute(
613
+ "stroke-dashoffset",
614
+ `${trackOff}`
615
+ );
616
+ }
617
+ } else {
618
+ const totalLen = circumference;
619
+ const activeLen = totalLen * progress;
620
+ const activeOff = 0;
621
+ if (indeterminateActiveRef.current) {
622
+ indeterminateActiveRef.current.setAttribute(
623
+ "stroke-dasharray",
624
+ `${activeLen} ${totalLen}`
625
+ );
626
+ indeterminateActiveRef.current.setAttribute(
627
+ "stroke-dashoffset",
628
+ `${activeOff}`
629
+ );
630
+ }
631
+ if (shouldShowIndeterminateTrack && indeterminateTrackRef.current) {
632
+ const gapFrac = (gapSize + trackHeight) / totalLen;
633
+ const trackStartFrac = progress + gapFrac;
634
+ const trackLen = Math.max(
635
+ 1e-3,
636
+ totalLen * (1 - progress - 2 * gapFrac)
637
+ );
638
+ const trackOff = -totalLen * trackStartFrac;
639
+ indeterminateTrackRef.current.setAttribute(
640
+ "stroke-dasharray",
641
+ `${trackLen} ${totalLen}`
642
+ );
643
+ indeterminateTrackRef.current.setAttribute(
644
+ "stroke-dashoffset",
645
+ `${trackOff}`
646
+ );
647
+ }
648
+ }
649
+ });
490
650
  return /* @__PURE__ */ jsxRuntime.jsx(
491
651
  "div",
492
652
  __spreadProps(__spreadValues({
@@ -563,9 +723,10 @@ var CircularProgress = React12__namespace.forwardRef(
563
723
  ]
564
724
  }
565
725
  ),
566
- !isDeterminate && /* @__PURE__ */ jsxRuntime.jsxs(
567
- react.m.svg,
726
+ !isDeterminate && /* @__PURE__ */ jsxRuntime.jsx(
727
+ "svg",
568
728
  {
729
+ ref: indeterminateSvgRef,
569
730
  width: size,
570
731
  height: size,
571
732
  viewBox: `0 0 ${size} ${size}`,
@@ -574,84 +735,60 @@ var CircularProgress = React12__namespace.forwardRef(
574
735
  position: "absolute",
575
736
  inset: 0,
576
737
  overflow: "visible",
577
- transformOrigin: "center"
578
- },
579
- animate: { rotate: [0, 360] },
580
- transition: {
581
- duration: 2 / Math.max(0.1, crawlerSpeed),
582
- repeat: Number.POSITIVE_INFINITY,
583
- ease: "linear"
738
+ transformOrigin: "center",
739
+ transform: "rotate(-90deg)"
584
740
  },
585
- children: [
586
- /* @__PURE__ */ jsxRuntime.jsx(
587
- react.m.circle,
741
+ children: isWavy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
742
+ shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
743
+ "path",
588
744
  {
589
- cx: center,
590
- cy: center,
591
- r: radius,
745
+ ref: indeterminateWavyTrackPathRef,
746
+ d: wavyActivePath != null ? wavyActivePath : "",
592
747
  fill: "none",
593
748
  stroke: bgTrackColor,
594
749
  strokeWidth: trackHeight,
595
- strokeLinecap: "round",
596
- animate: {
597
- pathLength: [
598
- Math.max(1e-3, 0.9 - 2 * gapForTrack),
599
- Math.max(1e-3, 0.25 - 2 * gapForTrack),
600
- Math.max(1e-3, 0.9 - 2 * gapForTrack)
601
- ],
602
- pathOffset: [
603
- 0.1 + gapForTrack,
604
- 0.75 + gapForTrack,
605
- 0.1 + gapForTrack
606
- ]
607
- },
608
- transition: {
609
- duration: 2 / Math.max(0.1, crawlerSpeed),
610
- repeat: Number.POSITIVE_INFINITY,
611
- ease: [0.4, 0, 0.2, 1]
612
- }
750
+ strokeLinecap: "round"
613
751
  }
614
752
  ),
615
- isWavy ? /* @__PURE__ */ jsxRuntime.jsx(
616
- ActivePathElem,
753
+ /* @__PURE__ */ jsxRuntime.jsx(
754
+ "path",
617
755
  {
756
+ ref: indeterminateWavyActivePathRef,
618
757
  d: wavyActivePath != null ? wavyActivePath : "",
619
758
  fill: "none",
620
759
  stroke: activeColor,
621
760
  strokeWidth: trackHeight,
622
- strokeLinecap: "round",
623
- animate: {
624
- pathLength: [0.1, 0.75, 0.1],
625
- pathOffset: [0, 0.65, 1]
626
- },
627
- transition: {
628
- duration: 2 / Math.max(0.1, crawlerSpeed),
629
- repeat: Number.POSITIVE_INFINITY,
630
- ease: [0.4, 0, 0.2, 1]
631
- }
761
+ strokeLinecap: "round"
632
762
  }
633
- ) : /* @__PURE__ */ jsxRuntime.jsx(
634
- ActiveCircleElem,
763
+ )
764
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
765
+ shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
766
+ "circle",
635
767
  {
768
+ ref: indeterminateTrackRef,
769
+ cx: center,
770
+ cy: center,
771
+ r: radius,
772
+ fill: "none",
773
+ stroke: bgTrackColor,
774
+ strokeWidth: trackHeight,
775
+ strokeLinecap: "round"
776
+ }
777
+ ),
778
+ /* @__PURE__ */ jsxRuntime.jsx(
779
+ "circle",
780
+ {
781
+ ref: indeterminateActiveRef,
636
782
  cx: center,
637
783
  cy: center,
638
784
  r: radius,
639
785
  fill: "none",
640
786
  stroke: activeColor,
641
787
  strokeWidth: trackHeight,
642
- strokeLinecap: "round",
643
- animate: {
644
- pathLength: [0.1, 0.75, 0.1],
645
- pathOffset: [0, 0.65, 1]
646
- },
647
- transition: {
648
- duration: 2 / Math.max(0.1, crawlerSpeed),
649
- repeat: Number.POSITIVE_INFINITY,
650
- ease: [0.4, 0, 0.2, 1]
651
- }
788
+ strokeLinecap: "round"
652
789
  }
653
790
  )
654
- ]
791
+ ] })
655
792
  }
656
793
  )
657
794
  ] })
@@ -661,9 +798,9 @@ var CircularProgress = React12__namespace.forwardRef(
661
798
  );
662
799
  CircularProgress.displayName = "CircularProgress";
663
800
  function useContainerWidth() {
664
- const [width, setWidth] = React12__namespace.useState(0);
665
- const observerRef = React12__namespace.useRef(null);
666
- const ref = React12__namespace.useCallback((node) => {
801
+ const [width, setWidth] = React3__namespace.useState(0);
802
+ const observerRef = React3__namespace.useRef(null);
803
+ const ref = React3__namespace.useCallback((node) => {
667
804
  if (observerRef.current) {
668
805
  observerRef.current.disconnect();
669
806
  observerRef.current = null;
@@ -677,7 +814,7 @@ function useContainerWidth() {
677
814
  observerRef.current = obs;
678
815
  }
679
816
  }, []);
680
- React12__namespace.useEffect(() => {
817
+ React3__namespace.useEffect(() => {
681
818
  return () => {
682
819
  if (observerRef.current) {
683
820
  observerRef.current.disconnect();
@@ -687,7 +824,7 @@ function useContainerWidth() {
687
824
  return [ref, width];
688
825
  }
689
826
  function useMergedRef(...refs) {
690
- return React12__namespace.useCallback(
827
+ return React3__namespace.useCallback(
691
828
  (node) => {
692
829
  for (const ref of refs) {
693
830
  if (typeof ref === "function") {
@@ -701,7 +838,7 @@ function useMergedRef(...refs) {
701
838
  [refs]
702
839
  );
703
840
  }
704
- var FlatLinearTrack = React12__namespace.memo(function FlatLinearTrack2({
841
+ var FlatLinearTrack = React3__namespace.memo(function FlatLinearTrack2({
705
842
  trackHeight,
706
843
  activeColor,
707
844
  trackColor,
@@ -777,7 +914,7 @@ var FlatLinearTrack = React12__namespace.memo(function FlatLinearTrack2({
777
914
  }
778
915
  );
779
916
  });
780
- var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
917
+ var WavyLinearTrack = React3__namespace.memo(function WavyLinearTrack2({
781
918
  trackHeight,
782
919
  svgHeight,
783
920
  amplitude,
@@ -796,13 +933,13 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
796
933
  }) {
797
934
  const isDeterminate = typeof value === "number";
798
935
  const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
799
- const titleId = React12__namespace.useId();
936
+ const titleId = React3__namespace.useId();
800
937
  const [containerRef, width] = useContainerWidth();
801
- const activePathRef = React12__namespace.useRef(null);
802
- const trackPathRef = React12__namespace.useRef(null);
938
+ const activePathRef = React3__namespace.useRef(null);
939
+ const trackPathRef = React3__namespace.useRef(null);
803
940
  const amplitudeMV = react.useMotionValue(amplitude);
804
941
  const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
805
- React12__namespace.useEffect(() => {
942
+ React3__namespace.useEffect(() => {
806
943
  if (isDeterminate) {
807
944
  const fraction = clampedValue / 100;
808
945
  let targetAmp = amplitude;
@@ -857,7 +994,7 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
857
994
  currentAmp
858
995
  );
859
996
  } else if (fraction === 0) {
860
- activePathD = `M ${capWidth} 0 L ${capWidth + 0.01} 0`;
997
+ activePathD = "";
861
998
  }
862
999
  const trackStart = adjHead + totalGap;
863
1000
  if (trackStart < width - capWidth) {
@@ -889,20 +1026,20 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
889
1026
  activeLines.push({ tail: l1T, head: l1H });
890
1027
  activeLines.push({ tail: l2T, head: l2H });
891
1028
  }
892
- const segments = activeLines.map((line) => {
893
- const barTail = line.tail * width;
894
- const barHead = line.head * width;
1029
+ const activeSegments = activeLines.map((line) => {
1030
+ const rawTail = line.tail * width;
1031
+ const rawHead = line.head * width;
895
1032
  const adjTail = Math.max(
896
1033
  capWidth,
897
- Math.min(width - capWidth, barTail)
1034
+ Math.min(width - capWidth, rawTail)
898
1035
  );
899
1036
  const adjHead = Math.max(
900
1037
  capWidth,
901
- Math.min(width - capWidth, barHead)
1038
+ Math.min(width - capWidth, rawHead)
902
1039
  );
903
1040
  return { adjTail, adjHead };
904
1041
  }).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
905
- activePathD = segments.map(
1042
+ activePathD = activeSegments.map(
906
1043
  (seg) => getSinePath(
907
1044
  seg.adjTail,
908
1045
  seg.adjHead,
@@ -911,13 +1048,24 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
911
1048
  currentAmp
912
1049
  )
913
1050
  ).join(" ");
1051
+ const validActiveLines = activeLines.filter(
1052
+ (line) => line.head > line.tail && line.head * width > 0 && line.tail * width < width
1053
+ ).sort((a, b) => a.tail - b.tail);
914
1054
  let currentTrackX = capWidth;
915
- for (const seg of segments) {
916
- const trackEnd = seg.adjTail - totalGap;
1055
+ for (const line of validActiveLines) {
1056
+ const blockStart = line.tail * width - totalGap;
1057
+ const blockEnd = line.head * width + totalGap;
1058
+ const trackEnd = Math.min(width - capWidth, blockStart);
917
1059
  if (trackEnd > currentTrackX) {
918
- trackD += `${getSinePath(currentTrackX, trackEnd, phase, activeWavelength, trackAmp)} `;
1060
+ trackD += `${getSinePath(
1061
+ currentTrackX,
1062
+ trackEnd,
1063
+ phase,
1064
+ activeWavelength,
1065
+ trackAmp
1066
+ )} `;
919
1067
  }
920
- currentTrackX = Math.max(currentTrackX, seg.adjHead + totalGap);
1068
+ currentTrackX = Math.max(currentTrackX, blockEnd);
921
1069
  }
922
1070
  if (currentTrackX < width - capWidth) {
923
1071
  trackD += getSinePath(
@@ -930,9 +1078,9 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
930
1078
  }
931
1079
  }
932
1080
  if (activePathRef.current)
933
- activePathRef.current.setAttribute("d", activePathD);
1081
+ activePathRef.current.setAttribute("d", activePathD || "");
934
1082
  if (trackPathRef.current)
935
- trackPathRef.current.setAttribute("d", trackD.trim());
1083
+ trackPathRef.current.setAttribute("d", trackD.trim() || "");
936
1084
  });
937
1085
  return /* @__PURE__ */ jsxRuntime.jsx(
938
1086
  "div",
@@ -979,7 +1127,7 @@ var WavyLinearTrack = React12__namespace.memo(function WavyLinearTrack2({
979
1127
  }
980
1128
  );
981
1129
  });
982
- var LinearProgress = React12__namespace.forwardRef(
1130
+ var LinearProgress = React3__namespace.forwardRef(
983
1131
  (_a, ref) => {
984
1132
  var _b = _a, {
985
1133
  value,
@@ -1020,10 +1168,10 @@ var LinearProgress = React12__namespace.forwardRef(
1020
1168
  ]);
1021
1169
  const isDeterminate = value !== void 0;
1022
1170
  const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
1023
- const containerRef = React12__namespace.useRef(null);
1171
+ const containerRef = React3__namespace.useRef(null);
1024
1172
  const mergedRef = useMergedRef(ref, containerRef);
1025
- const [isRtl, setIsRtl] = React12__namespace.useState(false);
1026
- React12__namespace.useEffect(() => {
1173
+ const [isRtl, setIsRtl] = React3__namespace.useState(false);
1174
+ React3__namespace.useEffect(() => {
1027
1175
  if (containerRef.current) {
1028
1176
  const dir = getComputedStyle(containerRef.current).direction;
1029
1177
  setIsRtl(dir === "rtl");
@@ -1031,16 +1179,16 @@ var LinearProgress = React12__namespace.forwardRef(
1031
1179
  }, []);
1032
1180
  const resolvedTrackShape = trackShape != null ? trackShape : shape;
1033
1181
  const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
1034
- const effectiveAmplitude = React12__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
1035
- const svgHeight = React12__namespace.useMemo(
1182
+ const effectiveAmplitude = React3__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
1183
+ const svgHeight = React3__namespace.useMemo(
1036
1184
  () => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
1037
1185
  [isWavy, trackHeight, effectiveAmplitude]
1038
1186
  );
1039
- const shouldShowStop = React12__namespace.useMemo(
1187
+ const shouldShowStop = React3__namespace.useMemo(
1040
1188
  () => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
1041
1189
  [isDeterminate, resolvedTrackShape, showStopIndicator]
1042
1190
  );
1043
- const stopSize = React12__namespace.useMemo(
1191
+ const stopSize = React3__namespace.useMemo(
1044
1192
  () => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
1045
1193
  [trackHeight]
1046
1194
  );
@@ -1115,14 +1263,14 @@ var LinearProgress = React12__namespace.forwardRef(
1115
1263
  }
1116
1264
  );
1117
1265
  LinearProgress.displayName = "LinearProgress";
1118
- var ProgressIndicator = React12__namespace.forwardRef((props, ref) => {
1266
+ var ProgressIndicator = React3__namespace.forwardRef((props, ref) => {
1119
1267
  if (props.variant === "circular") {
1120
1268
  return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
1121
1269
  }
1122
1270
  return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
1123
1271
  });
1124
1272
  ProgressIndicator.displayName = "ProgressIndicator";
1125
- var RippleItem = React12__namespace.memo(function RippleItem2({
1273
+ var RippleItem = React3__namespace.memo(function RippleItem2({
1126
1274
  ripple,
1127
1275
  onDone
1128
1276
  }) {
@@ -1166,8 +1314,8 @@ function Ripple({
1166
1314
  }
1167
1315
  function useRippleState(options = {}) {
1168
1316
  const { disabled = false } = options;
1169
- const [ripples, setRipples] = React12__namespace.useState([]);
1170
- const onPointerDown = React12__namespace.useCallback(
1317
+ const [ripples, setRipples] = React3__namespace.useState([]);
1318
+ const onPointerDown = React3__namespace.useCallback(
1171
1319
  (e) => {
1172
1320
  if (disabled) return;
1173
1321
  const rect = e.currentTarget.getBoundingClientRect();
@@ -1184,7 +1332,7 @@ function useRippleState(options = {}) {
1184
1332
  },
1185
1333
  [disabled]
1186
1334
  );
1187
- const removeRipple = React12__namespace.useCallback((id) => {
1335
+ const removeRipple = React3__namespace.useCallback((id) => {
1188
1336
  setRipples((prev) => prev.filter((r) => r.id !== id));
1189
1337
  }, []);
1190
1338
  return { ripples, onPointerDown, removeRipple };
@@ -1332,7 +1480,7 @@ function resolveDisabledBgClass(colorStyle) {
1332
1480
  }
1333
1481
  return "disabled:text-m3-on-surface/[0.38]";
1334
1482
  }
1335
- var IconButtonComponent = React12__namespace.forwardRef(
1483
+ var IconButtonComponent = React3__namespace.forwardRef(
1336
1484
  (_a, ref) => {
1337
1485
  var _b = _a, {
1338
1486
  className,
@@ -1374,18 +1522,18 @@ var IconButtonComponent = React12__namespace.forwardRef(
1374
1522
  var _a2, _b2, _c, _d, _e;
1375
1523
  const isToggle = variant === "toggle";
1376
1524
  const isSelected = isToggle && !!selected;
1377
- const resolvedColorClass = React12__namespace.useMemo(
1525
+ const resolvedColorClass = React3__namespace.useMemo(
1378
1526
  () => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
1379
1527
  [isSelected, colorStyle]
1380
1528
  );
1381
- const outlineWidthClass = React12__namespace.useMemo(
1529
+ const outlineWidthClass = React3__namespace.useMemo(
1382
1530
  () => {
1383
1531
  var _a3;
1384
1532
  return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
1385
1533
  },
1386
1534
  [colorStyle, isSelected, size]
1387
1535
  );
1388
- const disabledBgClass = React12__namespace.useMemo(
1536
+ const disabledBgClass = React3__namespace.useMemo(
1389
1537
  () => resolveDisabledBgClass(colorStyle),
1390
1538
  [colorStyle]
1391
1539
  );
@@ -1408,7 +1556,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
1408
1556
  const { ripples, onPointerDown, removeRipple } = useRippleState({
1409
1557
  disabled: loading
1410
1558
  });
1411
- const handleClick = React12__namespace.useCallback(
1559
+ const handleClick = React3__namespace.useCallback(
1412
1560
  (e) => {
1413
1561
  if (loading) {
1414
1562
  e.preventDefault();
@@ -1418,7 +1566,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
1418
1566
  },
1419
1567
  [loading, onClick]
1420
1568
  );
1421
- const handleKeyDown = React12__namespace.useCallback(
1569
+ const handleKeyDown = React3__namespace.useCallback(
1422
1570
  (e) => {
1423
1571
  if (loading) return;
1424
1572
  if ((e.key === "Enter" || e.key === " ") && onClick) {
@@ -1474,7 +1622,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
1474
1622
  width: isCustomSize ? `${iconSize}px` : void 0,
1475
1623
  height: isCustomSize ? `${iconSize}px` : void 0
1476
1624
  },
1477
- children: isSelected && selectedIcon ? selectedIcon : asChild ? React12__namespace.Children.only(children).props.children : children
1625
+ children: isSelected && selectedIcon ? selectedIcon : asChild ? React3__namespace.Children.only(children).props.children : children
1478
1626
  }),
1479
1627
  isSelected && selectedIcon ? "selected-content" : "content"
1480
1628
  ) })
@@ -1491,7 +1639,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
1491
1639
  className
1492
1640
  );
1493
1641
  if (asChild) {
1494
- const child = React12__namespace.Children.only(children);
1642
+ const child = React3__namespace.Children.only(children);
1495
1643
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1496
1644
  reactSlot.Slot,
1497
1645
  __spreadProps(__spreadValues({
@@ -1508,7 +1656,7 @@ var IconButtonComponent = React12__namespace.forwardRef(
1508
1656
  }),
1509
1657
  className: containerClassName
1510
1658
  }, restProps), {
1511
- children: React12__namespace.cloneElement(child, { children: innerContent })
1659
+ children: React3__namespace.cloneElement(child, { children: innerContent })
1512
1660
  })
1513
1661
  ) });
1514
1662
  }
@@ -1536,13 +1684,13 @@ var IconButtonComponent = React12__namespace.forwardRef(
1536
1684
  }
1537
1685
  );
1538
1686
  IconButtonComponent.displayName = "IconButton";
1539
- var IconButton = React12__namespace.memo(IconButtonComponent);
1687
+ var IconButton = React3__namespace.memo(IconButtonComponent);
1540
1688
  var VARIANT_FONT = {
1541
1689
  outlined: "'Material Symbols Outlined'",
1542
1690
  rounded: "'Material Symbols Rounded'",
1543
1691
  sharp: "'Material Symbols Sharp'"
1544
1692
  };
1545
- var IconComponent = React12__namespace.forwardRef(
1693
+ var IconComponent = React3__namespace.forwardRef(
1546
1694
  (_a, ref) => {
1547
1695
  var _b = _a, {
1548
1696
  name,
@@ -1608,7 +1756,7 @@ var IconComponent = React12__namespace.forwardRef(
1608
1756
  }
1609
1757
  );
1610
1758
  IconComponent.displayName = "Icon";
1611
- var Icon = React12__namespace.memo(IconComponent);
1759
+ var Icon = React3__namespace.memo(IconComponent);
1612
1760
  var DURATION_MAP = {
1613
1761
  short: 4e3,
1614
1762
  long: 7e3
@@ -1650,9 +1798,9 @@ function toSnackbarData(item) {
1650
1798
  return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
1651
1799
  }
1652
1800
  function useSnackbarState() {
1653
- const [current, setCurrent] = React12__namespace.useState(null);
1654
- const queueRef = React12__namespace.useRef([]);
1655
- const showSnackbar = React12__namespace.useCallback(
1801
+ const [current, setCurrent] = React3__namespace.useState(null);
1802
+ const queueRef = React3__namespace.useRef([]);
1803
+ const showSnackbar = React3__namespace.useCallback(
1656
1804
  (visuals) => {
1657
1805
  return new Promise((resolve) => {
1658
1806
  const item = { visuals, resolve };
@@ -1665,14 +1813,14 @@ function useSnackbarState() {
1665
1813
  },
1666
1814
  []
1667
1815
  );
1668
- const _dismiss = React12__namespace.useCallback((result) => {
1816
+ const _dismiss = React3__namespace.useCallback((result) => {
1669
1817
  setCurrent((prev) => {
1670
1818
  if (prev) prev.resolve(result);
1671
1819
  const next = queueRef.current.shift();
1672
1820
  return next ? toSnackbarData(next) : null;
1673
1821
  });
1674
1822
  }, []);
1675
- React12__namespace.useEffect(() => {
1823
+ React3__namespace.useEffect(() => {
1676
1824
  return () => {
1677
1825
  for (const item of queueRef.current) {
1678
1826
  item.resolve(RESULT.DISMISSED);
@@ -1682,7 +1830,7 @@ function useSnackbarState() {
1682
1830
  }, []);
1683
1831
  return { current, showSnackbar, _dismiss };
1684
1832
  }
1685
- var Snackbar = React12__namespace.memo(function Snackbar2({
1833
+ var Snackbar = React3__namespace.memo(function Snackbar2({
1686
1834
  data,
1687
1835
  className
1688
1836
  }) {
@@ -1696,15 +1844,15 @@ var Snackbar = React12__namespace.memo(function Snackbar2({
1696
1844
  } = visuals;
1697
1845
  const reducedMotion = react.useReducedMotion();
1698
1846
  const durationMs = resolveDuration(duration);
1699
- React12__namespace.useEffect(() => {
1847
+ React3__namespace.useEffect(() => {
1700
1848
  const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
1701
1849
  return () => clearTimeout(timer);
1702
1850
  }, [resolve, durationMs]);
1703
- const handleAction = React12__namespace.useCallback(
1851
+ const handleAction = React3__namespace.useCallback(
1704
1852
  () => resolve(RESULT.ACTION),
1705
1853
  [resolve]
1706
1854
  );
1707
- const handleDismiss = React12__namespace.useCallback(
1855
+ const handleDismiss = React3__namespace.useCallback(
1708
1856
  () => resolve(RESULT.DISMISSED),
1709
1857
  [resolve]
1710
1858
  );
@@ -1772,7 +1920,7 @@ var Snackbar = React12__namespace.memo(function Snackbar2({
1772
1920
  Snackbar.displayName = "Snackbar";
1773
1921
  function SnackbarHost({ state, className }) {
1774
1922
  const { current, _dismiss } = state;
1775
- const wrappedData = React12__namespace.useMemo(() => {
1923
+ const wrappedData = React3__namespace.useMemo(() => {
1776
1924
  if (!current) return null;
1777
1925
  return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
1778
1926
  }, [current, _dismiss]);
@@ -1790,12 +1938,12 @@ function SnackbarHost({ state, className }) {
1790
1938
  ) });
1791
1939
  }
1792
1940
  SnackbarHost.displayName = "SnackbarHost";
1793
- var SnackbarContext = React12__namespace.createContext(
1941
+ var SnackbarContext = React3__namespace.createContext(
1794
1942
  null
1795
1943
  );
1796
1944
  function SnackbarProvider({ children }) {
1797
1945
  const state = useSnackbarState();
1798
- const contextValue = React12__namespace.useMemo(
1946
+ const contextValue = React3__namespace.useMemo(
1799
1947
  () => ({ showSnackbar: state.showSnackbar }),
1800
1948
  [state.showSnackbar]
1801
1949
  );
@@ -1806,7 +1954,7 @@ function SnackbarProvider({ children }) {
1806
1954
  }
1807
1955
  SnackbarProvider.displayName = "SnackbarProvider";
1808
1956
  function useSnackbar() {
1809
- const ctx = React12__namespace.useContext(SnackbarContext);
1957
+ const ctx = React3__namespace.useContext(SnackbarContext);
1810
1958
  if (!ctx) {
1811
1959
  throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
1812
1960
  }
@@ -1908,7 +2056,7 @@ function TooltipCaretShape({
1908
2056
  }
1909
2057
  );
1910
2058
  }
1911
- var PlainTooltip = React12.forwardRef(
2059
+ var PlainTooltip = React3.forwardRef(
1912
2060
  (_a, ref) => {
1913
2061
  var _b = _a, {
1914
2062
  children,
@@ -1965,7 +2113,7 @@ var PlainTooltip = React12.forwardRef(
1965
2113
  }
1966
2114
  );
1967
2115
  PlainTooltip.displayName = "PlainTooltip";
1968
- var RichTooltip = React12.forwardRef(
2116
+ var RichTooltip = React3.forwardRef(
1969
2117
  (_a, ref) => {
1970
2118
  var _b = _a, {
1971
2119
  children,
@@ -2049,7 +2197,7 @@ var RichTooltip = React12.forwardRef(
2049
2197
  );
2050
2198
  RichTooltip.displayName = "RichTooltip";
2051
2199
  var VIEWPORT_PADDING = 8;
2052
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React12.useLayoutEffect : React12.useEffect;
2200
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React3.useLayoutEffect : React3.useEffect;
2053
2201
  function resolveAutoPlacement(spaceTop, spaceBottom, spaceLeft, spaceRight, tooltipWidth, tooltipHeight, spacing) {
2054
2202
  if (spaceTop >= tooltipHeight + spacing) return "top";
2055
2203
  if (spaceBottom >= tooltipHeight + spacing) return "bottom";
@@ -2109,7 +2257,7 @@ function clampToViewport(side, top, left, tooltipWidth, tooltipHeight) {
2109
2257
  return { top, left };
2110
2258
  }
2111
2259
  function useTooltipPosition(anchorRef, tooltipRef, placement, spacing, isVisible) {
2112
- const [position, setPosition] = React12.useState({
2260
+ const [position, setPosition] = React3.useState({
2113
2261
  top: -9999,
2114
2262
  left: -9999,
2115
2263
  actualSide: placement === "auto" ? "top" : placement
@@ -2184,24 +2332,24 @@ function useTooltipState(config) {
2184
2332
  isPersistent = false,
2185
2333
  duration = 1500
2186
2334
  } = config != null ? config : {};
2187
- const [isVisible, setIsVisible] = React12.useState(initialVisible);
2188
- const dismiss = React12.useCallback(() => {
2335
+ const [isVisible, setIsVisible] = React3.useState(initialVisible);
2336
+ const dismiss = React3.useCallback(() => {
2189
2337
  setIsVisible(false);
2190
2338
  activeTooltipDismissals.delete(dismiss);
2191
2339
  }, []);
2192
- const show = React12.useCallback(() => {
2340
+ const show = React3.useCallback(() => {
2193
2341
  for (const otherDismiss of activeTooltipDismissals) {
2194
2342
  if (otherDismiss !== dismiss) otherDismiss();
2195
2343
  }
2196
2344
  setIsVisible(true);
2197
2345
  activeTooltipDismissals.add(dismiss);
2198
2346
  }, [dismiss]);
2199
- React12.useEffect(() => {
2347
+ React3.useEffect(() => {
2200
2348
  if (!isVisible || isPersistent) return;
2201
2349
  const timeoutId = setTimeout(dismiss, duration);
2202
2350
  return () => clearTimeout(timeoutId);
2203
2351
  }, [isVisible, isPersistent, duration, dismiss]);
2204
- React12.useEffect(() => {
2352
+ React3.useEffect(() => {
2205
2353
  return () => {
2206
2354
  activeTooltipDismissals.delete(dismiss);
2207
2355
  };
@@ -2258,20 +2406,20 @@ function TooltipBox({
2258
2406
  }) {
2259
2407
  const internalState = useTooltipState();
2260
2408
  const state = controlledState != null ? controlledState : internalState;
2261
- const anchorRef = React12.useRef(null);
2262
- const tooltipRef = React12.useRef(null);
2263
- const hoverTimeoutRef = React12.useRef(null);
2264
- const hideTimeoutRef = React12.useRef(null);
2265
- const pressTimeoutRef = React12.useRef(null);
2409
+ const anchorRef = React3.useRef(null);
2410
+ const tooltipRef = React3.useRef(null);
2411
+ const hoverTimeoutRef = React3.useRef(null);
2412
+ const hideTimeoutRef = React3.useRef(null);
2413
+ const pressTimeoutRef = React3.useRef(null);
2266
2414
  const triggers = Array.isArray(trigger) ? trigger : [trigger];
2267
- const [mounted, setMounted] = React12.useState(false);
2268
- const [hasHoverSupport, setHasHoverSupport] = React12.useState(true);
2269
- const [prefersReducedMotion, setPrefersReducedMotion] = React12.useState(false);
2270
- React12.useEffect(() => {
2415
+ const [mounted, setMounted] = React3.useState(false);
2416
+ const [hasHoverSupport, setHasHoverSupport] = React3.useState(true);
2417
+ const [prefersReducedMotion, setPrefersReducedMotion] = React3.useState(false);
2418
+ React3.useEffect(() => {
2271
2419
  setMounted(true);
2272
2420
  setHasHoverSupport(!window.matchMedia("(hover: none)").matches);
2273
2421
  }, []);
2274
- React12.useEffect(() => {
2422
+ React3.useEffect(() => {
2275
2423
  const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
2276
2424
  setPrefersReducedMotion(mediaQuery.matches);
2277
2425
  const onChange = (e) => setPrefersReducedMotion(e.matches);
@@ -2343,7 +2491,7 @@ function TooltipBox({
2343
2491
  hideDelay
2344
2492
  );
2345
2493
  };
2346
- React12.useEffect(() => {
2494
+ React3.useEffect(() => {
2347
2495
  if (!state.isVisible) return;
2348
2496
  const onKeyDown = (e) => {
2349
2497
  var _a;
@@ -2355,8 +2503,8 @@ function TooltipBox({
2355
2503
  document.addEventListener("keydown", onKeyDown);
2356
2504
  return () => document.removeEventListener("keydown", onKeyDown);
2357
2505
  }, [state.isVisible, state]);
2358
- const tooltipId = React12.useId();
2359
- const tooltipWithProps = React12.cloneElement(
2506
+ const tooltipId = React3.useId();
2507
+ const tooltipWithProps = React3.cloneElement(
2360
2508
  tooltip,
2361
2509
  {
2362
2510
  "data-side": position.actualSide,
@@ -2384,7 +2532,7 @@ function TooltipBox({
2384
2532
  onKeyDown: handleKeyDown,
2385
2533
  "aria-label": ariaLabel,
2386
2534
  "aria-describedby": state.isVisible ? tooltipId : void 0,
2387
- children: React12__namespace.isValidElement(children) ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2535
+ children: React3__namespace.isValidElement(children) ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children })
2388
2536
  }
2389
2537
  ),
2390
2538
  mounted && reactDom.createPortal(