@levo-so/site-runtime 0.3.15 → 0.3.17

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.
@@ -1,10 +1,10 @@
1
1
  import { c as e } from "react/compiler-runtime";
2
- import t from "clsx";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { createRuntimeFn as r } from "@vanilla-extract/recipes/createRuntimeFn";
5
- import { createContext as i, useContext as a, useEffect as o, useMemo as s, useRef as c } from "react";
2
+ import { createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a } from "react";
3
+ import o from "clsx";
4
+ import { jsx as s } from "react/jsx-runtime";
5
+ import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
6
6
  //#region ../../libraries/levocn/dist/ui/button/Button.cssm.js
7
- var l = r({
7
+ var l = c({
8
8
  defaultClassName: "_1a7d0ek1 _1a7d0ek0",
9
9
  variantClassNames: {
10
10
  variant: {
@@ -31,24 +31,24 @@ var l = r({
31
31
  size: "default"
32
32
  },
33
33
  compoundVariants: []
34
- }), u = (r) => {
35
- let i = e(14), a, o, s, c, u;
36
- i[0] === r ? (a = i[1], o = i[2], s = i[3], c = i[4], u = i[5]) : ({className: a, variant: u, size: s, type: c, ...o} = r, i[0] = r, i[1] = a, i[2] = o, i[3] = s, i[4] = c, i[5] = u);
34
+ }), u = (t) => {
35
+ let n = e(14), r, i, a, c, u;
36
+ n[0] === t ? (r = n[1], i = n[2], a = n[3], c = n[4], u = n[5]) : ({className: r, variant: u, size: a, type: c, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = c, n[5] = u);
37
37
  let d = c === void 0 ? "button" : c, f;
38
- i[6] !== a || i[7] !== s || i[8] !== u ? (f = t(l({
38
+ n[6] !== r || n[7] !== a || n[8] !== u ? (f = o(l({
39
39
  variant: u,
40
- size: s
41
- }), a), i[6] = a, i[7] = s, i[8] = u, i[9] = f) : f = i[9];
40
+ size: a
41
+ }), r), n[6] = r, n[7] = a, n[8] = u, n[9] = f) : f = n[9];
42
42
  let p;
43
- return i[10] !== o || i[11] !== f || i[12] !== d ? (p = /* @__PURE__ */ n("button", {
43
+ return n[10] !== i || n[11] !== f || n[12] !== d ? (p = /* @__PURE__ */ s("button", {
44
44
  "data-slot": "button",
45
45
  type: d,
46
46
  className: f,
47
- ...o
48
- }), i[10] = o, i[11] = f, i[12] = d, i[13] = p) : p = i[13], p;
49
- }, d = "_1er5g5a0", f = /* @__PURE__ */ new Set(), p = {}, m = i(null), h = () => {
50
- let t = e(1), n = a(m);
51
- if (!n) {
47
+ ...i
48
+ }), n[10] = i, n[11] = f, n[12] = d, n[13] = p) : p = n[13], p;
49
+ }, d = "_1er5g5a0", f = /* @__PURE__ */ new Set(), p = {}, m = t(null), h = () => {
50
+ let t = e(1), r = n(m);
51
+ if (!r) {
52
52
  let e;
53
53
  return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
54
54
  portalRef: { current: null },
@@ -56,10 +56,10 @@ var l = r({
56
56
  overrides: p
57
57
  }, t[0] = e) : e = t[0], e;
58
58
  }
59
- return n;
60
- }, g = ({ children: e, cssReset: r, className: i, style: l, portalToThemeRoot: u, ...h }) => {
61
- let g = a(m), _ = c(null), v = !g && r !== !1 ? d : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = s(() => {
62
- let e = i ? i.split(/\s+/).filter(Boolean) : [], t = new Set(y);
59
+ return r;
60
+ }, g = ({ children: e, cssReset: t, className: c, style: l, portalToThemeRoot: u, ...h }) => {
61
+ let g = n(m), _ = a(null), v = !g && t !== !1 ? d : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = i(() => {
62
+ let e = c ? c.split(/\s+/).filter(Boolean) : [], t = new Set(y);
63
63
  for (let n of e) t.add(n);
64
64
  return {
65
65
  portalRef: _,
@@ -71,36 +71,36 @@ var l = r({
71
71
  };
72
72
  }, [
73
73
  y,
74
- i,
74
+ c,
75
75
  b,
76
76
  l
77
77
  ]);
78
- o(() => {
78
+ r(() => {
79
79
  if (u) return;
80
80
  let e = document.createElement("div");
81
81
  return document.body.appendChild(e), _.current = e, () => {
82
82
  document.body.removeChild(e), _.current = null;
83
83
  };
84
- }, [u]), o(() => {
84
+ }, [u]), r(() => {
85
85
  if (u) return;
86
86
  let e = _.current;
87
87
  if (!e) return;
88
- e.className = t(v, ...x.classes), e.style.cssText = "";
89
- let n = {
88
+ e.className = o(v, ...x.classes), e.style.cssText = "";
89
+ let t = {
90
90
  display: "contents",
91
91
  ...x.overrides
92
92
  };
93
- for (let [t, r] of Object.entries(n)) r != null && e.style.setProperty(t, String(r));
93
+ for (let [n, r] of Object.entries(t)) r != null && e.style.setProperty(n, String(r));
94
94
  }, [
95
95
  x.classes,
96
96
  x.overrides,
97
97
  v,
98
98
  u
99
99
  ]);
100
- let S = t(v, ...i ? i.split(/\s+/).filter((e) => e && !y.has(e)) : []);
101
- return /* @__PURE__ */ n(m.Provider, {
100
+ let S = o(v, ...c ? c.split(/\s+/).filter((e) => e && !y.has(e)) : []);
101
+ return /* @__PURE__ */ s(m.Provider, {
102
102
  value: x,
103
- children: /* @__PURE__ */ n("div", {
103
+ children: /* @__PURE__ */ s("div", {
104
104
  ...u ? { ref: _ } : {},
105
105
  ...S ? { className: S } : {},
106
106
  style: {
@@ -1,4 +1,4 @@
1
- import { i as e, t } from "./ThemeProvider-DutrjSTF.js";
1
+ import { i as e, t } from "./ThemeProvider-DlFehjh1.js";
2
2
  import { c as n } from "react/compiler-runtime";
3
3
  import r from "clsx";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { r as e } from "./ThemeProvider-DutrjSTF.js";
3
- import { t } from "./LevoProvider-Bsjkcwc8.js";
2
+ import { r as e } from "./ThemeProvider-DlFehjh1.js";
3
+ import { t } from "./LevoProvider-BkbKrvrI.js";
4
4
  import { t as n } from "./CollectionInput-BJ__qcbk.js";
5
- import { i as r, n as i, o as a, t as o } from "./Dialog-dT7y641z.js";
5
+ import { i as r, n as i, o as a, t as o } from "./Dialog-D-vRkU9N.js";
6
6
  import { c as s } from "react/compiler-runtime";
7
- import c from "clsx";
8
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
9
- import { useEffect as f, useState as p } from "react";
7
+ import { useEffect as c, useState as l } from "react";
8
+ import u from "clsx";
9
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
10
10
  import { IconCircleCheck as m, IconLoader as h } from "@tabler/icons-react";
11
11
  import { toast as g } from "sonner";
12
12
  //#region ../../libraries/levocn/dist/ui/spinner/Spinner.cssm.js
@@ -14,9 +14,9 @@ var _ = "_1k4xirc1", v = (e) => {
14
14
  let t = s(8), n, r;
15
15
  t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
16
16
  let i;
17
- t[3] === n ? i = t[4] : (i = c(_, n), t[3] = n, t[4] = i);
17
+ t[3] === n ? i = t[4] : (i = u(_, n), t[3] = n, t[4] = i);
18
18
  let a;
19
- return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ u(h, {
19
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ f(h, {
20
20
  role: "status",
21
21
  "aria-label": "Loading",
22
22
  className: i,
@@ -36,42 +36,42 @@ var _ = "_1k4xirc1", v = (e) => {
36
36
  position: "bottom-right",
37
37
  ...n
38
38
  });
39
- }, x = "_6o7s4x0", S = "qkytrb0", C = "qkytrb1", w = "qkytrb2", T = "qkytrb3", E = "qkytrb4", D = "qkytrb5", O = "qkytrb6", k = ({ isOpen: s, onClose: c, value: l, type: m = "email", onVerifySuccess: h }) => {
40
- let { membership: g } = t(), [_, v] = p(""), [k, A] = p(!1), [j, M] = p(!1), [N, P] = p(30);
41
- return f(() => {
39
+ }, x = "_6o7s4x0", S = "qkytrb0", C = "qkytrb1", w = "qkytrb2", T = "qkytrb3", E = "qkytrb4", D = "qkytrb5", O = "qkytrb6", k = ({ isOpen: s, onClose: u, value: d, type: m = "email", onVerifySuccess: h }) => {
40
+ let { membership: g } = t(), [_, v] = l(""), [k, A] = l(!1), [j, M] = l(!1), [N, P] = l(30);
41
+ return c(() => {
42
42
  let e;
43
43
  return s && N > 0 && (e = setInterval(() => {
44
44
  P((e) => e - 1);
45
45
  }, 1e3)), () => clearInterval(e);
46
- }, [s, N]), f(() => {
46
+ }, [s, N]), c(() => {
47
47
  s && (v(""), P(30), A(!1), M(!1));
48
- }, [s]), /* @__PURE__ */ u(a, {
48
+ }, [s]), /* @__PURE__ */ f(a, {
49
49
  open: s,
50
50
  onOpenChange: (e) => {
51
- e || c();
51
+ e || u();
52
52
  },
53
- children: /* @__PURE__ */ d(i, {
53
+ children: /* @__PURE__ */ p(i, {
54
54
  className: x,
55
- children: [/* @__PURE__ */ u(o, { children: /* @__PURE__ */ u(r, { children: `Verify ${m === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ d("div", {
55
+ children: [/* @__PURE__ */ f(o, { children: /* @__PURE__ */ f(r, { children: `Verify ${m === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ p("div", {
56
56
  className: S,
57
57
  children: [
58
- /* @__PURE__ */ d("div", {
58
+ /* @__PURE__ */ p("div", {
59
59
  className: C,
60
60
  children: [
61
61
  "Enter the 4-digit code sent to ",
62
- /* @__PURE__ */ u("strong", { children: l }),
62
+ /* @__PURE__ */ f("strong", { children: d }),
63
63
  ".",
64
64
  " ",
65
- /* @__PURE__ */ u("button", {
66
- onClick: () => c(),
65
+ /* @__PURE__ */ f("button", {
66
+ onClick: () => u(),
67
67
  className: w,
68
68
  children: "Change?"
69
69
  })
70
70
  ]
71
71
  }),
72
- /* @__PURE__ */ u("div", {
72
+ /* @__PURE__ */ f("div", {
73
73
  className: T,
74
- children: /* @__PURE__ */ u(n, {
74
+ children: /* @__PURE__ */ f(n, {
75
75
  value: _,
76
76
  onChange: (e) => {
77
77
  v(e.target.value.replace(/\D/g, "").slice(0, 4));
@@ -81,17 +81,17 @@ var _ = "_1k4xirc1", v = (e) => {
81
81
  className: D
82
82
  })
83
83
  }),
84
- /* @__PURE__ */ d("div", {
84
+ /* @__PURE__ */ p("div", {
85
85
  className: E,
86
- children: [/* @__PURE__ */ u(e, {
86
+ children: [/* @__PURE__ */ f(e, {
87
87
  onClick: async () => {
88
88
  if (!(!_ || _.length !== 4)) {
89
89
  A(!0);
90
90
  try {
91
91
  await g?.signInWithOtp({
92
- content: l,
92
+ content: d,
93
93
  code: _
94
- }), b("Verification successful"), h(l), c();
94
+ }), b("Verification successful"), h(d), u();
95
95
  } catch (e) {
96
96
  let t = e;
97
97
  y(t?.message || "Invalid OTP", t?.title || "Verification Failed");
@@ -103,19 +103,19 @@ var _ = "_1k4xirc1", v = (e) => {
103
103
  disabled: _.length !== 4 || k,
104
104
  className: "w-full",
105
105
  children: k ? "Verifying..." : "Verify"
106
- }), /* @__PURE__ */ u("div", {
106
+ }), /* @__PURE__ */ f("div", {
107
107
  className: O,
108
- children: N > 0 ? /* @__PURE__ */ d("span", { children: [
108
+ children: N > 0 ? /* @__PURE__ */ p("span", { children: [
109
109
  "Resend code in ",
110
110
  N,
111
111
  "s"
112
- ] }) : /* @__PURE__ */ u("button", {
112
+ ] }) : /* @__PURE__ */ f("button", {
113
113
  onClick: async () => {
114
114
  if (!(N > 0)) {
115
115
  M(!0);
116
116
  try {
117
117
  await g?.requestOtp({
118
- content: l,
118
+ content: d,
119
119
  medium: m === "phone" ? "whatsapp" : "email"
120
120
  }), b("OTP resent successfully"), P(30);
121
121
  } catch (e) {
@@ -137,7 +137,7 @@ var _ = "_1k4xirc1", v = (e) => {
137
137
  })
138
138
  });
139
139
  }, A = "jfrbe10", j = "jfrbe11", M = "jfrbe12", N = ({ value: n, type: r, isVerified: i, onVerifySuccess: a, onStateChange: o }) => {
140
- let { membership: s } = t(), [c, f] = p(!1), [h, g] = p(!1), _ = (e) => {
140
+ let { membership: s } = t(), [c, u] = l(!1), [h, g] = l(!1), _ = (e) => {
141
141
  o && o(e);
142
142
  }, b = async () => {
143
143
  let e = n?.trim()?.toLowerCase();
@@ -154,7 +154,7 @@ var _ = "_1k4xirc1", v = (e) => {
154
154
  await s?.requestOtp({
155
155
  content: e,
156
156
  medium: r === "phone" ? "whatsapp" : "email"
157
- }), f(!0);
157
+ }), u(!0);
158
158
  } catch (e) {
159
159
  let t = e;
160
160
  y(t?.message || "Failed to send OTP", t?.title || "Error"), _(!1);
@@ -162,23 +162,23 @@ var _ = "_1k4xirc1", v = (e) => {
162
162
  g(!1);
163
163
  }
164
164
  }, x = () => {
165
- f(!1), _(!1);
165
+ u(!1), _(!1);
166
166
  };
167
- return i ? /* @__PURE__ */ d("div", {
167
+ return i ? /* @__PURE__ */ p("div", {
168
168
  className: A,
169
- children: [/* @__PURE__ */ u(m, { className: M }), /* @__PURE__ */ u("span", {
169
+ children: [/* @__PURE__ */ f(m, { className: M }), /* @__PURE__ */ f("span", {
170
170
  className: j,
171
171
  children: "Verified"
172
172
  })]
173
- }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e, {
173
+ }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(e, {
174
174
  size: "default",
175
175
  variant: "ghost",
176
176
  onClick: b,
177
177
  onMouseDown: (e) => e.preventDefault(),
178
178
  disabled: !n || h,
179
179
  type: "button",
180
- children: h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(v, { size: 14 }), "Sending..."] }) : "Verify"
181
- }), c && /* @__PURE__ */ u(k, {
180
+ children: h ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(v, { size: 14 }), "Sending..."] }) : "Verify"
181
+ }), c && /* @__PURE__ */ f(k, {
182
182
  isOpen: c,
183
183
  onClose: x,
184
184
  value: n?.trim()?.toLowerCase() || "",