@levo-so/studio 0.1.95 → 0.1.98

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 (41) hide show
  1. package/{BillingStep-BLwl9IDQ.js → BillingStep-C3jJkLXQ.js} +1 -1
  2. package/{Button-C6BOkG_z.js → Button-CwN6jTXH.js} +1 -1
  3. package/CollectionField-DnbpB0Z5.js +254 -0
  4. package/CollectionInput-BoNAc4sq.js +132 -0
  5. package/DateTimeWidget-IRleQI-3.js +255 -0
  6. package/{EntryCard-B-feJvrB.js → EntryCard-xpo36vUc.js} +3 -3
  7. package/{LoginCard-CF9JbU-y.js → LoginCard-DG8NAN0B.js} +3 -3
  8. package/{LoginForm-CdpNCQJa.js → LoginForm-CPMtCyMF.js} +4 -0
  9. package/{LoginModal-ngTHCyli.js → LoginModal-BPI5tOIZ.js} +3 -3
  10. package/{MessageCard-D2uja800.js → MessageCard-BYxgc9dl.js} +2 -2
  11. package/{ModalManager-B7pCzvK1.js → ModalManager-BaIL6HG-.js} +1 -1
  12. package/{PendingApprovalCard-Dut-Xiw1.js → PendingApprovalCard-DID1FhwF.js} +3 -3
  13. package/PhoneWidget-CjhHfwuG.js +100 -0
  14. package/Popover-DHVZdJuv.js +56 -0
  15. package/RichTextWidget-CgT1_zC3.js +1135 -0
  16. package/Tooltip-ByJRyayB.js +78 -0
  17. package/VerifyButton-DFKzKYxC.js +283 -0
  18. package/{bookingCard-BU_MdmS9.js → bookingCard-Bw4tvDYh.js} +3 -3
  19. package/collection.d.ts +81 -46
  20. package/collection.js +8 -5
  21. package/dist-B7TPxn7o.js +3180 -0
  22. package/getFieldValidations-qVzuq6mv.js +195 -0
  23. package/index.d.ts +5 -5
  24. package/index.js +1229 -1434
  25. package/nodeAlignment-CG3qmAuQ.js +180 -0
  26. package/package.json +3 -4
  27. package/studio.css +1 -1
  28. package/theme.cssm-De_pl52g.js +4 -0
  29. package/{utils-KqbqLlMF.js → utils-F6eBcsyI.js} +1 -1
  30. package/widgets-Dvyv5_uj.js +215 -0
  31. package/dist-DDKHTnIW.js +0 -3653
  32. package/widgets-B84lq4lO.js +0 -351
  33. /package/{Beams-CCNNOvfW.js → Beams-Blr-zwvz.js} +0 -0
  34. /package/{Dots-89WGkd-z.js → Dots-DeBKuibU.js} +0 -0
  35. /package/{Gradient-vTa_uWCj.js → Gradient-DGFxOjft.js} +0 -0
  36. /package/{Grid-CrtztrxK.js → Grid-A7HRCQ0T.js} +0 -0
  37. /package/{MessageFooter-Bu-jyPkJ.js → MessageFooter-C6DivT4m.js} +0 -0
  38. /package/{StripePaymentModal-CajqohNM.js → StripePaymentModal-BcePXzmC.js} +0 -0
  39. /package/{Waves-BhA6CLEI.js → Waves-CIT6Ngng.js} +0 -0
  40. /package/{card-DCbhJCO9.js → card-izMd2DvE.js} +0 -0
  41. /package/{dialog-CILIXExr.js → dialog-CCWrvmHd.js} +0 -0
