@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.
Files changed (59) hide show
  1. package/{BillingStep-DhK0Mkjr.js → BillingStep-vBBLXLzk.js} +1 -1
  2. package/{Button-Ho7QJuCT.js → Button-BZDul09m.js} +29 -32
  3. package/{CollectionField-CD6ok1A3.js → CollectionField-BZmxRB5D.js} +68 -68
  4. package/DateTimeWidget-Bt1UcCnx.js +255 -0
  5. package/{Dialog-IrII0ugb.js → Dialog-CPE8yUqK.js} +10 -10
  6. package/{EntryCard-BfwGbFzQ.js → EntryCard-DLPs2PaP.js} +4 -4
  7. package/{KBChatWidget-0dtBwnDA.js → KBChatWidget-B-SNBtoX.js} +1 -1
  8. package/{LoginCard-CMeVif-w.js → LoginCard-EtzpuqYB.js} +3 -3
  9. package/{LoginForm-DhGQD4uI.js → LoginForm-kI_b_7Tc.js} +2 -2
  10. package/{LoginModal-Ui2GnSje.js → LoginModal-C-9BhmoO.js} +4 -4
  11. package/{MessageCard-CJltLT2a.js → MessageCard-Nsxr98n6.js} +2 -2
  12. package/{MessageFooter-CrhrI-su.js → MessageFooter-K4Zd_eFO.js} +2 -2
  13. package/{ModalManager-BW3Dol7F.js → ModalManager-CzH36UIk.js} +1 -1
  14. package/{PendingApprovalCard-BlyH59Vy.js → PendingApprovalCard-CCbhY8p3.js} +3 -3
  15. package/{PhoneWidget-BQEfbyV4.js → PhoneWidget-BkzFjfKW.js} +9 -9
  16. package/{Popover-V2O1gz6N.js → Popover-Iis-qOn1.js} +1 -1
  17. package/PopupBody-DZVwDLkg-PiECxgmc.js +171 -0
  18. package/PopupRenderer-BjW1jg70-C1UDgSfJ.js +388 -0
  19. package/{ProfileCard-DFgmQMUO.js → ProfileCard-DzEBPrax.js} +5 -5
  20. package/{RichTextWidget-CStx2PMn.js → RichTextWidget-C3Y-0pNy.js} +181 -181
  21. package/{RteThemeProvider-DxYOzcck.js → RteThemeProvider-owl5oajj.js} +4 -4
  22. package/{Spinner-HCqR1eGW.js → Spinner-D5spB_Mv.js} +1 -1
  23. package/{StripePaymentModal-Cw-AlxTS.js → StripePaymentModal-CiKqmQwK.js} +1 -1
  24. package/{Button-lUfKisu8.js → ThemeProvider-CqPHzkW9.js} +58 -58
  25. package/{Tooltip-DTnCNEcE.js → Tooltip-DHU1QD-n.js} +1 -1
  26. package/{VerifyButton-kdxRhJWI.js → VerifyButton-BwTbzSwS.js} +21 -21
  27. package/{bookingCard-DUMPxFp4.js → bookingCard-kEYdGZJ-.js} +5 -5
  28. package/collection.d.ts +171 -0
  29. package/collection.js +2 -0
  30. package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-C0PSYy0J.js} +2 -2
  31. package/{dialog-RrTP-MGm.js → dialog-8LH_ihs4.js} +1 -1
  32. package/dist-2bXx8eVI.js +3657 -0
  33. package/{PopupRenderer-DBKtkdmH-Ws7F9GmP.js → fontSize-B-ba6pvx.js} +17 -750
  34. package/{inlineCollectionTheme-D2w17LHX.js → generateRadiusScale-RROt8ppa.js} +4 -19
  35. package/index.js +3921 -3918
  36. package/inlineCollectionTheme-uhBXoF1F.js +19 -0
  37. package/{nodeAlignment-DS9_DLGB.js → inlineRteTheme-BOAno9MG.js} +16 -19
  38. package/{kbChat-BuTZ4Ytf.js → kbChat-zJcrfsqJ.js} +2 -2
  39. package/package.json +9 -5
  40. package/popupState-JmpeKzgM-UECLsSbL.js +100 -0
  41. package/rteTheme.cssm-W4gTOijw.js +4 -0
  42. package/studio.css +1 -1
  43. package/theme.cssm-Czj9sF4X.js +4 -0
  44. package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +61 -0
  45. package/{useLogin-BhysESLW.js → useLogin-CfnGrLdO.js} +1 -1
  46. package/usePopupRedirect-BThP_YPW-jXtfhYu6.js +80 -0
  47. package/DateTimeWidget-DHUmirf1.js +0 -255
  48. package/dist-Ckw19x6H.js +0 -3639
  49. package/rolldown-runtime-CAFD8bLK.js +0 -11
  50. /package/{AuthProvider-CFQqiIf1.js → AuthProvider-B5NfFwbG.js} +0 -0
  51. /package/{Beams-DVEhileN.js → Beams-WJN38XSv.js} +0 -0
  52. /package/{Dots-vp0H1Md3.js → Dots-DggLz5I7.js} +0 -0
  53. /package/{Gradient-_5G8Qm5s.js → Gradient-BSWJAu0a.js} +0 -0
  54. /package/{Grid-D694XUrO.js → Grid-BFKl0MUt.js} +0 -0
  55. /package/{Waves-DeNoq6Bo.js → Waves-BPEgTYoO.js} +0 -0
  56. /package/{authentication-TdyaDNTn.js → authentication-BXQbxiPP.js} +0 -0
  57. /package/{card-Cb4m0p4i.js → card-5ooLmYSr.js} +0 -0
  58. /package/{cn-BL52QQS4.js → cn-B6c1DjO_.js} +0 -0
  59. /package/{pillChrome-CrJ9a5vj.js → pillChrome-CYoMtUAv.js} +0 -0
