@bug-on/m3-expressive 1.3.0 → 1.3.1
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.d.mts +1 -1
- package/dist/buttons.d.ts +1 -1
- package/dist/buttons.js +185 -40
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +186 -41
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +156 -25
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +157 -26
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +20 -0
- package/dist/feedback.d.ts +20 -0
- package/dist/feedback.js +156 -25
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +157 -26
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +3 -2
- package/dist/forms.d.ts +3 -2
- package/dist/forms.js +88 -100
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +88 -100
- package/dist/forms.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +279 -146
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +280 -147
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +158 -27
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +159 -28
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.js +156 -25
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +157 -26
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +156 -25
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +157 -26
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +156 -25
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +157 -26
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-26qlZvKT.d.mts → split-button-trailing-uncheckable-CIVEYgjY.d.mts} +2 -0
- package/dist/{split-button-trailing-uncheckable-CXUVrH64.d.ts → split-button-trailing-uncheckable-DTQJjzsB.d.ts} +2 -0
- package/dist/{text-field-DWC7qOvp.d.mts → text-field-CiOmDM_8.d.ts} +52 -51
- package/dist/{text-field-DWC7qOvp.d.ts → text-field-Ear3hCSq.d.mts} +52 -51
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/buttons.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-
|
|
1
|
+
export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-CIVEYgjY.mjs';
|
|
2
2
|
import { Transition } from 'motion/react';
|
|
3
3
|
import { c as MD3Size } from './md3-D0_Z7IXj.mjs';
|
|
4
4
|
export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-USJo7AqO.mjs';
|
package/dist/buttons.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-
|
|
1
|
+
export { B as BUTTON_COLOR_TOKENS, a as BUTTON_SIZE_TOKENS, b as BaseButtonProps, c as Button, d as ButtonDistribute, e as ButtonDistributeProps, f as ButtonGroup, g as ButtonGroupOrientation, h as ButtonGroupProps, i as ButtonGroupVariant, j as ButtonProps, D as DistributeMode, E as ElevatedSplitButtonLeading, k as ElevatedSplitButtonTrailing, l as ElevatedSplitButtonTrailingUncheckable, m as ExtendedFAB, n as ExtendedFABProps, F as FAB, o as FABMenu, p as FABMenuItem, q as FABMenuItemData, r as FABMenuItemProps, s as FABMenuProps, t as FABPosition, u as FABPositionProps, v as FABProps, w as FilledSplitButtonLeading, x as FilledSplitButtonTrailing, y as FilledSplitButtonTrailingUncheckable, O as OutlinedSplitButtonLeading, z as OutlinedSplitButtonTrailing, A as OutlinedSplitButtonTrailingUncheckable, S as SplitButtonLayout, C as SplitButtonLayoutProps, G as SplitButtonLeading, H as SplitButtonLeadingProps, I as SplitButtonSize, V as SplitButtonSizeTokens, J as SplitButtonTrailing, K as SplitButtonTrailingProps, L as SplitButtonTrailingUncheckable, M as SplitButtonTrailingUncheckableProps, N as SplitButtonVariant, T as ToggleFAB, P as ToggleFABProps, Q as TonalSplitButtonLeading, R as TonalSplitButtonTrailing, U as TonalSplitButtonTrailingUncheckable } from './split-button-trailing-uncheckable-DTQJjzsB.js';
|
|
2
2
|
import { Transition } from 'motion/react';
|
|
3
3
|
import { c as MD3Size } from './md3-D0_Z7IXj.js';
|
|
4
4
|
export { B as BaseIconButtonProps, I as IconButton, a as IconButtonProps } from './icon-button-CqdQBsRe.js';
|
package/dist/buttons.js
CHANGED
|
@@ -251,7 +251,7 @@ LoadingIndicator.displayName = "LoadingIndicator";
|
|
|
251
251
|
function easeInOutCubic(x) {
|
|
252
252
|
return x < 0.5 ? 4 * x * x * x : 1 - (-2 * x + 2) ** 3 / 2;
|
|
253
253
|
}
|
|
254
|
-
function generateWavyCircularPath(center, radius, amplitude, wavelength) {
|
|
254
|
+
function generateWavyCircularPath(center, radius, amplitude, wavelength, phase = 0) {
|
|
255
255
|
const circumference = 2 * Math.PI * radius;
|
|
256
256
|
const numWaves = Math.max(
|
|
257
257
|
3,
|
|
@@ -259,8 +259,8 @@ function generateWavyCircularPath(center, radius, amplitude, wavelength) {
|
|
|
259
259
|
);
|
|
260
260
|
const steps = numWaves * 4;
|
|
261
261
|
const dt = 2 * Math.PI / steps;
|
|
262
|
-
const rAt = (t) => radius + amplitude * Math.sin(numWaves * t);
|
|
263
|
-
const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t);
|
|
262
|
+
const rAt = (t) => radius + amplitude * Math.sin(numWaves * t + phase);
|
|
263
|
+
const drAt = (t) => amplitude * numWaves * Math.cos(numWaves * t + phase);
|
|
264
264
|
const xAt = (t) => center + rAt(t) * Math.cos(t);
|
|
265
265
|
const yAt = (t) => center + rAt(t) * Math.sin(t);
|
|
266
266
|
const dxAt = (t) => drAt(t) * Math.cos(t) - rAt(t) * Math.sin(t);
|
|
@@ -325,15 +325,18 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
325
325
|
size = 48,
|
|
326
326
|
trackHeight = 4,
|
|
327
327
|
shape = "flat",
|
|
328
|
+
trackShape = "flat",
|
|
328
329
|
amplitude,
|
|
329
330
|
wavelength,
|
|
330
331
|
gapSize = 4,
|
|
332
|
+
waveSpeed = 1,
|
|
331
333
|
crawlerSpeed = 1,
|
|
332
334
|
color,
|
|
333
335
|
trackColor,
|
|
334
336
|
showTrack = "auto",
|
|
335
337
|
minProgress = DEFAULT_MIN_PROGRESS,
|
|
336
338
|
maxProgress = DEFAULT_MAX_PROGRESS,
|
|
339
|
+
determinateAnimation = "md3",
|
|
337
340
|
amplitudeRange,
|
|
338
341
|
className,
|
|
339
342
|
"aria-label": ariaLabel
|
|
@@ -342,15 +345,18 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
342
345
|
"size",
|
|
343
346
|
"trackHeight",
|
|
344
347
|
"shape",
|
|
348
|
+
"trackShape",
|
|
345
349
|
"amplitude",
|
|
346
350
|
"wavelength",
|
|
347
351
|
"gapSize",
|
|
352
|
+
"waveSpeed",
|
|
348
353
|
"crawlerSpeed",
|
|
349
354
|
"color",
|
|
350
355
|
"trackColor",
|
|
351
356
|
"showTrack",
|
|
352
357
|
"minProgress",
|
|
353
358
|
"maxProgress",
|
|
359
|
+
"determinateAnimation",
|
|
354
360
|
"amplitudeRange",
|
|
355
361
|
"className",
|
|
356
362
|
"aria-label"
|
|
@@ -363,6 +369,7 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
363
369
|
const bgTrackColor = trackColor || "var(--md-sys-color-indicator-track)";
|
|
364
370
|
const isWavy = shape === "wavy";
|
|
365
371
|
const shouldShowIndeterminateTrack = showTrack === "auto" ? isWavy : showTrack;
|
|
372
|
+
const shouldShowDeterminateTrack = showTrack === "auto" ? true : showTrack;
|
|
366
373
|
const BASELINE_SIZE = 48;
|
|
367
374
|
const scaleFactor = size / BASELINE_SIZE;
|
|
368
375
|
const effectiveAmplitude = React16__namespace.useMemo(
|
|
@@ -395,19 +402,50 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
395
402
|
const trackOffset = isDeterminate ? activeAngularFraction + gapForTrack : 0;
|
|
396
403
|
const trackLength = isDeterminate ? Math.max(1e-3, 1 - activeAngularFraction - 2 * gapForTrack) : 1;
|
|
397
404
|
const ActiveCircleElem = react.m.circle;
|
|
398
|
-
const ActivePathElem = react.m.path;
|
|
399
405
|
const indeterminateSvgRef = React16__namespace.useRef(null);
|
|
400
406
|
const indeterminateTrackRef = React16__namespace.useRef(null);
|
|
401
407
|
const indeterminateActiveRef = React16__namespace.useRef(null);
|
|
402
408
|
const indeterminateWavyTrackPathRef = React16__namespace.useRef(null);
|
|
403
409
|
const indeterminateWavyActivePathRef = React16__namespace.useRef(null);
|
|
410
|
+
const determinateWavyActivePathRef = React16__namespace.useRef(null);
|
|
411
|
+
const determinateWavyTrackPathRef = React16__namespace.useRef(null);
|
|
404
412
|
const cachedPathLengthRef = React16__namespace.useRef(0);
|
|
413
|
+
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 0);
|
|
414
|
+
const amplitudeMV = react.useMotionValue(isWavy ? effectiveAmplitude : 0);
|
|
415
|
+
React16__namespace.useEffect(() => {
|
|
416
|
+
if (isDeterminate) {
|
|
417
|
+
react.animate(fractionMV, clampedValue / 100, {
|
|
418
|
+
duration: 0.4,
|
|
419
|
+
ease: [0.2, 0, 0, 1]
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}, [clampedValue, isDeterminate, fractionMV]);
|
|
423
|
+
React16__namespace.useEffect(() => {
|
|
424
|
+
if (!isDeterminate || !isWavy) return;
|
|
425
|
+
const fraction = clampedValue / 100;
|
|
426
|
+
let targetAmp = effectiveAmplitude;
|
|
427
|
+
if (determinateAnimation === "md3") {
|
|
428
|
+
targetAmp = fraction <= 0.1 || fraction >= 0.95 ? 0 : effectiveAmplitude;
|
|
429
|
+
}
|
|
430
|
+
react.animate(amplitudeMV, targetAmp, {
|
|
431
|
+
type: "spring",
|
|
432
|
+
bounce: 0,
|
|
433
|
+
duration: 0.5
|
|
434
|
+
});
|
|
435
|
+
}, [
|
|
436
|
+
clampedValue,
|
|
437
|
+
isDeterminate,
|
|
438
|
+
isWavy,
|
|
439
|
+
effectiveAmplitude,
|
|
440
|
+
amplitudeMV,
|
|
441
|
+
determinateAnimation
|
|
442
|
+
]);
|
|
405
443
|
React16__namespace.useLayoutEffect(() => {
|
|
406
444
|
if (!isWavy || !wavyActivePath) {
|
|
407
445
|
cachedPathLengthRef.current = circumference;
|
|
408
446
|
return;
|
|
409
447
|
}
|
|
410
|
-
const el = indeterminateActiveRef.current;
|
|
448
|
+
const el = indeterminateActiveRef.current || determinateWavyActivePathRef.current;
|
|
411
449
|
if (el && "getTotalLength" in el) {
|
|
412
450
|
try {
|
|
413
451
|
const len = el.getTotalLength();
|
|
@@ -421,7 +459,65 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
421
459
|
cachedPathLengthRef.current = circumference;
|
|
422
460
|
}, [isWavy, circumference, wavyActivePath]);
|
|
423
461
|
react.useAnimationFrame((time) => {
|
|
424
|
-
|
|
462
|
+
const safeWaveSpeed = Math.max(0.1, waveSpeed);
|
|
463
|
+
const wavePhase = time / 1e3 * safeWaveSpeed * 2 * Math.PI;
|
|
464
|
+
if (isDeterminate) {
|
|
465
|
+
if (isWavy) {
|
|
466
|
+
const currentAmp = amplitudeMV.get();
|
|
467
|
+
const dynamicPath = generateWavyCircularPath(
|
|
468
|
+
center,
|
|
469
|
+
radius,
|
|
470
|
+
currentAmp,
|
|
471
|
+
effectiveWavelength,
|
|
472
|
+
wavePhase
|
|
473
|
+
);
|
|
474
|
+
if (determinateWavyActivePathRef.current) {
|
|
475
|
+
determinateWavyActivePathRef.current.setAttribute("d", dynamicPath);
|
|
476
|
+
}
|
|
477
|
+
if (trackShape === "wavy" && determinateWavyTrackPathRef.current) {
|
|
478
|
+
determinateWavyTrackPathRef.current.setAttribute("d", dynamicPath);
|
|
479
|
+
}
|
|
480
|
+
const pathEl = determinateWavyActivePathRef.current;
|
|
481
|
+
let totalLen = cachedPathLengthRef.current || circumference;
|
|
482
|
+
if (pathEl) {
|
|
483
|
+
try {
|
|
484
|
+
const len = pathEl.getTotalLength();
|
|
485
|
+
if (len > 0) totalLen = len;
|
|
486
|
+
} catch (e) {
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
const activeFrac = Math.max(0, Math.min(1, fractionMV.get()));
|
|
490
|
+
const activeLen = totalLen * activeFrac;
|
|
491
|
+
if (determinateWavyActivePathRef.current) {
|
|
492
|
+
determinateWavyActivePathRef.current.setAttribute(
|
|
493
|
+
"stroke-dasharray",
|
|
494
|
+
`${activeLen} ${totalLen}`
|
|
495
|
+
);
|
|
496
|
+
determinateWavyActivePathRef.current.setAttribute(
|
|
497
|
+
"stroke-dashoffset",
|
|
498
|
+
"0"
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
if (shouldShowDeterminateTrack && trackShape === "wavy" && determinateWavyTrackPathRef.current) {
|
|
502
|
+
const gapFrac = (gapSize + trackHeight) / totalLen;
|
|
503
|
+
const trackStartFrac = activeFrac + gapFrac;
|
|
504
|
+
const trackLen = Math.max(
|
|
505
|
+
1e-3,
|
|
506
|
+
totalLen * (1 - activeFrac - 2 * gapFrac)
|
|
507
|
+
);
|
|
508
|
+
const trackOff = -totalLen * trackStartFrac;
|
|
509
|
+
determinateWavyTrackPathRef.current.setAttribute(
|
|
510
|
+
"stroke-dasharray",
|
|
511
|
+
`${trackLen} ${totalLen}`
|
|
512
|
+
);
|
|
513
|
+
determinateWavyTrackPathRef.current.setAttribute(
|
|
514
|
+
"stroke-dashoffset",
|
|
515
|
+
`${trackOff}`
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
425
521
|
const safeCrawlerSpeed = Math.max(0.1, crawlerSpeed);
|
|
426
522
|
const scaledTime = time * safeCrawlerSpeed;
|
|
427
523
|
const globalCycle = scaledTime % GLOBAL_ROTATION_DURATION;
|
|
@@ -456,7 +552,8 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
456
552
|
center,
|
|
457
553
|
radius,
|
|
458
554
|
currentAmplitude,
|
|
459
|
-
effectiveWavelength
|
|
555
|
+
effectiveWavelength,
|
|
556
|
+
wavePhase
|
|
460
557
|
);
|
|
461
558
|
if (indeterminateWavyActivePathRef.current) {
|
|
462
559
|
indeterminateWavyActivePathRef.current.setAttribute("d", dynamicPath);
|
|
@@ -551,7 +648,7 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
551
648
|
style: { width: size, height: size }
|
|
552
649
|
}, restProps), {
|
|
553
650
|
children: /* @__PURE__ */ jsxRuntime.jsxs(react.LazyMotion, { features: react.domMax, strict: true, children: [
|
|
554
|
-
/* @__PURE__ */ jsxRuntime.
|
|
651
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
555
652
|
"svg",
|
|
556
653
|
{
|
|
557
654
|
width: size,
|
|
@@ -559,8 +656,18 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
559
656
|
viewBox: `0 0 ${size} ${size}`,
|
|
560
657
|
"aria-hidden": "true",
|
|
561
658
|
style: { transform: "rotate(-90deg)", overflow: "visible" },
|
|
562
|
-
children: [
|
|
563
|
-
|
|
659
|
+
children: isDeterminate ? isWavy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
660
|
+
shouldShowDeterminateTrack && (trackShape === "wavy" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
661
|
+
"path",
|
|
662
|
+
{
|
|
663
|
+
ref: determinateWavyTrackPathRef,
|
|
664
|
+
d: wavyActivePath != null ? wavyActivePath : "",
|
|
665
|
+
fill: "none",
|
|
666
|
+
stroke: bgTrackColor,
|
|
667
|
+
strokeWidth: trackHeight,
|
|
668
|
+
strokeLinecap: "round"
|
|
669
|
+
}
|
|
670
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
564
671
|
react.m.circle,
|
|
565
672
|
{
|
|
566
673
|
cx: center,
|
|
@@ -569,28 +676,52 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
569
676
|
fill: "none",
|
|
570
677
|
stroke: bgTrackColor,
|
|
571
678
|
strokeWidth: trackHeight,
|
|
572
|
-
initial: {
|
|
573
|
-
|
|
679
|
+
initial: {
|
|
680
|
+
pathLength: trackLength,
|
|
681
|
+
pathOffset: trackOffset
|
|
682
|
+
},
|
|
683
|
+
animate: {
|
|
684
|
+
pathLength: trackLength,
|
|
685
|
+
pathOffset: trackOffset
|
|
686
|
+
},
|
|
574
687
|
transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
|
|
575
688
|
strokeLinecap: "round"
|
|
576
689
|
}
|
|
577
|
-
)
|
|
578
|
-
|
|
579
|
-
|
|
690
|
+
)),
|
|
691
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
692
|
+
"path",
|
|
580
693
|
{
|
|
694
|
+
ref: determinateWavyActivePathRef,
|
|
581
695
|
d: wavyActivePath != null ? wavyActivePath : "",
|
|
582
696
|
fill: "none",
|
|
583
697
|
stroke: activeColor,
|
|
584
698
|
strokeWidth: trackHeight,
|
|
585
|
-
strokeLinecap: "round"
|
|
586
|
-
initial: { pathLength: 0 },
|
|
587
|
-
animate: { pathLength: clampedValue / 100 },
|
|
588
|
-
transition: {
|
|
589
|
-
duration: 0.4,
|
|
590
|
-
ease: [0.2, 0, 0, 1]
|
|
591
|
-
}
|
|
699
|
+
strokeLinecap: "round"
|
|
592
700
|
}
|
|
593
|
-
)
|
|
701
|
+
)
|
|
702
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
703
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
704
|
+
react.m.circle,
|
|
705
|
+
{
|
|
706
|
+
cx: center,
|
|
707
|
+
cy: center,
|
|
708
|
+
r: radius,
|
|
709
|
+
fill: "none",
|
|
710
|
+
stroke: bgTrackColor,
|
|
711
|
+
strokeWidth: trackHeight,
|
|
712
|
+
initial: {
|
|
713
|
+
pathLength: trackLength,
|
|
714
|
+
pathOffset: trackOffset
|
|
715
|
+
},
|
|
716
|
+
animate: {
|
|
717
|
+
pathLength: trackLength,
|
|
718
|
+
pathOffset: trackOffset
|
|
719
|
+
},
|
|
720
|
+
transition: { duration: 0.4, ease: [0.2, 0, 0, 1] },
|
|
721
|
+
strokeLinecap: "round"
|
|
722
|
+
}
|
|
723
|
+
),
|
|
724
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
594
725
|
ActiveCircleElem,
|
|
595
726
|
{
|
|
596
727
|
cx: center,
|
|
@@ -607,8 +738,8 @@ var CircularProgress = React16__namespace.forwardRef(
|
|
|
607
738
|
ease: [0.2, 0, 0, 1]
|
|
608
739
|
}
|
|
609
740
|
}
|
|
610
|
-
)
|
|
611
|
-
]
|
|
741
|
+
)
|
|
742
|
+
] }) : null
|
|
612
743
|
}
|
|
613
744
|
),
|
|
614
745
|
!isDeterminate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3885,11 +4016,12 @@ var SplitButtonLayoutComponent = React16__namespace.forwardRef(
|
|
|
3885
4016
|
"div",
|
|
3886
4017
|
__spreadProps(__spreadValues({
|
|
3887
4018
|
ref,
|
|
4019
|
+
role: "group",
|
|
3888
4020
|
className: cn(
|
|
3889
4021
|
"inline-flex flex-row items-stretch justify-center w-fit shrink-0 relative",
|
|
3890
4022
|
className
|
|
3891
4023
|
),
|
|
3892
|
-
style: { gap: `${spacing}px` }
|
|
4024
|
+
style: __spreadValues({ gap: `${spacing}px` }, restProps.style)
|
|
3893
4025
|
}, restProps), {
|
|
3894
4026
|
children: [
|
|
3895
4027
|
leadingButton,
|
|
@@ -4102,11 +4234,11 @@ var LEADING_ICON_SIZE_FOR_SIZE = {
|
|
|
4102
4234
|
xl: 40
|
|
4103
4235
|
};
|
|
4104
4236
|
var splitButtonSizeVariants = {
|
|
4105
|
-
xs: "min-h-[32px]",
|
|
4106
|
-
sm: "min-h-[40px]",
|
|
4107
|
-
md: "min-h-[56px]",
|
|
4108
|
-
lg: "min-h-[96px]",
|
|
4109
|
-
xl: "min-h-[136px]"
|
|
4237
|
+
xs: "h-[32px] min-h-[32px]",
|
|
4238
|
+
sm: "h-[40px] min-h-[40px]",
|
|
4239
|
+
md: "h-[56px] min-h-[56px]",
|
|
4240
|
+
lg: "h-[96px] min-h-[96px]",
|
|
4241
|
+
xl: "h-[136px] min-h-[136px]"
|
|
4110
4242
|
};
|
|
4111
4243
|
var splitButtonVariants = classVarianceAuthority.cva(
|
|
4112
4244
|
"group relative w-fit shrink-0 inline-flex flex-row items-center justify-center whitespace-nowrap select-none cursor-pointer transition-[background-color,color,border-color,box-shadow,opacity,filter] duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-m3-primary z-10 overflow-hidden",
|
|
@@ -4290,7 +4422,7 @@ var SplitButtonLeadingComponent = React16__namespace.forwardRef(
|
|
|
4290
4422
|
children: icon
|
|
4291
4423
|
}
|
|
4292
4424
|
),
|
|
4293
|
-
labelContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center
|
|
4425
|
+
labelContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center justify-center gap-[inherit]", children: labelContent })
|
|
4294
4426
|
] });
|
|
4295
4427
|
const containerClassName = cn(
|
|
4296
4428
|
splitButtonVariants({
|
|
@@ -4298,19 +4430,20 @@ var SplitButtonLeadingComponent = React16__namespace.forwardRef(
|
|
|
4298
4430
|
size: actualSize,
|
|
4299
4431
|
disabled
|
|
4300
4432
|
}),
|
|
4433
|
+
"gap-2",
|
|
4301
4434
|
typographyClass,
|
|
4302
4435
|
className
|
|
4303
4436
|
);
|
|
4304
4437
|
const mergedStyle = __spreadValues({
|
|
4305
4438
|
paddingInlineStart: tokens.leadingPadding.start,
|
|
4306
4439
|
paddingInlineEnd: tokens.leadingPadding.end,
|
|
4307
|
-
gap: "8px",
|
|
4308
4440
|
borderRadius
|
|
4309
4441
|
}, style);
|
|
4310
4442
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: asChild ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4311
4443
|
reactSlot.Slot,
|
|
4312
4444
|
__spreadProps(__spreadValues({
|
|
4313
4445
|
ref,
|
|
4446
|
+
"data-split-button-part": "leading",
|
|
4314
4447
|
"aria-disabled": disabled || void 0,
|
|
4315
4448
|
onClick: handleClick,
|
|
4316
4449
|
onPointerDown: handlePointerDown,
|
|
@@ -4333,6 +4466,7 @@ var SplitButtonLeadingComponent = React16__namespace.forwardRef(
|
|
|
4333
4466
|
__spreadProps(__spreadValues({
|
|
4334
4467
|
ref,
|
|
4335
4468
|
type: "button",
|
|
4469
|
+
"data-split-button-part": "leading",
|
|
4336
4470
|
disabled,
|
|
4337
4471
|
onClick: handleClick,
|
|
4338
4472
|
onPointerDown: handlePointerDown,
|
|
@@ -4346,8 +4480,7 @@ var SplitButtonLeadingComponent = React16__namespace.forwardRef(
|
|
|
4346
4480
|
transition: SPLIT_BUTTON_RADIUS_SPRING,
|
|
4347
4481
|
style: __spreadValues({
|
|
4348
4482
|
paddingInlineStart: tokens.leadingPadding.start,
|
|
4349
|
-
paddingInlineEnd: tokens.leadingPadding.end
|
|
4350
|
-
gap: "8px"
|
|
4483
|
+
paddingInlineEnd: tokens.leadingPadding.end
|
|
4351
4484
|
}, style),
|
|
4352
4485
|
className: containerClassName
|
|
4353
4486
|
}, restProps), {
|
|
@@ -4385,7 +4518,8 @@ var SplitButtonTrailingComponent = React16__namespace.forwardRef(
|
|
|
4385
4518
|
onBlur,
|
|
4386
4519
|
asChild = false,
|
|
4387
4520
|
children,
|
|
4388
|
-
"aria-label": ariaLabel
|
|
4521
|
+
"aria-label": ariaLabel,
|
|
4522
|
+
"aria-haspopup": ariaHaspopup = "menu"
|
|
4389
4523
|
} = _b, restProps = __objRest(_b, [
|
|
4390
4524
|
"className",
|
|
4391
4525
|
"style",
|
|
@@ -4403,7 +4537,8 @@ var SplitButtonTrailingComponent = React16__namespace.forwardRef(
|
|
|
4403
4537
|
"onBlur",
|
|
4404
4538
|
"asChild",
|
|
4405
4539
|
"children",
|
|
4406
|
-
"aria-label"
|
|
4540
|
+
"aria-label",
|
|
4541
|
+
"aria-haspopup"
|
|
4407
4542
|
]);
|
|
4408
4543
|
var _a2, _b2;
|
|
4409
4544
|
const context = useSplitButtonContext();
|
|
@@ -4496,7 +4631,11 @@ var SplitButtonTrailingComponent = React16__namespace.forwardRef(
|
|
|
4496
4631
|
x: checked ? 0 : tokens.opticalCenterOffset
|
|
4497
4632
|
},
|
|
4498
4633
|
transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_CHEVRON_SPRING,
|
|
4499
|
-
className: "flex items-center justify-center shrink-0",
|
|
4634
|
+
className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
|
|
4635
|
+
style: {
|
|
4636
|
+
width: tokens.trailingIconSize,
|
|
4637
|
+
height: tokens.trailingIconSize
|
|
4638
|
+
},
|
|
4500
4639
|
children: icon != null ? icon : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4501
4640
|
Icon,
|
|
4502
4641
|
{
|
|
@@ -4525,8 +4664,10 @@ var SplitButtonTrailingComponent = React16__namespace.forwardRef(
|
|
|
4525
4664
|
reactSlot.Slot,
|
|
4526
4665
|
__spreadProps(__spreadValues({
|
|
4527
4666
|
ref,
|
|
4667
|
+
"data-split-button-part": "trailing",
|
|
4528
4668
|
"aria-label": ariaLabel,
|
|
4529
4669
|
"aria-expanded": checked,
|
|
4670
|
+
"aria-haspopup": ariaHaspopup,
|
|
4530
4671
|
"aria-disabled": disabled,
|
|
4531
4672
|
onClick: handleToggle,
|
|
4532
4673
|
onPointerDown: handlePointerDown,
|
|
@@ -4549,8 +4690,10 @@ var SplitButtonTrailingComponent = React16__namespace.forwardRef(
|
|
|
4549
4690
|
__spreadProps(__spreadValues({
|
|
4550
4691
|
ref,
|
|
4551
4692
|
type: "button",
|
|
4693
|
+
"data-split-button-part": "trailing",
|
|
4552
4694
|
"aria-label": ariaLabel,
|
|
4553
4695
|
"aria-expanded": checked,
|
|
4696
|
+
"aria-haspopup": ariaHaspopup,
|
|
4554
4697
|
"aria-disabled": disabled,
|
|
4555
4698
|
disabled,
|
|
4556
4699
|
onClick: handleToggle,
|
|
@@ -4625,6 +4768,7 @@ var SplitButtonTrailingUncheckableComponent = React16__namespace.forwardRef(
|
|
|
4625
4768
|
const [isFocused, setIsFocused] = React16__namespace.useState(false);
|
|
4626
4769
|
const [isPressed, setIsPressed] = React16__namespace.useState(false);
|
|
4627
4770
|
const tokens = SPLIT_BUTTON_TOKENS[actualSize];
|
|
4771
|
+
const prefersReducedMotion = react.useReducedMotion();
|
|
4628
4772
|
const needsTouchTarget = actualSize === "xs" || actualSize === "sm";
|
|
4629
4773
|
const {
|
|
4630
4774
|
ripples,
|
|
@@ -4688,6 +4832,7 @@ var SplitButtonTrailingUncheckableComponent = React16__namespace.forwardRef(
|
|
|
4688
4832
|
__spreadProps(__spreadValues({
|
|
4689
4833
|
ref,
|
|
4690
4834
|
type: "button",
|
|
4835
|
+
"data-split-button-part": "trailing",
|
|
4691
4836
|
"aria-label": ariaLabel,
|
|
4692
4837
|
disabled,
|
|
4693
4838
|
onClick,
|
|
@@ -4699,7 +4844,7 @@ var SplitButtonTrailingUncheckableComponent = React16__namespace.forwardRef(
|
|
|
4699
4844
|
onFocus: handleFocus,
|
|
4700
4845
|
onBlur: handleBlur,
|
|
4701
4846
|
animate: { borderRadius },
|
|
4702
|
-
transition: SPLIT_BUTTON_RADIUS_SPRING,
|
|
4847
|
+
transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_RADIUS_SPRING,
|
|
4703
4848
|
style: __spreadValues({
|
|
4704
4849
|
paddingInlineStart: tokens.trailingPadding.start,
|
|
4705
4850
|
paddingInlineEnd: tokens.trailingPadding.end
|
|
@@ -4728,7 +4873,7 @@ var SplitButtonTrailingUncheckableComponent = React16__namespace.forwardRef(
|
|
|
4728
4873
|
react.m.div,
|
|
4729
4874
|
{
|
|
4730
4875
|
animate: { x: tokens.opticalCenterOffset },
|
|
4731
|
-
transition: SPLIT_BUTTON_RADIUS_SPRING,
|
|
4876
|
+
transition: prefersReducedMotion ? { duration: 0 } : SPLIT_BUTTON_RADIUS_SPRING,
|
|
4732
4877
|
className: "flex items-center justify-center shrink-0 [&>svg]:w-full [&>svg]:h-full",
|
|
4733
4878
|
style: {
|
|
4734
4879
|
width: tokens.trailingIconSize,
|