@levo-so/react 0.1.15 → 0.1.16

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 (81) hide show
  1. package/dist/{CheckboxWidget-BGS61gcL.js → CheckboxWidget-CNoS-2W3.js} +1 -1
  2. package/dist/{CollectionFormBuilder-BIvx_z08.js → CollectionFormBuilder-MAo2Ob3a.js} +67 -65
  3. package/dist/{CurrencyWidget-sD8ijLvw.js → CurrencyWidget-Cu1Cthnw.js} +1 -1
  4. package/dist/{DateTimeWidget-KrcsxgEF.js → DateTimeWidget-N-wuCRSJ.js} +1 -1
  5. package/dist/DefaultFormVariant-IqWi1BiT.js +81 -0
  6. package/dist/{DropdownWidget-rm5oUqOE.js → DropdownWidget-BFttB4b-.js} +4 -2
  7. package/dist/{EmailWidget-CvZKOywL.js → EmailWidget-D_SqXx3M.js} +1 -1
  8. package/dist/FormCaptcha-CJ9KgDu0.js +197 -0
  9. package/dist/{GeocoderWidget-CSsp_-hW.js → GeocoderWidget-Bxt3TeAf.js} +2 -2
  10. package/dist/LevoProvider-BAZy7_tP.js +223 -0
  11. package/dist/{MultiGeocoderWidget-Blqz-lHX.js → MultiGeocoderWidget-DFjuXZBN.js} +2 -2
  12. package/dist/{MultiTextWidget-CxVpyf06.js → MultiTextWidget-CZzT51cH.js} +1 -1
  13. package/dist/{PhoneWidget-DezcchSP.js → PhoneWidget--K5aS16s.js} +1 -1
  14. package/dist/{RadioWidget-SfD1fFDG.js → RadioWidget-BbMPtR3P.js} +1 -1
  15. package/dist/{RichTextWidget-Cg3RizdO.js → RichTextWidget-Cce3Bw8d.js} +1 -1
  16. package/dist/{StepsFormVariant-D35dFYK6.js → StepsFormVariant-5wZbYAA9.js} +59 -56
  17. package/dist/{SwitchWidget-Id6BNlPe.js → SwitchWidget-B0wkSWxa.js} +1 -1
  18. package/dist/{TextWidget-CtFaQde1.js → TextWidget-ldbMuLB0.js} +1 -1
  19. package/dist/{TextareaWidget-BKzAeMod.js → TextareaWidget-S8bKUTv0.js} +1 -1
  20. package/dist/{ToggleCheckboxWidget-nSlie9sE.js → ToggleCheckboxWidget-CPduXE6Y.js} +1 -1
  21. package/dist/{URLWidget-DtJai3xY.js → URLWidget-KbhE2ZUA.js} +2 -2
  22. package/dist/{UploadWidget-Dxx2_FYo.js → UploadWidget-DFvfDUT6.js} +6 -6
  23. package/dist/audience/components/block.d.ts.map +1 -1
  24. package/dist/audience/components/component.d.ts.map +1 -1
  25. package/dist/audience/components/page.d.ts.map +1 -1
  26. package/dist/audience/index.js +1 -1
  27. package/dist/collection/components/Altcha.d.ts.map +1 -1
  28. package/dist/collection/components/FormCaptcha.d.ts +3 -0
  29. package/dist/collection/components/FormCaptcha.d.ts.map +1 -0
  30. package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +1 -1
  31. package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +1 -1
  32. package/dist/collection/components/core/Input/Input.d.ts.map +1 -1
  33. package/dist/collection/components/core/Switch/Switch.d.ts.map +1 -1
  34. package/dist/collection/components/renderer/RenderCommonField.d.ts.map +1 -1
  35. package/dist/collection/components/widgets/FieldWrapper.d.ts.map +1 -1
  36. package/dist/collection/components/widgets/FormHelperText.d.ts.map +1 -1
  37. package/dist/collection/components/widgets/FormLabel.d.ts.map +1 -1
  38. package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +1 -1
  39. package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +1 -1
  40. package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +1 -1
  41. package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +1 -1
  42. package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +1 -1
  43. package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +1 -1
  44. package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +1 -1
  45. package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +1 -1
  46. package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +1 -1
  47. package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +1 -1
  48. package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +1 -1
  49. package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +1 -1
  50. package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +1 -1
  51. package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +1 -1
  52. package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +1 -1
  53. package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +1 -1
  54. package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +1 -1
  55. package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +1 -1
  56. package/dist/collection/index.js +1 -1
  57. package/dist/collection/lib/FormBuilder.d.ts.map +1 -1
  58. package/dist/collection/lib/SaveDraftValues.d.ts.map +1 -1
  59. package/dist/collection/lib/hooks/useLevoForm.d.ts +1 -2
  60. package/dist/collection/lib/hooks/useLevoForm.d.ts.map +1 -1
  61. package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +1 -1
  62. package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +1 -1
  63. package/dist/collection/utils/formHelpers.d.ts.map +1 -1
  64. package/dist/collection/utils/index.d.ts.map +1 -1
  65. package/dist/components/Dialog.d.ts.map +1 -1
  66. package/dist/components/Spinner.d.ts.map +1 -1
  67. package/dist/components/Table.d.ts.map +1 -1
  68. package/dist/components/Tabs.d.ts.map +1 -1
  69. package/dist/components/Tooltip.d.ts.map +1 -1
  70. package/dist/components/button/Button.d.ts.map +1 -1
  71. package/dist/index.js +3 -3
  72. package/dist/membership/components/Button.d.ts.map +1 -1
  73. package/dist/membership/components/Container.d.ts.map +1 -1
  74. package/dist/membership/components/Core.d.ts.map +1 -1
  75. package/dist/membership/index.js +2 -3
  76. package/dist/{page-DgqTELmZ.js → page-BKyDlf0z.js} +1 -1
  77. package/dist/utils/errorHandler.d.ts.map +1 -1
  78. package/package.json +6 -6
  79. package/dist/DefaultFormVariant-j1HgVDiI.js +0 -127
  80. package/dist/LevoProvider-Do3jjJ4j.js +0 -211
  81. package/dist/useLevoForm-3jSJ9I6v.js +0 -170