@@ -0,0 +1,78 @@
1
+ import { i as e, r as t } from "./getFieldValidations-qVzuq6mv.js";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { assignInlineVars as i } from "@vanilla-extract/dynamic";
4
+ import { c as a } from "react/compiler-runtime";
5
+ import o from "clsx";
6
+ import { Tooltip as s } from "@base-ui/react/tooltip";
7
+ //#region ../../libraries/levocn/dist/theme/utils/createThemeExtension.js
8
+ var c = (e, t) => {
9
+ let n = {};
10
+ for (let r of Object.keys(t)) {
11
+ let i = t[r], a = e[r];
12
+ if (!(i === void 0 || a === void 0)) if (typeof i == "object" && i && !Array.isArray(i)) {
13
+ let e = c(a, i);
14
+ Object.assign(n, e);
15
+ } else typeof a == "string" && (n[a] = String(i));
16
+ }
17
+ return n;
18
+ }, l = (e) => (t) => t ? i(c(e, t)) : {}, u = "_3zwjqd0", d = "_3zwjqd1", f = "_3zwjqd2", p = (e) => {
19
+ let t = a(6), r, i;
20
+ t[0] === e ? (r = t[1], i = t[2]) : ({delay: i, ...r} = e, t[0] = e, t[1] = r, t[2] = i);
21
+ let o = i === void 0 ? 0 : i, c;
22
+ return t[3] !== o || t[4] !== r ? (c = /* @__PURE__ */ n(s.Provider, {
23
+ "data-slot": "tooltip-provider",
24
+ delay: o,
25
+ ...r
26
+ }), t[3] = o, t[4] = r, t[5] = c) : c = t[5], c;
27
+ }, m = (e) => {
28
+ let t = a(4), r;
29
+ t[0] === e ? r = t[1] : ({...r} = e, t[0] = e, t[1] = r);
30
+ let i;
31
+ return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ n(s.Root, {
32
+ "data-slot": "tooltip",
33
+ ...r
34
+ }), t[2] = r, t[3] = i), i;
35
+ }, h = (e) => {
36
+ let r = a(12), i, c, l, u;
37
+ r[0] === e ? (i = r[1], c = r[2], l = r[3], u = r[4]) : ({className: i, variant: u, size: l, ...c} = e, r[0] = e, r[1] = i, r[2] = c, r[3] = l, r[4] = u);
38
+ let d;
39
+ r[5] !== i || r[6] !== l || r[7] !== u ? (d = o(t({
40
+ variant: u,
41
+ size: l
42
+ }), i), r[5] = i, r[6] = l, r[7] = u, r[8] = d) : d = r[8];
43
+ let f;
44
+ return r[9] !== c || r[10] !== d ? (f = /* @__PURE__ */ n(s.Trigger, {
45
+ className: d,
46
+ ...c
47
+ }), r[9] = c, r[10] = d, r[11] = f) : f = r[11], f;
48
+ }, g = (t) => {
49
+ let i = a(24), c, l, p, m, h, g, _;
50
+ i[0] === t ? (c = i[1], l = i[2], p = i[3], m = i[4], h = i[5], g = i[6], _ = i[7]) : ({className: l, side: m, sideOffset: h, align: g, alignOffset: _, children: c, ...p} = t, i[0] = t, i[1] = c, i[2] = l, i[3] = p, i[4] = m, i[5] = h, i[6] = g, i[7] = _);
51
+ let v = m === void 0 ? "top" : m, y = h === void 0 ? 8 : h, b = g === void 0 ? "center" : g, x = _ === void 0 ? 0 : _, { portalRef: S } = e(), C;
52
+ i[8] === l ? C = i[9] : (C = o(u, l), i[8] = l, i[9] = C);
53
+ let w;
54
+ i[10] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(s.Arrow, { className: d }), i[10] = w) : w = i[10];
55
+ let T;
56
+ i[11] !== c || i[12] !== p || i[13] !== C ? (T = /* @__PURE__ */ r(s.Popup, {
57
+ "data-slot": "tooltip-content",
58
+ className: C,
59
+ ...p,
60
+ children: [c, w]
61
+ }), i[11] = c, i[12] = p, i[13] = C, i[14] = T) : T = i[14];
62
+ let E;
63
+ i[15] !== b || i[16] !== x || i[17] !== v || i[18] !== y || i[19] !== T ? (E = /* @__PURE__ */ n(s.Positioner, {
64
+ align: b,
65
+ alignOffset: x,
66
+ side: v,
67
+ sideOffset: y,
68
+ className: f,
69
+ children: T
70
+ }), i[15] = b, i[16] = x, i[17] = v, i[18] = y, i[19] = T, i[20] = E) : E = i[20];
71
+ let D;
72
+ return i[21] !== S || i[22] !== E ? (D = /* @__PURE__ */ n(s.Portal, {
73
+ container: S,
74
+ children: E
75
+ }), i[21] = S, i[22] = E, i[23] = D) : D = i[23], D;
76
+ };
77
+ //#endregion
78
+ export { l as a, p as i, h as n, g as r, m as t };
@@ -0,0 +1,283 @@
1
+ "use client";
2
+ import { i as e, n as t } from "./getFieldValidations-qVzuq6mv.js";
3
+ import { t as n } from "./CollectionInput-BoNAc4sq.js";
4
+ import { useEffect as r, useState as i } from "react";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ import { errorToast as c, successToast as l, useLevo as u } from "@levo-so/react";
7
+ import { c as d } from "react/compiler-runtime";
8
+ import f from "clsx";
9
+ import { IconCircleCheck as p, IconLoader as m, IconX as h } from "@tabler/icons-react";
10
+ import { Dialog as g } from "@base-ui/react/dialog";
11
+ //#region ../../libraries/levocn/dist/ui/spinner/Spinner.cssm.js
12
+ var _ = "_1k4xirc1", v = (e) => {
13
+ let t = d(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 = f(_, n), t[3] = n, t[4] = i);
17
+ let a;
18
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(m, {
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
+ }, y = "qkytrb0", b = "qkytrb1", x = "qkytrb2", S = "qkytrb3", C = "qkytrb4", w = "qkytrb5", T = "qkytrb6", E = "ch8h0x0", D = "ch8h0x1", O = "ch8h0x2", k = "ch8h0x3", A = "ch8h0x5", j = (e) => {
25
+ let t = d(4), n;
26
+ t[0] === e ? n = t[1] : ({...n} = e, t[0] = e, t[1] = n);
27
+ let r;
28
+ return t[2] === n ? r = t[3] : (r = /* @__PURE__ */ o(g.Root, {
29
+ "data-slot": "dialog",
30
+ ...n
31
+ }), t[2] = n, t[3] = r), r;
32
+ }, M = (t) => {
33
+ let n = d(5), r;
34
+ n[0] === t ? r = n[1] : ({...r} = t, n[0] = t, n[1] = r);
35
+ let { portalRef: i } = e(), a;
36
+ return n[2] !== i || n[3] !== r ? (a = /* @__PURE__ */ o(g.Portal, {
37
+ container: i,
38
+ ...r
39
+ }), n[2] = i, n[3] = r, n[4] = a) : a = n[4], a;
40
+ }, N = (e) => {
41
+ let t = d(8), n, r;
42
+ t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
43
+ let i;
44
+ t[3] === n ? i = t[4] : (i = f(D, n), t[3] = n, t[4] = i);
45
+ let a;
46
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Viewport, {
47
+ "data-slot": "dialog-viewport",
48
+ className: i,
49
+ ...r
50
+ }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
51
+ }, P = (e) => {
52
+ let n = d(10), r, i, a;
53
+ n[0] === e ? (r = n[1], i = n[2], a = n[3]) : ({variant: a, size: i, ...r} = e, n[0] = e, n[1] = r, n[2] = i, n[3] = a);
54
+ let s;
55
+ n[4] !== i || n[5] !== a ? (s = /* @__PURE__ */ o(t, {
56
+ variant: a,
57
+ size: i
58
+ }), n[4] = i, n[5] = a, n[6] = s) : s = n[6];
59
+ let c;
60
+ return n[7] !== r || n[8] !== s ? (c = /* @__PURE__ */ o(g.Close, {
61
+ "data-slot": "dialog-close",
62
+ render: s,
63
+ ...r
64
+ }), n[7] = r, n[8] = s, n[9] = c) : c = n[9], c;
65
+ }, F = (e) => {
66
+ let t = d(8), n, r;
67
+ t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
68
+ let i;
69
+ t[3] === n ? i = t[4] : (i = f(E, n), t[3] = n, t[4] = i);
70
+ let a;
71
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Backdrop, {
72
+ "data-slot": "dialog-backdrop",
73
+ className: i,
74
+ ...r
75
+ }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
76
+ }, I = (e) => {
77
+ let n = d(14), r, i, a, c;
78
+ n[0] === e ? (r = n[1], i = n[2], a = n[3], c = n[4]) : ({className: i, children: r, showCloseButton: c, ...a} = e, n[0] = e, n[1] = r, n[2] = i, n[3] = a, n[4] = c);
79
+ let l = c === void 0 ? !0 : c, u;
80
+ n[5] === i ? u = n[6] : (u = f(O, i), n[5] = i, n[6] = u);
81
+ let p;
82
+ n[7] === l ? p = n[8] : (p = l && /* @__PURE__ */ o(g.Close, {
83
+ "data-slot": "dialog-close",
84
+ render: /* @__PURE__ */ o(t, {
85
+ variant: "ghost",
86
+ size: "icon-sm",
87
+ className: "ch8h0x7",
88
+ "aria-label": "Close"
89
+ }),
90
+ children: /* @__PURE__ */ o(h, { size: 16 })
91
+ }), n[7] = l, n[8] = p);
92
+ let m;
93
+ return n[9] !== r || n[10] !== a || n[11] !== u || n[12] !== p ? (m = /* @__PURE__ */ s(g.Popup, {
94
+ "data-slot": "dialog-popup",
95
+ className: u,
96
+ ...a,
97
+ children: [r, p]
98
+ }), n[9] = r, n[10] = a, n[11] = u, n[12] = p, n[13] = m) : m = n[13], m;
99
+ }, L = (e) => {
100
+ let t = d(8), n, r;
101
+ t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
102
+ let i;
103
+ t[3] === n ? i = t[4] : (i = f(k, n), t[3] = n, t[4] = i);
104
+ let a;
105
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o("div", {
106
+ "data-slot": "dialog-header",
107
+ className: i,
108
+ ...r
109
+ }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
110
+ }, R = (e) => {
111
+ let t = d(8), n, r;
112
+ t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
113
+ let i;
114
+ t[3] === n ? i = t[4] : (i = f(A, n), t[3] = n, t[4] = i);
115
+ let a;
116
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ o(g.Title, {
117
+ "data-slot": "dialog-title",
118
+ className: i,
119
+ ...r
120
+ }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
121
+ }, z = (e) => {
122
+ let t = d(11), n, r, i, a;
123
+ t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4]) : ({className: r, children: n, showCloseButton: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a);
124
+ let c = a === void 0 ? !0 : a, l;
125
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ o(F, {}), t[5] = l) : l = t[5];
126
+ let u;
127
+ return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== c ? (u = /* @__PURE__ */ s(M, { children: [l, /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(I, {
128
+ className: r,
129
+ showCloseButton: c,
130
+ ...i,
131
+ children: n
132
+ }) })] }), t[6] = n, t[7] = r, t[8] = i, t[9] = c, t[10] = u) : u = t[10], u;
133
+ }, B = ({ isOpen: e, onClose: a, value: d, type: f = "email", onVerifySuccess: p }) => {
134
+ let { membership: m } = u(), [h, g] = i(""), [_, v] = i(!1), [E, D] = i(!1), [O, k] = i(30);
135
+ return r(() => {
136
+ let t;
137
+ return e && O > 0 && (t = setInterval(() => {
138
+ k((e) => e - 1);
139
+ }, 1e3)), () => clearInterval(t);
140
+ }, [e, O]), r(() => {
141
+ e && (g(""), k(30), v(!1), D(!1));
142
+ }, [e]), /* @__PURE__ */ o(j, {
143
+ open: e,
144
+ onOpenChange: (e) => {
145
+ e || a();
146
+ },
147
+ children: /* @__PURE__ */ s(z, { children: [/* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(R, { children: `Verify ${f === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ s("div", {
148
+ className: y,
149
+ children: [
150
+ /* @__PURE__ */ s("div", {
151
+ className: b,
152
+ children: [
153
+ "Enter the 4-digit code sent to ",
154
+ /* @__PURE__ */ o("strong", { children: d }),
155
+ ".",
156
+ " ",
157
+ /* @__PURE__ */ o("button", {
158
+ onClick: () => a(),
159
+ className: x,
160
+ children: "Change?"
161
+ })
162
+ ]
163
+ }),
164
+ /* @__PURE__ */ o("div", {
165
+ className: S,
166
+ children: /* @__PURE__ */ o(n, {
167
+ value: h,
168
+ onChange: (e) => {
169
+ g(e.target.value.replace(/\D/g, "").slice(0, 4));
170
+ },
171
+ placeholder: "0000",
172
+ maxLength: 4,
173
+ className: w
174
+ })
175
+ }),
176
+ /* @__PURE__ */ s("div", {
177
+ className: C,
178
+ children: [/* @__PURE__ */ o(t, {
179
+ onClick: async () => {
180
+ if (!(!h || h.length !== 4)) {
181
+ v(!0);
182
+ try {
183
+ await m?.signInWithOtp({
184
+ content: d,
185
+ code: h
186
+ }), l("Verification successful"), p(d), a();
187
+ } catch (e) {
188
+ let t = e;
189
+ c(t?.message || "Invalid OTP", t?.title || "Verification Failed");
190
+ } finally {
191
+ v(!1);
192
+ }
193
+ }
194
+ },
195
+ disabled: h.length !== 4 || _,
196
+ className: "w-full",
197
+ children: _ ? "Verifying..." : "Verify"
198
+ }), /* @__PURE__ */ o("div", {
199
+ className: T,
200
+ children: O > 0 ? /* @__PURE__ */ s("span", { children: [
201
+ "Resend code in ",
202
+ O,
203
+ "s"
204
+ ] }) : /* @__PURE__ */ o("button", {
205
+ onClick: async () => {
206
+ if (!(O > 0)) {
207
+ D(!0);
208
+ try {
209
+ await m?.requestOtp({
210
+ content: d,
211
+ medium: f === "phone" ? "whatsapp" : "email"
212
+ }), l("OTP resent successfully"), k(30);
213
+ } catch (e) {
214
+ let t = e;
215
+ c(t?.message || "Failed to resend OTP", t?.title || "Error");
216
+ } finally {
217
+ D(!1);
218
+ }
219
+ }
220
+ },
221
+ disabled: E,
222
+ className: x,
223
+ children: E ? "Resending..." : "Resend Code"
224
+ })
225
+ })]
226
+ })
227
+ ]
228
+ })] })
229
+ });
230
+ }, V = "jfrbe10", H = "jfrbe11", U = "jfrbe12", W = ({ value: e, type: n, isVerified: r, onVerifySuccess: l, onStateChange: d }) => {
231
+ let { membership: f } = u(), [m, h] = i(!1), [g, _] = i(!1), y = (e) => {
232
+ d && d(e);
233
+ }, b = async () => {
234
+ let t = e?.trim()?.toLowerCase();
235
+ if (!t) {
236
+ c(`Please enter a ${n}`);
237
+ return;
238
+ }
239
+ if (n === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)) {
240
+ c("Please enter a valid email address");
241
+ return;
242
+ }
243
+ _(!0), y(!0);
244
+ try {
245
+ await f?.requestOtp({
246
+ content: t,
247
+ medium: n === "phone" ? "whatsapp" : "email"
248
+ }), h(!0);
249
+ } catch (e) {
250
+ let t = e;
251
+ c(t?.message || "Failed to send OTP", t?.title || "Error"), y(!1);
252
+ } finally {
253
+ _(!1);
254
+ }
255
+ }, x = () => {
256
+ h(!1), y(!1);
257
+ };
258
+ return r ? /* @__PURE__ */ s("div", {
259
+ className: V,
260
+ children: [/* @__PURE__ */ o(p, { className: U }), /* @__PURE__ */ o("span", {
261
+ className: H,
262
+ children: "Verified"
263
+ })]
264
+ }) : /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(t, {
265
+ size: "default",
266
+ variant: "ghost",
267
+ onClick: b,
268
+ onMouseDown: (e) => e.preventDefault(),
269
+ disabled: !e || g,
270
+ type: "button",
271
+ children: g ? /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(v, { size: 14 }), "Sending..."] }) : "Verify"
272
+ }), m && /* @__PURE__ */ o(B, {
273
+ isOpen: m,
274
+ onClose: x,
275
+ value: e?.trim()?.toLowerCase() || "",
276
+ type: n,
277
+ onVerifySuccess: (e) => {
278
+ l(e), x();
279
+ }
280
+ })] });
281
+ };
282
+ //#endregion
283
+ export { P as a, R as i, L as n, j as o, z as r, v as s, W as t };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { n as e } from "./AuthProvider-56TywIOB.js";
3
- import { t } from "./Button-C6BOkG_z.js";
4
- import { n, t as r } from "./StripePaymentModal-CajqohNM.js";
5
- import { BillingStep as ee } from "./BillingStep-BLwl9IDQ.js";
3
+ import { t } from "./Button-CwN6jTXH.js";
4
+ import { n, t as r } from "./StripePaymentModal-BcePXzmC.js";
5
+ import { BillingStep as ee } from "./BillingStep-C3jJkLXQ.js";
6
6
  import { useRef as i, useState as a } from "react";
