@levo-so/react 0.1.37 → 0.1.43

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 (191) hide show
  1. package/dist/{Sonner-t6JVKA0a.js → Sonner-BzW9wsXf.js} +11 -11
  2. package/dist/Spinner-DBvVyDMF.js +119 -0
  3. package/dist/Tooltip-BeY_STLA.js +281 -0
  4. package/dist/audience/hooks/useBounce.d.ts.map +1 -1
  5. package/dist/audience/hooks/useCurrentTab.d.ts.map +1 -1
  6. package/dist/audience/hooks/useDownloadSpeed.d.ts.map +1 -1
  7. package/dist/audience/hooks/useIdentifyAudience.d.ts.map +1 -1
  8. package/dist/audience/hooks/useOpenTabs.d.ts.map +1 -1
  9. package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +1 -1
  10. package/dist/audience/index.js +1 -1
  11. package/dist/audience/utils/autocapture.d.ts.map +1 -1
  12. package/dist/components/Dialog.d.ts +2 -0
  13. package/dist/components/Dialog.d.ts.map +1 -1
  14. package/dist/components/DialogWrapper.d.ts +1 -0
  15. package/dist/components/DialogWrapper.d.ts.map +1 -1
  16. package/dist/components/Sonner.d.ts.map +1 -1
  17. package/dist/components/Spinner.d.ts.map +1 -1
  18. package/dist/components/index.js +20 -20
  19. package/dist/index.css +1 -1
  20. package/dist/index.d.ts +0 -1
  21. package/dist/index.js +124 -83
  22. package/dist/isEmptyObject-BoIi0jMB.js +21 -0
  23. package/dist/{jsx-runtime-B6kdoens.js → jsx-runtime-D0AQ1Mn7.js} +216 -217
  24. package/dist/membership/components/Button.d.ts.map +1 -1
  25. package/dist/membership/components/Container.d.ts +1 -0
  26. package/dist/membership/components/Container.d.ts.map +1 -1
  27. package/dist/membership/index.d.ts +2 -1
  28. package/dist/membership/index.d.ts.map +1 -1
  29. package/dist/membership/index.js +155 -81
  30. package/dist/membership/useLevoOAuth.d.ts +17 -0
  31. package/dist/membership/useLevoOAuth.d.ts.map +1 -0
  32. package/dist/{page-BVVduzWl.js → page-DweUjn1K.js} +21 -20
  33. package/dist/providers/index.js +1 -1
  34. package/dist/utils/byteToSize.d.ts.map +1 -1
  35. package/dist/utils/cn.d.ts.map +1 -1
  36. package/dist/utils/errorHandler.d.ts.map +1 -1
  37. package/dist/utils/index.js +10 -12
  38. package/dist/utils/isDateObject.d.ts.map +1 -1
  39. package/dist/utils/isEmptyObject.d.ts.map +1 -1
  40. package/dist/utils/isNullOrUndefined.d.ts.map +1 -1
  41. package/dist/utils/isObject.d.ts.map +1 -1
  42. package/package.json +9 -14
  43. package/dist/Checbox-sq-atGlJ.js +0 -28
  44. package/dist/CheckboxWidget-BR6g2qCr.js +0 -124
  45. package/dist/CollectionFormBuilder-KNHR7ngy.js +0 -1195
  46. package/dist/CurrencyWidget-XHAkyPjV.js +0 -60
  47. package/dist/DateTimeWidget-UaUunQAK.js +0 -80
  48. package/dist/DefaultFormVariant-C8hqkuxx.js +0 -81
  49. package/dist/DropdownWidget-DvObQQMp.js +0 -115
  50. package/dist/EmailWidget-7L0S6tat.js +0 -41
  51. package/dist/FormCaptcha-CgYoGiya.js +0 -187
  52. package/dist/GeocoderWidget-DfghAiuD.js +0 -68
  53. package/dist/Input-Vv7mKQFt.js +0 -54
  54. package/dist/MultiGeocoderWidget-CqwjH855.js +0 -49
  55. package/dist/MultiTextWidget-BMp9xdSv.js +0 -33
  56. package/dist/PhoneWidget-DFP4giY9.js +0 -48
  57. package/dist/RadioWidget-DMWMo2Mj.js +0 -109
  58. package/dist/RichTextWidget-DOCSDDib.js +0 -310
  59. package/dist/Spinner-B4CjY8aw.js +0 -411
  60. package/dist/StepsFormVariant-CUFLCpGE.js +0 -140
  61. package/dist/SwitchWidget-BjpxXOcZ.js +0 -53
  62. package/dist/TextWidget-Cgk_TFqD.js +0 -33
  63. package/dist/TextareaWidget-DGU_Xhrx.js +0 -30
  64. package/dist/ToggleCheckboxWidget-bhmeasG_.js +0 -44
  65. package/dist/Tooltip-DoWyn3Ho.js +0 -37
  66. package/dist/URLWidget-B20QysNc.js +0 -14
  67. package/dist/UploadWidget-SQ1MLpbO.js +0 -656
  68. package/dist/byteToSize-BFKZSBu1.js +0 -8
  69. package/dist/collection/components/Altcha.d.ts +0 -10
  70. package/dist/collection/components/Altcha.d.ts.map +0 -1
  71. package/dist/collection/components/CollectionFormBuilder.d.ts +0 -12
  72. package/dist/collection/components/CollectionFormBuilder.d.ts.map +0 -1
  73. package/dist/collection/components/FieldRenderer.d.ts +0 -9
  74. package/dist/collection/components/FieldRenderer.d.ts.map +0 -1
  75. package/dist/collection/components/FormCaptcha.d.ts +0 -3
  76. package/dist/collection/components/FormCaptcha.d.ts.map +0 -1
  77. package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts +0 -5
  78. package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +0 -1
  79. package/dist/collection/components/core/Checkbox/Checbox.d.ts +0 -5
  80. package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +0 -1
  81. package/dist/collection/components/core/Input/Input.d.ts +0 -11
  82. package/dist/collection/components/core/Input/Input.d.ts.map +0 -1
  83. package/dist/collection/components/core/Switch/Switch.d.ts +0 -5
  84. package/dist/collection/components/core/Switch/Switch.d.ts.map +0 -1
  85. package/dist/collection/components/renderer/RenderArrayWidget.d.ts +0 -5
  86. package/dist/collection/components/renderer/RenderArrayWidget.d.ts.map +0 -1
  87. package/dist/collection/components/renderer/RenderCommonField.d.ts +0 -5
  88. package/dist/collection/components/renderer/RenderCommonField.d.ts.map +0 -1
  89. package/dist/collection/components/renderer/RenderRecordWidget.d.ts +0 -4
  90. package/dist/collection/components/renderer/RenderRecordWidget.d.ts.map +0 -1
  91. package/dist/collection/components/widgets/ErrorMessage.d.ts +0 -6
  92. package/dist/collection/components/widgets/ErrorMessage.d.ts.map +0 -1
  93. package/dist/collection/components/widgets/FieldWrapper.d.ts +0 -14
  94. package/dist/collection/components/widgets/FieldWrapper.d.ts.map +0 -1
  95. package/dist/collection/components/widgets/FormHelperText.d.ts +0 -6
  96. package/dist/collection/components/widgets/FormHelperText.d.ts.map +0 -1
  97. package/dist/collection/components/widgets/FormLabel.d.ts +0 -8
  98. package/dist/collection/components/widgets/FormLabel.d.ts.map +0 -1
  99. package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +0 -8
  100. package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +0 -1
  101. package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts +0 -7
  102. package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +0 -1
  103. package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts +0 -7
  104. package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts.map +0 -1
  105. package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts +0 -8
  106. package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +0 -1
  107. package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts +0 -9
  108. package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +0 -1
  109. package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts +0 -8
  110. package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +0 -1
  111. package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts +0 -9
  112. package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +0 -1
  113. package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts +0 -8
  114. package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts.map +0 -1
  115. package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts +0 -8
  116. package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +0 -1
  117. package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts +0 -8
  118. package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +0 -1
  119. package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts +0 -7
  120. package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +0 -1
  121. package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts +0 -8
  122. package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +0 -1
  123. package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts +0 -11
  124. package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +0 -1
  125. package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts +0 -12
  126. package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +0 -1
  127. package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts +0 -8
  128. package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts.map +0 -1
  129. package/dist/collection/components/widgets/textWidget/TextWidget.d.ts +0 -9
  130. package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +0 -1
  131. package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts +0 -8
  132. package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +0 -1
  133. package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts +0 -8
  134. package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts.map +0 -1
  135. package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts +0 -11
  136. package/dist/collection/components/widgets/uploadWidget/CommonPreview.d.ts.map +0 -1
  137. package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts +0 -11
  138. package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +0 -1
  139. package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts +0 -10
  140. package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +0 -1
  141. package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts +0 -13
  142. package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +0 -1
  143. package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts +0 -11
  144. package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +0 -1
  145. package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts +0 -19
  146. package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +0 -1
  147. package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts +0 -5
  148. package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts.map +0 -1
  149. package/dist/collection/index.d.ts +0 -5
  150. package/dist/collection/index.d.ts.map +0 -1
  151. package/dist/collection/index.js +0 -20
  152. package/dist/collection/lib/FormBuilder.d.ts +0 -8
  153. package/dist/collection/lib/FormBuilder.d.ts.map +0 -1
  154. package/dist/collection/lib/SaveDraftValues.d.ts +0 -7
  155. package/dist/collection/lib/SaveDraftValues.d.ts.map +0 -1
  156. package/dist/collection/lib/hooks/useLevoForm.d.ts +0 -18
  157. package/dist/collection/lib/hooks/useLevoForm.d.ts.map +0 -1
  158. package/dist/collection/lib/provider/LevoFormProvider.d.ts +0 -9
  159. package/dist/collection/lib/provider/LevoFormProvider.d.ts.map +0 -1
  160. package/dist/collection/lib/variants/DefaultFormVariant.d.ts +0 -3
  161. package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +0 -1
  162. package/dist/collection/lib/variants/StepsFormVariant.d.ts +0 -4
  163. package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +0 -1
  164. package/dist/collection/types/context.d.ts +0 -34
  165. package/dist/collection/types/context.d.ts.map +0 -1
  166. package/dist/collection/types/errors.d.ts +0 -7
  167. package/dist/collection/types/errors.d.ts.map +0 -1
  168. package/dist/collection/types/formVariant.d.ts +0 -18
  169. package/dist/collection/types/formVariant.d.ts.map +0 -1
  170. package/dist/collection/types/forms.d.ts +0 -31
  171. package/dist/collection/types/forms.d.ts.map +0 -1
  172. package/dist/collection/types/index.d.ts +0 -4
  173. package/dist/collection/types/index.d.ts.map +0 -1
  174. package/dist/collection/types/renderer.d.ts +0 -6
  175. package/dist/collection/types/renderer.d.ts.map +0 -1
  176. package/dist/collection/utils/formHelpers.d.ts +0 -48
  177. package/dist/collection/utils/formHelpers.d.ts.map +0 -1
  178. package/dist/collection/utils/getFieldValidations.d.ts +0 -6
  179. package/dist/collection/utils/getFieldValidations.d.ts.map +0 -1
  180. package/dist/collection/utils/index.d.ts +0 -6
  181. package/dist/collection/utils/index.d.ts.map +0 -1
  182. package/dist/collection/utils/schema.d.ts +0 -3
  183. package/dist/collection/utils/schema.d.ts.map +0 -1
  184. package/dist/collection/utils/setFormErrors.d.ts +0 -4
  185. package/dist/collection/utils/setFormErrors.d.ts.map +0 -1
  186. package/dist/collection/utils/storage.d.ts +0 -11
  187. package/dist/collection/utils/storage.d.ts.map +0 -1
  188. package/dist/errorHandler-_34Yv8wA.js +0 -9
  189. package/dist/isEmptyObject-C5s4GzLE.js +0 -8
  190. package/dist/libs.css +0 -1
  191. package/dist/libs.d.ts +0 -1
