@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.7

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.
Files changed (46) hide show
  1. package/dist/{Modal-D-NOEWMX.js → Modal-B8jrP02v.js} +20 -20
  2. package/dist/components/Alert/Alert.js +1 -1
  3. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  4. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  5. package/dist/components/AlertDialog/components/index.js +1 -1
  6. package/dist/components/Breadcrumb/components/Item/Item.js +21 -21
  7. package/dist/components/Checkbox/Checkbox.js +1 -1
  8. package/dist/components/Command/Command.js +2 -2
  9. package/dist/components/Command/components/Command.js +1 -1
  10. package/dist/components/Command/components/CommandEmpty.js +1 -1
  11. package/dist/components/Command/components/CommandGroup.js +1 -1
  12. package/dist/components/Command/components/CommandInput.js +1 -1
  13. package/dist/components/Command/components/CommandItem.js +1 -1
  14. package/dist/components/Command/components/CommandList.js +1 -1
  15. package/dist/components/Command/components/CommandSeparator.js +1 -1
  16. package/dist/components/Command/components/DialogContent.js +1 -1
  17. package/dist/components/Command/components/DialogOverlay.js +1 -1
  18. package/dist/components/Modal/Modal.js +2 -2
  19. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  20. package/dist/components/Modal/components/index.js +1 -1
  21. package/dist/components/NumberInput/NumberInput.js +1 -1
  22. package/dist/components/Range/Range.js +1 -1
  23. package/dist/components/Slider/Slider.js +1 -1
  24. package/dist/components/Switch/Switch.js +1 -1
  25. package/dist/components/Tabs/Tabs.js +1 -1
  26. package/dist/components/Tabs/components/Content.js +1 -1
  27. package/dist/components/Tabs/components/List.js +1 -1
  28. package/dist/components/Tabs/components/Trigger.js +1 -1
  29. package/dist/components/Toast/Toast.js +54 -53
  30. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +4 -3
  31. package/dist/components/VirtualizedTable/contexts/table.provider.js +64 -760
  32. package/dist/components/index.js +1 -1
  33. package/dist/{index-B7t8D14s.js → index-0XtjXVpJ.js} +2 -2
  34. package/dist/index-BVRIAMfe.js +36 -0
  35. package/dist/{index-os7vysFS.js → index-Bn4c-gww.js} +1 -1
  36. package/dist/{index-Cd2vhaop.js → index-CffpTFMi.js} +1 -1
  37. package/dist/{index-Bnb0ezr3.js → index-DQJhMz8c.js} +1 -1
  38. package/dist/index-DdXGVVBv.js +15 -0
  39. package/dist/{index-DzIBBMjs.js → index-amYX3uxF.js} +3 -3
  40. package/dist/{index-C84F4YyO.js → index-l3NwplN0.js} +1 -1
  41. package/dist/{index-DBbEcSUG.js → index-sp5ZfG6g.js} +1 -1
  42. package/dist/index.js +1 -1
  43. package/dist/package.json +6 -2
  44. package/package.json +6 -2
  45. package/dist/index-BITvcJAz.js +0 -423
  46. package/dist/index-ti1b9kqV.js +0 -14
@@ -2,25 +2,26 @@ import { jsx as i, jsxs as A, Fragment as se } from "react/jsx-runtime";
2
2
  import { u as ae, S as B } from "../../index-DQH6odE9.js";
3
3
  import * as n from "react";
4
4
  import { useRef as xe, useEffect as be, useMemo as oe, isValidElement as re, useCallback as ge } from "react";
5
- import { P as D, r as Se, d as Ie } from "../../index-BITvcJAz.js";
6
- import { c as Ne, a as Ae, b as x, u as De } from "../../index-BfXxHr_2.js";
7
- import { c as Fe } from "../../index-Cvx4lqTq.js";
8
- import { B as _e, R as Le } from "../../index-Cd2vhaop.js";
9
- import { P as Me } from "../../index-ti1b9kqV.js";
10
- import { P as Oe } from "../../index-C1g_chDT.js";
5
+ import * as Se from "react-dom";
6
+ import { c as Ie, a as Ne, b as x, u as Ae } from "../../index-BfXxHr_2.js";
7
+ import { c as De } from "../../index-Cvx4lqTq.js";
8
+ import { B as Fe, R as _e } from "../../index-CffpTFMi.js";
9
+ import { P as Le } from "../../index-DdXGVVBv.js";
10
+ import { P as Me } from "../../index-C1g_chDT.js";
11
+ import { P as D, d as Oe } from "../../index-BVRIAMfe.js";
11
12
  import { u as $ } from "../../index-0ioNhtNM.js";