7
7
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
8
  import { cn as te, errorHandler as l, useLevo as u } from "@levo-so/react";
package/collection.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { AsyncPaginateProps } from 'react-select-async-paginate';
2
- import { Checkbox as Checkbox_2 } from 'radix-ui';
3
2
  import { CommonFieldInterfacesList } from '@levo-so/core';
4
3
  import { CSSProperties } from 'react';
5
4
  import { default as default_2 } from 'react';
@@ -11,11 +10,12 @@ import { ILemaCollection } from '@levo-so/core';
11
10
  import { ILemaField } from '@levo-so/core';
12
11
  import { ILemaFieldOptions } from '@levo-so/core';
13
12
  import { ILevoMembership } from '@levo-so/core';
13
+ import { JSX } from 'react/jsx-runtime';
14
14
  import { MediaKindList } from '@levo-so/core';
15
- import * as React_2 from 'react';
16
15
  import { ReactElement } from 'react';
16
+ import { RecipeVariants } from '@vanilla-extract/recipes';
17
17
  import { RegisterOptions } from 'react-hook-form';
18
- import { Switch as Switch_2 } from 'radix-ui';
18
+ import { RuntimeFn } from '@vanilla-extract/recipes';
19
19
  import { UseFormReturn } from 'react-hook-form';
