@gustavo-valsechi/client 1.4.18 → 1.4.20

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 (32) hide show
  1. package/dist/components/types/form/index.js +1 -1
  2. package/dist/components/types/form/index.mjs +1 -1
  3. package/dist/components/types/form/styles.js +3 -0
  4. package/dist/components/types/form/styles.mjs +3 -0
  5. package/dist/components/types/form/types/custom/index.d.ts +2 -0
  6. package/dist/components/types/form/types/custom/index.js +43 -0
  7. package/dist/components/types/form/types/custom/index.mjs +19 -0
  8. package/dist/components/types/form/types/custom/styles.d.ts +1 -0
  9. package/dist/components/types/form/types/custom/styles.js +47 -0
  10. package/dist/components/types/form/types/custom/styles.mjs +13 -0
  11. package/dist/components/types/form/types/datetime/styles.js +0 -1
  12. package/dist/components/types/form/types/datetime/styles.mjs +0 -1
  13. package/dist/components/types/form/types/file/styles.js +0 -1
  14. package/dist/components/types/form/types/file/styles.mjs +0 -1
  15. package/dist/components/types/form/types/index.d.ts +1 -0
  16. package/dist/components/types/form/types/index.js +3 -1
  17. package/dist/components/types/form/types/index.mjs +1 -0
  18. package/dist/components/types/form/types/input/styles.js +0 -1
  19. package/dist/components/types/form/types/input/styles.mjs +0 -1
  20. package/dist/components/types/form/types/select/styles.js +0 -1
  21. package/dist/components/types/form/types/select/styles.mjs +0 -1
  22. package/dist/components/types/form/types/textarea/styles.js +0 -1
  23. package/dist/components/types/form/types/textarea/styles.mjs +0 -1
  24. package/dist/contexts/tooltip/index.js +7 -0
  25. package/dist/contexts/tooltip/index.mjs +7 -0
  26. package/dist/interfaces/components/form/custom/index.d.ts +18 -0
  27. package/dist/interfaces/components/form/custom/index.js +16 -0
  28. package/dist/interfaces/components/form/custom/index.mjs +0 -0
  29. package/dist/interfaces/components/form/index.d.ts +3 -6
  30. package/dist/interfaces/components/form/index.js +3 -1
  31. package/dist/interfaces/components/form/index.mjs +1 -0
  32. package/package.json +1 -1
