@gustavo-valsechi/client 1.3.29 → 1.3.30

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 +14 -3070
  2. package/dist/components/index.mjs +12 -3082
  3. package/dist/components/styles.js +3 -4
  4. package/dist/components/styles.mjs +3 -4
  5. package/dist/components/types/avatar/index.js +4 -62
  6. package/dist/components/types/avatar/index.mjs +3 -61
  7. package/dist/components/types/avatar/styles.js +2 -3
  8. package/dist/components/types/avatar/styles.mjs +2 -3
  9. package/dist/components/types/badge/index.js +5 -304
  10. package/dist/components/types/badge/index.mjs +5 -308
  11. package/dist/components/types/badge/styles.js +2 -3
  12. package/dist/components/types/badge/styles.mjs +2 -3
  13. package/dist/components/types/block/index.js +9 -3046
  14. package/dist/components/types/block/index.mjs +9 -3066
  15. package/dist/components/types/block/styles.js +3 -4
  16. package/dist/components/types/block/styles.mjs +3 -4
  17. package/dist/components/types/chart/index.js +13 -284
  18. package/dist/components/types/chart/index.mjs +13 -288
  19. package/dist/components/types/chart/styles.js +2 -3
  20. package/dist/components/types/chart/styles.mjs +2 -2
  21. package/dist/components/types/credit-card/assets/index.js +2 -3
  22. package/dist/components/types/credit-card/assets/index.mjs +2 -2
  23. package/dist/components/types/credit-card/card/index.js +9 -681
  24. package/dist/components/types/credit-card/card/index.mjs +7 -701
  25. package/dist/components/types/credit-card/card/styles.js +2 -3
  26. package/dist/components/types/credit-card/card/styles.mjs +2 -3
  27. package/dist/components/types/credit-card/functions/index.js +4 -44
  28. package/dist/components/types/credit-card/functions/index.mjs +3 -41
  29. package/dist/components/types/credit-card/functions/styles.js +2 -3
  30. package/dist/components/types/credit-card/functions/styles.mjs +2 -3
  31. package/dist/components/types/credit-card/index.js +7 -803
  32. package/dist/components/types/credit-card/index.mjs +7 -823
  33. package/dist/components/types/credit-card/styles.js +2 -3
  34. package/dist/components/types/credit-card/styles.mjs +2 -3
  35. package/dist/components/types/credit-card/tools/index.js +7 -527
  36. package/dist/components/types/credit-card/tools/index.mjs +8 -550
  37. package/dist/components/types/form/index.js +24 -659
  38. package/dist/components/types/form/index.mjs +20 -655
  39. package/dist/components/types/form/styles.js +2 -3
  40. package/dist/components/types/form/styles.mjs +2 -3
  41. package/dist/components/types/form/types/button/index.js +7 -149
  42. package/dist/components/types/form/types/button/index.mjs +6 -146
  43. package/dist/components/types/form/types/button/loading/index.js +3 -104
  44. package/dist/components/types/form/types/button/loading/index.mjs +2 -91
  45. package/dist/components/types/form/types/button/loading/styles.js +2 -3
  46. package/dist/components/types/form/types/button/loading/styles.mjs +2 -3
  47. package/dist/components/types/form/types/button/styles.js +2 -3
  48. package/dist/components/types/form/types/button/styles.mjs +2 -3
  49. package/dist/components/types/form/types/datetime/index.js +7 -63
  50. package/dist/components/types/form/types/datetime/index.mjs +6 -60
  51. package/dist/components/types/form/types/datetime/styles.js +2 -3
  52. package/dist/components/types/form/types/datetime/styles.mjs +2 -3
  53. package/dist/components/types/form/types/file/index.js +9 -62
  54. package/dist/components/types/form/types/file/index.mjs +7 -50
  55. package/dist/components/types/form/types/file/styles.js +2 -3
  56. package/dist/components/types/form/types/file/styles.mjs +2 -3
  57. package/dist/components/types/form/types/index.js +16 -625
  58. package/dist/components/types/form/types/index.mjs +8 -601
  59. package/dist/components/types/form/types/input/index.js +10 -72
  60. package/dist/components/types/form/types/input/index.mjs +7 -69
  61. package/dist/components/types/form/types/input/styles.js +2 -3
  62. package/dist/components/types/form/types/input/styles.mjs +2 -3
  63. package/dist/components/types/form/types/label/index.js +3 -23
  64. package/dist/components/types/form/types/label/index.mjs +2 -10
  65. package/dist/components/types/form/types/label/styles.js +2 -3
  66. package/dist/components/types/form/types/label/styles.mjs +2 -3
  67. package/dist/components/types/form/types/select/index.js +11 -79
  68. package/dist/components/types/form/types/select/index.mjs +8 -76
  69. package/dist/components/types/form/types/select/styles.js +2 -3
  70. package/dist/components/types/form/types/select/styles.mjs +2 -3
  71. package/dist/components/types/form/types/textarea/index.js +7 -62
  72. package/dist/components/types/form/types/textarea/index.mjs +6 -59
  73. package/dist/components/types/form/types/textarea/styles.js +2 -3
  74. package/dist/components/types/form/types/textarea/styles.mjs +2 -3
  75. package/dist/components/types/index.js +24 -3072
  76. package/dist/components/types/index.mjs +12 -3093
  77. package/dist/components/types/loading/app/index.js +4 -132
  78. package/dist/components/types/loading/app/index.mjs +5 -121
  79. package/dist/components/types/loading/app/styles.js +2 -3
  80. package/dist/components/types/loading/app/styles.mjs +2 -3
  81. package/dist/components/types/loading/bar/index.js +3 -37
  82. package/dist/components/types/loading/bar/index.mjs +2 -24
  83. package/dist/components/types/loading/bar/styles.js +2 -3
  84. package/dist/components/types/loading/bar/styles.mjs +2 -3
  85. package/dist/components/types/loading/index.js +6 -173
  86. package/dist/components/types/loading/index.mjs +3 -154
  87. package/dist/components/types/logo/index.js +3 -35
  88. package/dist/components/types/logo/index.mjs +2 -22
  89. package/dist/components/types/logo/styles.js +2 -3
  90. package/dist/components/types/logo/styles.mjs +2 -3
  91. package/dist/components/types/lottie/animations/index.js +13 -8
  92. package/dist/components/types/lottie/animations/index.mjs +3 -5
  93. package/dist/components/types/lottie/index.js +7 -39
  94. package/dist/components/types/lottie/index.mjs +6 -36
  95. package/dist/components/types/lottie/styles.js +2 -3
  96. package/dist/components/types/lottie/styles.mjs +2 -3
  97. package/dist/components/types/modal/index.js +18 -2283
  98. package/dist/components/types/modal/index.mjs +18 -2309
  99. package/dist/components/types/modal/styles.js +2 -3
  100. package/dist/components/types/modal/styles.mjs +2 -3
  101. package/dist/components/types/table/index.js +45 -2955
  102. package/dist/components/types/table/index.mjs +40 -2983
  103. package/dist/components/types/table/modal/actions.js +4 -82
  104. package/dist/components/types/table/modal/actions.mjs +3 -78
  105. package/dist/components/types/table/modal/index.js +22 -3006
  106. package/dist/components/types/table/modal/index.mjs +19 -3033
  107. package/dist/components/types/table/modal/styles.js +2 -3
  108. package/dist/components/types/table/modal/styles.mjs +2 -3
  109. package/dist/components/types/table/paginate/index.js +4 -43
  110. package/dist/components/types/table/paginate/index.mjs +3 -40
  111. package/dist/components/types/table/paginate/styles.js +2 -3
  112. package/dist/components/types/table/paginate/styles.mjs +2 -3
  113. package/dist/components/types/table/styles.js +2 -3
  114. package/dist/components/types/table/styles.mjs +2 -3
  115. package/dist/contexts/icon/assets/brands/index.js +3 -4
  116. package/dist/contexts/icon/assets/brands/index.mjs +3 -10
  117. package/dist/contexts/icon/assets/index.js +17 -34
  118. package/dist/contexts/icon/assets/index.mjs +7 -38
  119. package/dist/contexts/icon/assets/regular/index.js +3 -4
  120. package/dist/contexts/icon/assets/regular/index.mjs +3 -10
  121. package/dist/contexts/icon/assets/solid/index.js +3 -4
  122. package/dist/contexts/icon/assets/solid/index.mjs +3 -10
  123. package/dist/contexts/icon/index.js +15 -217
  124. package/dist/contexts/icon/index.mjs +15 -223
  125. package/dist/contexts/icon/styles.js +2 -3
  126. package/dist/contexts/icon/styles.mjs +2 -2
  127. package/dist/contexts/index.js +10 -504
  128. package/dist/contexts/index.mjs +5 -486
  129. package/dist/contexts/modal/index.js +8 -16
  130. package/dist/contexts/modal/index.mjs +7 -15
  131. package/dist/contexts/modal/styles.js +2 -3
  132. package/dist/contexts/modal/styles.mjs +2 -2
  133. package/dist/contexts/theme/content.js +3 -4
  134. package/dist/contexts/theme/content.mjs +3 -3
  135. package/dist/contexts/theme/index.js +11 -178
  136. package/dist/contexts/theme/index.mjs +7 -164
  137. package/dist/contexts/theme/styles.js +2 -3
  138. package/dist/contexts/theme/styles.mjs +2 -2
  139. package/dist/contexts/tooltip/index.js +7 -51
  140. package/dist/contexts/tooltip/index.mjs +6 -50
  141. package/dist/contexts/tooltip/styles.js +2 -3
  142. package/dist/contexts/tooltip/styles.mjs +2 -2
  143. package/dist/index.js +9 -3325
  144. package/dist/index.mjs +5 -3312
  145. package/dist/interfaces/components/avatar/index.js +1 -2
  146. package/dist/interfaces/components/avatar/index.mjs +1 -0
  147. package/dist/interfaces/components/badge/index.js +1 -2
  148. package/dist/interfaces/components/badge/index.mjs +1 -0
  149. package/dist/interfaces/components/block/index.js +1 -2
  150. package/dist/interfaces/components/block/index.mjs +1 -0
  151. package/dist/interfaces/components/chart/index.js +1 -2
  152. package/dist/interfaces/components/chart/index.mjs +1 -0
  153. package/dist/interfaces/components/credit-card/index.js +1 -2
  154. package/dist/interfaces/components/credit-card/index.mjs +1 -0
  155. package/dist/interfaces/components/form/button/index.js +1 -2
  156. package/dist/interfaces/components/form/button/index.mjs +1 -0
  157. package/dist/interfaces/components/form/datetime/index.js +1 -2
  158. package/dist/interfaces/components/form/datetime/index.mjs +1 -0
  159. package/dist/interfaces/components/form/file/index.js +1 -2
  160. package/dist/interfaces/components/form/file/index.mjs +1 -0
  161. package/dist/interfaces/components/form/index.js +19 -2
  162. package/dist/interfaces/components/form/index.mjs +8 -0
  163. package/dist/interfaces/components/form/input/index.js +1 -2
  164. package/dist/interfaces/components/form/input/index.mjs +1 -0
  165. package/dist/interfaces/components/form/label/index.js +1 -2
  166. package/dist/interfaces/components/form/label/index.mjs +1 -0
  167. package/dist/interfaces/components/form/select/index.js +1 -2
  168. package/dist/interfaces/components/form/select/index.mjs +1 -0
  169. package/dist/interfaces/components/form/textarea/index.js +1 -2
  170. package/dist/interfaces/components/form/textarea/index.mjs +1 -0
  171. package/dist/interfaces/components/index.js +27 -2
  172. package/dist/interfaces/components/index.mjs +12 -0
  173. package/dist/interfaces/components/loading/app/index.js +1 -2
  174. package/dist/interfaces/components/loading/app/index.mjs +1 -0
  175. package/dist/interfaces/components/loading/bar/index.js +1 -2
  176. package/dist/interfaces/components/loading/bar/index.mjs +1 -0
  177. package/dist/interfaces/components/loading/index.js +9 -2
  178. package/dist/interfaces/components/loading/index.mjs +3 -0
  179. package/dist/interfaces/components/logo/index.js +1 -2
  180. package/dist/interfaces/components/logo/index.mjs +1 -0
  181. package/dist/interfaces/components/lottie/index.js +1 -2
  182. package/dist/interfaces/components/lottie/index.mjs +1 -0
  183. package/dist/interfaces/components/modal/index.js +1 -2
  184. package/dist/interfaces/components/modal/index.mjs +1 -0
  185. package/dist/interfaces/components/table/index.js +7 -2
  186. package/dist/interfaces/components/table/index.mjs +2 -0
  187. package/dist/interfaces/components/table/paginate/index.js +1 -2
  188. package/dist/interfaces/components/table/paginate/index.mjs +1 -0
  189. package/dist/interfaces/contexts/icon/index.js +1 -2
  190. package/dist/interfaces/contexts/icon/index.mjs +1 -0
  191. package/dist/interfaces/contexts/index.js +13 -2
  192. package/dist/interfaces/contexts/index.mjs +5 -0
  193. package/dist/interfaces/contexts/modal/index.js +1 -2
  194. package/dist/interfaces/contexts/modal/index.mjs +1 -0
  195. package/dist/interfaces/contexts/theme/index.js +1 -2
  196. package/dist/interfaces/contexts/theme/index.mjs +1 -0
  197. package/dist/interfaces/contexts/tooltip/index.js +1 -2
  198. package/dist/interfaces/contexts/tooltip/index.mjs +1 -0
  199. package/dist/interfaces/index.js +9 -2
  200. package/dist/interfaces/index.mjs +3 -0
  201. package/package.json +1 -1
