@levo-so/studio 0.1.102 → 0.1.104
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/{AuthProvider-56TywIOB.js → AuthProvider-C6bvedwF.js} +16 -16
- package/{BillingStep-BTRobf00.js → BillingStep-2cKT5Pir.js} +1 -1
- package/{Button-DTrN8kki.js → Button-DtPwDEN0.js} +240 -143
- package/Button-lUfKisu8.js +116 -0
- package/CollectionField-xa-jed3_.js +232 -0
- package/{CollectionInput-lHOvWWav.js → CollectionInput-CpNGIXJx.js} +32 -32
- package/DateTimeWidget-DPHIhkAi.js +256 -0
- package/Dialog-IrII0ugb.js +130 -0
- package/{EntryCard-CqZlbw1Z.js → EntryCard-j4uZb2cE.js} +6 -6
- package/{LoginCard-DWLnYJJU.js → LoginCard-asvOHIRg.js} +3 -3
- package/{LoginForm-CEUbBeE3.js → LoginForm-BdsPVHdO.js} +200 -200
- package/{LoginModal-AWNLO49X.js → LoginModal-CyvbEK26.js} +4 -4
- package/{MessageCard-C5ULcfuw.js → MessageCard-lrXKEsBP.js} +2 -2
- package/{MessageFooter-CATwNJJU.js → MessageFooter-D-dCrzJH.js} +2 -2
- package/{ModalManager-DQXhkmyC.js → ModalManager-BcPk4sbK.js} +1 -1
- package/{PendingApprovalCard-BowwZMBu.js → PendingApprovalCard-hYkupl9A.js} +3 -3
- package/PhoneWidget-BOFhs8Ra.js +100 -0
- package/{Popover-Du4iigVw.js → Popover-O1poOHk2.js} +19 -20
- package/PopupRenderer-C7OHYphU-IWM6d7gW.js +2668 -0
- package/{RichTextWidget-iYdVRBGB.js → RichTextWidget-18XLL8wW.js} +27 -25
- package/RteThemeProvider-Cfepkyer.js +20 -0
- package/{StripePaymentModal-DC-ySB_o.js → StripePaymentModal-DrLMN18M.js} +17 -17
- package/Toolbar-Y6JtgPFn.js +645 -0
- package/Tooltip-NEMQqPyr.js +67 -0
- package/VerifyButton-TNkt-SDu.js +177 -0
- package/bookingCard-BdV2YSkq.js +636 -0
- package/collection.js +8 -8
- package/{dialog-CCWrvmHd.js → dialog-C8-iHixJ.js} +32 -32
- package/dist-CsX9NP5P.js +3188 -0
- package/generateRadiusScale-BpcgkGtN.js +71 -0
- package/getFieldValidations-CSkSV2hW.js +90 -0
- package/index.d.ts +53 -2
- package/index.js +5867 -7655
- package/inlineRteTheme-Ajq9PNpQ.js +9 -0
- package/{nodeAlignment-DoVbjk29.js → nodeAlignment-DKCIjzlR.js} +3 -3
- package/package.json +60 -76
- package/rolldown-runtime-CAFD8bLK.js +11 -0
- package/studio.css +1 -1
- package/{useLogin-D2VCOHYI.js → useLogin-B2qE8710.js} +23 -23
- package/{utils-Bh9uGjo1.js → utils-CZLafTgN.js} +1 -1
- package/{widgets-CG5Z_dk7.js → widgets-eu5zXTf-.js} +38 -105
- package/CollectionField-7uXvhxYK.js +0 -274
- package/DateTimeWidget-BHCP5osb.js +0 -255
- package/PhoneWidget-C6uZmrk8.js +0 -100
- package/Toolbar-BHi_B-nE.js +0 -737
- package/Tooltip-K_gFzjOa.js +0 -68
- package/VerifyButton-D21AOIX3.js +0 -273
- package/bookingCard--NlgtcJs.js +0 -577
- package/dist-x5VFEnQl.js +0 -3185
- package/getFieldValidations-DZnDgNI0.js +0 -159
- package/inlineRteTheme-Cn_Vqgsm.js +0 -23
- /package/{Beams-DkcjMVZl.js → Beams-DEybrmUZ.js} +0 -0
- /package/{Dots-BrEPvoj3.js → Dots-CMyy77GM.js} +0 -0
- /package/{Gradient-B4Er9hym.js → Gradient-DBn_zXzI.js} +0 -0
- /package/{Grid-B4XWU9eL.js → Grid-kGCr-6by.js} +0 -0
- /package/{Waves-kW-EBDdJ.js → Waves-DjLcbiBu.js} +0 -0
- /package/{authentication-fXmNYss1.js → authentication-hnV1BI8s.js} +0 -0
- /package/{card-BwNr7kQS.js → card-5ooLmYSr.js} +0 -0
- /package/{theme.cssm-2YTdd8Yh.js → theme.cssm-BXDp-ojp.js} +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { i as e, n as t, o as n, t as r } from "./Dialog-IrII0ugb.js";
|
|
3
|
+
import { t as i } from "./Button-lUfKisu8.js";
|
|
4
|
+
import { t as a } from "./CollectionInput-CpNGIXJx.js";
|
|
5
|
+
import { c as o } from "react/compiler-runtime";
|
|
6
|
+
import { errorToast as s, successToast as c, useLevo as l } from "@levo-so/react";
|
|
7
|
+
import { useEffect as u, useState as d } from "react";
|
|
8
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
import h from "clsx";
|
|
10
|
+
import { IconCircleCheck as g, IconLoader as _ } from "@tabler/icons-react";
|
|
11
|
+
//#region ../../libraries/levocn/dist/ui/spinner/Spinner.cssm.js
|
|
12
|
+
var v = "_1k4xirc1", y = (e) => {
|
|
13
|
+
let t = o(8), n, r;
|
|
14
|
+
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
15
|
+
let i;
|
|
16
|
+
t[3] === n ? i = t[4] : (i = h(v, n), t[3] = n, t[4] = i);
|
|
17
|
+
let a;
|
|
18
|
+
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ p(_, {
|
|
19
|
+
role: "status",
|
|
20
|
+
"aria-label": "Loading",
|
|
21
|
+
className: i,
|
|
22
|
+
...r
|
|
23
|
+
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
24
|
+
}, b = "_6o7s4x0", x = "qkytrb0", S = "qkytrb1", C = "qkytrb2", w = "qkytrb3", T = "qkytrb4", E = "qkytrb5", D = "qkytrb6", O = ({ isOpen: o, onClose: f, value: h, type: g = "email", onVerifySuccess: _ }) => {
|
|
25
|
+
let { membership: v } = l(), [y, O] = d(""), [k, A] = d(!1), [j, M] = d(!1), [N, P] = d(30);
|
|
26
|
+
return u(() => {
|
|
27
|
+
let e;
|
|
28
|
+
return o && N > 0 && (e = setInterval(() => {
|
|
29
|
+
P((e) => e - 1);
|
|
30
|
+
}, 1e3)), () => clearInterval(e);
|
|
31
|
+
}, [o, N]), u(() => {
|
|
32
|
+
o && (O(""), P(30), A(!1), M(!1));
|
|
33
|
+
}, [o]), /* @__PURE__ */ p(n, {
|
|
34
|
+
open: o,
|
|
35
|
+
onOpenChange: (e) => {
|
|
36
|
+
e || f();
|
|
37
|
+
},
|
|
38
|
+
children: /* @__PURE__ */ m(t, {
|
|
39
|
+
className: b,
|
|
40
|
+
children: [/* @__PURE__ */ p(r, { children: /* @__PURE__ */ p(e, { children: `Verify ${g === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ m("div", {
|
|
41
|
+
className: x,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ m("div", {
|
|
44
|
+
className: S,
|
|
45
|
+
children: [
|
|
46
|
+
"Enter the 4-digit code sent to ",
|
|
47
|
+
/* @__PURE__ */ p("strong", { children: h }),
|
|
48
|
+
".",
|
|
49
|
+
" ",
|
|
50
|
+
/* @__PURE__ */ p("button", {
|
|
51
|
+
onClick: () => f(),
|
|
52
|
+
className: C,
|
|
53
|
+
children: "Change?"
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ p("div", {
|
|
58
|
+
className: w,
|
|
59
|
+
children: /* @__PURE__ */ p(a, {
|
|
60
|
+
value: y,
|
|
61
|
+
onChange: (e) => {
|
|
62
|
+
O(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
63
|
+
},
|
|
64
|
+
placeholder: "0000",
|
|
65
|
+
maxLength: 4,
|
|
66
|
+
className: E
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ m("div", {
|
|
70
|
+
className: T,
|
|
71
|
+
children: [/* @__PURE__ */ p(i, {
|
|
72
|
+
onClick: async () => {
|
|
73
|
+
if (!(!y || y.length !== 4)) {
|
|
74
|
+
A(!0);
|
|
75
|
+
try {
|
|
76
|
+
await v?.signInWithOtp({
|
|
77
|
+
content: h,
|
|
78
|
+
code: y
|
|
79
|
+
}), c("Verification successful"), _(h), f();
|
|
80
|
+
} catch (e) {
|
|
81
|
+
let t = e;
|
|
82
|
+
s(t?.message || "Invalid OTP", t?.title || "Verification Failed");
|
|
83
|
+
} finally {
|
|
84
|
+
A(!1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
disabled: y.length !== 4 || k,
|
|
89
|
+
className: "w-full",
|
|
90
|
+
children: k ? "Verifying..." : "Verify"
|
|
91
|
+
}), /* @__PURE__ */ p("div", {
|
|
92
|
+
className: D,
|
|
93
|
+
children: N > 0 ? /* @__PURE__ */ m("span", { children: [
|
|
94
|
+
"Resend code in ",
|
|
95
|
+
N,
|
|
96
|
+
"s"
|
|
97
|
+
] }) : /* @__PURE__ */ p("button", {
|
|
98
|
+
onClick: async () => {
|
|
99
|
+
if (!(N > 0)) {
|
|
100
|
+
M(!0);
|
|
101
|
+
try {
|
|
102
|
+
await v?.requestOtp({
|
|
103
|
+
content: h,
|
|
104
|
+
medium: g === "phone" ? "whatsapp" : "email"
|
|
105
|
+
}), c("OTP resent successfully"), P(30);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
let t = e;
|
|
108
|
+
s(t?.message || "Failed to resend OTP", t?.title || "Error");
|
|
109
|
+
} finally {
|
|
110
|
+
M(!1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
disabled: j,
|
|
115
|
+
className: C,
|
|
116
|
+
children: j ? "Resending..." : "Resend Code"
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
}, k = "jfrbe10", A = "jfrbe11", j = "jfrbe12", M = ({ value: e, type: t, isVerified: n, onVerifySuccess: r, onStateChange: a }) => {
|
|
125
|
+
let { membership: o } = l(), [c, u] = d(!1), [h, _] = d(!1), v = (e) => {
|
|
126
|
+
a && a(e);
|
|
127
|
+
}, b = async () => {
|
|
128
|
+
let n = e?.trim()?.toLowerCase();
|
|
129
|
+
if (!n) {
|
|
130
|
+
s(`Please enter a ${t}`);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (t === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)) {
|
|
134
|
+
s("Please enter a valid email address");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
_(!0), v(!0);
|
|
138
|
+
try {
|
|
139
|
+
await o?.requestOtp({
|
|
140
|
+
content: n,
|
|
141
|
+
medium: t === "phone" ? "whatsapp" : "email"
|
|
142
|
+
}), u(!0);
|
|
143
|
+
} catch (e) {
|
|
144
|
+
let t = e;
|
|
145
|
+
s(t?.message || "Failed to send OTP", t?.title || "Error"), v(!1);
|
|
146
|
+
} finally {
|
|
147
|
+
_(!1);
|
|
148
|
+
}
|
|
149
|
+
}, x = () => {
|
|
150
|
+
u(!1), v(!1);
|
|
151
|
+
};
|
|
152
|
+
return n ? /* @__PURE__ */ m("div", {
|
|
153
|
+
className: k,
|
|
154
|
+
children: [/* @__PURE__ */ p(g, { className: j }), /* @__PURE__ */ p("span", {
|
|
155
|
+
className: A,
|
|
156
|
+
children: "Verified"
|
|
157
|
+
})]
|
|
158
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(i, {
|
|
159
|
+
size: "default",
|
|
160
|
+
variant: "ghost",
|
|
161
|
+
onClick: b,
|
|
162
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
163
|
+
disabled: !e || h,
|
|
164
|
+
type: "button",
|
|
165
|
+
children: h ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, { size: 14 }), "Sending..."] }) : "Verify"
|
|
166
|
+
}), c && /* @__PURE__ */ p(O, {
|
|
167
|
+
isOpen: c,
|
|
168
|
+
onClose: x,
|
|
169
|
+
value: e?.trim()?.toLowerCase() || "",
|
|
170
|
+
type: t,
|
|
171
|
+
onVerifySuccess: (e) => {
|
|
172
|
+
r(e), x();
|
|
173
|
+
}
|
|
174
|
+
})] });
|
|
175
|
+
};
|
|
176
|
+
//#endregion
|
|
177
|
+
export { b as n, y as r, M as t };
|