@gustavo-valsechi/client 1.4.20 → 1.4.22

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 (48) hide show
  1. package/dist/components/types/form/index.js +4 -2
  2. package/dist/components/types/form/index.mjs +4 -2
  3. package/dist/components/types/form/types/custom/index.js +11 -3
  4. package/dist/components/types/form/types/custom/index.mjs +11 -3
  5. package/dist/components/types/form/types/custom/styles.js +6 -3
  6. package/dist/components/types/form/types/custom/styles.mjs +6 -3
  7. package/dist/components/types/form/types/datetime/index.js +2 -1
  8. package/dist/components/types/form/types/datetime/index.mjs +2 -1
  9. package/dist/components/types/form/types/datetime/styles.js +0 -5
  10. package/dist/components/types/form/types/datetime/styles.mjs +0 -5
  11. package/dist/components/types/form/types/error/index.d.ts +2 -0
  12. package/dist/components/types/form/types/error/index.js +33 -0
  13. package/dist/components/types/form/types/error/index.mjs +9 -0
  14. package/dist/components/types/form/types/error/styles.js +43 -0
  15. package/dist/components/types/form/types/error/styles.mjs +9 -0
  16. package/dist/components/types/form/types/file/index.js +2 -1
  17. package/dist/components/types/form/types/file/index.mjs +2 -1
  18. package/dist/components/types/form/types/file/styles.js +0 -5
  19. package/dist/components/types/form/types/file/styles.mjs +0 -5
  20. package/dist/components/types/form/types/index.d.ts +2 -1
  21. package/dist/components/types/form/types/index.js +5 -3
  22. package/dist/components/types/form/types/index.mjs +2 -1
  23. package/dist/components/types/form/types/select/index.js +2 -1
  24. package/dist/components/types/form/types/select/index.mjs +2 -1
  25. package/dist/components/types/form/types/select/styles.js +0 -5
  26. package/dist/components/types/form/types/select/styles.mjs +0 -5
  27. package/dist/components/types/form/types/{input → text}/index.js +5 -4
  28. package/dist/components/types/form/types/{input → text}/index.mjs +2 -1
  29. package/dist/components/types/form/types/text/styles.d.ts +1 -0
  30. package/dist/components/types/form/types/{input → text}/styles.js +0 -5
  31. package/dist/components/types/form/types/{input → text}/styles.mjs +0 -5
  32. package/dist/components/types/form/types/textarea/index.js +2 -1
  33. package/dist/components/types/form/types/textarea/index.mjs +2 -1
  34. package/dist/components/types/form/types/textarea/styles.js +0 -5
  35. package/dist/components/types/form/types/textarea/styles.mjs +0 -5
  36. package/dist/interfaces/components/form/custom/index.d.ts +1 -0
  37. package/dist/interfaces/components/form/error/index.d.ts +5 -0
  38. package/dist/interfaces/components/form/{input → error}/index.js +2 -2
  39. package/dist/interfaces/components/form/index.d.ts +2 -1
  40. package/dist/interfaces/components/form/index.js +5 -3
  41. package/dist/interfaces/components/form/index.mjs +2 -1
  42. package/dist/interfaces/components/form/text/index.js +16 -0
  43. package/dist/interfaces/components/form/text/index.mjs +0 -0
  44. package/package.json +1 -1
  45. /package/dist/components/types/form/types/{input → error}/styles.d.ts +0 -0
  46. /package/dist/components/types/form/types/{input → text}/index.d.ts +0 -0
  47. /package/dist/interfaces/components/form/{input → error}/index.mjs +0 -0
  48. /package/dist/interfaces/components/form/{input → text}/index.d.ts +0 -0