@@ -1,647 +1,19 @@
1
1
  "use client";
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, { get: all[name], enumerable: true });
6
- };
7
-
8
- // components/types/form/index.tsx
9
- import React4, { useEffect, useRef as useRef2 } from "react";
10
-
11
- // components/types/form/styles.tsx
12
- import styled from "styled-components";
13
- var Container = styled.form`
14
- width: 100%;
15
-
16
- .form-buttons {
17
- width: 100%;
18
- padding-top: 1rem;
19
-
20
- button {
21
- width: 100%;
22
- margin-top: 1rem;
23
- }
24
- }
25
- `;
26
-
27
- // components/types/form/index.tsx
2
+ "use client";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import React, { useEffect, useRef } from "react";
5
+ import { Container } from "./styles";
28
6
  import { z } from "zod";
29
7
  import { useForm } from "react-hook-form";
30
8
  import { zodResolver } from "@hookform/resolvers/zod";
31
- import _6 from "lodash";
32
-
33
- // components/types/form/types/index.tsx
34
- var types_exports = {};
35
- __export(types_exports, {
36
- Button: () => Button,
37
- InputDateTime: () => InputDateTime,
38
- InputFile: () => InputFile,
39
- InputLabel: () => InputLabel,
40
- InputSelect: () => InputSelect,
41
- InputText: () => InputText,
42
- InputTextarea: () => InputTextarea
43
- });
44
-
45
- // components/types/form/types/file/index.tsx
46
- import { useRef } from "react";
47
-
48
- // components/types/form/types/file/styles.tsx
49
- import styled2 from "styled-components";
50
- var Container2 = styled2.div`
51
- width: 100%;
52
- padding-top: .3rem;
53
-
54
- .iz-image-content {
55
- display: flex;
56
- align-items: center;
57
- justify-content: center;
58
- border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
59
- border-radius: 5px;
60
- overflow: hidden;
61
- padding: .5rem 1rem;
62
- width: 100%;
63
- font-size: .8rem;
64
- background: ${(props) => props.disabled ? "${({ theme }) => theme.t2}" : "${({ theme }) => theme.primary}"};
65
- opacity: ${(props) => props.disabled ? ".7" : "1"};
66
- color: ${({ theme }) => theme.t6};
67
- cursor: pointer;
68
- }
69
-
70
- .iz-input-error {
71
- color: ${({ theme }) => theme.negative};
72
- font-size: .7rem;
73
- }
74
- `;
75
-
76
- // components/types/form/types/label/styles.tsx
77
- import styled3 from "styled-components";
78
- var Container3 = styled3.label`
79
- font-size: .8rem;
80
- font-weight: 500;
81
- color: ${({ theme }) => theme.t6};
82
- `;
83
-
84
- // components/types/form/types/label/index.tsx
85
- import { jsx } from "react/jsx-runtime";
86
- function InputLabel(props) {
87
- return /* @__PURE__ */ jsx(Container3, { className: props.className, children: props.children });
88
- }
89
-
90
- // components/types/form/types/file/index.tsx
91
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
92
- function InputFile(props) {
93
- var _a;
94
- const inputRef = useRef({});
95
- const register = (props.register || ((name) => ({})))(props.name || "");
96
- const readImage = (data) => {
97
- if (props.onPreview) props.onPreview(URL.createObjectURL(data));
98
- if (props.onChange) props.onChange(data);
99
- };
100
- return /* @__PURE__ */ jsxs(Container2, { className: props.className, error: props.error, disabled: props.disabled, children: [
101
- /* @__PURE__ */ jsx2(
102
- "input",
103
- {
104
- hidden: true,
105
- type: "file",
106
- id: "file",
107
- accept: "image/*",
108
- ref: inputRef,
109
- disabled: props.disabled,
110
- name: props.name,
111
- onFocus: () => {
112
- if (props.onFocus) props.onFocus(props.name);
113
- },
114
- ...register,
115
- onChange: (e) => {
116
- var _a2;
117
- register.onChange(e);
118
- readImage((_a2 = e.target.files) == null ? void 0 : _a2[0]);
119
- }
120
- }
121
- ),
122
- !!props.label && /* @__PURE__ */ jsxs(InputLabel, { children: [
123
- props.label,
124
- props.required ? "*" : ""
125
- ] }),
126
- /* @__PURE__ */ jsx2("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" }),
127
- !!props.error && /* @__PURE__ */ jsx2("div", { className: "iz-input-error", children: props.error })
128
- ] });
129
- }
130
-
131
- // components/types/form/types/input/index.tsx
132
- import { useState } from "react";
133
-
134
- // components/types/form/types/input/styles.tsx
135
- import styled4 from "styled-components";
136
- var Container4 = styled4.div`
137
- width: 100%;
138
- padding-top: .3rem;
139
-
140
- .iz-input-content {
141
- display: flex;
142
- align-items: center;
143
- justify-content: center;
144
- border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
145
- border-radius: 5px;
146
- overflow: hidden;
147
- padding-right: ${({ password }) => password ? ".6rem" : "0rem"};
148
- background-color: ${({ theme }) => theme.primary};
149
-
150
- input {
151
- border: 0;
152
- padding: .5rem 1rem;
153
- width: 100%;
154
- font-size: .8rem;
155
- background-color: ${({ theme }) => theme.primary};
156
- color: ${({ theme }) => theme.t6};
157
-
158
- &:disabled {
159
- background-color: ${({ theme }) => theme.t2};
160
- color: ${({ theme }) => theme.t6};
161
- opacity: .7;
162
- }
163
-
164
- &:focus-visible {
165
- outline: none;
166
- }
167
- }
168
-
169
- i {
170
- color: ${({ theme }) => theme.t3};
171
- cursor: pointer;
172
- }
173
- }
174
-
175
- .iz-input-error {
176
- color: ${({ theme }) => theme.negative};
177
- font-size: .7rem;
178
- }
179
- `;
180
-
181
- // components/types/form/types/input/index.tsx
182
9
  import _ from "lodash";
