fina-react-ds 1.0.37 → 1.0.39
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/components/calendar.js +11 -12
- package/dist/components/data-loader.js +1 -1
- package/dist/components/date-picker.js +28 -28
- package/dist/components/file-uploader.js +46 -47
- package/dist/components/form-file-uploader.d.ts +2 -1
- package/dist/components/form-file-uploader.js +18 -16
- package/dist/components/form-image-uploader.d.ts +2 -1
- package/dist/components/form-image-uploader.js +23 -14
- package/dist/components/form-input.d.ts +2 -1
- package/dist/components/form-input.js +22 -20
- package/dist/components/form-select.d.ts +2 -1
- package/dist/components/form-select.js +31 -29
- package/dist/components/form-textarea.d.ts +2 -1
- package/dist/components/form-textarea.js +22 -20
- package/dist/components/form.js +14 -14
- package/dist/components/html-input.d.ts +1 -0
- package/dist/components/image-uploader.js +53 -54
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.js +200 -0
- package/dist/components/select.js +39 -39
- package/dist/components/sidebar.js +49 -49
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/index.js +27 -0
- package/package.json +49 -36
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -21
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -36
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -18
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -72
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -33
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -13
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/localize.js +0 -123
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/match.js +0 -112
- package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js +0 -21
- package/dist/themes/base.css +0 -3396
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
2
|
var d = (l, s) => w(l, "name", { value: s, configurable: !0 });
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import * as
|
|
4
|
+
import * as g from "react";
|
|
5
5
|
import { ChevronLeftIcon as h, ChevronRightIcon as y, ChevronDownIcon as _ } from "lucide-react";
|
|
6
|
-
import { getDefaultClassNames as
|
|
6
|
+
import { getDefaultClassNames as p, DayPicker as v } from "react-day-picker";
|
|
7
7
|
import { cn as e } from "../lib/utils.js";
|
|
8
|
-
import { buttonVariants as
|
|
8
|
+
import { buttonVariants as f, Button as z } from "./button.js";
|
|
9
9
|
import { fr as k } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
|
|
10
10
|
function q({
|
|
11
11
|
className: l,
|
|
@@ -14,10 +14,10 @@ function q({
|
|
|
14
14
|
captionLayout: c = "label",
|
|
15
15
|
buttonVariant: i = "ghost",
|
|
16
16
|
formatters: m,
|
|
17
|
-
components:
|
|
17
|
+
components: x,
|
|
18
18
|
...b
|
|
19
19
|
}) {
|
|
20
|
-
const t =
|
|
20
|
+
const t = p();
|
|
21
21
|
return /* @__PURE__ */ n(
|
|
22
22
|
v,
|
|
23
23
|
{
|
|
@@ -49,7 +49,7 @@ function q({
|
|
|
49
49
|
t.nav
|
|
50
50
|
),
|
|
51
51
|
button_previous: e(
|
|
52
|
-
|
|
52
|
+
f({
|
|
53
53
|
variant: i,
|
|
54
54
|
color: "dark",
|
|
55
55
|
size: "icon"
|
|
@@ -58,7 +58,7 @@ function q({
|
|
|
58
58
|
t.button_previous
|
|
59
59
|
),
|
|
60
60
|
button_next: e(
|
|
61
|
-
|
|
61
|
+
f({
|
|
62
62
|
variant: i,
|
|
63
63
|
color: "dark",
|
|
64
64
|
size: "icon"
|
|
@@ -161,7 +161,7 @@ function q({
|
|
|
161
161
|
), "Chevron"),
|
|
162
162
|
DayButton: N,
|
|
163
163
|
WeekNumber: /* @__PURE__ */ d(({ children: a, ...o }) => /* @__PURE__ */ n("td", { ...o, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }), "WeekNumber"),
|
|
164
|
-
...
|
|
164
|
+
...x
|
|
165
165
|
},
|
|
166
166
|
...b
|
|
167
167
|
}
|
|
@@ -174,10 +174,9 @@ function N({
|
|
|
174
174
|
modifiers: r,
|
|
175
175
|
...c
|
|
176
176
|
}) {
|
|
177
|
-
const i =
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
r.focused && ((g = m.current) == null || g.focus());
|
|
177
|
+
const i = p(), m = g.useRef(null);
|
|
178
|
+
return g.useEffect(() => {
|
|
179
|
+
r.focused && m.current?.focus();
|
|
181
180
|
}, [r.focused]), /* @__PURE__ */ n(
|
|
182
181
|
z,
|
|
183
182
|
{
|
|
@@ -10,7 +10,7 @@ function j({
|
|
|
10
10
|
children: n
|
|
11
11
|
}) {
|
|
12
12
|
const a = /* @__PURE__ */ s((e) => {
|
|
13
|
-
c
|
|
13
|
+
c ||= e.isPending || e.isRefetching, o ||= e.isError || e.isRefetchError;
|
|
14
14
|
}, "checkQuery");
|
|
15
15
|
let c = !1, o = !1;
|
|
16
16
|
return t && Array.isArray(t) && t.forEach((e) => a(e)), c ? /* @__PURE__ */ r("div", { className: "min-h-[90px]", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-center text-gray-500", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-center flex-col", children: [
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
var p = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
2
|
+
var o = (i, t) => p(i, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import * as f from "react";
|
|
5
5
|
import { Calendar as u } from "lucide-react";
|
|
6
|
-
import { Calendar as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Button as
|
|
9
|
-
import { format as
|
|
10
|
-
import { fr as
|
|
11
|
-
function
|
|
12
|
-
placeholder:
|
|
13
|
-
onChange:
|
|
6
|
+
import { Calendar as h } from "./calendar.js";
|
|
7
|
+
import { Popover as g, PopoverTrigger as x, PopoverContent as b } from "./popover.js";
|
|
8
|
+
import { Button as v } from "./button.js";
|
|
9
|
+
import { format as C } from "date-fns";
|
|
10
|
+
import { fr as P } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
|
|
11
|
+
function z({
|
|
12
|
+
placeholder: i = "Choisir une date",
|
|
13
|
+
onChange: t,
|
|
14
14
|
value: e,
|
|
15
|
-
isClearable:
|
|
16
|
-
...
|
|
15
|
+
isClearable: s = !1,
|
|
16
|
+
...d
|
|
17
17
|
}) {
|
|
18
|
-
const [
|
|
19
|
-
|
|
18
|
+
const [l, n] = f.useState(!1), c = /* @__PURE__ */ o((m) => {
|
|
19
|
+
t?.(m || null), n(!1);
|
|
20
20
|
}, "onSelect");
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ a(g, { onOpenChange: n, open: l, children: [
|
|
22
|
+
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ a(
|
|
23
23
|
"button",
|
|
24
24
|
{
|
|
25
25
|
"data-empty": !e,
|
|
26
|
-
...
|
|
26
|
+
...d,
|
|
27
27
|
className: "border-input-border flex items-center h-9 w-full min-w-0 rounded-md border bg-input px-3 py-1 text-base shadow-xs focus-visible:border-ring ring-ring/50 focus-visible:ring-[3px] data-[state=open]:ring-[3px] data-[state=open]:border-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive! outline-none md:text-sm",
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
e ? /* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ r(u, { className: "mr-2 size-4" }),
|
|
30
|
+
e ? /* @__PURE__ */ r("span", { children: C(e, "PPP", { locale: P }) }) : /* @__PURE__ */ r("span", { className: "text-placeholder", children: i })
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
) }),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
34
|
+
/* @__PURE__ */ a(b, { align: "start", className: "w-auto p-0", children: [
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
h,
|
|
37
37
|
{
|
|
38
38
|
mode: "single",
|
|
39
39
|
required: !0,
|
|
@@ -43,14 +43,14 @@ function B({
|
|
|
43
43
|
captionLayout: "dropdown"
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
e &&
|
|
47
|
-
|
|
46
|
+
e && s && /* @__PURE__ */ r("div", { className: "flex justify-center border-t", children: /* @__PURE__ */ r(
|
|
47
|
+
v,
|
|
48
48
|
{
|
|
49
49
|
variant: "ghost",
|
|
50
50
|
color: "dark",
|
|
51
51
|
className: "flex w-full",
|
|
52
|
-
onClick: /* @__PURE__ */
|
|
53
|
-
|
|
52
|
+
onClick: /* @__PURE__ */ o(() => {
|
|
53
|
+
t?.(null), n(!1);
|
|
54
54
|
}, "onClick"),
|
|
55
55
|
children: "Effacer"
|
|
56
56
|
}
|
|
@@ -58,7 +58,7 @@ function B({
|
|
|
58
58
|
] })
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
o(z, "DatePicker");
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
z as DatePicker
|
|
64
64
|
};
|
|
@@ -1,109 +1,108 @@
|
|
|
1
1
|
var F = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useState as j, useImperativeHandle as k, useCallback as
|
|
5
|
-
import { FileIcon as
|
|
6
|
-
import { useDropzone as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Button as
|
|
9
|
-
function
|
|
10
|
-
onChange:
|
|
11
|
-
"aria-invalid":
|
|
2
|
+
var o = (i, l) => F(i, "name", { value: l, configurable: !0 });
|
|
3
|
+
import { jsxs as r, jsx as e, Fragment as f } from "react/jsx-runtime";
|
|
4
|
+
import { useState as j, useImperativeHandle as k, useCallback as p } from "react";
|
|
5
|
+
import { FileIcon as C, UploadIcon as D } from "lucide-react";
|
|
6
|
+
import { useDropzone as I } from "react-dropzone";
|
|
7
|
+
import { cn as c } from "../lib/utils.js";
|
|
8
|
+
import { Button as S } from "./button.js";
|
|
9
|
+
function M({
|
|
10
|
+
onChange: i,
|
|
11
|
+
"aria-invalid": l,
|
|
12
12
|
fileTypes: b,
|
|
13
13
|
ref: x
|
|
14
14
|
}) {
|
|
15
15
|
const [a, d] = j([]);
|
|
16
16
|
k(x, () => ({
|
|
17
|
-
focus: /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
focus: /* @__PURE__ */ o(() => {
|
|
18
|
+
t?.current && t.current.focus();
|
|
19
19
|
}, "focus")
|
|
20
20
|
}));
|
|
21
|
-
const v =
|
|
22
|
-
(
|
|
23
|
-
d(
|
|
21
|
+
const v = p(
|
|
22
|
+
(n) => {
|
|
23
|
+
d(n), i?.(n.length > 0 ? n[0] : null);
|
|
24
24
|
},
|
|
25
|
-
[
|
|
26
|
-
), g = /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
}, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles: u, open: N, rootRef:
|
|
25
|
+
[i]
|
|
26
|
+
), g = /* @__PURE__ */ o(() => {
|
|
27
|
+
t?.current && t.current.focus();
|
|
28
|
+
}, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles: u, open: N, rootRef: t } = I({
|
|
29
29
|
maxFiles: 1,
|
|
30
30
|
noClick: !0,
|
|
31
31
|
onDrop: v,
|
|
32
32
|
onFileDialogCancel: g
|
|
33
|
-
}), z =
|
|
34
|
-
let
|
|
35
|
-
return
|
|
33
|
+
}), z = p((n) => {
|
|
34
|
+
let s = 0, m = "ko";
|
|
35
|
+
return s = n.size / 1e3, s > 1e3 && (s /= 1e3, m = "mo"), s.toFixed(2) + " " + m;
|
|
36
36
|
}, []);
|
|
37
|
-
return /* @__PURE__ */
|
|
37
|
+
return /* @__PURE__ */ r(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
...h(),
|
|
41
|
-
className:
|
|
41
|
+
className: c(
|
|
42
42
|
"bg-input border border-input-border flex flex-col h-50 w-full rounded-md px-3 py-1 text-base shadow-xs items-center justify-center md:text-sm outline-none",
|
|
43
43
|
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
44
44
|
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
45
45
|
),
|
|
46
|
-
"aria-invalid":
|
|
46
|
+
"aria-invalid": l,
|
|
47
47
|
children: [
|
|
48
|
-
a.length > 0 && /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
a.length > 0 && /* @__PURE__ */ r(f, { children: [
|
|
49
|
+
/* @__PURE__ */ e(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
className:
|
|
52
|
+
className: c(
|
|
53
53
|
"bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"
|
|
54
54
|
),
|
|
55
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ e(C, { className: "size-4" })
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ r("div", { className: "mb-4 text-center", children: [
|
|
59
59
|
u[0].name,
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ e("br", {}),
|
|
61
61
|
z(u[0])
|
|
62
62
|
] }),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
S,
|
|
65
65
|
{
|
|
66
66
|
type: "button",
|
|
67
67
|
color: "destructive",
|
|
68
68
|
variant: "ghost",
|
|
69
|
-
onClick: /* @__PURE__ */
|
|
70
|
-
|
|
71
|
-
d([]), r == null || r(null), (t = e == null ? void 0 : e.current) == null || t.focus();
|
|
69
|
+
onClick: /* @__PURE__ */ o(() => {
|
|
70
|
+
d([]), i?.(null), t?.current?.focus();
|
|
72
71
|
}, "onClick"),
|
|
73
72
|
children: "Supprimer"
|
|
74
73
|
}
|
|
75
74
|
)
|
|
76
75
|
] }),
|
|
77
|
-
a.length === 0 && /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
76
|
+
a.length === 0 && /* @__PURE__ */ r(f, { children: [
|
|
77
|
+
/* @__PURE__ */ e(
|
|
79
78
|
"div",
|
|
80
79
|
{
|
|
81
|
-
className:
|
|
80
|
+
className: c(
|
|
82
81
|
"bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"
|
|
83
82
|
),
|
|
84
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ e(D, { className: "size-4" })
|
|
85
84
|
}
|
|
86
85
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r("div", { className: "mb-4", children: [
|
|
88
87
|
"Glisser-déposer ou",
|
|
89
88
|
" ",
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ e("span", { className: "font-bold underline cursor-pointer", onClick: N, children: "Choisir un fichier" }),
|
|
91
90
|
" ",
|
|
92
91
|
"à uploader"
|
|
93
92
|
] }),
|
|
94
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ r("div", { className: "text-center text-sm md:text-xs", children: [
|
|
95
94
|
"Formats acceptés : ",
|
|
96
95
|
Object.keys(b).join(", "),
|
|
97
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ e("br", {}),
|
|
98
97
|
"Taille max : 5Mo"
|
|
99
98
|
] })
|
|
100
99
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ e("input", { ...y() })
|
|
102
101
|
]
|
|
103
102
|
}
|
|
104
103
|
);
|
|
105
104
|
}
|
|
106
|
-
|
|
105
|
+
o(M, "FileUploader");
|
|
107
106
|
export {
|
|
108
|
-
|
|
107
|
+
M as FileUploader
|
|
109
108
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FileUploader } from "./file-uploader";
|
|
2
|
-
export declare function FormFileUploader({ name, label, required, ...props }: {
|
|
2
|
+
export declare function FormFileUploader({ name, label, description, required, ...props }: {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
description?: string;
|
|
5
6
|
required?: boolean;
|
|
6
7
|
} & React.ComponentProps<typeof FileUploader>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var m = (o, e) =>
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { FormField as f, FormItem as p, FormLabel as a, FormControl as
|
|
6
|
-
import { FileUploader as
|
|
7
|
-
function
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (o, e) => d(o, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
import { useFormContext as c } from "react-hook-form";
|
|
5
|
+
import { FormField as f, FormItem as p, FormLabel as a, FormControl as h, FormDescription as u, FormMessage as x } from "./form.js";
|
|
6
|
+
import { FileUploader as j } from "./file-uploader.js";
|
|
7
|
+
function I({
|
|
8
8
|
name: o,
|
|
9
9
|
label: e,
|
|
10
|
-
|
|
10
|
+
description: l,
|
|
11
|
+
required: i = !1,
|
|
11
12
|
...t
|
|
12
13
|
}) {
|
|
13
|
-
const { control:
|
|
14
|
+
const { control: n } = c();
|
|
14
15
|
return /* @__PURE__ */ r(
|
|
15
16
|
f,
|
|
16
17
|
{
|
|
17
|
-
control:
|
|
18
|
+
control: n,
|
|
18
19
|
name: o,
|
|
19
|
-
render: /* @__PURE__ */ m(({ field: { value:
|
|
20
|
-
/* @__PURE__ */ r(a, { required:
|
|
21
|
-
/* @__PURE__ */ r(
|
|
22
|
-
/* @__PURE__ */ r(u, {})
|
|
20
|
+
render: /* @__PURE__ */ m(({ field: { value: C, ...F } }) => /* @__PURE__ */ s(p, { children: [
|
|
21
|
+
/* @__PURE__ */ r(a, { required: i, children: e }),
|
|
22
|
+
/* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(j, { ...F, ...t }) }),
|
|
23
|
+
l && /* @__PURE__ */ r(u, { children: l }),
|
|
24
|
+
/* @__PURE__ */ r(x, {})
|
|
23
25
|
] }), "render")
|
|
24
26
|
}
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
m(
|
|
29
|
+
m(I, "FormFileUploader");
|
|
28
30
|
export {
|
|
29
|
-
|
|
31
|
+
I as FormFileUploader
|
|
30
32
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ImageUploader } from "./image-uploader";
|
|
2
|
-
export declare function FormImageUploader({ name, label, required, actualImageUrl, ...props }: {
|
|
2
|
+
export declare function FormImageUploader({ name, label, description, required, actualImageUrl, ...props }: {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
description?: string;
|
|
5
6
|
required?: boolean;
|
|
6
7
|
actualImageUrl?: string;
|
|
7
8
|
} & React.ComponentProps<typeof ImageUploader>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var m = (o, e) => d(o, "name", { value: e, configurable: !0 });
|
|
3
3
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { FormField as f, FormItem as p, FormLabel as
|
|
6
|
-
import { ImageUploader as
|
|
7
|
-
function
|
|
4
|
+
import { useFormContext as c } from "react-hook-form";
|
|
5
|
+
import { FormField as f, FormItem as p, FormLabel as h, FormControl as u, FormDescription as x, FormMessage as g } from "./form.js";
|
|
6
|
+
import { ImageUploader as I } from "./image-uploader.js";
|
|
7
|
+
function L({
|
|
8
8
|
name: o,
|
|
9
9
|
label: e,
|
|
10
|
+
description: l,
|
|
10
11
|
required: t = !1,
|
|
11
|
-
actualImageUrl:
|
|
12
|
-
...
|
|
12
|
+
actualImageUrl: n = "",
|
|
13
|
+
...i
|
|
13
14
|
}) {
|
|
14
|
-
const { control:
|
|
15
|
+
const { control: F } = c();
|
|
15
16
|
return /* @__PURE__ */ r(
|
|
16
17
|
f,
|
|
17
18
|
{
|
|
18
|
-
control:
|
|
19
|
+
control: F,
|
|
19
20
|
name: o,
|
|
20
|
-
render: /* @__PURE__ */ m(({ field: { value:
|
|
21
|
-
/* @__PURE__ */ r(
|
|
22
|
-
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
|
|
23
|
-
|
|
21
|
+
render: /* @__PURE__ */ m(({ field: { value: j, ...a } }) => /* @__PURE__ */ s(p, { children: [
|
|
22
|
+
/* @__PURE__ */ r(h, { required: t, children: e }),
|
|
23
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(
|
|
24
|
+
I,
|
|
25
|
+
{
|
|
26
|
+
actualImageUrl: n,
|
|
27
|
+
...a,
|
|
28
|
+
...i
|
|
29
|
+
}
|
|
30
|
+
) }),
|
|
31
|
+
l && /* @__PURE__ */ r(x, { children: l }),
|
|
32
|
+
/* @__PURE__ */ r(g, {})
|
|
24
33
|
] }), "render")
|
|
25
34
|
}
|
|
26
35
|
);
|
|
27
36
|
}
|
|
28
|
-
m(
|
|
37
|
+
m(L, "FormImageUploader");
|
|
29
38
|
export {
|
|
30
|
-
|
|
39
|
+
L as FormImageUploader
|
|
31
40
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Input } from "./input";
|
|
2
|
-
export declare function FormInput({ name, label, required, ...props }: {
|
|
2
|
+
export declare function FormInput({ name, label, description, required, ...props }: {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
description?: string;
|
|
5
6
|
required: boolean;
|
|
6
7
|
} & React.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { FormField as
|
|
6
|
-
import { Input as
|
|
7
|
-
function
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var m = (o, e) => p(o, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
4
|
+
import { useFormContext as f } from "react-hook-form";
|
|
5
|
+
import { FormField as d, FormItem as a, FormLabel as h, FormControl as x, FormDescription as I, FormMessage as j } from "./form.js";
|
|
6
|
+
import { Input as v } from "./input.js";
|
|
7
|
+
function M({
|
|
8
8
|
name: o,
|
|
9
9
|
label: e,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
description: t,
|
|
11
|
+
required: n = !1,
|
|
12
|
+
...l
|
|
12
13
|
}) {
|
|
13
|
-
const { control:
|
|
14
|
+
const { control: i } = f();
|
|
14
15
|
return /* @__PURE__ */ r(
|
|
15
|
-
|
|
16
|
+
d,
|
|
16
17
|
{
|
|
17
|
-
control:
|
|
18
|
+
control: i,
|
|
18
19
|
name: o,
|
|
19
|
-
render: /* @__PURE__ */
|
|
20
|
-
const { value:
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */ r(
|
|
23
|
-
/* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(
|
|
24
|
-
/* @__PURE__ */ r(
|
|
20
|
+
render: /* @__PURE__ */ m(({ field: s }) => {
|
|
21
|
+
const { value: F, ...c } = s;
|
|
22
|
+
return /* @__PURE__ */ u(a, { children: [
|
|
23
|
+
/* @__PURE__ */ r(h, { required: n, children: e }),
|
|
24
|
+
/* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(v, { value: F ?? "", ...c, ...l }) }),
|
|
25
|
+
t && /* @__PURE__ */ r(I, { children: t }),
|
|
26
|
+
/* @__PURE__ */ r(j, {})
|
|
25
27
|
] });
|
|
26
28
|
}, "render")
|
|
27
29
|
}
|
|
28
30
|
);
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
m(M, "FormInput");
|
|
31
33
|
export {
|
|
32
|
-
|
|
34
|
+
M as FormInput
|
|
33
35
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Select } from "./select";
|
|
2
|
-
export declare function FormSelect({ name, label, required, options, isMulti, isClearable, onChange, ...props }: {
|
|
2
|
+
export declare function FormSelect({ name, label, description, required, options, isMulti, isClearable, onChange, ...props }: {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
description?: string;
|
|
5
6
|
required?: boolean;
|
|
6
7
|
options: {
|
|
7
8
|
value: string;
|
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var o = (e, n) =>
|
|
3
|
-
import { jsx as r, jsxs as
|
|
4
|
-
import { useFormContext as
|
|
5
|
-
import { FormField as
|
|
6
|
-
import { Select as
|
|
7
|
-
function
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var o = (e, n) => x(e, "name", { value: n, configurable: !0 });
|
|
3
|
+
import { jsx as r, jsxs as C } from "react/jsx-runtime";
|
|
4
|
+
import { useFormContext as g } from "react-hook-form";
|
|
5
|
+
import { FormField as u, FormItem as j, FormLabel as S, FormControl as b, FormDescription as D, FormMessage as I } from "./form.js";
|
|
6
|
+
import { Select as L } from "./select.js";
|
|
7
|
+
function v({
|
|
8
8
|
name: e,
|
|
9
9
|
label: n,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
description: m,
|
|
11
|
+
required: l = !1,
|
|
12
|
+
options: s,
|
|
13
|
+
isMulti: f = !1,
|
|
14
|
+
isClearable: c = !1,
|
|
14
15
|
onChange: t = void 0,
|
|
15
|
-
...
|
|
16
|
+
...F
|
|
16
17
|
}) {
|
|
17
|
-
const { control: d } =
|
|
18
|
+
const { control: d } = g();
|
|
18
19
|
return /* @__PURE__ */ r(
|
|
19
|
-
|
|
20
|
+
u,
|
|
20
21
|
{
|
|
21
22
|
control: d,
|
|
22
23
|
name: e,
|
|
23
|
-
render: /* @__PURE__ */ o(({ field:
|
|
24
|
-
const { onChange:
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */ r(
|
|
27
|
-
/* @__PURE__ */ r(
|
|
28
|
-
|
|
24
|
+
render: /* @__PURE__ */ o(({ field: a }) => {
|
|
25
|
+
const { onChange: h, ...p } = a;
|
|
26
|
+
return /* @__PURE__ */ C(j, { children: [
|
|
27
|
+
/* @__PURE__ */ r(S, { required: l, children: n }),
|
|
28
|
+
/* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
|
|
29
|
+
L,
|
|
29
30
|
{
|
|
30
|
-
onChange: /* @__PURE__ */ o((
|
|
31
|
-
|
|
31
|
+
onChange: /* @__PURE__ */ o((i) => {
|
|
32
|
+
h(i), t && t(i);
|
|
32
33
|
}, "onChange"),
|
|
33
34
|
...p,
|
|
34
|
-
options:
|
|
35
|
-
isMulti:
|
|
36
|
-
isClearable:
|
|
37
|
-
...
|
|
35
|
+
options: s,
|
|
36
|
+
isMulti: f,
|
|
37
|
+
isClearable: c,
|
|
38
|
+
...F
|
|
38
39
|
}
|
|
39
40
|
) }),
|
|
40
|
-
/* @__PURE__ */ r(
|
|
41
|
+
m && /* @__PURE__ */ r(D, { children: m }),
|
|
42
|
+
/* @__PURE__ */ r(I, {})
|
|
41
43
|
] });
|
|
42
44
|
}, "render")
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
|
-
o(
|
|
48
|
+
o(v, "FormSelect");
|
|
47
49
|
export {
|
|
48
|
-
|
|
50
|
+
v as FormSelect
|
|
49
51
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Textarea } from "./textarea";
|
|
2
|
-
export declare function FormTextarea({ name, label, required, ...props }: {
|
|
2
|
+
export declare function FormTextarea({ name, label, description, required, ...props }: {
|
|
3
3
|
name: string;
|
|
4
4
|
label: string;
|
|
5
|
+
description?: string;
|
|
5
6
|
required?: boolean;
|
|
6
7
|
} & React.ComponentProps<typeof Textarea>): import("react/jsx-runtime").JSX.Element;
|