@levo-so/react 0.0.2-alpha → 0.1.0
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.
- package/dist/Checbox-sq-atGlJ.js +28 -0
- package/dist/CheckboxWidget-CD4lv7B4.js +118 -0
- package/dist/CollectionFormBuilder-a0pzMkWL.js +734 -0
- package/dist/CurrencyWidget-DRMqUgbP.js +60 -0
- package/dist/DateTimeWidget-FmBvE_lk.js +103 -0
- package/dist/DefaultFormVariant-BzHB74Ie.js +80 -0
- package/dist/DropdownWidget-CW0GSjwE.js +115 -0
- package/dist/EmailWidget-Nyc76pT8.js +42 -0
- package/dist/GeocoderWidget-Ib15NJcx.js +309 -0
- package/dist/Input-2CvZ90f8.js +54 -0
- package/dist/LevoProvider-DNbYyEaf.js +21 -0
- package/dist/MultiGeocoderWidget-BuW8i48_.js +49 -0
- package/dist/PhoneWidget-COo3SBNU.js +47 -0
- package/dist/RadioWidget-C8syq1dO.js +109 -0
- package/dist/RichTextWidget-B5qxi5OE.js +309 -0
- package/dist/Sonner-t6JVKA0a.js +39 -0
- package/dist/Spinner-CuUosd-S.js +297 -0
- package/dist/StepsFormVariant-NSTSIoVV.js +137 -0
- package/dist/SwitchWidget-C-p7lICr.js +53 -0
- package/dist/TextWidget-BtZp3DRk.js +34 -0
- package/dist/TextareaWidget-D0TbFUjX.js +30 -0
- package/dist/ToggleCheckboxWidget-BbVq_dAC.js +44 -0
- package/dist/Tooltip-CI4i4mYr.js +144 -0
- package/dist/URLWidget-00u8Svwt.js +14 -0
- package/dist/UploadWidget-Dim2TEFc.js +503 -0
- package/dist/audience/{block.d.ts → components/block.d.ts} +1 -1
- package/dist/audience/components/block.d.ts.map +1 -0
- package/dist/audience/{component.d.ts → components/component.d.ts} +1 -1
- package/dist/audience/components/component.d.ts.map +1 -0
- package/dist/audience/{page.d.ts → components/page.d.ts} +1 -1
- package/dist/audience/components/page.d.ts.map +1 -0
- package/dist/audience/components/useScrollDepth.d.ts.map +1 -0
- package/dist/audience/index.d.ts +3 -3
- package/dist/audience/index.d.ts.map +1 -1
- package/dist/audience/index.js +4 -2303
- package/dist/byteToSize-BFKZSBu1.js +8 -0
- package/dist/cn-C9QoOYNG.js +6 -0
- package/dist/collection/components/CollectionFormBuilder.d.ts +12 -0
- package/dist/collection/components/CollectionFormBuilder.d.ts.map +1 -0
- package/dist/collection/components/FieldRenderer.d.ts +9 -0
- package/dist/collection/components/FieldRenderer.d.ts.map +1 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts +5 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +1 -0
- package/dist/collection/components/core/Checkbox/Checbox.d.ts +5 -0
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +1 -0
- package/dist/collection/components/core/Input/Input.d.ts +11 -0
- package/dist/collection/components/core/Input/Input.d.ts.map +1 -0
- package/dist/collection/components/core/Switch/Switch.d.ts +5 -0
- package/dist/collection/components/core/Switch/Switch.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts +5 -0
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderCommonField.d.ts +5 -0
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts +4 -0
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/ErrorMessage.d.ts +6 -0
- package/dist/collection/components/widgets/ErrorMessage.d.ts.map +1 -0
- package/dist/collection/components/widgets/FieldWrapper.d.ts +14 -0
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +1 -0
- package/dist/collection/components/widgets/FormHelperText.d.ts +6 -0
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +1 -0
- package/dist/collection/components/widgets/FormLabel.d.ts +8 -0
- package/dist/collection/components/widgets/FormLabel.d.ts.map +1 -0
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +8 -0
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts +7 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts +9 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts +10 -0
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts +9 -0
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts +9 -0
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts +8 -0
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts +8 -0
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts +8 -0
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts +11 -0
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts +12 -0
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts +8 -0
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts +10 -0
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts +8 -0
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts +8 -0
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts +10 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts +13 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts +11 -0
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts +19 -0
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts +5 -0
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts.map +1 -0
- package/dist/collection/index.d.ts +5 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +19 -0
- package/dist/collection/lib/FormBuilder.d.ts +8 -0
- package/dist/collection/lib/FormBuilder.d.ts.map +1 -0
- package/dist/collection/lib/SaveDraftValues.d.ts +7 -0
- package/dist/collection/lib/SaveDraftValues.d.ts.map +1 -0
- package/dist/collection/lib/hooks/useLevoForm.d.ts +18 -0
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +1 -0
- package/dist/collection/lib/provider/LevoFormProvider.d.ts +9 -0
- package/dist/collection/lib/provider/LevoFormProvider.d.ts.map +1 -0
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts +3 -0
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +1 -0
- package/dist/collection/lib/variants/StepsFormVariant.d.ts +4 -0
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +1 -0
- package/dist/collection/types/context.d.ts +34 -0
- package/dist/collection/types/context.d.ts.map +1 -0
- package/dist/collection/types/errors.d.ts +7 -0
- package/dist/collection/types/errors.d.ts.map +1 -0
- package/dist/collection/types/formVariant.d.ts +18 -0
- package/dist/collection/types/formVariant.d.ts.map +1 -0
- package/dist/collection/types/forms.d.ts +31 -0
- package/dist/collection/types/forms.d.ts.map +1 -0
- package/dist/collection/types/index.d.ts +4 -0
- package/dist/collection/types/index.d.ts.map +1 -0
- package/dist/collection/types/renderer.d.ts +6 -0
- package/dist/collection/types/renderer.d.ts.map +1 -0
- package/dist/collection/utils/formHelpers.d.ts +47 -0
- package/dist/collection/utils/formHelpers.d.ts.map +1 -0
- package/dist/collection/utils/getFieldValidations.d.ts +6 -0
- package/dist/collection/utils/getFieldValidations.d.ts.map +1 -0
- package/dist/collection/utils/index.d.ts +4 -0
- package/dist/collection/utils/index.d.ts.map +1 -0
- package/dist/collection/utils/schema.d.ts +3 -0
- package/dist/collection/utils/schema.d.ts.map +1 -0
- package/dist/collection/utils/setFormErrors.d.ts +4 -0
- package/dist/collection/utils/setFormErrors.d.ts.map +1 -0
- package/dist/collection/utils/storage.d.ts +11 -0
- package/dist/collection/utils/storage.d.ts.map +1 -0
- package/dist/components/Dialog.d.ts +21 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/DialogWrapper.d.ts +11 -0
- package/dist/components/DialogWrapper.d.ts.map +1 -0
- package/dist/components/Sonner.d.ts +7 -0
- package/dist/components/Sonner.d.ts.map +1 -0
- package/dist/components/Spinner.d.ts +5 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts +8 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts +12 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/buttonVariants.d.ts +6 -0
- package/dist/components/button/buttonVariants.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +33 -0
- package/dist/constants/fileUploadPresets.d.ts +34 -0
- package/dist/constants/fileUploadPresets.d.ts.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/errorHandler-BJcFS2qV.js +26 -0
- package/dist/fileUploadPresets-2raQmHT0.js +74 -0
- package/dist/index-wTf_TtOG.js +131 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +84 -0
- package/dist/isEmptyObject-C5s4GzLE.js +8 -0
- package/dist/jsx-runtime-B6kdoens.js +634 -0
- package/dist/membership/components/OAuth/Button.d.ts +8 -0
- package/dist/membership/components/OAuth/Button.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Container.d.ts +24 -0
- package/dist/membership/components/OAuth/Container.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Core.d.ts +17 -0
- package/dist/membership/components/OAuth/Core.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Popup.d.ts +15 -0
- package/dist/membership/components/OAuth/Popup.d.ts.map +1 -0
- package/dist/membership/components/index.d.ts +8 -0
- package/dist/membership/components/index.d.ts.map +1 -0
- package/dist/membership/index.d.ts +2 -0
- package/dist/membership/index.d.ts.map +1 -0
- package/dist/membership/index.js +4 -0
- package/dist/page-CxaKoH22.js +205 -0
- package/dist/providers/LevoProvider.d.ts +25 -0
- package/dist/providers/LevoProvider.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/useLevoForm-CR3q-L5Z.js +166 -0
- package/dist/utils/byteToSize.d.ts +3 -0
- package/dist/utils/byteToSize.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/errorHandler.d.ts +2 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/isDateObject.d.ts +2 -0
- package/dist/utils/isDateObject.d.ts.map +1 -0
- package/dist/utils/isEmptyObject.d.ts +5 -0
- package/dist/utils/isEmptyObject.d.ts.map +1 -0
- package/dist/utils/isNullOrUndefined.d.ts +2 -0
- package/dist/utils/isNullOrUndefined.d.ts.map +1 -0
- package/dist/utils/isObject.d.ts +3 -0
- package/dist/utils/isObject.d.ts.map +1 -0
- package/package.json +82 -5
- package/dist/audience/block.d.ts.map +0 -1
- package/dist/audience/component.d.ts.map +0 -1
- package/dist/audience/page.d.ts.map +0 -1
- package/dist/audience/useScrollDepth.d.ts.map +0 -1
- /package/dist/audience/{useScrollDepth.d.ts → components/useScrollDepth.d.ts} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as h } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import le, { useState as J, useEffect as fe } from "react";
|
|
4
|
+
import { useController as de } from "react-hook-form";
|
|
5
|
+
import { q as pe } from "./Spinner-CuUosd-S.js";
|
|
6
|
+
import { h as ge, j as me, k as ye } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
7
|
+
import { I as _e } from "./Input-2CvZ90f8.js";
|
|
8
|
+
var U = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ne = {}, ve = "Expected a function", Y = NaN, be = "[object Symbol]", Se = /^\s+|\s+$/g, Pe = /^[-+]0x[0-9a-f]+$/i, Oe = /^0b[01]+$/i, he = /^0o[0-7]+$/i, Te = parseInt, je = typeof U == "object" && U && U.Object === Object && U, xe = typeof self == "object" && self && self.Object === Object && self, Ae = je || xe || Function("return this")(), Le = Object.prototype, Ee = Le.toString, we = Math.max, Ie = Math.min, $ = function() {
|
|
9
|
+
return Ae.Date.now();
|
|
10
|
+
};
|
|
11
|
+
function Ce(e, t, r) {
|
|
12
|
+
var n, a, c, u, s, l, g = 0, d = !1, v = !1, T = !0;
|
|
13
|
+
if (typeof e != "function")
|
|
14
|
+
throw new TypeError(ve);
|
|
15
|
+
t = Z(t) || 0, q(r) && (d = !!r.leading, v = "maxWait" in r, c = v ? we(Z(r.maxWait) || 0, t) : c, T = "trailing" in r ? !!r.trailing : T);
|
|
16
|
+
function P(i) {
|
|
17
|
+
var o = n, f = a;
|
|
18
|
+
return n = a = void 0, g = i, u = e.apply(f, o), u;
|
|
19
|
+
}
|
|
20
|
+
function j(i) {
|
|
21
|
+
return g = i, s = setTimeout(y, t), d ? P(i) : u;
|
|
22
|
+
}
|
|
23
|
+
function A(i) {
|
|
24
|
+
var o = i - l, f = i - g, O = t - o;
|
|
25
|
+
return v ? Ie(O, c - f) : O;
|
|
26
|
+
}
|
|
27
|
+
function L(i) {
|
|
28
|
+
var o = i - l, f = i - g;
|
|
29
|
+
return l === void 0 || o >= t || o < 0 || v && f >= c;
|
|
30
|
+
}
|
|
31
|
+
function y() {
|
|
32
|
+
var i = $();
|
|
33
|
+
if (L(i))
|
|
34
|
+
return b(i);
|
|
35
|
+
s = setTimeout(y, A(i));
|
|
36
|
+
}
|
|
37
|
+
function b(i) {
|
|
38
|
+
return s = void 0, T && n ? P(i) : (n = a = void 0, u);
|
|
39
|
+
}
|
|
40
|
+
function E() {
|
|
41
|
+
s !== void 0 && clearTimeout(s), g = 0, n = l = a = s = void 0;
|
|
42
|
+
}
|
|
43
|
+
function w() {
|
|
44
|
+
return s === void 0 ? u : b($());
|
|
45
|
+
}
|
|
46
|
+
function S() {
|
|
47
|
+
var i = $(), o = L(i);
|
|
48
|
+
if (n = arguments, a = this, l = i, o) {
|
|
49
|
+
if (s === void 0)
|
|
50
|
+
return j(l);
|
|
51
|
+
if (v)
|
|
52
|
+
return s = setTimeout(y, t), P(l);
|
|
53
|
+
}
|
|
54
|
+
return s === void 0 && (s = setTimeout(y, t)), u;
|
|
55
|
+
}
|
|
56
|
+
return S.cancel = E, S.flush = w, S;
|
|
57
|
+
}
|
|
58
|
+
function q(e) {
|
|
59
|
+
var t = typeof e;
|
|
60
|
+
return !!e && (t == "object" || t == "function");
|
|
61
|
+
}
|
|
62
|
+
function Me(e) {
|
|
63
|
+
return !!e && typeof e == "object";
|
|
64
|
+
}
|
|
65
|
+
function ke(e) {
|
|
66
|
+
return typeof e == "symbol" || Me(e) && Ee.call(e) == be;
|
|
67
|
+
}
|
|
68
|
+
function Z(e) {
|
|
69
|
+
if (typeof e == "number")
|
|
70
|
+
return e;
|
|
71
|
+
if (ke(e))
|
|
72
|
+
return Y;
|
|
73
|
+
if (q(e)) {
|
|
74
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
75
|
+
e = q(t) ? t + "" : t;
|
|
76
|
+
}
|
|
77
|
+
if (typeof e != "string")
|
|
78
|
+
return e === 0 ? e : +e;
|
|
79
|
+
e = e.replace(Se, "");
|
|
80
|
+
var r = Oe.test(e);
|
|
81
|
+
return r || he.test(e) ? Te(e.slice(2), r ? 2 : 8) : Pe.test(e) ? Y : +e;
|
|
82
|
+
}
|
|
83
|
+
var Ge = Ce, k = {};
|
|
84
|
+
Object.defineProperty(k, "__esModule", {
|
|
85
|
+
value: !0
|
|
86
|
+
});
|
|
87
|
+
k.loadGoogleMapScript = k.isBrowser = void 0;
|
|
88
|
+
var oe = typeof window < "u" && window.document;
|
|
89
|
+
k.isBrowser = oe;
|
|
90
|
+
var Re = function(t, r) {
|
|
91
|
+
if (!oe || typeof google < "u" && google.maps && google.maps.api)
|
|
92
|
+
return Promise.resolve();
|
|
93
|
+
var n = document.querySelectorAll('script[src*="'.concat(t, '"]'));
|
|
94
|
+
if (n && n.length)
|
|
95
|
+
return new Promise(function(u) {
|
|
96
|
+
if (typeof google < "u") return u();
|
|
97
|
+
n[0].addEventListener("load", function() {
|
|
98
|
+
return u();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
var a = new URL(r);
|
|
102
|
+
a.searchParams.set("callback", "__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__");
|
|
103
|
+
var c = document.createElement("script");
|
|
104
|
+
return c.src = a.toString(), new Promise(function(u) {
|
|
105
|
+
window.__REACT_GOOGLE_AUTOCOMPLETE_CALLBACK__ = u, document.body.appendChild(c);
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
k.loadGoogleMapScript = Re;
|
|
109
|
+
var N = {};
|
|
110
|
+
Object.defineProperty(N, "__esModule", {
|
|
111
|
+
value: !0
|
|
112
|
+
});
|
|
113
|
+
N.GOOGLE_MAP_SCRIPT_BASE_URL = void 0;
|
|
114
|
+
var Be = "https://maps.googleapis.com/maps/api/js";
|
|
115
|
+
N.GOOGLE_MAP_SCRIPT_BASE_URL = Be;
|
|
116
|
+
Object.defineProperty(ne, "__esModule", {
|
|
117
|
+
value: !0
|
|
118
|
+
});
|
|
119
|
+
var Ue = ne.default = Ve, m = le, D = Qe(Ge), ee = k, Ne = N;
|
|
120
|
+
function Qe(e) {
|
|
121
|
+
return e && e.__esModule ? e : { default: e };
|
|
122
|
+
}
|
|
123
|
+
function te(e, t) {
|
|
124
|
+
var r = Object.keys(e);
|
|
125
|
+
if (Object.getOwnPropertySymbols) {
|
|
126
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
127
|
+
t && (n = n.filter(function(a) {
|
|
128
|
+
return Object.getOwnPropertyDescriptor(e, a).enumerable;
|
|
129
|
+
})), r.push.apply(r, n);
|
|
130
|
+
}
|
|
131
|
+
return r;
|
|
132
|
+
}
|
|
133
|
+
function C(e) {
|
|
134
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
135
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
136
|
+
t % 2 ? te(Object(r), !0).forEach(function(n) {
|
|
137
|
+
$e(e, n, r[n]);
|
|
138
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : te(Object(r)).forEach(function(n) {
|
|
139
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
return e;
|
|
143
|
+
}
|
|
144
|
+
function $e(e, t, r) {
|
|
145
|
+
return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
146
|
+
}
|
|
147
|
+
function M(e, t) {
|
|
148
|
+
return We(e) || Ke(e, t) || Fe(e, t) || qe();
|
|
149
|
+
}
|
|
150
|
+
function qe() {
|
|
151
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
152
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
153
|
+
}
|
|
154
|
+
function Fe(e, t) {
|
|
155
|
+
if (e) {
|
|
156
|
+
if (typeof e == "string") return re(e, t);
|
|
157
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
158
|
+
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
159
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return re(e, t);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function re(e, t) {
|
|
163
|
+
(t == null || t > e.length) && (t = e.length);
|
|
164
|
+
for (var r = 0, n = new Array(t); r < t; r++)
|
|
165
|
+
n[r] = e[r];
|
|
166
|
+
return n;
|
|
167
|
+
}
|
|
168
|
+
function Ke(e, t) {
|
|
169
|
+
var r = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
170
|
+
if (r != null) {
|
|
171
|
+
var n = [], a = !0, c = !1, u, s;
|
|
172
|
+
try {
|
|
173
|
+
for (r = r.call(e); !(a = (u = r.next()).done) && (n.push(u.value), !(t && n.length === t)); a = !0)
|
|
174
|
+
;
|
|
175
|
+
} catch (l) {
|
|
176
|
+
c = !0, s = l;
|
|
177
|
+
} finally {
|
|
178
|
+
try {
|
|
179
|
+
!a && r.return != null && r.return();
|
|
180
|
+
} finally {
|
|
181
|
+
if (c) throw s;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return n;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function We(e) {
|
|
188
|
+
if (Array.isArray(e)) return e;
|
|
189
|
+
}
|
|
190
|
+
function Ve(e) {
|
|
191
|
+
var t = e.apiKey, r = e.libraries, n = r === void 0 ? "places" : r, a = e.googleMapsScriptBaseUrl, c = a === void 0 ? Ne.GOOGLE_MAP_SCRIPT_BASE_URL : a, u = e.debounce, s = u === void 0 ? 300 : u, l = e.options, g = l === void 0 ? {} : l, d = e.sessionToken, v = e.language, T = v ? "&language=".concat(v) : "", P = "".concat(c, "?key=").concat(t, "&libraries=").concat(n).concat(T), j = (0, m.useState)([]), A = M(j, 2), L = A[0], y = A[1], b = (0, m.useState)(!1), E = M(b, 2), w = E[0], S = E[1], i = (0, m.useState)(null), o = M(i, 2), f = o[0], O = o[1], R = (0, m.useState)(!1), G = M(R, 2), B = G[0], Q = G[1], ie = (0, m.useState)(!1), F = M(ie, 2), ae = F[0], K = F[1], se = (0, m.useState)([]), W = M(se, 2), ue = W[0], V = W[1], I = (0, m.useRef)(null), H = (0, m.useRef)(null), x = (0, m.useRef)(null), ce = (0, m.useCallback)(function() {
|
|
192
|
+
return (0, ee.loadGoogleMapScript)(c, P);
|
|
193
|
+
}, [c, P]), z = (0, m.useCallback)((0, D.default)(function(_) {
|
|
194
|
+
I.current && _.input && I.current.getPlacePredictions(C(C(C({}, d && x.current ? {
|
|
195
|
+
sessionToken: x.current
|
|
196
|
+
} : {}), g), _), function(p) {
|
|
197
|
+
S(!1), y(p || []);
|
|
198
|
+
});
|
|
199
|
+
}, s), [s]), X = (0, m.useCallback)((0, D.default)(function(_) {
|
|
200
|
+
I.current && _.input && I.current.getQueryPredictions(C(C(C({}, d && x.current ? {
|
|
201
|
+
sessionToken: x.current
|
|
202
|
+
} : {}), g), _), function(p) {
|
|
203
|
+
Q(!1), V(p || []);
|
|
204
|
+
});
|
|
205
|
+
}, s), [s]);
|
|
206
|
+
return (0, m.useEffect)(function() {
|
|
207
|
+
if (ee.isBrowser) {
|
|
208
|
+
var _ = function() {
|
|
209
|
+
if (!google) return console.error("Google has not been found. Make sure your provide apiKey prop.");
|
|
210
|
+
I.current = new google.maps.places.AutocompleteService(), H.current = new google.maps.places.PlacesService(document.createElement("div")), d && (x.current = new google.maps.places.AutocompleteSessionToken());
|
|
211
|
+
};
|
|
212
|
+
t ? ce().then(function() {
|
|
213
|
+
return _();
|
|
214
|
+
}) : _();
|
|
215
|
+
}
|
|
216
|
+
}, []), {
|
|
217
|
+
placesService: H.current,
|
|
218
|
+
autocompleteSessionToken: x.current,
|
|
219
|
+
placesAutocompleteService: I.current,
|
|
220
|
+
placePredictions: f ? L : [],
|
|
221
|
+
isPlacePredictionsLoading: w,
|
|
222
|
+
getPlacePredictions: function(p) {
|
|
223
|
+
if (p.input) {
|
|
224
|
+
O(p.input), S(!0), z(p);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
y([]), O(null), z(p), S(!1);
|
|
228
|
+
},
|
|
229
|
+
queryPredictions: ae ? ue : [],
|
|
230
|
+
isQueryPredictionsLoading: B,
|
|
231
|
+
getQueryPredictions: function(p) {
|
|
232
|
+
if (p.input) {
|
|
233
|
+
K(p.input), Q(!0), X(p);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
V([]), K(null), X(p), Q(!1);
|
|
237
|
+
},
|
|
238
|
+
refreshSessionToken: function() {
|
|
239
|
+
x.current = new google.maps.places.AutocompleteSessionToken();
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const De = ({ field: e }) => {
|
|
244
|
+
var i;
|
|
245
|
+
const [t, r] = J(""), [n, a] = J(!1), { key: c = "", label: u = "", helper_text: s = "", readonly: l = !1 } = e, g = c, {
|
|
246
|
+
field: { value: d, onBlur: v, onChange: T, ...P },
|
|
247
|
+
fieldState: j
|
|
248
|
+
} = de({
|
|
249
|
+
name: g,
|
|
250
|
+
rules: ge(e)
|
|
251
|
+
}), A = !!(e != null && e.required), L = (i = j == null ? void 0 : j.error) == null ? void 0 : i.message, {
|
|
252
|
+
placesService: y,
|
|
253
|
+
placePredictions: b,
|
|
254
|
+
getPlacePredictions: E,
|
|
255
|
+
isPlacePredictionsLoading: w
|
|
256
|
+
} = Ue({
|
|
257
|
+
apiKey: process.env.NEXT_PUBLIC_GOOGLE_MAPS,
|
|
258
|
+
debounce: 200
|
|
259
|
+
}), S = (o) => {
|
|
260
|
+
y == null || y.getDetails(
|
|
261
|
+
{
|
|
262
|
+
placeId: o == null ? void 0 : o.place_id
|
|
263
|
+
},
|
|
264
|
+
(f) => {
|
|
265
|
+
var O, R, G, B;
|
|
266
|
+
T(g, {
|
|
267
|
+
...f,
|
|
268
|
+
place_name: o == null ? void 0 : o.description,
|
|
269
|
+
latitude: ((R = (O = f == null ? void 0 : f.geometry) == null ? void 0 : O.location) == null ? void 0 : R.lat()) || 0,
|
|
270
|
+
longitude: ((B = (G = f == null ? void 0 : f.geometry) == null ? void 0 : G.location) == null ? void 0 : B.lng()) || 0
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
), a(!0);
|
|
274
|
+
};
|
|
275
|
+
return fe(() => {
|
|
276
|
+
d != null && d.place_name && (r(d == null ? void 0 : d.place_name), a(!0));
|
|
277
|
+
}, [d]), /* @__PURE__ */ h.jsx(me, { error: L, helperText: s, readOnly: l, children: /* @__PURE__ */ h.jsxs("div", { className: "w-full relative", children: [
|
|
278
|
+
u && /* @__PURE__ */ h.jsx(ye, { htmlFor: g, isRequired: A, children: u }),
|
|
279
|
+
/* @__PURE__ */ h.jsx(
|
|
280
|
+
_e,
|
|
281
|
+
{
|
|
282
|
+
id: g,
|
|
283
|
+
value: t,
|
|
284
|
+
onChange: (o) => {
|
|
285
|
+
a(!1), E({ input: o.target.value }), r(o.target.value);
|
|
286
|
+
},
|
|
287
|
+
onBlur: () => {
|
|
288
|
+
v();
|
|
289
|
+
},
|
|
290
|
+
rightIcon: w && /* @__PURE__ */ h.jsx(pe, { size: "20px", className: "animate-spin" }),
|
|
291
|
+
readOnly: l,
|
|
292
|
+
...P
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
t && !w && !n && /* @__PURE__ */ h.jsx("div", { className: "absolute bg-white left-[-1px] z-50 p-[4px] w-full shadow-[0_0_8px_rgba(0,0,0,0.25)] rounded-[6px]", children: b != null && b.length ? b.map((o) => /* @__PURE__ */ h.jsx(
|
|
296
|
+
"p",
|
|
297
|
+
{
|
|
298
|
+
className: "text-md p-[8px] cursor-pointer rounded-[6px] hover:bg-gray-200",
|
|
299
|
+
onClick: () => S(o),
|
|
300
|
+
children: o.description
|
|
301
|
+
},
|
|
302
|
+
o.place_id
|
|
303
|
+
)) : /* @__PURE__ */ h.jsx("p", { className: "text-md p-[8px] text-muted-foreground", children: "No results found" }) })
|
|
304
|
+
] }) });
|
|
305
|
+
};
|
|
306
|
+
export {
|
|
307
|
+
De as GeocoderWidget,
|
|
308
|
+
De as default
|
|
309
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import u from "react";
|
|
3
|
+
import { c as r } from "./cn-C9QoOYNG.js";
|
|
4
|
+
const b = u.forwardRef(
|
|
5
|
+
({
|
|
6
|
+
className: l,
|
|
7
|
+
leftIcon: t,
|
|
8
|
+
rightIcon: o,
|
|
9
|
+
leftIconBoxStyles: i,
|
|
10
|
+
rightIconBoxStyles: d,
|
|
11
|
+
containerStyles: n,
|
|
12
|
+
...s
|
|
13
|
+
}, a) => /* @__PURE__ */ e.jsxs("div", { className: r("w-full relative", n), children: [
|
|
14
|
+
t ? /* @__PURE__ */ e.jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: r(
|
|
18
|
+
"absolute left-0 top-0 bottom-0 w-9 flex items-center justify-center rounded-l-md overflow-hidden",
|
|
19
|
+
"border border-transparent",
|
|
20
|
+
i
|
|
21
|
+
),
|
|
22
|
+
children: t
|
|
23
|
+
}
|
|
24
|
+
) : null,
|
|
25
|
+
/* @__PURE__ */ e.jsx(
|
|
26
|
+
"input",
|
|
27
|
+
{
|
|
28
|
+
ref: a,
|
|
29
|
+
className: r(
|
|
30
|
+
"h-9 flex w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
31
|
+
s.readOnly ? "focus-visible:ring-0" : "",
|
|
32
|
+
t ? "pl-11" : "",
|
|
33
|
+
o ? "pr-11" : "",
|
|
34
|
+
l
|
|
35
|
+
),
|
|
36
|
+
...s
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
o ? /* @__PURE__ */ e.jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: r(
|
|
43
|
+
"absolute right-0 top-0 bottom-0 w-9 flex items-center justify-center rounded-r-md overflow-hidden",
|
|
44
|
+
"border border-transparent",
|
|
45
|
+
d
|
|
46
|
+
),
|
|
47
|
+
children: o
|
|
48
|
+
}
|
|
49
|
+
) : null
|
|
50
|
+
] })
|
|
51
|
+
);
|
|
52
|
+
export {
|
|
53
|
+
b as I
|
|
54
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { createContext as s, useContext as n } from "react";
|
|
4
|
+
const o = s(null), v = ({ children: e, ...t }) => /* @__PURE__ */ r.jsx(
|
|
5
|
+
o.Provider,
|
|
6
|
+
{
|
|
7
|
+
value: {
|
|
8
|
+
...t
|
|
9
|
+
},
|
|
10
|
+
children: e
|
|
11
|
+
}
|
|
12
|
+
), x = () => {
|
|
13
|
+
const e = n(o);
|
|
14
|
+
if (!e)
|
|
15
|
+
throw new Error("useLevo must be used within LevoProvider");
|
|
16
|
+
return e;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
v as L,
|
|
20
|
+
x as u
|
|
21
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useFieldArray as m } from "react-hook-form";
|
|
4
|
+
import { k as n } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
5
|
+
import { Plus as c } from "lucide-react";
|
|
6
|
+
import { GeocoderWidget as d } from "./GeocoderWidget-Ib15NJcx.js";
|
|
7
|
+
import { B as p } from "./Spinner-CuUosd-S.js";
|
|
8
|
+
const g = ({
|
|
9
|
+
field: l
|
|
10
|
+
}) => {
|
|
11
|
+
const { key: s = "", label: o = "" } = l, { fields: r, ...i } = m({
|
|
12
|
+
name: s
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "w-full relative", children: [
|
|
15
|
+
o && /* @__PURE__ */ e.jsx(n, { 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(c, { className: "inline-block mr-1", size: "14px" }),
|
|
39
|
+
"Add"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
g as MultiGeocoderWidget,
|
|
48
|
+
g as default
|
|
49
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useController as f } from "react-hook-form";
|
|
4
|
+
import { PhoneInput as g } from "react-international-phone";
|
|
5
|
+
import { h as x, j as v, k as j } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
6
|
+
import { c as l } from "./cn-C9QoOYNG.js";
|
|
7
|
+
const q = ({ field: e }) => {
|
|
8
|
+
const { key: u = "", label: n = "", helper_text: c = "", readonly: t = !1 } = e, s = u, {
|
|
9
|
+
field: { value: d, onBlur: a, onChange: i, ...m },
|
|
10
|
+
fieldState: { error: r }
|
|
11
|
+
} = f({
|
|
12
|
+
name: s,
|
|
13
|
+
rules: x(e)
|
|
14
|
+
}), p = !!(e != null && e.required), h = r == null ? void 0 : r.message;
|
|
15
|
+
return /* @__PURE__ */ o.jsxs(v, { error: h, helperText: c, readOnly: t, children: [
|
|
16
|
+
n && /* @__PURE__ */ o.jsx(j, { htmlFor: s, isRequired: p, children: n }),
|
|
17
|
+
/* @__PURE__ */ o.jsx(
|
|
18
|
+
g,
|
|
19
|
+
{
|
|
20
|
+
defaultCountry: "in",
|
|
21
|
+
value: d,
|
|
22
|
+
className: l(
|
|
23
|
+
"w-full",
|
|
24
|
+
t ? "focus-visible:ring-0 pointer-events-none" : ""
|
|
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"
|
|
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
|
+
...m
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
] });
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
q as PhoneWidget,
|
|
46
|
+
q as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
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 E } from "./Spinner-CuUosd-S.js";
|
|
7
|
+
import { h as G, j as V, k as f } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
8
|
+
import { I as q } from "./Input-2CvZ90f8.js";
|
|
9
|
+
import { c as N } from "./cn-C9QoOYNG.js";
|
|
10
|
+
function B(s) {
|
|
11
|
+
return E({ 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: G(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(V, { 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
|
+
"w-full flex gap-4 flex-col flex-wrap 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 gap-2 items-center", 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: "font-normal mb-0",
|
|
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: "font-normal leading-none mb-0",
|
|
67
|
+
htmlFor: `${a}-other`,
|
|
68
|
+
children: "Other:"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ r.jsx(
|
|
72
|
+
q,
|
|
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(B, { 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
|
+
};
|