@gustavo-valsechi/client 1.3.25 → 1.3.26

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