@@ -109,7 +109,7 @@ function Form(props) {
109
109
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { ref: formRef, onSubmit: handleSubmit(onSubmit), children: [
110
110
  import_lodash.default.map(
111
111
  props.inputs,
112
- (data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: data.type === "custom" ? data.component : component(data) }, index)
112
+ (data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: component(data) }, index)
113
113
  ),
114
114
  import_lodash.default.isArray(props.buttons) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-buttons", children: import_lodash.default.map(
115
115
  props.buttons,
@@ -75,7 +75,7 @@ function Form(props) {
75
75
  return /* @__PURE__ */ jsxs(Container, { ref: formRef, onSubmit: handleSubmit(onSubmit), children: [
76
76
  _.map(
77
77
  props.inputs,
78
- (data, index) => /* @__PURE__ */ jsx(React.Fragment, { children: data.type === "custom" ? data.component : component(data) }, index)
78
+ (data, index) => /* @__PURE__ */ jsx(React.Fragment, { children: component(data) }, index)
79
79
  ),
80
80
  _.isArray(props.buttons) && /* @__PURE__ */ jsx("div", { className: "form-buttons", children: _.map(
81
81
  props.buttons,
@@ -35,6 +35,9 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.form`
37
37
  width: 100%;
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: .3rem;
38
41
 
39
42
  .form-buttons {
40
43
  width: 100%;
@@ -2,6 +2,9 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.form`
4
4
  width: 100%;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: .3rem;
5
8
 
6
9
  .form-buttons {
7
10
  width: 100%;
@@ -0,0 +1,2 @@
1
+ import { IInputCustom } from "@interfaces";
2
+ export declare function InputCustom(props: IInputCustom): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,43 @@
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 custom_exports = {};
21
+ __export(custom_exports, {
22
+ InputCustom: () => InputCustom
23
+ });
24
+ module.exports = __toCommonJS(custom_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_styles = require("./styles");
27
+ var import_label = require("../label");
28
+ function InputCustom(props) {
29
+ const register = (props.register || ((name) => ({})))(props.name || "");
30
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { className: props.className, children: [
31
+ !!props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.InputLabel, { children: [
32
+ props.label,
33
+ props.required ? "*" : ""
34
+ ] }),
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 })
38
+ ] });
39
+ }
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ InputCustom
43
+ });
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Container } from "./styles";
4
+ import { InputLabel } from "../label";
5
+ function InputCustom(props) {
6
+ const register = (props.register || ((name) => ({})))(props.name || "");
7
+ return /* @__PURE__ */ jsxs(Container, { className: props.className, children: [
8
+ !!props.label && /* @__PURE__ */ jsxs(InputLabel, { children: [
9
+ props.label,
10
+ props.required ? "*" : ""
11
+ ] }),
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 })
15
+ ] });
16
+ }
17
+ export {
18
+ InputCustom
19
+ };
@@ -0,0 +1 @@
1
+ export declare const Container: any;
@@ -0,0 +1,47 @@
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.div`
37
+ width: 100%;
38
+
39
+ .iz-input-error {
40
+ color: ${({ theme }) => theme.negative};
41
+ font-size: .7rem;
42
+ }
43
+ `;
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ Container
47
+ });
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import styled from "styled-components";
3
+ const Container = styled.div`
4
+ width: 100%;
5
+
6
+ .iz-input-error {
7
+ color: ${({ theme }) => theme.negative};
8
+ font-size: .7rem;
9
+ }
10
+ `;
11
+ export {
12
+ Container
13
+ };
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
- padding-top: .3rem;
39
38
 
40
39
  .iz-input-content {
41
40
  display: flex;
@@ -2,7 +2,6 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
- padding-top: .3rem;
6
5
 
7
6
  .iz-input-content {
8
7
  display: flex;
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
- padding-top: .3rem;
39
38
 
40
39
  .iz-image-content {
41
40
  display: flex;
@@ -2,7 +2,6 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
- padding-top: .3rem;
6
5
 
7
6
  .iz-image-content {
8
7
  display: flex;
@@ -5,3 +5,4 @@ export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
+ export * from "./custom";
@@ -22,6 +22,7 @@ __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
+ __reExport(types_exports, require("./custom"), module.exports);
25
26
  // Annotate the CommonJS export names for ESM import in node:
26
27
  0 && (module.exports = {
27
28
  ...require("./file"),
@@ -30,5 +31,6 @@ __reExport(types_exports, require("./textarea"), module.exports);
30
31
  ...require("./select"),
31
32
  ...require("./button"),
32
33
  ...require("./datetime"),
33
- ...require("./textarea")
34
+ ...require("./textarea"),
35
+ ...require("./custom")
34
36
  });
@@ -5,3 +5,4 @@ export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
+ export * from "./custom";
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
- padding-top: .3rem;
39
38
 
40
39
  .iz-input-content {
41
40
  display: flex;
@@ -2,7 +2,6 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
- padding-top: .3rem;
6
5
 
7
6
  .iz-input-content {
8
7
  display: flex;
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
- padding-top: .3rem;
39
38
 
40
39
  .iz-input-content {
41
40
  display: flex;
@@ -2,7 +2,6 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
- padding-top: .3rem;
6
5
 
7
6
  .iz-input-content {
8
7
  display: flex;
@@ -35,7 +35,6 @@ module.exports = __toCommonJS(styles_exports);
35
35
  var import_styled_components = __toESM(require("styled-components"));
36
36
  const Container = import_styled_components.default.div`
37
37
  width: 100%;
38
- padding-top: .3rem;
39
38
 
40
39
  .iz-input-content {
41
40
  display: flex;
@@ -2,7 +2,6 @@
2
2
  import styled from "styled-components";
3
3
  const Container = styled.div`
4
4
  width: 100%;
5
- padding-top: .3rem;
6
5
 
7
6
  .iz-input-content {
8
7
  display: flex;
@@ -90,6 +90,13 @@ const TooltipProviderContainer = ({ children }) => {
90
90
  el.querySelectorAll("[data-tooltip]").forEach((child) => processElement(child));
91
91
  }
92
92
  });
93
+ mutation.removedNodes.forEach((node) => {
94
+ if (node.nodeType === 1) {
95
+ const target = node;
96
+ if (!target) return;
97
+ setTooltips(import_lodash.default.filter(tooltips, (data) => JSON.stringify(data) === JSON.stringify(getContent(target))));
98
+ }
99
+ });
93
100
  });
94
101
  });
95
102
  observer.observe(document.body, {
@@ -56,6 +56,13 @@ const TooltipProviderContainer = ({ children }) => {
56
56
  el.querySelectorAll("[data-tooltip]").forEach((child) => processElement(child));
57
57
  }
58
58
  });
59
+ mutation.removedNodes.forEach((node) => {
60
+ if (node.nodeType === 1) {
61
+ const target = node;
62
+ if (!target) return;
63
+ setTooltips(_.filter(tooltips, (data) => JSON.stringify(data) === JSON.stringify(getContent(target))));
64
+ }
65
+ });
59
66
  });
60
67
  });
