@levo-so/react 0.1.40 → 0.1.44

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.
@@ -1,383 +0,0 @@
1
- "use client";
2
- import { j as o } from "./jsx-runtime-D0AQ1Mn7.js";
3
- import { Slot as E } from "@radix-ui/react-slot";
4
- import * as d from "react";
5
- import u from "react";
6
- import { twMerge as S } from "tailwind-merge";
7
- import { c as l } from "./Sonner-5IAqCkBs.js";
8
- import { cva as _ } from "class-variance-authority";
9
- import * as i from "@radix-ui/react-dialog";
10
- import { X as k } from "lucide-react";
11
- import * as f from "@radix-ui/react-tabs";
12
- import * as m from "@radix-ui/react-tooltip";
13
- var y = {
14
- color: void 0,
15
- size: void 0,
16
- className: void 0,
17
- style: void 0,
18
- attr: void 0
19
- }, x = u.createContext && /* @__PURE__ */ u.createContext(y), B = ["attr", "size", "title"];
20
- function W(e, t) {
21
- if (e == null) return {};
22
- var r = I(e, t), a, n;
23
- if (Object.getOwnPropertySymbols) {
24
- var s = Object.getOwnPropertySymbols(e);
25
- for (n = 0; n < s.length; n++)
26
- a = s[n], !(t.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(e, a) && (r[a] = e[a]);
27
- }
28
- return r;
29
- }
30
- function I(e, t) {
31
- if (e == null) return {};
32
- var r = {};
33
- for (var a in e)
34
- if (Object.prototype.hasOwnProperty.call(e, a)) {
35
- if (t.indexOf(a) >= 0) continue;
36
- r[a] = e[a];
37
- }
38
- return r;
39
- }
40
- function b() {
41
- return b = Object.assign ? Object.assign.bind() : function(e) {
42
- for (var t = 1; t < arguments.length; t++) {
43
- var r = arguments[t];
44
- for (var a in r)
45
- Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
46
- }
47
- return e;
48
- }, b.apply(this, arguments);
49
- }
50
- function h(e, t) {
51
- var r = Object.keys(e);
52
- if (Object.getOwnPropertySymbols) {
53
- var a = Object.getOwnPropertySymbols(e);
54
- t && (a = a.filter(function(n) {
55
- return Object.getOwnPropertyDescriptor(e, n).enumerable;
56
- })), r.push.apply(r, a);
57
- }
58
- return r;
59
- }
60
- function v(e) {
61
- for (var t = 1; t < arguments.length; t++) {
62
- var r = arguments[t] != null ? arguments[t] : {};
63
- t % 2 ? h(Object(r), !0).forEach(function(a) {
64
- L(e, a, r[a]);
65
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : h(Object(r)).forEach(function(a) {
66
- Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
67
- });
68
- }
69
- return e;
70
- }
71
- function L(e, t, r) {
72
- return t = F(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
73
- }
74
- function F(e) {
75
- var t = V(e, "string");
76
- return typeof t == "symbol" ? t : t + "";
77
- }
78
- function V(e, t) {
79
- if (typeof e != "object" || !e) return e;
80
- var r = e[Symbol.toPrimitive];
81
- if (r !== void 0) {
82
- var a = r.call(e, t || "default");
83
- if (typeof a != "object") return a;
84
- throw new TypeError("@@toPrimitive must return a primitive value.");
85
- }
86
- return (t === "string" ? String : Number)(e);
87
- }
88
- function j(e) {
89
- return e && e.map((t, r) => /* @__PURE__ */ u.createElement(t.tag, v({
90
- key: r
91
- }, t.attr), j(t.child)));
92
- }
93
- function H(e) {
94
- return (t) => /* @__PURE__ */ u.createElement(M, b({
95
- attr: v({}, e.attr)
96
- }, t), j(e.child));
97
- }
98
- function M(e) {
99
- var t = (r) => {
100
- var {
101
- attr: a,
102
- size: n,
103
- title: s
104
- } = e, p = W(e, B), g = n || r.size || "1em", c;
105
- return r.className && (c = r.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ u.createElement("svg", b({
106
- stroke: "currentColor",
107
- fill: "currentColor",
108
- strokeWidth: "0"
109
- }, r.attr, a, p, {
110
- className: c,
111
- style: v(v({
112
- color: e.color || r.color
113
- }, r.style), e.style),
114
- height: g,
115
- width: g,
116
- xmlns: "http://www.w3.org/2000/svg"
117
- }), s && /* @__PURE__ */ u.createElement("title", null, s), e.children);
118
- };
119
- return x !== void 0 ? /* @__PURE__ */ u.createElement(x.Consumer, null, (r) => t(r)) : t(y);
120
- }
121
- function w(e) {
122
- return H({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
123
- }
124
- const q = _(
125
- "inline-flex items-center justify-center 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 disabled:cursor-not-allowed",
126
- {
127
- variants: {
128
- variant: {
129
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
130
- destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
131
- destructiveOutline: "border border-red-500 text-destructive bg-transparent shadow-sm hover:bg-destructive hover:text-destructive-foreground",
132
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
133
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
134
- secondaryOutline: "bg-transparent border-[1px] border-solid border-white hover:bg-white hover:border-input",
135
- ghost: "hover:bg-accent hover:text-accent-foreground",
136
- link: "text-primary underline-offset-4 hover:underline"
137
- },
138
- size: {
139
- default: "h-10 px-4 py-2",
140
- xs: "h-8 px-3 text-xs",
141
- sm: "h-9 px-3",
142
- lg: "h-11 px-8",
143
- icon: "h-10 w-10",
144
- "icon-small": "h-8 w-8"
145
- },
146
- rounded: {
147
- small: "rounded",
148
- default: "rounded-md",
149
- large: "rounded-lg",
150
- full: "rounded-full"
151
- }
152
- },
153
- defaultVariants: {
154
- variant: "default",
155
- size: "default",
156
- rounded: "default"
157
- }
158
- }
159
- ), A = d.forwardRef(
160
- ({
161
- className: e,
162
- variant: t,
163
- size: r,
164
- rounded: a,
165
- asChild: n = !1,
166
- isLoading: s = !1,
167
- loadingText: p,
168
- disabled: g,
169
- ...c
170
- }, z) => {
171
- const R = n ? E : "button";
172
- return /* @__PURE__ */ o.jsx(
173
- R,
174
- {
175
- className: l(q({ variant: t, size: r, rounded: a, className: e })),
176
- ref: z,
177
- disabled: g || s,
178
- type: "button",
179
- ...c,
180
- children: s ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
181
- /* @__PURE__ */ o.jsx(
182
- w,
183
- {
184
- className: S(
185
- "h-4 w-4 animate-spin",
186
- p ? "mr-2" : ""
187
- )
188
- }
189
- ),
190
- p
191
- ] }) : c.children
192
- }
193
- );
194
- }
195
- );
196
- A.displayName = "Button";
197
- const G = i.Root, ie = i.Trigger, K = i.Portal, le = i.Close, N = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
198
- i.Overlay,
199
- {
200
- ref: r,
201
- className: l(
202
- "fixed inset-0 z-50 grid max-h-screen place-items-center overflow-y-auto bg-background/80 py-10 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
203
- e
204
- ),
205
- ...t
206
- }
207
- ));
208
- N.displayName = i.Overlay.displayName;
209
- const O = d.forwardRef(({ className: e, children: t, hideCloseButton: r, overlayStyles: a, ...n }, s) => /* @__PURE__ */ o.jsx(K, { children: /* @__PURE__ */ o.jsx(N, { className: a, children: /* @__PURE__ */ o.jsxs(
210
- i.Content,
211
- {
212
- ref: s,
213
- className: l(
214
- "relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",
215
- e
216
- ),
217
- ...n,
218
- children: [
219
- t,
220
- !r && /* @__PURE__ */ o.jsxs(
221
- i.Close,
222
- {
223
- type: "button",
224
- className: "absolute right-4 top-4 rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
225
- children: [
226
- /* @__PURE__ */ o.jsx(k, { className: "h-4 w-4" }),
227
- /* @__PURE__ */ o.jsx("span", { className: "sr-only", children: "Close" })
228
- ]
229
- }
230
- )
231
- ]
232
- }
233
- ) }) }));
234
- O.displayName = i.Content.displayName;
235
- const P = ({
236
- className: e,
237
- ...t
238
- }) => /* @__PURE__ */ o.jsx(
239
- "div",
240
- {
241
- className: l(
242
- "flex flex-col space-y-1.5 text-center sm:text-left",
243
- e
244
- ),
245
- ...t
246
- }
247
- );
248
- P.displayName = "DialogHeader";
249
- const X = ({
250
- className: e,
251
- ...t
252
- }) => /* @__PURE__ */ o.jsx(
253
- "div",
254
- {
255
- className: l(
256
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
257
- e
258
- ),
259
- ...t
260
- }
261
- );
262
- X.displayName = "DialogFooter";
263
- const T = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
264
- i.Title,
265
- {
266
- ref: r,
267
- className: l(
268
- "text-lg font-semibold leading-none tracking-tight",
269
- e
270
- ),
271
- ...t
272
- }
273
- ));
274
- T.displayName = i.Title.displayName;
275
- const C = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
276
- i.Description,
277
- {
278
- ref: r,
279
- className: l("text-sm text-muted-foreground", e),
280
- ...t
281
- }
282
- ));
283
- C.displayName = i.Description.displayName;
284
- const de = ({
285
- isOpen: e,
286
- onClose: t,
287
- children: r,
288
- title: a,
289
- contentClassName: n,
290
- modal: s = !0
291
- }) => /* @__PURE__ */ o.jsx(G, { open: e, onOpenChange: t, modal: s, children: /* @__PURE__ */ o.jsxs(O, { className: n, children: [
292
- a && /* @__PURE__ */ o.jsxs(P, { className: "flex-1 font-medium", children: [
293
- /* @__PURE__ */ o.jsx(T, { children: a }),
294
- /* @__PURE__ */ o.jsx(C, {})
295
- ] }),
296
- /* @__PURE__ */ o.jsx("div", { className: "w-full", children: r })
297
- ] }) }), ce = ({ className: e }) => /* @__PURE__ */ o.jsx(w, { className: l("h-8 w-8 animate-spin font-light", e) }), ue = f.Root, J = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
298
- f.List,
299
- {
300
- ref: r,
301
- className: l(
302
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
303
- e
304
- ),
305
- ...t
306
- }
307
- ));
308
- J.displayName = f.List.displayName;
309
- const Q = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
310
- f.Trigger,
311
- {
312
- ref: r,
313
- className: l(
314
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
315
- e
316
- ),
317
- "data-levo-studio-interactive": "true",
318
- ...t
319
- }
320
- ));
321
- Q.displayName = f.Trigger.displayName;
322
- const U = d.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o.jsx(
323
- f.Content,
324
- {
325
- ref: r,
326
- className: l(
327
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
328
- e
329
- ),
330
- ...t
331
- }
332
- ));
333
- U.displayName = f.Content.displayName;
334
- const fe = m.Provider, Y = m.Root, Z = m.Trigger, $ = m.Portal, D = d.forwardRef(({ className: e, sideOffset: t = 4, ...r }, a) => /* @__PURE__ */ o.jsx(
335
- m.Content,
336
- {
337
- ref: a,
338
- sideOffset: t,
339
- className: l(
340
- "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-xs 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",
341
- e
342
- ),
343
- ...r
344
- }
345
- ));
346
- D.displayName = m.Content.displayName;
347
- const me = ({
348
- children: e,
349
- label: t,
350
- labelClassName: r,
351
- contentClassName: a,
352
- asChild: n = !0,
353
- contentProps: s = {}
354
- }) => /* @__PURE__ */ o.jsxs(Y, { children: [
355
- t && /* @__PURE__ */ o.jsx($, { children: /* @__PURE__ */ o.jsx(D, { className: r, ...s, children: /* @__PURE__ */ o.jsx("p", { className: a, children: t }) }) }),
356
- /* @__PURE__ */ o.jsx(Z, { asChild: n, children: e })
357
- ] });
358
- export {
359
- A as B,
360
- G as D,
361
- ce as S,
362
- ue as T,
363
- K as a,
364
- q as b,
365
- N as c,
366
- ie as d,
367
- O as e,
368
- P as f,
369
- X as g,
370
- T as h,
371
- C as i,
372
- le as j,
373
- de as k,
374
- J as l,
375
- Q as m,
376
- U as n,
377
- Y as o,
378
- Z as p,
379
- D as q,
380
- fe as r,
381
- me as s,
382
- $ as t
383
- };
@@ -1,19 +0,0 @@
1
- import { getLevoError as c } from "@levo-so/core";
2
- import { e as a } from "./Sonner-5IAqCkBs.js";
3
- const d = (t, o = 2) => {
4
- if (t === 0) return "0 B";
5
- const r = 1024, e = o < 0 ? 0 : o, n = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], s = Math.floor(Math.log(t) / Math.log(r));
6
- return `${Number.parseFloat((t / r ** s).toFixed(e))} ${n[s]}`;
7
- }, j = (t) => {
8
- const o = c(t);
9
- return a(o.message, o.title), o;
10
- }, i = (t) => t instanceof Date, B = (t) => t == null, f = (t) => typeof t == "object", p = (t) => !B(t) && !Array.isArray(t) && f(t) && !i(t), l = (t) => p(t) && !Object.keys(t).length;
11
- export {
12
- l as a,
13
- d as b,
14
- B as c,
15
- f as d,
16
- j as e,
17
- p as f,
18
- i
19
- };