@krosoft/react 0.0.88 → 0.0.89

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 (37) hide show
  1. package/dist/{AppSubTitle-DaFa30Qp.js → AppSubTitle-RKbtrPJr.js} +1 -1
  2. package/dist/{AppTitle-COtcNGNr.js → AppTitle-DCQpP2qE.js} +27 -27
  3. package/dist/AppVerticalTabs-pK3i9ZTD.js +110 -0
  4. package/dist/FormDialog-CXLQG83d.js +250 -0
  5. package/dist/{MetricCard-L5ETuqBs.js → MetricCard-DB1ME6tD.js} +3 -3
  6. package/dist/{SearchInput-BxnaShYy.js → SearchInput-D_SLIZ2y.js} +37 -37
  7. package/dist/{TableFilter-RzydxKBF.js → TableFilter-DXTOY-oa.js} +22 -22
  8. package/dist/{TableSettings-Bwysm3KH.js → TableSettings-CBtuAPgM.js} +27 -27
  9. package/dist/{ThemeSelector-mZBbr2qt.js → ThemeSelector-CU8JmN2b.js} +14 -15
  10. package/dist/{Topbar-DzFClMWt.js → Topbar-BzZxu1Zi.js} +28 -29
  11. package/dist/{badge-DCS7KMnM.js → badge-DyRSpnOb.js} +3 -3
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/dialogs/index.js +12 -11
  14. package/dist/components/core/filters/index.js +1 -1
  15. package/dist/components/core/index.js +55 -54
  16. package/dist/components/core/inputs/index.js +1 -1
  17. package/dist/components/core/layouts/index.js +2 -2
  18. package/dist/components/core/navbar/index.js +1 -1
  19. package/dist/components/core/table/index.js +1 -1
  20. package/dist/components/core/tabs/index.js +1 -1
  21. package/dist/components/core/theme/index.js +1 -1
  22. package/dist/components/index.js +136 -108
  23. package/dist/components/ui/index.d.ts +8 -0
  24. package/dist/components/ui/index.d.ts.map +1 -1
  25. package/dist/components/ui/index.js +89 -50
  26. package/dist/ellipsis-vertical-CqrunffH.js +15 -0
  27. package/dist/{select-C6w0ck7-.js → select-B5wF6jxC.js} +6 -6
  28. package/dist/skeleton-CJ1F2tD3.js +8 -0
  29. package/dist/tabs-BYqvMsA6.js +6628 -0
  30. package/dist/tooltip-BzTGwm2E.js +2505 -0
  31. package/package.json +1 -1
  32. package/dist/AppVerticalTabs-aeKDheVe.js +0 -829
  33. package/dist/FormDialog-B3u7bHU_.js +0 -472
  34. package/dist/dropdown-menu-BDcm9kW8.js +0 -1086
  35. package/dist/index-DUnCfjrC.js +0 -2176
  36. package/dist/popover-PsZp711z.js +0 -4533
  37. package/dist/tooltip-CtjaR1qq.js +0 -337
