@gustavo-valsechi/client 1.3.31 → 1.3.32

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 (201) hide show
  1. package/dist/components/index.js +3070 -13
  2. package/dist/components/index.mjs +3082 -11
  3. package/dist/contexts/index.js +504 -9
  4. package/dist/contexts/index.mjs +486 -4
  5. package/dist/index.js +3325 -8
  6. package/dist/index.mjs +3312 -4
  7. package/dist/interfaces/index.js +2 -8
  8. package/dist/interfaces/index.mjs +0 -2
  9. package/package.json +2 -2
  10. package/dist/components/styles.js +0 -54
  11. package/dist/components/styles.mjs +0 -19
  12. package/dist/components/types/avatar/index.js +0 -63
  13. package/dist/components/types/avatar/index.mjs +0 -29
  14. package/dist/components/types/avatar/styles.js +0 -93
  15. package/dist/components/types/avatar/styles.mjs +0 -59
  16. package/dist/components/types/badge/index.js +0 -54
  17. package/dist/components/types/badge/index.mjs +0 -20
  18. package/dist/components/types/badge/styles.js +0 -71
  19. package/dist/components/types/badge/styles.mjs +0 -37
  20. package/dist/components/types/block/index.js +0 -44
  21. package/dist/components/types/block/index.mjs +0 -20
  22. package/dist/components/types/block/styles.js +0 -65
  23. package/dist/components/types/block/styles.mjs +0 -30
  24. package/dist/components/types/chart/index.js +0 -80
  25. package/dist/components/types/chart/index.mjs +0 -46
  26. package/dist/components/types/chart/styles.js +0 -42
  27. package/dist/components/types/chart/styles.mjs +0 -8
  28. package/dist/components/types/credit-card/assets/index.js +0 -41
  29. package/dist/components/types/credit-card/assets/index.mjs +0 -21
  30. package/dist/components/types/credit-card/card/index.js +0 -67
  31. package/dist/components/types/credit-card/card/index.mjs +0 -37
  32. package/dist/components/types/credit-card/card/styles.js +0 -170
  33. package/dist/components/types/credit-card/card/styles.mjs +0 -136
  34. package/dist/components/types/credit-card/functions/index.js +0 -52
  35. package/dist/components/types/credit-card/functions/index.mjs +0 -22
  36. package/dist/components/types/credit-card/functions/styles.js +0 -75
  37. package/dist/components/types/credit-card/functions/styles.mjs +0 -41
  38. package/dist/components/types/credit-card/index.js +0 -70
  39. package/dist/components/types/credit-card/index.mjs +0 -36
  40. package/dist/components/types/credit-card/styles.js +0 -72
  41. package/dist/components/types/credit-card/styles.mjs +0 -38
  42. package/dist/components/types/credit-card/tools/index.js +0 -58
  43. package/dist/components/types/credit-card/tools/index.mjs +0 -23
  44. package/dist/components/types/form/index.js +0 -111
  45. package/dist/components/types/form/index.mjs +0 -75
  46. package/dist/components/types/form/styles.js +0 -53
  47. package/dist/components/types/form/styles.mjs +0 -19
  48. package/dist/components/types/form/types/button/index.js +0 -58
  49. package/dist/components/types/form/types/button/index.mjs +0 -24
  50. package/dist/components/types/form/types/button/loading/index.js +0 -38
  51. package/dist/components/types/form/types/button/loading/index.mjs +0 -14
  52. package/dist/components/types/form/types/button/loading/styles.js +0 -126
  53. package/dist/components/types/form/types/button/loading/styles.mjs +0 -92
  54. package/dist/components/types/form/types/button/styles.js +0 -79
  55. package/dist/components/types/form/types/button/styles.mjs +0 -45
  56. package/dist/components/types/form/types/datetime/index.js +0 -72
  57. package/dist/components/types/form/types/datetime/index.mjs +0 -38
  58. package/dist/components/types/form/types/datetime/styles.js +0 -78
  59. package/dist/components/types/form/types/datetime/styles.mjs +0 -44
  60. package/dist/components/types/form/types/file/index.js +0 -71
  61. package/dist/components/types/form/types/file/index.mjs +0 -47
  62. package/dist/components/types/form/types/file/styles.js +0 -65
  63. package/dist/components/types/form/types/file/styles.mjs +0 -31
  64. package/dist/components/types/form/types/index.js +0 -35
  65. package/dist/components/types/form/types/index.mjs +0 -8
  66. package/dist/components/types/form/types/input/index.js +0 -84
  67. package/dist/components/types/form/types/input/index.mjs +0 -50
  68. package/dist/components/types/form/types/input/styles.js +0 -84
  69. package/dist/components/types/form/types/input/styles.mjs +0 -50
  70. package/dist/components/types/form/types/label/index.js +0 -34
  71. package/dist/components/types/form/types/label/index.mjs +0 -10
  72. package/dist/components/types/form/types/label/styles.js +0 -45
  73. package/dist/components/types/form/types/label/styles.mjs +0 -11
  74. package/dist/components/types/form/types/select/index.js +0 -90
  75. package/dist/components/types/form/types/select/index.mjs +0 -56
  76. package/dist/components/types/form/types/select/styles.js +0 -90
  77. package/dist/components/types/form/types/select/styles.mjs +0 -56
  78. package/dist/components/types/form/types/textarea/index.js +0 -72
  79. package/dist/components/types/form/types/textarea/index.mjs +0 -38
  80. package/dist/components/types/form/types/textarea/styles.js +0 -77
  81. package/dist/components/types/form/types/textarea/styles.mjs +0 -43
  82. package/dist/components/types/index.js +0 -43
  83. package/dist/components/types/index.mjs +0 -12
  84. package/dist/components/types/loading/app/index.js +0 -35
  85. package/dist/components/types/loading/app/index.mjs +0 -11
  86. package/dist/components/types/loading/app/styles.js +0 -125
  87. package/dist/components/types/loading/app/styles.mjs +0 -91
  88. package/dist/components/types/loading/bar/index.js +0 -34
  89. package/dist/components/types/loading/bar/index.mjs +0 -10
  90. package/dist/components/types/loading/bar/styles.js +0 -59
  91. package/dist/components/types/loading/bar/styles.mjs +0 -25
  92. package/dist/components/types/loading/index.js +0 -25
  93. package/dist/components/types/loading/index.mjs +0 -3
  94. package/dist/components/types/logo/index.js +0 -37
  95. package/dist/components/types/logo/index.mjs +0 -13
  96. package/dist/components/types/logo/styles.js +0 -57
  97. package/dist/components/types/logo/styles.mjs +0 -23
  98. package/dist/components/types/lottie/animations/index.js +0 -36
  99. package/dist/components/types/lottie/animations/index.mjs +0 -6
  100. package/dist/components/types/lottie/index.js +0 -72
  101. package/dist/components/types/lottie/index.mjs +0 -38
  102. package/dist/components/types/lottie/styles.js +0 -60
  103. package/dist/components/types/lottie/styles.mjs +0 -26
  104. package/dist/components/types/modal/index.js +0 -66
  105. package/dist/components/types/modal/index.mjs +0 -32
  106. package/dist/components/types/modal/styles.js +0 -167
  107. package/dist/components/types/modal/styles.mjs +0 -133
  108. package/dist/components/types/table/index.js +0 -171
  109. package/dist/components/types/table/index.mjs +0 -135
  110. package/dist/components/types/table/modal/actions.js +0 -30
  111. package/dist/components/types/table/modal/actions.mjs +0 -10
  112. package/dist/components/types/table/modal/index.js +0 -91
  113. package/dist/components/types/table/modal/index.mjs +0 -61
  114. package/dist/components/types/table/modal/styles.js +0 -90
  115. package/dist/components/types/table/modal/styles.mjs +0 -56
  116. package/dist/components/types/table/paginate/index.js +0 -92
  117. package/dist/components/types/table/paginate/index.mjs +0 -58
  118. package/dist/components/types/table/paginate/styles.js +0 -74
  119. package/dist/components/types/table/paginate/styles.mjs +0 -40
  120. package/dist/components/types/table/styles.js +0 -300
  121. package/dist/components/types/table/styles.mjs +0 -266
  122. package/dist/contexts/icon/assets/brands/index.js +0 -31
  123. package/dist/contexts/icon/assets/brands/index.mjs +0 -11
  124. package/dist/contexts/icon/assets/index.js +0 -42
  125. package/dist/contexts/icon/assets/index.mjs +0 -12
  126. package/dist/contexts/icon/assets/regular/index.js +0 -31
  127. package/dist/contexts/icon/assets/regular/index.mjs +0 -11
  128. package/dist/contexts/icon/assets/solid/index.js +0 -31
  129. package/dist/contexts/icon/assets/solid/index.mjs +0 -11
  130. package/dist/contexts/icon/index.js +0 -107
  131. package/dist/contexts/icon/index.mjs +0 -72
  132. package/dist/contexts/icon/styles.js +0 -42
  133. package/dist/contexts/icon/styles.mjs +0 -8
  134. package/dist/contexts/modal/index.js +0 -92
  135. package/dist/contexts/modal/index.mjs +0 -57
  136. package/dist/contexts/modal/styles.js +0 -42
  137. package/dist/contexts/modal/styles.mjs +0 -8
  138. package/dist/contexts/theme/content.js +0 -104
  139. package/dist/contexts/theme/content.mjs +0 -79
  140. package/dist/contexts/theme/index.js +0 -68
  141. package/dist/contexts/theme/index.mjs +0 -43
  142. package/dist/contexts/theme/styles.js +0 -116
  143. package/dist/contexts/theme/styles.mjs +0 -82
  144. package/dist/contexts/tooltip/index.js +0 -107
  145. package/dist/contexts/tooltip/index.mjs +0 -72
  146. package/dist/contexts/tooltip/styles.js +0 -78
  147. package/dist/contexts/tooltip/styles.mjs +0 -44
  148. package/dist/interfaces/components/avatar/index.js +0 -17
  149. package/dist/interfaces/components/avatar/index.mjs +0 -1
  150. package/dist/interfaces/components/badge/index.js +0 -17
  151. package/dist/interfaces/components/badge/index.mjs +0 -1
  152. package/dist/interfaces/components/block/index.js +0 -17
  153. package/dist/interfaces/components/block/index.mjs +0 -1
  154. package/dist/interfaces/components/chart/index.js +0 -17
  155. package/dist/interfaces/components/chart/index.mjs +0 -1
  156. package/dist/interfaces/components/credit-card/index.js +0 -17
  157. package/dist/interfaces/components/credit-card/index.mjs +0 -1
  158. package/dist/interfaces/components/form/button/index.js +0 -17
  159. package/dist/interfaces/components/form/button/index.mjs +0 -1
  160. package/dist/interfaces/components/form/datetime/index.js +0 -17
  161. package/dist/interfaces/components/form/datetime/index.mjs +0 -1
  162. package/dist/interfaces/components/form/file/index.js +0 -17
  163. package/dist/interfaces/components/form/file/index.mjs +0 -1
  164. package/dist/interfaces/components/form/index.js +0 -35
  165. package/dist/interfaces/components/form/index.mjs +0 -8
  166. package/dist/interfaces/components/form/input/index.js +0 -17
  167. package/dist/interfaces/components/form/input/index.mjs +0 -1
  168. package/dist/interfaces/components/form/label/index.js +0 -17
  169. package/dist/interfaces/components/form/label/index.mjs +0 -1
  170. package/dist/interfaces/components/form/select/index.js +0 -17
  171. package/dist/interfaces/components/form/select/index.mjs +0 -1
  172. package/dist/interfaces/components/form/textarea/index.js +0 -17
  173. package/dist/interfaces/components/form/textarea/index.mjs +0 -1
  174. package/dist/interfaces/components/index.js +0 -43
  175. package/dist/interfaces/components/index.mjs +0 -12
  176. package/dist/interfaces/components/loading/app/index.js +0 -17
  177. package/dist/interfaces/components/loading/app/index.mjs +0 -1
  178. package/dist/interfaces/components/loading/bar/index.js +0 -17
  179. package/dist/interfaces/components/loading/bar/index.mjs +0 -1
  180. package/dist/interfaces/components/loading/index.js +0 -25
  181. package/dist/interfaces/components/loading/index.mjs +0 -3
  182. package/dist/interfaces/components/logo/index.js +0 -17
  183. package/dist/interfaces/components/logo/index.mjs +0 -1
  184. package/dist/interfaces/components/lottie/index.js +0 -17
  185. package/dist/interfaces/components/lottie/index.mjs +0 -1
  186. package/dist/interfaces/components/modal/index.js +0 -17
  187. package/dist/interfaces/components/modal/index.mjs +0 -1
  188. package/dist/interfaces/components/table/index.js +0 -23
  189. package/dist/interfaces/components/table/index.mjs +0 -2
  190. package/dist/interfaces/components/table/paginate/index.js +0 -17
  191. package/dist/interfaces/components/table/paginate/index.mjs +0 -1
  192. package/dist/interfaces/contexts/icon/index.js +0 -17
  193. package/dist/interfaces/contexts/icon/index.mjs +0 -1
  194. package/dist/interfaces/contexts/index.js +0 -29
  195. package/dist/interfaces/contexts/index.mjs +0 -5
  196. package/dist/interfaces/contexts/modal/index.js +0 -18
  197. package/dist/interfaces/contexts/modal/index.mjs +0 -2
  198. package/dist/interfaces/contexts/theme/index.js +0 -17
  199. package/dist/interfaces/contexts/theme/index.mjs +0 -1
  200. package/dist/interfaces/contexts/tooltip/index.js +0 -17
  201. package/dist/interfaces/contexts/tooltip/index.mjs +0 -1