@@ -59,7 +59,8 @@ function Form(props) {
59
59
  register,
60
60
  handleSubmit,
61
61
  reset,
62
- formState: { errors }
62
+ formState: { errors },
63
+ setValue
63
64
  } = (0, import_react_hook_form.useForm)({
64
65
  resolver: (0, import_zod2.zodResolver)(schema),
65
66
  defaultValues: props.defaultValues,
@@ -96,7 +97,8 @@ function Form(props) {
96
97
  id: data.name,
97
98
  type: component2 ? void 0 : data.type,
98
99
  error: (_a = errors[data.name]) == null ? void 0 : _a.message,
99
- register
100
+ register,
101
+ setValue
100
102
  }
101
103
  );
102
104
  };
@@ -25,7 +25,8 @@ function Form(props) {
25
25
  register,
26
26
  handleSubmit,
27
27
  reset,
28
- formState: { errors }
28
+ formState: { errors },
29
+ setValue
29
30
  } = useForm({
30
31
  resolver: zodResolver(schema),
31
32
  defaultValues: props.defaultValues,
@@ -62,7 +63,8 @@ function Form(props) {
62
63
  id: data.name,
63
64
  type: component2 ? void 0 : data.type,
64
65
  error: (_a = errors[data.name]) == null ? void 0 : _a.message,
65
- register
66
+ register,
67
+ setValue
66
68
  }
67
69
  );
68
70
  };
@@ -23,18 +23,26 @@ __export(custom_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(custom_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
26
27
  var import_styles = require("./styles");
27
28
  var import_label = require("../label");
29
+ var import_error = require("../error");
28
30
  function InputCustom(props) {
29
31
  const register = (props.register || ((name) => ({})))(props.name || "");
32
+ (0, import_react.useEffect)(() => {
33
+ var _a;
34
+ (_a = props.setValue) == null ? void 0 : _a.call(props, props.name, props.value);
35
+ }, [props.name, props.value]);
30
36
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, children: [
31
37
  !!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.InputLabel, { children: [
32
38
  props.label,
33
39
  props.required ? "*" : ""
34
40
  ] }),
35
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { hidden: true, value: props.value, ...register }),
36
- props.children,
37
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "iz-input-content", children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { hidden: true, ...register }),
43
+ props.children
44
+ ] }),
45
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { className: "iz-input-custom-error", children: props.error })
38
46
  ] });
39
47
  }
40
48
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,17 +1,25 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect } from "react";
3
4
  import { Container } from "./styles";
4
5
  import { InputLabel } from "../label";
6
+ import { InputError } from "../error";
5
7
  function InputCustom(props) {
6
8
  const register = (props.register || ((name) => ({})))(props.name || "");
9
+ useEffect(() => {
10
+ var _a;
11
+ (_a = props.setValue) == null ? void 0 : _a.call(props, props.name, props.value);
12
+ }, [props.name, props.value]);
7
13
  return /* @__PURE__ */ jsxs(Container, { className: props.className, children: [
8
14
  !!props.label && /* @__PURE__ */ jsxs(InputLabel, { children: [
9
15
  props.label,
10
16
  props.required ? "*" : ""
11
17
  ] }),
12
- /* @__PURE__ */ jsx("input", { hidden: true, value: props.value, ...register }),
13
- props.children,
14
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
18
+ /* @__PURE__ */ jsxs("div", { className: "iz-input-content", children: [
19
+ /* @__PURE__ */ jsx("input", { hidden: true, ...register }),
20
+ props.children
21
+ ] }),
22
+ !!props.error && /* @__PURE__ */ jsx(InputError, { className: "iz-input-custom-error", children: props.error })
15
23
  ] });
16
24
  }
17
25
  export {
@@ -36,9 +36,12 @@ var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
38
 
39
- .iz-input-error {
40
- color: ${({ theme }) => theme.negative};
41
- font-size: .7rem;
39
+ .iz-input-content {
40
+
41
+ }
42
+
43
+ .iz-input-custom-error {
44
+ padding-top: .5rem;
42
45
  }
43
46
  `;
44
47
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,9 +3,12 @@ import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
5
 
6
- .iz-input-error {
7
- color: ${({ theme }) => theme.negative};
8
- font-size: .7rem;
6
+ .iz-input-content {
7
+
8
+ }
9
+
10
+ .iz-input-custom-error {
11
+ padding-top: .5rem;
9
12
  }
10
13
  `;
11
14
  export {
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(datetime_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_styles = require("./styles");
37
37
  var import_label = require("../label");
38
+ var import_error = require("../error");
38
39
  var import_lodash = __toESM(require("lodash"));
39
40
  function InputDateTime(props) {
40
41
  const register = (props.register || ((name) => ({})))(props.name || "");
@@ -62,7 +63,7 @@ function InputDateTime(props) {
62
63
  onChange
63
64
  }
64
65
  ) }),
65
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
66
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
66
67
  ] });
