@konstructio/ui 0.0.13-alpha.2 → 0.1.0-alpha.3
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/DatePicker.css +1 -0
- package/dist/{Modal-i7eolhYH.js → Modal-B2ujmsSW.js} +2 -2
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +55 -41
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +79 -0
- package/dist/components/Badge/Badge.variants.js +68 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +43 -52
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
- package/dist/components/Button/Button.js +30 -26
- package/dist/components/Button/Button.variants.js +115 -28
- package/dist/components/Checkbox/Checkbox.js +297 -187
- package/dist/components/Checkbox/Checkbox.variants.js +12 -15
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2711 -0
- package/dist/components/Datepicker/DatePicker.variants.js +5 -0
- package/dist/components/Divider/Divider.variants.js +9 -12
- package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
- package/dist/components/Input/Input.js +106 -137
- package/dist/components/Input/Input.variants.js +15 -13
- package/dist/components/Loading/Loading.js +14 -99
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +1 -1
- package/dist/components/Radio/Radio.variants.js +14 -12
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +141 -126
- package/dist/components/Tabs/Tabs.js +24 -0
- package/dist/components/Tabs/Tabs.variants.js +58 -0
- package/dist/components/Tabs/components/Content.js +19 -0
- package/dist/components/Tabs/components/List.js +20 -0
- package/dist/components/Tabs/components/Trigger.js +26 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TimePicker/TimePicker.js +8 -0
- package/dist/components/TimePicker/TimePicker.variants.js +62 -0
- package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +102 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
- package/dist/components/TimePicker/components/index.js +4 -0
- package/dist/components/TimePicker/contexts/index.js +8 -0
- package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
- package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
- package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
- package/dist/components/TimePicker/utils/index.js +6 -0
- package/dist/components/Toast/Toast.js +37 -35
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/index.js +72 -66
- package/dist/createLucideIcon-BA2PlKw1.js +94 -0
- package/dist/index-55GVbfLI.js +432 -0
- package/dist/{index-D9BbbgUq.js → index-B-qIIQlg.js} +2 -2
- package/dist/index-BRcC_VTj.js +31 -0
- package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
- package/dist/index-BdMNhZnh.js +9 -0
- package/dist/index-C2xwUZXm.js +323 -0
- package/dist/{index-YaQrdkGE.js → index-CQ6ORxI_.js} +31 -30
- package/dist/index-Cq1I1cG9.js +129 -0
- package/dist/index-Cs8Lv8Wj.js +13 -0
- package/dist/{index-dRxIWVBr.js → index-DmCJ8fIR.js} +6 -5
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/{index-g-TFwd6Y.js → index-ObZsP5Eh.js} +2 -1
- package/dist/{index-DvFiic6N.js → index-Ud3-A7-K.js} +95 -101
- package/dist/{index-G_6jG4Qc.js → index-Y44iCJcQ.js} +18 -18
- package/dist/index-tIydFizp.js +83 -0
- package/dist/{index-AM3avohj.js → index-xPmNHv1y.js} +3 -3
- package/dist/index.d.ts +72 -13
- package/dist/index.js +78 -72
- package/dist/package.json +25 -22
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +263 -0
- package/dist/ui/kubefirst-theme.css +1 -1
- package/dist/ui/theme.css +11 -0
- package/dist/ui/utilities.css +11 -2
- package/dist/utils/index.js +3 -3
- package/package.json +25 -22
- package/dist/index-BOx5P4tS.js +0 -423
- package/dist/index-Bk324h27.js +0 -82
- package/dist/index-CWKdynYu.js +0 -32
- package/dist/index-bYyfdsls.js +0 -118
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { c as K, b as I, a as L } from "./index-Cq1I1cG9.js";
|
|
3
|
+
import { c as ce } from "./index-B-qIIQlg.js";
|
|
4
|
+
import { u as ie } from "./index-tIydFizp.js";
|
|
5
|
+
import { u as O } from "./index-Cs8Lv8Wj.js";
|
|
6
|
+
import { P as C } from "./index-ObZsP5Eh.js";
|
|
7
|
+
import { u as ue } from "./index-DwYXX2sM.js";
|
|
8
|
+
import { u as k } from "./index-BdMNhZnh.js";
|
|
9
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
10
|
+
import { P as le } from "./index-Y44iCJcQ.js";
|
|
11
|
+
var N = "rovingFocusGroup.onEntryFocus", de = { bubbles: !1, cancelable: !0 }, h = "RovingFocusGroup", [D, V, fe] = ce(h), [ve, U] = K(
|
|
12
|
+
h,
|
|
13
|
+
[fe]
|
|
14
|
+
), [me, pe] = ve(h), B = s.forwardRef(
|
|
15
|
+
(e, o) => /* @__PURE__ */ l(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ l(be, { ...e, ref: o }) }) })
|
|
16
|
+
);
|
|
17
|
+
B.displayName = h;
|
|
18
|
+
var be = s.forwardRef((e, o) => {
|
|
19
|
+
const {
|
|
20
|
+
__scopeRovingFocusGroup: n,
|
|
21
|
+
orientation: t,
|
|
22
|
+
loop: u = !1,
|
|
23
|
+
dir: d,
|
|
24
|
+
currentTabStopId: a,
|
|
25
|
+
defaultCurrentTabStopId: v,
|
|
26
|
+
onCurrentTabStopIdChange: g,
|
|
27
|
+
onEntryFocus: m,
|
|
28
|
+
preventScrollOnEntryFocus: r = !1,
|
|
29
|
+
...c
|
|
30
|
+
} = e, p = s.useRef(null), E = ie(o, p), w = k(d), [S, i] = L({
|
|
31
|
+
prop: a,
|
|
32
|
+
defaultProp: v ?? null,
|
|
33
|
+
onChange: g,
|
|
34
|
+
caller: h
|
|
35
|
+
}), [T, A] = s.useState(!1), b = ue(m), F = V(n), y = s.useRef(!1), [oe, M] = s.useState(0);
|
|
36
|
+
return s.useEffect(() => {
|
|
37
|
+
const f = p.current;
|
|
38
|
+
if (f)
|
|
39
|
+
return f.addEventListener(N, b), () => f.removeEventListener(N, b);
|
|
40
|
+
}, [b]), /* @__PURE__ */ l(
|
|
41
|
+
me,
|
|
42
|
+
{
|
|
43
|
+
scope: n,
|
|
44
|
+
orientation: t,
|
|
45
|
+
dir: w,
|
|
46
|
+
loop: u,
|
|
47
|
+
currentTabStopId: S,
|
|
48
|
+
onItemFocus: s.useCallback(
|
|
49
|
+
(f) => i(f),
|
|
50
|
+
[i]
|
|
51
|
+
),
|
|
52
|
+
onItemShiftTab: s.useCallback(() => A(!0), []),
|
|
53
|
+
onFocusableItemAdd: s.useCallback(
|
|
54
|
+
() => M((f) => f + 1),
|
|
55
|
+
[]
|
|
56
|
+
),
|
|
57
|
+
onFocusableItemRemove: s.useCallback(
|
|
58
|
+
() => M((f) => f - 1),
|
|
59
|
+
[]
|
|
60
|
+
),
|
|
61
|
+
children: /* @__PURE__ */ l(
|
|
62
|
+
C.div,
|
|
63
|
+
{
|
|
64
|
+
tabIndex: T || oe === 0 ? -1 : 0,
|
|
65
|
+
"data-orientation": t,
|
|
66
|
+
...c,
|
|
67
|
+
ref: E,
|
|
68
|
+
style: { outline: "none", ...e.style },
|
|
69
|
+
onMouseDown: I(e.onMouseDown, () => {
|
|
70
|
+
y.current = !0;
|
|
71
|
+
}),
|
|
72
|
+
onFocus: I(e.onFocus, (f) => {
|
|
73
|
+
const re = !y.current;
|
|
74
|
+
if (f.target === f.currentTarget && re && !T) {
|
|
75
|
+
const G = new CustomEvent(N, de);
|
|
76
|
+
if (f.currentTarget.dispatchEvent(G), !G.defaultPrevented) {
|
|
77
|
+
const P = F().filter((R) => R.focusable), ne = P.find((R) => R.active), ae = P.find((R) => R.id === S), se = [ne, ae, ...P].filter(
|
|
78
|
+
Boolean
|
|
79
|
+
).map((R) => R.ref.current);
|
|
80
|
+
z(se, r);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
y.current = !1;
|
|
84
|
+
}),
|
|
85
|
+
onBlur: I(e.onBlur, () => A(!1))
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}), $ = "RovingFocusGroupItem", Y = s.forwardRef(
|
|
91
|
+
(e, o) => {
|
|
92
|
+
const {
|
|
93
|
+
__scopeRovingFocusGroup: n,
|
|
94
|
+
focusable: t = !0,
|
|
95
|
+
active: u = !1,
|
|
96
|
+
tabStopId: d,
|
|
97
|
+
children: a,
|
|
98
|
+
...v
|
|
99
|
+
} = e, g = O(), m = d || g, r = pe($, n), c = r.currentTabStopId === m, p = V(n), { onFocusableItemAdd: E, onFocusableItemRemove: w, currentTabStopId: S } = r;
|
|
100
|
+
return s.useEffect(() => {
|
|
101
|
+
if (t)
|
|
102
|
+
return E(), () => w();
|
|
103
|
+
}, [t, E, w]), /* @__PURE__ */ l(
|
|
104
|
+
D.ItemSlot,
|
|
105
|
+
{
|
|
106
|
+
scope: n,
|
|
107
|
+
id: m,
|
|
108
|
+
focusable: t,
|
|
109
|
+
active: u,
|
|
110
|
+
children: /* @__PURE__ */ l(
|
|
111
|
+
C.span,
|
|
112
|
+
{
|
|
113
|
+
tabIndex: c ? 0 : -1,
|
|
114
|
+
"data-orientation": r.orientation,
|
|
115
|
+
...v,
|
|
116
|
+
ref: o,
|
|
117
|
+
onMouseDown: I(e.onMouseDown, (i) => {
|
|
118
|
+
t ? r.onItemFocus(m) : i.preventDefault();
|
|
119
|
+
}),
|
|
120
|
+
onFocus: I(e.onFocus, () => r.onItemFocus(m)),
|
|
121
|
+
onKeyDown: I(e.onKeyDown, (i) => {
|
|
122
|
+
if (i.key === "Tab" && i.shiftKey) {
|
|
123
|
+
r.onItemShiftTab();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (i.target !== i.currentTarget) return;
|
|
127
|
+
const T = Te(i, r.orientation, r.dir);
|
|
128
|
+
if (T !== void 0) {
|
|
129
|
+
if (i.metaKey || i.ctrlKey || i.altKey || i.shiftKey) return;
|
|
130
|
+
i.preventDefault();
|
|
131
|
+
let b = p().filter((F) => F.focusable).map((F) => F.ref.current);
|
|
132
|
+
if (T === "last") b.reverse();
|
|
133
|
+
else if (T === "prev" || T === "next") {
|
|
134
|
+
T === "prev" && b.reverse();
|
|
135
|
+
const F = b.indexOf(i.currentTarget);
|
|
136
|
+
b = r.loop ? Fe(b, F + 1) : b.slice(F + 1);
|
|
137
|
+
}
|
|
138
|
+
setTimeout(() => z(b));
|
|
139
|
+
}
|
|
140
|
+
}),
|
|
141
|
+
children: typeof a == "function" ? a({ isCurrentTabStop: c, hasTabStop: S != null }) : a
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
Y.displayName = $;
|
|
149
|
+
var ge = {
|
|
150
|
+
ArrowLeft: "prev",
|
|
151
|
+
ArrowUp: "prev",
|
|
152
|
+
ArrowRight: "next",
|
|
153
|
+
ArrowDown: "next",
|
|
154
|
+
PageUp: "first",
|
|
155
|
+
Home: "first",
|
|
156
|
+
PageDown: "last",
|
|
157
|
+
End: "last"
|
|
158
|
+
};
|
|
159
|
+
function Ie(e, o) {
|
|
160
|
+
return o !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
161
|
+
}
|
|
162
|
+
function Te(e, o, n) {
|
|
163
|
+
const t = Ie(e.key, n);
|
|
164
|
+
if (!(o === "vertical" && ["ArrowLeft", "ArrowRight"].includes(t)) && !(o === "horizontal" && ["ArrowUp", "ArrowDown"].includes(t)))
|
|
165
|
+
return ge[t];
|
|
166
|
+
}
|
|
167
|
+
function z(e, o = !1) {
|
|
168
|
+
const n = document.activeElement;
|
|
169
|
+
for (const t of e)
|
|
170
|
+
if (t === n || (t.focus({ preventScroll: o }), document.activeElement !== n)) return;
|
|
171
|
+
}
|
|
172
|
+
function Fe(e, o) {
|
|
173
|
+
return e.map((n, t) => e[(o + t) % e.length]);
|
|
174
|
+
}
|
|
175
|
+
var Re = B, Ce = Y, _ = "Tabs", [he, Ge] = K(_, [
|
|
176
|
+
U
|
|
177
|
+
]), H = U(), [Ee, x] = he(_), j = s.forwardRef(
|
|
178
|
+
(e, o) => {
|
|
179
|
+
const {
|
|
180
|
+
__scopeTabs: n,
|
|
181
|
+
value: t,
|
|
182
|
+
onValueChange: u,
|
|
183
|
+
defaultValue: d,
|
|
184
|
+
orientation: a = "horizontal",
|
|
185
|
+
dir: v,
|
|
186
|
+
activationMode: g = "automatic",
|
|
187
|
+
...m
|
|
188
|
+
} = e, r = k(v), [c, p] = L({
|
|
189
|
+
prop: t,
|
|
190
|
+
onChange: u,
|
|
191
|
+
defaultProp: d ?? "",
|
|
192
|
+
caller: _
|
|
193
|
+
});
|
|
194
|
+
return /* @__PURE__ */ l(
|
|
195
|
+
Ee,
|
|
196
|
+
{
|
|
197
|
+
scope: n,
|
|
198
|
+
baseId: O(),
|
|
199
|
+
value: c,
|
|
200
|
+
onValueChange: p,
|
|
201
|
+
orientation: a,
|
|
202
|
+
dir: r,
|
|
203
|
+
activationMode: g,
|
|
204
|
+
children: /* @__PURE__ */ l(
|
|
205
|
+
C.div,
|
|
206
|
+
{
|
|
207
|
+
dir: r,
|
|
208
|
+
"data-orientation": a,
|
|
209
|
+
...m,
|
|
210
|
+
ref: o
|
|
211
|
+
}
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
j.displayName = _;
|
|
218
|
+
var q = "TabsList", J = s.forwardRef(
|
|
219
|
+
(e, o) => {
|
|
220
|
+
const { __scopeTabs: n, loop: t = !0, ...u } = e, d = x(q, n), a = H(n);
|
|
221
|
+
return /* @__PURE__ */ l(
|
|
222
|
+
Re,
|
|
223
|
+
{
|
|
224
|
+
asChild: !0,
|
|
225
|
+
...a,
|
|
226
|
+
orientation: d.orientation,
|
|
227
|
+
dir: d.dir,
|
|
228
|
+
loop: t,
|
|
229
|
+
children: /* @__PURE__ */ l(
|
|
230
|
+
C.div,
|
|
231
|
+
{
|
|
232
|
+
role: "tablist",
|
|
233
|
+
"aria-orientation": d.orientation,
|
|
234
|
+
...u,
|
|
235
|
+
ref: o
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
J.displayName = q;
|
|
243
|
+
var Q = "TabsTrigger", W = s.forwardRef(
|
|
244
|
+
(e, o) => {
|
|
245
|
+
const { __scopeTabs: n, value: t, disabled: u = !1, ...d } = e, a = x(Q, n), v = H(n), g = ee(a.baseId, t), m = te(a.baseId, t), r = t === a.value;
|
|
246
|
+
return /* @__PURE__ */ l(
|
|
247
|
+
Ce,
|
|
248
|
+
{
|
|
249
|
+
asChild: !0,
|
|
250
|
+
...v,
|
|
251
|
+
focusable: !u,
|
|
252
|
+
active: r,
|
|
253
|
+
children: /* @__PURE__ */ l(
|
|
254
|
+
C.button,
|
|
255
|
+
{
|
|
256
|
+
type: "button",
|
|
257
|
+
role: "tab",
|
|
258
|
+
"aria-selected": r,
|
|
259
|
+
"aria-controls": m,
|
|
260
|
+
"data-state": r ? "active" : "inactive",
|
|
261
|
+
"data-disabled": u ? "" : void 0,
|
|
262
|
+
disabled: u,
|
|
263
|
+
id: g,
|
|
264
|
+
...d,
|
|
265
|
+
ref: o,
|
|
266
|
+
onMouseDown: I(e.onMouseDown, (c) => {
|
|
267
|
+
!u && c.button === 0 && c.ctrlKey === !1 ? a.onValueChange(t) : c.preventDefault();
|
|
268
|
+
}),
|
|
269
|
+
onKeyDown: I(e.onKeyDown, (c) => {
|
|
270
|
+
[" ", "Enter"].includes(c.key) && a.onValueChange(t);
|
|
271
|
+
}),
|
|
272
|
+
onFocus: I(e.onFocus, () => {
|
|
273
|
+
const c = a.activationMode !== "manual";
|
|
274
|
+
!r && !u && c && a.onValueChange(t);
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
W.displayName = Q;
|
|
283
|
+
var X = "TabsContent", Z = s.forwardRef(
|
|
284
|
+
(e, o) => {
|
|
285
|
+
const { __scopeTabs: n, value: t, forceMount: u, children: d, ...a } = e, v = x(X, n), g = ee(v.baseId, t), m = te(v.baseId, t), r = t === v.value, c = s.useRef(r);
|
|
286
|
+
return s.useEffect(() => {
|
|
287
|
+
const p = requestAnimationFrame(() => c.current = !1);
|
|
288
|
+
return () => cancelAnimationFrame(p);
|
|
289
|
+
}, []), /* @__PURE__ */ l(le, { present: u || r, children: ({ present: p }) => /* @__PURE__ */ l(
|
|
290
|
+
C.div,
|
|
291
|
+
{
|
|
292
|
+
"data-state": r ? "active" : "inactive",
|
|
293
|
+
"data-orientation": v.orientation,
|
|
294
|
+
role: "tabpanel",
|
|
295
|
+
"aria-labelledby": g,
|
|
296
|
+
hidden: !p,
|
|
297
|
+
id: m,
|
|
298
|
+
tabIndex: 0,
|
|
299
|
+
...a,
|
|
300
|
+
ref: o,
|
|
301
|
+
style: {
|
|
302
|
+
...e.style,
|
|
303
|
+
animationDuration: c.current ? "0s" : void 0
|
|
304
|
+
},
|
|
305
|
+
children: p && d
|
|
306
|
+
}
|
|
307
|
+
) });
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
Z.displayName = X;
|
|
311
|
+
function ee(e, o) {
|
|
312
|
+
return `${e}-trigger-${o}`;
|
|
313
|
+
}
|
|
314
|
+
function te(e, o) {
|
|
315
|
+
return `${e}-content-${o}`;
|
|
316
|
+
}
|
|
317
|
+
var Ke = j, Le = J, Oe = W, ke = Z;
|
|
318
|
+
export {
|
|
319
|
+
ke as C,
|
|
320
|
+
Le as L,
|
|
321
|
+
Ke as R,
|
|
322
|
+
Oe as T
|
|
323
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { P as m, d as z, R as H } from "./index-
|
|
4
|
-
import { u as T } from "./index-
|
|
2
|
+
import { b as h, u as U } from "./index-Cq1I1cG9.js";
|
|
3
|
+
import { P as m, d as z, R as H } from "./index-ObZsP5Eh.js";
|
|
4
|
+
import { u as T } from "./index-tIydFizp.js";
|
|
5
|
+
import { u as b } from "./index-DwYXX2sM.js";
|
|
5
6
|
import { jsx as P } from "react/jsx-runtime";
|
|
6
7
|
function K(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
7
8
|
const s = b(r);
|
|
@@ -22,19 +23,19 @@ var j = "DismissableLayer", p = "dismissableLayer.update", X = "dismissableLayer
|
|
|
22
23
|
disableOutsidePointerEvents: s = !1,
|
|
23
24
|
onEscapeKeyDown: n,
|
|
24
25
|
onPointerDownOutside: t,
|
|
25
|
-
onFocusOutside:
|
|
26
|
+
onFocusOutside: o,
|
|
26
27
|
onInteractOutside: l,
|
|
27
28
|
onDismiss: u,
|
|
28
29
|
...v
|
|
29
|
-
} = r, c = i.useContext(B), [d, N] = i.useState(null), f = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = i.useState({}), W = T(e, (
|
|
30
|
-
const E =
|
|
31
|
-
!C || R || (t == null || t(
|
|
32
|
-
}, f), O = J((
|
|
33
|
-
const E =
|
|
34
|
-
[...c.branches].some((y) => y.contains(E)) || (
|
|
30
|
+
} = r, c = i.useContext(B), [d, N] = i.useState(null), f = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = i.useState({}), W = T(e, (a) => N(a)), D = Array.from(c.layers), [k] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), I = D.indexOf(k), L = d ? D.indexOf(d) : -1, _ = c.layersWithOutsidePointerEventsDisabled.size > 0, C = L >= I, M = G((a) => {
|
|
31
|
+
const E = a.target, R = [...c.branches].some((y) => y.contains(E));
|
|
32
|
+
!C || R || (t == null || t(a), l == null || l(a), a.defaultPrevented || u == null || u());
|
|
33
|
+
}, f), O = J((a) => {
|
|
34
|
+
const E = a.target;
|
|
35
|
+
[...c.branches].some((y) => y.contains(E)) || (o == null || o(a), l == null || l(a), a.defaultPrevented || u == null || u());
|
|
35
36
|
}, f);
|
|
36
|
-
return K((
|
|
37
|
-
L === c.layers.size - 1 && (n == null || n(
|
|
37
|
+
return K((a) => {
|
|
38
|
+
L === c.layers.size - 1 && (n == null || n(a), !a.defaultPrevented && u && (a.preventDefault(), u()));
|
|
38
39
|
}, f), i.useEffect(() => {
|
|
39
40
|
if (d)
|
|
40
41
|
return s && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (g = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), w(), () => {
|
|
@@ -43,8 +44,8 @@ var j = "DismissableLayer", p = "dismissableLayer.update", X = "dismissableLayer
|
|
|
43
44
|
}, [d, f, s, c]), i.useEffect(() => () => {
|
|
44
45
|
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), w());
|
|
45
46
|
}, [d, c]), i.useEffect(() => {
|
|
46
|
-
const
|
|
47
|
-
return document.addEventListener(p,
|
|
47
|
+
const a = () => F({});
|
|
48
|
+
return document.addEventListener(p, a), () => document.removeEventListener(p, a);
|
|
48
49
|
}, []), /* @__PURE__ */ P(
|
|
49
50
|
m.div,
|
|
50
51
|
{
|
|
@@ -68,10 +69,10 @@ x.displayName = j;
|
|
|
68
69
|
var q = "DismissableLayerBranch", S = i.forwardRef((r, e) => {
|
|
69
70
|
const s = i.useContext(B), n = i.useRef(null), t = T(e, n);
|
|
70
71
|
return i.useEffect(() => {
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
return s.branches.add(
|
|
74
|
-
s.branches.delete(
|
|
72
|
+
const o = n.current;
|
|
73
|
+
if (o)
|
|
74
|
+
return s.branches.add(o), () => {
|
|
75
|
+
s.branches.delete(o);
|
|
75
76
|
};
|
|
76
77
|
}, [s.branches]), /* @__PURE__ */ P(m.div, { ...r, ref: t });
|
|
77
78
|
});
|
|
@@ -80,7 +81,7 @@ function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
|
80
81
|
const s = b(r), n = i.useRef(!1), t = i.useRef(() => {
|
|
81
82
|
});
|
|
82
83
|
return i.useEffect(() => {
|
|
83
|
-
const
|
|
84
|
+
const o = (u) => {
|
|
84
85
|
if (u.target && !n.current) {
|
|
85
86
|
let v = function() {
|
|
86
87
|
A(
|
|
@@ -96,10 +97,10 @@ function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
|
96
97
|
e.removeEventListener("click", t.current);
|
|
97
98
|
n.current = !1;
|
|
98
99
|
}, l = window.setTimeout(() => {
|
|
99
|
-
e.addEventListener("pointerdown",
|
|
100
|
+
e.addEventListener("pointerdown", o);
|
|
100
101
|
}, 0);
|
|
101
102
|
return () => {
|
|
102
|
-
window.clearTimeout(l), e.removeEventListener("pointerdown",
|
|
103
|
+
window.clearTimeout(l), e.removeEventListener("pointerdown", o), e.removeEventListener("click", t.current);
|
|
103
104
|
};
|
|
104
105
|
}, [e, s]), {
|
|
105
106
|
// ensures we check React component tree (not just DOM tree)
|
|
@@ -109,8 +110,8 @@ function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
|
109
110
|
function J(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
110
111
|
const s = b(r), n = i.useRef(!1);
|
|
111
112
|
return i.useEffect(() => {
|
|
112
|
-
const t = (
|
|
113
|
-
|
|
113
|
+
const t = (o) => {
|
|
114
|
+
o.target && !n.current && A(Y, s, { originalEvent: o }, {
|
|
114
115
|
discrete: !1
|
|
115
116
|
});
|
|
116
117
|
};
|
|
@@ -125,20 +126,20 @@ function w() {
|
|
|
125
126
|
document.dispatchEvent(r);
|
|
126
127
|
}
|
|
127
128
|
function A(r, e, s, { discrete: n }) {
|
|
128
|
-
const t = s.originalEvent.target,
|
|
129
|
-
e && t.addEventListener(r, e, { once: !0 }), n ? z(t,
|
|
129
|
+
const t = s.originalEvent.target, o = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: s });
|
|
130
|
+
e && t.addEventListener(r, e, { once: !0 }), n ? z(t, o) : t.dispatchEvent(o);
|
|
130
131
|
}
|
|
131
|
-
var
|
|
132
|
+
var ne = x, re = S, Q = "Portal", V = i.forwardRef((r, e) => {
|
|
132
133
|
var u;
|
|
133
|
-
const { container: s, ...n } = r, [t,
|
|
134
|
-
U(() =>
|
|
134
|
+
const { container: s, ...n } = r, [t, o] = i.useState(!1);
|
|
135
|
+
U(() => o(!0), []);
|
|
135
136
|
const l = s || t && ((u = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : u.body);
|
|
136
137
|
return l ? H.createPortal(/* @__PURE__ */ P(m.div, { ...n, ref: e }), l) : null;
|
|
137
138
|
});
|
|
138
139
|
V.displayName = Q;
|
|
139
140
|
export {
|
|
140
|
-
|
|
141
|
+
re as B,
|
|
141
142
|
x as D,
|
|
142
143
|
V as P,
|
|
143
|
-
|
|
144
|
+
ne as R
|
|
144
145
|
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
function M(t, r) {
|
|
4
|
+
const o = u.createContext(r), i = (c) => {
|
|
5
|
+
const { children: e, ...n } = c, f = u.useMemo(() => n, Object.values(n));
|
|
6
|
+
return /* @__PURE__ */ h(o.Provider, { value: f, children: e });
|
|
7
|
+
};
|
|
8
|
+
i.displayName = t + "Provider";
|
|
9
|
+
function s(c) {
|
|
10
|
+
const e = u.useContext(o);
|
|
11
|
+
if (e) return e;
|
|
12
|
+
if (r !== void 0) return r;
|
|
13
|
+
throw new Error(`\`${c}\` must be used within \`${t}\``);
|
|
14
|
+
}
|
|
15
|
+
return [i, s];
|
|
16
|
+
}
|
|
17
|
+
function R(t, r = []) {
|
|
18
|
+
let o = [];
|
|
19
|
+
function i(c, e) {
|
|
20
|
+
const n = u.createContext(e), f = o.length;
|
|
21
|
+
o = [...o, e];
|
|
22
|
+
const m = (l) => {
|
|
23
|
+
var S;
|
|
24
|
+
const { scope: a, children: v, ...x } = l, C = ((S = a == null ? void 0 : a[t]) == null ? void 0 : S[f]) || n, P = u.useMemo(() => x, Object.values(x));
|
|
25
|
+
return /* @__PURE__ */ h(C.Provider, { value: P, children: v });
|
|
26
|
+
};
|
|
27
|
+
m.displayName = c + "Provider";
|
|
28
|
+
function d(l, a) {
|
|
29
|
+
var C;
|
|
30
|
+
const v = ((C = a == null ? void 0 : a[t]) == null ? void 0 : C[f]) || n, x = u.useContext(v);
|
|
31
|
+
if (x) return x;
|
|
32
|
+
if (e !== void 0) return e;
|
|
33
|
+
throw new Error(`\`${l}\` must be used within \`${c}\``);
|
|
34
|
+
}
|
|
35
|
+
return [m, d];
|
|
36
|
+
}
|
|
37
|
+
const s = () => {
|
|
38
|
+
const c = o.map((e) => u.createContext(e));
|
|
39
|
+
return function(n) {
|
|
40
|
+
const f = (n == null ? void 0 : n[t]) || c;
|
|
41
|
+
return u.useMemo(
|
|
42
|
+
() => ({ [`__scope${t}`]: { ...n, [t]: f } }),
|
|
43
|
+
[n, f]
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return s.scopeName = t, [i, b(s, ...r)];
|
|
48
|
+
}
|
|
49
|
+
function b(...t) {
|
|
50
|
+
const r = t[0];
|
|
51
|
+
if (t.length === 1) return r;
|
|
52
|
+
const o = () => {
|
|
53
|
+
const i = t.map((s) => ({
|
|
54
|
+
useScope: s(),
|
|
55
|
+
scopeName: s.scopeName
|
|
56
|
+
}));
|
|
57
|
+
return function(c) {
|
|
58
|
+
const e = i.reduce((n, { useScope: f, scopeName: m }) => {
|
|
59
|
+
const l = f(c)[`__scope${m}`];
|
|
60
|
+
return { ...n, ...l };
|
|
61
|
+
}, {});
|
|
62
|
+
return u.useMemo(() => ({ [`__scope${r.scopeName}`]: e }), [e]);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return o.scopeName = r.scopeName, o;
|
|
66
|
+
}
|
|
67
|
+
function j(t, r, { checkForDefaultPrevented: o = !0 } = {}) {
|
|
68
|
+
return function(s) {
|
|
69
|
+
if (t == null || t(s), o === !1 || !s.defaultPrevented)
|
|
70
|
+
return r == null ? void 0 : r(s);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var p = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
|
|
74
|
+
}, w = u[" useInsertionEffect ".trim().toString()] || p;
|
|
75
|
+
function k({
|
|
76
|
+
prop: t,
|
|
77
|
+
defaultProp: r,
|
|
78
|
+
onChange: o = () => {
|
|
79
|
+
},
|
|
80
|
+
caller: i
|
|
81
|
+
}) {
|
|
82
|
+
const [s, c, e] = $({
|
|
83
|
+
defaultProp: r,
|
|
84
|
+
onChange: o
|
|
85
|
+
}), n = t !== void 0, f = n ? t : s;
|
|
86
|
+
{
|
|
87
|
+
const d = u.useRef(t !== void 0);
|
|
88
|
+
u.useEffect(() => {
|
|
89
|
+
const l = d.current;
|
|
90
|
+
l !== n && console.warn(
|
|
91
|
+
`${i} is changing from ${l ? "controlled" : "uncontrolled"} to ${n ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
92
|
+
), d.current = n;
|
|
93
|
+
}, [n, i]);
|
|
94
|
+
}
|
|
95
|
+
const m = u.useCallback(
|
|
96
|
+
(d) => {
|
|
97
|
+
var l;
|
|
98
|
+
if (n) {
|
|
99
|
+
const a = _(d) ? d(t) : d;
|
|
100
|
+
a !== t && ((l = e.current) == null || l.call(e, a));
|
|
101
|
+
} else
|
|
102
|
+
c(d);
|
|
103
|
+
},
|
|
104
|
+
[n, t, c, e]
|
|
105
|
+
);
|
|
106
|
+
return [f, m];
|
|
107
|
+
}
|
|
108
|
+
function $({
|
|
109
|
+
defaultProp: t,
|
|
110
|
+
onChange: r
|
|
111
|
+
}) {
|
|
112
|
+
const [o, i] = u.useState(t), s = u.useRef(o), c = u.useRef(r);
|
|
113
|
+
return w(() => {
|
|
114
|
+
c.current = r;
|
|
115
|
+
}, [r]), u.useEffect(() => {
|
|
116
|
+
var e;
|
|
117
|
+
s.current !== o && ((e = c.current) == null || e.call(c, o), s.current = o);
|
|
118
|
+
}, [o, s]), [o, i, c];
|
|
119
|
+
}
|
|
120
|
+
function _(t) {
|
|
121
|
+
return typeof t == "function";
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
k as a,
|
|
125
|
+
j as b,
|
|
126
|
+
R as c,
|
|
127
|
+
M as d,
|
|
128
|
+
p as u
|
|
129
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { u as a } from "./index-Cq1I1cG9.js";
|
|
3
|
+
var s = r[" useId ".trim().toString()] || (() => {
|
|
4
|
+
}), i = 0;
|
|
5
|
+
function n(e) {
|
|
6
|
+
const [t, o] = r.useState(s());
|
|
7
|
+
return a(() => {
|
|
8
|
+
o((u) => u ?? String(i++));
|
|
9
|
+
}, [e]), t ? `radix-${t}` : "";
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as u
|
|
13
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as Ee, P as ke, O as Se, C as Ie } from "./index-Ud3-A7-K.js";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { P as C } from "./index-
|
|
4
|
-
import {
|
|
3
|
+
import { P as C } from "./index-ObZsP5Eh.js";
|
|
4
|
+
import { u as P } from "./index-Cs8Lv8Wj.js";
|
|
5
|
+
import { a as j } from "./index-tIydFizp.js";
|
|
5
6
|
var de = 1, xe = 0.9, Re = 0.8, Ce = 0.17, Q = 0.1, Z = 0.999, Ae = 0.9999, Me = 0.99, $e = /[\\\/_+.#"@\[\(\{&]/, De = /[\\\/_+.#"@\[\(\{&]/g, Fe = /[\s-]/, me = /[\s-]/g;
|
|
6
7
|
function ee(t, l, r, f, u, c, d) {
|
|
7
8
|
if (c === l.length) return u === t.length ? de : Me;
|
|
@@ -248,7 +249,7 @@ var V = '[cmdk-group=""]', _ = '[cmdk-group-items=""]', Pe = '[cmdk-group-headin
|
|
|
248
249
|
}), Ue = n.forwardRef((t, l) => R((r) => r.filtered.count === 0) ? n.createElement(C.div, { ref: l, ...t, "cmdk-empty": "", role: "presentation" }) : null), He = n.forwardRef((t, l) => {
|
|
249
250
|
let { progress: r, children: f, label: u = "Loading...", ...c } = t;
|
|
250
251
|
return n.createElement(C.div, { ref: l, ...c, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": u }, z(t, (d) => n.createElement("div", { "aria-hidden": !0 }, d)));
|
|
251
|
-
}),
|
|
252
|
+
}), _e = Object.assign(be, { List: Be, Item: Ve, Input: Oe, Group: je, Separator: Le, Dialog: ze, Empty: Ue, Loading: He });
|
|
252
253
|
function Ne(t, l) {
|
|
253
254
|
let r = t.nextElementSibling;
|
|
254
255
|
for (; r; ) {
|
|
@@ -309,5 +310,5 @@ function z({ asChild: t, children: l }, r) {
|
|
|
309
310
|
}
|
|
310
311
|
var Je = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
311
312
|
export {
|
|
312
|
-
|
|
313
|
+
_e as _
|
|
313
314
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
function n(t) {
|
|
3
|
+
const e = r.useRef(t);
|
|
4
|
+
return r.useEffect(() => {
|
|
5
|
+
e.current = t;
|
|
6
|
+
}), r.useMemo(() => (...s) => {
|
|
7
|
+
var u;
|
|
8
|
+
return (u = e.current) == null ? void 0 : u.call(e, ...s);
|
|
9
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
n as u
|
|
13
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as D from "react";
|
|
2
2
|
import R from "react";
|
|
3
3
|
import { g as b } from "./_commonjsHelpers-C6fGbg64.js";
|
|
4
|
-
import { c as w } from "./index-
|
|
4
|
+
import { c as w } from "./index-tIydFizp.js";
|
|
5
5
|
import { jsx as N } from "react/jsx-runtime";
|
|
6
6
|
var v = { exports: {} }, u = {};
|
|
7
7
|
/**
|
|
@@ -401,6 +401,7 @@ var P = [
|
|
|
401
401
|
"nav",
|
|
402
402
|
"ol",
|
|
403
403
|
"p",
|
|
404
|
+
"select",
|
|
404
405
|
"span",
|
|
405
406
|
"svg",
|
|
406
407
|
"ul"
|