@konstructio/ui 0.0.12-alpha.2 → 0.0.12-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/{Modal-DZUwNzSW.js → Modal-ByNiP7eb.js} +3 -3
- 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/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/Loading/Loading.js +102 -21
- package/dist/components/Loading/Loading.variants.js +13 -14
- package/dist/components/Modal/Modal.js +2 -2
- 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/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- 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/Toast/Toast.js +3 -3
- package/dist/components/Typography/Typography.js +23 -22
- package/dist/components/Typography/Typography.variants.js +49 -22
- package/dist/components/index.js +1 -1
- 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 +15 -5
- package/dist/index.js +1 -1
- package/dist/package.json +17 -13
- package/dist/styles.css +1 -1
- package/package.json +16 -13
- 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
|
@@ -157,6 +157,8 @@ declare const footerVariants: (props?: ({
|
|
|
157
157
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
158
158
|
} & ClassProp) | undefined) => string;
|
|
159
159
|
|
|
160
|
+
declare type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
161
|
+
|
|
160
162
|
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
161
163
|
|
|
162
164
|
declare interface InputProps extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
@@ -178,11 +180,9 @@ export declare const konstructPlugin: {
|
|
|
178
180
|
|
|
179
181
|
export declare const Loading: FunctionComponent<LoadingProps>;
|
|
180
182
|
|
|
181
|
-
declare
|
|
182
|
-
}
|
|
183
|
+
declare type LoadingProps = InputHTMLAttributes<SVGSVGElement> & VariantProps<typeof loadingVariants>;
|
|
183
184
|
|
|
184
185
|
declare const loadingVariants: (props?: ({
|
|
185
|
-
variant?: "default" | null | undefined;
|
|
186
186
|
theme?: "kubefirst" | "colony" | "civo" | null | undefined;
|
|
187
187
|
} & ClassProp) | undefined) => string;
|
|
188
188
|
|
|
@@ -459,8 +459,14 @@ declare const switchVariants: (props?: ({
|
|
|
459
459
|
export declare const Tag: FC<TagProps>;
|
|
460
460
|
|
|
461
461
|
declare type TagProps = {
|
|
462
|
-
label: string;
|
|
463
462
|
color?: 'gray' | 'cyan' | 'gold' | 'green' | 'light blue' | 'lime' | 'pink' | 'purple' | 'emerald' | 'fuscia' | 'indigo' | 'light-orange' | 'dark-sky-blue' | 'mistery';
|
|
463
|
+
id: string | number;
|
|
464
|
+
label: string;
|
|
465
|
+
rightIcon?: ReactNode;
|
|
466
|
+
leftIcon?: ReactNode;
|
|
467
|
+
className?: string;
|
|
468
|
+
'data-value'?: string;
|
|
469
|
+
isSelected?: boolean;
|
|
464
470
|
};
|
|
465
471
|
|
|
466
472
|
export declare const TagSelect: FC<TagSelectProps>;
|
|
@@ -470,6 +476,9 @@ declare interface TagSelectProps extends VariantProps<typeof tagSelectVariants>
|
|
|
470
476
|
options: TagProps[];
|
|
471
477
|
name?: string;
|
|
472
478
|
placeholder?: string;
|
|
479
|
+
labelClassName?: string;
|
|
480
|
+
wrapperClassName?: string;
|
|
481
|
+
multiselect?: boolean;
|
|
473
482
|
}
|
|
474
483
|
|
|
475
484
|
declare const tagSelectVariants: (props?: ({
|
|
@@ -542,7 +551,8 @@ declare const tooltipVariants: (props?: ({
|
|
|
542
551
|
export declare const Typography: FunctionComponent<TypographyProps>;
|
|
543
552
|
|
|
544
553
|
declare interface TypographyProps extends InputHTMLAttributes<HTMLParagraphElement>, VariantProps<typeof typographyVariants> {
|
|
545
|
-
children:
|
|
554
|
+
children: ReactNode;
|
|
555
|
+
component?: HeadingTag | 'p' | 'span';
|
|
546
556
|
}
|
|
547
557
|
|
|
548
558
|
declare const typographyVariants: (props?: ({
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Card as n } from "./components/Card/Card.js";
|
|
|
7
7
|
import { Checkbox as l } from "./components/Checkbox/Checkbox.js";
|
|
8
8
|
import { Dropdown as s } from "./components/Dropdown/Dropdown.js";
|
|
9
9
|
import { Input as h } from "./components/Input/Input.js";
|
|
10
|
-
import { M as C } from "./Modal-
|
|
10
|
+
import { M as C } from "./Modal-ByNiP7eb.js";
|
|
11
11
|
import { NumberInput as R } from "./components/NumberInput/NumberInput.js";
|
|
12
12
|
import { ProgressBar as b } from "./components/ProgressBar/ProgressBar.js";
|
|
13
13
|
import { Radio as B } from "./components/Radio/Radio.js";
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.12-alpha.
|
|
5
|
+
"version": "0.0.12-alpha.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"build:storybook": "storybook build -o storybook-static && cp -r public/* storybook-static",
|
|
44
44
|
"check:prettier": "prettier lib --check --config ./.prettierrc",
|
|
45
45
|
"check:types": "tsc -p tsconfig.json",
|
|
46
|
-
"ci": "npm run
|
|
46
|
+
"ci": "npm run check:prettier && vitest run && npm run build",
|
|
47
47
|
"deps:update": "npx npm-check-updates --interactive --format group",
|
|
48
48
|
"format:prettier": "prettier lib --write './**/*.{js,jsx,ts,tsx}' --config ./.prettierrc",
|
|
49
49
|
"lint": "eslint lib --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
@@ -57,14 +57,18 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@radix-ui/react-alert-dialog": "^1.1.6",
|
|
59
59
|
"@radix-ui/react-checkbox": "^1.1.4",
|
|
60
|
+
"@radix-ui/react-dialog": "^1.1.5",
|
|
60
61
|
"@radix-ui/react-slider": "^1.2.3",
|
|
61
62
|
"@radix-ui/react-slot": "^1.1.2",
|
|
62
63
|
"@radix-ui/react-switch": "^1.1.3",
|
|
63
64
|
"@radix-ui/react-toast": "^1.2.6",
|
|
64
65
|
"@radix-ui/react-visually-hidden": "^1.1.2",
|
|
66
|
+
"@radix-ui/react-dialog": "^1.1.6",
|
|
65
67
|
"class-variance-authority": "^0.7.1",
|
|
66
68
|
"clsx": "^2.1.1",
|
|
69
|
+
"cmdk": "^1.0.4",
|
|
67
70
|
"js-cookie": "^3.0.5",
|
|
71
|
+
"lucide-react": "^0.475.0",
|
|
68
72
|
"react-feather": "^2.0.10",
|
|
69
73
|
"react-focus-lock": "^2.13.6",
|
|
70
74
|
"react-remove-scroll": "^2.6.3",
|
|
@@ -100,15 +104,15 @@
|
|
|
100
104
|
},
|
|
101
105
|
"devDependencies": {
|
|
102
106
|
"@rollup/plugin-alias": "^5.1.1",
|
|
103
|
-
"@storybook/addon-docs": "^8.5.
|
|
104
|
-
"@storybook/addon-essentials": "^8.5.
|
|
105
|
-
"@storybook/addon-interactions": "^8.5.
|
|
106
|
-
"@storybook/addon-links": "^8.5.
|
|
107
|
+
"@storybook/addon-docs": "^8.5.8",
|
|
108
|
+
"@storybook/addon-essentials": "^8.5.8",
|
|
109
|
+
"@storybook/addon-interactions": "^8.5.8",
|
|
110
|
+
"@storybook/addon-links": "^8.5.8",
|
|
107
111
|
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
108
|
-
"@storybook/blocks": "^8.5.
|
|
109
|
-
"@storybook/react": "^8.5.
|
|
110
|
-
"@storybook/react-vite": "^8.5.
|
|
111
|
-
"@storybook/test": "^8.5.
|
|
112
|
+
"@storybook/blocks": "^8.5.8",
|
|
113
|
+
"@storybook/react": "^8.5.8",
|
|
114
|
+
"@storybook/react-vite": "^8.5.8",
|
|
115
|
+
"@storybook/test": "^8.5.8",
|
|
112
116
|
"@testing-library/jest-dom": "^6.6.3",
|
|
113
117
|
"@testing-library/react": "^16.2.0",
|
|
114
118
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -132,14 +136,14 @@
|
|
|
132
136
|
"jest-axe": "^9.0.0",
|
|
133
137
|
"jsdom": "^26.0.0",
|
|
134
138
|
"lodash": "^4.17.21",
|
|
135
|
-
"postcss": "^8.5.
|
|
139
|
+
"postcss": "^8.5.3",
|
|
136
140
|
"prettier": "^3.5.1",
|
|
137
141
|
"rimraf": "^6.0.1",
|
|
138
|
-
"storybook": "^8.5.
|
|
142
|
+
"storybook": "^8.5.8",
|
|
139
143
|
"tailwindcss": "^3.4.17",
|
|
140
144
|
"ts-node": "^10.9.2",
|
|
141
145
|
"typescript": "^5.7.3",
|
|
142
|
-
"vite": "^6.1.
|
|
146
|
+
"vite": "^6.1.1",
|
|
143
147
|
"vite-plugin-dts": "^4.5.0",
|
|
144
148
|
"vite-plugin-lib-inject-css": "^2.2.1",
|
|
145
149
|
"vite-plugin-svgr": "^4.3.0",
|