67
68
  }
68
69
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Container } from "./styles";
4
4
  import { InputLabel } from "../label";
5
+ import { InputError } from "../error";
5
6
  import _ from "lodash";
6
7
  function InputDateTime(props) {
7
8
  const register = (props.register || ((name) => ({})))(props.name || "");
@@ -29,7 +30,7 @@ function InputDateTime(props) {
29
30
  onChange
30
31
  }
31
32
  ) }),
32
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
33
+ !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
33
34
  ] });
34
35
  }
35
36
  export {
@@ -64,11 +64,6 @@ const Container = import_styled_components.default.div`
64
64
  }
65
65
  }
66
66
  }
67
-
68
- .iz-input-error {
69
- color: ${({ theme }) => theme.negative};
70
- font-size: .7rem;
71
- }
72
67
  `;
73
68
  // Annotate the CommonJS export names for ESM import in node:
74
69
  0 && (module.exports = {
@@ -31,11 +31,6 @@ const Container = styled.div`
31
31
  }
32
32
  }
33
33
  }
34
-
35
- .iz-input-error {
36
- color: ${({ theme }) => theme.negative};
37
- font-size: .7rem;
38
- }
39
34
  `;
40
35
  export {
41
36
  Container
@@ -0,0 +1,2 @@
1
+ import { IInputError } from "@interfaces";
2
+ export declare function InputError(props: IInputError): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var error_exports = {};
21
+ __export(error_exports, {
22
+ InputError: () => InputError
23
+ });
24
+ module.exports = __toCommonJS(error_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_styles = require("./styles");
27
+ function InputError(props) {
28
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Container, { className: props.className, children: props.children });
29
+ }
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ InputError
33
+ });
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ function InputError(props) {
5
+ return /* @__PURE__ */ jsx(Container, { className: props.className, children: props.children });
6
+ }
7
+ export {
8
+ InputError
9
+ };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var styles_exports = {};
31
+ __export(styles_exports, {
32
+ Container: () => Container
33
+ });
34
+ module.exports = __toCommonJS(styles_exports);
35
+ var import_styled_components = __toESM(require("styled-components"));
36
+ const Container = import_styled_components.default.label`
37
+ color: ${({ theme }) => theme.negative};
38
+ font-size: .7rem;
39
+ `;
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ Container
43
+ });
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import styled from "styled-components";
3
+ const Container = styled.label`
4
+ color: ${({ theme }) => theme.negative};
5
+ font-size: .7rem;
6
+ `;
7
+ export {
8
+ Container
9
+ };
@@ -26,6 +26,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_react = require("react");
27
27
  var import_styles = require("./styles");
28
28
  var import_label = require("../label");
29
+ var import_error = require("../error");
29
30
  function InputFile(props) {
30
31
  var _a;
31
32
  const inputRef = (0, import_react.useRef)({});
@@ -61,7 +62,7 @@ function InputFile(props) {
61
62
  props.required ? "*" : ""
62
63
  ] }),
63
64
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-image-content", onClick: () => inputRef.current.click(), children: ((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) || "selecione uma imagem" }),
64
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
65
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
65
66
  ] });
66
67
  }
67
68
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useRef } from "react";
4
4
  import { Container } from "./styles";
5
5
  import { InputLabel } from "../label";