61
68
  observer.observe(document.body, {
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { UseFormRegister } from "react-hook-form";
3
+ import { IInputType } from "@interfaces";
4
+ import { z } from "zod";
5
+ export interface IInputCustom {
6
+ className?: string;
7
+ label?: string;
8
+ id?: string;
9
+ name?: string;
10
+ type?: IInputType;
11
+ value?: string;
12
+ error?: string;
13
+ disabled?: boolean;
14
+ required?: boolean;
15
+ register?: UseFormRegister<any>;
16
+ children: React.ReactNode;
17
+ validation?: typeof z;
18
+ }
@@ -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 custom_exports = {};
16
+ module.exports = __toCommonJS(custom_exports);
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import { IButton, IInputSelect, IInputFile, IInputText, IInputTextarea, IInputDateTime } from "@interfaces";
1
+ import { IButton, IInputSelect, IInputFile, IInputText, IInputTextarea, IInputDateTime, IInputCustom } from "@interfaces";
3
2
  export * from "./file";
4
3
  export * from "./label";
5
4
  export * from "./input";
@@ -7,6 +6,7 @@ export * from "./select";
7
6
  export * from "./button";
8
7
  export * from "./datetime";
9
8
  export * from "./textarea";
9
+ export * from "./custom";
10
10
  export type IInputType = "text" | "password" | "select" | "textarea" | "date-time" | "file" | "custom";
11
11
  export interface IForm {
12
12
  defaultValues?: any;
@@ -14,9 +14,6 @@ export interface IForm {
14
14
  formRef?: any;
15
15
  onSubmit: (values: any, actions?: any) => void;
16
16
  clearWhen?: boolean;
17
- inputs: Array<IInputSelect & IInputFile & IInputText & IInputTextarea & IInputDateTime & {
18
- type: IInputType;
19
- component: React.ReactNode;
20
- }>;
17
+ inputs: Array<IInputSelect & IInputFile & IInputText & IInputTextarea & IInputDateTime & IInputCustom>;
21
18
  buttons?: Array<IButton>;
22
19
  }
@@ -22,6 +22,7 @@ __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
+ __reExport(form_exports, require("./custom"), module.exports);
25
26
  // Annotate the CommonJS export names for ESM import in node:
26
27
  0 && (module.exports = {
27
28
  ...require("./file"),
@@ -30,5 +31,6 @@ __reExport(form_exports, require("./textarea"), module.exports);
30
31
  ...require("./select"),
31
32
  ...require("./button"),
32
33
  ...require("./datetime"),
33
- ...require("./textarea")
34
+ ...require("./textarea"),
35
+ ...require("./custom")
34
36
  });
@@ -5,3 +5,4 @@ export * from "./select";
5
5
  export * from "./button";
6
6
  export * from "./datetime";
7
7
  export * from "./textarea";
8
+ export * from "./custom";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.18",
3
+ "version": "1.4.20",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",