@levo-so/site-runtime 0.3.7 → 0.3.9

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 (45) hide show
  1. package/CollectionField-C-6a1ud4.js +270 -0
  2. package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
  3. package/DateTimeWidget-LfaosVVW.js +255 -0
  4. package/{Dialog-DVB4WpBS.js → Dialog-dT7y641z.js} +43 -43
  5. package/{KBChatWidget-Cnq0DCOQ.js → KBChatWidget-CuAtGhHT.js} +240 -239
  6. package/{LevoProvider-nmIbMlsk.js → LevoProvider-Bsjkcwc8.js} +8 -8
  7. package/PhoneWidget-D-CcDuie.js +99 -0
  8. package/{Popover-C7zZHBIc.js → Popover-BTdlOQP_.js} +20 -20
  9. package/{PopupBody-DZVwDLkg-yrot8Uqb.js → PopupBody-BI-MJqmd-C0qNyN7V.js} +299 -182
  10. package/PopupRenderer-D66Gx63H-C6RnOnl2.js +388 -0
  11. package/{RichTextWidget-BOrVIR2j.js → RichTextWidget-BFWVevY7.js} +140 -140
  12. package/ThemeProvider-DutrjSTF.js +116 -0
  13. package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
  14. package/{VerifyButton-CA1GtEZJ.js → VerifyButton-BUT70lgz.js} +65 -65
  15. package/{dist-Cb6sb7nO.js → dist-Rjs__H25.js} +14 -14
  16. package/dist-orLT2eNz.js +3663 -0
  17. package/index.d.ts +1071 -3
  18. package/index.js +1365 -733
  19. package/inlineBaseTheme-BB9e6h5f.js +9 -0
  20. package/{inlineCollectionTheme-DYYMrmcE.js → inlineCollectionTheme-CWcMCUti.js} +1 -1
  21. package/{kbChat-DIb4AS7E.js → kbChat-L55effMi.js} +28 -28
  22. package/{nodeAlignment-D70kOcui.js → nodeAlignment-COvc-rIj.js} +1 -1
  23. package/package.json +37 -27
  24. package/popups.js +1 -1
  25. package/{react-6kO0cqgr.js → react-B9yvlbH0.js} +1 -1
  26. package/routes-CyKmkoRM.js +316 -0
  27. package/start.d.ts +38 -0
  28. package/start.js +19 -0
  29. package/styles.css +1 -1
  30. package/{generateRadiusScale-54mE9ikx.js → themeVars.cssm-ByhhC2Jm.js} +17 -17
  31. package/usePopupRedirect-CAAdcpaW-D9XoiVhG.js +82 -0
  32. package/CollectionField-C59pmeQw.js +0 -270
  33. package/DateTimeWidget-Cctsvcrs.js +0 -255
  34. package/PhoneWidget-J3VTMWJH.js +0 -99
  35. package/PopupRenderer-BjW1jg70-Biwj2bIc.js +0 -387
  36. package/ThemeProvider-BQmIB5tr.js +0 -116
  37. package/dist-C8gLeklT.js +0 -3559
  38. package/inlineBaseTheme-B6E9zzyp.js +0 -9
  39. package/usePopupRedirect-BThP_YPW-DoixMAB9.js +0 -80
  40. /package/{createThemeExtension-DhGk81nV.js → createThemeExtension-4AUn51iJ.js} +0 -0
  41. /package/{es-CztjLuNy.js → es-Bj3CsMJz.js} +0 -0
  42. /package/{pillChrome-BAu5AfCT.js → pillChrome-uieiq_SK.js} +0 -0
  43. /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
  44. /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-CaRzrwtu.js} +0 -0
  45. /package/{theme.cssm-mkQwezuj.js → theme.cssm-DUzmx76l.js} +0 -0
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { createContext as e, useContext as t } from "react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ import { createContext as t, useContext as n } from "react";
4
4
  //#region ../react/dist/providers/LevoProvider.js