6
+ import { InputError } from "../error";
6
7
  function InputFile(props) {
7
8
  var _a;
8
9
  const inputRef = useRef({});
@@ -38,7 +39,7 @@ function InputFile(props) {
38
39
  props.required ? "*" : ""
39
40
  ] }),
40
41
  /* @__PURE__ */ jsx("div", { className: "iz-image-content", onClick: () => inputRef.current.click(), children: ((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) || "selecione uma imagem" }),
41
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
42
+ !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
42
43
  ] });
43
44
  }
44
45
  export {
@@ -51,11 +51,6 @@ const Container = import_styled_components.default.div`
51
51
  color: ${({ theme }) => theme.t6};
52
52
  cursor: pointer;
53
53
  }
54
-
55
- .iz-input-error {
56
- color: ${({ theme }) => theme.negative};
57
- font-size: .7rem;
58
- }
59
54
  `;
60
55
  // Annotate the CommonJS export names for ESM import in node:
61
56
  0 && (module.exports = {
@@ -18,11 +18,6 @@ const Container = styled.div`
18
18
  color: ${({ theme }) => theme.t6};
19
19
  cursor: pointer;
20
20
  }
21
-
22
- .iz-input-error {
23
- color: ${({ theme }) => theme.negative};
24
- font-size: .7rem;
25
- }
26
21
  `;
27
22
  export {
28
23
  Container
@@ -1,8 +1,9 @@
1
1
  export * from "./file";
2
2
  export * from "./label";
3
- export * from "./input";
3
+ export * from "./text";
4
4
  export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
8
  export * from "./custom";
9
+ export * from "./error";
@@ -17,20 +17,22 @@ var types_exports = {};
17
17
  module.exports = __toCommonJS(types_exports);
18
18
  __reExport(types_exports, require("./file"), module.exports);
19
19
  __reExport(types_exports, require("./label"), module.exports);
20
- __reExport(types_exports, require("./input"), module.exports);
20
+ __reExport(types_exports, require("./text"), module.exports);
21
21
  __reExport(types_exports, require("./select"), module.exports);
22
22
  __reExport(types_exports, require("./button"), module.exports);
23
23
  __reExport(types_exports, require("./datetime"), module.exports);
24
24
  __reExport(types_exports, require("./textarea"), module.exports);
25
25
  __reExport(types_exports, require("./custom"), module.exports);
26
+ __reExport(types_exports, require("./error"), module.exports);
26
27
  // Annotate the CommonJS export names for ESM import in node:
27
28
  0 && (module.exports = {
28
29
  ...require("./file"),
29
30
  ...require("./label"),
30
- ...require("./input"),
31
+ ...require("./text"),
31
32
  ...require("./select"),
32
33
  ...require("./button"),
33
34
  ...require("./datetime"),
34
35
  ...require("./textarea"),
35
- ...require("./custom")
36
+ ...require("./custom"),
37
+ ...require("./error")
36
38
  });
@@ -1,8 +1,9 @@
1
1
  export * from "./file";
2
2
  export * from "./label";
3
- export * from "./input";
3
+ export * from "./text";
4
4
  export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
8
  export * from "./custom";
9
+ export * from "./error";
@@ -36,6 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
37
  var import_styles = require("./styles");
38
38
  var import_label = require("../label");
39
+ var import_error = require("../error");
39
40
  var import_lodash = __toESM(require("lodash"));
40
41
  function InputSelect(props) {
41
42
  const [focus, setFocus] = (0, import_react.useState)(false);
@@ -80,7 +81,7 @@ function InputSelect(props) {
80
81
  ),
81
82
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" })
82
83
  ] }),
83
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
84
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
84
85
  ] });
85
86
  }
86
87
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { Container } from "./styles";
5
5
  import { InputLabel } from "../label";
6
+ import { InputError } from "../error";
6
7
  import _ from "lodash";
7
8
  function InputSelect(props) {
8
9
  const [focus, setFocus] = useState(false);
@@ -47,7 +48,7 @@ function InputSelect(props) {
47
48
  ),
48
49
  /* @__PURE__ */ jsx("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" })
