@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/CHANGELOG.md +12 -0
- package/dist/buttons.js +260 -98
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +261 -99
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +338 -176
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +321 -159
- 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 +348 -186
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +326 -164
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.js +261 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +262 -100
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +261 -99
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +262 -100
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.js +260 -98
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +261 -99
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +391 -229
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +354 -192
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +399 -237
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +367 -205
- package/dist/pickers.mjs.map +1 -1
- package/package.json +1 -1
package/dist/navigation.js
CHANGED
|
@@ -6338,26 +6338,46 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
|
|
|
6338
6338
|
if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
|
|
6339
6339
|
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
|
|
6340
6340
|
}
|
|
6341
|
-
d
|
|
6342
|
-
return d;
|
|
6341
|
+
return `${d} Z`;
|
|
6343
6342
|
}
|
|
6344
6343
|
function getSinePath(startX, endX, phase, wl, amp) {
|
|
6345
6344
|
if (startX >= endX) return "";
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6345
|
+
if (amp <= 0.01) {
|
|
6346
|
+
return `M ${startX.toFixed(2)} 0 L ${endX.toFixed(2)} 0`;
|
|
6347
|
+
}
|
|
6348
|
+
const safeWl = Math.max(1, wl);
|
|
6349
|
+
const k = 2 * Math.PI / safeWl;
|
|
6350
|
+
const phi = phase / safeWl * 2 * Math.PI;
|
|
6351
|
+
const yAt = (x) => amp * Math.sin(k * x + phi);
|
|
6352
|
+
const dyAt = (x) => amp * k * Math.cos(k * x + phi);
|
|
6353
|
+
const step = safeWl / 4;
|
|
6354
|
+
let d = `M ${startX.toFixed(2)} ${yAt(startX).toFixed(2)}`;
|
|
6355
|
+
let currentX = startX;
|
|
6356
|
+
while (currentX < endX) {
|
|
6357
|
+
const nextX = Math.min(endX, currentX + step);
|
|
6358
|
+
const dx = nextX - currentX;
|
|
6359
|
+
const scale = dx / 3;
|
|
6360
|
+
const y0 = yAt(currentX);
|
|
6361
|
+
const dy0 = dyAt(currentX);
|
|
6362
|
+
const y1 = yAt(nextX);
|
|
6363
|
+
const dy1 = dyAt(nextX);
|
|
6364
|
+
const cp1x = currentX + scale;
|
|
6365
|
+
const cp1y = y0 + scale * dy0;
|
|
6366
|
+
const cp2x = nextX - scale;
|
|
6367
|
+
const cp2y = y1 - scale * dy1;
|
|
6368
|
+
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${nextX.toFixed(2)} ${y1.toFixed(2)}`;
|
|
6369
|
+
currentX = nextX;
|
|
6356
6370
|
}
|
|
6357
|
-
const yEnd = Math.sin((endX + phase) / wl * 2 * Math.PI) * amp;
|
|
6358
|
-
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
6359
6371
|
return d;
|
|
6360
6372
|
}
|
|
6373
|
+
var GLOBAL_ROTATION_DURATION = 6e3;
|
|
6374
|
+
var GLOBAL_ROTATION_TARGET = 1080;
|
|
6375
|
+
var ADDITIONAL_ROTATION_CYCLE = 1500;
|
|
6376
|
+
var ADDITIONAL_ROTATION_STEP = 90;
|
|
6377
|
+
var ADDITIONAL_ROTATION_EASE_DURATION = 500;
|
|
6378
|
+
var DEFAULT_MIN_PROGRESS = 0.1;
|
|
6379
|
+
var DEFAULT_MAX_PROGRESS = 0.8;
|
|
6380
|
+
var PROGRESS_CYCLE_DURATION = 1500;
|
|
6361
6381
|
var CircularProgress = React37__namespace.forwardRef(
|
|
6362
6382
|
(_a, ref) => {
|
|
6363
6383
|
var _b = _a, {
|
|
@@ -6371,6 +6391,10 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6371
6391
|
crawlerSpeed = 1,
|
|
6372
6392
|
color,
|
|
6373
6393
|
trackColor,
|
|
6394
|
+
showTrack = "auto",
|
|
6395
|
+
minProgress = DEFAULT_MIN_PROGRESS,
|
|
6396
|
+
maxProgress = DEFAULT_MAX_PROGRESS,
|
|
6397
|
+
amplitudeRange,
|
|
6374
6398
|
className,
|
|
6375
6399
|
"aria-label": ariaLabel
|
|
6376
6400
|
} = _b, restProps = __objRest(_b, [
|
|
@@ -6384,6 +6408,10 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6384
6408
|
"crawlerSpeed",
|
|
6385
6409
|
"color",
|
|
6386
6410
|
"trackColor",
|
|
6411
|
+
"showTrack",
|
|
6412
|
+
"minProgress",
|
|
6413
|
+
"maxProgress",
|
|
6414
|
+
"amplitudeRange",
|
|
6387
6415
|
"className",
|
|
6388
6416
|
"aria-label"
|
|
6389
6417
|
]);
|
|
@@ -6394,6 +6422,7 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6394
6422
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
6395
6423
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
6396
6424
|
const isWavy = shape === "wavy";
|
|
6425
|
+
const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
|
|
6397
6426
|
const BASELINE_SIZE = 48;
|
|
6398
6427
|
const scaleFactor = size / BASELINE_SIZE;
|
|
6399
6428
|
const effectiveAmplitude = React37__namespace.useMemo(
|
|
@@ -6404,6 +6433,10 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6404
6433
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
6405
6434
|
[wavelength, scaleFactor]
|
|
6406
6435
|
);
|
|
6436
|
+
const resolvedAmplitudeRange = React37__namespace.useMemo(
|
|
6437
|
+
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
6438
|
+
[amplitudeRange, effectiveAmplitude]
|
|
6439
|
+
);
|
|
6407
6440
|
const wavyActivePath = React37__namespace.useMemo(
|
|
6408
6441
|
() => isWavy ? generateWavyCircularPath(
|
|
6409
6442
|
center,
|
|
@@ -6423,6 +6456,145 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6423
6456
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
6424
6457
|
const ActiveCircleElem = react.m.circle;
|
|
6425
6458
|
const ActivePathElem = react.m.path;
|
|
6459
|
+
const indeterminateSvgRef = React37__namespace.useRef(null);
|
|
6460
|
+
const indeterminateTrackRef = React37__namespace.useRef(null);
|
|
6461
|
+
const indeterminateActiveRef = React37__namespace.useRef(null);
|
|
6462
|
+
const indeterminateWavyTrackPathRef = React37__namespace.useRef(null);
|
|
6463
|
+
const indeterminateWavyActivePathRef = React37__namespace.useRef(null);
|
|
6464
|
+
const cachedPathLengthRef = React37__namespace.useRef(0);
|
|
6465
|
+
React37__namespace.useLayoutEffect(() => {
|
|
6466
|
+
if (!isWavy || !wavyActivePath) {
|
|
6467
|
+
cachedPathLengthRef.current = circumference;
|
|
6468
|
+
return;
|
|
6469
|
+
}
|
|
6470
|
+
const el = indeterminateActiveRef.current;
|
|
6471
|
+
if (el && "getTotalLength" in el) {
|
|
6472
|
+
try {
|
|
6473
|
+
const len = el.getTotalLength();
|
|
6474
|
+
if (len > 0) {
|
|
6475
|
+
cachedPathLengthRef.current = len;
|
|
6476
|
+
return;
|
|
6477
|
+
}
|
|
6478
|
+
} catch (e) {
|
|
6479
|
+
}
|
|
6480
|
+
}
|
|
6481
|
+
cachedPathLengthRef.current = circumference;
|
|
6482
|
+
}, [isWavy, circumference, wavyActivePath]);
|
|
6483
|
+
react.useAnimationFrame((time) => {
|
|
6484
|
+
if (isDeterminate) return;
|
|
6485
|
+
const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
|
|
6486
|
+
const scaledTime = time * safeCrawlerSpeed;
|
|
6487
|
+
const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
|
|
6488
|
+
const globalAngle = globalCycle / GLOBAL_ROTATION_DURATION * GLOBAL_ROTATION_TARGET;
|
|
6489
|
+
const additionalFullCycles = Math.floor(
|
|
6490
|
+
scaledTime / ADDITIONAL_ROTATION_CYCLE
|
|
6491
|
+
);
|
|
6492
|
+
const additionalCycleTime = scaledTime % ADDITIONAL_ROTATION_CYCLE;
|
|
6493
|
+
const additionalEaseT = Math.min(
|
|
6494
|
+
1,
|
|
6495
|
+
additionalCycleTime / ADDITIONAL_ROTATION_EASE_DURATION
|
|
6496
|
+
);
|
|
6497
|
+
const additionalAngle = (additionalFullCycles + easeInOutCubic(additionalEaseT)) * ADDITIONAL_ROTATION_STEP;
|
|
6498
|
+
const totalRotation = globalAngle + additionalAngle;
|
|
6499
|
+
if (indeterminateSvgRef.current) {
|
|
6500
|
+
indeterminateSvgRef.current.style.transform = `rotate(${totalRotation - 90}deg)`;
|
|
6501
|
+
}
|
|
6502
|
+
const progressFullCycle = PROGRESS_CYCLE_DURATION * 2;
|
|
6503
|
+
const progressCycleTime = scaledTime % progressFullCycle;
|
|
6504
|
+
let progress;
|
|
6505
|
+
if (progressCycleTime < PROGRESS_CYCLE_DURATION) {
|
|
6506
|
+
const t = progressCycleTime / PROGRESS_CYCLE_DURATION;
|
|
6507
|
+
progress = minProgress + (maxProgress - minProgress) * easeInOutCubic(t);
|
|
6508
|
+
} else {
|
|
6509
|
+
const t = (progressCycleTime - PROGRESS_CYCLE_DURATION) / PROGRESS_CYCLE_DURATION;
|
|
6510
|
+
progress = maxProgress - (maxProgress - minProgress) * easeInOutCubic(t);
|
|
6511
|
+
}
|
|
6512
|
+
if (isWavy) {
|
|
6513
|
+
const amplitudeT = (progress - minProgress) / (maxProgress - minProgress);
|
|
6514
|
+
const currentAmplitude = resolvedAmplitudeRange[0] + (resolvedAmplitudeRange[1] - resolvedAmplitudeRange[0]) * amplitudeT;
|
|
6515
|
+
const dynamicPath = generateWavyCircularPath(
|
|
6516
|
+
center,
|
|
6517
|
+
radius,
|
|
6518
|
+
currentAmplitude,
|
|
6519
|
+
effectiveWavelength
|
|
6520
|
+
);
|
|
6521
|
+
if (indeterminateWavyActivePathRef.current) {
|
|
6522
|
+
indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
|
|
6523
|
+
}
|
|
6524
|
+
if (indeterminateWavyTrackPathRef.current) {
|
|
6525
|
+
indeterminateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
|
|
6526
|
+
}
|
|
6527
|
+
const pathEl = indeterminateWavyActivePathRef.current;
|
|
6528
|
+
let totalLen = cachedPathLengthRef.current || circumference;
|
|
6529
|
+
if (pathEl) {
|
|
6530
|
+
try {
|
|
6531
|
+
const len = pathEl.getTotalLength();
|
|
6532
|
+
if (len > 0) totalLen = len;
|
|
6533
|
+
} catch (e) {
|
|
6534
|
+
}
|
|
6535
|
+
}
|
|
6536
|
+
const gapFrac = (gapSize + trackHeight) / totalLen;
|
|
6537
|
+
const activeLen = totalLen * progress;
|
|
6538
|
+
const activeOff = 0;
|
|
6539
|
+
if (indeterminateWavyActivePathRef.current) {
|
|
6540
|
+
indeterminateWavyActivePathRef.current.setAttribute(
|
|
6541
|
+
"stroke-dasharray",
|
|
6542
|
+
`${activeLen} ${totalLen}`
|
|
6543
|
+
);
|
|
6544
|
+
indeterminateWavyActivePathRef.current.setAttribute(
|
|
6545
|
+
"stroke-dashoffset",
|
|
6546
|
+
`${activeOff}`
|
|
6547
|
+
);
|
|
6548
|
+
}
|
|
6549
|
+
if (shouldShowIndeterminateTrack && indeterminateWavyTrackPathRef.current) {
|
|
6550
|
+
const trackStartFrac = progress + gapFrac;
|
|
6551
|
+
const trackLen = Math.max(
|
|
6552
|
+
1e-3,
|
|
6553
|
+
totalLen * (1 - progress - 2 * gapFrac)
|
|
6554
|
+
);
|
|
6555
|
+
const trackOff = -totalLen * trackStartFrac;
|
|
6556
|
+
indeterminateWavyTrackPathRef.current.setAttribute(
|
|
6557
|
+
"stroke-dasharray",
|
|
6558
|
+
`${trackLen} ${totalLen}`
|
|
6559
|
+
);
|
|
6560
|
+
indeterminateWavyTrackPathRef.current.setAttribute(
|
|
6561
|
+
"stroke-dashoffset",
|
|
6562
|
+
`${trackOff}`
|
|
6563
|
+
);
|
|
6564
|
+
}
|
|
6565
|
+
} else {
|
|
6566
|
+
const totalLen = circumference;
|
|
6567
|
+
const activeLen = totalLen * progress;
|
|
6568
|
+
const activeOff = 0;
|
|
6569
|
+
if (indeterminateActiveRef.current) {
|
|
6570
|
+
indeterminateActiveRef.current.setAttribute(
|
|
6571
|
+
"stroke-dasharray",
|
|
6572
|
+
`${activeLen} ${totalLen}`
|
|
6573
|
+
);
|
|
6574
|
+
indeterminateActiveRef.current.setAttribute(
|
|
6575
|
+
"stroke-dashoffset",
|
|
6576
|
+
`${activeOff}`
|
|
6577
|
+
);
|
|
6578
|
+
}
|
|
6579
|
+
if (shouldShowIndeterminateTrack && indeterminateTrackRef.current) {
|
|
6580
|
+
const gapFrac = (gapSize + trackHeight) / totalLen;
|
|
6581
|
+
const trackStartFrac = progress + gapFrac;
|
|
6582
|
+
const trackLen = Math.max(
|
|
6583
|
+
1e-3,
|
|
6584
|
+
totalLen * (1 - progress - 2 * gapFrac)
|
|
6585
|
+
);
|
|
6586
|
+
const trackOff = -totalLen * trackStartFrac;
|
|
6587
|
+
indeterminateTrackRef.current.setAttribute(
|
|
6588
|
+
"stroke-dasharray",
|
|
6589
|
+
`${trackLen} ${totalLen}`
|
|
6590
|
+
);
|
|
6591
|
+
indeterminateTrackRef.current.setAttribute(
|
|
6592
|
+
"stroke-dashoffset",
|
|
6593
|
+
`${trackOff}`
|
|
6594
|
+
);
|
|
6595
|
+
}
|
|
6596
|
+
}
|
|
6597
|
+
});
|
|
6426
6598
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6427
6599
|
"div",
|
|
6428
6600
|
__spreadProps(__spreadValues({
|
|
@@ -6499,9 +6671,10 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6499
6671
|
]
|
|
6500
6672
|
}
|
|
6501
6673
|
),
|
|
6502
|
-
!isDeterminate && /* @__PURE__ */ jsxRuntime.
|
|
6503
|
-
|
|
6674
|
+
!isDeterminate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6675
|
+
"svg",
|
|
6504
6676
|
{
|
|
6677
|
+
ref: indeterminateSvgRef,
|
|
6505
6678
|
width: size,
|
|
6506
6679
|
height: size,
|
|
6507
6680
|
viewBox: `0 0 ${size} ${size}`,
|
|
@@ -6510,90 +6683,60 @@ var CircularProgress = React37__namespace.forwardRef(
|
|
|
6510
6683
|
position: "absolute",
|
|
6511
6684
|
inset: 0,
|
|
6512
6685
|
overflow: "visible",
|
|
6513
|
-
|
|
6514
|
-
|
|
6686
|
+
transformOrigin: "center",
|
|
6687
|
+
transform: "rotate(-90deg)"
|
|
6515
6688
|
},
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
6520
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
6521
|
-
ease: "linear"
|
|
6522
|
-
}
|
|
6523
|
-
},
|
|
6524
|
-
children: [
|
|
6525
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6526
|
-
react.m.circle,
|
|
6689
|
+
children: isWavy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6690
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6691
|
+
"path",
|
|
6527
6692
|
{
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
r: radius,
|
|
6693
|
+
ref: indeterminateWavyTrackPathRef,
|
|
6694
|
+
d: wavyActivePath != null ? wavyActivePath : "",
|
|
6531
6695
|
fill: "none",
|
|
6532
6696
|
stroke: bgTrackColor,
|
|
6533
6697
|
strokeWidth: trackHeight,
|
|
6534
|
-
strokeLinecap: "round"
|
|
6535
|
-
style: { originX: "50%", originY: "50%" },
|
|
6536
|
-
animate: {
|
|
6537
|
-
pathLength: [
|
|
6538
|
-
Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
|
|
6539
|
-
Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
|
|
6540
|
-
Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
|
|
6541
|
-
],
|
|
6542
|
-
rotate: [
|
|
6543
|
-
`${(0.1 + gapForTrack) * 360}deg`,
|
|
6544
|
-
`${(1 + gapForTrack) * 360}deg`,
|
|
6545
|
-
`${(1.1 + gapForTrack) * 360}deg`
|
|
6546
|
-
]
|
|
6547
|
-
},
|
|
6548
|
-
transition: {
|
|
6549
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
6550
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
6551
|
-
ease: [0.4, 0, 0.2, 1]
|
|
6552
|
-
}
|
|
6698
|
+
strokeLinecap: "round"
|
|
6553
6699
|
}
|
|
6554
6700
|
),
|
|
6555
|
-
|
|
6556
|
-
|
|
6701
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6702
|
+
"path",
|
|
6557
6703
|
{
|
|
6704
|
+
ref: indeterminateWavyActivePathRef,
|
|
6558
6705
|
d: wavyActivePath != null ? wavyActivePath : "",
|
|
6559
6706
|
fill: "none",
|
|
6560
6707
|
stroke: activeColor,
|
|
6561
6708
|
strokeWidth: trackHeight,
|
|
6562
|
-
strokeLinecap: "round"
|
|
6563
|
-
style: { originX: "50%", originY: "50%" },
|
|
6564
|
-
animate: {
|
|
6565
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
6566
|
-
rotate: ["0deg", "90deg", "360deg"]
|
|
6567
|
-
},
|
|
6568
|
-
transition: {
|
|
6569
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
6570
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
6571
|
-
ease: [0.4, 0, 0.2, 1]
|
|
6572
|
-
}
|
|
6709
|
+
strokeLinecap: "round"
|
|
6573
6710
|
}
|
|
6574
|
-
)
|
|
6575
|
-
|
|
6711
|
+
)
|
|
6712
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6713
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6714
|
+
"circle",
|
|
6576
6715
|
{
|
|
6716
|
+
ref: indeterminateTrackRef,
|
|
6717
|
+
cx: center,
|
|
6718
|
+
cy: center,
|
|
6719
|
+
r: radius,
|
|
6720
|
+
fill: "none",
|
|
6721
|
+
stroke: bgTrackColor,
|
|
6722
|
+
strokeWidth: trackHeight,
|
|
6723
|
+
strokeLinecap: "round"
|
|
6724
|
+
}
|
|
6725
|
+
),
|
|
6726
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6727
|
+
"circle",
|
|
6728
|
+
{
|
|
6729
|
+
ref: indeterminateActiveRef,
|
|
6577
6730
|
cx: center,
|
|
6578
6731
|
cy: center,
|
|
6579
6732
|
r: radius,
|
|
6580
6733
|
fill: "none",
|
|
6581
6734
|
stroke: activeColor,
|
|
6582
6735
|
strokeWidth: trackHeight,
|
|
6583
|
-
strokeLinecap: "round"
|
|
6584
|
-
style: { originX: "50%", originY: "50%" },
|
|
6585
|
-
animate: {
|
|
6586
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
6587
|
-
rotate: ["0deg", "90deg", "360deg"]
|
|
6588
|
-
},
|
|
6589
|
-
transition: {
|
|
6590
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
6591
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
6592
|
-
ease: [0.4, 0, 0.2, 1]
|
|
6593
|
-
}
|
|
6736
|
+
strokeLinecap: "round"
|
|
6594
6737
|
}
|
|
6595
6738
|
)
|
|
6596
|
-
]
|
|
6739
|
+
] })
|
|
6597
6740
|
}
|
|
6598
6741
|
)
|
|
6599
6742
|
] })
|
|
@@ -6757,6 +6900,12 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6757
6900
|
duration: 0.5
|
|
6758
6901
|
});
|
|
6759
6902
|
react.animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
|
|
6903
|
+
} else {
|
|
6904
|
+
react.animate(amplitudeMV, amplitude, {
|
|
6905
|
+
type: "spring",
|
|
6906
|
+
bounce: 0,
|
|
6907
|
+
duration: 0.5
|
|
6908
|
+
});
|
|
6760
6909
|
}
|
|
6761
6910
|
}, [
|
|
6762
6911
|
clampedValue,
|
|
@@ -6770,10 +6919,10 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6770
6919
|
1,
|
|
6771
6920
|
isDeterminate ? wavelength : indeterminateWavelength
|
|
6772
6921
|
);
|
|
6773
|
-
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
6774
6922
|
react.useAnimationFrame((time) => {
|
|
6775
6923
|
if (width === 0) return;
|
|
6776
6924
|
const currentAmp = amplitudeMV.get();
|
|
6925
|
+
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
6777
6926
|
const phase = time / 1e3 * waveSpeed * activeWavelength;
|
|
6778
6927
|
const capWidth = trackHeight / 2;
|
|
6779
6928
|
let activePathD = "";
|
|
@@ -6793,7 +6942,7 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6793
6942
|
currentAmp
|
|
6794
6943
|
);
|
|
6795
6944
|
} else if (fraction === 0) {
|
|
6796
|
-
activePathD =
|
|
6945
|
+
activePathD = "";
|
|
6797
6946
|
}
|
|
6798
6947
|
const trackStart = adjHead + totalGap;
|
|
6799
6948
|
if (trackStart < width - capWidth) {
|
|
@@ -6825,20 +6974,20 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6825
6974
|
activeLines.push({ tail: l1T, head: l1H });
|
|
6826
6975
|
activeLines.push({ tail: l2T, head: l2H });
|
|
6827
6976
|
}
|
|
6828
|
-
const
|
|
6829
|
-
const
|
|
6830
|
-
const
|
|
6977
|
+
const activeSegments = activeLines.map((line) => {
|
|
6978
|
+
const rawTail = line.tail * width;
|
|
6979
|
+
const rawHead = line.head * width;
|
|
6831
6980
|
const adjTail = Math.max(
|
|
6832
6981
|
capWidth,
|
|
6833
|
-
Math.min(width - capWidth,
|
|
6982
|
+
Math.min(width - capWidth, rawTail)
|
|
6834
6983
|
);
|
|
6835
6984
|
const adjHead = Math.max(
|
|
6836
6985
|
capWidth,
|
|
6837
|
-
Math.min(width - capWidth,
|
|
6986
|
+
Math.min(width - capWidth, rawHead)
|
|
6838
6987
|
);
|
|
6839
6988
|
return { adjTail, adjHead };
|
|
6840
6989
|
}).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
|
|
6841
|
-
activePathD =
|
|
6990
|
+
activePathD = activeSegments.map(
|
|
6842
6991
|
(seg) => getSinePath(
|
|
6843
6992
|
seg.adjTail,
|
|
6844
6993
|
seg.adjHead,
|
|
@@ -6847,13 +6996,24 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6847
6996
|
currentAmp
|
|
6848
6997
|
)
|
|
6849
6998
|
).join(" ");
|
|
6999
|
+
const validActiveLines = activeLines.filter(
|
|
7000
|
+
(line) => line.head > line.tail && line.head * width > 0 && line.tail * width < width
|
|
7001
|
+
).sort((a, b) => a.tail - b.tail);
|
|
6850
7002
|
let currentTrackX = capWidth;
|
|
6851
|
-
for (const
|
|
6852
|
-
const
|
|
7003
|
+
for (const line of validActiveLines) {
|
|
7004
|
+
const blockStart = line.tail * width - totalGap;
|
|
7005
|
+
const blockEnd = line.head * width + totalGap;
|
|
7006
|
+
const trackEnd = Math.min(width - capWidth, blockStart);
|
|
6853
7007
|
if (trackEnd > currentTrackX) {
|
|
6854
|
-
trackD += `${getSinePath(
|
|
7008
|
+
trackD += `${getSinePath(
|
|
7009
|
+
currentTrackX,
|
|
7010
|
+
trackEnd,
|
|
7011
|
+
phase,
|
|
7012
|
+
activeWavelength,
|
|
7013
|
+
trackAmp
|
|
7014
|
+
)} `;
|
|
6855
7015
|
}
|
|
6856
|
-
currentTrackX = Math.max(currentTrackX,
|
|
7016
|
+
currentTrackX = Math.max(currentTrackX, blockEnd);
|
|
6857
7017
|
}
|
|
6858
7018
|
if (currentTrackX < width - capWidth) {
|
|
6859
7019
|
trackD += getSinePath(
|
|
@@ -6866,15 +7026,15 @@ var WavyLinearTrack = React37__namespace.memo(function WavyLinearTrack2({
|
|
|
6866
7026
|
}
|
|
6867
7027
|
}
|
|
6868
7028
|
if (activePathRef.current)
|
|
6869
|
-
activePathRef.current.setAttribute("d", activePathD);
|
|
7029
|
+
activePathRef.current.setAttribute("d", activePathD || "");
|
|
6870
7030
|
if (trackPathRef.current)
|
|
6871
|
-
trackPathRef.current.setAttribute("d", trackD.trim());
|
|
7031
|
+
trackPathRef.current.setAttribute("d", trackD.trim() || "");
|
|
6872
7032
|
});
|
|
6873
7033
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6874
7034
|
"div",
|
|
6875
7035
|
{
|
|
6876
7036
|
ref: containerRef,
|
|
6877
|
-
className: "relative w-full
|
|
7037
|
+
className: "relative w-full",
|
|
6878
7038
|
style: { height: svgHeight },
|
|
6879
7039
|
children: width > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6880
7040
|
"svg",
|
|
@@ -6928,7 +7088,7 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
6928
7088
|
waveSpeed = 1,
|
|
6929
7089
|
crawlerSpeed = 1,
|
|
6930
7090
|
determinateAnimation = "md3",
|
|
6931
|
-
indeterminateAnimation = "
|
|
7091
|
+
indeterminateAnimation = "md3",
|
|
6932
7092
|
gapSize = 4,
|
|
6933
7093
|
showStopIndicator = "auto",
|
|
6934
7094
|
color,
|
|
@@ -6965,15 +7125,15 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
6965
7125
|
setIsRtl(dir === "rtl");
|
|
6966
7126
|
}
|
|
6967
7127
|
}, []);
|
|
6968
|
-
const isWavy = shape === "wavy";
|
|
6969
7128
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
7129
|
+
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
6970
7130
|
const effectiveAmplitude = React37__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
6971
7131
|
const svgHeight = React37__namespace.useMemo(
|
|
6972
7132
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
6973
7133
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
6974
7134
|
);
|
|
6975
7135
|
const shouldShowStop = React37__namespace.useMemo(
|
|
6976
|
-
() => isDeterminate && resolvedTrackShape === "flat" &&
|
|
7136
|
+
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
6977
7137
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
6978
7138
|
);
|
|
6979
7139
|
const stopSize = React37__namespace.useMemo(
|
|
@@ -6983,6 +7143,8 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
6983
7143
|
const stopOffset = (trackHeight - stopSize) / 2;
|
|
6984
7144
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
6985
7145
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
7146
|
+
const useWavyTrack = isWavy || !isDeterminate;
|
|
7147
|
+
const trackAmp = isWavy ? effectiveAmplitude : 0;
|
|
6986
7148
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6987
7149
|
"div",
|
|
6988
7150
|
__spreadProps(__spreadValues({
|
|
@@ -6999,12 +7161,12 @@ var LinearProgress = React37__namespace.forwardRef(
|
|
|
6999
7161
|
style: { height: svgHeight }
|
|
7000
7162
|
}, restProps), {
|
|
7001
7163
|
children: [
|
|
7002
|
-
|
|
7164
|
+
useWavyTrack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7003
7165
|
WavyLinearTrack,
|
|
7004
7166
|
{
|
|
7005
7167
|
trackHeight,
|
|
7006
7168
|
svgHeight,
|
|
7007
|
-
amplitude:
|
|
7169
|
+
amplitude: trackAmp,
|
|
7008
7170
|
wavelength,
|
|
7009
7171
|
indeterminateWavelength,
|
|
7010
7172
|
activeColor,
|