@jfrader/ui 0.5.0 → 0.5.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/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
- package/dist/announcement-bar.js +1 -1
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
- package/dist/button.js +1 -1
- package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +1 -1
- package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
- package/dist/chip-group.js +1 -1
- package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
- package/dist/code-block.js +1 -1
- package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/{copy-button-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
- package/dist/copy-button.js +1 -1
- package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
- package/dist/expandable-card.js +1 -1
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
- package/dist/filter-toolbar.js +1 -1
- package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
- package/dist/hover-card.js +1 -1
- package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
- package/dist/image-compare.js +1 -1
- package/dist/index.js +81 -76
- package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
- package/dist/json-viewer.js +1 -1
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +1 -1
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
- package/dist/navigation.js +1 -1
- package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
- package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
- package/dist/pagination.js +1 -1
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
- package/dist/resizable-panels.js +1 -1
- package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
- package/dist/select.js +1 -1
- package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
- package/dist/signature-pad.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
- package/dist/sortable-data-table.js +1 -1
- package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
- package/dist/split-button.js +1 -1
- package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
- package/dist/swipe-actions.js +1 -1
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
- package/dist/text-field.js +1 -1
- package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/{time-picker-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
- package/dist/timeline.js +1 -1
- package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
- package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
- package/dist/tree-view.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +50 -7
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +2 -10
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/split-button/split-button.d.ts +2 -2
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/overlay/overlay-layer.d.ts +20 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
- package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +22 -2
- package/dist/accordion-xCI_u0BV.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/carousel-IvPqN-oM.js +0 -472
- package/dist/command-palette-BQ5LleGb.js +0 -384
- package/dist/date-range-picker-B5uFWsm-.js +0 -562
- package/dist/file-dropzone-pR4v7owg.js +0 -457
- package/dist/mention-input-BcQKX2EJ.js +0 -599
- package/dist/menu-xwOOUtWP.js +0 -275
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-QHcEvf9c.js +0 -119
- package/dist/slider-t0B5cecO.js +0 -477
- package/dist/switch-qwv8jQnR.js +0 -142
- package/dist/tabs-CAVJndX1.js +0 -203
- package/dist/tooltip-CkeiW9C1.js +0 -113
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n, t as r } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as i, r as a } from "./media-8yrN85VT.js";
|
|
5
|
+
import { n as o } from "./roving-focus-CYlo_Kf8.js";
|
|
6
|
+
import { t as s } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as c } from "./button-NLY0h6EJ.js";
|
|
8
|
+
import { Children as ee, isValidElement as l, useEffect as u, useId as te, useLayoutEffect as ne, useMemo as re, useRef as d, useState as f, useSyncExternalStore as ie } from "react";
|
|
9
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
10
|
+
import { createElement as ae } from "@emotion/react";
|
|
11
|
+
import { jsx as m, jsxs as oe } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { useMergeRefs as h } from "@floating-ui/react";
|
|
13
|
+
//#region src/components/carousel/carousel.tsx
|
|
14
|
+
var se = "min(80cqw, 21rem)", g = "min(var(--carousel-slide-size), 100cqw)", ce = 6, le = 120, _ = "(prefers-reduced-motion: reduce)", ue = "a[href], button, input, select, textarea, label, summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex], [role=\"slider\"]", de = {
|
|
15
|
+
itemSelector: "[role=\"tab\"]",
|
|
16
|
+
ownerSelector: "[role=\"tablist\"]"
|
|
17
|
+
}, v = () => {};
|
|
18
|
+
function fe(e) {
|
|
19
|
+
if (typeof window > "u" || !window.matchMedia) return v;
|
|
20
|
+
let t = window.matchMedia(_);
|
|
21
|
+
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
22
|
+
}
|
|
23
|
+
var pe = () => typeof window < "u" && window.matchMedia?.(_).matches === !0;
|
|
24
|
+
function me(e) {
|
|
25
|
+
return typeof document > "u" ? v : (document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e));
|
|
26
|
+
}
|
|
27
|
+
var he = () => typeof document < "u" && document.hidden, ge = () => !1;
|
|
28
|
+
function _e(e, t) {
|
|
29
|
+
return t === 0 ? 0 : Math.min(Math.max(Number.isFinite(e) ? Math.trunc(e) : 0, 0), t - 1);
|
|
30
|
+
}
|
|
31
|
+
function y(e, t) {
|
|
32
|
+
return (n) => {
|
|
33
|
+
e?.(n), n.defaultPrevented || t(n);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var ve = (...e) => e.filter(Boolean).join(" ") || void 0, b = (e, t) => l(e) && e.key !== null ? e.key : `slide-${t}`, ye = e({
|
|
37
|
+
label: "carousel",
|
|
38
|
+
containerType: "inline-size",
|
|
39
|
+
boxSizing: "border-box",
|
|
40
|
+
inlineSize: "100%",
|
|
41
|
+
minInlineSize: 0,
|
|
42
|
+
display: "grid",
|
|
43
|
+
gap: p.space[3],
|
|
44
|
+
fontFamily: p.font.sans,
|
|
45
|
+
color: p.color.text,
|
|
46
|
+
"&:focus-visible": n
|
|
47
|
+
}), be = e({ justifySelf: "start" }), xe = e({
|
|
48
|
+
overflowX: "auto",
|
|
49
|
+
overflowY: "hidden",
|
|
50
|
+
scrollSnapType: "inline mandatory",
|
|
51
|
+
overscrollBehaviorInline: "contain",
|
|
52
|
+
scrollbarWidth: "none",
|
|
53
|
+
borderRadius: p.radius.lg,
|
|
54
|
+
"&:focus-visible": n,
|
|
55
|
+
"&[data-disabled]": { overflowX: "hidden" },
|
|
56
|
+
"&[data-dragging]": {
|
|
57
|
+
cursor: "grabbing",
|
|
58
|
+
userSelect: "none"
|
|
59
|
+
}
|
|
60
|
+
}), Se = e({
|
|
61
|
+
display: "flex",
|
|
62
|
+
gap: p.space[3],
|
|
63
|
+
inlineSize: "max-content",
|
|
64
|
+
paddingInline: `calc((100cqw - ${g}) / 2)`
|
|
65
|
+
}), Ce = e({
|
|
66
|
+
flex: "none",
|
|
67
|
+
boxSizing: "border-box",
|
|
68
|
+
inlineSize: g,
|
|
69
|
+
minInlineSize: 0,
|
|
70
|
+
scrollSnapAlign: "center",
|
|
71
|
+
scrollSnapStop: "always"
|
|
72
|
+
}), we = e({
|
|
73
|
+
display: "flex",
|
|
74
|
+
flexWrap: "wrap",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
gap: p.space[2]
|
|
77
|
+
}), Te = e({
|
|
78
|
+
display: "flex",
|
|
79
|
+
flex: "1 1 auto",
|
|
80
|
+
minInlineSize: 0,
|
|
81
|
+
overflowX: "auto",
|
|
82
|
+
scrollbarWidth: "none"
|
|
83
|
+
}), Ee = e({
|
|
84
|
+
appearance: "none",
|
|
85
|
+
display: "inline-grid",
|
|
86
|
+
placeItems: "center",
|
|
87
|
+
flex: "none",
|
|
88
|
+
minInlineSize: p.space[8],
|
|
89
|
+
blockSize: p.space[8],
|
|
90
|
+
padding: 0,
|
|
91
|
+
border: 0,
|
|
92
|
+
borderRadius: p.radius.full,
|
|
93
|
+
background: "transparent",
|
|
94
|
+
cursor: "pointer",
|
|
95
|
+
"&:hover:not([aria-disabled=\"true\"]):not([aria-selected=\"true\"]) > span": { backgroundColor: p.color.textMuted },
|
|
96
|
+
"&[aria-selected=\"true\"] > span": {
|
|
97
|
+
inlineSize: p.space[6],
|
|
98
|
+
backgroundColor: p.color.accent
|
|
99
|
+
},
|
|
100
|
+
"&[aria-disabled=\"true\"]": {
|
|
101
|
+
cursor: "not-allowed",
|
|
102
|
+
opacity: .55
|
|
103
|
+
},
|
|
104
|
+
"&:focus-visible": r,
|
|
105
|
+
[i]: {
|
|
106
|
+
"& > span": {
|
|
107
|
+
forcedColorAdjust: "none",
|
|
108
|
+
backgroundColor: "CanvasText"
|
|
109
|
+
},
|
|
110
|
+
"&[aria-selected=\"true\"] > span": { backgroundColor: "Highlight" }
|
|
111
|
+
}
|
|
112
|
+
}), De = e({
|
|
113
|
+
display: "block",
|
|
114
|
+
inlineSize: p.space[2],
|
|
115
|
+
blockSize: p.space[2],
|
|
116
|
+
borderRadius: p.radius.full,
|
|
117
|
+
backgroundColor: p.color.borderControl,
|
|
118
|
+
transitionProperty: "inline-size, background-color",
|
|
119
|
+
transitionDuration: p.motion.duration.fast,
|
|
120
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
121
|
+
[a]: { transitionDuration: "0s" }
|
|
122
|
+
}), Oe = e({
|
|
123
|
+
inlineSize: p.space[8],
|
|
124
|
+
paddingInline: 0
|
|
125
|
+
}), ke = e({
|
|
126
|
+
inlineSize: p.space[4],
|
|
127
|
+
blockSize: p.space[4],
|
|
128
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
129
|
+
}), Ae = e({
|
|
130
|
+
margin: 0,
|
|
131
|
+
textAlign: "center",
|
|
132
|
+
fontSize: p.textSize.sm,
|
|
133
|
+
lineHeight: p.lineHeight.base,
|
|
134
|
+
color: p.color.textMuted,
|
|
135
|
+
fontVariantNumeric: "tabular-nums"
|
|
136
|
+
}), je = e({
|
|
137
|
+
display: "grid",
|
|
138
|
+
placeItems: "center",
|
|
139
|
+
padding: p.space[8],
|
|
140
|
+
border: `1px dashed ${p.color.borderControl}`,
|
|
141
|
+
borderRadius: p.radius.lg,
|
|
142
|
+
fontSize: p.textSize.sm,
|
|
143
|
+
lineHeight: p.lineHeight.base,
|
|
144
|
+
color: p.color.textMuted
|
|
145
|
+
});
|
|
146
|
+
function Me({ direction: e }) {
|
|
147
|
+
return /* @__PURE__ */ m("svg", {
|
|
148
|
+
viewBox: "0 0 16 16",
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
focusable: "false",
|
|
151
|
+
css: ke,
|
|
152
|
+
children: /* @__PURE__ */ m("path", {
|
|
153
|
+
d: e === "previous" ? "M10 3 5 8l5 5" : "m6 3 5 5-5 5",
|
|
154
|
+
fill: "none",
|
|
155
|
+
stroke: "currentColor",
|
|
156
|
+
strokeWidth: "1.5",
|
|
157
|
+
strokeLinecap: "round",
|
|
158
|
+
strokeLinejoin: "round"
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function x({ ref: e, children: n, value: r, defaultValue: i = 0, onValueChange: a, slideSize: l = se, getSlideLabel: p, activation: g = "auto", interval: _, autoPlay: ke = !1, playingValue: x, defaultPlayingValue: Ne, onPlayingValueChange: Pe, locale: Fe, labels: Ie, disabled: S = !1, slotProps: C, className: Le, sx: Re, style: ze, role: Be = "region", "aria-roledescription": Ve, onFocus: He, onBlur: Ue, onPointerEnter: We, onPointerLeave: Ge, ...Ke }) {
|
|
163
|
+
let qe = te(), Je = re(() => new Intl.NumberFormat(Fe), [Fe]), w = {
|
|
164
|
+
slides: "Slides",
|
|
165
|
+
chooseSlide: "Choose slide",
|
|
166
|
+
previous: "Previous slide",
|
|
167
|
+
next: "Next slide",
|
|
168
|
+
startRotation: "Start slide rotation",
|
|
169
|
+
stopRotation: "Stop slide rotation",
|
|
170
|
+
empty: "No slides",
|
|
171
|
+
carouselRole: "carousel",
|
|
172
|
+
slideCount: (e, t) => `Slide ${Je.format(e + 1)} of ${Je.format(t)}`,
|
|
173
|
+
...Ie
|
|
174
|
+
}, Ye = p ?? w.slideCount, T = ee.toArray(n), E = T.length, Xe = JSON.stringify(T.map(b)), D = E > 1, [Ze, O] = s(r, i, a), k = Ze ?? 0, A = _e(k, E), j = D && !S, M = typeof _ == "number" && Number.isFinite(_) && _ > 0 ? _ : void 0, N = M !== void 0 && D, [Qe, $e] = s(x, Ne ?? ke, Pe), [et, P] = f(!1), [F, tt] = f(null), I = ie(fe, pe, ge), nt = ie(me, he, ge), [rt, it] = f(!1), [at, ot] = f(!1), [st, ct] = f(!1), L = N && Qe && !et && !I && !S, R = L && !rt && !at && !nt && !st, [z, lt] = f(null), ut = z !== null && z < E ? z : A, [dt, ft] = f(0), B = d(null), V = d(null), H = d(null), pt = d(null), mt = h([e, B]), ht = h([C?.viewport?.ref, V]), gt = h([C?.tabList?.ref, pt]), U = d(null), W = d(null), _t = d(null), G = d(null), vt = d(null), K = d(null), yt = d(!0), bt = d(0), xt = d(void 0), St = (e) => `${qe}-panel-${e}`, Ct = (e) => `${qe}-tab-${e}`;
|
|
175
|
+
u(() => {
|
|
176
|
+
Number.isFinite(k) || console.warn(`Carousel: value ${k} is not a finite index; showing the first slide.`);
|
|
177
|
+
}, [k]), u(() => {
|
|
178
|
+
I && P(!0);
|
|
179
|
+
}, [I]), u(() => {
|
|
180
|
+
let e = B.current;
|
|
181
|
+
if (!N || !e || typeof IntersectionObserver > "u") return;
|
|
182
|
+
let t = new IntersectionObserver(([e]) => ct(e ? !e.isIntersecting : !1));
|
|
183
|
+
return t.observe(e), () => t.disconnect();
|
|
184
|
+
}, [N]), u(() => {
|
|
185
|
+
if (!R || M === void 0) return;
|
|
186
|
+
let e = setTimeout(() => {
|
|
187
|
+
tt(A), O((A + 1) % E);
|
|
188
|
+
}, M);
|
|
189
|
+
return () => clearTimeout(e);
|
|
190
|
+
}, [
|
|
191
|
+
R,
|
|
192
|
+
M,
|
|
193
|
+
A,
|
|
194
|
+
E,
|
|
195
|
+
O
|
|
196
|
+
]), u(() => {
|
|
197
|
+
F !== null && (tt(null), F === A && P(!0));
|
|
198
|
+
}, [F, A]), u(() => () => clearTimeout(xt.current), []);
|
|
199
|
+
let wt = (e) => H.current?.children[e], Tt = (e, t) => {
|
|
200
|
+
let n = V.current, r = wt(e);
|
|
201
|
+
if (!n || !r) return;
|
|
202
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = a.left + a.width / 2 - (i.left + i.width / 2);
|
|
203
|
+
Math.abs(o) < 1 || (K.current = n.scrollLeft + o, n.scrollTo({
|
|
204
|
+
left: K.current,
|
|
205
|
+
behavior: t
|
|
206
|
+
}));
|
|
207
|
+
}, Et = () => {
|
|
208
|
+
let e = V.current, t = H.current;
|
|
209
|
+
if (!e || !t) return A;
|
|
210
|
+
let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = A, a = Infinity;
|
|
211
|
+
return Array.from(t.children).forEach((e, t) => {
|
|
212
|
+
let n = e.getBoundingClientRect(), o = Math.abs(n.left + n.width / 2 - r);
|
|
213
|
+
o < a && (a = o, i = t);
|
|
214
|
+
}), i;
|
|
215
|
+
};
|
|
216
|
+
ne(() => {
|
|
217
|
+
bt.current = A;
|
|
218
|
+
let e = V.current, t = e ?? B.current;
|
|
219
|
+
if (!t) return;
|
|
220
|
+
let { activeElement: n, body: r } = t.ownerDocument, i = U.current, a = (t) => e?.contains(t) && t.closest("[inert]") !== null, o = n !== null && a(n), s = n === r && i !== null && (!i.isConnected || a(i));
|
|
221
|
+
(o || s) && t.focus({ preventScroll: !0 }), pt.current?.contains(n) || lt(null), !W.current?.active && (Tt(A, yt.current || I ? "instant" : "smooth"), yt.current = !1);
|
|
222
|
+
}, [
|
|
223
|
+
A,
|
|
224
|
+
Xe,
|
|
225
|
+
dt
|
|
226
|
+
]), u(() => {
|
|
227
|
+
let e = V.current;
|
|
228
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
229
|
+
let t = new ResizeObserver(() => {
|
|
230
|
+
W.current?.active || Tt(bt.current, "instant");
|
|
231
|
+
});
|
|
232
|
+
return t.observe(e), () => t.disconnect();
|
|
233
|
+
}, [E > 0]);
|
|
234
|
+
let q = (e) => {
|
|
235
|
+
if (!j) return;
|
|
236
|
+
let t = _e(e, E);
|
|
237
|
+
t !== A && O(t);
|
|
238
|
+
}, Dt = (e) => {
|
|
239
|
+
_t.current = e, q(e), ft((e) => e + 1);
|
|
240
|
+
}, Ot = () => {
|
|
241
|
+
let e = V.current, t = K.current;
|
|
242
|
+
if (e && t !== null) {
|
|
243
|
+
Math.abs(e.scrollLeft - t) < 2 && (K.current = null);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (!j || W.current) return;
|
|
247
|
+
let n = Et();
|
|
248
|
+
n !== A && n !== _t.current && Dt(n);
|
|
249
|
+
}, kt = () => {
|
|
250
|
+
clearTimeout(xt.current), xt.current = setTimeout(Ot, le);
|
|
251
|
+
}, At = typeof window < "u" && "onscrollend" in window, jt = () => {
|
|
252
|
+
N && !et && (P(!0), $e(!1));
|
|
253
|
+
}, Mt = y(He, (e) => {
|
|
254
|
+
U.current = e.target, jt();
|
|
255
|
+
}), Nt = y(Ue, (e) => {
|
|
256
|
+
let t = e.relatedTarget;
|
|
257
|
+
t !== null && !e.currentTarget.contains(t) && (U.current = null);
|
|
258
|
+
}), Pt = () => {
|
|
259
|
+
let e = vt.current ?? (L ? "stop" : "start");
|
|
260
|
+
vt.current = null, P(e === "stop"), $e(e === "start");
|
|
261
|
+
}, Ft = () => {
|
|
262
|
+
_t.current = null, K.current = null;
|
|
263
|
+
}, It = (e) => {
|
|
264
|
+
if (Ft(), e.target !== e.currentTarget || !j) return;
|
|
265
|
+
let t = getComputedStyle(e.currentTarget).direction === "rtl", n = {
|
|
266
|
+
ArrowRight: A + (t ? -1 : 1),
|
|
267
|
+
ArrowLeft: A + (t ? 1 : -1),
|
|
268
|
+
Home: 0,
|
|
269
|
+
End: E - 1
|
|
270
|
+
}[e.key];
|
|
271
|
+
n !== void 0 && (e.preventDefault(), q(n));
|
|
272
|
+
}, Lt = (e) => {
|
|
273
|
+
if (Ft(), !j || e.pointerType !== "mouse" || e.button !== 0) return;
|
|
274
|
+
let t = e.currentTarget, n = e.target.closest(ue);
|
|
275
|
+
n && n !== t && t.contains(n) || (W.current = {
|
|
276
|
+
pointerId: e.pointerId,
|
|
277
|
+
startX: e.clientX,
|
|
278
|
+
startY: e.clientY,
|
|
279
|
+
startScroll: t.scrollLeft,
|
|
280
|
+
active: !1
|
|
281
|
+
});
|
|
282
|
+
}, Rt = (e) => {
|
|
283
|
+
let t = W.current;
|
|
284
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
285
|
+
let n = e.currentTarget, r = e.clientX - t.startX, i = e.clientY - t.startY;
|
|
286
|
+
if (!t.active) {
|
|
287
|
+
if (Math.abs(i) >= ce && Math.abs(i) > Math.abs(r)) {
|
|
288
|
+
W.current = null;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (Math.abs(r) < ce) return;
|
|
292
|
+
t.active = !0, n.setPointerCapture(e.pointerId), n.style.scrollSnapType = "none", n.ownerDocument.getSelection()?.removeAllRanges(), ot(!0);
|
|
293
|
+
}
|
|
294
|
+
n.scrollLeft = t.startScroll - r;
|
|
295
|
+
}, zt = (e, t) => {
|
|
296
|
+
let n = W.current;
|
|
297
|
+
if (!n || n.pointerId !== e.pointerId || (W.current = null, !n.active)) return;
|
|
298
|
+
let r = e.currentTarget;
|
|
299
|
+
if (r.style.scrollSnapType = "", ot(!1), !t) {
|
|
300
|
+
ft((e) => e + 1);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
let i = (e) => {
|
|
304
|
+
e.preventDefault(), e.stopPropagation();
|
|
305
|
+
};
|
|
306
|
+
r.addEventListener("click", i, {
|
|
307
|
+
capture: !0,
|
|
308
|
+
once: !0
|
|
309
|
+
}), setTimeout(() => r.removeEventListener("click", i, { capture: !0 })), Dt(Et());
|
|
310
|
+
}, Bt = (e) => {
|
|
311
|
+
lt(e), g === "auto" && (G.current = e, q(e));
|
|
312
|
+
}, Vt = (e) => {
|
|
313
|
+
let t = G.current === e;
|
|
314
|
+
G.current = null, !(g === "auto" && t) && q(e);
|
|
315
|
+
}, Ht = (e) => {
|
|
316
|
+
G.current = null, o(e, e.currentTarget, "horizontal", de);
|
|
317
|
+
}, Ut = {
|
|
318
|
+
...ze,
|
|
319
|
+
"--carousel-slide-size": typeof l == "number" ? `${l}px` : l
|
|
320
|
+
}, { viewport: J, track: Wt, slide: Gt, controls: Kt, tabList: Y, indicator: X, rotationButton: Z, previousButton: Q, nextButton: $, status: qt, empty: Jt } = C ?? {};
|
|
321
|
+
return /* @__PURE__ */ m(t, {
|
|
322
|
+
className: Le,
|
|
323
|
+
styles: ye,
|
|
324
|
+
sx: Re,
|
|
325
|
+
children: (e) => /* @__PURE__ */ oe("section", {
|
|
326
|
+
...Ke,
|
|
327
|
+
ref: mt,
|
|
328
|
+
tabIndex: Ke.tabIndex ?? -1,
|
|
329
|
+
role: Be,
|
|
330
|
+
"aria-roledescription": Ve ?? w.carouselRole,
|
|
331
|
+
"data-ui": "carousel",
|
|
332
|
+
"data-disabled": S || void 0,
|
|
333
|
+
"data-rotating": R || void 0,
|
|
334
|
+
className: e,
|
|
335
|
+
style: Ut,
|
|
336
|
+
onFocus: Mt,
|
|
337
|
+
onBlur: Nt,
|
|
338
|
+
onPointerEnter: y(We, (e) => {
|
|
339
|
+
e.pointerType !== "touch" && it(!0);
|
|
340
|
+
}),
|
|
341
|
+
onPointerLeave: y(Ge, () => it(!1)),
|
|
342
|
+
children: [
|
|
343
|
+
N && /* @__PURE__ */ m(c, {
|
|
344
|
+
size: "sm",
|
|
345
|
+
variant: "outline",
|
|
346
|
+
...Z,
|
|
347
|
+
css: [be, Z?.css],
|
|
348
|
+
"data-ui": "carousel-rotation",
|
|
349
|
+
"aria-disabled": S || I || void 0,
|
|
350
|
+
onPointerDown: y(Z?.onPointerDown, () => {
|
|
351
|
+
vt.current = L ? "stop" : "start";
|
|
352
|
+
}),
|
|
353
|
+
onClick: y(Z?.onClick, Pt),
|
|
354
|
+
children: L ? w.stopRotation : w.startRotation
|
|
355
|
+
}),
|
|
356
|
+
E === 0 ? /* @__PURE__ */ m("div", {
|
|
357
|
+
...Jt,
|
|
358
|
+
"data-ui": "carousel-empty",
|
|
359
|
+
css: [je, Jt?.css],
|
|
360
|
+
children: w.empty
|
|
361
|
+
}) : /* @__PURE__ */ m("div", {
|
|
362
|
+
...J,
|
|
363
|
+
ref: ht,
|
|
364
|
+
role: "group",
|
|
365
|
+
"aria-label": J?.["aria-label"] ?? (J?.["aria-labelledby"] ? void 0 : w.slides),
|
|
366
|
+
tabIndex: j ? 0 : -1,
|
|
367
|
+
"data-ui": "carousel-viewport",
|
|
368
|
+
"data-disabled": S || void 0,
|
|
369
|
+
"data-dragging": at || void 0,
|
|
370
|
+
css: [xe, J?.css],
|
|
371
|
+
onKeyDown: y(J?.onKeyDown, It),
|
|
372
|
+
onWheel: y(J?.onWheel, Ft),
|
|
373
|
+
onPointerDown: y(J?.onPointerDown, Lt),
|
|
374
|
+
onPointerMove: y(J?.onPointerMove, Rt),
|
|
375
|
+
onPointerUp: y(J?.onPointerUp, (e) => zt(e, !0)),
|
|
376
|
+
onPointerCancel: y(J?.onPointerCancel, (e) => zt(e, !1)),
|
|
377
|
+
onScroll: y(J?.onScroll, At ? v : kt),
|
|
378
|
+
onScrollEnd: y(J?.onScrollEnd, Ot),
|
|
379
|
+
children: /* @__PURE__ */ m("div", {
|
|
380
|
+
...Wt,
|
|
381
|
+
ref: H,
|
|
382
|
+
"data-ui": "carousel-track",
|
|
383
|
+
css: [Se, Wt?.css],
|
|
384
|
+
children: T.map((e, t) => {
|
|
385
|
+
let n = t === A;
|
|
386
|
+
return /* @__PURE__ */ ae("div", {
|
|
387
|
+
...Gt,
|
|
388
|
+
key: b(e, t),
|
|
389
|
+
role: D ? "tabpanel" : void 0,
|
|
390
|
+
id: St(t),
|
|
391
|
+
"aria-labelledby": ve(Gt?.["aria-labelledby"], D ? Ct(t) : void 0),
|
|
392
|
+
"aria-hidden": !n || void 0,
|
|
393
|
+
inert: !n,
|
|
394
|
+
"data-ui": "carousel-slide",
|
|
395
|
+
"data-state": n ? "active" : "inactive",
|
|
396
|
+
css: [Ce, Gt?.css]
|
|
397
|
+
}, e);
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
}),
|
|
401
|
+
D && /* @__PURE__ */ oe("div", {
|
|
402
|
+
...Kt,
|
|
403
|
+
"data-ui": "carousel-controls",
|
|
404
|
+
css: [we, Kt?.css],
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ m("div", {
|
|
407
|
+
...Y,
|
|
408
|
+
ref: gt,
|
|
409
|
+
role: "tablist",
|
|
410
|
+
"aria-label": Y?.["aria-label"] ?? (Y?.["aria-labelledby"] ? void 0 : w.chooseSlide),
|
|
411
|
+
"aria-orientation": "horizontal",
|
|
412
|
+
"data-ui": "carousel-tablist",
|
|
413
|
+
css: [Te, Y?.css],
|
|
414
|
+
onKeyDown: y(Y?.onKeyDown, Ht),
|
|
415
|
+
children: T.map((e, t) => /* @__PURE__ */ ae("button", {
|
|
416
|
+
...X,
|
|
417
|
+
key: b(e, t),
|
|
418
|
+
type: "button",
|
|
419
|
+
role: "tab",
|
|
420
|
+
id: Ct(t),
|
|
421
|
+
"aria-label": Ye(t, E),
|
|
422
|
+
"aria-selected": t === A,
|
|
423
|
+
"aria-controls": St(t),
|
|
424
|
+
"aria-disabled": S || void 0,
|
|
425
|
+
tabIndex: t === ut ? 0 : -1,
|
|
426
|
+
"data-ui": "carousel-indicator",
|
|
427
|
+
css: [Ee, X?.css],
|
|
428
|
+
onPointerDown: y(X?.onPointerDown, () => {
|
|
429
|
+
G.current = null;
|
|
430
|
+
}),
|
|
431
|
+
onFocus: y(X?.onFocus, () => Bt(t)),
|
|
432
|
+
onClick: y(X?.onClick, () => Vt(t))
|
|
433
|
+
}, /* @__PURE__ */ m("span", { css: De })))
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ m(c, {
|
|
436
|
+
size: "sm",
|
|
437
|
+
variant: "outline",
|
|
438
|
+
...Q,
|
|
439
|
+
css: [Oe, Q?.css],
|
|
440
|
+
"data-ui": "carousel-previous",
|
|
441
|
+
"aria-label": Q?.["aria-label"] ?? w.previous,
|
|
442
|
+
"aria-disabled": !j || A === 0 || void 0,
|
|
443
|
+
onClick: y(Q?.onClick, () => q(A - 1)),
|
|
444
|
+
children: /* @__PURE__ */ m(Me, { direction: "previous" })
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ m(c, {
|
|
447
|
+
size: "sm",
|
|
448
|
+
variant: "outline",
|
|
449
|
+
...$,
|
|
450
|
+
css: [Oe, $?.css],
|
|
451
|
+
"data-ui": "carousel-next",
|
|
452
|
+
"aria-label": $?.["aria-label"] ?? w.next,
|
|
453
|
+
"aria-disabled": !j || A === E - 1 || void 0,
|
|
454
|
+
onClick: y($?.onClick, () => q(A + 1)),
|
|
455
|
+
children: /* @__PURE__ */ m(Me, { direction: "next" })
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
}),
|
|
459
|
+
D && /* @__PURE__ */ m("div", {
|
|
460
|
+
...qt,
|
|
461
|
+
role: "status",
|
|
462
|
+
"aria-live": R ? "off" : "polite",
|
|
463
|
+
"aria-atomic": "true",
|
|
464
|
+
"data-ui": "carousel-status",
|
|
465
|
+
css: [Ae, qt?.css],
|
|
466
|
+
children: Ye(A, E)
|
|
467
|
+
})
|
|
468
|
+
]
|
|
469
|
+
})
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
x.displayName = "Carousel";
|
|
473
|
+
//#endregion
|
|
474
|
+
export { x as t };
|
package/dist/carousel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Carousel } from "./carousel-
|
|
2
|
+
export { t as Carousel } from "./carousel-B7OrvD6J.js";
|
|
@@ -71,16 +71,16 @@ function S({ indeterminate: e }) {
|
|
|
71
71
|
}) : /* @__PURE__ */ p("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" })
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
function C({ ref: e, label: n, description: f, indeterminate: h = !1, size: C = "md", onChange: w, onCheckedChange: T, slotProps: E, className: D, sx: O, "aria-labelledby":
|
|
75
|
-
let
|
|
76
|
-
u(e, () =>
|
|
77
|
-
|
|
74
|
+
function C({ ref: e, label: n, description: f, indeterminate: h = !1, size: C = "md", onChange: w, onCheckedChange: T, slotProps: E, className: D, sx: O, dir: k, "aria-labelledby": A, "aria-describedby": j, ...M }) {
|
|
75
|
+
let N = d(null);
|
|
76
|
+
u(e, () => N.current, []), c(() => {
|
|
77
|
+
N.current && (N.current.indeterminate = h);
|
|
78
78
|
}, [h]);
|
|
79
|
-
let
|
|
79
|
+
let P = l(), F = `${P}-label`, I = `${P}-description`, L = r(n), R = r(f), z = [A, L && F].filter(Boolean).join(" ") || void 0, B = [j, R && I].filter(Boolean).join(" ") || void 0, V = [D, E?.root?.className].filter(Boolean).join(" ") || void 0, H = (e) => {
|
|
80
80
|
h && (e.currentTarget.indeterminate = !0), w?.(e), T?.(e.currentTarget.checked);
|
|
81
81
|
};
|
|
82
82
|
return /* @__PURE__ */ p(t, {
|
|
83
|
-
className:
|
|
83
|
+
className: V,
|
|
84
84
|
styles: [
|
|
85
85
|
o,
|
|
86
86
|
g,
|
|
@@ -90,19 +90,20 @@ function C({ ref: e, label: n, description: f, indeterminate: h = !1, size: C =
|
|
|
90
90
|
sx: O,
|
|
91
91
|
children: (e) => /* @__PURE__ */ m("label", {
|
|
92
92
|
"data-ui": "checkbox",
|
|
93
|
+
dir: k,
|
|
93
94
|
"data-indeterminate": h || void 0,
|
|
94
95
|
className: e,
|
|
95
96
|
children: [/* @__PURE__ */ m("span", {
|
|
96
97
|
css: i,
|
|
97
98
|
children: [
|
|
98
99
|
/* @__PURE__ */ p("input", {
|
|
99
|
-
...
|
|
100
|
-
ref:
|
|
100
|
+
...M,
|
|
101
|
+
ref: N,
|
|
101
102
|
type: "checkbox",
|
|
102
|
-
"aria-labelledby":
|
|
103
|
-
"aria-describedby":
|
|
103
|
+
"aria-labelledby": z,
|
|
104
|
+
"aria-describedby": B,
|
|
104
105
|
"aria-checked": h ? "mixed" : void 0,
|
|
105
|
-
onChange:
|
|
106
|
+
onChange: H,
|
|
106
107
|
css: s
|
|
107
108
|
}),
|
|
108
109
|
/* @__PURE__ */ p("span", {
|
|
@@ -115,15 +116,15 @@ function C({ ref: e, label: n, description: f, indeterminate: h = !1, size: C =
|
|
|
115
116
|
],
|
|
116
117
|
children: /* @__PURE__ */ p(S, { indeterminate: h })
|
|
117
118
|
}),
|
|
118
|
-
|
|
119
|
-
id:
|
|
119
|
+
L && /* @__PURE__ */ p("span", {
|
|
120
|
+
id: F,
|
|
120
121
|
className: E?.label?.className,
|
|
121
122
|
css: [y[C], E?.label?.css],
|
|
122
123
|
children: n
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
|
-
}),
|
|
126
|
-
id:
|
|
126
|
+
}), R && /* @__PURE__ */ p("span", {
|
|
127
|
+
id: I,
|
|
127
128
|
className: E?.description?.className,
|
|
128
129
|
css: [
|
|
129
130
|
b,
|
package/dist/checkbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Checkbox } from "./checkbox-
|
|
2
|
+
export { t as Checkbox } from "./checkbox-DKSzExj2.js";
|
|
@@ -54,7 +54,8 @@ var S = [], C = Symbol("overflow"), w = {
|
|
|
54
54
|
"&[aria-pressed=\"true\"]:hover:not(:disabled)": { backgroundColor: h.color.accentSoftHover },
|
|
55
55
|
"&:disabled": {
|
|
56
56
|
opacity: .55,
|
|
57
|
-
cursor: "not-allowed"
|
|
57
|
+
cursor: "not-allowed",
|
|
58
|
+
borderStyle: "dashed"
|
|
58
59
|
},
|
|
59
60
|
"&:focus-visible": r,
|
|
60
61
|
[a]: { transitionDuration: "0s" },
|
package/dist/chip-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as ChipGroup } from "./chip-group-
|
|
2
|
+
export { t as ChipGroup } from "./chip-group-DjQ0_6Y9.js";
|