@@ -1,337 +0,0 @@
1
- import { jsx as f, Fragment as V, jsxs as Y } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { P as q, D as X, C as K, R as W, u as S, a as J, d as M, e as Q, f as Z, g as ee, A as te, h as oe, i as g, j as re } from "./index-DUnCfjrC.js";
4
- import { c as ne } from "./index-gWiv5-6R.js";
5
- var se = Symbol("radix.slottable");
6
- // @__NO_SIDE_EFFECTS__
7
- function ae(t) {
8
- const o = ({ children: e }) => /* @__PURE__ */ f(V, { children: e });
9
- return o.displayName = `${t}.Slottable`, o.__radixId = se, o;
10
- }
11
- var [_] = J("Tooltip", [
12
- M
13
- ]), D = M(), H = "TooltipProvider", ie = 700, O = "tooltip.open", [le, k] = _(H), j = (t) => {
14
- const {
15
- __scopeTooltip: o,
16
- delayDuration: e = ie,
17
- skipDelayDuration: r = 300,
18
- disableHoverableContent: n = !1,
19
- children: l
20
- } = t, i = s.useRef(!0), v = s.useRef(!1), a = s.useRef(0);
21
- return s.useEffect(() => {
22
- const d = a.current;
23
- return () => window.clearTimeout(d);
24
- }, []), /* @__PURE__ */ f(
25
- le,
26
- {
27
- scope: o,
28
- isOpenDelayedRef: i,
29
- delayDuration: e,
30
- onOpen: s.useCallback(() => {
31
- window.clearTimeout(a.current), i.current = !1;
32
- }, []),
33
- onClose: s.useCallback(() => {
34
- window.clearTimeout(a.current), a.current = window.setTimeout(
35
- () => i.current = !0,
36
- r
37
- );
38
- }, [r]),
39
- isPointerInTransitRef: v,
40
- onPointerInTransitChange: s.useCallback((d) => {
41
- v.current = d;
42
- }, []),
43
- disableHoverableContent: n,
44
- children: l
45
- }
46
- );
47
- };
48
- j.displayName = H;
49
- var R = "Tooltip", [ce, L] = _(R), F = (t) => {
50
- const {
51
- __scopeTooltip: o,
52
- children: e,
53
- open: r,
54
- defaultOpen: n,
55
- onOpenChange: l,
56
- disableHoverableContent: i,
57
- delayDuration: v
58
- } = t, a = k(R, t.__scopeTooltip), d = D(o), [c, p] = s.useState(null), h = Q(), u = s.useRef(0), T = i ?? a.disableHoverableContent, y = v ?? a.delayDuration, m = s.useRef(!1), [C, x] = Z({
59
- prop: r,
60
- defaultProp: n ?? !1,
61
- onChange: (N) => {
62
- N ? (a.onOpen(), document.dispatchEvent(new CustomEvent(O))) : a.onClose(), l == null || l(N);
63
- },
64
- caller: R
65
- }), w = s.useMemo(() => C ? m.current ? "delayed-open" : "instant-open" : "closed", [C]), E = s.useCallback(() => {
66
- window.clearTimeout(u.current), u.current = 0, m.current = !1, x(!0);
67
- }, [x]), P = s.useCallback(() => {
68
- window.clearTimeout(u.current), u.current = 0, x(!1);
69
- }, [x]), I = s.useCallback(() => {
70
- window.clearTimeout(u.current), u.current = window.setTimeout(() => {
71
- m.current = !0, x(!0), u.current = 0;
72
- }, y);
73
- }, [y, x]);
74
- return s.useEffect(() => () => {
75
- u.current && (window.clearTimeout(u.current), u.current = 0);
76
- }, []), /* @__PURE__ */ f(ee, { ...d, children: /* @__PURE__ */ f(
77
- ce,
78
- {
79
- scope: o,
80
- contentId: h,
81
- open: C,
82
- stateAttribute: w,
83
- trigger: c,
84
- onTriggerChange: p,
85
- onTriggerEnter: s.useCallback(() => {
86
- a.isOpenDelayedRef.current ? I() : E();
87
- }, [a.isOpenDelayedRef, I, E]),
88
- onTriggerLeave: s.useCallback(() => {
89
- T ? P() : (window.clearTimeout(u.current), u.current = 0);
90
- }, [P, T]),
91
- onOpen: E,
92
- onClose: P,
93
- disableHoverableContent: T,
94
- children: e
95
- }
96
- ) });
97
- };
98
- F.displayName = R;
99
- var A = "TooltipTrigger", G = s.forwardRef(
100
- (t, o) => {
101
- const { __scopeTooltip: e, ...r } = t, n = L(A, e), l = k(A, e), i = D(e), v = s.useRef(null), a = S(o, v, n.onTriggerChange), d = s.useRef(!1), c = s.useRef(!1), p = s.useCallback(() => d.current = !1, []);
102
- return s.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ f(te, { asChild: !0, ...i, children: /* @__PURE__ */ f(
103
- oe.button,
104
- {
105
- "aria-describedby": n.open ? n.contentId : void 0,
106
- "data-state": n.stateAttribute,
107
- ...r,
108
- ref: a,
109
- onPointerMove: g(t.onPointerMove, (h) => {
110
- h.pointerType !== "touch" && !c.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
111
- }),
112
- onPointerLeave: g(t.onPointerLeave, () => {
113
- n.onTriggerLeave(), c.current = !1;
114
- }),
115
- onPointerDown: g(t.onPointerDown, () => {
116
- n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", p, { once: !0 });
117
- }),
118
- onFocus: g(t.onFocus, () => {
119
- d.current || n.onOpen();
120
- }),
121
- onBlur: g(t.onBlur, n.onClose),
122
- onClick: g(t.onClick, n.onClose)
123
- }
124
- ) });
125
- }
126
- );
127
- G.displayName = A;
128
- var ue = "TooltipPortal", [Oe, de] = _(ue, {
129
- forceMount: void 0
130
- }), b = "TooltipContent", B = s.forwardRef(
131
- (t, o) => {
132
- const e = de(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...l } = t, i = L(b, t.__scopeTooltip);
133
- return /* @__PURE__ */ f(q, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ f($, { side: n, ...l, ref: o }) : /* @__PURE__ */ f(pe, { side: n, ...l, ref: o }) });
134
- }
135
- ), pe = s.forwardRef((t, o) => {
136
- const e = L(b, t.__scopeTooltip), r = k(b, t.__scopeTooltip), n = s.useRef(null), l = S(o, n), [i, v] = s.useState(null), { trigger: a, onClose: d } = e, c = n.current, { onPointerInTransitChange: p } = r, h = s.useCallback(() => {
137
- v(null), p(!1);
138
- }, [p]), u = s.useCallback(
139
- (T, y) => {
140
- const m = T.currentTarget, C = { x: T.clientX, y: T.clientY }, x = me(C, m.getBoundingClientRect()), w = ye(C, x), E = xe(y.getBoundingClientRect()), P = ge([...w, ...E]);
141
- v(P), p(!0);
142
- },
143
- [p]
144
- );
145
- return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
146
- if (a && c) {
147
- const T = (m) => u(m, c), y = (m) => u(m, a);
148
- return a.addEventListener("pointerleave", T), c.addEventListener("pointerleave", y), () => {
149
- a.removeEventListener("pointerleave", T), c.removeEventListener("pointerleave", y);
150
- };
151
- }
152
- }, [a, c, u, h]), s.useEffect(() => {
153
- if (i) {
154
- const T = (y) => {
155
- const m = y.target, C = { x: y.clientX, y: y.clientY }, x = (a == null ? void 0 : a.contains(m)) || (c == null ? void 0 : c.contains(m)), w = !Ce(C, i);
156
- x ? h() : w && (h(), d());
157
- };
158
- return document.addEventListener("pointermove", T), () => document.removeEventListener("pointermove", T);
159
- }
160
- }, [a, c, i, d, h]), /* @__PURE__ */ f($, { ...t, ref: l });
161
- }), [fe, ve] = _(R, { isInside: !1 }), he = /* @__PURE__ */ ae("TooltipContent"), $ = s.forwardRef(
162
- (t, o) => {
163
- const {
164
- __scopeTooltip: e,
165
- children: r,
166
- "aria-label": n,
167
- onEscapeKeyDown: l,
168
- onPointerDownOutside: i,
169
- ...v
170
- } = t, a = L(b, e), d = D(e), { onClose: c } = a;
171
- return s.useEffect(() => (document.addEventListener(O, c), () => document.removeEventListener(O, c)), [c]), s.useEffect(() => {
172
- if (a.trigger) {
173
- const p = (h) => {
174
- const u = h.target;
175
- u != null && u.contains(a.trigger) && c();
176
- };
177
- return window.addEventListener("scroll", p, { capture: !0 }), () => window.removeEventListener("scroll", p, { capture: !0 });
178
- }
179
- }, [a.trigger, c]), /* @__PURE__ */ f(
180
- X,
181
- {
182
- asChild: !0,
183
- disableOutsidePointerEvents: !1,
184
- onEscapeKeyDown: l,
185
- onPointerDownOutside: i,
186
- onFocusOutside: (p) => p.preventDefault(),
187
- onDismiss: c,
188
- children: /* @__PURE__ */ Y(
189
- K,
190
- {
191
- "data-state": a.stateAttribute,
192
- ...d,
193
- ...v,
194
- ref: o,
195
- style: {
196
- ...v.style,
197
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
198
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
199
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
200
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
201
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
202
- },
203
- children: [
204
- /* @__PURE__ */ f(he, { children: r }),
205
- /* @__PURE__ */ f(fe, { scope: e, isInside: !0, children: /* @__PURE__ */ f(W, { id: a.contentId, role: "tooltip", children: n || r }) })
206
- ]
207
- }
208
- )
209
- }
210
- );
211
- }
212
- );
213
- B.displayName = b;
214
- var z = "TooltipArrow", Te = s.forwardRef(
215
- (t, o) => {
216
- const { __scopeTooltip: e, ...r } = t, n = D(e);
217
- return ve(
218
- z,
219
- e
220
- ).isInside ? null : /* @__PURE__ */ f(re, { ...n, ...r, ref: o });
221
- }
222
- );
223
- Te.displayName = z;
224
- function me(t, o) {
225
- const e = Math.abs(o.top - t.y), r = Math.abs(o.bottom - t.y), n = Math.abs(o.right - t.x), l = Math.abs(o.left - t.x);
226
- switch (Math.min(e, r, n, l)) {
227
- case l:
228
- return "left";
229
- case n:
230
- return "right";
231
- case e:
232
- return "top";
233
- case r:
234
- return "bottom";
235
- default:
236
- throw new Error("unreachable");
237
- }
238
- }
239
- function ye(t, o, e = 5) {
240
- const r = [];
241
- switch (o) {
242
- case "top":
243
- r.push(
244
- { x: t.x - e, y: t.y + e },
245
- { x: t.x + e, y: t.y + e }
246
- );
247
- break;
248
- case "bottom":
249
- r.push(
250
- { x: t.x - e, y: t.y - e },
251
- { x: t.x + e, y: t.y - e }
252
- );
253
- break;
254
- case "left":
255
- r.push(
256
- { x: t.x + e, y: t.y - e },
257
- { x: t.x + e, y: t.y + e }
258
- );
259
- break;
260
- case "right":
261
- r.push(
262
- { x: t.x - e, y: t.y - e },
263
- { x: t.x - e, y: t.y + e }
264
- );
265
- break;
266
- }
267
- return r;
268
- }
269
- function xe(t) {
270
- const { top: o, right: e, bottom: r, left: n } = t;
271
- return [
272
- { x: n, y: o },
273
- { x: e, y: o },
274
- { x: e, y: r },
275
- { x: n, y: r }
276
- ];
277
- }
278
- function Ce(t, o) {
279
- const { x: e, y: r } = t;
280
- let n = !1;
281
- for (let l = 0, i = o.length - 1; l < o.length; i = l++) {
282
- const v = o[l], a = o[i], d = v.x, c = v.y, p = a.x, h = a.y;
283
- c > r != h > r && e < (p - d) * (r - c) / (h - c) + d && (n = !n);
284
- }
285
- return n;
286
- }
287
- function ge(t) {
288
- const o = t.slice();
289
- return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), be(o);
290
- }
291
- function be(t) {
292
- if (t.length <= 1) return t.slice();
293
- const o = [];
294
- for (let r = 0; r < t.length; r++) {
295
- const n = t[r];
296
- for (; o.length >= 2; ) {
297
- const l = o[o.length - 1], i = o[o.length - 2];
298
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) o.pop();
299
- else break;
300
- }
301
- o.push(n);
302
- }
303
- o.pop();
304
- const e = [];
305
- for (let r = t.length - 1; r >= 0; r--) {
306
- const n = t[r];
307
- for (; e.length >= 2; ) {
308
- const l = e[e.length - 1], i = e[e.length - 2];
309
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x)) e.pop();
310
- else break;
311
- }
312
- e.push(n);
313
- }
314
- return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
315
- }
316
- var we = j, Ee = F, Pe = G, U = B;
317
- const Ae = we, ke = Ee, Ie = Pe, Re = s.forwardRef(
318
- ({ className: t, sideOffset: o = 4, ...e }, r) => /* @__PURE__ */ f(
319
- U,
320
- {
321
- ref: r,
322
- sideOffset: o,
323
- className: ne(
324
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
325
- t
326
- ),
327
- ...e
328
- }
329
- )
330
- );
331
- Re.displayName = U.displayName;
332
- export {
333
- Ae as T,
334
- ke as a,
335
- Ie as b,
336
- Re as c
337
- };