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.
Files changed (37) hide show
  1. package/dist/components/calendar.js +11 -12
  2. package/dist/components/data-loader.js +1 -1
  3. package/dist/components/date-picker.js +28 -28
  4. package/dist/components/file-uploader.js +46 -47
  5. package/dist/components/form-file-uploader.d.ts +2 -1
  6. package/dist/components/form-file-uploader.js +18 -16
  7. package/dist/components/form-image-uploader.d.ts +2 -1
  8. package/dist/components/form-image-uploader.js +23 -14
  9. package/dist/components/form-input.d.ts +2 -1
  10. package/dist/components/form-input.js +22 -20
  11. package/dist/components/form-select.d.ts +2 -1
  12. package/dist/components/form-select.js +31 -29
  13. package/dist/components/form-textarea.d.ts +2 -1
  14. package/dist/components/form-textarea.js +22 -20
  15. package/dist/components/form.js +14 -14
  16. package/dist/components/html-input.d.ts +1 -0
  17. package/dist/components/image-uploader.js +53 -54
  18. package/dist/components/index.d.ts +45 -0
  19. package/dist/components/index.js +200 -0
  20. package/dist/components/select.js +39 -39
  21. package/dist/components/sidebar.js +49 -49
  22. package/dist/hooks/index.d.ts +1 -0
  23. package/dist/hooks/index.js +4 -0
  24. package/dist/lib/index.d.ts +6 -0
  25. package/dist/lib/index.js +27 -0
  26. package/package.json +49 -36
  27. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -12
  28. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -21
  29. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -36
  30. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -18
  31. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatDistance.js +0 -72
  32. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatLong.js +0 -33
  33. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/formatRelative.js +0 -13
  34. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/localize.js +0 -123
  35. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr/_lib/match.js +0 -112
  36. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js +0 -21
  37. 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 f from "react";
4
+ import * as g from "react";
5
5
  import { ChevronLeftIcon as h, ChevronRightIcon as y, ChevronDownIcon as _ } from "lucide-react";
6
- import { getDefaultClassNames as x, DayPicker as v } from "react-day-picker";
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 p, Button as z } from "./button.js";
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: g,
17
+ components: x,
18
18
  ...b