49
50
  ] }),
50
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
51
+ !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
51
52
  ] });
52
53
  }
53
54
  export {
@@ -76,11 +76,6 @@ const Container = import_styled_components.default.div`
76
76
  color: ${({ theme }) => theme.t6};
77
77
  }
78
78
  }
79
-
80
- .iz-input-error {
81
- color: ${({ theme }) => theme.negative};
82
- font-size: .7rem;
83
- }
84
79
  `;
85
80
  // Annotate the CommonJS export names for ESM import in node:
86
81
  0 && (module.exports = {
@@ -43,11 +43,6 @@ const Container = styled.div`
43
43
  color: ${({ theme }) => theme.t6};
44
44
  }
45
45
  }
46
-
47
- .iz-input-error {
48
- color: ${({ theme }) => theme.negative};
49
- font-size: .7rem;
50
- }
51
46
  `;
52
47
  export {
53
48
  Container
@@ -27,15 +27,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var input_exports = {};
31
- __export(input_exports, {
30
+ var text_exports = {};
31
+ __export(text_exports, {
32
32
  InputText: () => InputText
33
33
  });
34
- module.exports = __toCommonJS(input_exports);
34
+ module.exports = __toCommonJS(text_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
37
  var import_styles = require("./styles");
38
38
  var import_label = require("../label");
39
+ var import_error = require("../error");
39
40
  var import_lodash = __toESM(require("lodash"));
40
41
  function InputText(props) {
41
42
  const [showPassword, setShowPassword] = (0, import_react.useState)(false);
@@ -74,7 +75,7 @@ function InputText(props) {
74
75
  }
75
76
  )
76
77
  ] }),
77
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
78
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
78
79
  ] });
79
80
  }
80
81
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import { Container } from "./styles";
5
5
  import { InputLabel } from "../label";
6
+ import { InputError } from "../error";
6
7
  import _ from "lodash";
7
8
  function InputText(props) {
8
9
  const [showPassword, setShowPassword] = useState(false);
@@ -41,7 +42,7 @@ function InputText(props) {
41
42
  }
42
43
  )
43
44
  ] }),
44
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
45
+ !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
45
46
  ] });
46
47
  }
47
48
  export {
@@ -0,0 +1 @@
1
+ export declare const Container: any;
@@ -70,11 +70,6 @@ const Container = import_styled_components.default.div`
70
70
  cursor: pointer;
71
71
  }
72
72
  }
73
-
74
- .iz-input-error {
75
- color: ${({ theme }) => theme.negative};
76
- font-size: .7rem;
77
- }
78
73
  `;
79
74
  // Annotate the CommonJS export names for ESM import in node:
80
75
  0 && (module.exports = {
@@ -37,11 +37,6 @@ const Container = styled.div`
37
37
  cursor: pointer;
38
38
  }
39
39
  }
40
-
41
- .iz-input-error {
42
- color: ${({ theme }) => theme.negative};
43
- font-size: .7rem;
44
- }
45
40
  `;
46
41
  export {
47
42
  Container
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(textarea_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_styles = require("./styles");
37
37
  var import_label = require("../label");
38
+ var import_error = require("../error");
38
39
  var import_lodash = __toESM(require("lodash"));
39
40
  function InputTextarea(props) {
40
41
  const register = (props.register || ((name) => ({})))(props.name || "");
@@ -62,7 +63,7 @@ function InputTextarea(props) {
62
63
  onChange
63
64
  }
64
65
  ) }),
65
- !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "iz-input-error", children: props.error })
66
+ !!props.error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_error.InputError, { children: props.error })
66
67
  ] });
67
68
  }
68
69
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Container } from "./styles";
4
4
  import { InputLabel } from "../label";
5
+ import { InputError } from "../error";
5
6
  import _ from "lodash";
6
7
  function InputTextarea(props) {
7
8
  const register = (props.register || ((name) => ({})))(props.name || "");
@@ -29,7 +30,7 @@ function InputTextarea(props) {
29
30
  onChange
30
31
  }
31
32
  ) }),
