@levo-so/react 0.0.1-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 -0
- 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 +96 -16
- /package/dist/audience/{useScrollDepth.d.ts → components/useScrollDepth.d.ts} +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useState as A, useMemo as v } from "react";
|
|
4
|
+
import { FormProvider as I } from "react-hook-form";
|
|
5
|
+
import { m as N, F as T } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
6
|
+
import { u as H, S as M } from "./useLevoForm-CR3q-L5Z.js";
|
|
7
|
+
import { c as g } from "./cn-C9QoOYNG.js";
|
|
8
|
+
import { B as y } from "./Spinner-CuUosd-S.js";
|
|
9
|
+
const X = () => {
|
|
10
|
+
const [n, l] = A(0), { containerStyles: m } = N(), a = () => {
|
|
11
|
+
l((o) => o - 1);
|
|
12
|
+
}, s = () => {
|
|
13
|
+
l((o) => o + 1);
|
|
14
|
+
}, d = (o) => {
|
|
15
|
+
l(o);
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ t.jsx("div", { className: g("w-full", m), children: /* @__PURE__ */ t.jsx(
|
|
18
|
+
q,
|
|
19
|
+
{
|
|
20
|
+
currentSectionIndex: n,
|
|
21
|
+
handleNext: s,
|
|
22
|
+
handlePrev: a,
|
|
23
|
+
goToIndex: d
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}, q = ({ currentSectionIndex: n, handleNext: l, handlePrev: m, goToIndex: a }) => {
|
|
27
|
+
var f, j, h;
|
|
28
|
+
const { schema: s, isInternal: d, isDisabled: o, submitButtonConfig: i, uiConfig: c } = N(), r = v(
|
|
29
|
+
() => {
|
|
30
|
+
var e;
|
|
31
|
+
return (e = s == null ? void 0 : s.sections) == null ? void 0 : e[n];
|
|
32
|
+
},
|
|
33
|
+
[n]
|
|
34
|
+
), F = v(() => {
|
|
35
|
+
if (s) {
|
|
36
|
+
const e = { ...s };
|
|
37
|
+
return r && e && (e.sections = [r]), e;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}, [r]), u = n === Number((f = s == null ? void 0 : s.sections) == null ? void 0 : f.length) - 1, {
|
|
41
|
+
methods: p,
|
|
42
|
+
handleSubmit: w,
|
|
43
|
+
isLoading: E,
|
|
44
|
+
handleContentId: L,
|
|
45
|
+
isError: P,
|
|
46
|
+
allFormValues: k
|
|
47
|
+
} = H({
|
|
48
|
+
schema: F,
|
|
49
|
+
saveToRemote: u,
|
|
50
|
+
onSubmit: () => {
|
|
51
|
+
l();
|
|
52
|
+
},
|
|
53
|
+
onSubmitSuccess: () => {
|
|
54
|
+
a(0);
|
|
55
|
+
},
|
|
56
|
+
onSubmitError: (e) => {
|
|
57
|
+
var S;
|
|
58
|
+
if (Array.isArray(e) && (e != null && e[0])) {
|
|
59
|
+
const R = e == null ? void 0 : e[0];
|
|
60
|
+
(S = s == null ? void 0 : s.sections) == null || S.forEach((x, V) => {
|
|
61
|
+
var b;
|
|
62
|
+
((b = x == null ? void 0 : x.fields) == null ? void 0 : b.find((z) => z.key === R.param)) && a(V);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}), {
|
|
67
|
+
formState: { isSubmitting: D }
|
|
68
|
+
} = p;
|
|
69
|
+
return /* @__PURE__ */ t.jsxs(I, { ...p, children: [
|
|
70
|
+
/* @__PURE__ */ t.jsx(
|
|
71
|
+
M,
|
|
72
|
+
{
|
|
73
|
+
getContentId: (e) => L(e),
|
|
74
|
+
isError: P,
|
|
75
|
+
currentValues: k
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ t.jsxs(
|
|
79
|
+
"form",
|
|
80
|
+
{
|
|
81
|
+
className: g(
|
|
82
|
+
"w-full bg-white rounded-md border border-[rgb(229, 231, 235)] min-h-12 px-4 md:px-8 py-6",
|
|
83
|
+
E && "opacity-50 pointer-events-none"
|
|
84
|
+
),
|
|
85
|
+
id: "collection-form",
|
|
86
|
+
onSubmit: w,
|
|
87
|
+
children: [
|
|
88
|
+
!(c != null && c.hideSectionHeadings) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
89
|
+
/* @__PURE__ */ t.jsx("p", { className: "text-xl font-medium", children: (r == null ? void 0 : r.label) || "Details" }),
|
|
90
|
+
/* @__PURE__ */ t.jsxs("p", { children: [
|
|
91
|
+
"Step ",
|
|
92
|
+
n + 1,
|
|
93
|
+
"/",
|
|
94
|
+
((j = s == null ? void 0 : s.sections) == null ? void 0 : j.length) || 1
|
|
95
|
+
] })
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ t.jsx("div", { className: "w-full flex flex-col gap-6", children: (h = r == null ? void 0 : r.fields) == null ? void 0 : h.map((e) => e && !e.hidden ? /* @__PURE__ */ t.jsx(
|
|
98
|
+
T,
|
|
99
|
+
{
|
|
100
|
+
field: e,
|
|
101
|
+
isInternal: d
|
|
102
|
+
},
|
|
103
|
+
e == null ? void 0 : e.key
|
|
104
|
+
) : null) }),
|
|
105
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex mt-8 justify-between", children: [
|
|
106
|
+
n !== 0 ? /* @__PURE__ */ t.jsx(
|
|
107
|
+
y,
|
|
108
|
+
{
|
|
109
|
+
type: "button",
|
|
110
|
+
size: "sm",
|
|
111
|
+
onClick: () => {
|
|
112
|
+
m();
|
|
113
|
+
},
|
|
114
|
+
children: "Prev"
|
|
115
|
+
}
|
|
116
|
+
) : /* @__PURE__ */ t.jsx("div", {}),
|
|
117
|
+
/* @__PURE__ */ t.jsx(
|
|
118
|
+
y,
|
|
119
|
+
{
|
|
120
|
+
type: "submit",
|
|
121
|
+
loadingText: "Saving",
|
|
122
|
+
size: "sm",
|
|
123
|
+
isLoading: D,
|
|
124
|
+
disabled: o,
|
|
125
|
+
className: i == null ? void 0 : i.styles,
|
|
126
|
+
children: u ? (i == null ? void 0 : i.text) ?? "Save" : "Next"
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] });
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
X as default
|
|
137
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useController as k } from "react-hook-form";
|
|
4
|
+
import { h as w, j, k as v } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
5
|
+
import * as c from "@radix-ui/react-switch";
|
|
6
|
+
import * as y from "react";
|
|
7
|
+
import { c as d } from "./cn-C9QoOYNG.js";
|
|
8
|
+
const m = y.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ r.jsx(
|
|
9
|
+
c.Root,
|
|
10
|
+
{
|
|
11
|
+
className: d(
|
|
12
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
13
|
+
e
|
|
14
|
+
),
|
|
15
|
+
...t,
|
|
16
|
+
ref: s,
|
|
17
|
+
children: /* @__PURE__ */ r.jsx(
|
|
18
|
+
c.Thumb,
|
|
19
|
+
{
|
|
20
|
+
className: d(
|
|
21
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
m.displayName = c.Root.displayName;
|
|
28
|
+
const C = ({ field: e }) => {
|
|
29
|
+
var l;
|
|
30
|
+
const { key: t = "", label: s = "", helper_text: u = "", readonly: h = !1 } = e, o = t, {
|
|
31
|
+
field: { value: p, onBlur: a, onChange: i, ...b },
|
|
32
|
+
fieldState: n
|
|
33
|
+
} = k({
|
|
34
|
+
name: o,
|
|
35
|
+
rules: w(e)
|
|
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: h, children: /* @__PURE__ */ r.jsxs("div", { className: "w-full flex items-center justify-between max-w-[300px]", children: [
|
|
38
|
+
s && /* @__PURE__ */ r.jsx(v, { htmlFor: o, isRequired: f, className: "!mb-0", children: s }),
|
|
39
|
+
/* @__PURE__ */ r.jsx(
|
|
40
|
+
m,
|
|
41
|
+
{
|
|
42
|
+
id: o,
|
|
43
|
+
checked: p,
|
|
44
|
+
onCheckedChange: (g) => i == null ? void 0 : i(g),
|
|
45
|
+
onBlur: () => a == null ? void 0 : a(),
|
|
46
|
+
...b
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] }) });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
C as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useFormContext as j, get as h } from "react-hook-form";
|
|
4
|
+
import { j as F, k as b, l as f } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
5
|
+
import { I as y } from "./Input-2CvZ90f8.js";
|
|
6
|
+
import { c as R } from "./cn-C9QoOYNG.js";
|
|
7
|
+
const T = ({
|
|
8
|
+
field: e,
|
|
9
|
+
inputStyles: a,
|
|
10
|
+
...m
|
|
11
|
+
}) => {
|
|
12
|
+
var o;
|
|
13
|
+
const {
|
|
14
|
+
register: n,
|
|
15
|
+
formState: { errors: i, disabled: c }
|
|
16
|
+
} = j(), { key: p = "", label: s = "", helper_text: l = "", readonly: x = !1 } = e, r = p, d = !!(e != null && e.required), u = (o = h(i, r)) == null ? void 0 : o.message;
|
|
17
|
+
return /* @__PURE__ */ t.jsxs(F, { error: u, helperText: l, children: [
|
|
18
|
+
s && /* @__PURE__ */ t.jsx(b, { htmlFor: r, isRequired: d, children: s }),
|
|
19
|
+
/* @__PURE__ */ t.jsx(
|
|
20
|
+
y,
|
|
21
|
+
{
|
|
22
|
+
id: r,
|
|
23
|
+
className: R(a),
|
|
24
|
+
readOnly: x,
|
|
25
|
+
disabled: c,
|
|
26
|
+
...n(r, { ...f(e) }),
|
|
27
|
+
...m
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
31
|
+
}, E = g.memo(T);
|
|
32
|
+
export {
|
|
33
|
+
E as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import { useFormContext as u, get as x } from "react-hook-form";
|
|
3
|
+
import { j as b, k as g, h } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
4
|
+
import { c as f } from "./cn-C9QoOYNG.js";
|
|
5
|
+
const w = ({ field: e }) => {
|
|
6
|
+
var a;
|
|
7
|
+
const {
|
|
8
|
+
register: i,
|
|
9
|
+
formState: { errors: n, disabled: l }
|
|
10
|
+
} = u(), { key: d = "", label: o = "", helper_text: m = "", readonly: t = !1 } = e, r = d, c = !!(e != null && e.required), p = (a = x(n, r)) == null ? void 0 : a.message;
|
|
11
|
+
return /* @__PURE__ */ s.jsxs(b, { error: p, helperText: m, children: [
|
|
12
|
+
o && /* @__PURE__ */ s.jsx(g, { htmlFor: r, isRequired: c, children: o }),
|
|
13
|
+
/* @__PURE__ */ s.jsx(
|
|
14
|
+
"textarea",
|
|
15
|
+
{
|
|
16
|
+
id: r,
|
|
17
|
+
className: f(
|
|
18
|
+
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
19
|
+
t && "focus-visible:ring-0"
|
|
20
|
+
),
|
|
21
|
+
readOnly: t,
|
|
22
|
+
disabled: l,
|
|
23
|
+
...i(r, h(e))
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
w as default
|
|
30
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as r } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useController as p } from "react-hook-form";
|
|
4
|
+
import { h as u, j as g, k as j } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
5
|
+
import { C } from "./Checbox-sq-atGlJ.js";
|
|
6
|
+
const y = ({
|
|
7
|
+
field: e
|
|
8
|
+
}) => {
|
|
9
|
+
const { key: l = "", label: o = "", helper_text: t = "", readonly: n = !1 } = e, {
|
|
10
|
+
field: { name: s, onBlur: i, onChange: m, ref: d, value: c, disabled: h },
|
|
11
|
+
fieldState: { error: a }
|
|
12
|
+
} = p({
|
|
13
|
+
name: l,
|
|
14
|
+
rules: u(e)
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ r.jsx(
|
|
17
|
+
g,
|
|
18
|
+
{
|
|
19
|
+
error: a == null ? void 0 : a.message,
|
|
20
|
+
helperText: t,
|
|
21
|
+
readOnly: n,
|
|
22
|
+
children: /* @__PURE__ */ r.jsxs("div", { className: "w-full flex gap-2 items-start flex-nowrap", ref: d, children: [
|
|
23
|
+
/* @__PURE__ */ r.jsx(
|
|
24
|
+
C,
|
|
25
|
+
{
|
|
26
|
+
id: s,
|
|
27
|
+
name: s,
|
|
28
|
+
checked: c,
|
|
29
|
+
onCheckedChange: (x) => m(x),
|
|
30
|
+
onBlur: () => {
|
|
31
|
+
i();
|
|
32
|
+
},
|
|
33
|
+
disabled: h
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
o && /* @__PURE__ */ r.jsx(j, { htmlFor: s, isRequired: e == null ? void 0 : e.required, children: o })
|
|
37
|
+
] })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
y as ToggleCheckboxWidget,
|
|
43
|
+
y as default
|
|
44
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as a } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import * as s from "@radix-ui/react-dialog";
|
|
4
|
+
import { X as N } from "lucide-react";
|
|
5
|
+
import * as n from "react";
|
|
6
|
+
import { c as l } from "./cn-C9QoOYNG.js";
|
|
7
|
+
import * as d from "@radix-ui/react-tooltip";
|
|
8
|
+
const j = s.Root, C = s.Trigger, y = s.Portal, m = n.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ a.jsx(
|
|
9
|
+
s.Overlay,
|
|
10
|
+
{
|
|
11
|
+
ref: o,
|
|
12
|
+
className: l(
|
|
13
|
+
"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",
|
|
14
|
+
t
|
|
15
|
+
),
|
|
16
|
+
...e
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
m.displayName = s.Overlay.displayName;
|
|
20
|
+
const c = n.forwardRef(({ className: t, children: e, hideCloseButton: o, ...i }, r) => /* @__PURE__ */ a.jsxs(y, { children: [
|
|
21
|
+
/* @__PURE__ */ a.jsx(m, {}),
|
|
22
|
+
/* @__PURE__ */ a.jsxs(
|
|
23
|
+
s.Content,
|
|
24
|
+
{
|
|
25
|
+
ref: r,
|
|
26
|
+
className: l(
|
|
27
|
+
"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",
|
|
28
|
+
t
|
|
29
|
+
),
|
|
30
|
+
...i,
|
|
31
|
+
children: [
|
|
32
|
+
e,
|
|
33
|
+
!o && /* @__PURE__ */ a.jsxs(s.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: [
|
|
34
|
+
/* @__PURE__ */ a.jsx(N, { className: "h-4 w-4" }),
|
|
35
|
+
/* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
|
|
36
|
+
] })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }));
|
|
41
|
+
c.displayName = s.Content.displayName;
|
|
42
|
+
const p = ({
|
|
43
|
+
className: t,
|
|
44
|
+
...e
|
|
45
|
+
}) => /* @__PURE__ */ a.jsx(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
className: l(
|
|
49
|
+
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
50
|
+
t
|
|
51
|
+
),
|
|
52
|
+
...e
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
p.displayName = "DialogHeader";
|
|
56
|
+
const h = ({
|
|
57
|
+
className: t,
|
|
58
|
+
...e
|
|
59
|
+
}) => /* @__PURE__ */ a.jsx(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: l(
|
|
63
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
64
|
+
t
|
|
65
|
+
),
|
|
66
|
+
...e
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
h.displayName = "DialogFooter";
|
|
70
|
+
const f = n.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ a.jsx(
|
|
71
|
+
s.Title,
|
|
72
|
+
{
|
|
73
|
+
ref: o,
|
|
74
|
+
className: l(
|
|
75
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
76
|
+
t
|
|
77
|
+
),
|
|
78
|
+
...e
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
f.displayName = s.Title.displayName;
|
|
82
|
+
const g = n.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ a.jsx(
|
|
83
|
+
s.Description,
|
|
84
|
+
{
|
|
85
|
+
ref: o,
|
|
86
|
+
className: l("text-sm text-muted-foreground", t),
|
|
87
|
+
...e
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
g.displayName = s.Description.displayName;
|
|
91
|
+
const R = ({
|
|
92
|
+
isOpen: t,
|
|
93
|
+
onClose: e,
|
|
94
|
+
children: o,
|
|
95
|
+
title: i,
|
|
96
|
+
contentClassName: r,
|
|
97
|
+
modal: u = !0
|
|
98
|
+
}) => /* @__PURE__ */ a.jsx(j, { open: t, onOpenChange: e, modal: u, children: /* @__PURE__ */ a.jsxs(c, { className: r, children: [
|
|
99
|
+
i && /* @__PURE__ */ a.jsxs(p, { className: "flex-1 font-medium", children: [
|
|
100
|
+
/* @__PURE__ */ a.jsx(f, { children: i }),
|
|
101
|
+
/* @__PURE__ */ a.jsx(g, {})
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ a.jsx("div", { className: "w-full", children: o })
|
|
104
|
+
] }) }), P = d.Provider, D = d.Root, b = d.Trigger, z = d.Portal, x = n.forwardRef(({ className: t, sideOffset: e = 4, ...o }, i) => /* @__PURE__ */ a.jsx(
|
|
105
|
+
d.Content,
|
|
106
|
+
{
|
|
107
|
+
ref: i,
|
|
108
|
+
sideOffset: e,
|
|
109
|
+
className: l(
|
|
110
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
111
|
+
t
|
|
112
|
+
),
|
|
113
|
+
...o
|
|
114
|
+
}
|
|
115
|
+
));
|
|
116
|
+
x.displayName = d.Content.displayName;
|
|
117
|
+
const k = ({
|
|
118
|
+
children: t,
|
|
119
|
+
label: e,
|
|
120
|
+
labelClassName: o,
|
|
121
|
+
contentClassName: i,
|
|
122
|
+
asChild: r = !0
|
|
123
|
+
}) => /* @__PURE__ */ a.jsxs(D, { children: [
|
|
124
|
+
e && /* @__PURE__ */ a.jsx(x, { className: o, children: /* @__PURE__ */ a.jsx("p", { className: i, children: e }) }),
|
|
125
|
+
/* @__PURE__ */ a.jsx(b, { asChild: r, children: t })
|
|
126
|
+
] });
|
|
127
|
+
export {
|
|
128
|
+
j as D,
|
|
129
|
+
k as S,
|
|
130
|
+
D as T,
|
|
131
|
+
y as a,
|
|
132
|
+
m as b,
|
|
133
|
+
C as c,
|
|
134
|
+
c as d,
|
|
135
|
+
p as e,
|
|
136
|
+
h as f,
|
|
137
|
+
f as g,
|
|
138
|
+
g as h,
|
|
139
|
+
R as i,
|
|
140
|
+
b as j,
|
|
141
|
+
x as k,
|
|
142
|
+
P as l,
|
|
143
|
+
z as m
|
|
144
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import { H as s } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
3
|
+
import r from "./TextWidget-BtZp3DRk.js";
|
|
4
|
+
const a = (t) => /* @__PURE__ */ e.jsx(
|
|
5
|
+
r,
|
|
6
|
+
{
|
|
7
|
+
leftIcon: /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex items-center justify-center bg-muted", children: /* @__PURE__ */ e.jsx(s, { size: "20px", className: "text-muted-foreground" }) }),
|
|
8
|
+
...t
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
export {
|
|
12
|
+
a as URLWidget,
|
|
13
|
+
a as default
|
|
14
|
+
};
|