12
- import { V as ie, R as ke } from "../../index-DBbEcSUG.js";
13
+ import { V as ie, R as ke } from "../../index-sp5ZfG6g.js";
13
14
  import { cn as j } from "../../utils/index.js";
14
15
  import { closeToastVariants as Ve, toastVariants as Ke, viewportToastVariants as He } from "./Toast.variants.js";
15
16
  import { X as We } from "../../x-4F_5p77m.js";
16
- var Q = "ToastProvider", [Z, Xe, $e] = Fe("Toast"), [ce, bt] = Ne("Toast", [$e]), [Ue, U] = ce(Q), ue = (e) => {
17
+ var Q = "ToastProvider", [Z, Xe, $e] = De("Toast"), [ce, bt] = Ie("Toast", [$e]), [Ue, U] = ce(Q), ue = (e) => {
17
18
  const {
18
19
  __scopeToast: r,
19
20
  label: o = "Notification",
20
21
  duration: t = 5e3,
21
22
  swipeDirection: c = "right",
22
23
  swipeThreshold: d = 50,
23
- children: p
24
+ children: f
24
25
  } = e, [T, v] = n.useState(null), [a, E] = n.useState(0), w = n.useRef(!1), S = n.useRef(!1);
25
26
  return o.trim() || console.error(
26
27
  `Invalid prop \`label\` supplied to \`${Q}\`. Expected non-empty \`string\`.`
@@ -39,7 +40,7 @@ var Q = "ToastProvider", [Z, Xe, $e] = Fe("Toast"), [ce, bt] = Ne("Toast", [$e])
39
40
  onToastRemove: n.useCallback(() => E((b) => b - 1), []),
40
41
  isFocusedToastEscapeKeyDownRef: w,
41
42
  isClosePausedRef: S,
42
- children: p
43
+ children: f
43
44
  }
44
45
  ) });
45
46
  };
@@ -51,7 +52,7 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
51
52
  hotkey: t = Ye,
52
53
  label: c = "Notifications ({hotkey})",
53
54
  ...d
