@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/CHANGELOG.md +6 -0
- package/dist/buttons.js +220 -72
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +221 -73
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +297 -149
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +280 -132
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +32 -0
- package/dist/feedback.d.ts +32 -0
- package/dist/feedback.js +308 -160
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +286 -138
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.js +220 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -73
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +220 -72
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +221 -73
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.js +220 -72
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +221 -73
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +351 -203
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +314 -166
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +359 -211
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +327 -179
- package/dist/pickers.mjs.map +1 -1
- package/package.json +1 -1
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,
|
|
4
|
-
import * as
|
|
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 =
|
|
92
|
+
var IndeterminateSvg = React2.memo(function IndeterminateSvg2({
|
|
93
93
|
size
|
|
94
94
|
}) {
|
|
95
|
-
const [ready, setReady] =
|
|
96
|
-
|
|
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 =
|
|
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 =
|
|
166
|
+
var LoadingIndicator = React2.forwardRef(
|
|
167
167
|
(_a, ref) => {
|
|
168
168
|
var _b = _a, {
|
|
169
169
|
variant = "uncontained",
|
|
@@ -258,7 +258,7 @@ 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
|
-
return d
|
|
261
|
+
return `${d} Z`;
|
|
262
262
|
}
|
|
263
263
|
function getSinePath(startX, endX, phase, wl, amp) {
|
|
264
264
|
if (startX >= endX) return "";
|
|
@@ -290,7 +290,15 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
290
290
|
}
|
|
291
291
|
return d;
|
|
292
292
|
}
|
|
293
|
-
var
|
|
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(
|
|
294
302
|
(_a, ref) => {
|
|
295
303
|
var _b = _a, {
|
|
296
304
|
value,
|
|
@@ -303,6 +311,10 @@ var CircularProgress = React9.forwardRef(
|
|
|
303
311
|
crawlerSpeed = 1,
|
|
304
312
|
color,
|
|
305
313
|
trackColor,
|
|
314
|
+
showTrack = "auto",
|
|
315
|
+
minProgress = DEFAULT_MIN_PROGRESS,
|
|
316
|
+
maxProgress = DEFAULT_MAX_PROGRESS,
|
|
317
|
+
amplitudeRange,
|
|
306
318
|
className,
|
|
307
319
|
"aria-label": ariaLabel
|
|
308
320
|
} = _b, restProps = __objRest(_b, [
|
|
@@ -316,6 +328,10 @@ var CircularProgress = React9.forwardRef(
|
|
|
316
328
|
"crawlerSpeed",
|
|
317
329
|
"color",
|
|
318
330
|
"trackColor",
|
|
331
|
+
"showTrack",
|
|
332
|
+
"minProgress",
|
|
333
|
+
"maxProgress",
|
|
334
|
+
"amplitudeRange",
|
|
319
335
|
"className",
|
|
320
336
|
"aria-label"
|
|
321
337
|
]);
|
|
@@ -326,17 +342,22 @@ var CircularProgress = React9.forwardRef(
|
|
|
326
342
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
327
343
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
328
344
|
const isWavy = shape === "wavy";
|
|
345
|
+
const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
|
|
329
346
|
const BASELINE_SIZE = 48;
|
|
330
347
|
const scaleFactor = size / BASELINE_SIZE;
|
|
331
|
-
const effectiveAmplitude =
|
|
348
|
+
const effectiveAmplitude = React2.useMemo(
|
|
332
349
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
333
350
|
[amplitude, scaleFactor]
|
|
334
351
|
);
|
|
335
|
-
const effectiveWavelength =
|
|
352
|
+
const effectiveWavelength = React2.useMemo(
|
|
336
353
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
337
354
|
[wavelength, scaleFactor]
|
|
338
355
|
);
|
|
339
|
-
const
|
|
356
|
+
const resolvedAmplitudeRange = React2.useMemo(
|
|
357
|
+
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
358
|
+
[amplitudeRange, effectiveAmplitude]
|
|
359
|
+
);
|
|
360
|
+
const wavyActivePath = React2.useMemo(
|
|
340
361
|
() => isWavy ? generateWavyCircularPath(
|
|
341
362
|
center,
|
|
342
363
|
radius,
|
|
@@ -345,8 +366,8 @@ var CircularProgress = React9.forwardRef(
|
|
|
345
366
|
) : null,
|
|
346
367
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
347
368
|
);
|
|
348
|
-
const circumference =
|
|
349
|
-
const gapForTrack =
|
|
369
|
+
const circumference = React2.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
370
|
+
const gapForTrack = React2.useMemo(
|
|
350
371
|
() => (gapSize + trackHeight) / circumference,
|
|
351
372
|
[gapSize, trackHeight, circumference]
|
|
352
373
|
);
|
|
@@ -355,6 +376,145 @@ var CircularProgress = React9.forwardRef(
|
|
|
355
376
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
356
377
|
const ActiveCircleElem = m.circle;
|
|
357
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
|
+
});
|
|
358
518
|
return /* @__PURE__ */ jsx(
|
|
359
519
|
"div",
|
|
360
520
|
__spreadProps(__spreadValues({
|
|
@@ -431,9 +591,10 @@ var CircularProgress = React9.forwardRef(
|
|
|
431
591
|
]
|
|
432
592
|
}
|
|
433
593
|
),
|
|
434
|
-
!isDeterminate && /* @__PURE__ */
|
|
435
|
-
|
|
594
|
+
!isDeterminate && /* @__PURE__ */ jsx(
|
|
595
|
+
"svg",
|
|
436
596
|
{
|
|
597
|
+
ref: indeterminateSvgRef,
|
|
437
598
|
width: size,
|
|
438
599
|
height: size,
|
|
439
600
|
viewBox: `0 0 ${size} ${size}`,
|
|
@@ -442,84 +603,60 @@ var CircularProgress = React9.forwardRef(
|
|
|
442
603
|
position: "absolute",
|
|
443
604
|
inset: 0,
|
|
444
605
|
overflow: "visible",
|
|
445
|
-
transformOrigin: "center"
|
|
446
|
-
|
|
447
|
-
animate: { rotate: [0, 360] },
|
|
448
|
-
transition: {
|
|
449
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
450
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
451
|
-
ease: "linear"
|
|
606
|
+
transformOrigin: "center",
|
|
607
|
+
transform: "rotate(-90deg)"
|
|
452
608
|
},
|
|
453
|
-
children: [
|
|
454
|
-
/* @__PURE__ */ jsx(
|
|
455
|
-
|
|
609
|
+
children: isWavy ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
610
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsx(
|
|
611
|
+
"path",
|
|
456
612
|
{
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
r: radius,
|
|
613
|
+
ref: indeterminateWavyTrackPathRef,
|
|
614
|
+
d: wavyActivePath != null ? wavyActivePath : "",
|
|
460
615
|
fill: "none",
|
|
461
616
|
stroke: bgTrackColor,
|
|
462
617
|
strokeWidth: trackHeight,
|
|
463
|
-
strokeLinecap: "round"
|
|
464
|
-
animate: {
|
|
465
|
-
pathLength: [
|
|
466
|
-
Math.max(1e-3, 0.9 - 2 * gapForTrack),
|
|
467
|
-
Math.max(1e-3, 0.25 - 2 * gapForTrack),
|
|
468
|
-
Math.max(1e-3, 0.9 - 2 * gapForTrack)
|
|
469
|
-
],
|
|
470
|
-
pathOffset: [
|
|
471
|
-
0.1 + gapForTrack,
|
|
472
|
-
0.75 + gapForTrack,
|
|
473
|
-
0.1 + gapForTrack
|
|
474
|
-
]
|
|
475
|
-
},
|
|
476
|
-
transition: {
|
|
477
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
478
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
479
|
-
ease: [0.4, 0, 0.2, 1]
|
|
480
|
-
}
|
|
618
|
+
strokeLinecap: "round"
|
|
481
619
|
}
|
|
482
620
|
),
|
|
483
|
-
|
|
484
|
-
|
|
621
|
+
/* @__PURE__ */ jsx(
|
|
622
|
+
"path",
|
|
485
623
|
{
|
|
624
|
+
ref: indeterminateWavyActivePathRef,
|
|
486
625
|
d: wavyActivePath != null ? wavyActivePath : "",
|
|
487
626
|
fill: "none",
|
|
488
627
|
stroke: activeColor,
|
|
489
628
|
strokeWidth: trackHeight,
|
|
490
|
-
strokeLinecap: "round"
|
|
491
|
-
animate: {
|
|
492
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
493
|
-
pathOffset: [0, 0.65, 1]
|
|
494
|
-
},
|
|
495
|
-
transition: {
|
|
496
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
497
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
498
|
-
ease: [0.4, 0, 0.2, 1]
|
|
499
|
-
}
|
|
629
|
+
strokeLinecap: "round"
|
|
500
630
|
}
|
|
501
|
-
)
|
|
502
|
-
|
|
631
|
+
)
|
|
632
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
633
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsx(
|
|
634
|
+
"circle",
|
|
503
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",
|
|
648
|
+
{
|
|
649
|
+
ref: indeterminateActiveRef,
|
|
504
650
|
cx: center,
|
|
505
651
|
cy: center,
|
|
506
652
|
r: radius,
|
|
507
653
|
fill: "none",
|
|
508
654
|
stroke: activeColor,
|
|
509
655
|
strokeWidth: trackHeight,
|
|
510
|
-
strokeLinecap: "round"
|
|
511
|
-
animate: {
|
|
512
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
513
|
-
pathOffset: [0, 0.65, 1]
|
|
514
|
-
},
|
|
515
|
-
transition: {
|
|
516
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
517
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
518
|
-
ease: [0.4, 0, 0.2, 1]
|
|
519
|
-
}
|
|
656
|
+
strokeLinecap: "round"
|
|
520
657
|
}
|
|
521
658
|
)
|
|
522
|
-
]
|
|
659
|
+
] })
|
|
523
660
|
}
|
|
524
661
|
)
|
|
525
662
|
] })
|
|
@@ -529,9 +666,9 @@ var CircularProgress = React9.forwardRef(
|
|
|
529
666
|
);
|
|
530
667
|
CircularProgress.displayName = "CircularProgress";
|
|
531
668
|
function useContainerWidth() {
|
|
532
|
-
const [width, setWidth] =
|
|
533
|
-
const observerRef =
|
|
534
|
-
const ref =
|
|
669
|
+
const [width, setWidth] = React2.useState(0);
|
|
670
|
+
const observerRef = React2.useRef(null);
|
|
671
|
+
const ref = React2.useCallback((node) => {
|
|
535
672
|
if (observerRef.current) {
|
|
536
673
|
observerRef.current.disconnect();
|
|
537
674
|
observerRef.current = null;
|
|
@@ -545,7 +682,7 @@ function useContainerWidth() {
|
|
|
545
682
|
observerRef.current = obs;
|
|
546
683
|
}
|
|
547
684
|
}, []);
|
|
548
|
-
|
|
685
|
+
React2.useEffect(() => {
|
|
549
686
|
return () => {
|
|
550
687
|
if (observerRef.current) {
|
|
551
688
|
observerRef.current.disconnect();
|
|
@@ -555,7 +692,7 @@ function useContainerWidth() {
|
|
|
555
692
|
return [ref, width];
|
|
556
693
|
}
|
|
557
694
|
function useMergedRef(...refs) {
|
|
558
|
-
return
|
|
695
|
+
return React2.useCallback(
|
|
559
696
|
(node) => {
|
|
560
697
|
for (const ref of refs) {
|
|
561
698
|
if (typeof ref === "function") {
|
|
@@ -569,7 +706,7 @@ function useMergedRef(...refs) {
|
|
|
569
706
|
[refs]
|
|
570
707
|
);
|
|
571
708
|
}
|
|
572
|
-
var FlatLinearTrack =
|
|
709
|
+
var FlatLinearTrack = React2.memo(function FlatLinearTrack2({
|
|
573
710
|
trackHeight,
|
|
574
711
|
activeColor,
|
|
575
712
|
trackColor,
|
|
@@ -645,7 +782,7 @@ var FlatLinearTrack = React9.memo(function FlatLinearTrack2({
|
|
|
645
782
|
}
|
|
646
783
|
);
|
|
647
784
|
});
|
|
648
|
-
var WavyLinearTrack =
|
|
785
|
+
var WavyLinearTrack = React2.memo(function WavyLinearTrack2({
|
|
649
786
|
trackHeight,
|
|
650
787
|
svgHeight,
|
|
651
788
|
amplitude,
|
|
@@ -664,13 +801,13 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
664
801
|
}) {
|
|
665
802
|
const isDeterminate = typeof value === "number";
|
|
666
803
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
667
|
-
const titleId =
|
|
804
|
+
const titleId = React2.useId();
|
|
668
805
|
const [containerRef, width] = useContainerWidth();
|
|
669
|
-
const activePathRef =
|
|
670
|
-
const trackPathRef =
|
|
806
|
+
const activePathRef = React2.useRef(null);
|
|
807
|
+
const trackPathRef = React2.useRef(null);
|
|
671
808
|
const amplitudeMV = useMotionValue(amplitude);
|
|
672
809
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
673
|
-
|
|
810
|
+
React2.useEffect(() => {
|
|
674
811
|
if (isDeterminate) {
|
|
675
812
|
const fraction = clampedValue / 100;
|
|
676
813
|
let targetAmp = amplitude;
|
|
@@ -725,7 +862,7 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
725
862
|
currentAmp
|
|
726
863
|
);
|
|
727
864
|
} else if (fraction === 0) {
|
|
728
|
-
activePathD =
|
|
865
|
+
activePathD = "";
|
|
729
866
|
}
|
|
730
867
|
const trackStart = adjHead + totalGap;
|
|
731
868
|
if (trackStart < width - capWidth) {
|
|
@@ -757,20 +894,20 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
757
894
|
activeLines.push({ tail: l1T, head: l1H });
|
|
758
895
|
activeLines.push({ tail: l2T, head: l2H });
|
|
759
896
|
}
|
|
760
|
-
const
|
|
761
|
-
const
|
|
762
|
-
const
|
|
897
|
+
const activeSegments = activeLines.map((line) => {
|
|
898
|
+
const rawTail = line.tail * width;
|
|
899
|
+
const rawHead = line.head * width;
|
|
763
900
|
const adjTail = Math.max(
|
|
764
901
|
capWidth,
|
|
765
|
-
Math.min(width - capWidth,
|
|
902
|
+
Math.min(width - capWidth, rawTail)
|
|
766
903
|
);
|
|
767
904
|
const adjHead = Math.max(
|
|
768
905
|
capWidth,
|
|
769
|
-
Math.min(width - capWidth,
|
|
906
|
+
Math.min(width - capWidth, rawHead)
|
|
770
907
|
);
|
|
771
908
|
return { adjTail, adjHead };
|
|
772
909
|
}).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
|
|
773
|
-
activePathD =
|
|
910
|
+
activePathD = activeSegments.map(
|
|
774
911
|
(seg) => getSinePath(
|
|
775
912
|
seg.adjTail,
|
|
776
913
|
seg.adjHead,
|
|
@@ -779,13 +916,24 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
779
916
|
currentAmp
|
|
780
917
|
)
|
|
781
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);
|
|
782
922
|
let currentTrackX = capWidth;
|
|
783
|
-
for (const
|
|
784
|
-
const
|
|
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);
|
|
785
927
|
if (trackEnd > currentTrackX) {
|
|
786
|
-
trackD += `${getSinePath(
|
|
928
|
+
trackD += `${getSinePath(
|
|
929
|
+
currentTrackX,
|
|
930
|
+
trackEnd,
|
|
931
|
+
phase,
|
|
932
|
+
activeWavelength,
|
|
933
|
+
trackAmp
|
|
934
|
+
)} `;
|
|
787
935
|
}
|
|
788
|
-
currentTrackX = Math.max(currentTrackX,
|
|
936
|
+
currentTrackX = Math.max(currentTrackX, blockEnd);
|
|
789
937
|
}
|
|
790
938
|
if (currentTrackX < width - capWidth) {
|
|
791
939
|
trackD += getSinePath(
|
|
@@ -798,9 +946,9 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
798
946
|
}
|
|
799
947
|
}
|
|
800
948
|
if (activePathRef.current)
|
|
801
|
-
activePathRef.current.setAttribute("d", activePathD);
|
|
949
|
+
activePathRef.current.setAttribute("d", activePathD || "");
|
|
802
950
|
if (trackPathRef.current)
|
|
803
|
-
trackPathRef.current.setAttribute("d", trackD.trim());
|
|
951
|
+
trackPathRef.current.setAttribute("d", trackD.trim() || "");
|
|
804
952
|
});
|
|
805
953
|
return /* @__PURE__ */ jsx(
|
|
806
954
|
"div",
|
|
@@ -847,7 +995,7 @@ var WavyLinearTrack = React9.memo(function WavyLinearTrack2({
|
|
|
847
995
|
}
|
|
848
996
|
);
|
|
849
997
|
});
|
|
850
|
-
var LinearProgress =
|
|
998
|
+
var LinearProgress = React2.forwardRef(
|
|
851
999
|
(_a, ref) => {
|
|
852
1000
|
var _b = _a, {
|
|
853
1001
|
value,
|
|
@@ -888,10 +1036,10 @@ var LinearProgress = React9.forwardRef(
|
|
|
888
1036
|
]);
|
|
889
1037
|
const isDeterminate = value !== void 0;
|
|
890
1038
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
891
|
-
const containerRef =
|
|
1039
|
+
const containerRef = React2.useRef(null);
|
|
892
1040
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
893
|
-
const [isRtl, setIsRtl] =
|
|
894
|
-
|
|
1041
|
+
const [isRtl, setIsRtl] = React2.useState(false);
|
|
1042
|
+
React2.useEffect(() => {
|
|
895
1043
|
if (containerRef.current) {
|
|
896
1044
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
897
1045
|
setIsRtl(dir === "rtl");
|
|
@@ -899,16 +1047,16 @@ var LinearProgress = React9.forwardRef(
|
|
|
899
1047
|
}, []);
|
|
900
1048
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
901
1049
|
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
902
|
-
const effectiveAmplitude =
|
|
903
|
-
const svgHeight =
|
|
1050
|
+
const effectiveAmplitude = React2.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
1051
|
+
const svgHeight = React2.useMemo(
|
|
904
1052
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
905
1053
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
906
1054
|
);
|
|
907
|
-
const shouldShowStop =
|
|
1055
|
+
const shouldShowStop = React2.useMemo(
|
|
908
1056
|
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
909
1057
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
910
1058
|
);
|
|
911
|
-
const stopSize =
|
|
1059
|
+
const stopSize = React2.useMemo(
|
|
912
1060
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
913
1061
|
[trackHeight]
|
|
914
1062
|
);
|
|
@@ -983,14 +1131,14 @@ var LinearProgress = React9.forwardRef(
|
|
|
983
1131
|
}
|
|
984
1132
|
);
|
|
985
1133
|
LinearProgress.displayName = "LinearProgress";
|
|
986
|
-
var ProgressIndicator =
|
|
1134
|
+
var ProgressIndicator = React2.forwardRef((props, ref) => {
|
|
987
1135
|
if (props.variant === "circular") {
|
|
988
1136
|
return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
989
1137
|
}
|
|
990
1138
|
return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
991
1139
|
});
|
|
992
1140
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
993
|
-
var RippleItem =
|
|
1141
|
+
var RippleItem = React2.memo(function RippleItem2({
|
|
994
1142
|
ripple,
|
|
995
1143
|
onDone
|
|
996
1144
|
}) {
|
|
@@ -1034,8 +1182,8 @@ function Ripple({
|
|
|
1034
1182
|
}
|
|
1035
1183
|
function useRippleState(options = {}) {
|
|
1036
1184
|
const { disabled = false } = options;
|
|
1037
|
-
const [ripples, setRipples] =
|
|
1038
|
-
const onPointerDown =
|
|
1185
|
+
const [ripples, setRipples] = React2.useState([]);
|
|
1186
|
+
const onPointerDown = React2.useCallback(
|
|
1039
1187
|
(e) => {
|
|
1040
1188
|
if (disabled) return;
|
|
1041
1189
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -1052,7 +1200,7 @@ function useRippleState(options = {}) {
|
|
|
1052
1200
|
},
|
|
1053
1201
|
[disabled]
|
|
1054
1202
|
);
|
|
1055
|
-
const removeRipple =
|
|
1203
|
+
const removeRipple = React2.useCallback((id) => {
|
|
1056
1204
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
1057
1205
|
}, []);
|
|
1058
1206
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -1287,7 +1435,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
1287
1435
|
}
|
|
1288
1436
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
1289
1437
|
}
|
|
1290
|
-
var IconButtonComponent =
|
|
1438
|
+
var IconButtonComponent = React2.forwardRef(
|
|
1291
1439
|
(_a, ref) => {
|
|
1292
1440
|
var _b = _a, {
|
|
1293
1441
|
className,
|
|
@@ -1329,18 +1477,18 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1329
1477
|
var _a2, _b2, _c, _d, _e;
|
|
1330
1478
|
const isToggle = variant === "toggle";
|
|
1331
1479
|
const isSelected = isToggle && !!selected;
|
|
1332
|
-
const resolvedColorClass =
|
|
1480
|
+
const resolvedColorClass = React2.useMemo(
|
|
1333
1481
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
1334
1482
|
[isSelected, colorStyle]
|
|
1335
1483
|
);
|
|
1336
|
-
const outlineWidthClass =
|
|
1484
|
+
const outlineWidthClass = React2.useMemo(
|
|
1337
1485
|
() => {
|
|
1338
1486
|
var _a3;
|
|
1339
1487
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
1340
1488
|
},
|
|
1341
1489
|
[colorStyle, isSelected, size]
|
|
1342
1490
|
);
|
|
1343
|
-
const disabledBgClass =
|
|
1491
|
+
const disabledBgClass = React2.useMemo(
|
|
1344
1492
|
() => resolveDisabledBgClass(colorStyle),
|
|
1345
1493
|
[colorStyle]
|
|
1346
1494
|
);
|
|
@@ -1363,7 +1511,7 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1363
1511
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
1364
1512
|
disabled: loading
|
|
1365
1513
|
});
|
|
1366
|
-
const handleClick =
|
|
1514
|
+
const handleClick = React2.useCallback(
|
|
1367
1515
|
(e) => {
|
|
1368
1516
|
if (loading) {
|
|
1369
1517
|
e.preventDefault();
|
|
@@ -1373,7 +1521,7 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1373
1521
|
},
|
|
1374
1522
|
[loading, onClick]
|
|
1375
1523
|
);
|
|
1376
|
-
const handleKeyDown =
|
|
1524
|
+
const handleKeyDown = React2.useCallback(
|
|
1377
1525
|
(e) => {
|
|
1378
1526
|
if (loading) return;
|
|
1379
1527
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -1429,7 +1577,7 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1429
1577
|
width: isCustomSize ? `${iconSize}px` : void 0,
|
|
1430
1578
|
height: isCustomSize ? `${iconSize}px` : void 0
|
|
1431
1579
|
},
|
|
1432
|
-
children: isSelected && selectedIcon ? selectedIcon : asChild ?
|
|
1580
|
+
children: isSelected && selectedIcon ? selectedIcon : asChild ? React2.Children.only(children).props.children : children
|
|
1433
1581
|
}),
|
|
1434
1582
|
isSelected && selectedIcon ? "selected-content" : "content"
|
|
1435
1583
|
) })
|
|
@@ -1446,7 +1594,7 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1446
1594
|
className
|
|
1447
1595
|
);
|
|
1448
1596
|
if (asChild) {
|
|
1449
|
-
const child =
|
|
1597
|
+
const child = React2.Children.only(children);
|
|
1450
1598
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(
|
|
1451
1599
|
Slot,
|
|
1452
1600
|
__spreadProps(__spreadValues({
|
|
@@ -1463,7 +1611,7 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1463
1611
|
}),
|
|
1464
1612
|
className: containerClassName
|
|
1465
1613
|
}, restProps), {
|
|
1466
|
-
children:
|
|
1614
|
+
children: React2.cloneElement(child, { children: innerContent })
|
|
1467
1615
|
})
|
|
1468
1616
|
) });
|
|
1469
1617
|
}
|
|
@@ -1491,13 +1639,13 @@ var IconButtonComponent = React9.forwardRef(
|
|
|
1491
1639
|
}
|
|
1492
1640
|
);
|
|
1493
1641
|
IconButtonComponent.displayName = "IconButton";
|
|
1494
|
-
var IconButton =
|
|
1642
|
+
var IconButton = React2.memo(IconButtonComponent);
|
|
1495
1643
|
var VARIANT_FONT = {
|
|
1496
1644
|
outlined: "'Material Symbols Outlined'",
|
|
1497
1645
|
rounded: "'Material Symbols Rounded'",
|
|
1498
1646
|
sharp: "'Material Symbols Sharp'"
|
|
1499
1647
|
};
|
|
1500
|
-
var IconComponent =
|
|
1648
|
+
var IconComponent = React2.forwardRef(
|
|
1501
1649
|
(_a, ref) => {
|
|
1502
1650
|
var _b = _a, {
|
|
1503
1651
|
name,
|
|
@@ -1563,8 +1711,8 @@ var IconComponent = React9.forwardRef(
|
|
|
1563
1711
|
}
|
|
1564
1712
|
);
|
|
1565
1713
|
IconComponent.displayName = "Icon";
|
|
1566
|
-
var Icon =
|
|
1567
|
-
var ScrollArea =
|
|
1714
|
+
var Icon = React2.memo(IconComponent);
|
|
1715
|
+
var ScrollArea = React2.forwardRef(
|
|
1568
1716
|
(_a, ref) => {
|
|
1569
1717
|
var _b = _a, {
|
|
1570
1718
|
className,
|
|
@@ -1585,15 +1733,15 @@ var ScrollArea = React9.forwardRef(
|
|
|
1585
1733
|
"viewportRef",
|
|
1586
1734
|
"viewportProps"
|
|
1587
1735
|
]);
|
|
1588
|
-
const [isTouchDevice, setIsTouchDevice] =
|
|
1589
|
-
|
|
1736
|
+
const [isTouchDevice, setIsTouchDevice] = React2.useState(false);
|
|
1737
|
+
React2.useEffect(() => {
|
|
1590
1738
|
if (typeof window !== "undefined") {
|
|
1591
1739
|
setIsTouchDevice(
|
|
1592
1740
|
"ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
1593
1741
|
);
|
|
1594
1742
|
}
|
|
1595
1743
|
}, []);
|
|
1596
|
-
const resolvedType =
|
|
1744
|
+
const resolvedType = React2.useMemo(() => {
|
|
1597
1745
|
if (type === "hover" && isTouchDevice) {
|
|
1598
1746
|
return "scroll";
|
|
1599
1747
|
}
|
|
@@ -1644,7 +1792,7 @@ var ScrollArea = React9.forwardRef(
|
|
|
1644
1792
|
}
|
|
1645
1793
|
);
|
|
1646
1794
|
ScrollArea.displayName = "ScrollArea";
|
|
1647
|
-
var ScrollAreaScrollbar =
|
|
1795
|
+
var ScrollAreaScrollbar = React2.forwardRef((_a, ref) => {
|
|
1648
1796
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
1649
1797
|
return /* @__PURE__ */ jsx(
|
|
1650
1798
|
RadixScrollArea.Scrollbar,
|
|
@@ -1674,7 +1822,7 @@ var ScrollAreaScrollbar = React9.forwardRef((_a, ref) => {
|
|
|
1674
1822
|
);
|
|
1675
1823
|
});
|
|
1676
1824
|
ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
|
|
1677
|
-
var ScrollAreaCorner =
|
|
1825
|
+
var ScrollAreaCorner = React2.forwardRef((_a, ref) => {
|
|
1678
1826
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1679
1827
|
return /* @__PURE__ */ jsx(
|
|
1680
1828
|
RadixScrollArea.Corner,
|
|
@@ -1716,9 +1864,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
1716
1864
|
var DialogPortal = ({
|
|
1717
1865
|
open,
|
|
1718
1866
|
children
|
|
1719
|
-
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ?
|
|
1867
|
+
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React2.Children.toArray(children) : null }) });
|
|
1720
1868
|
DialogPortal.displayName = "DialogPortal";
|
|
1721
|
-
var DialogOverlay =
|
|
1869
|
+
var DialogOverlay = React2.forwardRef((_a, ref) => {
|
|
1722
1870
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1723
1871
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1724
1872
|
m.div,
|
|
@@ -1729,7 +1877,7 @@ var DialogOverlay = React9.forwardRef((_a, ref) => {
|
|
|
1729
1877
|
) }));
|
|
1730
1878
|
});
|
|
1731
1879
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1732
|
-
var DialogContent =
|
|
1880
|
+
var DialogContent = React2.forwardRef((_a, ref) => {
|
|
1733
1881
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
1734
1882
|
return /* @__PURE__ */ jsx(
|
|
1735
1883
|
RadixDialog.Content,
|
|
@@ -1769,7 +1917,7 @@ var DialogContent = React9.forwardRef((_a, ref) => {
|
|
|
1769
1917
|
);
|
|
1770
1918
|
});
|
|
1771
1919
|
DialogContent.displayName = "DialogContent";
|
|
1772
|
-
var DialogIcon =
|
|
1920
|
+
var DialogIcon = React2.forwardRef((_a, ref) => {
|
|
1773
1921
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1774
1922
|
return /* @__PURE__ */ jsx(
|
|
1775
1923
|
"div",
|
|
@@ -1792,7 +1940,7 @@ var DialogHeader = (_a) => {
|
|
|
1792
1940
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
1793
1941
|
};
|
|
1794
1942
|
DialogHeader.displayName = "DialogHeader";
|
|
1795
|
-
var DialogTitle =
|
|
1943
|
+
var DialogTitle = React2.forwardRef((_a, ref) => {
|
|
1796
1944
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1797
1945
|
return /* @__PURE__ */ jsx(
|
|
1798
1946
|
RadixDialog.Title,
|
|
@@ -1807,7 +1955,7 @@ var DialogTitle = React9.forwardRef((_a, ref) => {
|
|
|
1807
1955
|
);
|
|
1808
1956
|
});
|
|
1809
1957
|
DialogTitle.displayName = "DialogTitle";
|
|
1810
|
-
var DialogDescription =
|
|
1958
|
+
var DialogDescription = React2.forwardRef((_a, ref) => {
|
|
1811
1959
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
1812
1960
|
return /* @__PURE__ */ jsx(
|
|
1813
1961
|
RadixDialog.Description,
|
|
@@ -1819,7 +1967,7 @@ var DialogDescription = React9.forwardRef((_a, ref) => {
|
|
|
1819
1967
|
);
|
|
1820
1968
|
});
|
|
1821
1969
|
DialogDescription.displayName = "DialogDescription";
|
|
1822
|
-
var DialogBody =
|
|
1970
|
+
var DialogBody = React2.forwardRef((_a, ref) => {
|
|
1823
1971
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
1824
1972
|
return /* @__PURE__ */ jsx(
|
|
1825
1973
|
ScrollArea,
|
|
@@ -1850,7 +1998,7 @@ var DialogFooter = (_a) => {
|
|
|
1850
1998
|
};
|
|
1851
1999
|
DialogFooter.displayName = "DialogFooter";
|
|
1852
2000
|
var DialogClose = RadixDialog.Close;
|
|
1853
|
-
var DialogFullScreenContent =
|
|
2001
|
+
var DialogFullScreenContent = React2.forwardRef(
|
|
1854
2002
|
(_a, ref) => {
|
|
1855
2003
|
var _b = _a, {
|
|
1856
2004
|
className,
|
|
@@ -1947,7 +2095,7 @@ var DrawerPortal = ({
|
|
|
1947
2095
|
open,
|
|
1948
2096
|
children
|
|
1949
2097
|
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
|
|
1950
|
-
var DrawerOverlay =
|
|
2098
|
+
var DrawerOverlay = React2.forwardRef((_a, ref) => {
|
|
1951
2099
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
1952
2100
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
1953
2101
|
m.div,
|
|
@@ -1958,7 +2106,7 @@ var DrawerOverlay = React9.forwardRef((_a, ref) => {
|
|
|
1958
2106
|
) }));
|
|
1959
2107
|
});
|
|
1960
2108
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
1961
|
-
var DrawerContent =
|
|
2109
|
+
var DrawerContent = React2.forwardRef(
|
|
1962
2110
|
(_a, ref) => {
|
|
1963
2111
|
var _b = _a, {
|
|
1964
2112
|
className,
|
|
@@ -2037,7 +2185,7 @@ var DrawerFooter = (_a) => {
|
|
|
2037
2185
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
2038
2186
|
};
|
|
2039
2187
|
DrawerFooter.displayName = "DrawerFooter";
|
|
2040
|
-
var DrawerTitle =
|
|
2188
|
+
var DrawerTitle = React2.forwardRef((_a, ref) => {
|
|
2041
2189
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2042
2190
|
return /* @__PURE__ */ jsx(
|
|
2043
2191
|
RadixDialog.Title,
|
|
@@ -2051,7 +2199,7 @@ var DrawerTitle = React9.forwardRef((_a, ref) => {
|
|
|
2051
2199
|
);
|
|
2052
2200
|
});
|
|
2053
2201
|
DrawerTitle.displayName = "DrawerTitle";
|
|
2054
|
-
var DrawerDescription =
|
|
2202
|
+
var DrawerDescription = React2.forwardRef((_a, ref) => {
|
|
2055
2203
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
2056
2204
|
return /* @__PURE__ */ jsx(
|
|
2057
2205
|
RadixDialog.Description,
|
|
@@ -2063,7 +2211,7 @@ var DrawerDescription = React9.forwardRef((_a, ref) => {
|
|
|
2063
2211
|
});
|
|
2064
2212
|
DrawerDescription.displayName = "DrawerDescription";
|
|
2065
2213
|
var INDICATOR = "h-1 w-8 rounded-full bg-m3-on-surface-variant/40";
|
|
2066
|
-
var DragHandle =
|
|
2214
|
+
var DragHandle = React2.forwardRef(
|
|
2067
2215
|
({ className, onCycle, "aria-label": ariaLabel }, ref) => {
|
|
2068
2216
|
const isInteractive = Boolean(onCycle);
|
|
2069
2217
|
if (isInteractive) {
|
|
@@ -2616,7 +2764,7 @@ function resolveMaxHeight(maxHeight, snapPoints) {
|
|
|
2616
2764
|
return ABSOLUTE_MAX_HEIGHT;
|
|
2617
2765
|
return maxHeight;
|
|
2618
2766
|
}
|
|
2619
|
-
var BottomSheet =
|
|
2767
|
+
var BottomSheet = React2.forwardRef(
|
|
2620
2768
|
({
|
|
2621
2769
|
isOpen,
|
|
2622
2770
|
onClose,
|
|
@@ -2649,27 +2797,27 @@ var BottomSheet = React9.forwardRef(
|
|
|
2649
2797
|
isModal: false,
|
|
2650
2798
|
maxHeight: resolveMaxHeight(maxHeight, snapPoints)
|
|
2651
2799
|
});
|
|
2652
|
-
|
|
2800
|
+
React2.useEffect(() => {
|
|
2653
2801
|
const node = scope.current;
|
|
2654
2802
|
if (node) {
|
|
2655
2803
|
node.snapTo = snapTo;
|
|
2656
2804
|
}
|
|
2657
2805
|
}, [snapTo, scope]);
|
|
2658
|
-
const [mounted, setMounted] =
|
|
2659
|
-
|
|
2806
|
+
const [mounted, setMounted] = React2.useState(false);
|
|
2807
|
+
React2.useEffect(() => {
|
|
2660
2808
|
setMounted(true);
|
|
2661
2809
|
}, []);
|
|
2662
|
-
const resolvedDividers =
|
|
2810
|
+
const resolvedDividers = React2.useMemo(
|
|
2663
2811
|
() => resolveDividers(divider),
|
|
2664
2812
|
[divider]
|
|
2665
2813
|
);
|
|
2666
|
-
const resolvedSheetMaxWidth =
|
|
2814
|
+
const resolvedSheetMaxWidth = React2.useMemo(() => {
|
|
2667
2815
|
if (sheetMaxWidth === void 0)
|
|
2668
2816
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
2669
2817
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
2670
2818
|
return sheetMaxWidth;
|
|
2671
2819
|
}, [sheetMaxWidth]);
|
|
2672
|
-
const mergedRef =
|
|
2820
|
+
const mergedRef = React2.useCallback(
|
|
2673
2821
|
(node) => {
|
|
2674
2822
|
scope(node);
|
|
2675
2823
|
if (typeof ref === "function") ref(node);
|
|
@@ -2753,7 +2901,7 @@ var SCRIM_ANIM = {
|
|
|
2753
2901
|
},
|
|
2754
2902
|
exit: { opacity: 0, transition: { duration: 0.18, ease: "easeIn" } }
|
|
2755
2903
|
};
|
|
2756
|
-
var Scrim =
|
|
2904
|
+
var Scrim = React2.forwardRef(
|
|
2757
2905
|
({ onClick, className, style }, ref) => /* @__PURE__ */ jsx(
|
|
2758
2906
|
m.div,
|
|
2759
2907
|
__spreadValues({
|
|
@@ -2785,7 +2933,7 @@ function resolveSheetMaxWidth(value) {
|
|
|
2785
2933
|
if (typeof value === "number") return `${value}px`;
|
|
2786
2934
|
return value;
|
|
2787
2935
|
}
|
|
2788
|
-
var BottomSheetModal =
|
|
2936
|
+
var BottomSheetModal = React2.forwardRef(
|
|
2789
2937
|
({
|
|
2790
2938
|
isOpen,
|
|
2791
2939
|
onClose,
|
|
@@ -2824,21 +2972,21 @@ var BottomSheetModal = React9.forwardRef(
|
|
|
2824
2972
|
isModal: true,
|
|
2825
2973
|
maxHeight: resolveMaxHeight2(maxHeight, snapPoints)
|
|
2826
2974
|
});
|
|
2827
|
-
|
|
2975
|
+
React2.useEffect(() => {
|
|
2828
2976
|
const node = scope.current;
|
|
2829
2977
|
if (node) {
|
|
2830
2978
|
node.snapTo = snapTo;
|
|
2831
2979
|
}
|
|
2832
2980
|
}, [snapTo, scope]);
|
|
2833
|
-
const resolvedDividers =
|
|
2981
|
+
const resolvedDividers = React2.useMemo(
|
|
2834
2982
|
() => resolveDividers(divider),
|
|
2835
2983
|
[divider]
|
|
2836
2984
|
);
|
|
2837
|
-
const resolvedSheetMaxWidth =
|
|
2985
|
+
const resolvedSheetMaxWidth = React2.useMemo(
|
|
2838
2986
|
() => resolveSheetMaxWidth(sheetMaxWidth),
|
|
2839
2987
|
[sheetMaxWidth]
|
|
2840
2988
|
);
|
|
2841
|
-
const mergedRef =
|
|
2989
|
+
const mergedRef = React2.useCallback(
|
|
2842
2990
|
(node) => {
|
|
2843
2991
|
scope(node);
|
|
2844
2992
|
if (typeof ref === "function") ref(node);
|
|
@@ -3037,7 +3185,7 @@ function useBottomSheetScaffold({
|
|
|
3037
3185
|
containerRef
|
|
3038
3186
|
};
|
|
3039
3187
|
}
|
|
3040
|
-
var BottomSheetScaffold =
|
|
3188
|
+
var BottomSheetScaffold = React2.forwardRef(
|
|
3041
3189
|
({
|
|
3042
3190
|
sheetContent,
|
|
3043
3191
|
children,
|
|
@@ -3066,13 +3214,13 @@ var BottomSheetScaffold = React9.forwardRef(
|
|
|
3066
3214
|
onStateChange: onSheetStateChange,
|
|
3067
3215
|
initialState: initialSheetState
|
|
3068
3216
|
});
|
|
3069
|
-
const resolvedSheetMaxWidth =
|
|
3217
|
+
const resolvedSheetMaxWidth = React2.useMemo(() => {
|
|
3070
3218
|
if (sheetMaxWidth === void 0)
|
|
3071
3219
|
return "var(--m3-bottom-sheet-max-width, 640px)";
|
|
3072
3220
|
if (typeof sheetMaxWidth === "number") return `${sheetMaxWidth}px`;
|
|
3073
3221
|
return sheetMaxWidth;
|
|
3074
3222
|
}, [sheetMaxWidth]);
|
|
3075
|
-
const mergedRef =
|
|
3223
|
+
const mergedRef = React2.useCallback(
|
|
3076
3224
|
(node) => {
|
|
3077
3225
|
containerRef(node);
|
|
3078
3226
|
if (typeof ref === "function") ref(node);
|
|
@@ -3080,7 +3228,7 @@ var BottomSheetScaffold = React9.forwardRef(
|
|
|
3080
3228
|
},
|
|
3081
3229
|
[containerRef, ref]
|
|
3082
3230
|
);
|
|
3083
|
-
const resolvedDragHandle =
|
|
3231
|
+
const resolvedDragHandle = React2.useMemo(() => {
|
|
3084
3232
|
if (sheetDragHandle === null) return null;
|
|
3085
3233
|
if (sheetDragHandle !== void 0) return sheetDragHandle;
|
|
3086
3234
|
return /* @__PURE__ */ jsx(DragHandle, { onCycle: toggle });
|
|
@@ -3143,7 +3291,7 @@ var BottomSheetScaffold = React9.forwardRef(
|
|
|
3143
3291
|
);
|
|
3144
3292
|
BottomSheetScaffold.displayName = "BottomSheetScaffold";
|
|
3145
3293
|
var COPLANAR_TRANSITION = `margin ${getMotionTransitionCSS("default", "spatial")}`;
|
|
3146
|
-
var SideSheet =
|
|
3294
|
+
var SideSheet = React2.forwardRef(
|
|
3147
3295
|
({
|
|
3148
3296
|
isOpen,
|
|
3149
3297
|
children,
|
|
@@ -3159,16 +3307,16 @@ var SideSheet = React9.forwardRef(
|
|
|
3159
3307
|
divider,
|
|
3160
3308
|
scrollAreaProps
|
|
3161
3309
|
}, ref) => {
|
|
3162
|
-
const sheetAnim =
|
|
3163
|
-
const [mounted, setMounted] =
|
|
3164
|
-
|
|
3310
|
+
const sheetAnim = React2.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3311
|
+
const [mounted, setMounted] = React2.useState(false);
|
|
3312
|
+
React2.useEffect(() => {
|
|
3165
3313
|
setMounted(true);
|
|
3166
3314
|
}, []);
|
|
3167
|
-
const resolvedDividers =
|
|
3315
|
+
const resolvedDividers = React2.useMemo(
|
|
3168
3316
|
() => resolveDividers(divider),
|
|
3169
3317
|
[divider]
|
|
3170
3318
|
);
|
|
3171
|
-
|
|
3319
|
+
React2.useEffect(() => {
|
|
3172
3320
|
const sibling = coplanarSiblingRef == null ? void 0 : coplanarSiblingRef.current;
|
|
3173
3321
|
if (!sibling) return;
|
|
3174
3322
|
sibling.style.transition = COPLANAR_TRANSITION;
|
|
@@ -3232,7 +3380,7 @@ var SideSheet = React9.forwardRef(
|
|
|
3232
3380
|
}
|
|
3233
3381
|
);
|
|
3234
3382
|
SideSheet.displayName = "SideSheet";
|
|
3235
|
-
var SideSheetModal =
|
|
3383
|
+
var SideSheetModal = React2.forwardRef(
|
|
3236
3384
|
({
|
|
3237
3385
|
isOpen,
|
|
3238
3386
|
onClose,
|
|
@@ -3247,8 +3395,8 @@ var SideSheetModal = React9.forwardRef(
|
|
|
3247
3395
|
divider,
|
|
3248
3396
|
scrollAreaProps
|
|
3249
3397
|
}, ref) => {
|
|
3250
|
-
const sheetAnim =
|
|
3251
|
-
const resolvedDividers =
|
|
3398
|
+
const sheetAnim = React2.useMemo(() => buildSideSheetAnim(edge), [edge]);
|
|
3399
|
+
const resolvedDividers = React2.useMemo(
|
|
3252
3400
|
() => resolveDividers(divider),
|
|
3253
3401
|
[divider]
|
|
3254
3402
|
);
|