20
20
  import { UseFormSetError } from 'react-hook-form';
21
21
 
@@ -23,7 +23,25 @@ export declare const areAllFieldsHidden: (fields: ILemaField[]) => boolean;
23
23
 
24
24
  export declare const AsyncSelectPaginate: default_2.FC<AsyncPaginateProps<any, any, any, any>>;
25
25
 
26
- export declare const Checkbox: React_2.ForwardRefExoticComponent<Omit<Checkbox_2.CheckboxProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
26
+ /**
27
+ * Collection-scoped field wrapper.
28
+ * Composes levocn Field primitives with collection theme overrides.
29
+ * Replaces the old FieldWrapper + FormLabel + FormHelperText + ErrorMessage.
30
+ */
31
+ declare function CollectionFieldWrapper({ label, error, helperText, topHelperText, isRequired, readOnly, htmlFor, className, children, ref, }: {
32
+ label?: React.ReactNode;
33
+ error?: React.ReactNode;
34
+ helperText?: string;
35
+ topHelperText?: string;
36
+ isRequired?: boolean;
37
+ readOnly?: boolean;
38
+ htmlFor?: string;
39
+ className?: string;
40
+ children: React.ReactNode;
41
+ ref?: React.Ref<HTMLDivElement>;
42
+ }): JSX.Element;
43
+ export { CollectionFieldWrapper }
44
+ export { CollectionFieldWrapper as FieldWrapper }
27
45
 