54
- } = e, p = U(le, o), T = Xe(o), v = n.useRef(null), a = n.useRef(null), E = n.useRef(null), w = n.useRef(null), S = ae(r, w, p.onViewportChange), b = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = p.toastCount > 0;
55
+ } = e, f = U(le, o), T = Xe(o), v = n.useRef(null), a = n.useRef(null), E = n.useRef(null), w = n.useRef(null), S = ae(r, w, f.onViewportChange), b = t.join("+").replace(/Key/g, "").replace(/Digit/g, ""), R = f.toastCount > 0;
55
56
  n.useEffect(() => {
56
57
  const u = (h) => {
57
58
  t.length !== 0 && t.every((m) => h[m] || h.code === m) && w.current?.focus();
@@ -60,55 +61,55 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
60
61
  }, [t]), n.useEffect(() => {
61
62
  const u = v.current, h = w.current;
62
63
  if (R && u && h) {
63
- const f = () => {
64
- if (!p.isClosePausedRef.current) {
64
+ const p = () => {
65
+ if (!f.isClosePausedRef.current) {
65
66
  const y = new CustomEvent(z);
66
- h.dispatchEvent(y), p.isClosePausedRef.current = !0;
67
+ h.dispatchEvent(y), f.isClosePausedRef.current = !0;
67
68
  }
68
69
  }, m = () => {
69
- if (p.isClosePausedRef.current) {
70
+ if (f.isClosePausedRef.current) {
70
71
  const y = new CustomEvent(G);
71
- h.dispatchEvent(y), p.isClosePausedRef.current = !1;
72
+ h.dispatchEvent(y), f.isClosePausedRef.current = !1;
72
73
  }
73
74
  }, P = (y) => {
74
75
  !u.contains(y.relatedTarget) && m();
75
76
  }, C = () => {
76
77
  u.contains(document.activeElement) || m();
77
78
  };
78
- return u.addEventListener("focusin", f), u.addEventListener("focusout", P), u.addEventListener("pointermove", f), u.addEventListener("pointerleave", C), window.addEventListener("blur", f), window.addEventListener("focus", m), () => {
79
- u.removeEventListener("focusin", f), u.removeEventListener("focusout", P), u.removeEventListener("pointermove", f), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", f), window.removeEventListener("focus", m);
79
+ return u.addEventListener("focusin", p), u.addEventListener("focusout", P), u.addEventListener("pointermove", p), u.addEventListener("pointerleave", C), window.addEventListener("blur", p), window.addEventListener("focus", m), () => {
80
+ u.removeEventListener("focusin", p), u.removeEventListener("focusout", P), u.removeEventListener("pointermove", p), u.removeEventListener("pointerleave", C), window.removeEventListener("blur", p), window.removeEventListener("focus", m);
80
81
  };
81
82
  }
82
- }, [R, p.isClosePausedRef]);
83
+ }, [R, f.isClosePausedRef]);
83
84
  const l = n.useCallback(
84
85
  ({ tabbingDirection: u }) => {
85
- const f = T().map((m) => {
86
+ const p = T().map((m) => {
86
87
  const P = m.ref.current, C = [P, ...nt(P)];
87
88
  return u === "forwards" ? C : C.reverse();
88
89
  });
89
- return (u === "forwards" ? f.reverse() : f).flat();
90
+ return (u === "forwards" ? p.reverse() : p).flat();
90
91
  },
91
92
  [T]
92
93
  );
93
94
  return n.useEffect(() => {
94
95
  const u = w.current;
95
96
  if (u) {
96
- const h = (f) => {
97
- const m = f.altKey || f.ctrlKey || f.metaKey;
98
- if (f.key === "Tab" && !m) {
99
- const C = document.activeElement, y = f.shiftKey;
100
- if (f.target === u && y) {
97
+ const h = (p) => {
98
+ const m = p.altKey || p.ctrlKey || p.metaKey;
99
+ if (p.key === "Tab" && !m) {
100
+ const C = document.activeElement, y = p.shiftKey;
101
+ if (p.target === u && y) {
101
102
  a.current?.focus();
102
103
  return;
103
104
  }
104
105
  const _ = l({ tabbingDirection: y ? "backwards" : "forwards" }), V = _.findIndex((N) => N === C);
105
- q(_.slice(V + 1)) ? f.preventDefault() : y ? a.current?.focus() : E.current?.focus();
106
+ q(_.slice(V + 1)) ? p.preventDefault() : y ? a.current?.focus() : E.current?.focus();
106
107
  }
107
108
  };
108
109
  return u.addEventListener("keydown", h), () => u.removeEventListener("keydown", h);
109
110
  }
110
111
  }, [T, l]), /* @__PURE__ */ A(
111
- _e,
112
+ Fe,
112
113
  {
113
114
  ref: v,
114
115
  role: "region",
@@ -147,9 +148,9 @@ var le = "ToastViewport", Ye = ["F8"], z = "toast.viewportPause", G = "toast.vie
147
148
  }
148
149
  );
149
150
  de.displayName = le;
150
- var pe = "ToastFocusProxy", J = n.forwardRef(
151
+ var fe = "ToastFocusProxy", J = n.forwardRef(
151
152
  (e, r) => {
152
- const { __scopeToast: o, onFocusFromOutsideViewport: t, ...c } = e, d = U(pe, o);
153
+ const { __scopeToast: o, onFocusFromOutsideViewport: t, ...c } = e, d = U(fe, o);
153
154
  return /* @__PURE__ */ i(
154
155
  ie,
155
156
  {
@@ -157,28 +158,28 @@ var pe = "ToastFocusProxy", J = n.forwardRef(
157
158
  ...c,
158
159
  ref: r,
159
160
  style: { position: "fixed" },
160
- onFocus: (p) => {
161
- const T = p.relatedTarget;
161
+ onFocus: (f) => {
162
+ const T = f.relatedTarget;
162
163
  !d.viewport?.contains(T) && t();
163
164
  }
164
165
  }
165
166
  );
166
167
  }
167
168
  );
168
- J.displayName = pe;
169
- var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", fe = n.forwardRef(
169
+ J.displayName = fe;
170
+ var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.swipeCancel", ze = "toast.swipeEnd", pe = n.forwardRef(
170
171
  (e, r) => {
171
- const { forceMount: o, open: t, defaultOpen: c, onOpenChange: d, ...p } = e, [T, v] = Ae({
172
+ const { forceMount: o, open: t, defaultOpen: c, onOpenChange: d, ...f } = e, [T, v] = Ne({
172
173
  prop: t,
173
174
  defaultProp: c ?? !0,
174
175
  onChange: d,
175
176
  caller: O
176
177
  });
177
- return /* @__PURE__ */ i(Oe, { present: o || T, children: /* @__PURE__ */ i(
178
+ return /* @__PURE__ */ i(Me, { present: o || T, children: /* @__PURE__ */ i(
178
179
  Qe,
179
180
  {
180
181
  open: T,
181
- ...p,
182
+ ...f,
182
183
  ref: r,
183
184
  onClose: () => v(!1),
184
185
  onPause: $(e.onPause),
@@ -201,7 +202,7 @@ var O = "Toast", Be = "toast.swipeStart", je = "toast.swipeMove", qe = "toast.sw
201
202
  ) });
202
203
  }
203
204
  );
204
- fe.displayName = O;
205
+ pe.displayName = O;
205
206
  var [Ge, Je] = ce(O, {
206
207
  onClose() {
207
208
  }
@@ -212,7 +213,7 @@ var [Ge, Je] = ce(O, {
212
213
  type: t = "foreground",
213
214
  duration: c,
214
215
  open: d,
215
- onClose: p,
216
+ onClose: f,
216
217
  onEscapeKeyDown: T,
217
218
  onPause: v,
218
219
  onResume: a,
@@ -221,8 +222,8 @@ var [Ge, Je] = ce(O, {
221
222
  onSwipeCancel: S,
222
223
  onSwipeEnd: b,
223
224
  ...R
224
- } = e, l = U(O, o), [u, h] = n.useState(null), f = ae(r, (s) => h(s)), m = n.useRef(null), P = n.useRef(null), C = c || l.duration, y = n.useRef(0), F = n.useRef(C), k = n.useRef(0), { onToastAdd: _, onToastRemove: V } = l, N = $(() => {
225
- u?.contains(document.activeElement) && l.viewport?.focus(), p();
225
+ } = e, l = U(O, o), [u, h] = n.useState(null), p = ae(r, (s) => h(s)), m = n.useRef(null), P = n.useRef(null), C = c || l.duration, y = n.useRef(0), F = n.useRef(C), k = n.useRef(0), { onToastAdd: _, onToastRemove: V } = l, N = $(() => {
226
+ u?.contains(document.activeElement) && l.viewport?.focus(), f();
226
227
  }), K = n.useCallback(
227
228
  (s) => {
228
229
  !s || s === 1 / 0 || (window.clearTimeout(k.current), y.current = (/* @__PURE__ */ new Date()).getTime(), k.current = window.setTimeout(N, s));
@@ -258,7 +259,7 @@ var [Ge, Je] = ce(O, {
258
259
  ),
259
260
  /* @__PURE__ */ i(Ge, { scope: o, onClose: N, children: Se.createPortal(
260
261
  /* @__PURE__ */ i(Z.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
261
- Le,
262
+ _e,
262
263
  {
263
264
  asChild: !0,
264
265
  onEscapeKeyDown: x(T, () => {
@@ -271,7 +272,7 @@ var [Ge, Je] = ce(O, {
271
272
  "data-state": d ? "open" : "closed",
272
273
  "data-swipe-direction": l.swipeDirection,
273
274
  ...R,
274
- ref: f,
275
+ ref: p,
275
276
  style: { userSelect: "none", touchAction: "none", ...e.style },
276
277
  onKeyDown: x(e.onKeyDown, (s) => {
277
278
  s.key === "Escape" && (T?.(s.nativeEvent), s.nativeEvent.defaultPrevented || (l.isFocusedToastEscapeKeyDownRef.current = !0, N()));
@@ -315,11 +316,11 @@ var [Ge, Je] = ce(O, {
315
316
  ] }) : null;
316
317
  }
317
318
  ), Ze = (e) => {
318
- const { __scopeToast: r, children: o, ...t } = e, c = U(O, r), [d, p] = n.useState(!1), [T, v] = n.useState(!1);
319
- return ot(() => p(!0)), n.useEffect(() => {
319
+ const { __scopeToast: r, children: o, ...t } = e, c = U(O, r), [d, f] = n.useState(!1), [T, v] = n.useState(!1);
320
+ return ot(() => f(!0)), n.useEffect(() => {
320
321
  const a = window.setTimeout(() => v(!0), 1e3);
321
322
  return () => window.clearTimeout(a);
322
- }, []), T ? null : /* @__PURE__ */ i(Me, { asChild: !0, children: /* @__PURE__ */ i(ie, { ...t, children: d && /* @__PURE__ */ A(se, { children: [
323
+ }, []), T ? null : /* @__PURE__ */ i(Le, { asChild: !0, children: /* @__PURE__ */ i(ie, { ...t, children: d && /* @__PURE__ */ A(se, { children: [
323
324
  c.label,
324
325
  " ",
325
326
  o
@@ -381,8 +382,8 @@ function Pe(e) {
381
382
  const c = t.ariaHidden || t.hidden || t.style.display === "none", d = t.dataset.radixToastAnnounceExclude === "";
382
383
  if (!c)
383
384
  if (d) {
384
- const p = t.dataset.radixToastAnnounceAlt;
385
- p && r.push(p);
385
+ const f = t.dataset.radixToastAnnounceAlt;
386
+ f && r.push(f);
386
387
  } else
387
388
  r.push(...Pe(t));
388
389
  }
@@ -390,7 +391,7 @@ function Pe(e) {
390
391
  }
391
392
  function X(e, r, o, { discrete: t }) {
392
393
  const c = o.originalEvent.currentTarget, d = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: o });
393
- r && c.addEventListener(e, r, { once: !0 }), t ? Ie(c, d) : c.dispatchEvent(d);
394
+ r && c.addEventListener(e, r, { once: !0 }), t ? Oe(c, d) : c.dispatchEvent(d);
394
395
  }
395
396
  var ne = (e, r, o = 0) => {
396
397
  const t = Math.abs(e.x), c = Math.abs(e.y), d = t > c;
@@ -399,7 +400,7 @@ var ne = (e, r, o = 0) => {
399
400
  function ot(e = () => {
400
401
  }) {
401
402
  const r = $(e);
402
- De(() => {
403
+ Ae(() => {
403
404
  let o = 0, t = 0;
404
405
  return o = window.requestAnimationFrame(() => t = window.requestAnimationFrame(r)), () => {
405
406
  window.cancelAnimationFrame(o), window.cancelAnimationFrame(t);
@@ -423,7 +424,7 @@ function q(e) {
423
424
  const r = document.activeElement;
424
425
  return e.some((o) => o === r ? !0 : (o.focus(), document.activeElement !== r));
425
426
  }
426
- var st = ue, at = de, it = fe, ct = me, ut = Te, lt = ve;
427
+ var st = ue, at = de, it = pe, ct = me, ut = Te, lt = ve;
427
428
  const gt = ({
428
429
  title: e,
429
430
  duration: r = 5e3,
@@ -431,7 +432,7 @@ const gt = ({
431
432
  descriptionClassName: t,
432
433
  description: c,
433
434
  children: d,
434
- theme: p,
435
+ theme: f,
435
436
  showCloseButton: T = !0,
436
437
  closeButtonClassName: v,
437
438
  className: a,
@@ -449,7 +450,7 @@ const gt = ({
449
450
  it,
450
451
  {
451
452
  className: j(Ke({ className: a })),
452
- "data-theme": p,
453
+ "data-theme": f,
453
454
  open: E,
454
455
  onOpenChange: w,
455
456
  children: [
@@ -3,13 +3,14 @@ import * as g from "react";
3
3
  import { useLayoutEffect as Vt, useRef as zt, useState as jt, useCallback as Yt, useEffect as ze } from "react";
4
4
  import { c as ot, u as je, a as Xt, b as J } from "../../../../index-BfXxHr_2.js";
5
5
  import { u as ge, b as Gt } from "../../../../index-DQH6odE9.js";
6
- import { D as qt } from "../../../../index-Cd2vhaop.js";
6
+ import { D as qt } from "../../../../index-CffpTFMi.js";
7
7
  import { u as Ut } from "../../../../index-bwWKd82e.js";
8
- import { r as Kt, P as we } from "../../../../index-BITvcJAz.js";
8
+ import * as Kt from "react-dom";
9
+ import { P as we } from "../../../../index-BVRIAMfe.js";
9
10
  import { u as Zt } from "../../../../index-0ioNhtNM.js";
10
11
  import { u as Jt } from "../../../../index-BAEWsOG1.js";
11
12
  import { P as Qt } from "../../../../index-C1g_chDT.js";
12
- import { R as en } from "../../../../index-DBbEcSUG.js";
13
+ import { R as en } from "../../../../index-sp5ZfG6g.js";
13
14
  import { d as tn } from "../../../../debounce-BFejQm9P.js";
14
15
  const nn = ["top", "right", "bottom", "left"], U = Math.min, F = Math.max, de = Math.round, fe = Math.floor, j = (e) => ({
15
16
  x: e,