32
- !!props.error && /* @__PURE__ */ jsx("div", { className: "iz-input-error", children: props.error })
33
+ !!props.error && /* @__PURE__ */ jsx(InputError, { children: props.error })
33
34
  ] });
34
35
  }
35
36
  export {
@@ -63,11 +63,6 @@ const Container = import_styled_components.default.div`
63
63
  }
64
64
  }
65
65
  }
66
-
67
- .iz-input-error {
68
- color: ${({ theme }) => theme.negative};
69
- font-size: .7rem;
70
- }
71
66
  `;
72
67
  // Annotate the CommonJS export names for ESM import in node:
73
68
  0 && (module.exports = {
@@ -30,11 +30,6 @@ const Container = styled.div`
30
30
  }
31
31
  }
32
32
  }
33
-
34
- .iz-input-error {
35
- color: ${({ theme }) => theme.negative};
36
- font-size: .7rem;
37
- }
38
33
  `;
39
34
  export {
40
35
  Container
@@ -13,6 +13,7 @@ export interface IInputCustom {
13
13
  disabled?: boolean;
14
14
  required?: boolean;
15
15
  register?: UseFormRegister<any>;
16
+ setValue?: (...args: any[]) => void;
16
17
  children: React.ReactNode;
17
18
  validation?: typeof z;
18
19
  }
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export interface IInputError {
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ }
@@ -12,5 +12,5 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var input_exports = {};
16
- module.exports = __toCommonJS(input_exports);
15
+ var error_exports = {};
16
+ module.exports = __toCommonJS(error_exports);
@@ -1,12 +1,13 @@
1
1
  import { IButton, IInputSelect, IInputFile, IInputText, IInputTextarea, IInputDateTime, IInputCustom } from "@interfaces";
2
2
  export * from "./file";
3
3
  export * from "./label";
4
- export * from "./input";
4
+ export * from "./text";
5
5
  export * from "./select";
6
6
  export * from "./button";
7
7
  export * from "./datetime";
8
8
  export * from "./textarea";
9
9
  export * from "./custom";
10
+ export * from "./error";
10
11
  export type IInputType = "text" | "password" | "select" | "textarea" | "date-time" | "file" | "custom";
11
12
  export interface IForm {
12
13
  defaultValues?: any;
@@ -17,20 +17,22 @@ var form_exports = {};
17
17
  module.exports = __toCommonJS(form_exports);
18
18
  __reExport(form_exports, require("./file"), module.exports);
19
19
  __reExport(form_exports, require("./label"), module.exports);
20
- __reExport(form_exports, require("./input"), module.exports);
20
+ __reExport(form_exports, require("./text"), module.exports);
21
21
  __reExport(form_exports, require("./select"), module.exports);
22
22
  __reExport(form_exports, require("./button"), module.exports);
23
23
  __reExport(form_exports, require("./datetime"), module.exports);
24
24
  __reExport(form_exports, require("./textarea"), module.exports);
25
25
  __reExport(form_exports, require("./custom"), module.exports);
26
+ __reExport(form_exports, require("./error"), module.exports);
26
27
  // Annotate the CommonJS export names for ESM import in node:
27
28
  0 && (module.exports = {
28
29
  ...require("./file"),
29
30
  ...require("./label"),
30
- ...require("./input"),
31
+ ...require("./text"),
31
32
  ...require("./select"),
32
33
  ...require("./button"),
33
34
  ...require("./datetime"),
34
35
  ...require("./textarea"),
35
- ...require("./custom")
36
+ ...require("./custom"),
37
+ ...require("./error")
36
38
  });
@@ -1,8 +1,9 @@
1
1
  export * from "./file";
2
2
  export * from "./label";
3
- export * from "./input";
3
+ export * from "./text";
4
4
  export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
8
  export * from "./custom";
9
+ export * from "./error";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var text_exports = {};
16
+ module.exports = __toCommonJS(text_exports);
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.20",
3
+ "version": "1.4.22",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",