19
19
  }) {
20
- const t = x();
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
- p({
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
- p({
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
- ...g
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 = x(), m = f.useRef(null);
178
- return f.useEffect(() => {
179
- var g;
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 || (c = e.isPending || e.isRefetching), o || (o = e.isError || e.isRefetchError);
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 i = (o, r) => p(o, "name", { value: r, configurable: !0 });
3
- import { jsxs as s, jsx as t } from "react/jsx-runtime";
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 x } from "./calendar.js";
7
- import { Popover as b, PopoverTrigger as v, PopoverContent as h } from "./popover.js";
8
- import { Button as P } from "./button.js";
9
- import { format as g } from "date-fns";
10
- import { fr as w } from "../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/fr.js";
11
- function B({
12
- placeholder: o = "Choisir une date",
13
- onChange: r,
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: d = !1,
16
- ...l
15
+ isClearable: s = !1,
16
+ ...d
17
17
  }) {
18
- const [n, a] = f.useState(!1), c = /* @__PURE__ */ i((m) => {
19
- r == null || r(m || null), a(!1);
18
+ const [l, n] = f.useState(!1), c = /* @__PURE__ */ o((m) => {
19
+ t?.(m || null), n(!1);
20
20
  }, "onSelect");
21
- return /* @__PURE__ */ s(b, { onOpenChange: a, open: n, children: [
22
- /* @__PURE__ */ t(v, { asChild: !0, children: /* @__PURE__ */ s(
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
- ...l,
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__ */ t(u, { className: "mr-2 size-4" }),
30
- e ? /* @__PURE__ */ t("span", { children: g(e, "PPP", { locale: w }) }) : /* @__PURE__ */ t("span", { className: "text-placeholder", children: o })
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__ */ s(h, { align: "start", className: "w-auto p-0", children: [
35
- /* @__PURE__ */ t(
36
- x,
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 && d && /* @__PURE__ */ t("div", { className: "flex justify-center border-t", children: /* @__PURE__ */ t(
47
- P,
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__ */ i(() => {
53
- r == null || r(null), a(!1);
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
- i(B, "DatePicker");
61
+ o(z, "DatePicker");
62
62
  export {
63
- B as DatePicker
63
+ z as DatePicker
64
64
  };
@@ -1,109 +1,108 @@
1
1
  var F = Object.defineProperty;
2
- var l = (r, c) => F(r, "name", { value: c, configurable: !0 });
3
- import { jsxs as s, jsx as i, Fragment as p } from "react/jsx-runtime";
4
- import { useState as j, useImperativeHandle as k, useCallback as f } from "react";
5
- import { FileIcon as D, UploadIcon as I } from "lucide-react";
6
- import { useDropzone as S } from "react-dropzone";
7
- import { cn as o } from "../lib/utils.js";
8
- import { Button as w } from "./button.js";
9
- function T({
10
- onChange: r,
11
- "aria-invalid": c,
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__ */ l(() => {
18
- e != null && e.current && e.current.focus();
17
+ focus: /* @__PURE__ */ o(() => {
18
+ t?.current && t.current.focus();
19
19
  }, "focus")
20
20
  }));
21
- const v = f(
22
- (t) => {
23
- d(t), r == null || r(t.length > 0 ? t[0] : null);
21
+ const v = p(
22
+ (n) => {
23
+ d(n), i?.(n.length > 0 ? n[0] : null);
24
24
  },
25
- [r]
26
- ), g = /* @__PURE__ */ l(() => {
27
- e != null && e.current && e.current.focus();
28
- }, "handleFileDialogCancel"), { getRootProps: h, getInputProps: y, acceptedFiles: u, open: N, rootRef: e } = S({
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 = f((t) => {
34
- let n = 0, m = "ko";
35
- return n = t.size / 1e3, n > 1e3 && (n /= 1e3, m = "mo"), n.toFixed(2) + " " + m;
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__ */ s(
37
+ return /* @__PURE__ */ r(
38
38
  "div",
39
39
  {
40
40
  ...h(),
41
- className: o(
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": c,
46
+ "aria-invalid": l,
47
47
  children: [
48
- a.length > 0 && /* @__PURE__ */ s(p, { children: [
49
- /* @__PURE__ */ i(
48
+ a.length > 0 && /* @__PURE__ */ r(f, { children: [
49
+ /* @__PURE__ */ e(
50
50
  "div",
51
51
  {
52
- className: o(
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__ */ i(D, { className: "size-4" })
55
+ children: /* @__PURE__ */ e(C, { className: "size-4" })
56
56
  }
57
57
  ),
58
- /* @__PURE__ */ s("div", { className: "mb-4 text-center", children: [
58
+ /* @__PURE__ */ r("div", { className: "mb-4 text-center", children: [
59
59
  u[0].name,
60
- /* @__PURE__ */ i("br", {}),
60
+ /* @__PURE__ */ e("br", {}),
61
61
  z(u[0])
62
62
  ] }),
63
- /* @__PURE__ */ i(
64
- w,
63
+ /* @__PURE__ */ e(
64
+ S,
65
65
  {
66
66
  type: "button",
67
67
  color: "destructive",
68
68
  variant: "ghost",
69
- onClick: /* @__PURE__ */ l(() => {
70
- var t;
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__ */ s(p, { children: [
78
- /* @__PURE__ */ i(
76
+ a.length === 0 && /* @__PURE__ */ r(f, { children: [
77
+ /* @__PURE__ */ e(
79
78
  "div",
80
79
  {
81
- className: o(
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__ */ i(I, { className: "size-4" })
83
+ children: /* @__PURE__ */ e(D, { className: "size-4" })
85
84
  }
86
85
  ),
87
- /* @__PURE__ */ s("div", { className: "mb-4", children: [
86
+ /* @__PURE__ */ r("div", { className: "mb-4", children: [
88
87
  "Glisser-déposer ou",
89
88
  " ",
90
- /* @__PURE__ */ i("span", { className: "font-bold underline cursor-pointer", onClick: N, children: "Choisir un fichier" }),
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__ */ s("div", { className: "text-center text-sm md:text-xs", children: [
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__ */ i("br", {}),
96
+ /* @__PURE__ */ e("br", {}),
98
97
  "Taille max : 5Mo"
99
98
  ] })
100
99
  ] }),
101
- /* @__PURE__ */ i("input", { ...y() })
100
+ /* @__PURE__ */ e("input", { ...y() })
102
101
  ]
103
102
  }
104
103
  );
105
104
  }
106
- l(T, "FileUploader");
105
+ o(M, "FileUploader");
107
106
  export {
108
- T as FileUploader
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 F = Object.defineProperty;
2
- var m = (o, e) => F(o, "name", { value: e, configurable: !0 });
3
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
4
- import { useFormContext as s } from "react-hook-form";
5
- import { FormField as f, FormItem as p, FormLabel as a, FormControl as c, FormMessage as u } from "./form.js";
6
- import { FileUploader as x } from "./file-uploader.js";
7
- function v({
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
- required: l = !1,
10
+ description: l,
11
+ required: i = !1,
11
12
  ...t
12
13
  }) {
13
- const { control: i } = s();
14
+ const { control: n } = c();
14
15
  return /* @__PURE__ */ r(
15
16
  f,
16
17
  {
17
- control: i,
18
+ control: n,
18
19
  name: o,
19
- render: /* @__PURE__ */ m(({ field: { value: h, ...n } }) => /* @__PURE__ */ d(p, { children: [
20
- /* @__PURE__ */ r(a, { required: l, children: e }),
21
- /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(x, { ...n, ...t }) }),
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(v, "FormFileUploader");
29
+ m(I, "FormFileUploader");
28
30
  export {
29
- v as FormFileUploader
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 F } from "react-hook-form";
5
- import { FormField as f, FormItem as p, FormLabel as c, FormControl as u, FormMessage as x } from "./form.js";
6
- import { ImageUploader as g } from "./image-uploader.js";
7
- function v({
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: l = "",
12
- ...n
12
+ actualImageUrl: n = "",
13
+ ...i
13
14
  }) {
14
- const { control: i } = F();
15
+ const { control: F } = c();
15
16
  return /* @__PURE__ */ r(
16
17
  f,
17
18
  {
18
- control: i,
19
+ control: F,
19
20
  name: o,
20
- render: /* @__PURE__ */ m(({ field: { value: h, ...a } }) => /* @__PURE__ */ s(p, { children: [
21
- /* @__PURE__ */ r(c, { required: t, children: e }),
22
- /* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(g, { actualImageUrl: l, ...a, ...n }) }),
23
- /* @__PURE__ */ r(x, {})
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(v, "FormImageUploader");
37
+ m(L, "FormImageUploader");
29
38
  export {
30
- v as FormImageUploader
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 u = Object.defineProperty;
2
- var t = (o, e) => u(o, "name", { value: e, configurable: !0 });
3
- import { jsx as r, jsxs as F } from "react/jsx-runtime";
4
- import { useFormContext as c } from "react-hook-form";
5
- import { FormField as f, FormItem as d, FormLabel as a, FormControl as x, FormMessage as h } from "./form.js";
6
- import { Input as I } from "./input.js";
7
- function L({
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
- required: m = !1,
11
- ...n
10
+ description: t,
11
+ required: n = !1,
12
+ ...l
12
13
  }) {
13
- const { control: l } = c();
14
+ const { control: i } = f();
14
15
  return /* @__PURE__ */ r(
15
- f,
16
+ d,
16
17
  {
17
- control: l,
18
+ control: i,
18
19
  name: o,
19
- render: /* @__PURE__ */ t(({ field: i }) => {
20
- const { value: s, ...p } = i;
21
- return /* @__PURE__ */ F(d, { children: [
22
- /* @__PURE__ */ r(a, { required: m, children: e }),
23
- /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(I, { value: s ?? "", ...p, ...n }) }),
24
- /* @__PURE__ */ r(h, {})
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
- t(L, "FormInput");
32
+ m(M, "FormInput");
31
33
  export {
32
- L as FormInput
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 h = Object.defineProperty;
2
- var o = (e, n) => h(e, "name", { value: n, configurable: !0 });
3
- import { jsx as r, jsxs as x } from "react/jsx-runtime";
4
- import { useFormContext as C } from "react-hook-form";
5
- import { FormField as g, FormItem as u, FormLabel as j, FormControl as S, FormMessage as b } from "./form.js";
6
- import { Select as I } from "./select.js";
7
- function q({
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
- required: i = !1,
11
- options: l,
12
- isMulti: s = !1,
13
- isClearable: f = !1,
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
- ...c
16
+ ...F
16
17
  }) {
17
- const { control: d } = C();
18
+ const { control: d } = g();
18
19
  return /* @__PURE__ */ r(
19
- g,
20
+ u,
20
21
  {
21
22
  control: d,
22
23
  name: e,
23
- render: /* @__PURE__ */ o(({ field: F }) => {
24
- const { onChange: a, ...p } = F;
25
- return /* @__PURE__ */ x(u, { children: [
26
- /* @__PURE__ */ r(j, { required: i, children: n }),
27
- /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
28
- I,
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((m) => {
31
- a(m), t && t(m);
31
+ onChange: /* @__PURE__ */ o((i) => {
32
+ h(i), t && t(i);
32
33
  }, "onChange"),
33
34
  ...p,
34
- options: l,
35
- isMulti: s,
36
- isClearable: f,
37
- ...c
35
+ options: s,
36
+ isMulti: f,
37
+ isClearable: c,
38
+ ...F
38
39
  }
39
40
  ) }),
40
- /* @__PURE__ */ r(b, {})
41
+ m && /* @__PURE__ */ r(D, { children: m }),
42
+ /* @__PURE__ */ r(I, {})
41
43
  ] });
42
44
  }, "render")
43
45
  }
44
46
  );
45
47
  }
46
- o(q, "FormSelect");
48
+ o(v, "FormSelect");
47
49
  export {
48
- q as FormSelect
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;