28
46
  export declare const CollectionForm: default_2.FC<ICollectionFormProps>;
29
47
 
@@ -31,16 +49,44 @@ export declare const CollectionFormBuilder: default_2.FC<ICollectionFormBuilderP
31
49
 
32
50
  export declare const CollectionFormRenderer: default_2.FC<ICollectionFormRendererProps>;
33
51
 
52
+ /**
53
+ * Collection-scoped input.
54
+ * Plain input when no icons, InputGroup composition when icons are present.
55
+ * Sizing (height, fontSize, borderRadius) comes from collectionThemeVars.
56
+ */
57
+ declare function CollectionInput({ leftIcon, rightIcon, className, ...props }: ICollectionInputProps): JSX.Element;
58
+ export { CollectionInput }
59
+ export { CollectionInput as Input }
60
+
61
+ /** Styled label with optional required indicator. Replaces duplicated Label + asterisk pattern. */
62
+ export declare function CollectionLabel({ label, isRequired, htmlFor, }: {
63
+ label?: React.ReactNode;
64
+ isRequired?: boolean;
65
+ htmlFor?: string;
66
+ }): JSX.Element | null;
67
+
34
68
  export declare const createWidget: (component: WidgetComponent) => WidgetComponent;
35
69
 
36
70
  export declare const DEFAULT_WIDGET_REGISTRY: IWidgetRegistry;