5
- var r = e({
5
+ var r = t({
6
6
  client: null,
7
7
  insights: null
8
- }), i = ({ children: e, client: t, insights: i = null }) => /* @__PURE__ */ n(r.Provider, {
8
+ }), i = ({ children: t, client: n, insights: i = null }) => /* @__PURE__ */ e(r.Provider, {
9
9
  value: {
10
- client: t,
10
+ client: n,
11
11
  insights: i
12
12
  },
13
- children: e
13
+ children: t
14
14
  }), a = () => {
15
- let e = t(r);
15
+ let e = n(r);
16
16
  if (!e.client) throw Error("useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider.");
17
17
  return e.client;
18
- }, o = () => t(r).client, s = () => t(r).insights;
18
+ }, o = () => n(r).client, s = () => n(r).insights;
19
19
  //#endregion
20
20
  export { s as i, i as n, o as r, a as t };
@@ -0,0 +1,99 @@
1
+ "use client";
2
+ import { r as e, t } from "./CollectionField-C-6a1ud4.js";
3
+ import { t as ee } from "./VerifyButton-BUT70lgz.js";
4
+ import { t as n } from "./CollectionInput-BJ__qcbk.js";
5
+ import te, { isSupportedCountry as r } from "react-phone-number-input";
6
+ import { useController as i } from "react-hook-form";
7
+ import { c as a } from "react/compiler-runtime";
8
+ import { jsx as o, jsxs as ne } from "react/jsx-runtime";
9
+ import { useState as s } from "react";
10
+ import { IconPencil as re } from "@tabler/icons-react";
11
+ //#region ../../libraries/react-collection/dist/widgets/phoneWidget/PhoneWidget.cssm.js
12
+ var ie = "_89f1hw0", c = "_89f1hw1", l = "_89f1hw2", ae = "_89f1hw4", u = (u) => {
13
+ let d = a(51), { field: f, settings: oe } = u, { key: p, label: m, helper_text: h, readonly: g, options: _ } = f, v = p === void 0 ? "" : p, y = m === void 0 ? "" : m, b = h === void 0 ? "" : h, x = g === void 0 ? !1 : g, S = v, C = !!_?.verification && !!oe?.enableVerification, [w, T] = s(null), [E, se] = s(!1), D;
14
+ d[0] !== E || d[1] !== C || d[2] !== w ? (D = (e) => E ? !0 : C && (!w || w !== e) ? "Phone verification required" : !0, d[0] = E, d[1] = C, d[2] = w, d[3] = D) : D = d[3];
15
+ let O;
16
+ d[4] !== f || d[5] !== D ? (O = e(f, D), d[4] = f, d[5] = D, d[6] = O) : O = d[6];
17
+ let k = O, A;
18
+ d[7] !== S || d[8] !== k ? (A = {
19
+ name: S,
20
+ rules: k
21
+ }, d[7] = S, d[8] = k, d[9] = A) : A = d[9];
22
+ let { field: j, fieldState: M } = i(A), N, P, F, I;
23
+ d[10] === j ? (N = d[11], P = d[12], F = d[13], I = d[14]) : ({value: I, onBlur: N, onChange: P, ...F} = j, d[10] = j, d[11] = N, d[12] = P, d[13] = F, d[14] = I);
24
+ let { error: ce } = M, L = !!f?.required, R = ce?.message, z = !!w && !!I && w === I, B;
25
+ d[15] === _?.country ? B = d[16] : (B = () => {
26
+ let e = _?.country;
27
+ if (e && typeof e == "string") {
28
+ let t = e?.toUpperCase();
29
+ if (r(t)) return t;
30
+ }
31
+ return "IN";
32
+ }, d[15] = _?.country, d[16] = B);
33
+ let V = B, H;
34
+ d[17] === P ? H = d[18] : (H = (e) => {
35
+ T(e), P(e);
36
+ }, d[17] = P, d[18] = H);
37
+ let U = H, W = I ?? "", G;
38
+ d[19] === V ? G = d[20] : (G = V(), d[19] = V, d[20] = G);
39
+ let K;
40
+ d[21] === P ? K = d[22] : (K = (e) => {
41
+ P?.(e ?? "");
42
+ }, d[21] = P, d[22] = K);
43
+ let q;
44
+ d[23] === N ? q = d[24] : (q = () => {
45
+ N?.();
46
+ }, d[23] = N, d[24] = q);
47
+ let J = x || z, Y;
48
+ d[25] === z ? Y = d[26] : (Y = z ? /* @__PURE__ */ o("button", {
49
+ type: "button",
50
+ onClick: () => T(null),
51
+ className: ae,
52
+ title: "Change phone number",
53
+ children: /* @__PURE__ */ o(re, { size: 14 })
54
+ }) : null, d[25] = z, d[26] = Y);
55
+ let X;
56
+ d[27] !== F || d[28] !== W || d[29] !== G || d[30] !== K || d[31] !== q || d[32] !== J || d[33] !== Y ? (X = /* @__PURE__ */ o("div", {
57
+ className: l,
58
+ children: /* @__PURE__ */ o(te, {
59
+ value: W,
60
+ international: !0,
61
+ inputComponent: n,
62
+ defaultCountry: G,
63
+ onChange: K,
64
+ onBlur: q,
65
+ className: ie,
66
+ readOnly: J,
67
+ rightIcon: Y,
68
+ ...F
69
+ })
70
+ }), d[27] = F, d[28] = W, d[29] = G, d[30] = K, d[31] = q, d[32] = J, d[33] = Y, d[34] = X) : X = d[34];
71
+ let Z;
72
+ d[35] !== U || d[36] !== z || d[37] !== C || d[38] !== I ? (Z = C && /* @__PURE__ */ o("div", {
73
+ className: "_89f1hw3",
74
+ children: /* @__PURE__ */ o(ee, {
75
+ value: I,
76
+ type: "phone",
77
+ isVerified: z,
78
+ onVerifySuccess: U,
79
+ onStateChange: se
80
+ })
81
+ }), d[35] = U, d[36] = z, d[37] = C, d[38] = I, d[39] = Z) : Z = d[39];
82
+ let Q;
83
+ d[40] !== X || d[41] !== Z ? (Q = /* @__PURE__ */ ne("div", {
84
+ className: c,
85
+ children: [X, Z]
86
+ }), d[40] = X, d[41] = Z, d[42] = Q) : Q = d[42];
87
+ let $;
88
+ return d[43] !== R || d[44] !== b || d[45] !== L || d[46] !== y || d[47] !== S || d[48] !== x || d[49] !== Q ? ($ = /* @__PURE__ */ o(t, {
89
+ error: R,
90
+ helperText: b,
91
+ readOnly: x,
92
+ label: y,
93
+ htmlFor: S,
94
+ isRequired: L,
95
+ children: Q
96
+ }), d[43] = R, d[44] = b, d[45] = L, d[46] = y, d[47] = S, d[48] = x, d[49] = Q, d[50] = $) : $ = d[50], $;
97
+ };
98
+ //#endregion
99
+ export { u as PhoneWidget, u as default };
@@ -1,54 +1,54 @@
1
- import { i as e, t } from "./ThemeProvider-BQmIB5tr.js";
2
- import { jsx as n } from "react/jsx-runtime";
3
- import { c as r } from "react/compiler-runtime";
4
- import i from "clsx";
1
+ import { i as e, t } from "./ThemeProvider-DutrjSTF.js";
2
+ import { c as n } from "react/compiler-runtime";
3
+ import r from "clsx";
4
+ import { jsx as i } from "react/jsx-runtime";
5
5
  import { Popover as a } from "@base-ui/react/popover";
6
6
  //#region ../../libraries/levocn/dist/ui/popover/Popover.cssm.js
7
7
  var o = "_1tn9uzj0", s = "_1tn9uzj4", c = (e) => {
8
- let t = r(4), i;
9
- t[0] === e ? i = t[1] : ({...i} = e, t[0] = e, t[1] = i);
8
+ let t = n(4), r;
9
+ t[0] === e ? r = t[1] : ({...r} = e, t[0] = e, t[1] = r);
10
10
  let o;
11
- return t[2] === i ? o = t[3] : (o = /* @__PURE__ */ n(a.Root, { ...i }), t[2] = i, t[3] = o), o;
11
+ return t[2] === r ? o = t[3] : (o = /* @__PURE__ */ i(a.Root, { ...r }), t[2] = r, t[3] = o), o;
12
12
  }, l = (e) => {
13
- let i = r(5), o;
14
- i[0] === e ? o = i[1] : ({...o} = e, i[0] = e, i[1] = o);
13
+ let r = n(5), o;
14
+ r[0] === e ? o = r[1] : ({...o} = e, r[0] = e, r[1] = o);
15
15
  let { portalRef: s } = t(), c;
16
- return i[2] !== s || i[3] !== o ? (c = /* @__PURE__ */ n(a.Portal, {
16
+ return r[2] !== s || r[3] !== o ? (c = /* @__PURE__ */ i(a.Portal, {
17
17
  container: s,
18
18
  ...o
19
- }), i[2] = s, i[3] = o, i[4] = c) : c = i[4], c;
19
+ }), r[2] = s, r[3] = o, r[4] = c) : c = r[4], c;
20
20
  }, u = (e) => {
21
- let t = r(8), o, c;
21
+ let t = n(8), o, c;
22
22
  t[0] === e ? (o = t[1], c = t[2]) : ({className: o, ...c} = e, t[0] = e, t[1] = o, t[2] = c);
23
23
  let l;
24
- t[3] === o ? l = t[4] : (l = i(s, o), t[3] = o, t[4] = l);
24
+ t[3] === o ? l = t[4] : (l = r(s, o), t[3] = o, t[4] = l);
25
25
  let u;
26
- return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ n(a.Positioner, {
26
+ return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ i(a.Positioner, {
27
27
  "data-levocn-portal": "",
28
28
  className: l,
29
29
  ...c
30
30
  }), t[5] = c, t[6] = l, t[7] = u) : u = t[7], u;
31
31
  }, d = (e) => {
32
- let t = r(8), s, c;
32
+ let t = n(8), s, c;
33
33
  t[0] === e ? (s = t[1], c = t[2]) : ({className: s, ...c} = e, t[0] = e, t[1] = s, t[2] = c);
34
34
  let l;
35
- t[3] === s ? l = t[4] : (l = i(o, s), t[3] = s, t[4] = l);
35
+ t[3] === s ? l = t[4] : (l = r(o, s), t[3] = s, t[4] = l);
36
36
  let u;
37
- return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ n(a.Popup, {
37
+ return t[5] !== c || t[6] !== l ? (u = /* @__PURE__ */ i(a.Popup, {
38
38
  "data-slot": "popover-content",
39
39
  className: l,
40
40
  ...c
41
41
  }), t[5] = c, t[6] = l, t[7] = u) : u = t[7], u;
42
42
  }, f = (t) => {
43
- let o = r(12), s, c, l, u;
43
+ let o = n(12), s, c, l, u;
44
44
  o[0] === t ? (s = o[1], c = o[2], l = o[3], u = o[4]) : ({className: s, variant: u, size: l, ...c} = t, o[0] = t, o[1] = s, o[2] = c, o[3] = l, o[4] = u);
45
45
  let d;
46
- o[5] !== s || o[6] !== l || o[7] !== u ? (d = i(e({
46
+ o[5] !== s || o[6] !== l || o[7] !== u ? (d = r(e({
47
47
  variant: u,
48
48
  size: l
49
49
  }), s), o[5] = s, o[6] = l, o[7] = u, o[8] = d) : d = o[8];
50
50
  let f;
51
- return o[9] !== c || o[10] !== d ? (f = /* @__PURE__ */ n(a.Trigger, {
51
+ return o[9] !== c || o[10] !== d ? (f = /* @__PURE__ */ i(a.Trigger, {
52
52
  className: d,
53
53
  ...c
54
54
  }), o[9] = c, o[10] = d, o[11] = f) : f = o[11], f;