@@ -3,7 +3,7 @@ import { j as a } from "./jsx-runtime-B6kdoens.js";
3
3
  import { useState as w, useEffect as B } from "react";
4
4
  import { useController as E } from "react-hook-form";
5
5
  import { c as C } from "./cn-C9QoOYNG.js";
6
- import { z as O, A as I, B as x } from "./CollectionFormBuilder-BIvx_z08.js";
6
+ import { z as O, A as I, B as x } from "./CollectionFormBuilder-MAo2Ob3a.js";
7
7
  import { C as g } from "./Checbox-sq-atGlJ.js";
8
8
  import { I as S } from "./Input-2CvZ90f8.js";
9
9
  const L = ({ field: i }) => {
@@ -5,14 +5,14 @@ import * as A from "react";
5
5
  import E, { useState as w, useEffect as ge, lazy as v, Suspense as _e } from "react";
6
6
  import { useFieldArray as Ne, useController as me } from "react-hook-form";
7
7
  import { G as H, T as Re, k as Le, l as Te, B as W, m as Me, A as Ae, C as Ie, j as De, n as Be, S as Se } from "./Spinner-Bzu2xCFZ.js";
8
- import { u as X } from "./LevoProvider-Do3jjJ4j.js";
9
- import { Snowflake as Fe } from "@theinternetfolks/snowflake";
10
- import Pe from "google-libphonenumber";
8
+ import { X as Fe } from "lucide-react";
9
+ import { u as X } from "./LevoProvider-BAZy7_tP.js";
10
+ import { Snowflake as Pe } from "@theinternetfolks/snowflake";
11
+ import Ee from "google-libphonenumber";
11
12
  import re from "validator";
12
13
  import z from "validatorjs";
13
14
  import { c as b } from "./cn-C9QoOYNG.js";
14
- import { Mate as J } from "@theinternetfolks/mate";
15
- import { X as Ee } from "lucide-react";
15
+ import { Mate as Q } from "@theinternetfolks/mate";
16
16
  import * as He from "inflection";
17
17
  import { useInView as Oe } from "react-intersection-observer";
18
18
  const Ve = [
@@ -74,7 +74,7 @@ const Ve = [
74
74
  ...$.document,
75
75
  ...$.image,
76
76
  ...$.video
77
- }, { PhoneNumberUtil: Xe } = Pe, Je = (e) => {
77
+ }, { PhoneNumberUtil: Xe } = Ee, Je = (e) => {
78
78
  const n = [];
79
79
  for (const t of Object.keys(e))
80
80
  for (const r of (e == null ? void 0 : e[t]) || [])
@@ -176,7 +176,7 @@ const Ve = [
176
176
  let r = null;
177
177
  return (t.field_interface === l.ArrayWidget && n !== l.ArrayWidget || t.field_interface === l.RecordWidget && n !== l.RecordWidget) && (t.fields = []), (n !== l.MultiDropdownWidget || n !== l.DropdownWidget || n !== l.RadioWidget || n !== l.CheckboxWidget) && t.field_interface !== l.MultiDropdownWidget && t.field_interface !== l.DropdownWidget && t.field_interface !== l.RadioWidget && t.field_interface !== l.CheckboxWidget && ((c = t.values) == null ? void 0 : c.length) !== 0 && (t.values = []), (n === l.MultiDropdownWidget && t.field_interface !== l.MultiDropdownWidget || n === l.DropdownWidget && t.field_interface !== l.DropdownWidget || n === l.RadioWidget && t.field_interface !== l.RadioWidget || n === l.CheckboxWidget && t.field_interface !== l.CheckboxWidget) && (t.values = [""], r = `${t.id}-option-0`), [l.RecordWidget, l.ArrayWidget].includes(
178
178
  n
179
- ) && (r = `field-${Fe.generate()}`, t.kind = n === l.RecordWidget ? "record" : "group", t.fields = [
179
+ ) && (r = `field-${Pe.generate()}`, t.kind = n === l.RecordWidget ? "record" : "group", t.fields = [
180
180
  ...(t == null ? void 0 : t.fields) || [],
181
181
  {
182
182
  id: r,
@@ -202,7 +202,7 @@ const Ve = [
202
202
  }, Yt = (e, n) => {
203
203
  var g;
204
204
  const t = { ...e }, r = [], c = "_id";
205
- if (n)
205
+ if (delete t.__captcha, n)
206
206
  for (const a of n.sections ?? [])
207
207
  for (const o of a.fields)
208
208
  o.field_interface === "CollectionWidget" && r.push(o.key);
@@ -300,10 +300,10 @@ const q = ({
300
300
  className: "space-y-4 border rounded bg-secondary/40",
301
301
  value: d.toString(),
302
302
  children: [
303
- /* @__PURE__ */ s.jsx("div", { className: "flex flex-col px-3 py-2 gap-3", children: g.map((y) => {
303
+ /* @__PURE__ */ s.jsx("div", { className: "flex flex-col px-3 py-2 gap-3", children: g.map((f) => {
304
304
  const k = {
305
- ...y,
306
- key: `${t}.${d}.${y == null ? void 0 : y.key}`
305
+ ...f,
306
+ key: `${t}.${d}.${f == null ? void 0 : f.key}`
307
307
  };
308
308
  return /* @__PURE__ */ s.jsx(
309
309
  ve,
@@ -311,7 +311,7 @@ const q = ({
311
311
  field: k,
312
312
  isInternal: n
313
313
  },
314
- `common-fields-${y == null ? void 0 : y.id}`
314
+ `common-fields-${f == null ? void 0 : f.id}`
315
315
  );
316
316
  }) }),
317
317
  /* @__PURE__ */ s.jsxs("div", { className: "flex p-2 items-center border-t", children: [
@@ -430,7 +430,7 @@ const xe = (e) => {
430
430
  children: e
431
431
  }) => /* @__PURE__ */ s.jsx("p", { className: "text-xs font-normal text-red-400 text-wrap", children: e }), ot = ({
432
432
  children: e
433
- }) => /* @__PURE__ */ s.jsx("p", { className: b("text-xs font-normal text-gray-600"), children: e }), Q = E.forwardRef(({ error: e, helperText: n, containerStyles: t, readOnly: r, children: c }, g) => /* @__PURE__ */ s.jsx(
433
+ }) => /* @__PURE__ */ s.jsx("p", { className: b("text-xs font-normal text-gray-600"), children: e }), J = E.forwardRef(({ error: e, helperText: n, containerStyles: t, readOnly: r, children: c }, g) => /* @__PURE__ */ s.jsx(
434
434
  "div",
435
435
  {
436
436
  className: b(
@@ -445,7 +445,9 @@ const xe = (e) => {
445
445
  n && /* @__PURE__ */ s.jsx("div", { className: b("w-full mt-3"), children: /* @__PURE__ */ s.jsx(ot, { children: n }) })
446
446
  ] })
447
447
  }
448
- )), he = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
448
+ ));
449
+ J.displayName = "FieldWrapper";
450
+ const he = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
449
451
  "table",
450
452
  {
451
453
  ref: t,
@@ -456,7 +458,7 @@ const xe = (e) => {
456
458
  he.displayName = "Table";
457
459
  const at = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx("thead", { ref: t, className: b("[&_tr]:border-b", e), ...n }));
458
460
  at.displayName = "TableHeader";
459
- const fe = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
461
+ const ye = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
460
462
  "tbody",
461
463
  {
462
464
  ref: t,
@@ -464,7 +466,7 @@ const fe = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
464
466
  ...n
465
467
  }
466
468
  ));
467
- fe.displayName = "TableBody";
469
+ ye.displayName = "TableBody";
468
470
  const lt = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
469
471
  "tfoot",
470
472
  {
@@ -474,7 +476,7 @@ const lt = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
474
476
  }
475
477
  ));
476
478
  lt.displayName = "TableFooter";
477
- const ye = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
479
+ const fe = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
478
480
  "tr",
479
481
  {
480
482
  ref: t,
@@ -485,7 +487,7 @@ const ye = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
485
487
  ...n
486
488
  }
487
489
  ));
488
- ye.displayName = "TableRow";
490
+ fe.displayName = "TableRow";
489
491
  const it = A.forwardRef(({ className: e, ...n }, t) => /* @__PURE__ */ s.jsx(
490
492
  "th",
491
493
  {
@@ -564,13 +566,13 @@ const dt = E.lazy(
564
566
  value: n,
565
567
  onChange: t
566
568
  }) => {
567
- var S, f;
569
+ var S, y;
568
570
  const { collection: r } = X(), [c, g] = w(!1), [a, o] = w([]), [i, m] = w(!1), {
569
571
  key: x = "",
570
572
  label: d = "items",
571
- helper_text: y = "",
573
+ helper_text: f = "",
572
574
  readonly: k = !1
573
- } = e, C = x, B = ((S = e == null ? void 0 : e.options) == null ? void 0 : S.collection_key) || "", _ = ((f = e == null ? void 0 : e.options) == null ? void 0 : f.label_field_key) || "", I = async (j, N, { page: R = 1 }) => {
575
+ } = e, C = x, B = ((S = e == null ? void 0 : e.options) == null ? void 0 : S.collection_key) || "", _ = ((y = e == null ? void 0 : e.options) == null ? void 0 : y.label_field_key) || "", I = async (j, N, { page: R = 1 }) => {
574
576
  var F;
575
577
  g(!0);
576
578
  try {
@@ -585,7 +587,7 @@ const dt = E.lazy(
585
587
  }
586
588
  }
587
589
  })), h = (F = L == null ? void 0 : L.content) == null ? void 0 : F.data, O = (h || []).map((p) => {
588
- const P = p != null && p[_] ? p == null ? void 0 : p[_] : J.toTitle((p == null ? void 0 : p.slug) || "");
590
+ const P = p != null && p[_] ? p == null ? void 0 : p[_] : Q.toTitle((p == null ? void 0 : p.slug) || "");
589
591
  return {
590
592
  value: {
591
593
  _id: p == null ? void 0 : p._id,
@@ -627,7 +629,7 @@ const dt = E.lazy(
627
629
  onClose: () => m(!1),
628
630
  contentClassName: "max-w-96",
629
631
  children: [
630
- /* @__PURE__ */ s.jsxs(Q, { helperText: y, readOnly: k, children: [
632
+ /* @__PURE__ */ s.jsxs(J, { helperText: f, readOnly: k, children: [
631
633
  d && /* @__PURE__ */ s.jsx(q, { htmlFor: C, children: d }),
632
634
  /* @__PURE__ */ s.jsx(
633
635
  be,
@@ -675,8 +677,8 @@ const dt = E.lazy(
675
677
  field: e
676
678
  }) => {
677
679
  var T, M, V;
678
- const { collection: n } = X(), [t, r] = w(!1), [c, g] = w([]), [a, o] = w(1), [i, m] = w(0), [x, d] = w(0), { key: y = "", label: k = "", helper_text: C = "", readonly: B = !1 } = e, _ = y, I = ((T = e == null ? void 0 : e.options) == null ? void 0 : T.collection_key) || "", S = ((M = e == null ? void 0 : e.options) == null ? void 0 : M.label_field_key) || "", {
679
- field: { value: f, onBlur: j, onChange: N, ref: R, disabled: F, ...L },
680
+ const { collection: n } = X(), [t, r] = w(!1), [c, g] = w([]), [a, o] = w(1), [i, m] = w(0), [x, d] = w(0), { key: f = "", label: k = "", helper_text: C = "", readonly: B = !1 } = e, _ = f, I = ((T = e == null ? void 0 : e.options) == null ? void 0 : T.collection_key) || "", S = ((M = e == null ? void 0 : e.options) == null ? void 0 : M.label_field_key) || "", {
681
+ field: { value: y, onBlur: j, onChange: N, ref: R, disabled: F, ...L },
680
682
  fieldState: h
681
683
  } = me({
682
684
  name: _,
@@ -690,16 +692,16 @@ const dt = E.lazy(
690
692
  limit: 5,
691
693
  where: {
692
694
  _id: {
693
- in: f
695
+ in: y
694
696
  }
695
697
  }
696
698
  })), D = ((Y = u == null ? void 0 : u.content) == null ? void 0 : Y.data) ?? [], G = ((te = (ee = u == null ? void 0 : u.content) == null ? void 0 : ee.meta) == null ? void 0 : te.pages) ?? 0;
697
699
  m(((ne = (se = u == null ? void 0 : u.content) == null ? void 0 : se.meta) == null ? void 0 : ne.total) ?? 0), d(G), a > G && o(G), g(D), r(!1);
698
700
  };
699
701
  return ge(() => {
700
- (f == null ? void 0 : f.length) > 0 && P();
701
- }, [f, a]), /* @__PURE__ */ s.jsxs(
702
- Q,
702
+ (y == null ? void 0 : y.length) > 0 && P();
703
+ }, [y, a]), /* @__PURE__ */ s.jsxs(
704
+ J,
703
705
  {
704
706
  ref: R,
705
707
  error: p,
@@ -711,30 +713,30 @@ const dt = E.lazy(
711
713
  ut,
712
714
  {
713
715
  onChange: N,
714
- value: f ?? [],
716
+ value: y ?? [],
715
717
  field: e
716
718
  }
717
719
  ),
718
- f != null && f.length ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
720
+ y != null && y.length ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
719
721
  /* @__PURE__ */ s.jsxs("div", { className: "relative overflow-hidden", children: [
720
722
  t ? /* @__PURE__ */ s.jsx("div", { className: "z-10 absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-[rgba(0,0,0,0.05)]", children: /* @__PURE__ */ s.jsxs("div", { className: "flex items-center", children: [
721
723
  /* @__PURE__ */ s.jsx(Be, { className: "h-8 w-8 animate-spin mr-2" }),
722
724
  "Fetching"
723
725
  ] }) }) : null,
724
- /* @__PURE__ */ s.jsx(he, { className: f.length > 5 ? "min-h-72" : "", children: /* @__PURE__ */ s.jsx(fe, { children: c.map((u) => /* @__PURE__ */ s.jsx(ye, { children: /* @__PURE__ */ s.jsxs(je, { className: "flex justify-between", children: [
726
+ /* @__PURE__ */ s.jsx(he, { className: y.length > 5 ? "min-h-72" : "", children: /* @__PURE__ */ s.jsx(ye, { children: c.map((u) => /* @__PURE__ */ s.jsx(fe, { children: /* @__PURE__ */ s.jsxs(je, { className: "flex justify-between", children: [
725
727
  u == null ? void 0 : u[S],
726
728
  /* @__PURE__ */ s.jsx(
727
- Ee,
729
+ Fe,
728
730
  {
729
731
  className: "cursor-pointer",
730
732
  size: 20,
731
733
  onClick: () => {
732
734
  console.log(
733
- f,
734
- f == null ? void 0 : f.filter((D) => D !== (u == null ? void 0 : u._id)),
735
+ y,
736
+ y == null ? void 0 : y.filter((D) => D !== (u == null ? void 0 : u._id)),
735
737
  u
736
738
  ), N(
737
- f == null ? void 0 : f.filter((D) => D !== (u == null ? void 0 : u._id))
739
+ y == null ? void 0 : y.filter((D) => D !== (u == null ? void 0 : u._id))
738
740
  );
739
741
  }
740
742
  }
@@ -828,12 +830,12 @@ const dt = E.lazy(
828
830
  }) => {
829
831
  var R, F, L;
830
832
  const { collection: n } = X(), [t, r] = w(!1), { key: c = "", label: g = "", helper_text: a = "", readonly: o = !1 } = e, i = c, m = ((R = e == null ? void 0 : e.options) == null ? void 0 : R.collection_key) || "", x = ((F = e == null ? void 0 : e.options) == null ? void 0 : F.label_field_key) || "", {
831
- field: { value: d, onBlur: y, onChange: k, ref: C, disabled: B, ..._ },
833
+ field: { value: d, onBlur: f, onChange: k, ref: C, disabled: B, ..._ },
832
834
  fieldState: I
833
835
  } = me({
834
836
  name: i,
835
837
  rules: xe(e)
836
- }), S = !!(e != null && e.required), f = (L = I == null ? void 0 : I.error) == null ? void 0 : L.message, j = async (h, O, { page: p = 1 }) => {
838
+ }), S = !!(e != null && e.required), y = (L = I == null ? void 0 : I.error) == null ? void 0 : L.message, j = async (h, O, { page: p = 1 }) => {
837
839
  var P;
838
840
  r(!0);
839
841
  try {
@@ -843,7 +845,7 @@ const dt = E.lazy(
843
845
  search: h,
844
846
  limit: 10
845
847
  })), M = (P = T == null ? void 0 : T.content) == null ? void 0 : P.data, V = (M || []).map((u) => {
846
- const D = u != null && u[x] ? u == null ? void 0 : u[x] : J.toTitle((u == null ? void 0 : u.slug) || "");
848
+ const D = u != null && u[x] ? u == null ? void 0 : u[x] : Q.toTitle((u == null ? void 0 : u.slug) || "");
847
849
  return {
848
850
  value: {
849
851
  _id: u == null ? void 0 : u._id,
@@ -872,7 +874,7 @@ const dt = E.lazy(
872
874
  r(!1);
873
875
  }
874
876
  }, N = d ? {
875
- label: d != null && d[x] ? d == null ? void 0 : d[x] : d != null && d.slug ? J.toTitle((d == null ? void 0 : d.slug) || "") : "",
877
+ label: d != null && d[x] ? d == null ? void 0 : d[x] : d != null && d.slug ? Q.toTitle((d == null ? void 0 : d.slug) || "") : "",
876
878
  value: {
877
879
  _id: d == null ? void 0 : d._id,
878
880
  slug: d == null ? void 0 : d.slug,
@@ -880,10 +882,10 @@ const dt = E.lazy(
880
882
  }
881
883
  } : null;
882
884
  return /* @__PURE__ */ s.jsxs(
883
- Q,
885
+ J,
884
886
  {
885
887
  ref: C,
886
- error: f,
888
+ error: y,
887
889
  helperText: a,
888
890
  readOnly: o,
889
891
  children: [
@@ -897,7 +899,7 @@ const dt = E.lazy(
897
899
  k((h == null ? void 0 : h.value) || null);
898
900
  },
899
901
  onBlur: () => {
900
- y();
902
+ f();
901
903
  },
902
904
  loadOptions: j,
903
905
  debounceTimeout: 500,
@@ -917,26 +919,26 @@ const dt = E.lazy(
917
919
  }
918
920
  );
919
921
  }, pt = v(
920
- () => import("./MultiTextWidget-CxVpyf06.js")
921
- ), ie = v(() => import("./TextWidget-CtFaQde1.js")), xt = v(
922
- () => import("./CurrencyWidget-sD8ijLvw.js")
922
+ () => import("./MultiTextWidget-CZzT51cH.js")
923
+ ), ie = v(() => import("./TextWidget-ldbMuLB0.js")), xt = v(
924
+ () => import("./CurrencyWidget-Cu1Cthnw.js")
923
925
  ), ht = v(
924
- () => import("./CheckboxWidget-BGS61gcL.js")
926
+ () => import("./CheckboxWidget-CNoS-2W3.js")
925
927
  ), ce = v(
926
- () => import("./DateTimeWidget-KrcsxgEF.js")
928
+ () => import("./DateTimeWidget-N-wuCRSJ.js")
927
929
  ), de = v(
928
- () => import("./DropdownWidget-rm5oUqOE.js")
929
- ), ft = v(() => import("./EmailWidget-CvZKOywL.js")), yt = v(
930
- () => import("./GeocoderWidget-CSsp_-hW.js")
930
+ () => import("./DropdownWidget-BFttB4b-.js")
931
+ ), yt = v(() => import("./EmailWidget-D_SqXx3M.js")), ft = v(
932
+ () => import("./GeocoderWidget-Bxt3TeAf.js")
931
933
  ), jt = v(
932
- () => import("./MultiGeocoderWidget-Blqz-lHX.js")
933
- ), bt = v(() => import("./PhoneWidget-DezcchSP.js")), vt = v(() => import("./RadioWidget-SfD1fFDG.js")), Ct = v(
934
- () => import("./RichTextWidget-Cg3RizdO.js")
935
- ), wt = v(() => import("./SwitchWidget-Id6BNlPe.js")), kt = v(
936
- () => import("./TextareaWidget-BKzAeMod.js")
934
+ () => import("./MultiGeocoderWidget-DFjuXZBN.js")
935
+ ), bt = v(() => import("./PhoneWidget--K5aS16s.js")), vt = v(() => import("./RadioWidget-BbMPtR3P.js")), Ct = v(
936
+ () => import("./RichTextWidget-Cce3Bw8d.js")
937
+ ), wt = v(() => import("./SwitchWidget-B0wkSWxa.js")), kt = v(
938
+ () => import("./TextareaWidget-S8bKUTv0.js")
937
939
  ), Wt = v(
938
- () => import("./ToggleCheckboxWidget-nSlie9sE.js")
939
- ), _t = v(() => import("./URLWidget-DtJai3xY.js")), K = v(() => import("./UploadWidget-Dxx2_FYo.js")), Nt = ({
940
+ () => import("./ToggleCheckboxWidget-CPduXE6Y.js")
941
+ ), _t = v(() => import("./URLWidget-KbhE2ZUA.js")), K = v(() => import("./UploadWidget-DFvfDUT6.js")), Nt = ({
940
942
  field: e,
941
943
  isInternal: n
942
944
  }) => {
@@ -964,9 +966,9 @@ const dt = E.lazy(
964
966
  case l.MultiTextWidget:
965
967
  return /* @__PURE__ */ s.jsx(pt, { field: e });
966
968
  case l.EmailWidget:
967
- return /* @__PURE__ */ s.jsx(ft, { field: e });
968
- case l.GeocoderWidget:
969
969
  return /* @__PURE__ */ s.jsx(yt, { field: e });
970
+ case l.GeocoderWidget:
971
+ return /* @__PURE__ */ s.jsx(ft, { field: e });
970
972
  case l.MultiGeocoderWidget:
971
973
  return /* @__PURE__ */ s.jsx(jt, { field: e });
972
974
  case l.PhoneWidget:
@@ -1105,9 +1107,9 @@ const dt = E.lazy(
1105
1107
  e
1106
1108
  ] });
1107
1109
  }, ns = () => E.useContext(Ce), Tt = E.lazy(
1108
- () => import("./DefaultFormVariant-j1HgVDiI.js")
1110
+ () => import("./DefaultFormVariant-IqWi1BiT.js")
1109
1111
  ), Mt = E.lazy(
1110
- () => import("./StepsFormVariant-D35dFYK6.js")
1112
+ () => import("./StepsFormVariant-5wZbYAA9.js")
1111
1113
  ), At = ({
1112
1114
  formVariant: e,
1113
1115
  ...n
@@ -1145,9 +1147,9 @@ const dt = E.lazy(
1145
1147
  const m = (x = i == null ? void 0 : i.content) == null ? void 0 : x.data;
1146
1148
  if (m)
1147
1149
  m.sections = (d = m == null ? void 0 : m.sections) == null ? void 0 : d.map(
1148
- (y) => {
1150
+ (f) => {
1149
1151
  var k;
1150
- return y.fields = (k = y == null ? void 0 : y.fields) == null ? void 0 : k.map((C) => (n != null && n.includes(C == null ? void 0 : C.key) && (C.hidden = !0), C)), y;
1152
+ return f.fields = (k = f == null ? void 0 : f.fields) == null ? void 0 : k.map((C) => (n != null && n.includes(C == null ? void 0 : C.key) && (C.hidden = !0), C)), f;
1151
1153
  }
1152
1154
  ), o(m);
1153
1155
  else
@@ -1162,7 +1164,7 @@ const dt = E.lazy(
1162
1164
  }, [e]), /* @__PURE__ */ s.jsx("div", { className: "w-full h-auto", children: c ? /* @__PURE__ */ s.jsx("div", { className: "min-h-[400px] w-full flex justify-center items-center bg-white rounded-md", children: /* @__PURE__ */ s.jsx(Se, {}) }) : a ? /* @__PURE__ */ s.jsx(At, { schema: a, ...t }) : null });
1163
1165
  };
1164
1166
  export {
1165
- Q as A,
1167
+ J as A,
1166
1168
  q as B,
1167
1169
  rs as C,
1168
1170
  ns as D,
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-B6kdoens.js";
2
2
  import { useController as j } from "react-hook-form";
3
3
  import { NumericFormat as F } from "react-number-format";
4
4
  import { c as w } from "./cn-C9QoOYNG.js";
5
- import { z as C, A as B, B as N } from "./CollectionFormBuilder-BIvx_z08.js";
5
+ import { z as C, A as B, B as N } from "./CollectionFormBuilder-MAo2Ob3a.js";
6
6
  const V = ({
7
7
  field: r,
8
8
  ...m
@@ -4,7 +4,7 @@ import { Calendar as w, X as N } from "lucide-react";
4
4
  import * as l from "react-datepicker";
5
5
  import { useController as v } from "react-hook-form";
6
6
  import { c as p } from "./cn-C9QoOYNG.js";
7
- import { z as M, A as D, B as C } from "./CollectionFormBuilder-BIvx_z08.js";
7
+ import { z as M, A as D, B as C } from "./CollectionFormBuilder-MAo2Ob3a.js";
8
8
  import { I as F } from "./Input-2CvZ90f8.js";
9
9
  const T = l.default.default || l.default || l, I = (e) => {
10
10
  if (e) {
@@ -0,0 +1,81 @@
1
+ import { j as e } from "./jsx-runtime-B6kdoens.js";
2
+ import { FormProvider as y } from "react-hook-form";
3
+ import { c as t } from "./cn-C9QoOYNG.js";
4
+ import { D as F, F as g } from "./CollectionFormBuilder-MAo2Ob3a.js";
5
+ import { u as w, S as N, F as b } from "./FormCaptcha-CJ9KgDu0.js";
6
+ import { B as D } from "./Spinner-Bzu2xCFZ.js";
7
+ const _ = () => {
8
+ var n;
9
+ const {
10
+ schema: l,
11
+ containerStyles: c,
12
+ uiConfig: m,
13
+ isInternal: d,
14
+ submitButtonConfig: a,
15
+ isDisabled: x
16
+ } = F(), {
17
+ methods: o,
18
+ allFormValues: p,
19
+ isError: h,
20
+ isLoading: u,
21
+ handleContentId: f,
22
+ handleSubmit: j
23
+ } = w({
24
+ schema: l,
25
+ saveToRemote: !0
26
+ }), {
27
+ formState: { isSubmitting: v }
28
+ } = o, S = o.watch("__captcha");
29
+ return /* @__PURE__ */ e.jsxs(y, { ...o, children: [
30
+ /* @__PURE__ */ e.jsx(
31
+ N,
32
+ {
33
+ getContentId: (s) => f(s),
34
+ isError: h,
35
+ currentValues: p
36
+ }
37
+ ),
38
+ /* @__PURE__ */ e.jsx("div", { className: t("w-full", c), children: /* @__PURE__ */ e.jsxs(
39
+ "form",
40
+ {
41
+ className: t(
42
+ "w-full bg-white rounded-md flex flex-col gap-6 px-4 md:px-8 py-6",
43
+ u && "opacity-50 pointer-events-none"
44
+ ),
45
+ id: "collection-form",
46
+ onSubmit: j,
47
+ children: [
48
+ (n = l == null ? void 0 : l.sections) == null ? void 0 : n.map((s) => {
49
+ var i;
50
+ return /* @__PURE__ */ e.jsxs("div", { className: "w-full", children: [
51
+ !(m != null && m.hideSectionHeadings) && /* @__PURE__ */ e.jsx("p", { className: t("mb-4 text-lg font-semibold"), children: s == null ? void 0 : s.label }),
52
+ /* @__PURE__ */ e.jsx("div", { className: t("flex flex-col gap-4"), children: (i = s == null ? void 0 : s.fields) == null ? void 0 : i.map((r) => r && !r.hidden ? /* @__PURE__ */ e.jsx(
53
+ g,
54
+ {
55
+ field: r,
56
+ isInternal: d
57
+ },
58
+ r == null ? void 0 : r.key
59
+ ) : null) })
60
+ ] }, s.id);
61
+ }),
62
+ !d && /* @__PURE__ */ e.jsx(b, {}),
63
+ (a == null ? void 0 : a.show) && /* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-end mt-6", children: /* @__PURE__ */ e.jsx(
64
+ D,
65
+ {
66
+ className: a == null ? void 0 : a.styles,
67
+ loadingText: "Saving",
68
+ isLoading: v,
69
+ disabled: x,
70
+ type: "submit",
71
+ children: S === "verifying" ? "Verifying..." : (a == null ? void 0 : a.text) || "Save"
72
+ }
73
+ ) })
74
+ ]
75
+ }
76
+ ) })
77
+ ] });
78
+ };
79
+ export {
80
+ _ as default
81
+ };
@@ -4,7 +4,7 @@ import { useState as x, useEffect as w } from "react";
4
4
  import { useController as B } from "react-hook-form";
5
5
  import D from "react-select";
6
6
  import { c as y } from "./cn-C9QoOYNG.js";
7
- import { z as N, A as k, B as q } from "./CollectionFormBuilder-BIvx_z08.js";
7
+ import { z as N, A as k, B as q } from "./CollectionFormBuilder-MAo2Ob3a.js";
8
8
  import { I as L } from "./Input-2CvZ90f8.js";
9
9
  const G = ({
10
10
  field: s,
@@ -49,7 +49,9 @@ const G = ({
49
49
  value: p ? {
50
50
  label: "Other, Please Specify",
51
51
  value: "Other"
52
- } : l ? o != null && o.isMulti ? t == null ? void 0 : t.filter((e) => l == null ? void 0 : l.includes(e == null ? void 0 : e.value)) : t == null ? void 0 : t.find((e) => (e == null ? void 0 : e.value) === l) : null,
52
+ } : l ? o != null && o.isMulti ? t == null ? void 0 : t.filter(
53
+ (e) => l == null ? void 0 : l.includes(e == null ? void 0 : e.value)
54
+ ) : t == null ? void 0 : t.find((e) => (e == null ? void 0 : e.value) === l) : null,
53
55
  onChange: (e) => {
54
56
  m && (e == null ? void 0 : e.value) === "Other" && (e == null ? void 0 : e.label) === "Other, Please Specify" ? (i(!0), a(h)) : (i(!1), o != null && o.isMulti ? a(e == null ? void 0 : e.map((r) => r == null ? void 0 : r.value)) : a(e == null ? void 0 : e.value));
55
57
  },
@@ -1,7 +1,7 @@
1
1
  import { j as r } from "./jsx-runtime-B6kdoens.js";
2
2
  import { useController as y } from "react-hook-form";
3
3
  import { G as C } from "./Spinner-Bzu2xCFZ.js";
4
- import { z as F, A as I, B as V } from "./CollectionFormBuilder-BIvx_z08.js";
4
+ import { z as F, A as I, B as V } from "./CollectionFormBuilder-MAo2Ob3a.js";
5
5
  import { I as b } from "./Input-2CvZ90f8.js";
6
6
  function w(e) {
7
7
  return C({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14a1.75 1.75 0 0 1-1.75 1.75H1.75A1.75 1.75 0 0 1 0 18.75v-14C0 3.784.784 3 1.75 3ZM1.5 7.412V18.75c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V7.412l-9.52 6.433c-.592.4-1.368.4-1.96 0Zm0-2.662v.852l10.36 7a.25.25 0 0 0 .28 0l10.36-7V4.75a.25.25 0 0 0-.25-.25H1.75a.25.25 0 0 0-.25.25Z" }, child: [] }] })(e);