37
71
 
38
- export declare const ErrorMessage: default_2.FC<{
39
- children: default_2.ReactNode;
40
- }>;
41
-
42
72
  export declare const errorsToParam: (data: Record<string, string[]>) => ParamError[];
43
73
 
74
+ export declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & FieldVariants): JSX.Element;
75
+
76
+ export declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
77
+
78
+ export declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): JSX.Element;
79
+
80
+ export declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
81
+ errors?: Array<{
82
+ message?: string;
83
+ } | undefined>;
84
+ }): JSX.Element | null;
85
+
86
+ export declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
87
+
88
+ export declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): JSX.Element;
89
+
44
90
  export declare const FieldRenderer: default_2.FC<{
45
91
  schema: ILemaCollection | null;
46
92
  field: ILemaField;
@@ -50,18 +96,28 @@ export declare const FieldRenderer: default_2.FC<{
50
96
  };
51
97
  }>;
52
98
 
53
- /**
54
- * @description This component is used to wrap the input components and display the error message and helper text.
55
- */
56
- export declare const FieldWrapper: default_2.ForwardRefExoticComponent<IFieldWrapperProps & default_2.RefAttributes<HTMLDivElement>>;
99
+ export declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): JSX.Element;
57
100
 
58
- export declare const FormBuilder: default_2.FC<IFormBuilderProps>;
101
+ declare type FieldVariants = NonNullable<RecipeVariants<typeof fieldVariants>>;
59
102
 
