fina-react-ds 1.0.37 → 1.0.38

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.
@@ -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;
@@ -1,33 +1,35 @@
1
- var F = Object.defineProperty;
2
- var t = (o, e) => F(o, "name", { value: e, configurable: !0 });
3
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
4
- import { useFormContext as f } from "react-hook-form";
5
- import { FormField as d, FormItem as p, FormLabel as u, FormControl as x, FormMessage as h } from "./form.js";
6
- import { Textarea as j } from "./textarea.js";
7
- function I({
1
+ var c = Object.defineProperty;
2
+ var m = (o, e) => c(o, "name", { value: e, configurable: !0 });
3
+ import { jsx as r, jsxs as f } from "react/jsx-runtime";
4
+ import { useFormContext as d } from "react-hook-form";
5
+ import { FormField as p, FormItem as u, FormLabel as x, FormControl as h, FormDescription as j, FormMessage as v } from "./form.js";
6
+ import { Textarea as C } from "./textarea.js";
7
+ function L({
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 } = f();
14
+ const { control: i } = d();
14
15
  return /* @__PURE__ */ r(
15
- d,
16
+ p,
16
17
  {
17
- control: l,
18
+ control: i,
18
19
  name: o,
19
- render: /* @__PURE__ */ t(({ field: i }) => {
20
- const { value: s, ...a } = i;
21
- return /* @__PURE__ */ c(p, { children: [
22
- /* @__PURE__ */ r(u, { required: m, children: e }),
23
- /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(j, { value: s ?? "", ...a, ...n }) }),
24
- /* @__PURE__ */ r(h, {})
20
+ render: /* @__PURE__ */ m(({ field: s }) => {
21
+ const { value: a, ...F } = s;
22
+ return /* @__PURE__ */ f(u, { children: [
23
+ /* @__PURE__ */ r(x, { required: n, children: e }),
24
+ /* @__PURE__ */ r(h, { children: /* @__PURE__ */ r(C, { value: a ?? "", ...F, ...l }) }),
25
+ t && /* @__PURE__ */ r(j, { children: t }),
26
+ /* @__PURE__ */ r(v, {})
25
27
  ] });
26
28
  }, "render")
27
29
  }
28
30
  );
29
31
  }
30
- t(I, "FormTextarea");
32
+ m(L, "FormTextarea");
31
33
  export {
32
- I as FormTextarea
34
+ L as FormTextarea
33
35
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/F1na/fina-react-ds"
6
6
  },
7
7
  "private": false,
8
- "version": "1.0.37",
8
+ "version": "1.0.38",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"