@@ -1,36 +0,0 @@
1
- "use client";
2
- "use client";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { Container } from "./styles";
5
- import Card from "./card";
6
- import Functions from "./functions";
7
- function CreditCard(props) {
8
- const functions = [
9
- {
10
- icon: "fa-regular fa-pen-to-square",
11
- label: "Editar",
12
- function: props.onEdit,
13
- hide: !props.onEdit
14
- },
15
- {
16
- icon: "fa-solid fa-gear",
17
- label: "Configura\xE7\xF5es",
18
- function: props.onConfig,
19
- hide: !props.onConfig
20
- },
21
- {
22
- icon: "fa-solid fa-trash-can",
23
- label: "Remover",
24
- function: props.onRemove,
25
- hide: !props.onRemove
26
- },
27
- ...props.functions || []
28
- ];
29
- return /* @__PURE__ */ jsxs(Container, { children: [
30
- /* @__PURE__ */ jsx(Card, { ...props }),
31
- /* @__PURE__ */ jsx(Functions, { ...props, functions })
32
- ] });
33
- }
34
- export {
35
- CreditCard
36
- };
@@ -1,72 +0,0 @@
1
- "use client";
2
- "use strict";
3
- "use client";
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
- var styles_exports = {};
32
- __export(styles_exports, {
33
- Container: () => Container
34
- });
35
- module.exports = __toCommonJS(styles_exports);
36
- var import_styled_components = __toESM(require("styled-components"));
37
- const Container = import_styled_components.default.div`
38
- border-radius: 8px 8px 0 0;
39
- transition: .2s ease .2s background, .2s ease .2s padding;
40
- position: relative;
41
- display: flex;
42
- gap: .5rem;
43
- height: 11rem;
44
- pointer-events: all;
45
-
46
- @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
47
- width: 100%;
48
- }
49
-
50
- &:hover {
51
- .iz-credit-card-function-container {
52
- margin-left: 0;
53
-
54
- .iz-credit-card-function {
55
- transform: translateX(0);
56
- opacity: 1;
57
- }
58
-
59
- .iz-credit-card-function:nth-child(1) {
60
- transition: .3s ease transform, .2s ease .1s opacity, ease .3s color;
61
- }
62
-
63
- .iz-credit-card-function:nth-child(2) {
64
- transition: .3s ease .1s transform, .2s ease .2s opacity, ease .3s color;
65
- }
66
- }
67
- }
68
- `;
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- Container
72
- });
@@ -1,38 +0,0 @@
1
- "use client";
2
- "use client";
3
- import styled from "styled-components";
4
- const Container = styled.div`
5
- border-radius: 8px 8px 0 0;
6
- transition: .2s ease .2s background, .2s ease .2s padding;
7
- position: relative;
8
- display: flex;
9
- gap: .5rem;
10
- height: 11rem;
11
- pointer-events: all;
12
-
13
- @media(max-width: ${({ theme }) => theme.mobileMaxWidth}) {
14
- width: 100%;
15
- }
16
-
17
- &:hover {
18
- .iz-credit-card-function-container {
19
- margin-left: 0;
20
-
21
- .iz-credit-card-function {
22
- transform: translateX(0);
23
- opacity: 1;
24
- }
25
-
26
- .iz-credit-card-function:nth-child(1) {
27
- transition: .3s ease transform, .2s ease .1s opacity, ease .3s color;
28
- }
29
-
30
- .iz-credit-card-function:nth-child(2) {
31
- transition: .3s ease .1s transform, .2s ease .2s opacity, ease .3s color;
32
- }
33
- }
34
- }
35
- `;
36
- export {
37
- Container
38
- };
@@ -1,58 +0,0 @@
1
- "use client";
2
- "use strict";
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 tools_exports = {};
31
- __export(tools_exports, {
32
- getCardContent: () => getCardContent,
33
- validateLuhn: () => validateLuhn
34
- });
35
- module.exports = __toCommonJS(tools_exports);
36
- var import_credit_card_type = __toESM(require("credit-card-type"));
37
- var import_assets = __toESM(require("../assets"));
38
- var import_luhn = __toESM(require("luhn"));
39
- var import_lodash = __toESM(require("lodash"));
40
- const validateLuhn = import_luhn.default.validate;
41
- const getCardContent = (cardNumber) => {
42
- const content = { flag: "", logo: "" };
43
- if (!cardNumber) return content;
44
- const potentialCardContents = (0, import_credit_card_type.default)(cardNumber);
45
- if (potentialCardContents.length === 1) {
46
- const cardContent = potentialCardContents.shift();
47
- const flag = cardContent == null ? void 0 : cardContent.type;
48
- content.flag = flag || "";
49
- content.logo = import_assets.default[import_lodash.default.upperFirst(import_lodash.default.camelCase(flag))] || "";
50
- return content;
51
- }
52
- return content;
53
- };
54
- // Annotate the CommonJS export names for ESM import in node:
55
- 0 && (module.exports = {
56
- getCardContent,
57
- validateLuhn
58
- });
@@ -1,23 +0,0 @@
1
- "use client";
2
- import creditCardType from "credit-card-type";
3
- import assets from "../assets";
4
- import luhn from "luhn";
5
- import _ from "lodash";
6
- const validateLuhn = luhn.validate;
7
- const getCardContent = (cardNumber) => {
8
- const content = { flag: "", logo: "" };
9
- if (!cardNumber) return content;
10
- const potentialCardContents = creditCardType(cardNumber);
11
- if (potentialCardContents.length === 1) {
12
- const cardContent = potentialCardContents.shift();
13
- const flag = cardContent == null ? void 0 : cardContent.type;
14
- content.flag = flag || "";
15
- content.logo = assets[_.upperFirst(_.camelCase(flag))] || "";
16
- return content;
17
- }
18
- return content;
19
- };
20
- export {
21
- getCardContent,
22
- validateLuhn
23
- };
@@ -1,111 +0,0 @@
1
- "use client";
2
- "use strict";
3
- "use client";
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
- var form_exports = {};
33
- __export(form_exports, {
34
- Form: () => Form
35
- });
36
- module.exports = __toCommonJS(form_exports);
37
- var import_jsx_runtime = require("react/jsx-runtime");
38
- var import_react = __toESM(require("react"));
39
- var import_styles = require("./styles");
40
- var import_zod = require("zod");
41
- var import_react_hook_form = require("react-hook-form");
42
- var import_zod2 = require("@hookform/resolvers/zod");
43
- var import_lodash = __toESM(require("lodash"));
44
- var Types = __toESM(require("./types"));
45
- __reExport(form_exports, require("./types"), module.exports);
46
- function Form(props) {
47
- const formRef = props.formRef || (0, import_react.useRef)({});
48
- const setSchema = () => {
49
- const schema2 = {};
50
- import_lodash.default.forEach(props.inputs, (data) => {
51
- if (!data.validation) return;
52
- schema2[data.name] = data.validation;
53
- });
54
- if (props.validation) return props.validation(import_zod.z.object(schema2));
55
- return import_zod.z.object(schema2);
56
- };
57
- const schema = setSchema();
58
- const {
59
- register,
60
- handleSubmit,
61
- reset,
62
- formState: { errors }
63
- } = (0, import_react_hook_form.useForm)({
64
- resolver: (0, import_zod2.zodResolver)(schema),
65
- defaultValues: props.defaultValues,
66
- mode: "all"
67
- });
68
- (0, import_react.useEffect)(() => {
69
- if (!props.clearWhen) return;
70
- reset(void 0, { keepErrors: false });
71
- }, [props.clearWhen]);
72
- (0, import_react.useEffect)(() => {
73
- var _a;
74
- if (!props.defaultValues || !((_a = Object.keys(props.defaultValues || {})) == null ? void 0 : _a.length)) return;
75
- import_lodash.default.forEach(props.defaultValues, (value, key) => {
76
- const input = import_lodash.default.find(props.inputs, (data) => data.name === key);
77
- props.defaultValues[key] = input.mask ? input.mask(value) : value;
78
- });
79
- reset(props.defaultValues, { keepErrors: false });
80
- }, [props.defaultValues]);
81
- const component = (data) => {
82
- var _a;
83
- const component2 = Types[import_lodash.default.camelCase(data.type)];
84
- const TypeComponent = component2 || Types.InputText;
85
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
- TypeComponent,
87
- {
88
- ...import_lodash.default.omit(data, ["validation"]),
89
- id: data.name,
90
- type: component2 ? void 0 : data.type,
91
- error: (_a = errors[data.name]) == null ? void 0 : _a.message,
92
- register
93
- }
94
- );
95
- };
96
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { ref: formRef, onSubmit: handleSubmit(props.onSubmit), children: [
97
- import_lodash.default.map(
98
- props.inputs,
99
- (data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: component(data) }, index)
100
- ),
101
- import_lodash.default.isArray(props.buttons) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "form-buttons", children: import_lodash.default.map(
102
- props.buttons,
103
- (data, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Types.Button, { ...data }, index)
104
- ) })
105
- ] });
106
- }
107
- // Annotate the CommonJS export names for ESM import in node:
108
- 0 && (module.exports = {
109
- Form,
110
- ...require("./types")
111
- });
@@ -1,75 +0,0 @@
1
- "use client";
2
- "use client";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import React, { useEffect, useRef } from "react";
5
- import { Container } from "./styles";
6
- import { z } from "zod";
7
- import { useForm } from "react-hook-form";
8
- import { zodResolver } from "@hookform/resolvers/zod";
9
- import _ from "lodash";
10
- import * as Types from "./types";
11
- export * from "./types";
12
- function Form(props) {
13
- const formRef = props.formRef || useRef({});
14
- const setSchema = () => {
15
- const schema2 = {};
16
- _.forEach(props.inputs, (data) => {
17
- if (!data.validation) return;
18
- schema2[data.name] = data.validation;
19
- });
20
- if (props.validation) return props.validation(z.object(schema2));
21
- return z.object(schema2);
22
- };
23
- const schema = setSchema();
24
- const {
25
- register,
26
- handleSubmit,
27
- reset,
28
- formState: { errors }
29
- } = useForm({
30
- resolver: zodResolver(schema),
31
- defaultValues: props.defaultValues,
32
- mode: "all"
33
- });
34
- useEffect(() => {
35
- if (!props.clearWhen) return;
36
- reset(void 0, { keepErrors: false });
37
- }, [props.clearWhen]);
38
- useEffect(() => {
39
- var _a;
40
- if (!props.defaultValues || !((_a = Object.keys(props.defaultValues || {})) == null ? void 0 : _a.length)) return;
41
- _.forEach(props.defaultValues, (value, key) => {
42
- const input = _.find(props.inputs, (data) => data.name === key);
43
- props.defaultValues[key] = input.mask ? input.mask(value) : value;
44
- });
45
- reset(props.defaultValues, { keepErrors: false });
46
- }, [props.defaultValues]);
47
- const component = (data) => {
48
- var _a;
49
- const component2 = Types[_.camelCase(data.type)];
50
- const TypeComponent = component2 || Types.InputText;
51
- return /* @__PURE__ */ jsx(
52
- TypeComponent,
53
- {
54
- ..._.omit(data, ["validation"]),
55
- id: data.name,
56
- type: component2 ? void 0 : data.type,
57
- error: (_a = errors[data.name]) == null ? void 0 : _a.message,
58
- register
59
- }
60
- );
61
- };
62
- return /* @__PURE__ */ jsxs(Container, { ref: formRef, onSubmit: handleSubmit(props.onSubmit), children: [
63
- _.map(
64
- props.inputs,
65
- (data, index) => /* @__PURE__ */ jsx(React.Fragment, { children: component(data) }, index)
66
- ),
67
- _.isArray(props.buttons) && /* @__PURE__ */ jsx("div", { className: "form-buttons", children: _.map(
68
- props.buttons,
69
- (data, index) => /* @__PURE__ */ jsx(Types.Button, { ...data }, index)
70
- ) })
71
- ] });
72
- }
73
- export {
74
- Form
75
- };
@@ -1,53 +0,0 @@
1
- "use client";
2
- "use strict";
3
- "use client";
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
- var styles_exports = {};
32
- __export(styles_exports, {
33
- Container: () => Container
34
- });
35
- module.exports = __toCommonJS(styles_exports);
36
- var import_styled_components = __toESM(require("styled-components"));
37
- const Container = import_styled_components.default.form`
38
- width: 100%;
39
-
40
- .form-buttons {
41
- width: 100%;
42
- padding-top: 1rem;
43
-
44
- button {
45
- width: 100%;
46
- margin-top: 1rem;
47
- }
48
- }
49
- `;
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- Container
53
- });
@@ -1,19 +0,0 @@
1
- "use client";
2
- "use client";
3
- import styled from "styled-components";
4
- const Container = styled.form`
5
- width: 100%;
6
-
7
- .form-buttons {
8
- width: 100%;
9
- padding-top: 1rem;
10
-
11
- button {
12
- width: 100%;
13
- margin-top: 1rem;
14
- }
15
- }
16
- `;
17
- export {
18
- Container
19
- };
@@ -1,58 +0,0 @@
1
- "use client";
2
- "use strict";
3
- "use client";
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
- var button_exports = {};
32
- __export(button_exports, {
33
- Button: () => Button
34
- });
35
- module.exports = __toCommonJS(button_exports);
36
- var import_jsx_runtime = require("react/jsx-runtime");
37
- var import_styles = require("./styles");
38
- var import_loading = require("./loading");
39
- var import_lodash = __toESM(require("lodash"));
40
- function Button(props) {
41
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
42
- import_styles.Container,
43
- {
44
- loading: String(!!props.loading),
45
- disabled: props.disabled,
46
- type: props.type || "button",
47
- ...import_lodash.default.omit(props, ["loading", "type"]),
48
- children: [
49
- !!props.loading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_loading.Loading, {}),
50
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: props.label })
51
- ]
52
- }
53
- );
54
- }
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- Button
58
- });
@@ -1,24 +0,0 @@
1
- "use client";
2
- "use client";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { Container } from "./styles";
5
- import { Loading } from "./loading";
6
- import _ from "lodash";
7
- function Button(props) {
8
- return /* @__PURE__ */ jsxs(
9
- Container,
10
- {
11
- loading: String(!!props.loading),
12
- disabled: props.disabled,
13
- type: props.type || "button",
14
- ..._.omit(props, ["loading", "type"]),
15
- children: [
16
- !!props.loading && /* @__PURE__ */ jsx(Loading, {}),
17
- /* @__PURE__ */ jsx("span", { children: props.label })
18
- ]
19
- }
20
- );
21
- }
22
- export {
23
- Button
24
- };
@@ -1,38 +0,0 @@
1
- "use client";
2
- "use strict";
3
- "use client";
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var loading_exports = {};
22
- __export(loading_exports, {
23
- Loading: () => Loading
24
- });
25
- module.exports = __toCommonJS(loading_exports);
26
- var import_jsx_runtime = require("react/jsx-runtime");
27
- var import_styles = require("./styles");
28
- function Loading() {
29
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.Container, { children: [
30
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
31
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
32
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {})
33
- ] });
34
- }
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- Loading
38
- });
@@ -1,14 +0,0 @@
1
- "use client";
2
- "use client";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { Container } from "./styles";
5
- function Loading() {
6
- return /* @__PURE__ */ jsxs(Container, { children: [
7
- /* @__PURE__ */ jsx("div", {}),
8
- /* @__PURE__ */ jsx("div", {}),
9
- /* @__PURE__ */ jsx("div", {})
10
- ] });
11
- }
12
- export {
13
- Loading
14
- };