@@ -1,13 +1,13 @@
1
- import { i as e } from "./Button-lUfKisu8.js";
2
- import { a as t } from "./nodeAlignment-DS9_DLGB.js";
3
- import { t as n } from "./theme.cssm-2YTdd8Yh.js";
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(n, t, u), s[0] = u, s[1] = d);
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,
@@ -1,4 +1,4 @@
1
- import { t as e } from "./cn-BL52QQS4.js";
1
+ import { t as e } from "./cn-B6c1DjO_.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  import { Loader2 as n } from "lucide-react";
4
4
  //#region src/components/Spinner.tsx
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./cn-BL52QQS4.js";
2
+ import { t as e } from "./cn-B6c1DjO_.js";
3
3
  import { useCallback as t, useState as n } from "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { XIcon as a } from "lucide-react";
@@ -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 = /* @__PURE__ */ new Set(), d = {}, f = t(null), p = () => {
8
- let t = e(1), r = n(f);
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: u,
14
- overrides: d
55
+ classes: f,
56
+ overrides: p
15
57
  }, t[0] = e) : e = t[0], e;
16
58
  }
17
59
  return r;
18
- }, m = ({ children: e, cssReset: t, className: c, style: p, portalToThemeRoot: m, ...h }) => {
19
- let g = n(f), _ = a(null), v = !g && t !== !1 ? l : "", y = g?.classes ?? u, b = g?.overrides ?? d, x = i(() => {
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
- ...p
69
+ ...u
28
70
  }
29
71
  };
30
72
  }, [
31
73
  y,
32
74
  c,
33
75
  b,
34
- p
76
+ u
35
77
  ]);
36
78
  r(() => {
37
- if (m) return;
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
- }, [m]), r(() => {
43
- if (m) return;
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
- m
98
+ d
57
99
  ]);
58
100
  let S = s(v, ...c ? c.split(/\s+/).filter((e) => e && !y.has(e)) : []);
59
- return /* @__PURE__ */ o(f.Provider, {
101
+ return /* @__PURE__ */ o(m.Provider, {
60
102
  value: x,
61
103
  children: /* @__PURE__ */ o("div", {
62
- ...m ? { ref: _ } : {},
104
+ ...d ? { ref: _ } : {},
63
105
  ...S ? { className: S } : {},
64
106
  style: {
65
107
  display: "contents",
66
- ...p
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 { m as i, h as n, p as r, g as t };
116
+ export { u as i, g as n, d as r, h as t };
@@ -1,4 +1,4 @@
1
- import { n as e, r as t } from "./Button-lUfKisu8.js";
1
+ import { i as e, t } from "./ThemeProvider-CqPHzkW9.js";
2
2
  import { c as n } from "react/compiler-runtime";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  import a from "clsx";
@@ -1,7 +1,7 @@
1
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-DyNbxIZ8.js";
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(n, {
33
+ }, [o]), /* @__PURE__ */ p(i, {
34
34
  open: o,
35
35
  onOpenChange: (e) => {
36
36
  e || f();
37
37
  },
38
- children: /* @__PURE__ */ m(t, {
38
+ children: /* @__PURE__ */ m(r, {
39
39
  className: b,
40
- children: [/* @__PURE__ */ p(r, { children: /* @__PURE__ */ p(e, { children: `Verify ${g === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ m("div", {
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(a, {
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(i, {
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: e, type: t, isVerified: n, onVerifySuccess: r, onStateChange: a }) => {
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 n = e?.trim()?.toLowerCase();
129
- if (!n) {
130
- s(`Please enter a ${t}`);
128
+ let e = t?.trim()?.toLowerCase();
129
+ if (!e) {
130
+ s(`Please enter a ${n}`);
131
131
  return;
132
132
  }
133
- if (t === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n)) {
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: n,
141
- medium: t === "phone" ? "whatsapp" : "email"
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 n ? /* @__PURE__ */ m("div", {
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(i, {
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: !e || h,
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: e?.trim()?.toLowerCase() || "",
170
- type: t,
169
+ value: t?.trim()?.toLowerCase() || "",
170
+ type: n,
171
171
  onVerifySuccess: (e) => {
172
- r(e), x();
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-Ho7QJuCT.js";
3
- import { n as t } from "./AuthProvider-CFQqiIf1.js";
4
- import { t as n } from "./cn-BL52QQS4.js";
5
- import { n as r, t as i } from "./StripePaymentModal-Cw-AlxTS.js";
6
- import { BillingStep as a } from "./BillingStep-DhK0Mkjr.js";
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";
@@ -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
@@ -0,0 +1,2 @@
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o } from "./dist-2bXx8eVI.js";
2
+ export { t as CollectionForm, a as CollectionFormBuilder, r as CollectionFormRenderer, n as FormBuilder, i as LevoFormProvider, e as useLevoForm, o as useLevoFormContext };
@@ -10,6 +10,6 @@ var t = (e, n) => {
10
10
  } else typeof o == "string" && (r[o] = String(a));
11
11
  }
12
12
  return r;
13
- }, n = (n) => (r) => r ? e(t(n, r)) : {}, r = "_1bi3v3x0";
13
+ }, n = (n) => (r) => r ? e(t(n, r)) : {};
14
14
  //#endregion
15
- export { n, r as t };
15
+ export { n as t };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./cn-BL52QQS4.js";
2
+ import { t as e } from "./cn-B6c1DjO_.js";
3
3
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  import { XIcon as r } from "lucide-react";
5
5
  import { Dialog as i } from "radix-ui";