@levo-so/studio 0.3.6 → 0.3.8
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/{BillingStep-DhK0Mkjr.js → BillingStep-vBBLXLzk.js} +1 -1
- package/{Button-Ho7QJuCT.js → Button-BZDul09m.js} +29 -32
- package/{CollectionField-CD6ok1A3.js → CollectionField-BZmxRB5D.js} +68 -68
- package/DateTimeWidget-Bt1UcCnx.js +255 -0
- package/{Dialog-IrII0ugb.js → Dialog-CPE8yUqK.js} +10 -10
- package/{EntryCard-BfwGbFzQ.js → EntryCard-DLPs2PaP.js} +4 -4
- package/{KBChatWidget-0dtBwnDA.js → KBChatWidget-B-SNBtoX.js} +1 -1
- package/{LoginCard-CMeVif-w.js → LoginCard-EtzpuqYB.js} +3 -3
- package/{LoginForm-DhGQD4uI.js → LoginForm-kI_b_7Tc.js} +2 -2
- package/{LoginModal-Ui2GnSje.js → LoginModal-C-9BhmoO.js} +4 -4
- package/{MessageCard-CJltLT2a.js → MessageCard-Nsxr98n6.js} +2 -2
- package/{MessageFooter-CrhrI-su.js → MessageFooter-K4Zd_eFO.js} +2 -2
- package/{ModalManager-BW3Dol7F.js → ModalManager-CzH36UIk.js} +1 -1
- package/{PendingApprovalCard-BlyH59Vy.js → PendingApprovalCard-CCbhY8p3.js} +3 -3
- package/{PhoneWidget-BQEfbyV4.js → PhoneWidget-BkzFjfKW.js} +9 -9
- package/{Popover-V2O1gz6N.js → Popover-Iis-qOn1.js} +1 -1
- package/PopupBody-DZVwDLkg-PiECxgmc.js +171 -0
- package/PopupRenderer-BjW1jg70-C1UDgSfJ.js +388 -0
- package/{ProfileCard-DFgmQMUO.js → ProfileCard-DzEBPrax.js} +5 -5
- package/{RichTextWidget-CStx2PMn.js → RichTextWidget-C3Y-0pNy.js} +181 -181
- package/{RteThemeProvider-DxYOzcck.js → RteThemeProvider-owl5oajj.js} +4 -4
- package/{Spinner-HCqR1eGW.js → Spinner-D5spB_Mv.js} +1 -1
- package/{StripePaymentModal-Cw-AlxTS.js → StripePaymentModal-CiKqmQwK.js} +1 -1
- package/{Button-lUfKisu8.js → ThemeProvider-CqPHzkW9.js} +58 -58
- package/{Tooltip-DTnCNEcE.js → Tooltip-DHU1QD-n.js} +1 -1
- package/{VerifyButton-kdxRhJWI.js → VerifyButton-BwTbzSwS.js} +21 -21
- package/{bookingCard-DUMPxFp4.js → bookingCard-kEYdGZJ-.js} +5 -5
- package/collection.d.ts +171 -0
- package/collection.js +2 -0
- package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-C0PSYy0J.js} +2 -2
- package/{dialog-RrTP-MGm.js → dialog-8LH_ihs4.js} +1 -1
- package/dist-2bXx8eVI.js +3657 -0
- package/{PopupRenderer-DBKtkdmH-Ws7F9GmP.js → fontSize-B-ba6pvx.js} +17 -750
- package/{inlineCollectionTheme-D2w17LHX.js → generateRadiusScale-RROt8ppa.js} +4 -19
- package/index.js +3921 -3918
- package/inlineCollectionTheme-uhBXoF1F.js +19 -0
- package/{nodeAlignment-DS9_DLGB.js → inlineRteTheme-BOAno9MG.js} +16 -19
- package/{kbChat-BuTZ4Ytf.js → kbChat-zJcrfsqJ.js} +2 -2
- package/package.json +9 -5
- package/popupState-JmpeKzgM-UECLsSbL.js +100 -0
- package/rteTheme.cssm-W4gTOijw.js +4 -0
- package/studio.css +1 -1
- package/theme.cssm-Czj9sF4X.js +4 -0
- package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +61 -0
- package/{useLogin-BhysESLW.js → useLogin-CfnGrLdO.js} +1 -1
- package/usePopupRedirect-BThP_YPW-jXtfhYu6.js +80 -0
- package/DateTimeWidget-DHUmirf1.js +0 -255
- package/dist-Ckw19x6H.js +0 -3639
- package/rolldown-runtime-CAFD8bLK.js +0 -11
- /package/{AuthProvider-CFQqiIf1.js → AuthProvider-B5NfFwbG.js} +0 -0
- /package/{Beams-DVEhileN.js → Beams-WJN38XSv.js} +0 -0
- /package/{Dots-vp0H1Md3.js → Dots-DggLz5I7.js} +0 -0
- /package/{Gradient-_5G8Qm5s.js → Gradient-BSWJAu0a.js} +0 -0
- /package/{Grid-D694XUrO.js → Grid-BFKl0MUt.js} +0 -0
- /package/{Waves-DeNoq6Bo.js → Waves-BPEgTYoO.js} +0 -0
- /package/{authentication-TdyaDNTn.js → authentication-BXQbxiPP.js} +0 -0
- /package/{card-Cb4m0p4i.js → card-5ooLmYSr.js} +0 -0
- /package/{cn-BL52QQS4.js → cn-B6c1DjO_.js} +0 -0
- /package/{pillChrome-CrJ9a5vj.js → pillChrome-CYoMtUAv.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as n } from "./
|
|
1
|
+
import { n as e } from "./ThemeProvider-CqPHzkW9.js";
|
|
2
|
+
import { t } from "./theme.cssm-Czj9sF4X.js";
|
|
3
|
+
import { t as n } from "./rteTheme.cssm-W4gTOijw.js";
|
|
4
4
|
import { c as r } from "react/compiler-runtime";
|
|
5
5
|
import { jsx as i } from "react/jsx-runtime";
|
|
6
6
|
import a from "clsx";
|
|
7
7
|
//#region ../../libraries/editor-core/dist/theme/RteThemeProvider.js
|
|
8
8
|
var o = (o) => {
|
|
9
9
|
let s = r(7), { children: c, theme: l } = o, u = l?.className, d;
|
|
10
|
-
s[0] === u ? d = s[1] : (d = a(
|
|
10
|
+
s[0] === u ? d = s[1] : (d = a(t, n, u), s[0] = u, s[1] = d);
|
|
11
11
|
let f = l?.style, p = l?.portalToThemeRoot, m;
|
|
12
12
|
return s[2] !== c || s[3] !== d || s[4] !== f || s[5] !== p ? (m = /* @__PURE__ */ i(e, {
|
|
13
13
|
className: d,
|
|
@@ -4,19 +4,61 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
4
4
|
import s from "clsx";
|
|
5
5
|
import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
6
|
//#region ../../libraries/levocn/dist/styles/reset.cssm.js
|
|
7
|
-
var l = "_1er5g5a0", u =
|
|
8
|
-
|
|
7
|
+
var l = "_1er5g5a0", u = c({
|
|
8
|
+
defaultClassName: "_1a7d0ek1 _1a7d0ek0",
|
|
9
|
+
variantClassNames: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "_1a7d0ek2",
|
|
12
|
+
outline: "_1a7d0ek3",
|
|
13
|
+
secondary: "_1a7d0ek4",
|
|
14
|
+
ghost: "_1a7d0ek5",
|
|
15
|
+
destructive: "_1a7d0ek6",
|
|
16
|
+
link: "_1a7d0ek7"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "_1a7d0ek8",
|
|
20
|
+
xs: "_1a7d0ek9",
|
|
21
|
+
sm: "_1a7d0eka",
|
|
22
|
+
lg: "_1a7d0ekb",
|
|
23
|
+
icon: "_1a7d0ekc",
|
|
24
|
+
"icon-xs": "_1a7d0ekd",
|
|
25
|
+
"icon-sm": "_1a7d0eke",
|
|
26
|
+
"icon-lg": "_1a7d0ekf"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default"
|
|
32
|
+
},
|
|
33
|
+
compoundVariants: []
|
|
34
|
+
}), d = (t) => {
|
|
35
|
+
let n = e(14), r, i, a, c, l;
|
|
36
|
+
n[0] === t ? (r = n[1], i = n[2], a = n[3], c = n[4], l = n[5]) : ({className: r, variant: l, size: a, type: c, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = c, n[5] = l);
|
|
37
|
+
let d = c === void 0 ? "button" : c, f;
|
|
38
|
+
n[6] !== r || n[7] !== a || n[8] !== l ? (f = s(u({
|
|
39
|
+
variant: l,
|
|
40
|
+
size: a
|
|
41
|
+
}), r), n[6] = r, n[7] = a, n[8] = l, n[9] = f) : f = n[9];
|
|
42
|
+
let p;
|
|
43
|
+
return n[10] !== i || n[11] !== f || n[12] !== d ? (p = /* @__PURE__ */ o("button", {
|
|
44
|
+
"data-slot": "button",
|
|
45
|
+
type: d,
|
|
46
|
+
className: f,
|
|
47
|
+
...i
|
|
48
|
+
}), n[10] = i, n[11] = f, n[12] = d, n[13] = p) : p = n[13], p;
|
|
49
|
+
}, f = /* @__PURE__ */ new Set(), p = {}, m = t(null), h = () => {
|
|
50
|
+
let t = e(1), r = n(m);
|
|
9
51
|
if (!r) {
|
|
10
52
|
let e;
|
|
11
53
|
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
|
|
12
54
|
portalRef: { current: null },
|
|
13
|
-
classes:
|
|
14
|
-
overrides:
|
|
55
|
+
classes: f,
|
|
56
|
+
overrides: p
|
|
15
57
|
}, t[0] = e) : e = t[0], e;
|
|
16
58
|
}
|
|
17
59
|
return r;
|
|
18
|
-
},
|
|
19
|
-
let g = n(
|
|
60
|
+
}, g = ({ children: e, cssReset: t, className: c, style: u, portalToThemeRoot: d, ...h }) => {
|
|
61
|
+
let g = n(m), _ = a(null), v = !g && t !== !1 ? l : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = i(() => {
|
|
20
62
|
let e = c ? c.split(/\s+/).filter(Boolean) : [], t = new Set(y);
|
|
21
63
|
for (let n of e) t.add(n);
|
|
22
64
|
return {
|
|
@@ -24,23 +66,23 @@ var l = "_1er5g5a0", u = /* @__PURE__ */ new Set(), d = {}, f = t(null), p = ()
|
|
|
24
66
|
classes: t,
|
|
25
67
|
overrides: {
|
|
26
68
|
...b,
|
|
27
|
-
...
|
|
69
|
+
...u
|
|
28
70
|
}
|
|
29
71
|
};
|
|
30
72
|
}, [
|
|
31
73
|
y,
|
|
32
74
|
c,
|
|
33
75
|
b,
|
|
34
|
-
|
|
76
|
+
u
|
|
35
77
|
]);
|
|
36
78
|
r(() => {
|
|
37
|
-
if (
|
|
79
|
+
if (d) return;
|
|
38
80
|
let e = document.createElement("div");
|
|
39
81
|
return document.body.appendChild(e), _.current = e, () => {
|
|
40
82
|
document.body.removeChild(e), _.current = null;
|
|
41
83
|
};
|
|
42
|
-
}, [
|
|
43
|
-
if (
|
|
84
|
+
}, [d]), r(() => {
|
|
85
|
+
if (d) return;
|
|
44
86
|
let e = _.current;
|
|
45
87
|
if (!e) return;
|
|
46
88
|
e.className = s(v, ...x.classes), e.style.cssText = "";
|
|
@@ -53,64 +95,22 @@ var l = "_1er5g5a0", u = /* @__PURE__ */ new Set(), d = {}, f = t(null), p = ()
|
|
|
53
95
|
x.classes,
|
|
54
96
|
x.overrides,
|
|
55
97
|
v,
|
|
56
|
-
|
|
98
|
+
d
|
|
57
99
|
]);
|
|
58
100
|
let S = s(v, ...c ? c.split(/\s+/).filter((e) => e && !y.has(e)) : []);
|
|
59
|
-
return /* @__PURE__ */ o(
|
|
101
|
+
return /* @__PURE__ */ o(m.Provider, {
|
|
60
102
|
value: x,
|
|
61
103
|
children: /* @__PURE__ */ o("div", {
|
|
62
|
-
...
|
|
104
|
+
...d ? { ref: _ } : {},
|
|
63
105
|
...S ? { className: S } : {},
|
|
64
106
|
style: {
|
|
65
107
|
display: "contents",
|
|
66
|
-
...
|
|
108
|
+
...u
|
|
67
109
|
},
|
|
68
110
|
...h,
|
|
69
111
|
children: e
|
|
70
112
|
})
|
|
71
113
|
});
|
|
72
|
-
}, h = c({
|
|
73
|
-
defaultClassName: "_1a7d0ek1 _1a7d0ek0",
|
|
74
|
-
variantClassNames: {
|
|
75
|
-
variant: {
|
|
76
|
-
default: "_1a7d0ek2",
|
|
77
|
-
outline: "_1a7d0ek3",
|
|
78
|
-
secondary: "_1a7d0ek4",
|
|
79
|
-
ghost: "_1a7d0ek5",
|
|
80
|
-
destructive: "_1a7d0ek6",
|
|
81
|
-
link: "_1a7d0ek7"
|
|
82
|
-
},
|
|
83
|
-
size: {
|
|
84
|
-
default: "_1a7d0ek8",
|
|
85
|
-
xs: "_1a7d0ek9",
|
|
86
|
-
sm: "_1a7d0eka",
|
|
87
|
-
lg: "_1a7d0ekb",
|
|
88
|
-
icon: "_1a7d0ekc",
|
|
89
|
-
"icon-xs": "_1a7d0ekd",
|
|
90
|
-
"icon-sm": "_1a7d0eke",
|
|
91
|
-
"icon-lg": "_1a7d0ekf"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
defaultVariants: {
|
|
95
|
-
variant: "default",
|
|
96
|
-
size: "default"
|
|
97
|
-
},
|
|
98
|
-
compoundVariants: []
|
|
99
|
-
}), g = (t) => {
|
|
100
|
-
let n = e(14), r, i, a, c, l;
|
|
101
|
-
n[0] === t ? (r = n[1], i = n[2], a = n[3], c = n[4], l = n[5]) : ({className: r, variant: l, size: a, type: c, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = c, n[5] = l);
|
|
102
|
-
let u = c === void 0 ? "button" : c, d;
|
|
103
|
-
n[6] !== r || n[7] !== a || n[8] !== l ? (d = s(h({
|
|
104
|
-
variant: l,
|
|
105
|
-
size: a
|
|
106
|
-
}), r), n[6] = r, n[7] = a, n[8] = l, n[9] = d) : d = n[9];
|
|
107
|
-
let f;
|
|
108
|
-
return n[10] !== i || n[11] !== d || n[12] !== u ? (f = /* @__PURE__ */ o("button", {
|
|
109
|
-
"data-slot": "button",
|
|
110
|
-
type: u,
|
|
111
|
-
className: d,
|
|
112
|
-
...i
|
|
113
|
-
}), n[10] = i, n[11] = d, n[12] = u, n[13] = f) : f = n[13], f;
|
|
114
114
|
};
|
|
115
115
|
//#endregion
|
|
116
|
-
export {
|
|
116
|
+
export { u as i, g as n, d as r, h as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { t
|
|
4
|
-
import { t as a } from "./
|
|
2
|
+
import { r as e } from "./ThemeProvider-CqPHzkW9.js";
|
|
3
|
+
import { t } from "./CollectionInput-DyNbxIZ8.js";
|
|
4
|
+
import { i as n, n as r, o as i, t as a } from "./Dialog-CPE8yUqK.js";
|
|
5
5
|
import { c as o } from "react/compiler-runtime";
|
|
6
6
|
import { errorToast as s, successToast as c, useLevo as l } from "@levo-so/react";
|
|
7
7
|
import { useEffect as u, useState as d } from "react";
|
|
@@ -30,14 +30,14 @@ var v = "_1k4xirc1", y = (e) => {
|
|
|
30
30
|
}, 1e3)), () => clearInterval(e);
|
|
31
31
|
}, [o, N]), u(() => {
|
|
32
32
|
o && (O(""), P(30), A(!1), M(!1));
|
|
33
|
-
}, [o]), /* @__PURE__ */ p(
|
|
33
|
+
}, [o]), /* @__PURE__ */ p(i, {
|
|
34
34
|
open: o,
|
|
35
35
|
onOpenChange: (e) => {
|
|
36
36
|
e || f();
|
|
37
37
|
},
|
|
38
|
-
children: /* @__PURE__ */ m(
|
|
38
|
+
children: /* @__PURE__ */ m(r, {
|
|
39
39
|
className: b,
|
|
40
|
-
children: [/* @__PURE__ */ p(
|
|
40
|
+
children: [/* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(n, { children: `Verify ${g === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ m("div", {
|
|
41
41
|
className: x,
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ m("div", {
|
|
@@ -56,7 +56,7 @@ var v = "_1k4xirc1", y = (e) => {
|
|
|
56
56
|
}),
|
|
57
57
|
/* @__PURE__ */ p("div", {
|
|
58
58
|
className: w,
|
|
59
|
-
children: /* @__PURE__ */ p(
|
|
59
|
+
children: /* @__PURE__ */ p(t, {
|
|
60
60
|
value: y,
|
|
61
61
|
onChange: (e) => {
|
|
62
62
|
O(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
@@ -68,7 +68,7 @@ var v = "_1k4xirc1", y = (e) => {
|
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ m("div", {
|
|
70
70
|
className: T,
|
|
71
|
-
children: [/* @__PURE__ */ p(
|
|
71
|
+
children: [/* @__PURE__ */ p(e, {
|
|
72
72
|
onClick: async () => {
|
|
73
73
|
if (!(!y || y.length !== 4)) {
|
|
74
74
|
A(!0);
|
|
@@ -121,24 +121,24 @@ var v = "_1k4xirc1", y = (e) => {
|
|
|
121
121
|
})]
|
|
122
122
|
})
|
|
123
123
|
});
|
|
124
|
-
}, k = "jfrbe10", A = "jfrbe11", j = "jfrbe12", M = ({ value:
|
|
124
|
+
}, k = "jfrbe10", A = "jfrbe11", j = "jfrbe12", M = ({ value: t, type: n, isVerified: r, onVerifySuccess: i, onStateChange: a }) => {
|
|
125
125
|
let { membership: o } = l(), [c, u] = d(!1), [h, _] = d(!1), v = (e) => {
|
|
126
126
|
a && a(e);
|
|
127
127
|
}, b = async () => {
|
|
128
|
-
let
|
|
129
|
-
if (!
|
|
130
|
-
s(`Please enter a ${
|
|
128
|
+
let e = t?.trim()?.toLowerCase();
|
|
129
|
+
if (!e) {
|
|
130
|
+
s(`Please enter a ${n}`);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
133
|
+
if (n === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
134
134
|
s("Please enter a valid email address");
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
_(!0), v(!0);
|
|
138
138
|
try {
|
|
139
139
|
await o?.requestOtp({
|
|
140
|
-
content:
|
|
141
|
-
medium:
|
|
140
|
+
content: e,
|
|
141
|
+
medium: n === "phone" ? "whatsapp" : "email"
|
|
142
142
|
}), u(!0);
|
|
143
143
|
} catch (e) {
|
|
144
144
|
let t = e;
|
|
@@ -149,27 +149,27 @@ var v = "_1k4xirc1", y = (e) => {
|
|
|
149
149
|
}, x = () => {
|
|
150
150
|
u(!1), v(!1);
|
|
151
151
|
};
|
|
152
|
-
return
|
|
152
|
+
return r ? /* @__PURE__ */ m("div", {
|
|
153
153
|
className: k,
|
|
154
154
|
children: [/* @__PURE__ */ p(g, { className: j }), /* @__PURE__ */ p("span", {
|
|
155
155
|
className: A,
|
|
156
156
|
children: "Verified"
|
|
157
157
|
})]
|
|
158
|
-
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
158
|
+
}) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(e, {
|
|
159
159
|
size: "default",
|
|
160
160
|
variant: "ghost",
|
|
161
161
|
onClick: b,
|
|
162
162
|
onMouseDown: (e) => e.preventDefault(),
|
|
163
|
-
disabled: !
|
|
163
|
+
disabled: !t || h,
|
|
164
164
|
type: "button",
|
|
165
165
|
children: h ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(y, { size: 14 }), "Sending..."] }) : "Verify"
|
|
166
166
|
}), c && /* @__PURE__ */ p(O, {
|
|
167
167
|
isOpen: c,
|
|
168
168
|
onClose: x,
|
|
169
|
-
value:
|
|
170
|
-
type:
|
|
169
|
+
value: t?.trim()?.toLowerCase() || "",
|
|
170
|
+
type: n,
|
|
171
171
|
onVerifySuccess: (e) => {
|
|
172
|
-
|
|
172
|
+
i(e), x();
|
|
173
173
|
}
|
|
174
174
|
})] });
|
|
175
175
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./Button-
|
|
3
|
-
import { n as t } from "./AuthProvider-
|
|
4
|
-
import { t as n } from "./cn-
|
|
5
|
-
import { n as r, t as i } from "./StripePaymentModal-
|
|
6
|
-
import { BillingStep as a } from "./BillingStep-
|
|
2
|
+
import { t as e } from "./Button-BZDul09m.js";
|
|
3
|
+
import { n as t } from "./AuthProvider-B5NfFwbG.js";
|
|
4
|
+
import { t as n } from "./cn-B6c1DjO_.js";
|
|
5
|
+
import { n as r, t as i } from "./StripePaymentModal-CiKqmQwK.js";
|
|
6
|
+
import { BillingStep as a } from "./BillingStep-vBBLXLzk.js";
|
|
7
7
|
import { errorHandler as o, useLevo as s } from "@levo-so/react";
|
|
8
8
|
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
9
9
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
package/collection.d.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { CommonFieldInterfacesList } from '@levo-so/core';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
import { IFieldError } from '@levo-so/core';
|
|
5
|
+
import { ILemaCollection } from '@levo-so/core';
|
|
6
|
+
import { ILemaField } from '@levo-so/core';
|
|
7
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
8
|
+
|
|
9
|
+
export declare const CollectionForm: default_2.FC<ICollectionFormProps>;
|
|
10
|
+
|
|
11
|
+
export declare const CollectionFormBuilder: default_2.FC<ICollectionFormBuilderProps>;
|
|
12
|
+
|
|
13
|
+
export declare const CollectionFormRenderer: default_2.FC<ICollectionFormRendererProps>;
|
|
14
|
+
|
|
15
|
+
export declare const FormBuilder: default_2.FC<IFormBuilderProps>;
|
|
16
|
+
|
|
17
|
+
declare const FormVariantOptions: readonly [{
|
|
18
|
+
readonly value: "default";
|
|
19
|
+
readonly label: "Classic";
|
|
20
|
+
readonly description: "All fields displayed together in a single view";
|
|
21
|
+
}, {
|
|
22
|
+
readonly value: "steps";
|
|
23
|
+
readonly label: "Multi-Step";
|
|
24
|
+
readonly description: "Each section becomes a step — navigate with next/previous buttons";
|
|
25
|
+
}, {
|
|
26
|
+
readonly value: "single-field";
|
|
27
|
+
readonly label: "One at a Time";
|
|
28
|
+
readonly description: "Typeform-style — one field per screen with smooth transitions";
|
|
29
|
+
}, {
|
|
30
|
+
readonly value: "steps-2";
|
|
31
|
+
readonly label: "Conversational Steps";
|
|
32
|
+
readonly description: "Multi-step with typeform-style field presentation";
|
|
33
|
+
}];
|
|
34
|
+
|
|
35
|
+
declare type FormVariantType = (typeof FormVariantOptions)[number]["value"];
|
|
36
|
+
|
|
37
|
+
export declare interface ICollectionFormBuilderProps extends Omit<ILevoFormContext, "schema"> {
|
|
38
|
+
formVariant?: FormVariantType;
|
|
39
|
+
collection_id: string;
|
|
40
|
+
hiddenFields?: string[];
|
|
41
|
+
workspace_id?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export declare interface ICollectionFormProps extends Omit<ILevoFormContext, "onSuccess" | "externalInitialValues" | "onError" | "isLoggedIn" | "toastConfig" | "onFormDirty" | "disableCaptcha" | "enableVerification"> {
|
|
45
|
+
hiddenFields?: string[];
|
|
46
|
+
isLoading?: boolean;
|
|
47
|
+
initialValues?: any;
|
|
48
|
+
onSubmit?: (values: any) => void;
|
|
49
|
+
disableCaptcha?: boolean;
|
|
50
|
+
enableVerification?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export declare interface ICollectionFormRendererProps extends Omit<ILevoFormContext, "schema"> {
|
|
54
|
+
formVariant?: FormVariantType;
|
|
55
|
+
fetchedSchema?: ILevoFormContext["schema"];
|
|
56
|
+
hiddenFields?: string[];
|
|
57
|
+
workspace_id?: string;
|
|
58
|
+
isLoading?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare interface ICommonRendererProps {
|
|
62
|
+
schema: ILemaCollection | null;
|
|
63
|
+
field: ILemaField;
|
|
64
|
+
settings?: {
|
|
65
|
+
enableVerification?: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare interface IFormBuilderProps extends ILevoFormContext {
|
|
70
|
+
formVariant?: FormVariantType;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export declare interface IFormRendererProps extends ILevoFormContext {
|
|
74
|
+
children: default_2.ReactNode;
|
|
75
|
+
variant?: FormVariantType;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface ILevoFormContext {
|
|
79
|
+
schema: ILemaCollection | null;
|
|
80
|
+
isDisabled?: boolean;
|
|
81
|
+
containerStyles?: string;
|
|
82
|
+
submitButtonConfig: {
|
|
83
|
+
text?: string;
|
|
84
|
+
show?: boolean;
|
|
85
|
+
styles?: string;
|
|
86
|
+
};
|
|
87
|
+
uiConfig?: {
|
|
88
|
+
hideSectionHeadings?: boolean;
|
|
89
|
+
hideFormHeading?: boolean;
|
|
90
|
+
};
|
|
91
|
+
toastConfig?: {
|
|
92
|
+
showSuccessToast?: boolean;
|
|
93
|
+
successToastText?: string;
|
|
94
|
+
suppressOnBooking?: boolean;
|
|
95
|
+
};
|
|
96
|
+
onError?: (v: any) => void;
|
|
97
|
+
disableCaptcha?: boolean;
|
|
98
|
+
enableVerification?: boolean;
|
|
99
|
+
theme?: {
|
|
100
|
+
className?: string;
|
|
101
|
+
style?: React.CSSProperties;
|
|
102
|
+
cssReset?: boolean;
|
|
103
|
+
};
|
|
104
|
+
isLoggedIn?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Logged-in member's contact details, used only to prefill the schema's designated
|
|
107
|
+
* email_field/mobile_field. Strictly the fields consumed — pass anything else via
|
|
108
|
+
* externalInitialValues.
|
|
109
|
+
*/
|
|
110
|
+
account?: {
|
|
111
|
+
email?: string | null;
|
|
112
|
+
mobile?: string | null;
|
|
113
|
+
};
|
|
114
|
+
externalInitialValues?: Record<string, any>;
|
|
115
|
+
onSuccess?: (v: {
|
|
116
|
+
schemaId: string;
|
|
117
|
+
response: any;
|
|
118
|
+
meta?: any;
|
|
119
|
+
}) => void;
|
|
120
|
+
onFormView?: (v: {
|
|
121
|
+
schemaId: string;
|
|
122
|
+
}) => void;
|
|
123
|
+
onFormDirty?: (v: {
|
|
124
|
+
schemaId: string;
|
|
125
|
+
}) => void;
|
|
126
|
+
widgets?: Partial<IWidgetRegistry>;
|
|
127
|
+
/** Success screen config from props. Priority: this > schema.settings.success_message > defaults. */
|
|
128
|
+
successConfig?: {
|
|
129
|
+
title?: string;
|
|
130
|
+
message?: string;
|
|
131
|
+
action?: {
|
|
132
|
+
type: "none" | "submit_another" | "redirect";
|
|
133
|
+
/** URL for redirect action type. */
|
|
134
|
+
value?: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
debug?: boolean;
|
|
138
|
+
/** When true, the form is in preview mode — no remote submission, no drafts, no captcha, no analytics. */
|
|
139
|
+
preview?: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
declare type IWidgetRegistry = Record<(typeof CommonFieldInterfacesList)[number], WidgetComponent>;
|
|
143
|
+
|
|
144
|
+
export declare const LevoFormProvider: default_2.FC<IFormRendererProps>;
|
|
145
|
+
|
|
146
|
+
export declare const useLevoForm: ({ schema: schemaProp, originalSchema: originalSchemaProp, onSubmitSuccess, onSubmitError, onInit, setFormErrorAfterSubmit, }: {
|
|
147
|
+
schema: ILemaCollection | null;
|
|
148
|
+
originalSchema?: ILemaCollection | null;
|
|
149
|
+
setFormErrorAfterSubmit?: boolean;
|
|
150
|
+
onSubmitSuccess?: () => void;
|
|
151
|
+
onSubmitError?: (e: IFieldError[]) => void;
|
|
152
|
+
onInit?: (values: Record<string, unknown>) => void;
|
|
153
|
+
}) => {
|
|
154
|
+
methods: UseFormReturn<FieldValues, any, FieldValues>;
|
|
155
|
+
isLoading: boolean;
|
|
156
|
+
isError: boolean;
|
|
157
|
+
contentId: string | null;
|
|
158
|
+
publishedId: string | null;
|
|
159
|
+
allFormValues: any;
|
|
160
|
+
handleContentId: (id: string) => void;
|
|
161
|
+
appendFormValues: (data: any) => void;
|
|
162
|
+
submitToRemote: (data: any) => Promise<void>;
|
|
163
|
+
showSuccessOverlay: boolean;
|
|
164
|
+
dismissSuccessOverlay: () => void;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export declare const useLevoFormContext: () => ILevoFormContext;
|
|
168
|
+
|
|
169
|
+
declare type WidgetComponent = default_2.FC<ICommonRendererProps>;
|
|
170
|
+
|
|
171
|
+
export { }
|
package/collection.js
ADDED