@appica/ui-react 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 +24 -0
- package/agent-rules.md +2 -0
- package/appica.css +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.js +1 -5
- package/dist/components/autocomplete/autocomplete.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/carousel/carousel.d.ts +2 -2
- package/dist/components/carousel/carousel.d.ts.map +1 -1
- package/dist/components/carousel/carousel.js +151 -32
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/combobox.js +1 -5
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/copy-button/copy-button.d.ts +2 -2
- package/dist/components/copy-button/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button/copy-button.js +49 -46
- package/dist/components/copy-button/copy-button.js.map +1 -1
- package/dist/components/date-field/date-field.d.ts.map +1 -1
- package/dist/components/date-field/date-field.js +7 -0
- package/dist/components/date-field/date-field.js.map +1 -1
- package/dist/components/date-picker/date-picker.d.ts +10 -0
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.js +14 -0
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/field.js +1 -0
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/loader/loader.d.ts +1 -1
- package/dist/components/loader/loader.d.ts.map +1 -1
- package/dist/components/loader/loader.js +7 -5
- package/dist/components/loader/loader.js.map +1 -1
- package/dist/components/number-field/number-field.d.ts +1 -1
- package/dist/components/number-field/number-field.d.ts.map +1 -1
- package/dist/components/number-field/number-field.js +7 -0
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/pagination/pagination.js +1 -2
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/spinner/spinner.d.ts +1 -1
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +7 -5
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/time-field/time-field.d.ts.map +1 -1
- package/dist/components/time-field/time-field.js +7 -0
- package/dist/components/time-field/time-field.js.map +1 -1
- package/package.json +11 -11
- package/src/components/autocomplete/autocomplete.test.tsx +33 -0
- package/src/components/autocomplete/autocomplete.tsx +1 -5
- package/src/components/breadcrumb/breadcrumb.test.tsx +57 -2
- package/src/components/breadcrumb/breadcrumb.tsx +1 -1
- package/src/components/carousel/carousel.test.tsx +512 -12
- package/src/components/carousel/carousel.tsx +171 -33
- package/src/components/chip/chip.test.tsx +4 -5
- package/src/components/combobox/combobox.test.tsx +33 -0
- package/src/components/combobox/combobox.tsx +1 -5
- package/src/components/context-menu/context-menu.test.tsx +2 -1
- package/src/components/copy-button/copy-button.test.tsx +68 -3
- package/src/components/copy-button/copy-button.tsx +49 -43
- package/src/components/date-field/date-field.test.tsx +82 -0
- package/src/components/date-field/date-field.tsx +7 -0
- package/src/components/date-picker/date-picker.test.tsx +70 -0
- package/src/components/date-picker/date-picker.tsx +26 -0
- package/src/components/dropdown-menu/dropdown-menu.test.tsx +2 -1
- package/src/components/field/field.test.tsx +34 -0
- package/src/components/field/field.tsx +1 -0
- package/src/components/loader/loader.test.tsx +17 -4
- package/src/components/loader/loader.tsx +2 -2
- package/src/components/number-field/number-field.test.tsx +59 -0
- package/src/components/number-field/number-field.tsx +8 -0
- package/src/components/pagination/pagination.test.tsx +83 -0
- package/src/components/pagination/pagination.tsx +1 -2
- package/src/components/spinner/spinner.test.tsx +17 -4
- package/src/components/spinner/spinner.tsx +2 -2
- package/src/components/time-field/time-field.test.tsx +64 -0
- package/src/components/time-field/time-field.tsx +7 -0
|
@@ -12,7 +12,7 @@ import AutoHeight from 'embla-carousel-auto-height';
|
|
|
12
12
|
import ClassNames from 'embla-carousel-class-names';
|
|
13
13
|
import Fade from 'embla-carousel-fade';
|
|
14
14
|
import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';
|
|
15
|
-
import { cn } from '../../internal/utils.js';
|
|
15
|
+
import { cn, useComposedRefs } from '../../internal/utils.js';
|
|
16
16
|
import { useReducedMotion } from '../../hooks/use-reduced-motion.js';
|
|
17
17
|
import { useDirection } from '@base-ui/react/direction-provider';
|
|
18
18
|
|
|
@@ -24,6 +24,68 @@ function useCarousel() {
|
|
|
24
24
|
}
|
|
25
25
|
return ctx;
|
|
26
26
|
}
|
|
27
|
+
const CAROUSEL_ACCESSIBILITY_VIEWPORT = {
|
|
28
|
+
carouselRole: "",
|
|
29
|
+
carouselAriaLabel: "",
|
|
30
|
+
carouselAriaRoleDescription: ""
|
|
31
|
+
};
|
|
32
|
+
function getShownSlides(api) {
|
|
33
|
+
const { options, scrollSnapList } = api.internalEngine();
|
|
34
|
+
if (!options.active) return new Set(api.slideNodes().keys());
|
|
35
|
+
const inView = api.plugins().fade ? [] : api.slidesInView();
|
|
36
|
+
return new Set(inView.length ? inView : scrollSnapList.slidesBySnap[api.selectedSnap()] ?? []);
|
|
37
|
+
}
|
|
38
|
+
function useSlideVisibility(api, enabled) {
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
if (!api || !enabled) return;
|
|
41
|
+
const inert = /* @__PURE__ */ new Set();
|
|
42
|
+
const labels = /* @__PURE__ */ new Map();
|
|
43
|
+
const release = (node) => {
|
|
44
|
+
if (inert.delete(node)) node.removeAttribute("inert");
|
|
45
|
+
if (labels.has(node) && node.getAttribute("aria-label") === labels.get(node)) node.removeAttribute("aria-label");
|
|
46
|
+
labels.delete(node);
|
|
47
|
+
};
|
|
48
|
+
const sync = (focused) => {
|
|
49
|
+
const slides = api.slideNodes();
|
|
50
|
+
const shown = getShownSlides(api);
|
|
51
|
+
(/* @__PURE__ */ new Set([...inert, ...labels.keys()])).forEach((node) => {
|
|
52
|
+
if (!slides.includes(node)) release(node);
|
|
53
|
+
});
|
|
54
|
+
slides.forEach((node, index) => {
|
|
55
|
+
const hidden = !shown.has(index) && !(focused instanceof Node && node.contains(focused));
|
|
56
|
+
if (hidden && !inert.has(node)) {
|
|
57
|
+
node.setAttribute("inert", "");
|
|
58
|
+
inert.add(node);
|
|
59
|
+
} else if (!hidden && inert.delete(node)) {
|
|
60
|
+
node.removeAttribute("inert");
|
|
61
|
+
}
|
|
62
|
+
const ownLabel = node.getAttribute("aria-label");
|
|
63
|
+
if (node.hasAttribute("aria-labelledby") || ownLabel !== null && ownLabel !== labels.get(node)) {
|
|
64
|
+
labels.delete(node);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const label = `${index + 1} of ${slides.length}`;
|
|
68
|
+
if (ownLabel !== label) node.setAttribute("aria-label", label);
|
|
69
|
+
labels.set(node, label);
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const onChange = () => sync(document.activeElement);
|
|
73
|
+
const onFocusOut = (event) => sync(event.relatedTarget);
|
|
74
|
+
const viewport = api.rootNode();
|
|
75
|
+
onChange();
|
|
76
|
+
api.on("select", onChange);
|
|
77
|
+
api.on("reinit", onChange);
|
|
78
|
+
api.on("slidesinview", onChange);
|
|
79
|
+
viewport?.addEventListener("focusout", onFocusOut);
|
|
80
|
+
return () => {
|
|
81
|
+
api.off("select", onChange);
|
|
82
|
+
api.off("reinit", onChange);
|
|
83
|
+
api.off("slidesinview", onChange);
|
|
84
|
+
viewport?.removeEventListener("focusout", onFocusOut);
|
|
85
|
+
(/* @__PURE__ */ new Set([...inert, ...labels.keys()])).forEach(release);
|
|
86
|
+
};
|
|
87
|
+
}, [api, enabled]);
|
|
88
|
+
}
|
|
27
89
|
function Carousel({
|
|
28
90
|
orientation = "horizontal",
|
|
29
91
|
loop = false,
|
|
@@ -67,8 +129,8 @@ function Carousel({
|
|
|
67
129
|
const resumeAfterMs = typeof autoplay === "object" && typeof autoplay.resumeAfter === "number" && autoplay.resumeAfter || typeof autoScroll === "object" && typeof autoScroll.resumeAfter === "number" && autoScroll.resumeAfter || 0;
|
|
68
130
|
const plugins = React.useMemo(() => {
|
|
69
131
|
const list = [];
|
|
70
|
-
if (accessibility
|
|
71
|
-
list.push(Accessibility(
|
|
132
|
+
if (typeof accessibility === "object") {
|
|
133
|
+
list.push(Accessibility({ ...CAROUSEL_ACCESSIBILITY_VIEWPORT, ...accessibility }));
|
|
72
134
|
}
|
|
73
135
|
if (wheelGestures !== false) {
|
|
74
136
|
list.push(WheelGesturesPlugin(typeof wheelGestures === "object" ? wheelGestures : void 0));
|
|
@@ -128,6 +190,10 @@ function Carousel({
|
|
|
128
190
|
reducedMotion
|
|
129
191
|
]);
|
|
130
192
|
const [viewportRef, emblaApi] = useEmblaCarousel(emblaOptions, plugins);
|
|
193
|
+
useSlideVisibility(emblaApi, accessibility === true);
|
|
194
|
+
const { ref: forwardedRef, ...rootProps } = rest;
|
|
195
|
+
const rootRef = React.useRef(null);
|
|
196
|
+
const composedRootRef = useComposedRefs(rootRef, forwardedRef);
|
|
131
197
|
const setApiRef = React.useRef(setApi);
|
|
132
198
|
const onReInitRef = React.useRef(onReInit);
|
|
133
199
|
const onSelectRef = React.useRef(onSelect);
|
|
@@ -198,8 +264,6 @@ function Carousel({
|
|
|
198
264
|
const syncScroll = () => {
|
|
199
265
|
notifyScroll();
|
|
200
266
|
};
|
|
201
|
-
const syncInView = () => {
|
|
202
|
-
};
|
|
203
267
|
syncFull();
|
|
204
268
|
setApiRef.current?.(emblaApi);
|
|
205
269
|
onReInitRef.current?.(emblaApi);
|
|
@@ -222,7 +286,6 @@ function Carousel({
|
|
|
222
286
|
emblaApi.on("reinit", handleReInit);
|
|
223
287
|
emblaApi.on("select", handleSelect);
|
|
224
288
|
emblaApi.on("scroll", handleScroll);
|
|
225
|
-
emblaApi.on("slidesinview", syncInView);
|
|
226
289
|
emblaApi.on("slideschanged", syncFull);
|
|
227
290
|
const autoplayPlugin = emblaApi.plugins().autoplay;
|
|
228
291
|
const autoScrollPlugin = emblaApi.plugins().autoScroll;
|
|
@@ -242,6 +305,19 @@ function Carousel({
|
|
|
242
305
|
play();
|
|
243
306
|
}, resumeAfter);
|
|
244
307
|
};
|
|
308
|
+
const root = rootRef.current;
|
|
309
|
+
let hovered = false;
|
|
310
|
+
let focused = false;
|
|
311
|
+
let held = false;
|
|
312
|
+
const playAutoplay = () => {
|
|
313
|
+
if (hovered || focused) held = true;
|
|
314
|
+
else emblaApi.plugins().autoplay?.play();
|
|
315
|
+
};
|
|
316
|
+
const interruptAutoplay = () => {
|
|
317
|
+
held = false;
|
|
318
|
+
emblaApi.plugins().autoplay?.stop();
|
|
319
|
+
scheduleResume(playAutoplay);
|
|
320
|
+
};
|
|
245
321
|
let cleanupAutoplay;
|
|
246
322
|
if (autoplayPlugin) {
|
|
247
323
|
const rawDelay = autoplayPlugin.options.delay;
|
|
@@ -252,6 +328,7 @@ function Carousel({
|
|
|
252
328
|
isPlaying: autoplayPlugin.isPlaying()
|
|
253
329
|
});
|
|
254
330
|
const onPlay = () => {
|
|
331
|
+
held = false;
|
|
255
332
|
clearResumeTimer();
|
|
256
333
|
setAutoplayState((s) => s ? { ...s, isPlaying: true } : s);
|
|
257
334
|
};
|
|
@@ -259,26 +336,71 @@ function Carousel({
|
|
|
259
336
|
const onTimerSet = () => setAutoplayState((s) => s ? { ...s, cycleId: s.cycleId + 1, isPlaying: true } : s);
|
|
260
337
|
const onTimerStopped = () => setAutoplayState((s) => s ? { ...s, isPlaying: false } : s);
|
|
261
338
|
const resetOnSelect = () => autoplayPlugin.reset();
|
|
339
|
+
const onUserStop = () => {
|
|
340
|
+
held = false;
|
|
341
|
+
};
|
|
262
342
|
const onInteraction = (_api, event) => {
|
|
263
343
|
if (event.detail.interaction === "pointerdown" || event.detail.interaction === "slidefocus") {
|
|
264
|
-
|
|
265
|
-
scheduleResume(() => emblaApi.plugins().autoplay?.play());
|
|
344
|
+
interruptAutoplay();
|
|
266
345
|
}
|
|
267
346
|
};
|
|
347
|
+
const hold = () => {
|
|
348
|
+
if (!emblaApi.plugins().autoplay?.isPlaying()) return;
|
|
349
|
+
held = true;
|
|
350
|
+
emblaApi.plugins().autoplay?.stop();
|
|
351
|
+
};
|
|
352
|
+
const release = () => {
|
|
353
|
+
if (held) playAutoplay();
|
|
354
|
+
};
|
|
355
|
+
const onPointerEnter = () => {
|
|
356
|
+
hovered = true;
|
|
357
|
+
hold();
|
|
358
|
+
};
|
|
359
|
+
const onPointerLeave = () => {
|
|
360
|
+
hovered = false;
|
|
361
|
+
release();
|
|
362
|
+
};
|
|
363
|
+
const onFocusIn = () => {
|
|
364
|
+
focused = true;
|
|
365
|
+
hold();
|
|
366
|
+
};
|
|
367
|
+
const onFocusOut = (event) => {
|
|
368
|
+
if (event.relatedTarget instanceof Node && root?.contains(event.relatedTarget)) return;
|
|
369
|
+
focused = false;
|
|
370
|
+
release();
|
|
371
|
+
};
|
|
268
372
|
emblaApi.on("autoplay:play", onPlay);
|
|
269
373
|
emblaApi.on("autoplay:stop", onStop);
|
|
270
374
|
emblaApi.on("autoplay:timerset", onTimerSet);
|
|
271
375
|
emblaApi.on("autoplay:timerstopped", onTimerStopped);
|
|
272
376
|
emblaApi.on("select", resetOnSelect);
|
|
377
|
+
emblaApi.on("pointerdown", onUserStop);
|
|
378
|
+
emblaApi.on("slidefocus", onUserStop);
|
|
273
379
|
if (resumeAfter > 0) emblaApi.on("autoplay:interaction", onInteraction);
|
|
274
|
-
|
|
380
|
+
root?.addEventListener("pointerenter", onPointerEnter);
|
|
381
|
+
root?.addEventListener("pointerleave", onPointerLeave);
|
|
382
|
+
root?.addEventListener("focusin", onFocusIn);
|
|
383
|
+
root?.addEventListener("focusout", onFocusOut);
|
|
384
|
+
if (autoplayEnabled && !reducedMotion) {
|
|
385
|
+
hovered = !!root?.matches(":hover");
|
|
386
|
+
focused = !!root?.contains(document.activeElement);
|
|
387
|
+
playAutoplay();
|
|
388
|
+
} else {
|
|
389
|
+
autoplayPlugin.stop();
|
|
390
|
+
}
|
|
275
391
|
cleanupAutoplay = () => {
|
|
276
392
|
emblaApi.off("autoplay:play", onPlay);
|
|
277
393
|
emblaApi.off("autoplay:stop", onStop);
|
|
278
394
|
emblaApi.off("autoplay:timerset", onTimerSet);
|
|
279
395
|
emblaApi.off("autoplay:timerstopped", onTimerStopped);
|
|
280
396
|
emblaApi.off("select", resetOnSelect);
|
|
397
|
+
emblaApi.off("pointerdown", onUserStop);
|
|
398
|
+
emblaApi.off("slidefocus", onUserStop);
|
|
281
399
|
if (resumeAfter > 0) emblaApi.off("autoplay:interaction", onInteraction);
|
|
400
|
+
root?.removeEventListener("pointerenter", onPointerEnter);
|
|
401
|
+
root?.removeEventListener("pointerleave", onPointerLeave);
|
|
402
|
+
root?.removeEventListener("focusin", onFocusIn);
|
|
403
|
+
root?.removeEventListener("focusout", onFocusOut);
|
|
282
404
|
};
|
|
283
405
|
} else {
|
|
284
406
|
setAutoplayState(null);
|
|
@@ -305,9 +427,8 @@ function Carousel({
|
|
|
305
427
|
const along = Math.abs(vertical ? event.deltaY : event.deltaX);
|
|
306
428
|
const across = Math.abs(vertical ? event.deltaX : event.deltaY);
|
|
307
429
|
if (along <= across) return;
|
|
308
|
-
if (autoplayPlugin?.isPlaying()) {
|
|
309
|
-
|
|
310
|
-
scheduleResume(() => emblaApi.plugins().autoplay?.play());
|
|
430
|
+
if (autoplayPlugin?.isPlaying() || held) {
|
|
431
|
+
interruptAutoplay();
|
|
311
432
|
} else if (autoScrollPlugin?.isPlaying()) {
|
|
312
433
|
autoScrollPlugin.stop();
|
|
313
434
|
scheduleResume(() => emblaApi.plugins().autoScroll?.play());
|
|
@@ -320,14 +441,13 @@ function Carousel({
|
|
|
320
441
|
emblaApi.off("reinit", handleReInit);
|
|
321
442
|
emblaApi.off("select", handleSelect);
|
|
322
443
|
emblaApi.off("scroll", handleScroll);
|
|
323
|
-
emblaApi.off("slidesinview", syncInView);
|
|
324
444
|
emblaApi.off("slideschanged", syncFull);
|
|
325
445
|
cleanupAutoplay?.();
|
|
326
446
|
cleanupAutoScroll?.();
|
|
327
447
|
cleanupWheel?.();
|
|
328
448
|
clearResumeTimer();
|
|
329
449
|
};
|
|
330
|
-
}, [emblaApi, autoplayEnabled, autoScrollEnabled, resumeAfterMs]);
|
|
450
|
+
}, [emblaApi, autoplayEnabled, autoScrollEnabled, resumeAfterMs, reducedMotion]);
|
|
331
451
|
const scrollPrev = React.useCallback(() => emblaApi?.goToPrev(), [emblaApi]);
|
|
332
452
|
const scrollNext = React.useCallback(() => emblaApi?.goToNext(), [emblaApi]);
|
|
333
453
|
const scrollTo = React.useCallback((i) => emblaApi?.goTo(i), [emblaApi]);
|
|
@@ -376,11 +496,11 @@ function Carousel({
|
|
|
376
496
|
{
|
|
377
497
|
"data-slot": "carousel",
|
|
378
498
|
"data-orientation": orientation,
|
|
379
|
-
role: "region",
|
|
499
|
+
role: rootProps["aria-label"] || rootProps["aria-labelledby"] ? "region" : "group",
|
|
380
500
|
"aria-roledescription": "carousel",
|
|
381
|
-
"aria-label": "Carousel",
|
|
382
501
|
className: cn("relative", className),
|
|
383
|
-
...
|
|
502
|
+
...rootProps,
|
|
503
|
+
ref: composedRootRef,
|
|
384
504
|
children
|
|
385
505
|
}
|
|
386
506
|
) });
|
|
@@ -507,6 +627,7 @@ function CarouselThumbs({
|
|
|
507
627
|
align: "start",
|
|
508
628
|
containScroll: "keepSnaps",
|
|
509
629
|
options: CAROUSEL_THUMB_OPTIONS,
|
|
630
|
+
accessibility: false,
|
|
510
631
|
setApi,
|
|
511
632
|
light,
|
|
512
633
|
role: "group",
|
|
@@ -637,9 +758,9 @@ function CarouselPrev({ className, position = "inside", disabled: disabledProp,
|
|
|
637
758
|
type: "button",
|
|
638
759
|
"data-slot": "carousel-prev",
|
|
639
760
|
"data-disabled": disabled || void 0,
|
|
761
|
+
"aria-disabled": disabled || void 0,
|
|
640
762
|
"aria-label": "Previous slide",
|
|
641
|
-
disabled,
|
|
642
|
-
onClick: scrollPrev,
|
|
763
|
+
onClick: disabled ? void 0 : scrollPrev,
|
|
643
764
|
suppressHydrationWarning: true
|
|
644
765
|
},
|
|
645
766
|
props
|
|
@@ -669,9 +790,9 @@ function CarouselNext({ className, position = "inside", disabled: disabledProp,
|
|
|
669
790
|
type: "button",
|
|
670
791
|
"data-slot": "carousel-next",
|
|
671
792
|
"data-disabled": disabled || void 0,
|
|
793
|
+
"aria-disabled": disabled || void 0,
|
|
672
794
|
"aria-label": "Next slide",
|
|
673
|
-
disabled,
|
|
674
|
-
onClick: scrollNext,
|
|
795
|
+
onClick: disabled ? void 0 : scrollNext,
|
|
675
796
|
suppressHydrationWarning: true
|
|
676
797
|
},
|
|
677
798
|
props
|
|
@@ -751,6 +872,10 @@ function CarouselPagination({
|
|
|
751
872
|
}
|
|
752
873
|
);
|
|
753
874
|
}
|
|
875
|
+
const AUTOPLAY_INDICATOR_TRAVEL = {
|
|
876
|
+
horizontal: { start: "-translate-x-full rtl:translate-x-full", end: "translate-x-0" },
|
|
877
|
+
vertical: { start: "-translate-y-full", end: "translate-y-0" }
|
|
878
|
+
};
|
|
754
879
|
function CarouselAutoplayIndicator({ delay, isPlaying, light, orientation }) {
|
|
755
880
|
const [armed, setArmed] = React.useState(false);
|
|
756
881
|
React.useEffect(() => {
|
|
@@ -763,8 +888,7 @@ function CarouselAutoplayIndicator({ delay, isPlaying, light, orientation }) {
|
|
|
763
888
|
cancelAnimationFrame(raf2);
|
|
764
889
|
};
|
|
765
890
|
}, []);
|
|
766
|
-
const
|
|
767
|
-
const fillValue = armed && isPlaying ? "100%" : "0%";
|
|
891
|
+
const travel = AUTOPLAY_INDICATOR_TRAVEL[orientation];
|
|
768
892
|
return /* @__PURE__ */ jsx(
|
|
769
893
|
"span",
|
|
770
894
|
{
|
|
@@ -773,17 +897,12 @@ function CarouselAutoplayIndicator({ delay, isPlaying, light, orientation }) {
|
|
|
773
897
|
"data-orientation": orientation,
|
|
774
898
|
"data-playing": isPlaying || void 0,
|
|
775
899
|
className: cn(
|
|
776
|
-
"absolute rounded-full",
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
"motion-safe:ease-linear",
|
|
900
|
+
"absolute inset-0 rounded-full",
|
|
901
|
+
"motion-safe:transition-[translate] motion-safe:ease-linear",
|
|
902
|
+
armed && isPlaying ? travel.end : travel.start,
|
|
780
903
|
light ? "bg-white" : "bg-primary"
|
|
781
904
|
),
|
|
782
|
-
style: {
|
|
783
|
-
transitionDuration: `${delay}ms`,
|
|
784
|
-
width: isHorizontal ? fillValue : void 0,
|
|
785
|
-
height: isHorizontal ? void 0 : fillValue
|
|
786
|
-
}
|
|
905
|
+
style: { transitionDuration: `${delay}ms` }
|
|
787
906
|
}
|
|
788
907
|
);
|
|
789
908
|
}
|