183
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
184
- function InputText(props) {
185
- const [showPassword, setShowPassword] = useState(false);
186
- const register = (props.register || ((name) => ({})))(props.name || "");
187
- const onChange = (event) => {
188
- const value = event.target.value || "";
189
- event.target.value = props.mask ? props.mask(value) : value;
190
- if (register.onChange) register.onChange(event);
191
- if (props.onChange) props.onChange(value);
192
- };
193
- return /* @__PURE__ */ jsxs2(Container4, { className: props.className, error: props.error, password: props.type === "password", children: [
194
- !!props.label && /* @__PURE__ */ jsxs2(InputLabel, { children: [
195
- props.label,
196
- props.required ? "*" : ""
197
- ] }),
198
- /* @__PURE__ */ jsxs2("div", { className: "iz-input-content", children: [
199
- /* @__PURE__ */ jsx3(
200
- "input",
201
- {
202
- ..._.omit(props, ["className", "register", "mask"]),
203
- type: props.type === "password" ? showPassword ? "text" : "password" : props.type,
204
- maxLength: props.maxLength || 255,
205
- onFocus: () => {
206
- if (props.onFocus) props.onFocus(props.name);
207
- },
208
- ...register,
209
- onChange
210
- }
211
- ),
212
- props.type === "password" && /* @__PURE__ */ jsx3(
213
- "i",
214
- {
215
- "aria-hidden": true,
216
- className: showPassword ? "fa-solid fa-eye-slash" : "fa-solid fa-eye",
217
- onClick: () => setShowPassword(!showPassword)
218
- }
219
- )
220
- ] }),
221
- !!props.error && /* @__PURE__ */ jsx3("div", { className: "iz-input-error", children: props.error })
222
- ] });
223
- }
224
-
225
- // components/types/form/types/select/index.tsx
226
- import { useState as useState2 } from "react";
227
-
228
- // components/types/form/types/select/styles.tsx
229
- import styled5 from "styled-components";
230
- var Container5 = styled5.div`
231
- width: 100%;
232
- padding-top: .3rem;
233
-
234
- .iz-input-content {
235
- display: flex;
236
- align-items: center;
237
- justify-content: center;
238
- border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
239
- border-radius: 5px;
240
- overflow: hidden;
241
- position: relative;
242
- cursor: pointer;
243
-
244
- select {
245
- border: 0;
246
- padding: .5rem 2.3rem .5rem 1rem;
247
- width: 100%;
248
- font-size: .8rem;
249
- appearance: none;
250
- cursor: pointer;
251
- background-color: ${({ theme }) => theme.primary};
252
- color: ${({ theme }) => theme.t6};
253
-
254
- &:disabled {
255
- background-color: ${({ theme }) => theme.t2};
256
- color: ${({ theme }) => theme.t6};
257
- opacity: .7;
258
- }
259
-
260
- &:focus-visible {
261
- outline: none;
262
- }
263
- }
264
-
265
- i {
266
- position: absolute;
267
- top: 50%;
268
- right: .8rem;
269
- transform: translateY(-50%);
270
- font-size: .8rem;
271
- color: ${({ theme }) => theme.t6};
272
- }
273
- }
274
-
275
- .iz-input-error {
276
- color: ${({ theme }) => theme.negative};
277
- font-size: .7rem;
278
- }
279
- `;
280
-
281
- // components/types/form/types/select/index.tsx
282
- import _2 from "lodash";
283
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
284
- function InputSelect(props) {
285
- const [focus, setFocus] = useState2(false);
286
- const register = (props.register || ((name) => ({})))(props.name || "");
287
- const onChange = (event) => {
288
- const value = event.target.value || "";
289
- if (register.onChange) register.onChange(event);
290
- if (props.onChange) props.onChange(value);
291
- };
292
- return /* @__PURE__ */ jsxs3(Container5, { className: props.className, error: props.error, children: [
293
- !!props.label && /* @__PURE__ */ jsxs3(InputLabel, { children: [
294
- props.label,
295
- props.required ? "*" : ""
296
- ] }),
297
- /* @__PURE__ */ jsxs3("div", { className: "iz-input-content", children: [
298
- /* @__PURE__ */ jsx4(
299
- "select",
300
- {
301
- ..._2.omit(props, ["className", "onChange", "onFocus", "options", "onMouseDown", "onBlur", "maxLength", "required", "register"]),
302
- onMouseDown: () => setFocus(!focus),
303
- onFocus: () => {
304
- if (props.onFocus) props.onFocus(props.name);
305
- },
306
- ...register,
307
- onBlur: (event) => {
308
- if (register.onBlur) register.onBlur(event);
309
- setFocus(false);
310
- },
311
- onChange,
312
- children: _2.map(
313
- props.options,
314
- (data, index) => /* @__PURE__ */ jsx4(
315
- "option",
316
- {
317
- value: Object.keys(data),
318
- children: Object.values(data)
319
- },
320
- index
321
- )
322
- )
323
- }
324
- ),
325
- /* @__PURE__ */ jsx4("i", { "aria-hidden": true, className: focus ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down" })
326
- ] }),
327
- !!props.error && /* @__PURE__ */ jsx4("div", { className: "iz-input-error", children: props.error })
328
- ] });
329
- }
330
-
331
- // components/types/form/types/button/styles.tsx
332
- import styled6 from "styled-components";
333
- var Container6 = styled6.button`
334
- border-radius: 5px;
335
- font-size: .8rem;
336
- font-weight: 500;
337
- transition: ease .3s;
338
- display: flex;
339
- align-items: center;
340
- justify-content: center;
341
- color: ${(props) => props.transparent ? props.theme.t6 : props.outline ? props.color || props.theme.secondary : "#fff !important"};
342
- background: ${(props) => props.transparent ? "transparent" : props.outline ? props.theme.t05 : props.color || props.theme.secondary};
343
- border: 1px solid ${(props) => props.transparent ? "transparent" : props.outline ? props.theme.t05 : props.color || props.theme.secondary};
344
- pointer-events: ${(props) => props.loading === "true" ? "none" : "auto"};
345
- cursor: ${(props) => props.loading === "true" ? "default" : "pointer"};
346
- opacity: ${(props) => props.loading === "true" ? 0.6 : 1};
347
- padding: .4rem 2.5rem;
348
- transition: ease .3s;
349
-
350
- span {
351
- text-align: center;
352
- cursor: ${(props) => props.loading === "true" ? "default" : "pointer"};
353
- }
354
-
355
- &:disabled {
356
- pointer-events: none;
357
-
358
- &::before {
359
- opacity: .6;
360
- }
361
- }
362
-
363
- &:hover {
364
- opacity: .9;
365
- color: ${(props) => props.transparent ? props.theme.t6 : props.outline ? props.color || props.theme.secondary : "#fff"};
366
-
367
- &::before {
368
- background: ${(props) => props.transparent ? "transparent" : props.color || props.theme.secondary};
369
- }
370
- }
371
- `;
372
-
373
- // components/types/form/types/button/loading/styles.tsx
374
- import styled7 from "styled-components";
375
- var Container7 = styled7.div`
376
- display: flex;
377
- justify-content: space-between;
378
- align-items: center;
379
- width: 2rem;
380
- margin-right: .5rem;
381
-
382
- div {
383
- width: .5rem;
384
- height: .5rem;
385
- border-radius: 1rem;
386
- background: rgb(255, 255, 255, 1);
387
-
388
- &:nth-child(1) {
389
- animation: blinkOne infinite ease 2s;
390
- }
391
-
392
- &:nth-child(2) {
393
- animation: blinkTwo infinite ease 2s;
394
- }
395
-
396
- &:nth-child(3) {
397
- animation: blinkThree infinite ease 2s;
398
- }
399
- }
400
-
401
- @keyframes blinkOne {
402
- 0% {
403
- opacity: 0.8;
404
- }
405
- 20% {
406
- opacity: 0.2;
407
- }
408
- 40% {
409
- opacity: 0.2;
410
- }
411
- 60% {
412
- opacity: 0.2;
413
- }
414
- 80% {
415
- opacity: 0.2;
416
- }
417
- 100% {
418
- opacity: 0.8;
419
- }
420
- }
421
-
422
- @keyframes blinkTwo {
423
- 0% {
424
- opacity: 0.2;
425
- }
426
- 20% {
427
- opacity: 0.8;
428
- }
429
- 40% {
430
- opacity: 0.2;
431
- }
432
- 60% {
433
- opacity: 0.2;
434
- }
435
- 80% {
436
- opacity: 0.8;
437
- }
438
- 100% {
439
- opacity: 0.2;
440
- }
441
- }
442
-
443
- @keyframes blinkThree {
444
- 0% {
445
- opacity: 0.2;
446
- }
447
- 25% {
448
- opacity: 0.2;
449
- }
450
- 50% {
451
- opacity: 0.8;
452
- }
453
- 75% {
454
- opacity: 0.2;
455
- }
456
- 100% {
457
- opacity: 0.2;
458
- }
459
- }
460
- `;
461
-
462
- // components/types/form/types/button/loading/index.tsx
463
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
464
- function Loading() {
465
- return /* @__PURE__ */ jsxs4(Container7, { children: [
466
- /* @__PURE__ */ jsx5("div", {}),
467
- /* @__PURE__ */ jsx5("div", {}),
468
- /* @__PURE__ */ jsx5("div", {})
469
- ] });
470
- }
471
-
472
- // components/types/form/types/button/index.tsx
473
- import _3 from "lodash";
474
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
475
- function Button(props) {
476
- return /* @__PURE__ */ jsxs5(
477
- Container6,
478
- {
479
- loading: String(!!props.loading),
480
- disabled: props.disabled,
481
- type: props.type || "button",
482
- ..._3.omit(props, ["loading", "type"]),
483
- children: [
484
- !!props.loading && /* @__PURE__ */ jsx6(Loading, {}),
485
- /* @__PURE__ */ jsx6("span", { children: props.label })
486
- ]
487
- }
488
- );
489
- }
490
-
491
- // components/types/form/types/datetime/styles.tsx
492
- import styled8 from "styled-components";
493
- var Container8 = styled8.div`
494
- width: 100%;
495
- padding-top: .3rem;
496
-
497
- .iz-input-content {
498
- display: flex;
499
- align-items: center;
500
- justify-content: center;
501
- border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
502
- border-radius: 5px;
503
- overflow: hidden;
504
-
505
- input {
506
- border: 0;
507
- padding: .5rem 1rem;
508
- width: 100%;
509
- font-size: .8rem;
510
- background-color: ${({ theme }) => theme.primary};
511
- color: ${({ theme }) => theme.t6};
512
- color-scheme: ${(props) => props.theme || "light"};
513
-
514
- &:disabled {
515
- background-color: ${({ theme }) => theme.t2};
516
- color: ${({ theme }) => theme.t6};
517
- opacity: .7;
518
- }
519
-
520
- &:focus-visible {
521
- outline: none;
522
- }
523
- }
524
- }
525
-
526
- .iz-input-error {
527
- color: ${({ theme }) => theme.negative};
528
- font-size: .7rem;
529
- }
530
- `;
531
-
532
- // components/types/form/types/datetime/index.tsx
533
- import _4 from "lodash";
534
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
535
- function InputDateTime(props) {
536
- const register = (props.register || ((name) => ({})))(props.name || "");
537
- const onChange = (event) => {
538
- const value = event.target.value || "";
539
- event.target.value = props.mask ? props.mask(value) : value;
540
- if (register.onChange) register.onChange(event);
541
- if (props.onChange) props.onChange(event);
542
- };
543
- return /* @__PURE__ */ jsxs6(Container8, { className: props.className, error: props.error, children: [
544
- !!props.label && /* @__PURE__ */ jsxs6(InputLabel, { children: [
545
- props.label,
546
- props.required ? "*" : ""
547
- ] }),
548
- /* @__PURE__ */ jsx7("div", { className: "iz-input-content", children: /* @__PURE__ */ jsx7(
549
- "input",
550
- {
551
- ..._4.omit(props, ["className", "onChange", "mask", "type", "required", "register"]),
552
- type: "datetime-local",
553
- onFocus: () => {
554
- if (props.onFocus) props.onFocus(props.name);
555
- },
556
- maxLength: props.maxLength || 255,
557
- ...register,
558
- onChange
559
- }
560
- ) }),
561
- !!props.error && /* @__PURE__ */ jsx7("div", { className: "iz-input-error", children: props.error })
562
- ] });
563
- }
564
-
565
- // components/types/form/types/textarea/styles.tsx
566
- import styled9 from "styled-components";
567
- var Container9 = styled9.div`
568
- width: 100%;
569
- padding-top: .3rem;
570
-
571
- .iz-input-content {
572
- display: flex;
573
- align-items: center;
574
- justify-content: center;
575
- border: 1px solid ${({ error, theme }) => error ? theme.negative : theme.t2};
576
- border-radius: 5px;
577
- overflow: hidden;
578
-
579
- textarea {
580
- border: 0;
581
- padding: .5rem 1rem;
582
- width: 100%;
583
- font-size: .8rem;
584
- background-color: ${({ theme }) => theme.primary};
585
- color: ${({ theme }) => theme.t6};
586
-
587
- &:disabled {
588
- background-color: ${({ theme }) => theme.t2};
589
- color: ${({ theme }) => theme.t6};
590
- opacity: .7;
591
- }
592
-
593
- &:focus-visible {
594
- outline: none;
595
- }
596
- }
597
- }
598
-
599
- .iz-input-error {
600
- color: ${({ theme }) => theme.negative};
601
- font-size: .7rem;
602
- }
603
- `;
604
-
605
- // components/types/form/types/textarea/index.tsx
606
- import _5 from "lodash";
607
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
608
- function InputTextarea(props) {
609
- const register = (props.register || ((name) => ({})))(props.name || "");
610
- const onChange = (event) => {
611
- const value = event.target.value || "";
612
- event.target.value = props.mask ? props.mask(value) : value;
613
- if (register.onChange) register.onChange(event);
614
- if (props.onChange) props.onChange(value);
615
- };
616
- return /* @__PURE__ */ jsxs7(Container9, { className: props.className, error: props.error, children: [
617
- !!props.label && /* @__PURE__ */ jsxs7(InputLabel, { children: [
618
- props.label,
619
- props.required ? "*" : ""
620
- ] }),
621
- /* @__PURE__ */ jsx8("div", { className: "iz-input-content", children: /* @__PURE__ */ jsx8(
622
- "textarea",
623
- {
624
- ..._5.omit(props, ["onFocus", "maxLength", "className", "onChange", "mask", "rows", "required", "register"]),
625
- maxLength: props.maxLength,
626
- rows: props.rows || 5,
627
- onFocus: () => {
628
- if (props.onFocus) props.onFocus(props.name);
629
- },
630
- ...register,
631
- onChange
632
- }
633
- ) }),
634
- !!props.error && /* @__PURE__ */ jsx8("div", { className: "iz-input-error", children: props.error })
635
- ] });
636
- }
637
-
638
- // components/types/form/index.tsx
639
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
10
+ import * as Types from "./types";
11
+ export * from "./types";
640
12
  function Form(props) {
641
- const formRef = props.formRef || useRef2({});
13
+ const formRef = props.formRef || useRef({});
642
14
  const setSchema = () => {
643
15
  const schema2 = {};
644
- _6.forEach(props.inputs, (data) => {
16
+ _.forEach(props.inputs, (data) => {
645
17
  if (!data.validation) return;
646
18
  schema2[data.name] = data.validation;
647
19
  });
@@ -666,20 +38,20 @@ function Form(props) {
666
38
  useEffect(() => {
667
39
  var _a;
668
40
  if (!props.defaultValues || !((_a = Object.keys(props.defaultValues || {})) == null ? void 0 : _a.length)) return;
669
- _6.forEach(props.defaultValues, (value, key) => {
670
- const input = _6.find(props.inputs, (data) => data.name === key);
41
+ _.forEach(props.defaultValues, (value, key) => {
42
+ const input = _.find(props.inputs, (data) => data.name === key);
671
43
  props.defaultValues[key] = input.mask ? input.mask(value) : value;
672
44
  });
673
45
  reset(props.defaultValues, { keepErrors: false });
674
46
  }, [props.defaultValues]);
675
47
  const component = (data) => {
676
48
  var _a;
677
- const component2 = types_exports[_6.camelCase(data.type)];
678
- const TypeComponent = component2 || InputText;
679
- return /* @__PURE__ */ jsx9(
49
+ const component2 = Types[_.camelCase(data.type)];
50
+ const TypeComponent = component2 || Types.InputText;
51
+ return /* @__PURE__ */ jsx(
680
52
  TypeComponent,
681
53
  {
682
- ..._6.omit(data, ["validation"]),
54
+ ..._.omit(data, ["validation"]),
683
55
  id: data.name,
684
56
  type: component2 ? void 0 : data.type,
685
57
  error: (_a = errors[data.name]) == null ? void 0 : _a.message,
@@ -687,24 +59,17 @@ function Form(props) {
687
59
  }
688
60
  );
689
61
  };
690
- return /* @__PURE__ */ jsxs8(Container, { ref: formRef, onSubmit: handleSubmit(props.onSubmit), children: [
691
- _6.map(
62
+ return /* @__PURE__ */ jsxs(Container, { ref: formRef, onSubmit: handleSubmit(props.onSubmit), children: [
63
+ _.map(
692
64
  props.inputs,
693
- (data, index) => /* @__PURE__ */ jsx9(React4.Fragment, { children: component(data) }, index)
65
+ (data, index) => /* @__PURE__ */ jsx(React.Fragment, { children: component(data) }, index)
694
66
  ),
695
- _6.isArray(props.buttons) && /* @__PURE__ */ jsx9("div", { className: "form-buttons", children: _6.map(
67
+ _.isArray(props.buttons) && /* @__PURE__ */ jsx("div", { className: "form-buttons", children: _.map(
696
68
  props.buttons,
697
- (data, index) => /* @__PURE__ */ jsx9(Button, { ...data }, index)
69
+ (data, index) => /* @__PURE__ */ jsx(Types.Button, { ...data }, index)
698
70
  ) })
699
71
  ] });
700
72
  }
701
73
  export {
702
- Button,
703
- Form,
704
- InputDateTime,
705
- InputFile,
706
- InputLabel,
707
- InputSelect,
708
- InputText,
709
- InputTextarea
74
+ Form
710
75
  };