@levo-so/react 0.1.14 → 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.
- package/dist/CheckboxWidget-CNoS-2W3.js +124 -0
- package/dist/CollectionFormBuilder-MAo2Ob3a.js +1199 -0
- package/dist/{CurrencyWidget-COoMkfsA.js → CurrencyWidget-Cu1Cthnw.js} +5 -5
- package/dist/{DateTimeWidget-DcbQ3smI.js → DateTimeWidget-N-wuCRSJ.js} +3 -3
- package/dist/DefaultFormVariant-IqWi1BiT.js +81 -0
- package/dist/DropdownWidget-BFttB4b-.js +115 -0
- package/dist/{EmailWidget-CG9oNUM5.js → EmailWidget-D_SqXx3M.js} +11 -11
- package/dist/FormCaptcha-CJ9KgDu0.js +197 -0
- package/dist/GeocoderWidget-Bxt3TeAf.js +68 -0
- package/dist/LevoProvider-BAZy7_tP.js +223 -0
- package/dist/{MultiGeocoderWidget-D3Xmv8g4.js → MultiGeocoderWidget-DFjuXZBN.js} +6 -6
- package/dist/{MultiTextWidget-CyQRcWC8.js → MultiTextWidget-CZzT51cH.js} +14 -14
- package/dist/{PhoneWidget-C1Jt7kXL.js → PhoneWidget--K5aS16s.js} +5 -5
- package/dist/{RadioWidget-BrLNF-I2.js → RadioWidget-BbMPtR3P.js} +9 -9
- package/dist/{RichTextWidget-BogYcPtS.js → RichTextWidget-Cce3Bw8d.js} +21 -21
- package/dist/Spinner-Bzu2xCFZ.js +405 -0
- package/dist/{StepsFormVariant-Bx-jdciC.js → StepsFormVariant-5wZbYAA9.js} +58 -55
- package/dist/{SwitchWidget-BT0-waP9.js → SwitchWidget-B0wkSWxa.js} +5 -5
- package/dist/{TextWidget-Bvsz-hey.js → TextWidget-ldbMuLB0.js} +7 -7
- package/dist/{TextareaWidget-8SLym--T.js → TextareaWidget-S8bKUTv0.js} +3 -3
- package/dist/{ToggleCheckboxWidget-VrCQBF5C.js → ToggleCheckboxWidget-CPduXE6Y.js} +7 -7
- package/dist/Tooltip-DEBnSqlo.js +36 -0
- package/dist/{URLWidget-B99nKr6N.js → URLWidget-KbhE2ZUA.js} +2 -2
- package/dist/UploadWidget-DFvfDUT6.js +616 -0
- package/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/index.js +1 -1
- package/dist/collection/components/Altcha.d.ts +10 -0
- package/dist/collection/components/Altcha.d.ts.map +1 -0
- package/dist/collection/components/FormCaptcha.d.ts +3 -0
- package/dist/collection/components/FormCaptcha.d.ts.map +1 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +1 -1
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +1 -1
- package/dist/collection/components/core/Input/Input.d.ts.map +1 -1
- package/dist/collection/components/core/Switch/Switch.d.ts.map +1 -1
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +1 -1
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +1 -1
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +1 -1
- package/dist/collection/components/widgets/FormLabel.d.ts.map +1 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +1 -1
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts +7 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2M.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/{CollectionWidget.d.ts → CollectionWidgetM2O.d.ts} +1 -1
- package/dist/collection/components/widgets/collectionWidget/CollectionWidgetM2O.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts +8 -0
- package/dist/collection/components/widgets/collectionWidget/SelectedCollectionItems.d.ts.map +1 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/multiTextWidget/MultiTextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts +11 -0
- package/dist/collection/components/widgets/uploadWidget/ExternalURL.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +1 -1
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +1 -1
- package/dist/collection/index.js +13 -12
- package/dist/collection/lib/FormBuilder.d.ts.map +1 -1
- package/dist/collection/lib/SaveDraftValues.d.ts.map +1 -1
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +1 -1
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +1 -1
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +1 -1
- package/dist/collection/utils/formHelpers.d.ts.map +1 -1
- package/dist/collection/utils/index.d.ts +2 -0
- package/dist/collection/utils/index.d.ts.map +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Table.d.ts +11 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/index.js +29 -29
- package/dist/constants/fileUploadPresets.d.ts +4 -2
- package/dist/constants/fileUploadPresets.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +75 -75
- package/dist/membership/components/Button.d.ts.map +1 -1
- package/dist/membership/components/Container.d.ts.map +1 -1
- package/dist/membership/components/Core.d.ts.map +1 -1
- package/dist/membership/index.js +2 -3
- package/dist/page-BKyDlf0z.js +212 -0
- package/dist/utils/errorHandler.d.ts.map +1 -1
- package/package.json +12 -11
- package/dist/CheckboxWidget-BctVOZiO.js +0 -118
- package/dist/CollectionFormBuilder-B6CAVKhg.js +0 -772
- package/dist/DefaultFormVariant-C6zbKgwB.js +0 -80
- package/dist/DropdownWidget-DszCTSWr.js +0 -115
- package/dist/GeocoderWidget-CXu17A7y.js +0 -310
- package/dist/LevoProvider-BI6g_T4E.js +0 -212
- package/dist/Spinner-DzGH5rKe.js +0 -297
- package/dist/Tooltip-CI4i4mYr.js +0 -144
- package/dist/UploadWidget-ZebPWZZZ.js +0 -505
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts.map +0 -1
- package/dist/fileUploadPresets-2raQmHT0.js +0 -74
- package/dist/page-yeiAPg3O.js +0 -200
- package/dist/useLevoForm-DjvUas25.js +0 -166
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as i } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import * as m from "@radix-ui/react-tabs";
|
|
4
|
+
import * as u from "react";
|
|
5
|
+
import f from "react";
|
|
6
|
+
import { c as l } from "./cn-C9QoOYNG.js";
|
|
7
|
+
import { Slot as D } from "@radix-ui/react-slot";
|
|
8
|
+
import { twMerge as M } from "tailwind-merge";
|
|
9
|
+
import { cva as L } from "class-variance-authority";
|
|
10
|
+
import * as o from "@radix-ui/react-dialog";
|
|
11
|
+
import { X as R } from "lucide-react";
|
|
12
|
+
var y = {
|
|
13
|
+
color: void 0,
|
|
14
|
+
size: void 0,
|
|
15
|
+
className: void 0,
|
|
16
|
+
style: void 0,
|
|
17
|
+
attr: void 0
|
|
18
|
+
}, b = f.createContext && /* @__PURE__ */ f.createContext(y), T = ["attr", "size", "title"];
|
|
19
|
+
function S(t, e) {
|
|
20
|
+
if (t == null) return {};
|
|
21
|
+
var a = k(t, e), r, s;
|
|
22
|
+
if (Object.getOwnPropertySymbols) {
|
|
23
|
+
var c = Object.getOwnPropertySymbols(t);
|
|
24
|
+
for (s = 0; s < c.length; s++)
|
|
25
|
+
r = c[s], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (a[r] = t[r]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
}
|
|
29
|
+
function k(t, e) {
|
|
30
|
+
if (t == null) return {};
|
|
31
|
+
var a = {};
|
|
32
|
+
for (var r in t)
|
|
33
|
+
if (Object.prototype.hasOwnProperty.call(t, r)) {
|
|
34
|
+
if (e.indexOf(r) >= 0) continue;
|
|
35
|
+
a[r] = t[r];
|
|
36
|
+
}
|
|
37
|
+
return a;
|
|
38
|
+
}
|
|
39
|
+
function v() {
|
|
40
|
+
return v = Object.assign ? Object.assign.bind() : function(t) {
|
|
41
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
42
|
+
var a = arguments[e];
|
|
43
|
+
for (var r in a)
|
|
44
|
+
Object.prototype.hasOwnProperty.call(a, r) && (t[r] = a[r]);
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
}, v.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
function x(t, e) {
|
|
50
|
+
var a = Object.keys(t);
|
|
51
|
+
if (Object.getOwnPropertySymbols) {
|
|
52
|
+
var r = Object.getOwnPropertySymbols(t);
|
|
53
|
+
e && (r = r.filter(function(s) {
|
|
54
|
+
return Object.getOwnPropertyDescriptor(t, s).enumerable;
|
|
55
|
+
})), a.push.apply(a, r);
|
|
56
|
+
}
|
|
57
|
+
return a;
|
|
58
|
+
}
|
|
59
|
+
function p(t) {
|
|
60
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
61
|
+
var a = arguments[e] != null ? arguments[e] : {};
|
|
62
|
+
e % 2 ? x(Object(a), !0).forEach(function(r) {
|
|
63
|
+
E(t, r, a[r]);
|
|
64
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : x(Object(a)).forEach(function(r) {
|
|
65
|
+
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(a, r));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
function E(t, e, a) {
|
|
71
|
+
return e = _(e), e in t ? Object.defineProperty(t, e, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = a, t;
|
|
72
|
+
}
|
|
73
|
+
function _(t) {
|
|
74
|
+
var e = A(t, "string");
|
|
75
|
+
return typeof e == "symbol" ? e : e + "";
|
|
76
|
+
}
|
|
77
|
+
function A(t, e) {
|
|
78
|
+
if (typeof t != "object" || !t) return t;
|
|
79
|
+
var a = t[Symbol.toPrimitive];
|
|
80
|
+
if (a !== void 0) {
|
|
81
|
+
var r = a.call(t, e || "default");
|
|
82
|
+
if (typeof r != "object") return r;
|
|
83
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
84
|
+
}
|
|
85
|
+
return (e === "string" ? String : Number)(t);
|
|
86
|
+
}
|
|
87
|
+
function w(t) {
|
|
88
|
+
return t && t.map((e, a) => /* @__PURE__ */ f.createElement(e.tag, p({
|
|
89
|
+
key: a
|
|
90
|
+
}, e.attr), w(e.child)));
|
|
91
|
+
}
|
|
92
|
+
function n(t) {
|
|
93
|
+
return (e) => /* @__PURE__ */ f.createElement(V, v({
|
|
94
|
+
attr: p({}, t.attr)
|
|
95
|
+
}, e), w(t.child));
|
|
96
|
+
}
|
|
97
|
+
function V(t) {
|
|
98
|
+
var e = (a) => {
|
|
99
|
+
var {
|
|
100
|
+
attr: r,
|
|
101
|
+
size: s,
|
|
102
|
+
title: c
|
|
103
|
+
} = t, g = S(t, T), h = s || a.size || "1em", d;
|
|
104
|
+
return a.className && (d = a.className), t.className && (d = (d ? d + " " : "") + t.className), /* @__PURE__ */ f.createElement("svg", v({
|
|
105
|
+
stroke: "currentColor",
|
|
106
|
+
fill: "currentColor",
|
|
107
|
+
strokeWidth: "0"
|
|
108
|
+
}, a.attr, r, g, {
|
|
109
|
+
className: d,
|
|
110
|
+
style: p(p({
|
|
111
|
+
color: t.color || a.color
|
|
112
|
+
}, a.style), t.style),
|
|
113
|
+
height: h,
|
|
114
|
+
width: h,
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
116
|
+
}), c && /* @__PURE__ */ f.createElement("title", null, c), t.children);
|
|
117
|
+
};
|
|
118
|
+
return b !== void 0 ? /* @__PURE__ */ f.createElement(b.Consumer, null, (a) => e(a)) : e(y);
|
|
119
|
+
}
|
|
120
|
+
function at(t) {
|
|
121
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 7h16v2H4zm0-4h16v2H4zm0 8h16v2H4zm0 4h16v2H4zm2 4h12v2H6z" }, child: [] }] })(t);
|
|
122
|
+
}
|
|
123
|
+
function rt(t) {
|
|
124
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 19h16v2H4zm0-4h11v2H4zm0-4h16v2H4zm0-8h16v2H4zm0 4h11v2H4z" }, child: [] }] })(t);
|
|
125
|
+
}
|
|
126
|
+
function it(t) {
|
|
127
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 19h16v2H4zm3-4h10v2H7zm-3-4h16v2H4zm0-8h16v2H4zm3 4h10v2H7z" }, child: [] }] })(t);
|
|
128
|
+
}
|
|
129
|
+
function nt(t) {
|
|
130
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 19h16v2H4zm5-4h11v2H9zm-5-4h16v2H4zm0-8h16v2H4zm5 4h11v2H9z" }, child: [] }] })(t);
|
|
131
|
+
}
|
|
132
|
+
function st(t) {
|
|
133
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M17.061 11.22A4.46 4.46 0 0 0 18 8.5C18 6.019 15.981 4 13.5 4H6v15h8c2.481 0 4.5-2.019 4.5-4.5a4.48 4.48 0 0 0-1.439-3.28zM13.5 7c.827 0 1.5.673 1.5 1.5s-.673 1.5-1.5 1.5H9V7h4.5zm.5 9H9v-3h5c.827 0 1.5.673 1.5 1.5S14.827 16 14 16z" }, child: [] }] })(t);
|
|
134
|
+
}
|
|
135
|
+
function ot(t) {
|
|
136
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z" }, child: [] }] })(t);
|
|
137
|
+
}
|
|
138
|
+
function lt(t) {
|
|
139
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z" }, child: [] }] })(t);
|
|
140
|
+
}
|
|
141
|
+
function ct(t) {
|
|
142
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19 7V4H9v3h2.868L9.012 17H5v3h10v-3h-2.868l2.856-10z" }, child: [] }] })(t);
|
|
143
|
+
}
|
|
144
|
+
function dt(t) {
|
|
145
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M8.465 11.293c1.133-1.133 3.109-1.133 4.242 0l.707.707 1.414-1.414-.707-.707c-.943-.944-2.199-1.465-3.535-1.465s-2.592.521-3.535 1.465L4.929 12a5.008 5.008 0 0 0 0 7.071 4.983 4.983 0 0 0 3.535 1.462A4.982 4.982 0 0 0 12 19.071l.707-.707-1.414-1.414-.707.707a3.007 3.007 0 0 1-4.243 0 3.005 3.005 0 0 1 0-4.243l2.122-2.121z" }, child: [] }, { tag: "path", attr: { d: "m12 4.929-.707.707 1.414 1.414.707-.707a3.007 3.007 0 0 1 4.243 0 3.005 3.005 0 0 1 0 4.243l-2.122 2.121c-1.133 1.133-3.109 1.133-4.242 0L10.586 12l-1.414 1.414.707.707c.943.944 2.199 1.465 3.535 1.465s2.592-.521 3.535-1.465L19.071 12a5.008 5.008 0 0 0 0-7.071 5.006 5.006 0 0 0-7.071 0z" }, child: [] }] })(t);
|
|
146
|
+
}
|
|
147
|
+
function ut(t) {
|
|
148
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M5.282 12.064c-.428.328-.72.609-.875.851-.155.24-.249.498-.279.768h2.679v-.748H5.413c.081-.081.152-.151.212-.201.062-.05.182-.142.361-.27.303-.218.511-.42.626-.604.116-.186.173-.375.173-.578a.898.898 0 0 0-.151-.512.892.892 0 0 0-.412-.341c-.174-.076-.419-.111-.733-.111-.3 0-.537.038-.706.114a.889.889 0 0 0-.396.338c-.094.143-.159.346-.194.604l.894.076c.025-.188.074-.317.147-.394a.375.375 0 0 1 .279-.108c.11 0 .2.035.272.108a.344.344 0 0 1 .108.258.55.55 0 0 1-.108.297c-.074.102-.241.254-.503.453zm.055 6.386a.398.398 0 0 1-.282-.105c-.074-.07-.128-.195-.162-.378L4 18.085c.059.204.142.372.251.506.109.133.248.235.417.306.168.069.399.103.692.103.3 0 .541-.047.725-.14a1 1 0 0 0 .424-.403c.098-.175.146-.354.146-.544a.823.823 0 0 0-.088-.393.708.708 0 0 0-.249-.261 1.015 1.015 0 0 0-.286-.11.943.943 0 0 0 .345-.299.673.673 0 0 0 .113-.383.747.747 0 0 0-.281-.596c-.187-.159-.49-.238-.909-.238-.365 0-.648.072-.847.219-.2.143-.334.353-.404.626l.844.151c.023-.162.067-.274.133-.338s.151-.098.257-.098a.33.33 0 0 1 .241.089c.059.06.087.139.087.238 0 .104-.038.193-.117.27s-.177.112-.293.112a.907.907 0 0 1-.116-.011l-.045.649a1.13 1.13 0 0 1 .289-.056c.132 0 .237.041.313.126.077.082.115.199.115.352 0 .146-.04.266-.119.354a.394.394 0 0 1-.301.134zm.948-10.083V5h-.739a1.47 1.47 0 0 1-.394.523c-.168.142-.404.262-.708.365v.754a2.595 2.595 0 0 0 .937-.48v2.206h.904zM9 6h11v2H9zm0 5h11v2H9zm0 5h11v2H9z" }, child: [] }] })(t);
|
|
149
|
+
}
|
|
150
|
+
function ft(t) {
|
|
151
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 6h2v2H4zm0 5h2v2H4zm0 5h2v2H4zm16-8V6H8.023v2H18.8zM8 11h12v2H8zm0 5h12v2H8z" }, child: [] }] })(t);
|
|
152
|
+
}
|
|
153
|
+
function z(t) {
|
|
154
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(t);
|
|
155
|
+
}
|
|
156
|
+
function mt(t) {
|
|
157
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M20 11h-8c-4 0-4-1.816-4-2.5C8 7.882 8 6 12 6c2.8 0 2.99 1.678 3 2.014L16 8h1c0-1.384-1.045-4-5-4-5.416 0-6 3.147-6 4.5 0 .728.148 1.667.736 2.5H4v2h16v-2zm-8 7c-3.793 0-3.99-1.815-4-2H6c0 .04.069 4 6 4 5.221 0 6-2.819 6-4.5 0-.146-.009-.317-.028-.5h-2.006c.032.2.034.376.034.5 0 .684 0 2.5-4 2.5z" }, child: [] }] })(t);
|
|
158
|
+
}
|
|
159
|
+
function gt(t) {
|
|
160
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M5 18h14v2H5zM6 4v6c0 3.309 2.691 6 6 6s6-2.691 6-6V4h-2v6c0 2.206-1.794 4-4 4s-4-1.794-4-4V4H6z" }, child: [] }] })(t);
|
|
161
|
+
}
|
|
162
|
+
function ht(t) {
|
|
163
|
+
return n({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16.949 14.121 19.071 12a5.008 5.008 0 0 0 0-7.071 5.006 5.006 0 0 0-7.071 0l-.707.707 1.414 1.414.707-.707a3.007 3.007 0 0 1 4.243 0 3.005 3.005 0 0 1 0 4.243l-2.122 2.121a2.723 2.723 0 0 1-.844.57L13.414 12l1.414-1.414-.707-.707a4.965 4.965 0 0 0-3.535-1.465c-.235 0-.464.032-.691.066L3.707 2.293 2.293 3.707l18 18 1.414-1.414-5.536-5.536c.277-.184.538-.396.778-.636zm-6.363 3.536a3.007 3.007 0 0 1-4.243 0 3.005 3.005 0 0 1 0-4.243l1.476-1.475-1.414-1.414L4.929 12a5.008 5.008 0 0 0 0 7.071 4.983 4.983 0 0 0 3.535 1.462A4.982 4.982 0 0 0 12 19.071l.707-.707-1.414-1.414-.707.707z" }, child: [] }] })(t);
|
|
164
|
+
}
|
|
165
|
+
const vt = m.Root, I = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
166
|
+
m.List,
|
|
167
|
+
{
|
|
168
|
+
ref: a,
|
|
169
|
+
className: l(
|
|
170
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
171
|
+
t
|
|
172
|
+
),
|
|
173
|
+
...e
|
|
174
|
+
}
|
|
175
|
+
));
|
|
176
|
+
I.displayName = m.List.displayName;
|
|
177
|
+
const W = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
178
|
+
m.Trigger,
|
|
179
|
+
{
|
|
180
|
+
ref: a,
|
|
181
|
+
className: l(
|
|
182
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
183
|
+
t
|
|
184
|
+
),
|
|
185
|
+
"data-levo-studio-interactive": "true",
|
|
186
|
+
...e
|
|
187
|
+
}
|
|
188
|
+
));
|
|
189
|
+
W.displayName = m.Trigger.displayName;
|
|
190
|
+
const F = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
191
|
+
m.Content,
|
|
192
|
+
{
|
|
193
|
+
ref: a,
|
|
194
|
+
className: l(
|
|
195
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
196
|
+
t
|
|
197
|
+
),
|
|
198
|
+
...e
|
|
199
|
+
}
|
|
200
|
+
));
|
|
201
|
+
F.displayName = m.Content.displayName;
|
|
202
|
+
const U = L(
|
|
203
|
+
"inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
204
|
+
{
|
|
205
|
+
variants: {
|
|
206
|
+
variant: {
|
|
207
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
208
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
209
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
210
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
211
|
+
secondaryOutline: "bg-transparent border-[1px] border-solid border-white hover:bg-white hover:border-input",
|
|
212
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
213
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
214
|
+
},
|
|
215
|
+
size: {
|
|
216
|
+
default: "h-10 px-4 py-2",
|
|
217
|
+
xs: "h-8 px-3 text-xs",
|
|
218
|
+
sm: "h-9 px-3",
|
|
219
|
+
lg: "h-11 px-8",
|
|
220
|
+
icon: "h-10 w-10",
|
|
221
|
+
"icon-small": "h-8 w-8"
|
|
222
|
+
},
|
|
223
|
+
rounded: {
|
|
224
|
+
small: "rounded",
|
|
225
|
+
default: "rounded-md",
|
|
226
|
+
large: "rounded-lg",
|
|
227
|
+
full: "rounded-full"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
defaultVariants: {
|
|
231
|
+
variant: "default",
|
|
232
|
+
size: "default",
|
|
233
|
+
rounded: "default"
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
), G = u.forwardRef(
|
|
237
|
+
({
|
|
238
|
+
className: t,
|
|
239
|
+
variant: e,
|
|
240
|
+
size: a,
|
|
241
|
+
rounded: r,
|
|
242
|
+
asChild: s = !1,
|
|
243
|
+
isLoading: c = !1,
|
|
244
|
+
loadingText: g,
|
|
245
|
+
disabled: h,
|
|
246
|
+
...d
|
|
247
|
+
}, P) => {
|
|
248
|
+
const C = s ? D : "button";
|
|
249
|
+
return /* @__PURE__ */ i.jsx(
|
|
250
|
+
C,
|
|
251
|
+
{
|
|
252
|
+
className: l(U({ variant: e, size: a, rounded: r, className: t })),
|
|
253
|
+
ref: P,
|
|
254
|
+
disabled: h || c,
|
|
255
|
+
type: "button",
|
|
256
|
+
...d,
|
|
257
|
+
children: c ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
258
|
+
/* @__PURE__ */ i.jsx(
|
|
259
|
+
z,
|
|
260
|
+
{
|
|
261
|
+
className: M(
|
|
262
|
+
"h-4 w-4 animate-spin",
|
|
263
|
+
g ? "mr-2" : ""
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
g
|
|
268
|
+
] }) : d.children
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
);
|
|
273
|
+
G.displayName = "Button";
|
|
274
|
+
const q = o.Root, pt = o.Trigger, J = o.Portal, j = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
275
|
+
o.Overlay,
|
|
276
|
+
{
|
|
277
|
+
ref: a,
|
|
278
|
+
className: l(
|
|
279
|
+
"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
280
|
+
t
|
|
281
|
+
),
|
|
282
|
+
...e
|
|
283
|
+
}
|
|
284
|
+
));
|
|
285
|
+
j.displayName = o.Overlay.displayName;
|
|
286
|
+
const N = u.forwardRef(({ className: t, children: e, hideCloseButton: a, ...r }, s) => /* @__PURE__ */ i.jsxs(J, { children: [
|
|
287
|
+
/* @__PURE__ */ i.jsx(j, {}),
|
|
288
|
+
/* @__PURE__ */ i.jsxs(
|
|
289
|
+
o.Content,
|
|
290
|
+
{
|
|
291
|
+
ref: s,
|
|
292
|
+
className: l(
|
|
293
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
|
|
294
|
+
t
|
|
295
|
+
),
|
|
296
|
+
...r,
|
|
297
|
+
children: [
|
|
298
|
+
e,
|
|
299
|
+
!a && /* @__PURE__ */ i.jsxs(o.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
300
|
+
/* @__PURE__ */ i.jsx(R, { className: "h-4 w-4" }),
|
|
301
|
+
/* @__PURE__ */ i.jsx("span", { className: "sr-only", children: "Close" })
|
|
302
|
+
] })
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] }));
|
|
307
|
+
N.displayName = o.Content.displayName;
|
|
308
|
+
const H = ({
|
|
309
|
+
className: t,
|
|
310
|
+
...e
|
|
311
|
+
}) => /* @__PURE__ */ i.jsx(
|
|
312
|
+
"div",
|
|
313
|
+
{
|
|
314
|
+
className: l(
|
|
315
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
316
|
+
t
|
|
317
|
+
),
|
|
318
|
+
...e
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
H.displayName = "DialogHeader";
|
|
322
|
+
const K = ({
|
|
323
|
+
className: t,
|
|
324
|
+
...e
|
|
325
|
+
}) => /* @__PURE__ */ i.jsx(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
className: l(
|
|
329
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
330
|
+
t
|
|
331
|
+
),
|
|
332
|
+
...e
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
K.displayName = "DialogFooter";
|
|
336
|
+
const O = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
337
|
+
o.Title,
|
|
338
|
+
{
|
|
339
|
+
ref: a,
|
|
340
|
+
className: l(
|
|
341
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
342
|
+
t
|
|
343
|
+
),
|
|
344
|
+
...e
|
|
345
|
+
}
|
|
346
|
+
));
|
|
347
|
+
O.displayName = o.Title.displayName;
|
|
348
|
+
const B = u.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ i.jsx(
|
|
349
|
+
o.Description,
|
|
350
|
+
{
|
|
351
|
+
ref: a,
|
|
352
|
+
className: l("text-sm text-muted-foreground", t),
|
|
353
|
+
...e
|
|
354
|
+
}
|
|
355
|
+
));
|
|
356
|
+
B.displayName = o.Description.displayName;
|
|
357
|
+
const bt = ({
|
|
358
|
+
isOpen: t,
|
|
359
|
+
onClose: e,
|
|
360
|
+
children: a,
|
|
361
|
+
title: r,
|
|
362
|
+
contentClassName: s,
|
|
363
|
+
modal: c = !0
|
|
364
|
+
}) => /* @__PURE__ */ i.jsx(q, { open: t, onOpenChange: e, modal: c, children: /* @__PURE__ */ i.jsxs(N, { className: s, children: [
|
|
365
|
+
r && /* @__PURE__ */ i.jsxs(H, { className: "flex-1 font-medium", children: [
|
|
366
|
+
/* @__PURE__ */ i.jsx(O, { children: r }),
|
|
367
|
+
/* @__PURE__ */ i.jsx(B, {})
|
|
368
|
+
] }),
|
|
369
|
+
/* @__PURE__ */ i.jsx("div", { className: "w-full", children: a })
|
|
370
|
+
] }) }), xt = ({ className: t }) => /* @__PURE__ */ i.jsx(z, { className: l("h-8 w-8 animate-spin font-light", t) });
|
|
371
|
+
export {
|
|
372
|
+
ot as A,
|
|
373
|
+
G as B,
|
|
374
|
+
lt as C,
|
|
375
|
+
q as D,
|
|
376
|
+
n as G,
|
|
377
|
+
xt as S,
|
|
378
|
+
vt as T,
|
|
379
|
+
J as a,
|
|
380
|
+
U as b,
|
|
381
|
+
j as c,
|
|
382
|
+
pt as d,
|
|
383
|
+
N as e,
|
|
384
|
+
H as f,
|
|
385
|
+
K as g,
|
|
386
|
+
O as h,
|
|
387
|
+
B as i,
|
|
388
|
+
bt as j,
|
|
389
|
+
I as k,
|
|
390
|
+
W as l,
|
|
391
|
+
F as m,
|
|
392
|
+
z as n,
|
|
393
|
+
st as o,
|
|
394
|
+
ct as p,
|
|
395
|
+
gt as q,
|
|
396
|
+
mt as r,
|
|
397
|
+
ft as s,
|
|
398
|
+
ut as t,
|
|
399
|
+
dt as u,
|
|
400
|
+
ht as v,
|
|
401
|
+
rt as w,
|
|
402
|
+
it as x,
|
|
403
|
+
nt as y,
|
|
404
|
+
at as z
|
|
405
|
+
};
|
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { FormProvider as
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import { u as
|
|
8
|
-
import { B as
|
|
9
|
-
const
|
|
10
|
-
const [n,
|
|
11
|
-
|
|
3
|
+
import { useState as I, useMemo as y } from "react";
|
|
4
|
+
import { FormProvider as T } from "react-hook-form";
|
|
5
|
+
import { c as F } from "./cn-C9QoOYNG.js";
|
|
6
|
+
import { D as N, F as _ } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
7
|
+
import { u as C, S as H, F as M } from "./FormCaptcha-CJ9KgDu0.js";
|
|
8
|
+
import { B as g } from "./Spinner-Bzu2xCFZ.js";
|
|
9
|
+
const Y = () => {
|
|
10
|
+
const [n, a] = I(0), { containerStyles: m } = N(), l = () => {
|
|
11
|
+
a((o) => o - 1);
|
|
12
12
|
}, s = () => {
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
13
|
+
a((o) => o + 1);
|
|
14
|
+
}, c = (o) => {
|
|
15
|
+
a(o);
|
|
16
16
|
};
|
|
17
|
-
return /* @__PURE__ */ t.jsx("div", { className:
|
|
17
|
+
return /* @__PURE__ */ t.jsx("div", { className: F("w-full", m), children: /* @__PURE__ */ t.jsx(
|
|
18
18
|
q,
|
|
19
19
|
{
|
|
20
20
|
currentSectionIndex: n,
|
|
21
21
|
handleNext: s,
|
|
22
|
-
handlePrev:
|
|
23
|
-
goToIndex:
|
|
22
|
+
handlePrev: l,
|
|
23
|
+
goToIndex: c
|
|
24
24
|
}
|
|
25
25
|
) });
|
|
26
|
-
}, q = ({ currentSectionIndex: n, handleNext:
|
|
27
|
-
var
|
|
28
|
-
const { schema: s, isInternal:
|
|
26
|
+
}, q = ({ currentSectionIndex: n, handleNext: a, handlePrev: m, goToIndex: l }) => {
|
|
27
|
+
var h, j, v;
|
|
28
|
+
const { schema: s, isInternal: c, isDisabled: o, submitButtonConfig: i, uiConfig: d } = N(), r = y(
|
|
29
29
|
() => {
|
|
30
30
|
var e;
|
|
31
31
|
return (e = s == null ? void 0 : s.sections) == null ? void 0 : e[n];
|
|
32
32
|
},
|
|
33
33
|
[n]
|
|
34
|
-
),
|
|
34
|
+
), w = y(() => {
|
|
35
35
|
if (s) {
|
|
36
36
|
const e = { ...s };
|
|
37
37
|
return r && e && (e.sections = [r]), e;
|
|
38
38
|
}
|
|
39
39
|
return null;
|
|
40
|
-
}, [r]),
|
|
41
|
-
methods:
|
|
42
|
-
handleSubmit:
|
|
43
|
-
isLoading:
|
|
44
|
-
handleContentId:
|
|
40
|
+
}, [r]), x = n === Number((h = s == null ? void 0 : s.sections) == null ? void 0 : h.length) - 1, {
|
|
41
|
+
methods: u,
|
|
42
|
+
handleSubmit: E,
|
|
43
|
+
isLoading: L,
|
|
44
|
+
handleContentId: D,
|
|
45
45
|
isError: P,
|
|
46
|
-
allFormValues:
|
|
47
|
-
} =
|
|
48
|
-
schema:
|
|
49
|
-
saveToRemote:
|
|
46
|
+
allFormValues: V
|
|
47
|
+
} = C({
|
|
48
|
+
schema: w,
|
|
49
|
+
saveToRemote: x,
|
|
50
50
|
onSubmit: () => {
|
|
51
|
-
|
|
51
|
+
a();
|
|
52
52
|
},
|
|
53
53
|
onSubmitSuccess: () => {
|
|
54
|
-
|
|
54
|
+
l(0);
|
|
55
55
|
},
|
|
56
56
|
onSubmitError: (e) => {
|
|
57
57
|
var S;
|
|
58
58
|
if (Array.isArray(e) && (e != null && e[0])) {
|
|
59
59
|
const R = e == null ? void 0 : e[0];
|
|
60
|
-
(S = s == null ? void 0 : s.sections) == null || S.forEach((
|
|
60
|
+
(S = s == null ? void 0 : s.sections) == null || S.forEach((p, z) => {
|
|
61
61
|
var b;
|
|
62
|
-
((b =
|
|
62
|
+
((b = p == null ? void 0 : p.fields) == null ? void 0 : b.find((A) => A.key === R.param)) && l(z);
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}), {
|
|
67
|
-
formState: { isSubmitting:
|
|
68
|
-
} =
|
|
69
|
-
return /* @__PURE__ */ t.jsxs(
|
|
67
|
+
formState: { isSubmitting: k }
|
|
68
|
+
} = u, f = u.watch("__captcha");
|
|
69
|
+
return /* @__PURE__ */ t.jsxs(T, { ...u, children: [
|
|
70
70
|
/* @__PURE__ */ t.jsx(
|
|
71
|
-
|
|
71
|
+
H,
|
|
72
72
|
{
|
|
73
|
-
getContentId: (e) =>
|
|
73
|
+
getContentId: (e) => D(e),
|
|
74
74
|
isError: P,
|
|
75
|
-
currentValues:
|
|
75
|
+
currentValues: V
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
78
|
/* @__PURE__ */ t.jsxs(
|
|
79
79
|
"form",
|
|
80
80
|
{
|
|
81
|
-
className:
|
|
81
|
+
className: F(
|
|
82
82
|
"w-full bg-white rounded-md border border-[rgb(229, 231, 235)] min-h-12 px-4 md:px-8 py-6",
|
|
83
|
-
|
|
83
|
+
L && "opacity-50 pointer-events-none"
|
|
84
84
|
),
|
|
85
85
|
id: "collection-form",
|
|
86
|
-
onSubmit:
|
|
86
|
+
onSubmit: E,
|
|
87
87
|
children: [
|
|
88
|
-
!(
|
|
88
|
+
!(d != null && d.hideSectionHeadings) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
89
89
|
/* @__PURE__ */ t.jsx("p", { className: "text-xl font-medium", children: (r == null ? void 0 : r.label) || "Details" }),
|
|
90
90
|
/* @__PURE__ */ t.jsxs("p", { children: [
|
|
91
91
|
"Step ",
|
|
@@ -94,17 +94,20 @@ const X = () => {
|
|
|
94
94
|
((j = s == null ? void 0 : s.sections) == null ? void 0 : j.length) || 1
|
|
95
95
|
] })
|
|
96
96
|
] }),
|
|
97
|
-
/* @__PURE__ */ t.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
/* @__PURE__ */ t.jsxs("div", { className: "w-full flex flex-col gap-6", children: [
|
|
98
|
+
(v = r == null ? void 0 : r.fields) == null ? void 0 : v.map((e) => e && !e.hidden ? /* @__PURE__ */ t.jsx(
|
|
99
|
+
_,
|
|
100
|
+
{
|
|
101
|
+
field: e,
|
|
102
|
+
isInternal: c
|
|
103
|
+
},
|
|
104
|
+
e == null ? void 0 : e.key
|
|
105
|
+
) : null),
|
|
106
|
+
!c && x && /* @__PURE__ */ t.jsx(M, {})
|
|
107
|
+
] }),
|
|
105
108
|
/* @__PURE__ */ t.jsxs("div", { className: "flex mt-8 justify-between", children: [
|
|
106
109
|
n !== 0 ? /* @__PURE__ */ t.jsx(
|
|
107
|
-
|
|
110
|
+
g,
|
|
108
111
|
{
|
|
109
112
|
type: "button",
|
|
110
113
|
size: "sm",
|
|
@@ -115,15 +118,15 @@ const X = () => {
|
|
|
115
118
|
}
|
|
116
119
|
) : /* @__PURE__ */ t.jsx("div", {}),
|
|
117
120
|
/* @__PURE__ */ t.jsx(
|
|
118
|
-
|
|
121
|
+
g,
|
|
119
122
|
{
|
|
120
123
|
type: "submit",
|
|
121
124
|
loadingText: "Saving",
|
|
122
125
|
size: "sm",
|
|
123
|
-
isLoading:
|
|
126
|
+
isLoading: k || f === "verifying",
|
|
124
127
|
disabled: o,
|
|
125
128
|
className: i == null ? void 0 : i.styles,
|
|
126
|
-
children:
|
|
129
|
+
children: x ? f === "verifying" ? "Verifying..." : (i == null ? void 0 : i.text) || "Save" : "Next"
|
|
127
130
|
}
|
|
128
131
|
)
|
|
129
132
|
] })
|
|
@@ -133,5 +136,5 @@ const X = () => {
|
|
|
133
136
|
] });
|
|
134
137
|
};
|
|
135
138
|
export {
|
|
136
|
-
|
|
139
|
+
Y as default
|
|
137
140
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
3
|
import { useController as k } from "react-hook-form";
|
|
4
|
-
import {
|
|
4
|
+
import { z as w, A as j, B as v } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
5
5
|
import * as c from "@radix-ui/react-switch";
|
|
6
6
|
import * as y from "react";
|
|
7
7
|
import { c as d } from "./cn-C9QoOYNG.js";
|
|
@@ -27,20 +27,20 @@ const m = y.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ r.jsx(
|
|
|
27
27
|
m.displayName = c.Root.displayName;
|
|
28
28
|
const C = ({ field: e }) => {
|
|
29
29
|
var l;
|
|
30
|
-
const { key: t = "", label: s = "", helper_text: u = "", readonly:
|
|
31
|
-
field: { value:
|
|
30
|
+
const { key: t = "", label: s = "", helper_text: u = "", readonly: p = !1 } = e, o = t, {
|
|
31
|
+
field: { value: h, onBlur: a, onChange: i, ...b },
|
|
32
32
|
fieldState: n
|
|
33
33
|
} = k({
|
|
34
34
|
name: o,
|
|
35
35
|
rules: w(e)
|
|
36
36
|
}), f = !!(e != null && e.required), x = (l = n == null ? void 0 : n.error) == null ? void 0 : l.message;
|
|
37
|
-
return /* @__PURE__ */ r.jsx(j, { error: x, helperText: u, readOnly:
|
|
37
|
+
return /* @__PURE__ */ r.jsx(j, { error: x, helperText: u, readOnly: p, children: /* @__PURE__ */ r.jsxs("div", { className: "w-full flex items-center justify-between max-w-[300px]", children: [
|
|
38
38
|
s && /* @__PURE__ */ r.jsx(v, { htmlFor: o, isRequired: f, className: "!mb-0", children: s }),
|
|
39
39
|
/* @__PURE__ */ r.jsx(
|
|
40
40
|
m,
|
|
41
41
|
{
|
|
42
42
|
id: o,
|
|
43
|
-
checked:
|
|
43
|
+
checked: h,
|
|
44
44
|
onCheckedChange: (g) => i == null ? void 0 : i(g),
|
|
45
45
|
onBlur: () => a == null ? void 0 : a(),
|
|
46
46
|
...b
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { useFormContext as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
2
|
+
import { useFormContext as g, get as h } from "react-hook-form";
|
|
3
|
+
import { c as j } from "./cn-C9QoOYNG.js";
|
|
4
|
+
import { A as F, B as b, z as y } from "./CollectionFormBuilder-MAo2Ob3a.js";
|
|
5
5
|
import { I as f } from "./Input-2CvZ90f8.js";
|
|
6
|
-
const
|
|
6
|
+
const k = ({
|
|
7
7
|
field: r,
|
|
8
8
|
inputStyles: a,
|
|
9
9
|
...m
|
|
@@ -12,14 +12,14 @@ const W = ({
|
|
|
12
12
|
const {
|
|
13
13
|
register: n,
|
|
14
14
|
formState: { errors: i, disabled: p }
|
|
15
|
-
} =
|
|
15
|
+
} = g(), { key: c = "", label: s = "", helper_text: l = "", readonly: x = !1 } = r, e = c, d = !!(r != null && r.required), u = (o = h(i, e)) == null ? void 0 : o.message;
|
|
16
16
|
return /* @__PURE__ */ t.jsxs(F, { error: u, helperText: l, children: [
|
|
17
17
|
s && /* @__PURE__ */ t.jsx(b, { htmlFor: e, isRequired: d, children: s }),
|
|
18
18
|
/* @__PURE__ */ t.jsx(
|
|
19
19
|
f,
|
|
20
20
|
{
|
|
21
21
|
id: e,
|
|
22
|
-
className:
|
|
22
|
+
className: j(a),
|
|
23
23
|
readOnly: x,
|
|
24
24
|
disabled: p,
|
|
25
25
|
...n(e, { ...y(r) }),
|
|
@@ -29,5 +29,5 @@ const W = ({
|
|
|
29
29
|
] });
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
k as default
|
|
33
33
|
};
|