@konstructio/ui 0.0.12-alpha.2 → 0.0.12-alpha.21
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/{Modal-DZUwNzSW.js → Modal-B-E9uaA6.js} +354 -346
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Autocomplete/Autocomplete.variants.js +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +18 -15
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Command/Command.js +32 -0
- package/dist/components/Command/Command.variants.js +97 -0
- package/dist/components/Command/components/Command.js +8 -0
- package/dist/components/Command/components/CommandEmpty.js +15 -0
- package/dist/components/Command/components/CommandGroup.js +19 -0
- package/dist/components/Command/components/CommandInput.js +84 -0
- package/dist/components/Command/components/CommandItem.js +29 -0
- package/dist/components/Command/components/CommandList.js +16 -0
- package/dist/components/Command/components/CommandSeparator.js +16 -0
- package/dist/components/Command/components/CommandShortcut.js +19 -0
- package/dist/components/Command/components/DialogContent.js +31 -0
- package/dist/components/Command/components/DialogOverlay.js +19 -0
- package/dist/components/Command/components/index.js +20 -0
- package/dist/components/Command/contexts/Command.context.js +13 -0
- package/dist/components/Command/contexts/Command.provider.js +24 -0
- package/dist/components/Command/contexts/index.js +6 -0
- package/dist/components/Dropdown/Dropdown.js +6 -6
- package/dist/components/Dropdown/Dropdown.variants.js +22 -3
- package/dist/components/Dropdown/components/List/List.js +42 -16
- package/dist/components/Dropdown/components/List/List.variants.js +7 -5
- package/dist/components/Dropdown/components/ListItem/ListItem.js +26 -21
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +6 -4
- package/dist/components/Dropdown/components/Wrapper.js +97 -63
- package/dist/components/Dropdown/contexts/dropdown.context.js +1 -1
- package/dist/components/Dropdown/contexts/dropdown.provider.js +9 -9
- package/dist/components/Input/Input.js +112 -67
- package/dist/components/Input/Input.variants.js +5 -6
- package/dist/components/Loading/Loading.js +102 -21
- package/dist/components/Loading/Loading.variants.js +13 -14
- package/dist/components/Modal/Modal.js +3 -3
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +88 -88
- package/dist/components/NumberInput/NumberInput.variants.js +23 -19
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -1
- package/dist/components/Sidebar/components/Logo/Logo.variants.js +9 -17
- package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +2 -2
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +6 -5
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +99 -101
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Table/Table.js +31 -0
- package/dist/components/Table/Table.variants.js +78 -0
- package/dist/components/Table/components/Body.js +28 -0
- package/dist/components/Table/components/Filter.js +9 -0
- package/dist/components/Table/components/Head.js +28 -0
- package/dist/components/Table/components/Row.js +34 -0
- package/dist/components/Tag/Tag.js +17 -5
- package/dist/components/Tag/Tag.variants.js +11 -1
- package/dist/components/TagSelect/TagSelect.js +6 -71
- package/dist/components/TagSelect/TagSelect.variants.js +29 -50
- package/dist/components/TagSelect/components/Item/Item.js +23 -0
- package/dist/components/TagSelect/components/Item/Item.variants.js +31 -0
- package/dist/components/TagSelect/components/List/List.js +13 -0
- package/dist/components/TagSelect/components/List/List.variants.js +37 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +88 -0
- package/dist/components/TagSelect/components/index.js +8 -0
- package/dist/components/TagSelect/contexts/TagSelect.context.js +19 -0
- package/dist/components/TagSelect/contexts/TagSelect.hook.js +11 -0
- package/dist/components/TagSelect/contexts/TagSelect.provider.js +69 -0
- package/dist/components/TagSelect/contexts/index.js +6 -0
- package/dist/components/TagSelect/hooks/useTagSelect.js +22 -27
- package/dist/components/TextArea/TextArea.js +28 -22
- package/dist/components/TextArea/TextArea.variants.js +0 -1
- package/dist/components/Toast/Toast.js +141 -128
- package/dist/components/Toast/Toast.variants.js +2 -3
- package/dist/components/Typography/Typography.js +23 -22
- package/dist/components/Typography/Typography.variants.js +49 -22
- package/dist/components/index.js +22 -20
- package/dist/{index-C6WtlN_F.js → index-BzaHYXkt.js} +1 -1
- package/dist/{index-Z1voPZOH.js → index-CbTU3cnP.js} +1 -1
- package/dist/index-CzSBQN5S.js +432 -0
- package/dist/index-D7QNmo_D.js +422 -0
- package/dist/index-DUA6Y_AE.js +126 -0
- package/dist/{index-B33at13_.js → index-D_76wh4w.js} +1 -1
- package/dist/index-DyKo5ZJT.js +446 -0
- package/dist/index.d.ts +85 -17
- package/dist/index.js +18 -16
- package/dist/package.json +26 -24
- package/dist/styles.css +1 -1
- package/dist/utils/index.js +320 -322
- package/package.json +26 -24
- package/dist/index-3jTPaVvh.js +0 -551
- package/dist/index-BTeAm7mx.js +0 -19133
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { u as Ee, d as j, a as he, c as ye, b as _, e as De } from "./index-Cva-e5M4.js";
|
|
3
|
+
import { u as S, S as be } from "./index-B_6_jmOO.js";
|
|
4
|
+
import { P as Ce, D as Ae } from "./index-D_76wh4w.js";
|
|
5
|
+
import { P as N } from "./index-D7QNmo_D.js";
|
|
6
|
+
import { jsx as f, jsxs as q, Fragment as B } from "react/jsx-runtime";
|
|
7
|
+
import { P as W } from "./index-Dj1pom3_.js";
|
|
8
|
+
import { R as Re } from "./Combination-b348x__d.js";
|
|
9
|
+
var Ne = i.useId || (() => {
|
|
10
|
+
}), Oe = 0;
|
|
11
|
+
function M(e) {
|
|
12
|
+
const [n, t] = i.useState(Ne());
|
|
13
|
+
return Ee(() => {
|
|
14
|
+
t((o) => o ?? String(Oe++));
|
|
15
|
+
}, [e]), n ? `radix-${n}` : "";
|
|
16
|
+
}
|
|
17
|
+
var x = "focusScope.autoFocusOnMount", w = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, _e = "FocusScope", Q = i.forwardRef((e, n) => {
|
|
18
|
+
const {
|
|
19
|
+
loop: t = !1,
|
|
20
|
+
trapped: o = !1,
|
|
21
|
+
onMountAutoFocus: a,
|
|
22
|
+
onUnmountAutoFocus: r,
|
|
23
|
+
...c
|
|
24
|
+
} = e, [s, g] = i.useState(null), m = j(a), h = j(r), u = i.useRef(null), d = S(n, (l) => g(l)), p = i.useRef({
|
|
25
|
+
paused: !1,
|
|
26
|
+
pause() {
|
|
27
|
+
this.paused = !0;
|
|
28
|
+
},
|
|
29
|
+
resume() {
|
|
30
|
+
this.paused = !1;
|
|
31
|
+
}
|
|
32
|
+
}).current;
|
|
33
|
+
i.useEffect(() => {
|
|
34
|
+
if (o) {
|
|
35
|
+
let l = function(D) {
|
|
36
|
+
if (p.paused || !s) return;
|
|
37
|
+
const y = D.target;
|
|
38
|
+
s.contains(y) ? u.current = y : C(u.current, { select: !0 });
|
|
39
|
+
}, b = function(D) {
|
|
40
|
+
if (p.paused || !s) return;
|
|
41
|
+
const y = D.relatedTarget;
|
|
42
|
+
y !== null && (s.contains(y) || C(u.current, { select: !0 }));
|
|
43
|
+
}, v = function(D) {
|
|
44
|
+
if (document.activeElement === document.body)
|
|
45
|
+
for (const H of D)
|
|
46
|
+
H.removedNodes.length > 0 && C(s);
|
|
47
|
+
};
|
|
48
|
+
document.addEventListener("focusin", l), document.addEventListener("focusout", b);
|
|
49
|
+
const O = new MutationObserver(v);
|
|
50
|
+
return s && O.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
51
|
+
document.removeEventListener("focusin", l), document.removeEventListener("focusout", b), O.disconnect();
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}, [o, s, p.paused]), i.useEffect(() => {
|
|
55
|
+
if (s) {
|
|
56
|
+
Z.add(p);
|
|
57
|
+
const l = document.activeElement;
|
|
58
|
+
if (!s.contains(l)) {
|
|
59
|
+
const v = new CustomEvent(x, V);
|
|
60
|
+
s.addEventListener(x, m), s.dispatchEvent(v), v.defaultPrevented || (Ie(Me(X(s)), { select: !0 }), document.activeElement === l && C(s));
|
|
61
|
+
}
|
|
62
|
+
return () => {
|
|
63
|
+
s.removeEventListener(x, m), setTimeout(() => {
|
|
64
|
+
const v = new CustomEvent(w, V);
|
|
65
|
+
s.addEventListener(w, h), s.dispatchEvent(v), v.defaultPrevented || C(l ?? document.body, { select: !0 }), s.removeEventListener(w, h), Z.remove(p);
|
|
66
|
+
}, 0);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}, [s, m, h, p]);
|
|
70
|
+
const I = i.useCallback(
|
|
71
|
+
(l) => {
|
|
72
|
+
if (!t && !o || p.paused) return;
|
|
73
|
+
const b = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, v = document.activeElement;
|
|
74
|
+
if (b && v) {
|
|
75
|
+
const O = l.currentTarget, [D, y] = Pe(O);
|
|
76
|
+
D && y ? !l.shiftKey && v === y ? (l.preventDefault(), t && C(D, { select: !0 })) : l.shiftKey && v === D && (l.preventDefault(), t && C(y, { select: !0 })) : v === O && l.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
[t, o, p.paused]
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ f(N.div, { tabIndex: -1, ...c, ref: d, onKeyDown: I });
|
|
82
|
+
});
|
|
83
|
+
Q.displayName = _e;
|
|
84
|
+
function Ie(e, { select: n = !1 } = {}) {
|
|
85
|
+
const t = document.activeElement;
|
|
86
|
+
for (const o of e)
|
|
87
|
+
if (C(o, { select: n }), document.activeElement !== t) return;
|
|
88
|
+
}
|
|
89
|
+
function Pe(e) {
|
|
90
|
+
const n = X(e), t = Y(n, e), o = Y(n.reverse(), e);
|
|
91
|
+
return [t, o];
|
|
92
|
+
}
|
|
93
|
+
function X(e) {
|
|
94
|
+
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
95
|
+
acceptNode: (o) => {
|
|
96
|
+
const a = o.tagName === "INPUT" && o.type === "hidden";
|
|
97
|
+
return o.disabled || o.hidden || a ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
for (; t.nextNode(); ) n.push(t.currentNode);
|
|
101
|
+
return n;
|
|
102
|
+
}
|
|
103
|
+
function Y(e, n) {
|
|
104
|
+
for (const t of e)
|
|
105
|
+
if (!Te(t, { upTo: n })) return t;
|
|
106
|
+
}
|
|
107
|
+
function Te(e, { upTo: n }) {
|
|
108
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
109
|
+
for (; e; ) {
|
|
110
|
+
if (n !== void 0 && e === n) return !1;
|
|
111
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
112
|
+
e = e.parentElement;
|
|
113
|
+
}
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
function Fe(e) {
|
|
117
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
118
|
+
}
|
|
119
|
+
function C(e, { select: n = !1 } = {}) {
|
|
120
|
+
if (e && e.focus) {
|
|
121
|
+
const t = document.activeElement;
|
|
122
|
+
e.focus({ preventScroll: !0 }), e !== t && Fe(e) && n && e.select();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var Z = Se();
|
|
126
|
+
function Se() {
|
|
127
|
+
let e = [];
|
|
128
|
+
return {
|
|
129
|
+
add(n) {
|
|
130
|
+
const t = e[0];
|
|
131
|
+
n !== t && (t == null || t.pause()), e = z(e, n), e.unshift(n);
|
|
132
|
+
},
|
|
133
|
+
remove(n) {
|
|
134
|
+
var t;
|
|
135
|
+
e = z(e, n), (t = e[0]) == null || t.resume();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function z(e, n) {
|
|
140
|
+
const t = [...e], o = t.indexOf(n);
|
|
141
|
+
return o !== -1 && t.splice(o, 1), t;
|
|
142
|
+
}
|
|
143
|
+
function Me(e) {
|
|
144
|
+
return e.filter((n) => n.tagName !== "A");
|
|
145
|
+
}
|
|
146
|
+
var L = 0;
|
|
147
|
+
function xe() {
|
|
148
|
+
i.useEffect(() => {
|
|
149
|
+
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
150
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), L++, () => {
|
|
151
|
+
L === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), L--;
|
|
152
|
+
};
|
|
153
|
+
}, []);
|
|
154
|
+
}
|
|
155
|
+
function J() {
|
|
156
|
+
const e = document.createElement("span");
|
|
157
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
158
|
+
}
|
|
159
|
+
var we = function(e) {
|
|
160
|
+
if (typeof document > "u")
|
|
161
|
+
return null;
|
|
162
|
+
var n = Array.isArray(e) ? e[0] : e;
|
|
163
|
+
return n.ownerDocument.body;
|
|
164
|
+
}, R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), T = {}, k = 0, ee = function(e) {
|
|
165
|
+
return e && (e.host || ee(e.parentNode));
|
|
166
|
+
}, Le = function(e, n) {
|
|
167
|
+
return n.map(function(t) {
|
|
168
|
+
if (e.contains(t))
|
|
169
|
+
return t;
|
|
170
|
+
var o = ee(t);
|
|
171
|
+
return o && e.contains(o) ? o : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
172
|
+
}).filter(function(t) {
|
|
173
|
+
return !!t;
|
|
174
|
+
});
|
|
175
|
+
}, ke = function(e, n, t, o) {
|
|
176
|
+
var a = Le(n, Array.isArray(e) ? e : [e]);
|
|
177
|
+
T[t] || (T[t] = /* @__PURE__ */ new WeakMap());
|
|
178
|
+
var r = T[t], c = [], s = /* @__PURE__ */ new Set(), g = new Set(a), m = function(u) {
|
|
179
|
+
!u || s.has(u) || (s.add(u), m(u.parentNode));
|
|
180
|
+
};
|
|
181
|
+
a.forEach(m);
|
|
182
|
+
var h = function(u) {
|
|
183
|
+
!u || g.has(u) || Array.prototype.forEach.call(u.children, function(d) {
|
|
184
|
+
if (s.has(d))
|
|
185
|
+
h(d);
|
|
186
|
+
else
|
|
187
|
+
try {
|
|
188
|
+
var p = d.getAttribute(o), I = p !== null && p !== "false", l = (R.get(d) || 0) + 1, b = (r.get(d) || 0) + 1;
|
|
189
|
+
R.set(d, l), r.set(d, b), c.push(d), l === 1 && I && P.set(d, !0), b === 1 && d.setAttribute(t, "true"), I || d.setAttribute(o, "true");
|
|
190
|
+
} catch (v) {
|
|
191
|
+
console.error("aria-hidden: cannot operate on ", d, v);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
return h(n), s.clear(), k++, function() {
|
|
196
|
+
c.forEach(function(u) {
|
|
197
|
+
var d = R.get(u) - 1, p = r.get(u) - 1;
|
|
198
|
+
R.set(u, d), r.set(u, p), d || (P.has(u) || u.removeAttribute(o), P.delete(u)), p || u.removeAttribute(t);
|
|
199
|
+
}), k--, k || (R = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), T = {});
|
|
200
|
+
};
|
|
201
|
+
}, We = function(e, n, t) {
|
|
202
|
+
t === void 0 && (t = "data-aria-hidden");
|
|
203
|
+
var o = Array.from(Array.isArray(e) ? e : [e]), a = we(e);
|
|
204
|
+
return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live]"))), ke(o, a, t, "aria-hidden")) : function() {
|
|
205
|
+
return null;
|
|
206
|
+
};
|
|
207
|
+
}, U = "Dialog", [te, et] = ye(U), [Ue, E] = te(U), ne = (e) => {
|
|
208
|
+
const {
|
|
209
|
+
__scopeDialog: n,
|
|
210
|
+
children: t,
|
|
211
|
+
open: o,
|
|
212
|
+
defaultOpen: a,
|
|
213
|
+
onOpenChange: r,
|
|
214
|
+
modal: c = !0
|
|
215
|
+
} = e, s = i.useRef(null), g = i.useRef(null), [m = !1, h] = he({
|
|
216
|
+
prop: o,
|
|
217
|
+
defaultProp: a,
|
|
218
|
+
onChange: r
|
|
219
|
+
});
|
|
220
|
+
return /* @__PURE__ */ f(
|
|
221
|
+
Ue,
|
|
222
|
+
{
|
|
223
|
+
scope: n,
|
|
224
|
+
triggerRef: s,
|
|
225
|
+
contentRef: g,
|
|
226
|
+
contentId: M(),
|
|
227
|
+
titleId: M(),
|
|
228
|
+
descriptionId: M(),
|
|
229
|
+
open: m,
|
|
230
|
+
onOpenChange: h,
|
|
231
|
+
onOpenToggle: i.useCallback(() => h((u) => !u), [h]),
|
|
232
|
+
modal: c,
|
|
233
|
+
children: t
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
ne.displayName = U;
|
|
238
|
+
var oe = "DialogTrigger", re = i.forwardRef(
|
|
239
|
+
(e, n) => {
|
|
240
|
+
const { __scopeDialog: t, ...o } = e, a = E(oe, t), r = S(n, a.triggerRef);
|
|
241
|
+
return /* @__PURE__ */ f(
|
|
242
|
+
N.button,
|
|
243
|
+
{
|
|
244
|
+
type: "button",
|
|
245
|
+
"aria-haspopup": "dialog",
|
|
246
|
+
"aria-expanded": a.open,
|
|
247
|
+
"aria-controls": a.contentId,
|
|
248
|
+
"data-state": $(a.open),
|
|
249
|
+
...o,
|
|
250
|
+
ref: r,
|
|
251
|
+
onClick: _(e.onClick, a.onOpenToggle)
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
re.displayName = oe;
|
|
257
|
+
var K = "DialogPortal", [Ke, ae] = te(K, {
|
|
258
|
+
forceMount: void 0
|
|
259
|
+
}), se = (e) => {
|
|
260
|
+
const { __scopeDialog: n, forceMount: t, children: o, container: a } = e, r = E(K, n);
|
|
261
|
+
return /* @__PURE__ */ f(Ke, { scope: n, forceMount: t, children: i.Children.map(o, (c) => /* @__PURE__ */ f(W, { present: t || r.open, children: /* @__PURE__ */ f(Ce, { asChild: !0, container: a, children: c }) })) });
|
|
262
|
+
};
|
|
263
|
+
se.displayName = K;
|
|
264
|
+
var F = "DialogOverlay", ie = i.forwardRef(
|
|
265
|
+
(e, n) => {
|
|
266
|
+
const t = ae(F, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = E(F, e.__scopeDialog);
|
|
267
|
+
return r.modal ? /* @__PURE__ */ f(W, { present: o || r.open, children: /* @__PURE__ */ f(Ge, { ...a, ref: n }) }) : null;
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
ie.displayName = F;
|
|
271
|
+
var Ge = i.forwardRef(
|
|
272
|
+
(e, n) => {
|
|
273
|
+
const { __scopeDialog: t, ...o } = e, a = E(F, t);
|
|
274
|
+
return (
|
|
275
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
276
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
277
|
+
/* @__PURE__ */ f(Re, { as: be, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ f(
|
|
278
|
+
N.div,
|
|
279
|
+
{
|
|
280
|
+
"data-state": $(a.open),
|
|
281
|
+
...o,
|
|
282
|
+
ref: n,
|
|
283
|
+
style: { pointerEvents: "auto", ...o.style }
|
|
284
|
+
}
|
|
285
|
+
) })
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
), A = "DialogContent", ce = i.forwardRef(
|
|
289
|
+
(e, n) => {
|
|
290
|
+
const t = ae(A, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = E(A, e.__scopeDialog);
|
|
291
|
+
return /* @__PURE__ */ f(W, { present: o || r.open, children: r.modal ? /* @__PURE__ */ f($e, { ...a, ref: n }) : /* @__PURE__ */ f(He, { ...a, ref: n }) });
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
ce.displayName = A;
|
|
295
|
+
var $e = i.forwardRef(
|
|
296
|
+
(e, n) => {
|
|
297
|
+
const t = E(A, e.__scopeDialog), o = i.useRef(null), a = S(n, t.contentRef, o);
|
|
298
|
+
return i.useEffect(() => {
|
|
299
|
+
const r = o.current;
|
|
300
|
+
if (r) return We(r);
|
|
301
|
+
}, []), /* @__PURE__ */ f(
|
|
302
|
+
ue,
|
|
303
|
+
{
|
|
304
|
+
...e,
|
|
305
|
+
ref: a,
|
|
306
|
+
trapFocus: t.open,
|
|
307
|
+
disableOutsidePointerEvents: !0,
|
|
308
|
+
onCloseAutoFocus: _(e.onCloseAutoFocus, (r) => {
|
|
309
|
+
var c;
|
|
310
|
+
r.preventDefault(), (c = t.triggerRef.current) == null || c.focus();
|
|
311
|
+
}),
|
|
312
|
+
onPointerDownOutside: _(e.onPointerDownOutside, (r) => {
|
|
313
|
+
const c = r.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
|
|
314
|
+
(c.button === 2 || s) && r.preventDefault();
|
|
315
|
+
}),
|
|
316
|
+
onFocusOutside: _(
|
|
317
|
+
e.onFocusOutside,
|
|
318
|
+
(r) => r.preventDefault()
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
), He = i.forwardRef(
|
|
324
|
+
(e, n) => {
|
|
325
|
+
const t = E(A, e.__scopeDialog), o = i.useRef(!1), a = i.useRef(!1);
|
|
326
|
+
return /* @__PURE__ */ f(
|
|
327
|
+
ue,
|
|
328
|
+
{
|
|
329
|
+
...e,
|
|
330
|
+
ref: n,
|
|
331
|
+
trapFocus: !1,
|
|
332
|
+
disableOutsidePointerEvents: !1,
|
|
333
|
+
onCloseAutoFocus: (r) => {
|
|
334
|
+
var c, s;
|
|
335
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, r), r.defaultPrevented || (o.current || (s = t.triggerRef.current) == null || s.focus(), r.preventDefault()), o.current = !1, a.current = !1;
|
|
336
|
+
},
|
|
337
|
+
onInteractOutside: (r) => {
|
|
338
|
+
var g, m;
|
|
339
|
+
(g = e.onInteractOutside) == null || g.call(e, r), r.defaultPrevented || (o.current = !0, r.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
340
|
+
const c = r.target;
|
|
341
|
+
((m = t.triggerRef.current) == null ? void 0 : m.contains(c)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && a.current && r.preventDefault();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
), ue = i.forwardRef(
|
|
347
|
+
(e, n) => {
|
|
348
|
+
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: r, ...c } = e, s = E(A, t), g = i.useRef(null), m = S(n, g);
|
|
349
|
+
return xe(), /* @__PURE__ */ q(B, { children: [
|
|
350
|
+
/* @__PURE__ */ f(
|
|
351
|
+
Q,
|
|
352
|
+
{
|
|
353
|
+
asChild: !0,
|
|
354
|
+
loop: !0,
|
|
355
|
+
trapped: o,
|
|
356
|
+
onMountAutoFocus: a,
|
|
357
|
+
onUnmountAutoFocus: r,
|
|
358
|
+
children: /* @__PURE__ */ f(
|
|
359
|
+
Ae,
|
|
360
|
+
{
|
|
361
|
+
role: "dialog",
|
|
362
|
+
id: s.contentId,
|
|
363
|
+
"aria-describedby": s.descriptionId,
|
|
364
|
+
"aria-labelledby": s.titleId,
|
|
365
|
+
"data-state": $(s.open),
|
|
366
|
+
...c,
|
|
367
|
+
ref: m,
|
|
368
|
+
onDismiss: () => s.onOpenChange(!1)
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ q(B, { children: [
|
|
374
|
+
/* @__PURE__ */ f(je, { titleId: s.titleId }),
|
|
375
|
+
/* @__PURE__ */ f(Be, { contentRef: g, descriptionId: s.descriptionId })
|
|
376
|
+
] })
|
|
377
|
+
] });
|
|
378
|
+
}
|
|
379
|
+
), G = "DialogTitle", le = i.forwardRef(
|
|
380
|
+
(e, n) => {
|
|
381
|
+
const { __scopeDialog: t, ...o } = e, a = E(G, t);
|
|
382
|
+
return /* @__PURE__ */ f(N.h2, { id: a.titleId, ...o, ref: n });
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
le.displayName = G;
|
|
386
|
+
var fe = "DialogDescription", de = i.forwardRef(
|
|
387
|
+
(e, n) => {
|
|
388
|
+
const { __scopeDialog: t, ...o } = e, a = E(fe, t);
|
|
389
|
+
return /* @__PURE__ */ f(N.p, { id: a.descriptionId, ...o, ref: n });
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
de.displayName = fe;
|
|
393
|
+
var pe = "DialogClose", ve = i.forwardRef(
|
|
394
|
+
(e, n) => {
|
|
395
|
+
const { __scopeDialog: t, ...o } = e, a = E(pe, t);
|
|
396
|
+
return /* @__PURE__ */ f(
|
|
397
|
+
N.button,
|
|
398
|
+
{
|
|
399
|
+
type: "button",
|
|
400
|
+
...o,
|
|
401
|
+
ref: n,
|
|
402
|
+
onClick: _(e.onClick, () => a.onOpenChange(!1))
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
);
|
|
407
|
+
ve.displayName = pe;
|
|
408
|
+
function $(e) {
|
|
409
|
+
return e ? "open" : "closed";
|
|
410
|
+
}
|
|
411
|
+
var me = "DialogTitleWarning", [tt, ge] = De(me, {
|
|
412
|
+
contentName: A,
|
|
413
|
+
titleName: G,
|
|
414
|
+
docsSlug: "dialog"
|
|
415
|
+
}), je = ({ titleId: e }) => {
|
|
416
|
+
const n = ge(me), t = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
417
|
+
|
|
418
|
+
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
419
|
+
|
|
420
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;
|
|
421
|
+
return i.useEffect(() => {
|
|
422
|
+
e && (document.getElementById(e) || console.error(t));
|
|
423
|
+
}, [t, e]), null;
|
|
424
|
+
}, qe = "DialogDescriptionWarning", Be = ({ contentRef: e, descriptionId: n }) => {
|
|
425
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge(qe).contentName}}.`;
|
|
426
|
+
return i.useEffect(() => {
|
|
427
|
+
var r;
|
|
428
|
+
const a = (r = e.current) == null ? void 0 : r.getAttribute("aria-describedby");
|
|
429
|
+
n && a && (document.getElementById(n) || console.warn(o));
|
|
430
|
+
}, [o, e, n]), null;
|
|
431
|
+
}, nt = ne, ot = re, rt = se, at = ie, st = ce, it = le, ct = de, ut = ve;
|
|
432
|
+
export {
|
|
433
|
+
st as C,
|
|
434
|
+
le as D,
|
|
435
|
+
at as O,
|
|
436
|
+
rt as P,
|
|
437
|
+
nt as R,
|
|
438
|
+
it as T,
|
|
439
|
+
tt as W,
|
|
440
|
+
se as a,
|
|
441
|
+
ut as b,
|
|
442
|
+
et as c,
|
|
443
|
+
ct as d,
|
|
444
|
+
ot as e,
|
|
445
|
+
M as u
|
|
446
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,13 @@ declare const autocompleteVariants: (props?: ({
|
|
|
65
65
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
66
66
|
} & ClassProp) | undefined) => string;
|
|
67
67
|
|
|
68
|
+
declare interface BodyProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof bodyVariants> {
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare const bodyVariants: (props?: ({
|
|
72
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
73
|
+
} & ClassProp) | undefined) => string;
|
|
74
|
+
|
|
68
75
|
export declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
69
76
|
|
|
70
77
|
declare interface BreadcrumbProps extends VariantProps<typeof breadcrumbVariants>, HTMLAttributes<HTMLOListElement> {
|
|
@@ -134,19 +141,28 @@ export declare const Divider: FunctionComponent<HTMLAttributes<HTMLDivElement>>;
|
|
|
134
141
|
|
|
135
142
|
export declare const Dropdown: FC<DropdownProps>;
|
|
136
143
|
|
|
137
|
-
declare interface DropdownProps extends VariantProps<typeof dropdownVariants> {
|
|
138
|
-
|
|
144
|
+
declare interface DropdownProps extends VariantProps<typeof dropdownVariants>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {
|
|
145
|
+
onChange?: ({ target: { value, name }, }: {
|
|
146
|
+
target: {
|
|
147
|
+
value: string;
|
|
148
|
+
name: string;
|
|
149
|
+
};
|
|
150
|
+
}) => void;
|
|
139
151
|
label?: string;
|
|
140
|
-
name?: string;
|
|
141
152
|
options: Option_3[];
|
|
142
|
-
|
|
143
|
-
|
|
153
|
+
labelClassName?: string;
|
|
154
|
+
value?: string;
|
|
155
|
+
isLoading?: boolean;
|
|
144
156
|
}
|
|
145
157
|
|
|
146
158
|
declare const dropdownVariants: (props?: ({
|
|
147
159
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
148
160
|
} & ClassProp) | undefined) => string;
|
|
149
161
|
|
|
162
|
+
declare interface FilterProps extends React.InputHTMLAttributes<HTMLInputElement>, PropsWithChildren {
|
|
163
|
+
placeholder?: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
150
166
|
export declare const Footer: FC<FooterProps>;
|
|
151
167
|
|
|
152
168
|
declare interface FooterProps extends PropsWithChildren, VariantProps<typeof footerVariants> {
|
|
@@ -157,13 +173,21 @@ declare const footerVariants: (props?: ({
|
|
|
157
173
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
158
174
|
} & ClassProp) | undefined) => string;
|
|
159
175
|
|
|
176
|
+
declare type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
177
|
+
|
|
178
|
+
declare interface HeadProps extends React.HTMLAttributes<HTMLTableSectionElement>, PropsWithChildren, VariantProps<typeof headVariants> {
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare const headVariants: (props?: ({
|
|
182
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
183
|
+
} & ClassProp) | undefined) => string;
|
|
184
|
+
|
|
160
185
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
161
186
|
|
|
162
187
|
declare interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
163
|
-
label?: string;
|
|
188
|
+
label?: string | ReactNode;
|
|
164
189
|
labelClassName?: string;
|
|
165
190
|
error?: string;
|
|
166
|
-
onClickIcon?: () => void;
|
|
167
191
|
}
|
|
168
192
|
|
|
169
193
|
declare const inputVariants: (props?: ({
|
|
@@ -178,11 +202,9 @@ export declare const konstructPlugin: {
|
|
|
178
202
|
|
|
179
203
|
export declare const Loading: FunctionComponent<LoadingProps>;
|
|
180
204
|
|
|
181
|
-
declare
|
|
182
|
-
}
|
|
205
|
+
declare type LoadingProps = InputHTMLAttributes<SVGSVGElement> & VariantProps<typeof loadingVariants>;
|
|
183
206
|
|
|
184
207
|
declare const loadingVariants: (props?: ({
|
|
185
|
-
variant?: "default" | null | undefined;
|
|
186
208
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
187
209
|
} & ClassProp) | undefined) => string;
|
|
188
210
|
|
|
@@ -211,6 +233,8 @@ declare type ModalChildProps = {
|
|
|
211
233
|
declare interface ModalProps extends PropsWithChildren, VariantProps<typeof modalVariants> {
|
|
212
234
|
className?: string;
|
|
213
235
|
buttonCloseClassName?: string;
|
|
236
|
+
isOpen?: boolean;
|
|
237
|
+
onClose?: () => void;
|
|
214
238
|
}
|
|
215
239
|
|
|
216
240
|
declare const modalVariants: (props?: ({
|
|
@@ -292,11 +316,16 @@ export declare const NumberInput: FC<NumberInputProps>;
|
|
|
292
316
|
declare interface NumberInputProps extends VariantProps<typeof numberInputVariants> {
|
|
293
317
|
className?: string;
|
|
294
318
|
init?: number;
|
|
295
|
-
label?: string;
|
|
319
|
+
label?: string | ReactNode;
|
|
296
320
|
max?: number;
|
|
297
321
|
min?: number;
|
|
298
322
|
name?: string;
|
|
299
|
-
|
|
323
|
+
value?: number;
|
|
324
|
+
onChange?: ({ target: { value } }: {
|
|
325
|
+
target: {
|
|
326
|
+
value: number;
|
|
327
|
+
};
|
|
328
|
+
}) => void;
|
|
300
329
|
}
|
|
301
330
|
|
|
302
331
|
declare const numberInputVariants: (props?: ({
|
|
@@ -399,6 +428,17 @@ declare const rangeVariants: (props?: ({
|
|
|
399
428
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
400
429
|
} & ClassProp) | undefined) => string;
|
|
401
430
|
|
|
431
|
+
declare interface RowProps extends React.HTMLAttributes<HTMLTableRowElement>, PropsWithChildren, VariantProps<typeof rowVariants> {
|
|
432
|
+
width?: string;
|
|
433
|
+
isSelected?: boolean;
|
|
434
|
+
onSelect?: () => void;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
declare const rowVariants: (props?: ({
|
|
438
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
439
|
+
isSelected?: boolean | null | undefined;
|
|
440
|
+
} & ClassProp) | undefined) => string;
|
|
441
|
+
|
|
402
442
|
export declare const Sidebar: FC<SidebarProps> & SidebarChildrenProps;
|
|
403
443
|
|
|
404
444
|
declare type SidebarChildrenProps = {
|
|
@@ -446,21 +486,43 @@ export declare const Switch: FC<SwitchProps>;
|
|
|
446
486
|
declare interface SwitchProps extends VariantProps<typeof switchVariants> {
|
|
447
487
|
alignment?: 'horizontal' | 'vertical';
|
|
448
488
|
className?: string;
|
|
449
|
-
defaultChecked?: boolean;
|
|
450
489
|
label?: string;
|
|
451
490
|
name?: string;
|
|
452
491
|
thumbClassName?: string;
|
|
492
|
+
onChange?: (e: boolean) => void;
|
|
493
|
+
value?: boolean;
|
|
494
|
+
defaultChecked?: boolean;
|
|
453
495
|
}
|
|
454
496
|
|
|
455
497
|
declare const switchVariants: (props?: ({
|
|
456
498
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
457
499
|
} & ClassProp) | undefined) => string;
|
|
458
500
|
|
|
501
|
+
export declare const Table: FunctionComponent<TableProps> & {
|
|
502
|
+
Head: FunctionComponent<HeadProps>;
|
|
503
|
+
Row: FunctionComponent<RowProps>;
|
|
504
|
+
Filter: FunctionComponent<FilterProps>;
|
|
505
|
+
Body: FunctionComponent<BodyProps>;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
declare interface TableProps extends React.HTMLAttributes<HTMLTableElement>, PropsWithChildren, VariantProps<typeof tableVariants> {
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
declare const tableVariants: (props?: ({
|
|
512
|
+
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
513
|
+
} & ClassProp) | undefined) => string;
|
|
514
|
+
|
|
459
515
|
export declare const Tag: FC<TagProps>;
|
|
460
516
|
|
|
461
517
|
declare type TagProps = {
|
|
462
|
-
label: string;
|
|
463
518
|
color?: 'gray' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
|
|
519
|
+
id: string | number;
|
|
520
|
+
label: string;
|
|
521
|
+
rightIcon?: ReactNode;
|
|
522
|
+
leftIcon?: ReactNode;
|
|
523
|
+
className?: string;
|
|
524
|
+
'data-value'?: string;
|
|
525
|
+
isSelected?: boolean;
|
|
464
526
|
};
|
|
465
527
|
|
|
466
528
|
export declare const TagSelect: FC<TagSelectProps>;
|
|
@@ -470,6 +532,9 @@ declare interface TagSelectProps extends VariantProps<typeof tagSelectVariants>
|
|
|
470
532
|
options: TagProps[];
|
|
471
533
|
name?: string;
|
|
472
534
|
placeholder?: string;
|
|
535
|
+
labelClassName?: string;
|
|
536
|
+
wrapperClassName?: string;
|
|
537
|
+
multiselect?: boolean;
|
|
473
538
|
}
|
|
474
539
|
|
|
475
540
|
declare const tagSelectVariants: (props?: ({
|
|
@@ -480,10 +545,9 @@ export declare const TextArea: FC<TextAreaProps>;
|
|
|
480
545
|
|
|
481
546
|
declare interface TextAreaProps extends InputHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textAreaVariants> {
|
|
482
547
|
rows?: number;
|
|
483
|
-
label?: string;
|
|
548
|
+
label?: string | ReactNode;
|
|
484
549
|
name?: string;
|
|
485
550
|
initialValue?: string;
|
|
486
|
-
onChange?: () => void;
|
|
487
551
|
}
|
|
488
552
|
|
|
489
553
|
declare const textAreaVariants: (props?: ({
|
|
@@ -520,6 +584,9 @@ declare interface ToastProps extends PropsWithChildren, VariantProps<typeof toas
|
|
|
520
584
|
showCloseButton?: boolean;
|
|
521
585
|
title: string | ReactNode;
|
|
522
586
|
titleClassName?: string;
|
|
587
|
+
open: boolean;
|
|
588
|
+
setOpen: (open: boolean) => void;
|
|
589
|
+
closeButtonClassName?: string;
|
|
523
590
|
}
|
|
524
591
|
|
|
525
592
|
declare const toastVariants: (props?: ({
|
|
@@ -542,7 +609,8 @@ declare const tooltipVariants: (props?: ({
|
|
|
542
609
|
export declare const Typography: FunctionComponent<TypographyProps>;
|
|
543
610
|
|
|
544
611
|
declare interface TypographyProps extends InputHTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
|
|
545
|
-
children:
|
|
612
|
+
children: ReactNode;
|
|
613
|
+
component?: HeadingTag | 'p' | 'span';
|
|
546
614
|
}
|
|
547
615
|
|
|
548
616
|
declare const typographyVariants: (props?: ({
|