60
- export declare const FormHelperText: default_2.FC<{
61
- children: default_2.ReactNode;
103
+ declare const fieldVariants: RuntimeFn< {
104
+ orientation: {
105
+ vertical: {
106
+ flexDirection: "column";
107
+ };
108
+ horizontal: {
109
+ flexDirection: "row";
110
+ alignItems: "center";
111
+ selectors: {
112
+ "&:has(>[data-slot=field-content])": {
113
+ alignItems: "start";
114
+ };
115
+ };
116
+ };
117
+ };
62
118
  }>;
63
119
 
64
- export declare const FormLabel: default_2.FC<IFormLabelProps>;
120
+ export declare const FormBuilder: default_2.FC<IFormBuilderProps>;
65
121
 
66
122
  declare type FormValidationOptionsType = Partial<Pick<RegisterOptions, "required" | "min" | "max" | "minLength" | "maxLength" | "pattern" | "validate">>;
67
123
 
@@ -138,6 +194,11 @@ export declare interface ICollectionFormRendererProps extends Omit<ILevoFormCont
138
194
  isLoading?: boolean;
139
195
  }
140
196
 
197
+ export declare interface ICollectionInputProps extends React.ComponentProps<"input"> {
198
+ leftIcon?: React.ReactNode;
199
+ rightIcon?: React.ReactNode;
200
+ }
201
+
141
202
  declare interface ICommonRendererProps {
142
203
  schema: ILemaCollection | null;
143
204
  field: ILemaField;
@@ -157,28 +218,10 @@ export declare interface IFieldControlProps {
157
218
  inputContainerStyles?: string;
158
219
  }
159
220
 
160
- declare interface IFieldWrapperProps {
161
- error?: default_2.ReactNode;
162
- helperText?: string;
163
- topHelperText?: string;
164
- children: default_2.ReactNode;
165
- readOnly?: boolean;
166
- isRequired?: boolean;
167
- containerStyles?: string;
168
- labelStyles?: string;
169
- label?: default_2.ReactNode;
170
- htmlFor?: string;
171
- }
172
-
173
221
  export declare interface IFormBuilderProps extends ILevoFormContext {
174
222
  formVariant?: FormVariantType;
175
223
  }
176
224
 
177
- declare interface IFormLabelProps extends default_2.LabelHTMLAttributes<HTMLLabelElement> {
178
- isRequired?: boolean;
179
- children?: default_2.ReactNode;
180
- }
181
-
182
225
  export declare interface IFormRendererProps extends ILevoFormContext {
183
226
  children: default_2.ReactNode;
184
227
  variant?: FormVariantType;
@@ -205,14 +248,6 @@ export declare interface IFormVariantProps {
205
248
  };
206
249
  }
207
250
 
208
- declare interface IInputProps extends default_2.ComponentPropsWithRef<"input"> {
209
- leftIcon?: default_2.ReactNode;
210
- rightIcon?: default_2.ReactNode;
211
- leftIconBoxStyles?: string;
212
- rightIconBoxStyles?: string;
213
- containerStyles?: string;
214
- }
215
-
216
251
  export declare interface ILevoFormContext {
217
252
  schema: ILemaCollection | null;
218
253
  isDisabled?: boolean;
@@ -265,6 +300,8 @@ export declare interface ILevoFormContext {
265
300
  };
266
301
  };
267
302
  debug?: boolean;
303
+ /** When true, the form is in preview mode — no remote submission, no drafts, no captcha, no analytics. */
304
+ preview?: boolean;
268
305
  }
269
306
 