@@ -1,49 +0,0 @@
1
- "use client";
2
- import { j as e } from "./jsx-runtime-B6kdoens.js";
3
- import { Plus as m } from "lucide-react";
4
- import { useFieldArray as n } from "react-hook-form";
5
- import { B as c } from "./CollectionFormBuilder-KNHR7ngy.js";
6
- import { GeocoderWidget as d } from "./GeocoderWidget-DfghAiuD.js";
7
- import { B as p } from "./Spinner-B4CjY8aw.js";
8
- const k = ({
9
- field: l
10
- }) => {
11
- const { key: s = "", label: o = "" } = l, { fields: r, ...i } = n({
12
- name: s
13
- });
14
- return /* @__PURE__ */ e.jsxs("div", { className: "relative w-full", children: [
15
- o && /* @__PURE__ */ e.jsx(c, { htmlFor: s, children: o }),
16
- /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
17
- r == null ? void 0 : r.map((a, t) => /* @__PURE__ */ e.jsx(
18
- d,
19
- {
20
- field: {
21
- ...l,
22
- key: `${s}.${t}`,
23
- label: ""
24
- }
25
- },
26
- a.id
27
- )),
28
- /* @__PURE__ */ e.jsxs(
29
- p,
30
- {
31
- variant: "ghost",
32
- size: "xs",
33
- className: "shrink-0 grow-0 self-start",
34
- onClick: () => {
35
- i.append(null);
36
- },
37
- children: [
38
- /* @__PURE__ */ e.jsx(m, { className: "mr-1 inline-block", size: "14px" }),
39
- "Add"
40
- ]
41
- }
42
- )
43
- ] })
44
- ] });
45
- };
46
- export {
47
- k as MultiGeocoderWidget,
48
- k as default
49
- };
@@ -1,33 +0,0 @@
1
- import { j as a } from "./jsx-runtime-B6kdoens.js";
2
- import { useController as A } from "react-hook-form";
3
- import { z as C, A as b, B as q } from "./CollectionFormBuilder-KNHR7ngy.js";
4
- import { I } from "./Input-Vv7mKQFt.js";
5
- const f = ({ field: r }) => {
6
- var l;
7
- const { key: u = "", label: n = "", helper_text: c = "", readonly: x = !1 } = r, o = u, {
8
- field: { value: e, onChange: d, ...h },
9
- fieldState: s
10
- } = A({
11
- name: o,
12
- rules: C(r)
13
- }), g = !!(r != null && r.required), j = (l = s == null ? void 0 : s.error) == null ? void 0 : l.message, y = Array.isArray(e) ? e == null ? void 0 : e.join(",") : "";
14
- return /* @__PURE__ */ a.jsxs(b, { error: j, helperText: c, children: [
15
- n && /* @__PURE__ */ a.jsx(q, { htmlFor: o, isRequired: g, children: n }),
16
- /* @__PURE__ */ a.jsx(
17
- I,
18
- {
19
- id: o,
20
- readOnly: x,
21
- value: y,
22
- onChange: (F) => {
23
- var m, p, i;
24
- d((i = (p = (m = F.target) == null ? void 0 : m.value) == null ? void 0 : p.split(",")) == null ? void 0 : i.map((t) => t == null ? void 0 : t.trim()));
25
- },
26
- ...h
27
- }
28
- )
29
- ] });
30
- };
31
- export {
32
- f as default
33
- };
@@ -1,48 +0,0 @@
1
- "use client";
2
- import { j as t } from "./jsx-runtime-B6kdoens.js";
3
- import { useController as f } from "react-hook-form";
4
- import { PhoneInput as x } from "react-international-phone";
5
- import { c as l } from "./cn-C9QoOYNG.js";
6
- import { z as g, A as v, B as y } from "./CollectionFormBuilder-KNHR7ngy.js";
7
- const P = ({ field: e }) => {
8
- const { key: u = "", label: o = "", helper_text: c = "", readonly: n = !1 } = e, s = u, {
9
- field: { value: d, onBlur: a, onChange: i, ...m },
10
- fieldState: { error: r }
11
- } = f({
12
- name: s,
13
- rules: g(e)
14
- }), p = !!(e != null && e.required), h = r == null ? void 0 : r.message;
15
- return /* @__PURE__ */ t.jsxs(v, { error: h, helperText: c, readOnly: n, children: [
16
- o && /* @__PURE__ */ t.jsx(y, { htmlFor: s, isRequired: p, children: o }),
17
- /* @__PURE__ */ t.jsx(
18
- x,
19
- {
20
- defaultCountry: "in",
21
- value: d,
22
- className: l(
23
- "w-full",
24
- n ? "pointer-events-none focus-visible:ring-0" : ""
25
- ),
26
- inputClassName: l(
27
- "w-full border border-input !bg-transparent text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 !text-text-1"
28
- ),
29
- onChange: (b) => {
30
- i && i(b);
31
- },
32
- onBlur: () => {
33
- a && a();
34
- },
35
- style: {
36
- "--react-international-phone-height": "2.25rem",
37
- "--react-international-phone-border-radius": "calc(var(--radius) - 2px)"
38
- },
39
- disableDialCodePrefill: !0,
40
- ...m
41
- }
42
- )
43
- ] });
44
- };
45
- export {
46
- P as PhoneWidget,
47
- P as default
48
- };
@@ -1,109 +0,0 @@
1
- "use client";
2
- import { j as r } from "./jsx-runtime-B6kdoens.js";
3
- import * as n from "@radix-ui/react-radio-group";
4
- import * as d from "react";
5
- import { useController as F } from "react-hook-form";
6
- import { G as B } from "./Spinner-B4CjY8aw.js";
7
- import { c as N } from "./cn-C9QoOYNG.js";
8
- import { z as E, A as G, B as f } from "./CollectionFormBuilder-KNHR7ngy.js";
9
- import { I as V } from "./Input-Vv7mKQFt.js";
10
- function q(s) {
11
- return B({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M416 128 192 384l-96-96" }, child: [] }] })(s);
12
- }
13
- const C = ({ field: s }) => {
14
- var y;
15
- const [c, m] = d.useState(""), [u, h] = d.useState(!1), {
16
- key: v = "",
17
- label: j = "",
18
- helper_text: $ = "",
19
- readonly: g = !1,
20
- values: t = [],
21
- options: w = {}
22
- } = s, { custom_input: I } = w, a = v, {
23
- field: { value: i, onBlur: b, onChange: o, ...R },
24
- fieldState: p
25
- } = F({
26
- name: a,
27
- rules: E(s)
28
- }), O = !!(s != null && s.required), k = (y = p == null ? void 0 : p.error) == null ? void 0 : y.message;
29
- return d.useEffect(() => {
30
- u || i && (t == null ? void 0 : t.findIndex((e) => e === i)) === -1 && (h(!0), m(i));
31
- }, [i]), /* @__PURE__ */ r.jsxs(G, { error: k, helperText: $, readOnly: g, children: [
32
- j && /* @__PURE__ */ r.jsx(f, { htmlFor: a, isRequired: O, children: j }),
33
- /* @__PURE__ */ r.jsxs(
34
- n.Root,
35
- {
36
- id: a,
37
- className: N(
38
- "flex w-full flex-col flex-wrap gap-4 pt-1",
39
- g && "pointer-events-none cursor-not-allowed"
40
- ),
41
- onValueChange: (e) => {
42
- o && (e === "Other" ? (h(!0), o(c)) : (h(!1), o(e)));
43
- },
44
- onBlur: () => {
45
- b && b();
46
- },
47
- value: u ? "Other" : i,
48
- ...R,
49
- children: [
50
- t == null ? void 0 : t.map((e, l) => /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
51
- /* @__PURE__ */ r.jsx(x, { id: `${a}-${e}-${l}`, value: e, children: e }),
52
- /* @__PURE__ */ r.jsx(
53
- f,
54
- {
55
- htmlFor: `${a}-${e}-${l}`,
56
- className: "mb-0 font-normal",
57
- children: e
58
- }
59
- )
60
- ] }, `${e}-${l}`)),
61
- !!I && /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
62
- /* @__PURE__ */ r.jsx(x, { id: `${a}-other`, value: "Other" }),
63
- /* @__PURE__ */ r.jsx(
64
- f,
65
- {
66
- className: "mb-0 font-normal leading-none",
67
- htmlFor: `${a}-other`,
68
- children: "Other:"
69
- }
70
- ),
71
- /* @__PURE__ */ r.jsx(
72
- V,
73
- {
74
- className: "max-w-[300px]",
75
- name: `radio-other-${a}`,
76
- value: c,
77
- onChange: (e) => {
78
- var l;
79
- o == null || o((l = e == null ? void 0 : e.target) == null ? void 0 : l.value), m(e.target.value);
80
- },
81
- disabled: !u,
82
- placeholder: "Please specify"
83
- }
84
- )
85
- ] })
86
- ]
87
- }
88
- )
89
- ] });
90
- };
91
- C.displayName = n.Root.displayName;
92
- const x = d.forwardRef(({ className: s, ...c }, m) => /* @__PURE__ */ r.jsx(
93
- n.Item,
94
- {
95
- ref: m,
96
- className: N(
97
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
98
- s
99
- ),
100
- ...c,
101
- children: /* @__PURE__ */ r.jsx(n.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ r.jsx(q, { className: "h-3.5 w-3.5 fill-primary" }) })
102
- }
103
- ));
104
- x.displayName = n.Item.displayName;
105
- export {
106
- x as RadioGroupItem,
107
- C as RadioWidget,
108
- C as default
109
- };
@@ -1,310 +0,0 @@
1
- "use client";
2
- import { j as l } from "./jsx-runtime-B6kdoens.js";
3
- import B from "@tiptap/extension-bold";
4
- import d from "@tiptap/extension-bullet-list";
5
- import w from "@tiptap/extension-document";
6
- import { HardBreak as z } from "@tiptap/extension-hard-break";
7
- import y from "@tiptap/extension-history";
8
- import S from "@tiptap/extension-italic";
9
- import R from "@tiptap/extension-link";
10
- import M from "@tiptap/extension-list-item";
11
- import U from "@tiptap/extension-ordered-list";
12
- import T from "@tiptap/extension-paragraph";
13
- import H from "@tiptap/extension-strike";
14
- import N from "@tiptap/extension-text";
15
- import O from "@tiptap/extension-text-align";
16
- import F from "@tiptap/extension-underline";
17
- import { useEditor as I, EditorContent as E } from "@tiptap/react";
18
- import { useState as q, useEffect as D } from "react";
19
- import { useController as G } from "react-hook-form";
20
- import { G as p, p as J, q as V, r as W, s as Z, t as _, u as P, v as K, w as Q, x as X, y as Y, z as $, A as nn } from "./Spinner-B4CjY8aw.js";
21
- import { c as j } from "./cn-C9QoOYNG.js";
22
- import { z as ln, A as en, B as sn } from "./CollectionFormBuilder-KNHR7ngy.js";
23
- function an(n) {
24
- return p({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 0 1-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 0 1-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 0 0-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z" }, child: [] }] })(n);
25
- }
26
- function cn(n) {
27
- return p({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 0 0-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 0 1-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 0 1-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 0 0-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z" }, child: [] }] })(n);
28
- }
29
- function tn(n) {
30
- return p({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M12.6512 14.0654L11.6047 20H9.57389L10.9247 12.339L3.51465 4.92892L4.92886 3.51471L20.4852 19.0711L19.071 20.4853L12.6512 14.0654ZM11.7727 7.53009L12.0425 5.99999H10.2426L8.24257 3.99999H19.9999V5.99999H14.0733L13.4991 9.25652L11.7727 7.53009Z" }, child: [] }] })(n);
31
- }
32
- const e = ({
33
- isSelected: n,
34
- className: c,
35
- children: t,
36
- ...i
37
- }) => /* @__PURE__ */ l.jsx(
38
- "button",
39
- {
40
- className: j(
41
- "rounded-[4px] text-gray-900 hover:bg-gray-200",
42
- n ? "bg-gray-400" : "bg-transparent",
43
- c
44
- ),
45
- type: "button",
46
- ...i,
47
- children: t
48
- }
49
- ), a = ({ children: n }) => /* @__PURE__ */ l.jsx("div", { className: "flex gap-[2px] border-r-[1px] border-solid border-input p-1", children: n }), rn = ({ editor: n }) => {
50
- if (!n)
51
- return null;
52
- function c(i) {
53
- const u = i.getAttributes("link").href, r = window.prompt("URL", u);
54
- if (r !== null) {
55
- if (r === "") {
56
- i.chain().focus().extendMarkRange("link").unsetLink().run();
57
- return;
58
- }
59
- i.chain().focus().extendMarkRange("link").setLink({ href: r }).run();
60
- }
61
- }
62
- const t = n.getAttributes("link").href;
63
- return /* @__PURE__ */ l.jsxs("div", { className: "overflow flex w-full flex-wrap rounded-br-[14px] rounded-tl-[14px] border-b-[1px] border-solid bg-white", children: [
64
- /* @__PURE__ */ l.jsxs(a, { children: [
65
- /* @__PURE__ */ l.jsx(
66
- e,
67
- {
68
- title: "Bold",
69
- isSelected: n == null ? void 0 : n.isActive("bold"),
70
- "aria-label": "bold",
71
- onClick: () => n == null ? void 0 : n.chain().focus().toggleBold().run(),
72
- children: /* @__PURE__ */ l.jsx(J, { size: "1.125rem" })
73
- }
74
- ),
75
- /* @__PURE__ */ l.jsx(
76
- e,
77
- {
78
- title: "Italic",
79
- isSelected: n == null ? void 0 : n.isActive("italic"),
80
- "aria-label": "italic",
81
- onClick: () => n == null ? void 0 : n.chain().focus().toggleItalic().run(),
82
- children: /* @__PURE__ */ l.jsx(V, { size: "1.125rem" })
83
- }
84
- ),
85
- /* @__PURE__ */ l.jsx(
86
- e,
87
- {
88
- title: "Underline",
89
- isSelected: n == null ? void 0 : n.isActive("underline"),
90
- "aria-label": "underline",
91
- onClick: () => n == null ? void 0 : n.commands.toggleUnderline(),
92
- children: /* @__PURE__ */ l.jsx(W, { size: "1.25rem" })
93
- }
94
- ),
95
- /* @__PURE__ */ l.jsx(
96
- e,
97
- {
98
- title: "Strike",
99
- isSelected: n == null ? void 0 : n.isActive("strike"),
100
- "aria-label": "strike",
101
- onClick: () => n == null ? void 0 : n.chain().focus().toggleStrike().run(),
102
- children: /* @__PURE__ */ l.jsx(Z, { size: "1.125rem" })
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ l.jsxs(a, { children: [
107
- /* @__PURE__ */ l.jsx(
108
- e,
109
- {
110
- title: "Bullet list",
111
- isSelected: n == null ? void 0 : n.isActive("bulletList"),
112
- "aria-label": "bulletList",
113
- onClick: () => n == null ? void 0 : n.chain().focus().toggleBulletList().run(),
114
- children: /* @__PURE__ */ l.jsx(_, { size: "1.25rem" })
115
- }
116
- ),
117
- /* @__PURE__ */ l.jsx(
118
- e,
119
- {
120
- title: "Numbered List",
121
- isSelected: n == null ? void 0 : n.isActive("orderedList"),
122
- "aria-label": "numberList",
123
- onClick: () => n == null ? void 0 : n.chain().focus().toggleOrderedList().run(),
124
- children: /* @__PURE__ */ l.jsx(P, { size: "1.25rem" })
125
- }
126
- )
127
- ] }),
128
- /* @__PURE__ */ l.jsxs(a, { children: [
129
- /* @__PURE__ */ l.jsx(
130
- e,
131
- {
132
- title: "Add Link",
133
- "aria-label": "link",
134
- isSelected: n == null ? void 0 : n.isActive("link"),
135
- onClick: () => c(n),
136
- children: /* @__PURE__ */ l.jsx(K, { size: "1.25rem" })
137
- }
138
- ),
139
- /* @__PURE__ */ l.jsx(
140
- e,
141
- {
142
- title: "Remove Link",
143
- "aria-label": "unlink",
144
- disabled: !t,
145
- onClick: () => n.chain().focus().extendMarkRange("link").unsetLink().run(),
146
- children: /* @__PURE__ */ l.jsx(Q, { size: "1.25rem" })
147
- }
148
- )
149
- ] }),
150
- /* @__PURE__ */ l.jsxs(a, { children: [
151
- /* @__PURE__ */ l.jsx(
152
- e,
153
- {
154
- title: "Left Align",
155
- isSelected: n == null ? void 0 : n.isActive({ textAlign: "left" }),
156
- "aria-label": "leftAlign",
157
- onClick: () => n == null ? void 0 : n.chain().focus().setTextAlign("left").run(),
158
- children: /* @__PURE__ */ l.jsx(X, { size: "1.125rem" })
159
- }
160
- ),
161
- /* @__PURE__ */ l.jsx(
162
- e,
163
- {
164
- title: "Center Align",
165
- isSelected: n == null ? void 0 : n.isActive({ textAlign: "center" }),
166
- "aria-label": "centerAlign",
167
- onClick: () => n == null ? void 0 : n.chain().focus().setTextAlign("center").run(),
168
- children: /* @__PURE__ */ l.jsx(Y, { size: "1.125rem" })
169
- }
170
- ),
171
- /* @__PURE__ */ l.jsx(
172
- e,
173
- {
174
- title: "Right Align",
175
- isSelected: n == null ? void 0 : n.isActive({ textAlign: "right" }),
176
- "aria-label": "rightAlign",
177
- onClick: () => n == null ? void 0 : n.chain().focus().setTextAlign("right").run(),
178
- children: /* @__PURE__ */ l.jsx($, { size: "1.125rem" })
179
- }
180
- ),
181
- /* @__PURE__ */ l.jsx(
182
- e,
183
- {
184
- title: "Justify Align",
185
- isSelected: n == null ? void 0 : n.isActive({ textAlign: "justify" }),
186
- "aria-label": "justifyAlign",
187
- onClick: () => n == null ? void 0 : n.chain().focus().setTextAlign("justify").run(),
188
- children: /* @__PURE__ */ l.jsx(nn, { size: "1.125rem" })
189
- }
190
- )
191
- ] }),
192
- /* @__PURE__ */ l.jsx(a, { children: /* @__PURE__ */ l.jsx(
193
- e,
194
- {
195
- title: "Clear Formatting",
196
- isSelected: n == null ? void 0 : n.isActive("clear-formatting"),
197
- "aria-label": "clear-formatting",
198
- onClick: () => n.chain().focus().clearNodes().unsetAllMarks().run(),
199
- children: /* @__PURE__ */ l.jsx(tn, { size: "1.125rem" })
200
- }
201
- ) }),
202
- /* @__PURE__ */ l.jsxs(a, { children: [
203
- /* @__PURE__ */ l.jsx(
204
- e,
205
- {
206
- title: "Undo",
207
- "aria-label": "undo",
208
- onClick: () => n.chain().focus().undo().run(),
209
- disabled: !n.can().chain().focus().undo().run(),
210
- children: /* @__PURE__ */ l.jsx(cn, { size: "1.125rem" })
211
- }
212
- ),
213
- /* @__PURE__ */ l.jsx(
214
- e,
215
- {
216
- title: "Redo",
217
- "aria-label": "redo",
218
- onClick: () => n.chain().focus().redo().run(),
219
- disabled: !n.can().chain().focus().redo().run(),
220
- children: /* @__PURE__ */ l.jsx(an, { size: "1.125rem" })
221
- }
222
- )
223
- ] })
224
- ] });
225
- }, Rn = ({ field: n }) => {
226
- var b;
227
- const [c, t] = q(!1), { key: i = "", label: u = "", helper_text: r = "", readonly: x = !1 } = n, o = i, {
228
- field: { value: g, onBlur: k, onChange: A, ...m },
229
- fieldState: h
230
- } = G({
231
- name: o,
232
- rules: ln(n)
233
- }), L = !!(n != null && n.required), v = (b = h == null ? void 0 : h.error) == null ? void 0 : b.message, s = I({
234
- extensions: [
235
- w,
236
- T,
237
- N,
238
- B,
239
- F,
240
- S,
241
- H,
242
- U,
243
- d,
244
- M,
245
- z,
246
- R.configure({
247
- HTMLAttributes: {
248
- target: "_blank"
249
- },
250
- openOnClick: !1
251
- }),
252
- O.configure({
253
- types: ["heading", "paragraph"]
254
- }),
255
- y
256
- ],
257
- content: g,
258
- editable: !m.disabled && !x,
259
- onBlur: () => {
260
- k();
261
- },
262
- onUpdate: ({ editor: f }) => {
263
- const C = f.getHTML();
264
- A(C);
265
- },
266
- immediatelyRender: !1
267
- });
268
- return D(() => {
269
- s != null && s.commands && !c && (s.commands.setContent(g || ""), t(!0));
270
- }, [g]), /* @__PURE__ */ l.jsxs(en, { error: v, helperText: r, readOnly: x, children: [
271
- u && /* @__PURE__ */ l.jsx(sn, { htmlFor: o, isRequired: L, children: u }),
272
- /* @__PURE__ */ l.jsxs(
273
- "div",
274
- {
275
- className: j(
276
- "w-full overflow-hidden rounded-md border border-input placeholder:text-muted-foreground focus-within:outline-none focus-within:ring-1 focus-within:ring-ring",
277
- (m == null ? void 0 : m.disabled) && "pointer-events-none cursor-not-allowed opacity-50",
278
- x && "pointer-events-none focus-visible:ring-0"
279
- ),
280
- children: [
281
- /* @__PURE__ */ l.jsx(rn, { editor: s }),
282
- /* @__PURE__ */ l.jsx(
283
- "div",
284
- {
285
- className: "h-[210px] w-full flex-1 overflow-y-auto rounded-b-[inherit] bg-white",
286
- onClick: () => {
287
- var f;
288
- return (f = s == null ? void 0 : s.commands) == null ? void 0 : f.focus();
289
- },
290
- children: /* @__PURE__ */ l.jsx(
291
- E,
292
- {
293
- id: o,
294
- className: "prose prose-sm !w-full px-4 [&>div]:w-full [&>div]:outline-none",
295
- name: o,
296
- editor: s
297
- }
298
- )
299
- }
300
- )
301
- ]
302
- }
303
- )
304
- ] });
305
- };
306
- export {
307
- Rn as RichTextWidget,
308
- e as ToolbarButton,
309
- Rn as default
310
- };