@levo-so/react 0.1.78 → 0.1.80
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/index.js +611 -80
- package/package.json +6 -6
- package/dist/audience/components/block.js +0 -32
- package/dist/audience/components/component.js +0 -13
- package/dist/audience/components/page.js +0 -19
- package/dist/components/Dialog.js +0 -84
- package/dist/components/DialogWrapper.js +0 -20
- package/dist/components/Sonner.js +0 -41
- package/dist/components/Spinner.js +0 -8
- package/dist/components/Tabs.js +0 -48
- package/dist/components/Tooltip.js +0 -30
- package/dist/components/button/Button.js +0 -41
- package/dist/components/button/buttonVariants.js +0 -40
- package/dist/constants/fileUploadPresets.js +0 -75
- package/dist/membership/components/Button.js +0 -13
- package/dist/membership/components/Container.js +0 -52
- package/dist/membership/components/Core.js +0 -33
- package/dist/membership/components/Popup.js +0 -56
- package/dist/membership/index.js +0 -9
- package/dist/membership/useLevoOAuth.js +0 -76
- package/dist/providers/LevoProvider.js +0 -19
- package/dist/utils/byteToSize.js +0 -9
- package/dist/utils/cn.js +0 -7
- package/dist/utils/errorHandler.js +0 -11
- package/dist/utils/isDateObject.js +0 -4
- package/dist/utils/isEmptyObject.js +0 -5
- package/dist/utils/isNullOrUndefined.js +0 -4
- package/dist/utils/isObject.js +0 -7
- /package/dist/{styles/index.css → index.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.80",
|
|
4
4
|
"author": "Levo Engineering <devs@theinternetfolks.com>",
|
|
5
5
|
"description": "Levo suite for React based applications",
|
|
6
6
|
"type": "module",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": ">=18",
|
|
18
18
|
"react-dom": ">=18",
|
|
19
|
-
"@levo-so/core": "0.1.
|
|
20
|
-
"@levo-so/insights": "0.1.
|
|
19
|
+
"@levo-so/core": "0.1.80",
|
|
20
|
+
"@levo-so/insights": "0.1.80"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"class-variance-authority": "0.7.0",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"vite": "7.2.4",
|
|
44
44
|
"vite-plugin-dts": "4.1.0",
|
|
45
45
|
"vite-plugin-externalize-deps": "0.10.0",
|
|
46
|
-
"@levo-so/core": "0.1.
|
|
46
|
+
"@levo-so/core": "0.1.80",
|
|
47
|
+
"@levo-so/insights": "0.1.80",
|
|
47
48
|
"@levo/tw-config": "0.0.0",
|
|
48
|
-
"@levo-so/insights": "0.1.78",
|
|
49
49
|
"@levo/ts-config": "0.0.0"
|
|
50
50
|
},
|
|
51
51
|
"main": "./dist/index.js",
|
|
52
52
|
"module": "./dist/index.js",
|
|
53
53
|
"types": "./dist/index.d.ts",
|
|
54
54
|
"exports": {
|
|
55
|
-
"./index.css": "./dist/
|
|
55
|
+
"./index.css": "./dist/index.css",
|
|
56
56
|
".": {
|
|
57
57
|
"types": "./dist/index.d.ts",
|
|
58
58
|
"default": "./dist/index.js"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState as a, useEffect as l } from "react";
|
|
3
|
-
import { useLevoInsights as d } from "../../providers/LevoProvider.js";
|
|
4
|
-
const v = ({ id: e, properties: c = {} }) => {
|
|
5
|
-
const t = d(), [n, s] = a(!1);
|
|
6
|
-
return l(() => {
|
|
7
|
-
if (n || typeof t?.track != "function") return;
|
|
8
|
-
const o = document.getElementById(e);
|
|
9
|
-
if (!o) return;
|
|
10
|
-
const i = () => {
|
|
11
|
-
n || (t?.track("block.view", {
|
|
12
|
-
...c,
|
|
13
|
-
resource: "block",
|
|
14
|
-
identifier: e
|
|
15
|
-
}), s(!0));
|
|
16
|
-
}, r = new IntersectionObserver(
|
|
17
|
-
(u) => {
|
|
18
|
-
u.forEach((f) => {
|
|
19
|
-
f.isIntersecting && (i(), r.disconnect());
|
|
20
|
-
});
|
|
21
|
-
},
|
|
22
|
-
{ threshold: 0 }
|
|
23
|
-
);
|
|
24
|
-
return r.observe(o), () => {
|
|
25
|
-
r.disconnect();
|
|
26
|
-
};
|
|
27
|
-
}, [t, e, c, n]), null;
|
|
28
|
-
};
|
|
29
|
-
export {
|
|
30
|
-
v as LevoAudienceBlock,
|
|
31
|
-
v as default
|
|
32
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect as n } from "react";
|
|
3
|
-
import { useLevoInsights as u } from "../../providers/LevoProvider.js";
|
|
4
|
-
const r = ({ event: e, properties: o }) => {
|
|
5
|
-
const t = u();
|
|
6
|
-
return n(() => {
|
|
7
|
-
t?.track(e, o);
|
|
8
|
-
}, [t, e, o]), null;
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
r as LevoAudienceComponent,
|
|
12
|
-
r as default
|
|
13
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect as o } from "react";
|
|
3
|
-
import { useLevo as t, useLevoInsights as f } from "../../providers/LevoProvider.js";
|
|
4
|
-
const d = ({ id: n }) => {
|
|
5
|
-
const i = t(), e = f();
|
|
6
|
-
return o(() => {
|
|
7
|
-
i && typeof window < "u" && (window.levo_client = i);
|
|
8
|
-
}, [i]), o(() => {
|
|
9
|
-
e && typeof window < "u" && (window.levo_insights = e);
|
|
10
|
-
}, [e]), o(() => {
|
|
11
|
-
e && n && e.init({
|
|
12
|
-
pageId: n
|
|
13
|
-
});
|
|
14
|
-
}, [e, n]), null;
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
d as LevoAudiencePage,
|
|
18
|
-
d as default
|
|
19
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { X as p } from "lucide-react";
|
|
4
|
-
import { Dialog as e } from "radix-ui";
|
|
5
|
-
import * as l from "react";
|
|
6
|
-
import { cn as i } from "../utils/cn.js";
|
|
7
|
-
const C = e.Root, R = e.Trigger, f = e.Portal, k = e.Close, r = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
8
|
-
e.Overlay,
|
|
9
|
-
{
|
|
10
|
-
ref: s,
|
|
11
|
-
className: i(
|
|
12
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 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=closed]:animate-out data-[state=open]:animate-in",
|
|
13
|
-
a
|
|
14
|
-
),
|
|
15
|
-
...t
|
|
16
|
-
}
|
|
17
|
-
));
|
|
18
|
-
r.displayName = e.Overlay.displayName;
|
|
19
|
-
const u = l.forwardRef(({ className: a, children: t, container: s, hideCloseButton: d, overlayStyles: c, ...m }, g) => /* @__PURE__ */ o(f, { container: s, children: /* @__PURE__ */ o(r, { className: c, children: /* @__PURE__ */ n(
|
|
20
|
-
e.Content,
|
|
21
|
-
{
|
|
22
|
-
ref: g,
|
|
23
|
-
className: i(
|
|
24
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:rounded-lg",
|
|
25
|
-
a
|
|
26
|
-
),
|
|
27
|
-
...m,
|
|
28
|
-
children: [
|
|
29
|
-
t,
|
|
30
|
-
!d && /* @__PURE__ */ n(
|
|
31
|
-
e.Close,
|
|
32
|
-
{
|
|
33
|
-
type: "button",
|
|
34
|
-
className: "absolute top-4 right-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",
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ o(p, { className: "h-4 w-4" }),
|
|
37
|
-
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
) }) }));
|
|
44
|
-
u.displayName = e.Content.displayName;
|
|
45
|
-
const y = ({ className: a, ...t }) => /* @__PURE__ */ o("div", { className: i("flex flex-col space-y-1.5 text-center sm:text-left", a), ...t });
|
|
46
|
-
y.displayName = "DialogHeader";
|
|
47
|
-
const N = ({ className: a, ...t }) => /* @__PURE__ */ o(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: i("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a),
|
|
51
|
-
...t
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
N.displayName = "DialogFooter";
|
|
55
|
-
const x = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
56
|
-
e.Title,
|
|
57
|
-
{
|
|
58
|
-
ref: s,
|
|
59
|
-
className: i("font-semibold text-lg leading-none tracking-tight", a),
|
|
60
|
-
...t
|
|
61
|
-
}
|
|
62
|
-
));
|
|
63
|
-
x.displayName = e.Title.displayName;
|
|
64
|
-
const D = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
|
|
65
|
-
e.Description,
|
|
66
|
-
{
|
|
67
|
-
ref: s,
|
|
68
|
-
className: i("text-muted-foreground text-sm", a),
|
|
69
|
-
...t
|
|
70
|
-
}
|
|
71
|
-
));
|
|
72
|
-
D.displayName = e.Description.displayName;
|
|
73
|
-
export {
|
|
74
|
-
C as Dialog,
|
|
75
|
-
k as DialogClose,
|
|
76
|
-
u as DialogContent,
|
|
77
|
-
D as DialogDescription,
|
|
78
|
-
N as DialogFooter,
|
|
79
|
-
y as DialogHeader,
|
|
80
|
-
r as DialogOverlay,
|
|
81
|
-
f as DialogPortal,
|
|
82
|
-
x as DialogTitle,
|
|
83
|
-
R as DialogTrigger
|
|
84
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { Dialog as m, DialogContent as d, DialogHeader as p, DialogTitle as t, DialogDescription as g } from "./Dialog.js";
|
|
3
|
-
const f = ({
|
|
4
|
-
isOpen: o,
|
|
5
|
-
onClose: a,
|
|
6
|
-
children: r,
|
|
7
|
-
title: i,
|
|
8
|
-
description: n = "",
|
|
9
|
-
contentClassName: s,
|
|
10
|
-
modal: c = !0
|
|
11
|
-
}) => /* @__PURE__ */ e(m, { open: o, onOpenChange: a, modal: c, children: /* @__PURE__ */ l(d, { className: s, children: [
|
|
12
|
-
i && /* @__PURE__ */ l(p, { className: "flex-1 font-medium", children: [
|
|
13
|
-
/* @__PURE__ */ e(t, { children: i }),
|
|
14
|
-
/* @__PURE__ */ e(g, { children: n })
|
|
15
|
-
] }),
|
|
16
|
-
/* @__PURE__ */ e("div", { className: "w-full", children: r })
|
|
17
|
-
] }) });
|
|
18
|
-
export {
|
|
19
|
-
f as DialogWrapper
|
|
20
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { Toaster as a, toast as s } from "sonner";
|
|
4
|
-
import { toast as m } from "sonner";
|
|
5
|
-
const g = ({ ...t }) => /* @__PURE__ */ e(
|
|
6
|
-
a,
|
|
7
|
-
{
|
|
8
|
-
closeButton: !0,
|
|
9
|
-
richColors: !0,
|
|
10
|
-
className: "toaster group",
|
|
11
|
-
toastOptions: {
|
|
12
|
-
classNames: {
|
|
13
|
-
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
14
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
15
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
16
|
-
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
...t
|
|
20
|
-
}
|
|
21
|
-
), c = (t, r = "Error", o = {}) => {
|
|
22
|
-
s.error(r, {
|
|
23
|
-
description: t,
|
|
24
|
-
duration: 4e3,
|
|
25
|
-
position: "bottom-right",
|
|
26
|
-
...o
|
|
27
|
-
});
|
|
28
|
-
}, p = (t, r = "Success", o = {}) => {
|
|
29
|
-
o?.id && s.dismiss(o?.id), s.success(r, {
|
|
30
|
-
description: t,
|
|
31
|
-
duration: 4e3,
|
|
32
|
-
position: "bottom-right",
|
|
33
|
-
...o
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
g as Toaster,
|
|
38
|
-
c as errorToast,
|
|
39
|
-
p as successToast,
|
|
40
|
-
m as toast
|
|
41
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { BiLoaderAlt as r } from "react-icons/bi";
|
|
3
|
-
import { cn as i } from "../utils/cn.js";
|
|
4
|
-
const e = ({ className: o }) => /* @__PURE__ */ t(r, { className: i("h-8 w-8 animate-spin font-light", o) });
|
|
5
|
-
export {
|
|
6
|
-
e as Spinner,
|
|
7
|
-
e as default
|
|
8
|
-
};
|
package/dist/components/Tabs.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { Tabs as e } from "radix-ui";
|
|
4
|
-
import * as o from "react";
|
|
5
|
-
import { cn as n } from "../utils/cn.js";
|
|
6
|
-
const u = e.Root, r = o.forwardRef(({ className: t, ...i }, s) => /* @__PURE__ */ a(
|
|
7
|
-
e.List,
|
|
8
|
-
{
|
|
9
|
-
ref: s,
|
|
10
|
-
className: n(
|
|
11
|
-
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
12
|
-
t
|
|
13
|
-
),
|
|
14
|
-
...i
|
|
15
|
-
}
|
|
16
|
-
));
|
|
17
|
-
r.displayName = e.List.displayName;
|
|
18
|
-
const f = o.forwardRef(({ className: t, ...i }, s) => /* @__PURE__ */ a(
|
|
19
|
-
e.Trigger,
|
|
20
|
-
{
|
|
21
|
-
ref: s,
|
|
22
|
-
className: n(
|
|
23
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm 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",
|
|
24
|
-
t
|
|
25
|
-
),
|
|
26
|
-
"data-levo-studio-interactive": "true",
|
|
27
|
-
...i
|
|
28
|
-
}
|
|
29
|
-
));
|
|
30
|
-
f.displayName = e.Trigger.displayName;
|
|
31
|
-
const d = o.forwardRef(({ className: t, ...i }, s) => /* @__PURE__ */ a(
|
|
32
|
-
e.Content,
|
|
33
|
-
{
|
|
34
|
-
ref: s,
|
|
35
|
-
className: n(
|
|
36
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
37
|
-
t
|
|
38
|
-
),
|
|
39
|
-
...i
|
|
40
|
-
}
|
|
41
|
-
));
|
|
42
|
-
d.displayName = e.Content.displayName;
|
|
43
|
-
export {
|
|
44
|
-
u as Tabs,
|
|
45
|
-
d as TabsContent,
|
|
46
|
-
r as TabsList,
|
|
47
|
-
f as TabsTrigger
|
|
48
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
3
|
-
import { Tooltip as o } from "radix-ui";
|
|
4
|
-
import * as p from "react";
|
|
5
|
-
import { cn as m } from "../utils/cn.js";
|
|
6
|
-
const x = o.Provider, c = o.Root, f = o.Trigger, T = o.Portal, d = p.forwardRef(({ className: i, sideOffset: t = 4, ...r }, a) => /* @__PURE__ */ e(
|
|
7
|
-
o.Content,
|
|
8
|
-
{
|
|
9
|
-
ref: a,
|
|
10
|
-
sideOffset: t,
|
|
11
|
-
className: m(
|
|
12
|
-
"fade-in-0 zoom-in-95 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 z-50 animate-in overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-popover-foreground text-xs shadow-md data-[state=closed]:animate-out",
|
|
13
|
-
i
|
|
14
|
-
),
|
|
15
|
-
...r
|
|
16
|
-
}
|
|
17
|
-
));
|
|
18
|
-
d.displayName = o.Content.displayName;
|
|
19
|
-
const v = ({ children: i, label: t, labelClassName: r, asChild: a = !0, contentProps: s = {}, side: n }) => /* @__PURE__ */ l(c, { children: [
|
|
20
|
-
t && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(d, { side: n, className: r, ...s, children: t }) }),
|
|
21
|
-
/* @__PURE__ */ e(f, { asChild: a, children: i })
|
|
22
|
-
] });
|
|
23
|
-
export {
|
|
24
|
-
v as SimpleTooltipWrapper,
|
|
25
|
-
c as Tooltip,
|
|
26
|
-
d as TooltipContent,
|
|
27
|
-
T as TooltipPortal,
|
|
28
|
-
x as TooltipProvider,
|
|
29
|
-
f as TooltipTrigger
|
|
30
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as m, jsxs as c, Fragment as d } from "react/jsx-runtime";
|
|
2
|
-
import { Slot as u } from "radix-ui";
|
|
3
|
-
import * as b from "react";
|
|
4
|
-
import { BiLoaderAlt as h } from "react-icons/bi";
|
|
5
|
-
import { twMerge as w } from "tailwind-merge";
|
|
6
|
-
import { cn as B } from "../../utils/cn.js";
|
|
7
|
-
import { buttonVariants as N } from "./buttonVariants.js";
|
|
8
|
-
const R = b.forwardRef(
|
|
9
|
-
({
|
|
10
|
-
className: e,
|
|
11
|
-
variant: a,
|
|
12
|
-
size: s,
|
|
13
|
-
rounded: n,
|
|
14
|
-
asChild: i = !1,
|
|
15
|
-
isLoading: t = !1,
|
|
16
|
-
loadingText: r,
|
|
17
|
-
disabled: f,
|
|
18
|
-
...o
|
|
19
|
-
}, l) => {
|
|
20
|
-
const p = i ? u.Root : "button";
|
|
21
|
-
return /* @__PURE__ */ m(
|
|
22
|
-
p,
|
|
23
|
-
{
|
|
24
|
-
className: B(N({ variant: a, size: s, rounded: n, className: e })),
|
|
25
|
-
ref: l,
|
|
26
|
-
disabled: f || t,
|
|
27
|
-
type: "button",
|
|
28
|
-
...o,
|
|
29
|
-
children: t ? /* @__PURE__ */ c(d, { children: [
|
|
30
|
-
/* @__PURE__ */ m(h, { className: w("h-4 w-4 animate-spin", r ? "mr-2" : "") }),
|
|
31
|
-
r
|
|
32
|
-
] }) : o.children
|
|
33
|
-
}
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
R.displayName = "Button";
|
|
38
|
-
export {
|
|
39
|
-
R as Button,
|
|
40
|
-
R as default
|
|
41
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { cva as e } from "class-variance-authority";
|
|
2
|
-
const t = e(
|
|
3
|
-
"inline-flex items-center justify-center font-medium text-sm 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:cursor-not-allowed disabled:opacity-50",
|
|
4
|
-
{
|
|
5
|
-
variants: {
|
|
6
|
-
variant: {
|
|
7
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
8
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90",
|
|
9
|
-
destructiveOutline: "border border-red-500 bg-transparent text-destructive shadow-sm hover:bg-destructive hover:text-white",
|
|
10
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
11
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
12
|
-
secondaryOutline: "border border-white border-solid bg-transparent hover:border-input hover:bg-white",
|
|
13
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: "h-10 px-4 py-2",
|
|
18
|
-
xs: "h-8 px-3 text-xs",
|
|
19
|
-
sm: "h-9 px-3",
|
|
20
|
-
lg: "h-11 px-8",
|
|
21
|
-
icon: "h-10 w-10",
|
|
22
|
-
"icon-small": "h-8 w-8"
|
|
23
|
-
},
|
|
24
|
-
rounded: {
|
|
25
|
-
small: "rounded",
|
|
26
|
-
default: "rounded-md",
|
|
27
|
-
large: "rounded-lg",
|
|
28
|
-
full: "rounded-full"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
variant: "default",
|
|
33
|
-
size: "default",
|
|
34
|
-
rounded: "default"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
export {
|
|
39
|
-
t as buttonVariants
|
|
40
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const o = [
|
|
2
|
-
"pdf",
|
|
3
|
-
"txt",
|
|
4
|
-
"xml",
|
|
5
|
-
"xls",
|
|
6
|
-
"xlsx",
|
|
7
|
-
"ods",
|
|
8
|
-
"odt",
|
|
9
|
-
"doc",
|
|
10
|
-
"docx",
|
|
11
|
-
"csv",
|
|
12
|
-
"odp",
|
|
13
|
-
"ppt",
|
|
14
|
-
"pptx"
|
|
15
|
-
], p = ["svg", "png", "jpg", "jpeg", "gif", "webp", "avif"], t = ["mp4", "ogv", "webm"], m = ["mp3", "ogg", "opus"], n = {
|
|
16
|
-
"application/xml": [".xml"],
|
|
17
|
-
"text/plain": [".txt"],
|
|
18
|
-
"application/pdf": [".pdf"],
|
|
19
|
-
"application/msword": [".doc"],
|
|
20
|
-
"application/vnd.ms-excel": [".xls"],
|
|
21
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
22
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
23
|
-
"text/csv": [".csv"]
|
|
24
|
-
}, s = {
|
|
25
|
-
"image/jpeg": [".jpeg", ".jpg"],
|
|
26
|
-
"image/jpg": [".jpg"],
|
|
27
|
-
"image/png": [".png"],
|
|
28
|
-
"image/gif": [".gif"],
|
|
29
|
-
"image/svg": [".svg"],
|
|
30
|
-
"image/svg+xml": [".svg"],
|
|
31
|
-
"image/webp": [".webp"],
|
|
32
|
-
"image/avif": [".avif"]
|
|
33
|
-
}, a = {
|
|
34
|
-
"video/mp4": [".mp4"],
|
|
35
|
-
"video/mpeg": [".mpeg"],
|
|
36
|
-
"video/webm": [".webm"]
|
|
37
|
-
}, d = {
|
|
38
|
-
"audio/mpeg": [".mp3"],
|
|
39
|
-
"audio/ogg": [".oga"],
|
|
40
|
-
"audio/opus": [".opus"]
|
|
41
|
-
}, e = {
|
|
42
|
-
audio: d,
|
|
43
|
-
document: n,
|
|
44
|
-
image: s,
|
|
45
|
-
video: a
|
|
46
|
-
}, i = {
|
|
47
|
-
audio: m,
|
|
48
|
-
document: o,
|
|
49
|
-
image: p,
|
|
50
|
-
video: t
|
|
51
|
-
}, g = [
|
|
52
|
-
...i.audio,
|
|
53
|
-
...i.document,
|
|
54
|
-
...i.image,
|
|
55
|
-
...i.video
|
|
56
|
-
], c = {
|
|
57
|
-
...e.audio,
|
|
58
|
-
...e.document,
|
|
59
|
-
...e.image,
|
|
60
|
-
...e.video
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
g as allMediaFileExtensions,
|
|
64
|
-
c as allMediaMimetypes,
|
|
65
|
-
m as audioFileExtensions,
|
|
66
|
-
d as audioMimetype,
|
|
67
|
-
o as documentFileExtensions,
|
|
68
|
-
n as documentMimetype,
|
|
69
|
-
p as imageFileExtensions,
|
|
70
|
-
s as imageMimetype,
|
|
71
|
-
i as mediaExtensionsByKind,
|
|
72
|
-
e as mediaMimetypeByKind,
|
|
73
|
-
t as videoFileExtensions,
|
|
74
|
-
a as videoMimetype
|
|
75
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { useLevoOAuth as c } from "./Container.js";
|
|
4
|
-
import m from "./Core.js";
|
|
5
|
-
import { Spinner as a } from "../../components/Spinner.js";
|
|
6
|
-
const A = ({ children: o, provider: t }) => {
|
|
7
|
-
const { title: n, urls: s, isLoading: u, onSuccess: i, onError: l } = c(), e = s?.[t];
|
|
8
|
-
return e ? /* @__PURE__ */ r(m, { title: n, provider: t, url: e, onSuccess: i, onError: l, children: u ? /* @__PURE__ */ r("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ r(a, { className: "h-5 w-5 bg-brand" }) }) : o }) : null;
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
A as LevoOAuthButton,
|
|
12
|
-
A as default
|
|
13
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as y } from "react/jsx-runtime";
|
|
3
|
-
import w, { useState as g, useEffect as p, useMemo as C, useContext as _ } from "react";
|
|
4
|
-
import { useLevo as R } from "../../providers/LevoProvider.js";
|
|
5
|
-
const L = w.createContext({
|
|
6
|
-
urls: null,
|
|
7
|
-
title: "",
|
|
8
|
-
isLoading: !1,
|
|
9
|
-
onSuccess: () => {
|
|
10
|
-
},
|
|
11
|
-
onError: () => {
|
|
12
|
-
}
|
|
13
|
-
}), S = ({ title: c, onSuccess: i, onError: o, children: O }) => {
|
|
14
|
-
const s = R(), n = typeof window < "u" ? window.location.href : "", [t, u] = g(null), [a, f] = g(!1);
|
|
15
|
-
p(() => {
|
|
16
|
-
s.membership && (f(!0), s.membership?.getOAuthURL().then((e) => {
|
|
17
|
-
u(e);
|
|
18
|
-
}).catch((e) => {
|
|
19
|
-
o({
|
|
20
|
-
code: e?.code || "SOMETHING_WENT_WRONG",
|
|
21
|
-
message: e?.message || "We could not connect with our service for your sign-in."
|
|
22
|
-
});
|
|
23
|
-
}).finally(() => {
|
|
24
|
-
f(!1);
|
|
25
|
-
}));
|
|
26
|
-
}, []);
|
|
27
|
-
const x = C(
|
|
28
|
-
() => ({ title: c, urls: t, isLoading: a, onSuccess: i, onError: o }),
|
|
29
|
-
[c, t, i, o, a]
|
|
30
|
-
);
|
|
31
|
-
return p(() => {
|
|
32
|
-
if (t && n) {
|
|
33
|
-
const e = {}, v = Object.keys(t);
|
|
34
|
-
for (const l of v)
|
|
35
|
-
try {
|
|
36
|
-
const r = t[l];
|
|
37
|
-
if (r) {
|
|
38
|
-
const m = new URL(r), h = m.searchParams;
|
|
39
|
-
h.set("redirect_uri", n);
|
|
40
|
-
const d = s.pageContext;
|
|
41
|
-
d && h.set("page_context", JSON.stringify(d)), e[l] = m.toString();
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
}
|
|
45
|
-
u(e);
|
|
46
|
-
}
|
|
47
|
-
}, [n]), /* @__PURE__ */ y(L.Provider, { value: x, children: O });
|
|
48
|
-
}, U = () => _(L);
|
|
49
|
-
export {
|
|
50
|
-
S as default,
|
|
51
|
-
U as useLevoOAuth
|
|
52
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback as m } from "react";
|
|
4
|
-
import p from "./Popup.js";
|
|
5
|
-
const x = ({
|
|
6
|
-
title: e = "Levo",
|
|
7
|
-
url: r,
|
|
8
|
-
children: t,
|
|
9
|
-
onSuccess: s,
|
|
10
|
-
onError: u,
|
|
11
|
-
width: n = 500,
|
|
12
|
-
height: c = 700
|
|
13
|
-
}) => {
|
|
14
|
-
const l = m((f, o) => {
|
|
15
|
-
f.toLowerCase() === "success" ? s(o) : u(o);
|
|
16
|
-
}, []);
|
|
17
|
-
return /* @__PURE__ */ i(
|
|
18
|
-
p,
|
|
19
|
-
{
|
|
20
|
-
title: e,
|
|
21
|
-
width: n,
|
|
22
|
-
height: c,
|
|
23
|
-
onClose: () => {
|
|
24
|
-
},
|
|
25
|
-
url: r,
|
|
26
|
-
onCode: l,
|
|
27
|
-
children: t
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
x as default
|
|
33
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import { useState as x, useRef as h, useEffect as v } from "react";
|
|
4
|
-
const P = ({ url: o, title: c, height: t, width: n }) => {
|
|
5
|
-
const i = window.screenX + (window.outerWidth - n) / 2, s = window.screenY + (window.outerHeight - t) / 2.5;
|
|
6
|
-
return window.open(
|
|
7
|
-
o,
|
|
8
|
-
c,
|
|
9
|
-
`width=${n},height=${t},left=${i},top=${s}`
|
|
10
|
-
);
|
|
11
|
-
}, W = ({
|
|
12
|
-
title: o = "",
|
|
13
|
-
width: c = 500,
|
|
14
|
-
height: t = 500,
|
|
15
|
-
url: n,
|
|
16
|
-
children: i,
|
|
17
|
-
onCode: s,
|
|
18
|
-
onClose: r
|
|
19
|
-
}) => {
|
|
20
|
-
const [e, f] = x(), a = h(void 0), l = () => {
|
|
21
|
-
window.clearInterval(a.current);
|
|
22
|
-
}, p = () => {
|
|
23
|
-
f(
|
|
24
|
-
P({
|
|
25
|
-
url: n,
|
|
26
|
-
title: o,
|
|
27
|
-
width: c,
|
|
28
|
-
height: t
|
|
29
|
-
})
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
return v(() => (e && (a.current = window.setInterval(() => {
|
|
33
|
-
try {
|
|
34
|
-
const u = e.location.href, w = new URL(u).searchParams, d = w.get("code");
|
|
35
|
-
if (!d)
|
|
36
|
-
return;
|
|
37
|
-
s(d, w), l(), e.close();
|
|
38
|
-
} catch {
|
|
39
|
-
} finally {
|
|
40
|
-
(!e || e.closed) && (r(), l());
|
|
41
|
-
}
|
|
42
|
-
}, 700)), () => {
|
|
43
|
-
e && e.close(), r && r();
|
|
44
|
-
}), [e]), /* @__PURE__ */ m(
|
|
45
|
-
"div",
|
|
46
|
-
{
|
|
47
|
-
onClick: () => {
|
|
48
|
-
p();
|
|
49
|
-
},
|
|
50
|
-
children: i
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
export {
|
|
55
|
-
W as default
|
|
56
|
-
};
|