270
307
  export declare interface ILevoFormThemeContext {
@@ -273,12 +310,12 @@ export declare interface ILevoFormThemeContext {
273
310
  cssReset?: boolean;
274
311
  }
275
312
 
276
- export declare const Input: default_2.ForwardRefExoticComponent<Omit<IInputProps, "ref"> & default_2.RefAttributes<HTMLInputElement>>;
277
-
278
313
  export declare const isPhoneValid: (phone: string) => boolean;
279
314
 
280
315
  export declare type IWidgetRegistry = Record<(typeof CommonFieldInterfacesList)[number], WidgetComponent>;
281
316
 
317
+ declare const Label: React.FC<React.ComponentProps<"label">>;
318
+
282
319
  export declare const LevoFormProvider: default_2.FC<IFormRendererProps>;
283
320
 
284
321
  declare type ParamError = {
@@ -290,8 +327,6 @@ export declare const setFormErrors: (errors: IFieldError[], setError: UseFormSet
290
327
 
291
328
  export declare const submitDataParser: (data: Record<string, unknown>, schema: ILemaCollection) => any;
292
329
 
293
- export declare const Switch: React_2.ForwardRefExoticComponent<Omit<Switch_2.SwitchProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
294
-
295
330
  export declare const ThemeWrapper: default_2.FC<{
296
331
  children: default_2.ReactNode;
297
332
  className?: string;
package/collection.js CHANGED
@@ -1,8 +1,11 @@
1
- import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, u as g, v as _, y as v } from "./dist-DDKHTnIW.js";
2
- import { a as y, c as b, d as x, f as S, i as C, l as w, n as T, o as E, p as D, r as O, s as k, t as A, u as j } from "./widgets-B84lq4lO.js";
3
- import { t as M } from "./utils-KqbqLlMF.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, u as d } from "./dist-B7TPxn7o.js";
2
+ import { t as f } from "./getFieldValidations-qVzuq6mv.js";
3
+ import { a as p, c as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x } from "./CollectionField-DnbpB0Z5.js";
4
+ import { a as S, c as C, d as w, f as T, i as E, l as D, n as O, o as k, r as A, s as j, t as M, u as N } from "./widgets-Dvyv5_uj.js";
5
+ import { t as P } from "./utils-F6eBcsyI.js";
6
+ import { t as F } from "./CollectionInput-BoNAc4sq.js";
4
7
  //#region ../../libraries/react-collection/dist/types/formVariant.js
5
- var N = [
8
+ var I = [
6
9
  {
7
10
  value: "default",
8
11
  label: "Classic",
@@ -25,4 +28,4 @@ var N = [
25
28
  }
26
29
  ];
27
30
  //#endregion
28
- export { u as AsyncSelectPaginate, p as Checkbox, r as CollectionForm, m as CollectionFormBuilder, d as CollectionFormRenderer, g as DEFAULT_WIDGET_REGISTRY, _ as ErrorMessage, l as FieldRenderer, s as FieldWrapper, c as FormBuilder, o as FormHelperText, e as FormLabel, N as FormVariantOptions, a as Input, h as LevoFormProvider, i as Switch, v as ThemeWrapper, D as areAllFieldsHidden, A as createWidget, y as errorsToParam, k as getDefaultFieldValues, S as getDefaultValuesByKind, O as getFieldValidations, w as getInitialValues, M as getKindFromMimetype, x as getValueIfNotUndefined, j as isPhoneValid, T as setFormErrors, C as submitDataParser, b as updateFieldWInterface, t as useLevoForm, f as useLevoFormContext, n as useLevoFormTheme, E as validateForm };
31
+ export { c as AsyncSelectPaginate, x as CollectionFieldWrapper, x as FieldWrapper, t as CollectionForm, l as CollectionFormBuilder, o as CollectionFormRenderer, F as CollectionInput, F as Input, g as CollectionLabel, r as DEFAULT_WIDGET_REGISTRY, p as Field, b as FieldContent, v as FieldDescription, _ as FieldError, m as FieldGroup, y as FieldLabel, n as FieldRenderer, h as FieldSet, i as FormBuilder, I as FormVariantOptions, s as LevoFormProvider, d as ThemeWrapper, T as areAllFieldsHidden, M as createWidget, E as errorsToParam, k as getDefaultFieldValues, w as getDefaultValuesByKind, f as getFieldValidations, C as getInitialValues, P as getKindFromMimetype, N as getValueIfNotUndefined, D as isPhoneValid, O as setFormErrors, A as submitDataParser, j as updateFieldWInterface, e as useLevoForm, u as useLevoFormContext, a as useLevoFormTheme, S as validateForm };