@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/index.js
CHANGED
|
@@ -5714,26 +5714,46 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
|
|
|
5714
5714
|
if (i === 0) d += `M ${xAt(t0).toFixed(2)} ${yAt(t0).toFixed(2)}`;
|
|
5715
5715
|
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${xAt(t1).toFixed(2)} ${yAt(t1).toFixed(2)}`;
|
|
5716
5716
|
}
|
|
5717
|
-
d
|
|
5718
|
-
return d;
|
|
5717
|
+
return `${d} Z`;
|
|
5719
5718
|
}
|
|
5720
5719
|
function getSinePath(startX, endX, phase, wl, amp) {
|
|
5721
5720
|
if (startX >= endX) return "";
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5721
|
+
if (amp <= 0.01) {
|
|
5722
|
+
return `M ${startX.toFixed(2)} 0 L ${endX.toFixed(2)} 0`;
|
|
5723
|
+
}
|
|
5724
|
+
const safeWl = Math.max(1, wl);
|
|
5725
|
+
const k = 2 * Math.PI / safeWl;
|
|
5726
|
+
const phi = phase / safeWl * 2 * Math.PI;
|
|
5727
|
+
const yAt = (x) => amp * Math.sin(k * x + phi);
|
|
5728
|
+
const dyAt = (x) => amp * k * Math.cos(k * x + phi);
|
|
5729
|
+
const step = safeWl / 4;
|
|
5730
|
+
let d = `M ${startX.toFixed(2)} ${yAt(startX).toFixed(2)}`;
|
|
5731
|
+
let currentX = startX;
|
|
5732
|
+
while (currentX < endX) {
|
|
5733
|
+
const nextX = Math.min(endX, currentX + step);
|
|
5734
|
+
const dx = nextX - currentX;
|
|
5735
|
+
const scale = dx / 3;
|
|
5736
|
+
const y0 = yAt(currentX);
|
|
5737
|
+
const dy0 = dyAt(currentX);
|
|
5738
|
+
const y1 = yAt(nextX);
|
|
5739
|
+
const dy1 = dyAt(nextX);
|
|
5740
|
+
const cp1x = currentX + scale;
|
|
5741
|
+
const cp1y = y0 + scale * dy0;
|
|
5742
|
+
const cp2x = nextX - scale;
|
|
5743
|
+
const cp2y = y1 - scale * dy1;
|
|
5744
|
+
d += ` C ${cp1x.toFixed(2)} ${cp1y.toFixed(2)}, ${cp2x.toFixed(2)} ${cp2y.toFixed(2)}, ${nextX.toFixed(2)} ${y1.toFixed(2)}`;
|
|
5745
|
+
currentX = nextX;
|
|
5746
|
+
}
|
|
5735
5747
|
return d;
|
|
5736
5748
|
}
|
|
5749
|
+
var GLOBAL_ROTATION_DURATION = 6e3;
|
|
5750
|
+
var GLOBAL_ROTATION_TARGET = 1080;
|
|
5751
|
+
var ADDITIONAL_ROTATION_CYCLE = 1500;
|
|
5752
|
+
var ADDITIONAL_ROTATION_STEP = 90;
|
|
5753
|
+
var ADDITIONAL_ROTATION_EASE_DURATION = 500;
|
|
5754
|
+
var DEFAULT_MIN_PROGRESS = 0.1;
|
|
5755
|
+
var DEFAULT_MAX_PROGRESS = 0.8;
|
|
5756
|
+
var PROGRESS_CYCLE_DURATION = 1500;
|
|
5737
5757
|
var CircularProgress = React62__namespace.forwardRef(
|
|
5738
5758
|
(_a, ref) => {
|
|
5739
5759
|
var _b = _a, {
|
|
@@ -5747,6 +5767,10 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5747
5767
|
crawlerSpeed = 1,
|
|
5748
5768
|
color,
|
|
5749
5769
|
trackColor,
|
|
5770
|
+
showTrack = "auto",
|
|
5771
|
+
minProgress = DEFAULT_MIN_PROGRESS,
|
|
5772
|
+
maxProgress = DEFAULT_MAX_PROGRESS,
|
|
5773
|
+
amplitudeRange,
|
|
5750
5774
|
className,
|
|
5751
5775
|
"aria-label": ariaLabel
|
|
5752
5776
|
} = _b, restProps = __objRest(_b, [
|
|
@@ -5760,6 +5784,10 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5760
5784
|
"crawlerSpeed",
|
|
5761
5785
|
"color",
|
|
5762
5786
|
"trackColor",
|
|
5787
|
+
"showTrack",
|
|
5788
|
+
"minProgress",
|
|
5789
|
+
"maxProgress",
|
|
5790
|
+
"amplitudeRange",
|
|
5763
5791
|
"className",
|
|
5764
5792
|
"aria-label"
|
|
5765
5793
|
]);
|
|
@@ -5770,6 +5798,7 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5770
5798
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
5771
5799
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
5772
5800
|
const isWavy = shape === "wavy";
|
|
5801
|
+
const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
|
|
5773
5802
|
const BASELINE_SIZE = 48;
|
|
5774
5803
|
const scaleFactor = size / BASELINE_SIZE;
|
|
5775
5804
|
const effectiveAmplitude = React62__namespace.useMemo(
|
|
@@ -5780,6 +5809,10 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5780
5809
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
5781
5810
|
[wavelength, scaleFactor]
|
|
5782
5811
|
);
|
|
5812
|
+
const resolvedAmplitudeRange = React62__namespace.useMemo(
|
|
5813
|
+
() => amplitudeRange != null ? amplitudeRange : [0, effectiveAmplitude],
|
|
5814
|
+
[amplitudeRange, effectiveAmplitude]
|
|
5815
|
+
);
|
|
5783
5816
|
const wavyActivePath = React62__namespace.useMemo(
|
|
5784
5817
|
() => isWavy ? generateWavyCircularPath(
|
|
5785
5818
|
center,
|
|
@@ -5799,6 +5832,145 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5799
5832
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
5800
5833
|
const ActiveCircleElem = react.m.circle;
|
|
5801
5834
|
const ActivePathElem = react.m.path;
|
|
5835
|
+
const indeterminateSvgRef = React62__namespace.useRef(null);
|
|
5836
|
+
const indeterminateTrackRef = React62__namespace.useRef(null);
|
|
5837
|
+
const indeterminateActiveRef = React62__namespace.useRef(null);
|
|
5838
|
+
const indeterminateWavyTrackPathRef = React62__namespace.useRef(null);
|
|
5839
|
+
const indeterminateWavyActivePathRef = React62__namespace.useRef(null);
|
|
5840
|
+
const cachedPathLengthRef = React62__namespace.useRef(0);
|
|
5841
|
+
React62__namespace.useLayoutEffect(() => {
|
|
5842
|
+
if (!isWavy || !wavyActivePath) {
|
|
5843
|
+
cachedPathLengthRef.current = circumference;
|
|
5844
|
+
return;
|
|
5845
|
+
}
|
|
5846
|
+
const el = indeterminateActiveRef.current;
|
|
5847
|
+
if (el && "getTotalLength" in el) {
|
|
5848
|
+
try {
|
|
5849
|
+
const len = el.getTotalLength();
|
|
5850
|
+
if (len > 0) {
|
|
5851
|
+
cachedPathLengthRef.current = len;
|
|
5852
|
+
return;
|
|
5853
|
+
}
|
|
5854
|
+
} catch (e) {
|
|
5855
|
+
}
|
|
5856
|
+
}
|
|
5857
|
+
cachedPathLengthRef.current = circumference;
|
|
5858
|
+
}, [isWavy, circumference, wavyActivePath]);
|
|
5859
|
+
react.useAnimationFrame((time) => {
|
|
5860
|
+
if (isDeterminate) return;
|
|
5861
|
+
const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
|
|
5862
|
+
const scaledTime = time * safeCrawlerSpeed;
|
|
5863
|
+
const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
|
|
5864
|
+
const globalAngle = globalCycle / GLOBAL_ROTATION_DURATION * GLOBAL_ROTATION_TARGET;
|
|
5865
|
+
const additionalFullCycles = Math.floor(
|
|
5866
|
+
scaledTime / ADDITIONAL_ROTATION_CYCLE
|
|
5867
|
+
);
|
|
5868
|
+
const additionalCycleTime = scaledTime % ADDITIONAL_ROTATION_CYCLE;
|
|
5869
|
+
const additionalEaseT = Math.min(
|
|
5870
|
+
1,
|
|
5871
|
+
additionalCycleTime / ADDITIONAL_ROTATION_EASE_DURATION
|
|
5872
|
+
);
|
|
5873
|
+
const additionalAngle = (additionalFullCycles + easeInOutCubic(additionalEaseT)) * ADDITIONAL_ROTATION_STEP;
|
|
5874
|
+
const totalRotation = globalAngle + additionalAngle;
|
|
5875
|
+
if (indeterminateSvgRef.current) {
|
|
5876
|
+
indeterminateSvgRef.current.style.transform = `rotate(${totalRotation - 90}deg)`;
|
|
5877
|
+
}
|
|
5878
|
+
const progressFullCycle = PROGRESS_CYCLE_DURATION * 2;
|
|
5879
|
+
const progressCycleTime = scaledTime % progressFullCycle;
|
|
5880
|
+
let progress;
|
|
5881
|
+
if (progressCycleTime < PROGRESS_CYCLE_DURATION) {
|
|
5882
|
+
const t = progressCycleTime / PROGRESS_CYCLE_DURATION;
|
|
5883
|
+
progress = minProgress + (maxProgress - minProgress) * easeInOutCubic(t);
|
|
5884
|
+
} else {
|
|
5885
|
+
const t = (progressCycleTime - PROGRESS_CYCLE_DURATION) / PROGRESS_CYCLE_DURATION;
|
|
5886
|
+
progress = maxProgress - (maxProgress - minProgress) * easeInOutCubic(t);
|
|
5887
|
+
}
|
|
5888
|
+
if (isWavy) {
|
|
5889
|
+
const amplitudeT = (progress - minProgress) / (maxProgress - minProgress);
|
|
5890
|
+
const currentAmplitude = resolvedAmplitudeRange[0] + (resolvedAmplitudeRange[1] - resolvedAmplitudeRange[0]) * amplitudeT;
|
|
5891
|
+
const dynamicPath = generateWavyCircularPath(
|
|
5892
|
+
center,
|
|
5893
|
+
radius,
|
|
5894
|
+
currentAmplitude,
|
|
5895
|
+
effectiveWavelength
|
|
5896
|
+
);
|
|
5897
|
+
if (indeterminateWavyActivePathRef.current) {
|
|
5898
|
+
indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
|
|
5899
|
+
}
|
|
5900
|
+
if (indeterminateWavyTrackPathRef.current) {
|
|
5901
|
+
indeterminateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
|
|
5902
|
+
}
|
|
5903
|
+
const pathEl = indeterminateWavyActivePathRef.current;
|
|
5904
|
+
let totalLen = cachedPathLengthRef.current || circumference;
|
|
5905
|
+
if (pathEl) {
|
|
5906
|
+
try {
|
|
5907
|
+
const len = pathEl.getTotalLength();
|
|
5908
|
+
if (len > 0) totalLen = len;
|
|
5909
|
+
} catch (e) {
|
|
5910
|
+
}
|
|
5911
|
+
}
|
|
5912
|
+
const gapFrac = (gapSize + trackHeight) / totalLen;
|
|
5913
|
+
const activeLen = totalLen * progress;
|
|
5914
|
+
const activeOff = 0;
|
|
5915
|
+
if (indeterminateWavyActivePathRef.current) {
|
|
5916
|
+
indeterminateWavyActivePathRef.current.setAttribute(
|
|
5917
|
+
"stroke-dasharray",
|
|
5918
|
+
`${activeLen} ${totalLen}`
|
|
5919
|
+
);
|
|
5920
|
+
indeterminateWavyActivePathRef.current.setAttribute(
|
|
5921
|
+
"stroke-dashoffset",
|
|
5922
|
+
`${activeOff}`
|
|
5923
|
+
);
|
|
5924
|
+
}
|
|
5925
|
+
if (shouldShowIndeterminateTrack && indeterminateWavyTrackPathRef.current) {
|
|
5926
|
+
const trackStartFrac = progress + gapFrac;
|
|
5927
|
+
const trackLen = Math.max(
|
|
5928
|
+
1e-3,
|
|
5929
|
+
totalLen * (1 - progress - 2 * gapFrac)
|
|
5930
|
+
);
|
|
5931
|
+
const trackOff = -totalLen * trackStartFrac;
|
|
5932
|
+
indeterminateWavyTrackPathRef.current.setAttribute(
|
|
5933
|
+
"stroke-dasharray",
|
|
5934
|
+
`${trackLen} ${totalLen}`
|
|
5935
|
+
);
|
|
5936
|
+
indeterminateWavyTrackPathRef.current.setAttribute(
|
|
5937
|
+
"stroke-dashoffset",
|
|
5938
|
+
`${trackOff}`
|
|
5939
|
+
);
|
|
5940
|
+
}
|
|
5941
|
+
} else {
|
|
5942
|
+
const totalLen = circumference;
|
|
5943
|
+
const activeLen = totalLen * progress;
|
|
5944
|
+
const activeOff = 0;
|
|
5945
|
+
if (indeterminateActiveRef.current) {
|
|
5946
|
+
indeterminateActiveRef.current.setAttribute(
|
|
5947
|
+
"stroke-dasharray",
|
|
5948
|
+
`${activeLen} ${totalLen}`
|
|
5949
|
+
);
|
|
5950
|
+
indeterminateActiveRef.current.setAttribute(
|
|
5951
|
+
"stroke-dashoffset",
|
|
5952
|
+
`${activeOff}`
|
|
5953
|
+
);
|
|
5954
|
+
}
|
|
5955
|
+
if (shouldShowIndeterminateTrack && indeterminateTrackRef.current) {
|
|
5956
|
+
const gapFrac = (gapSize + trackHeight) / totalLen;
|
|
5957
|
+
const trackStartFrac = progress + gapFrac;
|
|
5958
|
+
const trackLen = Math.max(
|
|
5959
|
+
1e-3,
|
|
5960
|
+
totalLen * (1 - progress - 2 * gapFrac)
|
|
5961
|
+
);
|
|
5962
|
+
const trackOff = -totalLen * trackStartFrac;
|
|
5963
|
+
indeterminateTrackRef.current.setAttribute(
|
|
5964
|
+
"stroke-dasharray",
|
|
5965
|
+
`${trackLen} ${totalLen}`
|
|
5966
|
+
);
|
|
5967
|
+
indeterminateTrackRef.current.setAttribute(
|
|
5968
|
+
"stroke-dashoffset",
|
|
5969
|
+
`${trackOff}`
|
|
5970
|
+
);
|
|
5971
|
+
}
|
|
5972
|
+
}
|
|
5973
|
+
});
|
|
5802
5974
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5803
5975
|
"div",
|
|
5804
5976
|
__spreadProps(__spreadValues({
|
|
@@ -5875,9 +6047,10 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5875
6047
|
]
|
|
5876
6048
|
}
|
|
5877
6049
|
),
|
|
5878
|
-
!isDeterminate && /* @__PURE__ */ jsxRuntime.
|
|
5879
|
-
|
|
6050
|
+
!isDeterminate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6051
|
+
"svg",
|
|
5880
6052
|
{
|
|
6053
|
+
ref: indeterminateSvgRef,
|
|
5881
6054
|
width: size,
|
|
5882
6055
|
height: size,
|
|
5883
6056
|
viewBox: `0 0 ${size} ${size}`,
|
|
@@ -5886,90 +6059,60 @@ var CircularProgress = React62__namespace.forwardRef(
|
|
|
5886
6059
|
position: "absolute",
|
|
5887
6060
|
inset: 0,
|
|
5888
6061
|
overflow: "visible",
|
|
5889
|
-
|
|
5890
|
-
|
|
6062
|
+
transformOrigin: "center",
|
|
6063
|
+
transform: "rotate(-90deg)"
|
|
5891
6064
|
},
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
5896
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
5897
|
-
ease: "linear"
|
|
5898
|
-
}
|
|
5899
|
-
},
|
|
5900
|
-
children: [
|
|
5901
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5902
|
-
react.m.circle,
|
|
6065
|
+
children: isWavy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6066
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6067
|
+
"path",
|
|
5903
6068
|
{
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
r: radius,
|
|
6069
|
+
ref: indeterminateWavyTrackPathRef,
|
|
6070
|
+
d: wavyActivePath != null ? wavyActivePath : "",
|
|
5907
6071
|
fill: "none",
|
|
5908
6072
|
stroke: bgTrackColor,
|
|
5909
6073
|
strokeWidth: trackHeight,
|
|
5910
|
-
strokeLinecap: "round"
|
|
5911
|
-
style: { originX: "50%", originY: "50%" },
|
|
5912
|
-
animate: {
|
|
5913
|
-
pathLength: [
|
|
5914
|
-
Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack),
|
|
5915
|
-
Math.max(1e-3, 1 - 0.75 - 2 * gapForTrack),
|
|
5916
|
-
Math.max(1e-3, 1 - 0.1 - 2 * gapForTrack)
|
|
5917
|
-
],
|
|
5918
|
-
rotate: [
|
|
5919
|
-
`${(0.1 + gapForTrack) * 360}deg`,
|
|
5920
|
-
`${(1 + gapForTrack) * 360}deg`,
|
|
5921
|
-
`${(1.1 + gapForTrack) * 360}deg`
|
|
5922
|
-
]
|
|
5923
|
-
},
|
|
5924
|
-
transition: {
|
|
5925
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
5926
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
5927
|
-
ease: [0.4, 0, 0.2, 1]
|
|
5928
|
-
}
|
|
6074
|
+
strokeLinecap: "round"
|
|
5929
6075
|
}
|
|
5930
6076
|
),
|
|
5931
|
-
|
|
5932
|
-
|
|
6077
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6078
|
+
"path",
|
|
5933
6079
|
{
|
|
6080
|
+
ref: indeterminateWavyActivePathRef,
|
|
5934
6081
|
d: wavyActivePath != null ? wavyActivePath : "",
|
|
5935
6082
|
fill: "none",
|
|
5936
6083
|
stroke: activeColor,
|
|
5937
6084
|
strokeWidth: trackHeight,
|
|
5938
|
-
strokeLinecap: "round"
|
|
5939
|
-
style: { originX: "50%", originY: "50%" },
|
|
5940
|
-
animate: {
|
|
5941
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
5942
|
-
rotate: ["0deg", "90deg", "360deg"]
|
|
5943
|
-
},
|
|
5944
|
-
transition: {
|
|
5945
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
5946
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
5947
|
-
ease: [0.4, 0, 0.2, 1]
|
|
5948
|
-
}
|
|
6085
|
+
strokeLinecap: "round"
|
|
5949
6086
|
}
|
|
5950
|
-
)
|
|
5951
|
-
|
|
6087
|
+
)
|
|
6088
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6089
|
+
shouldShowIndeterminateTrack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6090
|
+
"circle",
|
|
5952
6091
|
{
|
|
6092
|
+
ref: indeterminateTrackRef,
|
|
6093
|
+
cx: center,
|
|
6094
|
+
cy: center,
|
|
6095
|
+
r: radius,
|
|
6096
|
+
fill: "none",
|
|
6097
|
+
stroke: bgTrackColor,
|
|
6098
|
+
strokeWidth: trackHeight,
|
|
6099
|
+
strokeLinecap: "round"
|
|
6100
|
+
}
|
|
6101
|
+
),
|
|
6102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6103
|
+
"circle",
|
|
6104
|
+
{
|
|
6105
|
+
ref: indeterminateActiveRef,
|
|
5953
6106
|
cx: center,
|
|
5954
6107
|
cy: center,
|
|
5955
6108
|
r: radius,
|
|
5956
6109
|
fill: "none",
|
|
5957
6110
|
stroke: activeColor,
|
|
5958
6111
|
strokeWidth: trackHeight,
|
|
5959
|
-
strokeLinecap: "round"
|
|
5960
|
-
style: { originX: "50%", originY: "50%" },
|
|
5961
|
-
animate: {
|
|
5962
|
-
pathLength: [0.1, 0.75, 0.1],
|
|
5963
|
-
rotate: ["0deg", "90deg", "360deg"]
|
|
5964
|
-
},
|
|
5965
|
-
transition: {
|
|
5966
|
-
duration: 2 / Math.max(0.1, crawlerSpeed),
|
|
5967
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
5968
|
-
ease: [0.4, 0, 0.2, 1]
|
|
5969
|
-
}
|
|
6112
|
+
strokeLinecap: "round"
|
|
5970
6113
|
}
|
|
5971
6114
|
)
|
|
5972
|
-
]
|
|
6115
|
+
] })
|
|
5973
6116
|
}
|
|
5974
6117
|
)
|
|
5975
6118
|
] })
|
|
@@ -6133,6 +6276,12 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6133
6276
|
duration: 0.5
|
|
6134
6277
|
});
|
|
6135
6278
|
react.animate(fractionMV, fraction, { duration: 0.4, ease: [0.2, 0, 0, 1] });
|
|
6279
|
+
} else {
|
|
6280
|
+
react.animate(amplitudeMV, amplitude, {
|
|
6281
|
+
type: "spring",
|
|
6282
|
+
bounce: 0,
|
|
6283
|
+
duration: 0.5
|
|
6284
|
+
});
|
|
6136
6285
|
}
|
|
6137
6286
|
}, [
|
|
6138
6287
|
clampedValue,
|
|
@@ -6146,10 +6295,10 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6146
6295
|
1,
|
|
6147
6296
|
isDeterminate ? wavelength : indeterminateWavelength
|
|
6148
6297
|
);
|
|
6149
|
-
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
6150
6298
|
react.useAnimationFrame((time) => {
|
|
6151
6299
|
if (width === 0) return;
|
|
6152
6300
|
const currentAmp = amplitudeMV.get();
|
|
6301
|
+
const trackAmp = trackShape === "wavy" ? amplitude : 0;
|
|
6153
6302
|
const phase = time / 1e3 * waveSpeed * activeWavelength;
|
|
6154
6303
|
const capWidth = trackHeight / 2;
|
|
6155
6304
|
let activePathD = "";
|
|
@@ -6169,7 +6318,7 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6169
6318
|
currentAmp
|
|
6170
6319
|
);
|
|
6171
6320
|
} else if (fraction === 0) {
|
|
6172
|
-
activePathD =
|
|
6321
|
+
activePathD = "";
|
|
6173
6322
|
}
|
|
6174
6323
|
const trackStart = adjHead + totalGap;
|
|
6175
6324
|
if (trackStart < width - capWidth) {
|
|
@@ -6201,20 +6350,20 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6201
6350
|
activeLines.push({ tail: l1T, head: l1H });
|
|
6202
6351
|
activeLines.push({ tail: l2T, head: l2H });
|
|
6203
6352
|
}
|
|
6204
|
-
const
|
|
6205
|
-
const
|
|
6206
|
-
const
|
|
6353
|
+
const activeSegments = activeLines.map((line) => {
|
|
6354
|
+
const rawTail = line.tail * width;
|
|
6355
|
+
const rawHead = line.head * width;
|
|
6207
6356
|
const adjTail = Math.max(
|
|
6208
6357
|
capWidth,
|
|
6209
|
-
Math.min(width - capWidth,
|
|
6358
|
+
Math.min(width - capWidth, rawTail)
|
|
6210
6359
|
);
|
|
6211
6360
|
const adjHead = Math.max(
|
|
6212
6361
|
capWidth,
|
|
6213
|
-
Math.min(width - capWidth,
|
|
6362
|
+
Math.min(width - capWidth, rawHead)
|
|
6214
6363
|
);
|
|
6215
6364
|
return { adjTail, adjHead };
|
|
6216
6365
|
}).filter((seg) => seg.adjHead - seg.adjTail > 0.1);
|
|
6217
|
-
activePathD =
|
|
6366
|
+
activePathD = activeSegments.map(
|
|
6218
6367
|
(seg) => getSinePath(
|
|
6219
6368
|
seg.adjTail,
|
|
6220
6369
|
seg.adjHead,
|
|
@@ -6223,13 +6372,24 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6223
6372
|
currentAmp
|
|
6224
6373
|
)
|
|
6225
6374
|
).join(" ");
|
|
6375
|
+
const validActiveLines = activeLines.filter(
|
|
6376
|
+
(line) => line.head > line.tail && line.head * width > 0 && line.tail * width < width
|
|
6377
|
+
).sort((a, b) => a.tail - b.tail);
|
|
6226
6378
|
let currentTrackX = capWidth;
|
|
6227
|
-
for (const
|
|
6228
|
-
const
|
|
6379
|
+
for (const line of validActiveLines) {
|
|
6380
|
+
const blockStart = line.tail * width - totalGap;
|
|
6381
|
+
const blockEnd = line.head * width + totalGap;
|
|
6382
|
+
const trackEnd = Math.min(width - capWidth, blockStart);
|
|
6229
6383
|
if (trackEnd > currentTrackX) {
|
|
6230
|
-
trackD += `${getSinePath(
|
|
6384
|
+
trackD += `${getSinePath(
|
|
6385
|
+
currentTrackX,
|
|
6386
|
+
trackEnd,
|
|
6387
|
+
phase,
|
|
6388
|
+
activeWavelength,
|
|
6389
|
+
trackAmp
|
|
6390
|
+
)} `;
|
|
6231
6391
|
}
|
|
6232
|
-
currentTrackX = Math.max(currentTrackX,
|
|
6392
|
+
currentTrackX = Math.max(currentTrackX, blockEnd);
|
|
6233
6393
|
}
|
|
6234
6394
|
if (currentTrackX < width - capWidth) {
|
|
6235
6395
|
trackD += getSinePath(
|
|
@@ -6242,15 +6402,15 @@ var WavyLinearTrack = React62__namespace.memo(function WavyLinearTrack2({
|
|
|
6242
6402
|
}
|
|
6243
6403
|
}
|
|
6244
6404
|
if (activePathRef.current)
|
|
6245
|
-
activePathRef.current.setAttribute("d", activePathD);
|
|
6405
|
+
activePathRef.current.setAttribute("d", activePathD || "");
|
|
6246
6406
|
if (trackPathRef.current)
|
|
6247
|
-
trackPathRef.current.setAttribute("d", trackD.trim());
|
|
6407
|
+
trackPathRef.current.setAttribute("d", trackD.trim() || "");
|
|
6248
6408
|
});
|
|
6249
6409
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6250
6410
|
"div",
|
|
6251
6411
|
{
|
|
6252
6412
|
ref: containerRef,
|
|
6253
|
-
className: "relative w-full
|
|
6413
|
+
className: "relative w-full",
|
|
6254
6414
|
style: { height: svgHeight },
|
|
6255
6415
|
children: width > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6256
6416
|
"svg",
|
|
@@ -6304,7 +6464,7 @@ var LinearProgress = React62__namespace.forwardRef(
|
|
|
6304
6464
|
waveSpeed = 1,
|
|
6305
6465
|
crawlerSpeed = 1,
|
|
6306
6466
|
determinateAnimation = "md3",
|
|
6307
|
-
indeterminateAnimation = "
|
|
6467
|
+
indeterminateAnimation = "md3",
|
|
6308
6468
|
gapSize = 4,
|
|
6309
6469
|
showStopIndicator = "auto",
|
|
6310
6470
|
color,
|
|
@@ -6341,15 +6501,15 @@ var LinearProgress = React62__namespace.forwardRef(
|
|
|
6341
6501
|
setIsRtl(dir === "rtl");
|
|
6342
6502
|
}
|
|
6343
6503
|
}, []);
|
|
6344
|
-
const isWavy = shape === "wavy";
|
|
6345
6504
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
6505
|
+
const isWavy = shape === "wavy" || resolvedTrackShape === "wavy";
|
|
6346
6506
|
const effectiveAmplitude = React62__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
6347
6507
|
const svgHeight = React62__namespace.useMemo(
|
|
6348
6508
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
6349
6509
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
6350
6510
|
);
|
|
6351
6511
|
const shouldShowStop = React62__namespace.useMemo(
|
|
6352
|
-
() => isDeterminate && resolvedTrackShape === "flat" &&
|
|
6512
|
+
() => isDeterminate && resolvedTrackShape === "flat" && showStopIndicator !== false,
|
|
6353
6513
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
6354
6514
|
);
|
|
6355
6515
|
const stopSize = React62__namespace.useMemo(
|
|
@@ -6359,6 +6519,8 @@ var LinearProgress = React62__namespace.forwardRef(
|
|
|
6359
6519
|
const stopOffset = (trackHeight - stopSize) / 2;
|
|
6360
6520
|
const activeColor = color || "var(--md-sys-color-indicator-active)";
|
|
6361
6521
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
6522
|
+
const useWavyTrack = isWavy || !isDeterminate;
|
|
6523
|
+
const trackAmp = isWavy ? effectiveAmplitude : 0;
|
|
6362
6524
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6363
6525
|
"div",
|
|
6364
6526
|
__spreadProps(__spreadValues({
|
|
@@ -6375,12 +6537,12 @@ var LinearProgress = React62__namespace.forwardRef(
|
|
|
6375
6537
|
style: { height: svgHeight }
|
|
6376
6538
|
}, restProps), {
|
|
6377
6539
|
children: [
|
|
6378
|
-
|
|
6540
|
+
useWavyTrack ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6379
6541
|
WavyLinearTrack,
|
|
6380
6542
|
{
|
|
6381
6543
|
trackHeight,
|
|
6382
6544
|
svgHeight,
|
|
6383
|
-
amplitude:
|
|
6545
|
+
amplitude: trackAmp,
|
|
6384
6546
|
wavelength,
|
|
6385
6547
|
indeterminateWavelength,
|
|
6386
6548
|
activeColor,
|