@krosoft/react 0.0.72 → 0.0.73
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/KpiCards-Bjsd4bSz.js +40 -0
- package/dist/{SearchInput-LIey3bo9.js → SearchInput-Bu4wb0gI.js} +10 -9
- package/dist/ThemeSelector-DMgBLEYm.js +49 -0
- package/dist/Topbar-CFALRIJn.js +168 -0
- package/dist/{badge-Cj2EQgcL.js → badge-C4pCH7IL.js} +1 -1
- package/dist/components/core/cards/KpiCards.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +10 -8
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts +8 -0
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -0
- package/dist/components/core/theme/index.d.ts +3 -0
- package/dist/components/core/theme/index.d.ts.map +1 -0
- package/dist/components/core/theme/index.js +4 -0
- package/dist/components/index.js +41 -30
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +27 -18
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +16 -112
- package/dist/hooks/ui/useTheme.d.ts +20 -0
- package/dist/hooks/ui/useTheme.d.ts.map +1 -0
- package/dist/index-BQOmHRsD.js +1662 -0
- package/dist/select-CdiR6cO0.js +2020 -0
- package/dist/{toast-B6CC_ory.js → toast-BypnW71k.js} +1 -1
- package/dist/tooltip-Dep8OR3c.js +779 -0
- package/dist/useTheme-D__o7mLN.js +122 -0
- package/package.json +10 -2
- package/dist/KpiCards-D4Cy8CLT.js +0 -38
- package/dist/Topbar-CtXJ337W.js +0 -2314
- package/dist/index-BNCR478R.js +0 -272
package/dist/index-BNCR478R.js
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { jsx as h, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
-
import { a as R, c as P } from "./index-gWiv5-6R.js";
|
|
3
|
-
import * as c from "react";
|
|
4
|
-
const x = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, C = R, V = (e, n) => (t) => {
|
|
5
|
-
var r;
|
|
6
|
-
if ((n == null ? void 0 : n.variants) == null) return C(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
7
|
-
const { variants: o, defaultVariants: s } = n, u = Object.keys(o).map((l) => {
|
|
8
|
-
const f = t == null ? void 0 : t[l], a = s == null ? void 0 : s[l];
|
|
9
|
-
if (f === null) return null;
|
|
10
|
-
const d = x(f) || x(a);
|
|
11
|
-
return o[l][d];
|
|
12
|
-
}), i = t && Object.entries(t).reduce((l, f) => {
|
|
13
|
-
let [a, d] = f;
|
|
14
|
-
return d === void 0 || (l[a] = d), l;
|
|
15
|
-
}, {}), m = n == null || (r = n.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((l, f) => {
|
|
16
|
-
let { class: a, className: d, ...y } = f;
|
|
17
|
-
return Object.entries(y).every((v) => {
|
|
18
|
-
let [p, b] = v;
|
|
19
|
-
return Array.isArray(b) ? b.includes({
|
|
20
|
-
...s,
|
|
21
|
-
...i
|
|
22
|
-
}[p]) : {
|
|
23
|
-
...s,
|
|
24
|
-
...i
|
|
25
|
-
}[p] === b;
|
|
26
|
-
}) ? [
|
|
27
|
-
...l,
|
|
28
|
-
a,
|
|
29
|
-
d
|
|
30
|
-
] : l;
|
|
31
|
-
}, []);
|
|
32
|
-
return C(e, u, m, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
|
|
33
|
-
};
|
|
34
|
-
function S(e, n) {
|
|
35
|
-
if (typeof e == "function")
|
|
36
|
-
return e(n);
|
|
37
|
-
e != null && (e.current = n);
|
|
38
|
-
}
|
|
39
|
-
function w(...e) {
|
|
40
|
-
return (n) => {
|
|
41
|
-
let t = !1;
|
|
42
|
-
const r = e.map((o) => {
|
|
43
|
-
const s = S(o, n);
|
|
44
|
-
return !t && typeof s == "function" && (t = !0), s;
|
|
45
|
-
});
|
|
46
|
-
if (t)
|
|
47
|
-
return () => {
|
|
48
|
-
for (let o = 0; o < r.length; o++) {
|
|
49
|
-
const s = r[o];
|
|
50
|
-
typeof s == "function" ? s() : S(e[o], null);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function U(...e) {
|
|
56
|
-
return c.useCallback(w(...e), e);
|
|
57
|
-
}
|
|
58
|
-
// @__NO_SIDE_EFFECTS__
|
|
59
|
-
function N(e) {
|
|
60
|
-
const n = /* @__PURE__ */ $(e), t = c.forwardRef((r, o) => {
|
|
61
|
-
const { children: s, ...u } = r, i = c.Children.toArray(s), m = i.find(j);
|
|
62
|
-
if (m) {
|
|
63
|
-
const l = m.props.children, f = i.map((a) => a === m ? c.Children.count(l) > 1 ? c.Children.only(null) : c.isValidElement(l) ? l.props.children : null : a);
|
|
64
|
-
return /* @__PURE__ */ h(n, { ...u, ref: o, children: c.isValidElement(l) ? c.cloneElement(l, void 0, f) : null });
|
|
65
|
-
}
|
|
66
|
-
return /* @__PURE__ */ h(n, { ...u, ref: o, children: s });
|
|
67
|
-
});
|
|
68
|
-
return t.displayName = `${e}.Slot`, t;
|
|
69
|
-
}
|
|
70
|
-
var k = /* @__PURE__ */ N("Slot");
|
|
71
|
-
// @__NO_SIDE_EFFECTS__
|
|
72
|
-
function $(e) {
|
|
73
|
-
const n = c.forwardRef((t, r) => {
|
|
74
|
-
const { children: o, ...s } = t;
|
|
75
|
-
if (c.isValidElement(o)) {
|
|
76
|
-
const u = I(o), i = O(s, o.props);
|
|
77
|
-
return o.type !== c.Fragment && (i.ref = r ? w(r, u) : u), c.cloneElement(o, i);
|
|
78
|
-
}
|
|
79
|
-
return c.Children.count(o) > 1 ? c.Children.only(null) : null;
|
|
80
|
-
});
|
|
81
|
-
return n.displayName = `${e}.SlotClone`, n;
|
|
82
|
-
}
|
|
83
|
-
var E = Symbol("radix.slottable");
|
|
84
|
-
// @__NO_SIDE_EFFECTS__
|
|
85
|
-
function Z(e) {
|
|
86
|
-
const n = ({ children: t }) => /* @__PURE__ */ h(_, { children: t });
|
|
87
|
-
return n.displayName = `${e}.Slottable`, n.__radixId = E, n;
|
|
88
|
-
}
|
|
89
|
-
function j(e) {
|
|
90
|
-
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === E;
|
|
91
|
-
}
|
|
92
|
-
function O(e, n) {
|
|
93
|
-
const t = { ...n };
|
|
94
|
-
for (const r in n) {
|
|
95
|
-
const o = e[r], s = n[r];
|
|
96
|
-
/^on[A-Z]/.test(r) ? o && s ? t[r] = (...i) => {
|
|
97
|
-
const m = s(...i);
|
|
98
|
-
return o(...i), m;
|
|
99
|
-
} : o && (t[r] = o) : r === "style" ? t[r] = { ...o, ...s } : r === "className" && (t[r] = [o, s].filter(Boolean).join(" "));
|
|
100
|
-
}
|
|
101
|
-
return { ...e, ...t };
|
|
102
|
-
}
|
|
103
|
-
function I(e) {
|
|
104
|
-
var r, o;
|
|
105
|
-
let n = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
106
|
-
return t ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
107
|
-
}
|
|
108
|
-
const A = V(
|
|
109
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
110
|
-
{
|
|
111
|
-
variants: {
|
|
112
|
-
variant: {
|
|
113
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
114
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
115
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
116
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
117
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
118
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
119
|
-
styled: "bg-gradient-to-r from-slate-900 to-purple-700 hover:from-slate-800 hover:to-purple-600 text-white shadow-lg shadow-purple-500/25 px-6 h-12"
|
|
120
|
-
},
|
|
121
|
-
size: {
|
|
122
|
-
default: "h-10 px-4 py-2",
|
|
123
|
-
sm: "h-9 rounded-md px-3",
|
|
124
|
-
lg: "h-11 rounded-md px-8",
|
|
125
|
-
icon: "h-10 w-10"
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
defaultVariants: {
|
|
129
|
-
variant: "default",
|
|
130
|
-
size: "default"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
), B = c.forwardRef(({ className: e, variant: n, size: t, asChild: r = !1, ...o }, s) => /* @__PURE__ */ h(r ? k : "button", { className: P(A({ variant: n, size: t, className: e })), ref: s, ...o }));
|
|
134
|
-
B.displayName = "Button";
|
|
135
|
-
function q(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
136
|
-
return function(o) {
|
|
137
|
-
if (e == null || e(o), t === !1 || !o.defaultPrevented)
|
|
138
|
-
return n == null ? void 0 : n(o);
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function G(e, n = []) {
|
|
142
|
-
let t = [];
|
|
143
|
-
function r(s, u) {
|
|
144
|
-
const i = c.createContext(u), m = t.length;
|
|
145
|
-
t = [...t, u];
|
|
146
|
-
const l = (a) => {
|
|
147
|
-
var g;
|
|
148
|
-
const { scope: d, children: y, ...v } = a, p = ((g = d == null ? void 0 : d[e]) == null ? void 0 : g[m]) || i, b = c.useMemo(() => v, Object.values(v));
|
|
149
|
-
return /* @__PURE__ */ h(p.Provider, { value: b, children: y });
|
|
150
|
-
};
|
|
151
|
-
l.displayName = s + "Provider";
|
|
152
|
-
function f(a, d) {
|
|
153
|
-
var p;
|
|
154
|
-
const y = ((p = d == null ? void 0 : d[e]) == null ? void 0 : p[m]) || i, v = c.useContext(y);
|
|
155
|
-
if (v) return v;
|
|
156
|
-
if (u !== void 0) return u;
|
|
157
|
-
throw new Error(`\`${a}\` must be used within \`${s}\``);
|
|
158
|
-
}
|
|
159
|
-
return [l, f];
|
|
160
|
-
}
|
|
161
|
-
const o = () => {
|
|
162
|
-
const s = t.map((u) => c.createContext(u));
|
|
163
|
-
return function(i) {
|
|
164
|
-
const m = (i == null ? void 0 : i[e]) || s;
|
|
165
|
-
return c.useMemo(
|
|
166
|
-
() => ({ [`__scope${e}`]: { ...i, [e]: m } }),
|
|
167
|
-
[i, m]
|
|
168
|
-
);
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
return o.scopeName = e, [r, L(o, ...n)];
|
|
172
|
-
}
|
|
173
|
-
function L(...e) {
|
|
174
|
-
const n = e[0];
|
|
175
|
-
if (e.length === 1) return n;
|
|
176
|
-
const t = () => {
|
|
177
|
-
const r = e.map((o) => ({
|
|
178
|
-
useScope: o(),
|
|
179
|
-
scopeName: o.scopeName
|
|
180
|
-
}));
|
|
181
|
-
return function(s) {
|
|
182
|
-
const u = r.reduce((i, { useScope: m, scopeName: l }) => {
|
|
183
|
-
const a = m(s)[`__scope${l}`];
|
|
184
|
-
return { ...i, ...a };
|
|
185
|
-
}, {});
|
|
186
|
-
return c.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
187
|
-
};
|
|
188
|
-
};
|
|
189
|
-
return t.scopeName = n.scopeName, t;
|
|
190
|
-
}
|
|
191
|
-
function T(e) {
|
|
192
|
-
const n = c.useRef(e);
|
|
193
|
-
return c.useEffect(() => {
|
|
194
|
-
n.current = e;
|
|
195
|
-
}), c.useMemo(() => (...t) => {
|
|
196
|
-
var r;
|
|
197
|
-
return (r = n.current) == null ? void 0 : r.call(n, ...t);
|
|
198
|
-
}, []);
|
|
199
|
-
}
|
|
200
|
-
function J(e, n = globalThis == null ? void 0 : globalThis.document) {
|
|
201
|
-
const t = T(e);
|
|
202
|
-
c.useEffect(() => {
|
|
203
|
-
const r = (o) => {
|
|
204
|
-
o.key === "Escape" && t(o);
|
|
205
|
-
};
|
|
206
|
-
return n.addEventListener("keydown", r, { capture: !0 }), () => n.removeEventListener("keydown", r, { capture: !0 });
|
|
207
|
-
}, [t, n]);
|
|
208
|
-
}
|
|
209
|
-
var W = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
|
|
210
|
-
}, D = c[" useInsertionEffect ".trim().toString()] || W;
|
|
211
|
-
function Q({
|
|
212
|
-
prop: e,
|
|
213
|
-
defaultProp: n,
|
|
214
|
-
onChange: t = () => {
|
|
215
|
-
},
|
|
216
|
-
caller: r
|
|
217
|
-
}) {
|
|
218
|
-
const [o, s, u] = F({
|
|
219
|
-
defaultProp: n,
|
|
220
|
-
onChange: t
|
|
221
|
-
}), i = e !== void 0, m = i ? e : o;
|
|
222
|
-
{
|
|
223
|
-
const f = c.useRef(e !== void 0);
|
|
224
|
-
c.useEffect(() => {
|
|
225
|
-
const a = f.current;
|
|
226
|
-
a !== i && console.warn(
|
|
227
|
-
`${r} is changing from ${a ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
228
|
-
), f.current = i;
|
|
229
|
-
}, [i, r]);
|
|
230
|
-
}
|
|
231
|
-
const l = c.useCallback(
|
|
232
|
-
(f) => {
|
|
233
|
-
var a;
|
|
234
|
-
if (i) {
|
|
235
|
-
const d = K(f) ? f(e) : f;
|
|
236
|
-
d !== e && ((a = u.current) == null || a.call(u, d));
|
|
237
|
-
} else
|
|
238
|
-
s(f);
|
|
239
|
-
},
|
|
240
|
-
[i, e, s, u]
|
|
241
|
-
);
|
|
242
|
-
return [m, l];
|
|
243
|
-
}
|
|
244
|
-
function F({
|
|
245
|
-
defaultProp: e,
|
|
246
|
-
onChange: n
|
|
247
|
-
}) {
|
|
248
|
-
const [t, r] = c.useState(e), o = c.useRef(t), s = c.useRef(n);
|
|
249
|
-
return D(() => {
|
|
250
|
-
s.current = n;
|
|
251
|
-
}, [n]), c.useEffect(() => {
|
|
252
|
-
var u;
|
|
253
|
-
o.current !== t && ((u = s.current) == null || u.call(s, t), o.current = t);
|
|
254
|
-
}, [t, o]), [t, r, s];
|
|
255
|
-
}
|
|
256
|
-
function K(e) {
|
|
257
|
-
return typeof e == "function";
|
|
258
|
-
}
|
|
259
|
-
export {
|
|
260
|
-
B,
|
|
261
|
-
G as a,
|
|
262
|
-
A as b,
|
|
263
|
-
V as c,
|
|
264
|
-
N as d,
|
|
265
|
-
J as e,
|
|
266
|
-
q as f,
|
|
267
|
-
T as g,
|
|
268
|
-
W as h,
|
|
269
|
-
Q as i,
|
|
270
|
-
Z as j,
|
|
271
|
-
U as u
|
|
272
|
-
};
|