@sigep/react 1.0.0 → 1.1.1

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.
package/dist/index.js CHANGED
@@ -20,16 +20,87 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ Avatar: () => Avatar,
23
24
  Button: () => Button,
24
- button: () => button
25
+ Card: () => Card,
26
+ InputCNPJ: () => InputCNPJ,
27
+ InputCPF: () => InputCPF,
28
+ InputCep: () => InputCep,
29
+ InputCheckbox: () => InputCheckbox,
30
+ InputCurrency: () => InputCurrency,
31
+ InputEmail: () => InputEmail,
32
+ InputNumber: () => InputNumber,
33
+ InputPassword: () => InputPassword,
34
+ InputPhone: () => InputPhone,
35
+ InputRadio: () => InputRadio,
36
+ InputString: () => InputString,
37
+ InputWrapper: () => InputWrapper,
38
+ Modal: () => Modal,
39
+ Textarea: () => Textarea,
40
+ Tooltip: () => Tooltip,
41
+ avatar: () => avatar,
42
+ button: () => button,
43
+ card: () => card,
44
+ maskCEP: () => maskCEP,
45
+ maskCNPJ: () => maskCNPJ,
46
+ maskCPF: () => maskCPF,
47
+ maskCurrency: () => maskCurrency,
48
+ maskPhone: () => maskPhone,
49
+ modal: () => modal,
50
+ tooltip: () => tooltip,
51
+ unmask: () => unmask,
52
+ unmaskCurrency: () => unmaskCurrency
25
53
  });
26
54
  module.exports = __toCommonJS(index_exports);
27
55
 
28
- // src/components/Button/index.tsx
56
+ // src/components/Avatar/index.tsx
29
57
  var import_react = require("react");
30
58
  var import_tailwind_variants = require("tailwind-variants");
31
59
  var import_jsx_runtime = require("react/jsx-runtime");
32
- var button = (0, import_tailwind_variants.tv)({
60
+ var avatar = (0, import_tailwind_variants.tv)({
61
+ base: "inline-flex items-center justify-center rounded-full font-medium select-none overflow-hidden",
62
+ variants: {
63
+ size: {
64
+ sm: "h-8 w-8 text-xs",
65
+ md: "h-10 w-10 text-sm",
66
+ lg: "h-12 w-12 text-base",
67
+ xl: "h-16 w-16 text-lg"
68
+ },
69
+ variant: {
70
+ primary: "bg-blue-600 text-white",
71
+ secondary: "bg-gray-200 text-gray-700",
72
+ outline: "bg-white text-blue-600 ring-2 ring-blue-600 ring-offset-2"
73
+ }
74
+ },
75
+ defaultVariants: {
76
+ size: "md",
77
+ variant: "primary"
78
+ }
79
+ });
80
+ function getInitials(name) {
81
+ const parts = name.trim().split(/\s+/);
82
+ if (parts.length === 1) return parts[0].charAt(0).toUpperCase();
83
+ return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
84
+ }
85
+ var Avatar = (0, import_react.forwardRef)(
86
+ ({ name, src, alt, size, variant, className, ...props }, ref) => {
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: avatar({ size, variant, className }), ...props, children: src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
+ "img",
89
+ {
90
+ src,
91
+ alt: alt || name || "avatar",
92
+ className: "h-full w-full object-cover"
93
+ }
94
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: name ? getInitials(name) : "?" }) });
95
+ }
96
+ );
97
+ Avatar.displayName = "Avatar";
98
+
99
+ // src/components/Button/index.tsx
100
+ var import_react2 = require("react");
101
+ var import_tailwind_variants2 = require("tailwind-variants");
102
+ var import_jsx_runtime2 = require("react/jsx-runtime");
103
+ var button = (0, import_tailwind_variants2.tv)({
33
104
  base: "inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
34
105
  variants: {
35
106
  variant: {
@@ -49,9 +120,9 @@ var button = (0, import_tailwind_variants.tv)({
49
120
  size: "md"
50
121
  }
51
122
  });
52
- var Button = (0, import_react.forwardRef)(
123
+ var Button = (0, import_react2.forwardRef)(
53
124
  ({ variant, size, className, ...props }, ref) => {
54
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
55
126
  "button",
56
127
  {
57
128
  ref,
@@ -62,8 +133,1081 @@ var Button = (0, import_react.forwardRef)(
62
133
  }
63
134
  );
64
135
  Button.displayName = "Button";
136
+
137
+ // src/components/Card/index.tsx
138
+ var import_react3 = require("react");
139
+ var import_tailwind_variants3 = require("tailwind-variants");
140
+ var import_jsx_runtime3 = require("react/jsx-runtime");
141
+ var card = (0, import_tailwind_variants3.tv)({
142
+ base: "rounded-lg bg-white text-gray-900 overflow-hidden",
143
+ variants: {
144
+ variant: {
145
+ elevated: "shadow-md",
146
+ outlined: "border border-gray-200",
147
+ filled: "bg-gray-50"
148
+ },
149
+ padding: {
150
+ none: "",
151
+ sm: "p-3",
152
+ md: "p-5",
153
+ lg: "p-8"
154
+ }
155
+ },
156
+ defaultVariants: {
157
+ variant: "elevated",
158
+ padding: "md"
159
+ }
160
+ });
161
+ var Card = (0, import_react3.forwardRef)(
162
+ ({ variant, padding, header, footer, className, children, ...props }, ref) => {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref, className: card({ variant, padding: header || footer ? "none" : padding, className }), ...props, children: [
164
+ header && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-b border-gray-200 px-5 py-3 font-semibold text-sm", children: header }),
165
+ header || footer ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: card({ padding, className: "rounded-none shadow-none border-none bg-transparent" }), children }) : children,
166
+ footer && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "border-t border-gray-200 px-5 py-3 text-sm", children: footer })
167
+ ] });
168
+ }
169
+ );
170
+ Card.displayName = "Card";
171
+
172
+ // src/components/Modal/index.tsx
173
+ var import_react4 = require("react");
174
+ var import_tailwind_variants4 = require("tailwind-variants");
175
+ var import_jsx_runtime4 = require("react/jsx-runtime");
176
+ var overlay = (0, import_tailwind_variants4.tv)({
177
+ base: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 transition-opacity"
178
+ });
179
+ var modal = (0, import_tailwind_variants4.tv)({
180
+ base: "relative flex flex-col rounded-lg bg-white text-gray-900 shadow-xl overflow-hidden",
181
+ variants: {
182
+ size: {
183
+ sm: "w-[30vw] max-h-[40vh]",
184
+ md: "w-[50vw] max-h-[60vh]",
185
+ lg: "w-[70vw] max-h-[80vh]",
186
+ full: "w-[95vw] max-h-[90vh]"
187
+ }
188
+ },
189
+ defaultVariants: {
190
+ size: "md"
191
+ }
192
+ });
193
+ var Modal = (0, import_react4.forwardRef)(
194
+ ({ isOpen, onClose, title, footer, size, className, children, ...props }, ref) => {
195
+ const handleKeyDown = (0, import_react4.useCallback)(
196
+ (e) => {
197
+ if (e.key === "Escape") onClose();
198
+ },
199
+ [onClose]
200
+ );
201
+ (0, import_react4.useEffect)(() => {
202
+ if (!isOpen) return;
203
+ document.addEventListener("keydown", handleKeyDown);
204
+ document.body.style.overflow = "hidden";
205
+ return () => {
206
+ document.removeEventListener("keydown", handleKeyDown);
207
+ document.body.style.overflow = "";
208
+ };
209
+ }, [isOpen, handleKeyDown]);
210
+ if (!isOpen) return null;
211
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: overlay(), onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
212
+ "div",
213
+ {
214
+ ref,
215
+ className: modal({ size, className }),
216
+ onClick: (e) => e.stopPropagation(),
217
+ role: "dialog",
218
+ "aria-modal": "true",
219
+ ...props,
220
+ children: [
221
+ title && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between border-b border-gray-200 bg-gray-50 px-5 py-3", children: [
222
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-sm font-semibold text-gray-900", children: title }),
223
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
224
+ "button",
225
+ {
226
+ type: "button",
227
+ className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-500 hover:bg-gray-200 hover:text-gray-700 transition-colors",
228
+ onClick: onClose,
229
+ "aria-label": "Fechar",
230
+ children: "\u2715"
231
+ }
232
+ )
233
+ ] }),
234
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1 overflow-y-auto p-5", children }),
235
+ footer && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center justify-end gap-2 border-t border-gray-200 px-5 py-3", children: footer })
236
+ ]
237
+ }
238
+ ) });
239
+ }
240
+ );
241
+ Modal.displayName = "Modal";
242
+
243
+ // src/components/Tooltip/index.tsx
244
+ var import_react5 = require("react");
245
+ var import_react_dom = require("react-dom");
246
+ var import_tailwind_variants5 = require("tailwind-variants");
247
+ var import_jsx_runtime5 = require("react/jsx-runtime");
248
+ var tooltip = (0, import_tailwind_variants5.tv)({
249
+ base: "fixed z-[999999] pointer-events-none",
250
+ variants: {
251
+ variant: {
252
+ dark: "",
253
+ light: ""
254
+ }
255
+ },
256
+ defaultVariants: {
257
+ variant: "dark"
258
+ }
259
+ });
260
+ var tooltipContent = (0, import_tailwind_variants5.tv)({
261
+ base: "inline-flex items-center justify-center rounded px-2.5 py-1 text-xs font-medium whitespace-nowrap",
262
+ variants: {
263
+ variant: {
264
+ dark: "bg-gray-900 text-white",
265
+ light: "bg-white text-gray-900 shadow-md border border-gray-200"
266
+ }
267
+ },
268
+ defaultVariants: {
269
+ variant: "dark"
270
+ }
271
+ });
272
+ var tooltipArrow = (0, import_tailwind_variants5.tv)({
273
+ base: "absolute h-1.5 w-1.5 rotate-45",
274
+ variants: {
275
+ variant: {
276
+ dark: "bg-gray-900",
277
+ light: "bg-white border border-gray-200"
278
+ }
279
+ },
280
+ defaultVariants: {
281
+ variant: "dark"
282
+ }
283
+ });
284
+ var arrowPlacementStyles = {
285
+ top: "bottom-[-3px] left-1/2 -translate-x-1/2",
286
+ bottom: "top-[-3px] left-1/2 -translate-x-1/2",
287
+ left: "right-[-3px] top-1/2 -translate-y-1/2",
288
+ right: "left-[-3px] top-1/2 -translate-y-1/2"
289
+ };
290
+ var Tooltip = (0, import_react5.forwardRef)(
291
+ ({
292
+ content,
293
+ placement = "top",
294
+ offset: offsetPx = 8,
295
+ variant,
296
+ disabled,
297
+ delayShow = 100,
298
+ delayHide = 100,
299
+ children,
300
+ className,
301
+ ...props
302
+ }, ref) => {
303
+ const wrapperRef = (0, import_react5.useRef)(null);
304
+ const tipRef = (0, import_react5.useRef)(null);
305
+ const [visible, setVisible] = (0, import_react5.useState)(false);
306
+ const [coords, setCoords] = (0, import_react5.useState)(null);
307
+ const [activePlacement, setActivePlacement] = (0, import_react5.useState)(placement);
308
+ const showTimer = (0, import_react5.useRef)(null);
309
+ const hideTimer = (0, import_react5.useRef)(null);
310
+ function clearTimers() {
311
+ if (showTimer.current !== null) window.clearTimeout(showTimer.current);
312
+ if (hideTimer.current !== null) window.clearTimeout(hideTimer.current);
313
+ showTimer.current = null;
314
+ hideTimer.current = null;
315
+ }
316
+ function scheduleShow() {
317
+ if (disabled) return;
318
+ clearTimers();
319
+ showTimer.current = window.setTimeout(() => setVisible(true), delayShow);
320
+ }
321
+ function scheduleHide() {
322
+ clearTimers();
323
+ hideTimer.current = window.setTimeout(() => setVisible(false), delayHide);
324
+ }
325
+ const computePosition = (0, import_react5.useCallback)(() => {
326
+ const anchor = wrapperRef.current;
327
+ const tip = tipRef.current;
328
+ if (!anchor || !tip) return;
329
+ const rect = anchor.getBoundingClientRect();
330
+ const tipW = tip.offsetWidth;
331
+ const tipH = tip.offsetHeight;
332
+ const vw = window.innerWidth;
333
+ const vh = window.innerHeight;
334
+ const calc = (p2) => {
335
+ switch (p2) {
336
+ case "top":
337
+ return { top: rect.top - tipH - offsetPx, left: rect.left + rect.width / 2 - tipW / 2 };
338
+ case "bottom":
339
+ return { top: rect.bottom + offsetPx, left: rect.left + rect.width / 2 - tipW / 2 };
340
+ case "left":
341
+ return { top: rect.top + rect.height / 2 - tipH / 2, left: rect.left - tipW - offsetPx };
342
+ case "right":
343
+ return { top: rect.top + rect.height / 2 - tipH / 2, left: rect.right + offsetPx };
344
+ }
345
+ };
346
+ let pos = calc(placement);
347
+ let p = placement;
348
+ const fits = (c) => c.top >= 0 && c.left >= 0 && c.top + tipH <= vh && c.left + tipW <= vw;
349
+ if (!fits(pos)) {
350
+ const fallbacks = {
351
+ top: ["bottom", "right", "left"],
352
+ bottom: ["top", "right", "left"],
353
+ left: ["right", "top", "bottom"],
354
+ right: ["left", "top", "bottom"]
355
+ };
356
+ for (const candidate of fallbacks[placement]) {
357
+ const c = calc(candidate);
358
+ if (fits(c)) {
359
+ pos = c;
360
+ p = candidate;
361
+ break;
362
+ }
363
+ }
364
+ }
365
+ pos.top = Math.max(4, Math.min(vh - tipH - 4, pos.top));
366
+ pos.left = Math.max(4, Math.min(vw - tipW - 4, pos.left));
367
+ setActivePlacement(p);
368
+ setCoords(pos);
369
+ }, [placement, offsetPx]);
370
+ (0, import_react5.useLayoutEffect)(() => {
371
+ if (!visible) return;
372
+ let raf1 = 0;
373
+ let raf2 = 0;
374
+ raf1 = requestAnimationFrame(() => {
375
+ raf2 = requestAnimationFrame(computePosition);
376
+ });
377
+ return () => {
378
+ cancelAnimationFrame(raf1);
379
+ cancelAnimationFrame(raf2);
380
+ };
381
+ }, [visible, computePosition]);
382
+ (0, import_react5.useEffect)(() => {
383
+ if (!visible) return;
384
+ const handler = () => computePosition();
385
+ window.addEventListener("scroll", handler, true);
386
+ window.addEventListener("resize", handler);
387
+ return () => {
388
+ window.removeEventListener("scroll", handler, true);
389
+ window.removeEventListener("resize", handler);
390
+ };
391
+ }, [visible, computePosition]);
392
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
393
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
394
+ "span",
395
+ {
396
+ ref: (el) => {
397
+ wrapperRef.current = el;
398
+ if (typeof ref === "function") ref(el);
399
+ else if (ref) ref.current = el;
400
+ },
401
+ onMouseEnter: scheduleShow,
402
+ onMouseLeave: scheduleHide,
403
+ onFocus: scheduleShow,
404
+ onBlur: scheduleHide,
405
+ style: { display: "contents" },
406
+ className,
407
+ ...props,
408
+ children
409
+ }
410
+ ),
411
+ visible && (0, import_react_dom.createPortal)(
412
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
413
+ "div",
414
+ {
415
+ ref: tipRef,
416
+ role: "tooltip",
417
+ className: tooltip({ variant }),
418
+ style: {
419
+ top: coords?.top ?? -99999,
420
+ left: coords?.left ?? -99999,
421
+ visibility: coords ? "visible" : "hidden"
422
+ },
423
+ children: [
424
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: tooltipContent({ variant }), children: content }),
425
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `${tooltipArrow({ variant })} ${arrowPlacementStyles[activePlacement]}` })
426
+ ]
427
+ }
428
+ ),
429
+ document.body
430
+ )
431
+ ] });
432
+ }
433
+ );
434
+ Tooltip.displayName = "Tooltip";
435
+
436
+ // src/components/Input/InputString.tsx
437
+ var import_react7 = require("react");
438
+
439
+ // src/components/Input/InputWrapper.tsx
440
+ var import_react6 = require("react");
441
+ var import_tailwind_variants6 = require("tailwind-variants");
442
+ var import_jsx_runtime6 = require("react/jsx-runtime");
443
+ var wrapper = (0, import_tailwind_variants6.tv)({
444
+ base: "flex w-full flex-col gap-1"
445
+ });
446
+ var labelStyle = (0, import_tailwind_variants6.tv)({
447
+ base: "text-xs text-gray-700 flex items-start gap-0.5"
448
+ });
449
+ var containerStyle = (0, import_tailwind_variants6.tv)({
450
+ base: "flex items-center w-full rounded-md border bg-white transition-colors",
451
+ variants: {
452
+ size: {
453
+ sm: "h-8 text-sm",
454
+ md: "h-9 text-sm",
455
+ lg: "h-10 text-base"
456
+ },
457
+ error: {
458
+ true: "border-red-500 focus-within:border-red-500 focus-within:ring-1 focus-within:ring-red-500",
459
+ false: "border-gray-300 hover:border-gray-400 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500"
460
+ },
461
+ disabled: {
462
+ true: "opacity-50 cursor-not-allowed bg-gray-50"
463
+ }
464
+ },
465
+ defaultVariants: {
466
+ size: "md",
467
+ error: false
468
+ }
469
+ });
470
+ var errorStyle = (0, import_tailwind_variants6.tv)({
471
+ base: "text-xs text-red-500 mt-0.5"
472
+ });
473
+ var InputWrapper = (0, import_react6.forwardRef)(
474
+ ({ label, error, errorMessage, required, disabled, size, children, className, classContainer, htmlFor }, ref) => {
475
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, className: wrapper({ className }), children: [
476
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor, className: labelStyle(), children: [
477
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: label }),
478
+ required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
479
+ ] }),
480
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: containerStyle({ size, error: !!error, disabled: !!disabled, className: classContainer }), children }),
481
+ error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: errorStyle(), children: errorMessage })
482
+ ] });
483
+ }
484
+ );
485
+ InputWrapper.displayName = "InputWrapper";
486
+
487
+ // src/components/Input/InputString.tsx
488
+ var import_jsx_runtime7 = require("react/jsx-runtime");
489
+ var InputString = (0, import_react7.forwardRef)(
490
+ ({
491
+ label,
492
+ error,
493
+ errorMessage,
494
+ required,
495
+ size,
496
+ showClearButton = true,
497
+ leftIcon,
498
+ rightIcon,
499
+ classContainer,
500
+ classInput,
501
+ value,
502
+ onChange,
503
+ disabled,
504
+ name,
505
+ ...props
506
+ }, ref) => {
507
+ const [hovered, setHovered] = (0, import_react7.useState)(false);
508
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
509
+ "div",
510
+ {
511
+ onMouseEnter: () => setHovered(true),
512
+ onMouseLeave: () => setHovered(false),
513
+ className: "w-full",
514
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
515
+ InputWrapper,
516
+ {
517
+ label,
518
+ error,
519
+ errorMessage,
520
+ required,
521
+ disabled,
522
+ size,
523
+ classContainer,
524
+ htmlFor: name,
525
+ children: [
526
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pl-2.5 text-gray-400", children: leftIcon }),
527
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
528
+ "input",
529
+ {
530
+ ref,
531
+ id: name,
532
+ name,
533
+ type: "text",
534
+ value: value ?? "",
535
+ onChange: (e) => onChange?.(e.target.value),
536
+ disabled,
537
+ "aria-invalid": !!error,
538
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
539
+ ...props
540
+ }
541
+ ),
542
+ showClearButton && hovered && value && !disabled && !required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
543
+ "button",
544
+ {
545
+ type: "button",
546
+ tabIndex: -1,
547
+ "aria-label": "Limpar campo",
548
+ className: "px-2 text-gray-400 hover:text-gray-600",
549
+ onMouseDown: (e) => e.preventDefault(),
550
+ onClick: () => onChange?.(""),
551
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
552
+ "svg",
553
+ {
554
+ width: "14",
555
+ height: "14",
556
+ viewBox: "0 0 24 24",
557
+ fill: "none",
558
+ stroke: "currentColor",
559
+ strokeWidth: "2",
560
+ strokeLinecap: "round",
561
+ strokeLinejoin: "round",
562
+ children: [
563
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
564
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
565
+ ]
566
+ }
567
+ )
568
+ }
569
+ ),
570
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pr-2.5 text-gray-400", children: rightIcon })
571
+ ]
572
+ }
573
+ )
574
+ }
575
+ );
576
+ }
577
+ );
578
+ InputString.displayName = "InputString";
579
+
580
+ // src/components/Input/InputEmail.tsx
581
+ var import_react8 = require("react");
582
+ var import_jsx_runtime8 = require("react/jsx-runtime");
583
+ var InputEmail = (0, import_react8.forwardRef)(
584
+ ({ label, error, errorMessage, required, size, leftIcon, rightIcon, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
585
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
586
+ InputWrapper,
587
+ {
588
+ label,
589
+ error,
590
+ errorMessage,
591
+ required,
592
+ disabled,
593
+ size,
594
+ classContainer,
595
+ htmlFor: name,
596
+ children: [
597
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "pl-2.5 text-gray-400", children: leftIcon }),
598
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
599
+ "input",
600
+ {
601
+ ref,
602
+ id: name,
603
+ name,
604
+ type: "email",
605
+ autoComplete: "email",
606
+ value: value ?? "",
607
+ onChange: (e) => onChange?.(e.target.value),
608
+ disabled,
609
+ "aria-invalid": !!error,
610
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
611
+ ...props
612
+ }
613
+ ),
614
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "pr-2.5 text-gray-400", children: rightIcon })
615
+ ]
616
+ }
617
+ );
618
+ }
619
+ );
620
+ InputEmail.displayName = "InputEmail";
621
+
622
+ // src/components/Input/InputPassword.tsx
623
+ var import_react9 = require("react");
624
+ var import_jsx_runtime9 = require("react/jsx-runtime");
625
+ var EyeIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
626
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
627
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "12", r: "3" })
628
+ ] });
629
+ var EyeOffIcon = () => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
630
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
631
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
632
+ ] });
633
+ var InputPassword = (0, import_react9.forwardRef)(
634
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
635
+ const [visible, setVisible] = (0, import_react9.useState)(false);
636
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
637
+ InputWrapper,
638
+ {
639
+ label,
640
+ error,
641
+ errorMessage,
642
+ required,
643
+ disabled,
644
+ size,
645
+ classContainer,
646
+ htmlFor: name,
647
+ children: [
648
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
649
+ "input",
650
+ {
651
+ ref,
652
+ id: name,
653
+ name,
654
+ type: visible ? "text" : "password",
655
+ autoComplete: "current-password",
656
+ value: value ?? "",
657
+ onChange: (e) => onChange?.(e.target.value),
658
+ disabled,
659
+ "aria-invalid": !!error,
660
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
661
+ ...props
662
+ }
663
+ ),
664
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
665
+ "button",
666
+ {
667
+ type: "button",
668
+ tabIndex: -1,
669
+ "aria-label": visible ? "Ocultar senha" : "Mostrar senha",
670
+ className: "px-2.5 text-gray-400 hover:text-gray-600",
671
+ onClick: () => setVisible(!visible),
672
+ children: visible ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EyeOffIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EyeIcon, {})
673
+ }
674
+ )
675
+ ]
676
+ }
677
+ );
678
+ }
679
+ );
680
+ InputPassword.displayName = "InputPassword";
681
+
682
+ // src/components/Input/InputNumber.tsx
683
+ var import_react10 = require("react");
684
+ var import_jsx_runtime10 = require("react/jsx-runtime");
685
+ var allowedKeys = ["Backspace", "Delete", "Tab", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"];
686
+ var InputNumber = (0, import_react10.forwardRef)(
687
+ ({ label, error, errorMessage, required, size, leftIcon, rightIcon, classContainer, classInput, value, onChange, disabled, name, min = 0, max, ...props }, ref) => {
688
+ function handleKeyDown(e) {
689
+ if (e.ctrlKey || e.metaKey) return;
690
+ if (allowedKeys.includes(e.key)) return;
691
+ if (!/^[0-9]$/.test(e.key)) {
692
+ e.preventDefault();
693
+ }
694
+ }
695
+ function handleChange(raw) {
696
+ if (raw === "") {
697
+ onChange?.(void 0);
698
+ return;
699
+ }
700
+ const num = Number(raw);
701
+ if (isNaN(num)) return;
702
+ if (min !== void 0 && num < min) return;
703
+ if (max !== void 0 && num > max) return;
704
+ onChange?.(num);
705
+ }
706
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
707
+ InputWrapper,
708
+ {
709
+ label,
710
+ error,
711
+ errorMessage,
712
+ required,
713
+ disabled,
714
+ size,
715
+ classContainer,
716
+ htmlFor: name,
717
+ children: [
718
+ leftIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "pl-2.5 text-gray-400", children: leftIcon }),
719
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
720
+ "input",
721
+ {
722
+ ref,
723
+ id: name,
724
+ name,
725
+ type: "text",
726
+ inputMode: "numeric",
727
+ value: value ?? "",
728
+ onChange: (e) => handleChange(e.target.value),
729
+ onKeyDown: handleKeyDown,
730
+ disabled,
731
+ "aria-invalid": !!error,
732
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
733
+ ...props
734
+ }
735
+ ),
736
+ rightIcon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "pr-2.5 text-gray-400", children: rightIcon })
737
+ ]
738
+ }
739
+ );
740
+ }
741
+ );
742
+ InputNumber.displayName = "InputNumber";
743
+
744
+ // src/components/Input/InputCPF.tsx
745
+ var import_react11 = require("react");
746
+
747
+ // src/components/Input/masks.ts
748
+ function maskCPF(value) {
749
+ const digits = value.replace(/\D/g, "").slice(0, 11);
750
+ return digits.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2");
751
+ }
752
+ function maskCNPJ(value) {
753
+ const digits = value.replace(/\D/g, "").slice(0, 14);
754
+ return digits.replace(/(\d{2})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1/$2").replace(/(\d{4})(\d{1,2})$/, "$1-$2");
755
+ }
756
+ function maskPhone(value) {
757
+ const digits = value.replace(/\D/g, "").slice(0, 11);
758
+ if (digits.length <= 10) {
759
+ return digits.replace(/(\d{2})(\d)/, "($1) $2").replace(/(\d{4})(\d)/, "$1-$2");
760
+ }
761
+ return digits.replace(/(\d{2})(\d)/, "($1) $2").replace(/(\d{5})(\d)/, "$1-$2");
762
+ }
763
+ function maskCEP(value) {
764
+ const digits = value.replace(/\D/g, "").slice(0, 8);
765
+ return digits.replace(/(\d{5})(\d)/, "$1-$2");
766
+ }
767
+ function unmask(value) {
768
+ return value.replace(/\D/g, "");
769
+ }
770
+ function maskCurrency(value, prefix = "R$ ", decimalScale = 2) {
771
+ return prefix + value.toFixed(decimalScale).replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".");
772
+ }
773
+ function unmaskCurrency(value) {
774
+ const cleaned = value.replace(/[^\d,-]/g, "").replace(",", ".");
775
+ return parseFloat(cleaned) || 0;
776
+ }
777
+
778
+ // src/components/Input/InputCPF.tsx
779
+ var import_jsx_runtime11 = require("react/jsx-runtime");
780
+ var InputCPF = (0, import_react11.forwardRef)(
781
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
782
+ function handleChange(raw) {
783
+ const digits = unmask(raw);
784
+ onChange?.(digits);
785
+ }
786
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
787
+ InputWrapper,
788
+ {
789
+ label,
790
+ error,
791
+ errorMessage,
792
+ required,
793
+ disabled,
794
+ size,
795
+ classContainer,
796
+ htmlFor: name,
797
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
798
+ "input",
799
+ {
800
+ ref,
801
+ id: name,
802
+ name,
803
+ type: "text",
804
+ inputMode: "numeric",
805
+ maxLength: 14,
806
+ placeholder: "000.000.000-00",
807
+ value: value ? maskCPF(value) : "",
808
+ onChange: (e) => handleChange(e.target.value),
809
+ disabled,
810
+ "aria-invalid": !!error,
811
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
812
+ ...props
813
+ }
814
+ )
815
+ }
816
+ );
817
+ }
818
+ );
819
+ InputCPF.displayName = "InputCPF";
820
+
821
+ // src/components/Input/InputCNPJ.tsx
822
+ var import_react12 = require("react");
823
+ var import_jsx_runtime12 = require("react/jsx-runtime");
824
+ var InputCNPJ = (0, import_react12.forwardRef)(
825
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
826
+ function handleChange(raw) {
827
+ const digits = unmask(raw);
828
+ onChange?.(digits);
829
+ }
830
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
831
+ InputWrapper,
832
+ {
833
+ label,
834
+ error,
835
+ errorMessage,
836
+ required,
837
+ disabled,
838
+ size,
839
+ classContainer,
840
+ htmlFor: name,
841
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
842
+ "input",
843
+ {
844
+ ref,
845
+ id: name,
846
+ name,
847
+ type: "text",
848
+ inputMode: "numeric",
849
+ maxLength: 18,
850
+ placeholder: "00.000.000/0000-00",
851
+ value: value ? maskCNPJ(value) : "",
852
+ onChange: (e) => handleChange(e.target.value),
853
+ disabled,
854
+ "aria-invalid": !!error,
855
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
856
+ ...props
857
+ }
858
+ )
859
+ }
860
+ );
861
+ }
862
+ );
863
+ InputCNPJ.displayName = "InputCNPJ";
864
+
865
+ // src/components/Input/InputPhone.tsx
866
+ var import_react13 = require("react");
867
+ var import_jsx_runtime13 = require("react/jsx-runtime");
868
+ var InputPhone = (0, import_react13.forwardRef)(
869
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
870
+ function handleChange(raw) {
871
+ const digits = unmask(raw);
872
+ onChange?.(digits);
873
+ }
874
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
875
+ InputWrapper,
876
+ {
877
+ label,
878
+ error,
879
+ errorMessage,
880
+ required,
881
+ disabled,
882
+ size,
883
+ classContainer,
884
+ htmlFor: name,
885
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
886
+ "input",
887
+ {
888
+ ref,
889
+ id: name,
890
+ name,
891
+ type: "tel",
892
+ inputMode: "numeric",
893
+ maxLength: 15,
894
+ placeholder: "(00) 00000-0000",
895
+ value: value ? maskPhone(value) : "",
896
+ onChange: (e) => handleChange(e.target.value),
897
+ disabled,
898
+ "aria-invalid": !!error,
899
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
900
+ ...props
901
+ }
902
+ )
903
+ }
904
+ );
905
+ }
906
+ );
907
+ InputPhone.displayName = "InputPhone";
908
+
909
+ // src/components/Input/InputCurrency.tsx
910
+ var import_react14 = require("react");
911
+ var import_jsx_runtime14 = require("react/jsx-runtime");
912
+ function formatCurrency(value, prefix, decimalScale) {
913
+ const fixed = Math.abs(value).toFixed(decimalScale);
914
+ const [intPart, decPart] = fixed.split(".");
915
+ const formatted = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, ".");
916
+ const sign = value < 0 ? "-" : "";
917
+ return `${sign}${prefix}${formatted},${decPart}`;
918
+ }
919
+ var InputCurrency = (0, import_react14.forwardRef)(
920
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, prefix = "R$ ", decimalScale = 2, allowNegative = false, ...props }, ref) => {
921
+ function handleChange(e) {
922
+ const raw = e.target.value;
923
+ const num = unmaskCurrency(raw);
924
+ if (!allowNegative && num < 0) return;
925
+ onChange?.(isNaN(num) ? void 0 : num);
926
+ }
927
+ const displayValue = value !== void 0 && value !== null ? formatCurrency(value, prefix, decimalScale) : "";
928
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
929
+ InputWrapper,
930
+ {
931
+ label,
932
+ error,
933
+ errorMessage,
934
+ required,
935
+ disabled,
936
+ size,
937
+ classContainer,
938
+ htmlFor: name,
939
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
940
+ "input",
941
+ {
942
+ ref,
943
+ id: name,
944
+ name,
945
+ type: "text",
946
+ inputMode: "decimal",
947
+ value: displayValue,
948
+ onChange: handleChange,
949
+ disabled,
950
+ "aria-invalid": !!error,
951
+ placeholder: `${prefix}0,${"0".repeat(decimalScale)}`,
952
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
953
+ ...props
954
+ }
955
+ )
956
+ }
957
+ );
958
+ }
959
+ );
960
+ InputCurrency.displayName = "InputCurrency";
961
+
962
+ // src/components/Input/InputCep.tsx
963
+ var import_react15 = require("react");
964
+ var import_jsx_runtime15 = require("react/jsx-runtime");
965
+ var InputCep = (0, import_react15.forwardRef)(
966
+ ({ label, error, errorMessage, required, size, classContainer, classInput, value, onChange, disabled, name, ...props }, ref) => {
967
+ function handleChange(raw) {
968
+ const digits = unmask(raw);
969
+ onChange?.(digits);
970
+ }
971
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
972
+ InputWrapper,
973
+ {
974
+ label,
975
+ error,
976
+ errorMessage,
977
+ required,
978
+ disabled,
979
+ size,
980
+ classContainer,
981
+ htmlFor: name,
982
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
983
+ "input",
984
+ {
985
+ ref,
986
+ id: name,
987
+ name,
988
+ type: "text",
989
+ inputMode: "numeric",
990
+ autoComplete: "postal-code",
991
+ maxLength: 9,
992
+ placeholder: "00000-000",
993
+ value: value ? maskCEP(value) : "",
994
+ onChange: (e) => handleChange(e.target.value),
995
+ disabled,
996
+ "aria-invalid": !!error,
997
+ className: `flex-1 min-w-0 h-full bg-transparent px-2.5 outline-none text-gray-900 placeholder:text-gray-400 disabled:cursor-not-allowed ${classInput ?? ""}`,
998
+ ...props
999
+ }
1000
+ )
1001
+ }
1002
+ );
1003
+ }
1004
+ );
1005
+ InputCep.displayName = "InputCep";
1006
+
1007
+ // src/components/Input/InputCheckbox.tsx
1008
+ var import_react16 = require("react");
1009
+ var import_tailwind_variants7 = require("tailwind-variants");
1010
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1011
+ var checkboxContainer = (0, import_tailwind_variants7.tv)({
1012
+ base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded border cursor-pointer transition-colors",
1013
+ variants: {
1014
+ checked: {
1015
+ true: "bg-blue-600 border-blue-600",
1016
+ false: "bg-white border-gray-300 hover:border-blue-500 hover:bg-blue-50"
1017
+ },
1018
+ disabled: {
1019
+ true: "opacity-50 cursor-not-allowed"
1020
+ },
1021
+ error: {
1022
+ true: "border-red-500"
1023
+ }
1024
+ },
1025
+ defaultVariants: {
1026
+ checked: false
1027
+ }
1028
+ });
1029
+ var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", stroke: "white", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("polyline", { points: "20 6 9 17 4 12" }) });
1030
+ var IndeterminateIcon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-2 h-2 rounded-sm bg-gray-300" });
1031
+ var InputCheckbox = (0, import_react16.forwardRef)(
1032
+ ({ label, checked = false, indeterminate = false, onChange, disabled, error, labelPosition = "right", className, name, required }, ref) => {
1033
+ function handleClick() {
1034
+ if (disabled) return;
1035
+ onChange?.(!checked);
1036
+ }
1037
+ const box = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1038
+ "button",
1039
+ {
1040
+ ref,
1041
+ type: "button",
1042
+ role: "checkbox",
1043
+ id: name,
1044
+ "aria-checked": indeterminate ? "mixed" : checked,
1045
+ "aria-required": required,
1046
+ className: checkboxContainer({ checked: checked || indeterminate, disabled: !!disabled, error: !!error }),
1047
+ onClick: handleClick,
1048
+ disabled,
1049
+ children: [
1050
+ checked && !indeterminate && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckIcon, {}),
1051
+ indeterminate && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IndeterminateIcon, {})
1052
+ ]
1053
+ }
1054
+ );
1055
+ if (!label) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className, children: box });
1056
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: `flex items-center gap-2 ${className ?? ""}`, children: [
1057
+ labelPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: name, className: "text-sm text-gray-700 cursor-pointer select-none", children: label }),
1058
+ box,
1059
+ labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("label", { htmlFor: name, className: "text-sm text-gray-700 cursor-pointer select-none", children: label }),
1060
+ required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-red-500 text-[10px]", children: "*" })
1061
+ ] });
1062
+ }
1063
+ );
1064
+ InputCheckbox.displayName = "InputCheckbox";
1065
+
1066
+ // src/components/Input/InputRadio.tsx
1067
+ var import_react17 = require("react");
1068
+ var import_tailwind_variants8 = require("tailwind-variants");
1069
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1070
+ var radioButton = (0, import_tailwind_variants8.tv)({
1071
+ base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded-full border cursor-pointer transition-colors",
1072
+ variants: {
1073
+ selected: {
1074
+ true: "border-blue-600",
1075
+ false: "border-gray-300 hover:border-blue-500 hover:bg-blue-50"
1076
+ },
1077
+ disabled: {
1078
+ true: "opacity-50 cursor-not-allowed"
1079
+ },
1080
+ error: {
1081
+ true: "border-red-500"
1082
+ }
1083
+ },
1084
+ defaultVariants: {
1085
+ selected: false
1086
+ }
1087
+ });
1088
+ var InputRadio = (0, import_react17.forwardRef)(
1089
+ ({ label, options, value, onChange, disabled, error, required, name, className, direction = "horizontal" }, ref) => {
1090
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref, className: `flex w-full flex-col gap-1 ${className ?? ""}`, children: [
1091
+ label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "text-xs text-gray-700 flex items-start gap-0.5", children: [
1092
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: label }),
1093
+ required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
1094
+ ] }),
1095
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1096
+ "div",
1097
+ {
1098
+ role: "radiogroup",
1099
+ "aria-label": label,
1100
+ className: `flex gap-3 ${direction === "vertical" ? "flex-col" : "items-center"}`,
1101
+ children: options.map((option) => {
1102
+ const isSelected = value === option.value;
1103
+ const isDisabled = disabled || option.disabled;
1104
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1105
+ "label",
1106
+ {
1107
+ className: `flex items-center gap-2 cursor-pointer select-none ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`,
1108
+ children: [
1109
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1110
+ "button",
1111
+ {
1112
+ type: "button",
1113
+ role: "radio",
1114
+ "aria-checked": isSelected,
1115
+ className: radioButton({ selected: isSelected, disabled: !!isDisabled, error: !!error }),
1116
+ onClick: () => !isDisabled && onChange?.(option.value),
1117
+ disabled: isDisabled,
1118
+ children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-[10px] h-[10px] rounded-full bg-blue-600" })
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm text-gray-700", children: option.label })
1122
+ ]
1123
+ },
1124
+ String(option.value)
1125
+ );
1126
+ })
1127
+ }
1128
+ ),
1129
+ error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-red-500 mt-0.5", children: "Selecione uma op\xE7\xE3o" })
1130
+ ] });
1131
+ }
1132
+ );
1133
+ InputRadio.displayName = "InputRadio";
1134
+
1135
+ // src/components/Input/Textarea.tsx
1136
+ var import_react18 = require("react");
1137
+ var import_tailwind_variants9 = require("tailwind-variants");
1138
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1139
+ var textareaStyle = (0, import_tailwind_variants9.tv)({
1140
+ base: "w-full rounded-md border bg-white px-2.5 py-2 text-sm text-gray-900 outline-none placeholder:text-gray-400 resize-vertical transition-colors",
1141
+ variants: {
1142
+ error: {
1143
+ true: "border-red-500 focus:border-red-500 focus:ring-1 focus:ring-red-500",
1144
+ false: "border-gray-300 hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500"
1145
+ },
1146
+ disabled: {
1147
+ true: "opacity-50 cursor-not-allowed bg-gray-50"
1148
+ }
1149
+ },
1150
+ defaultVariants: {
1151
+ error: false
1152
+ }
1153
+ });
1154
+ var Textarea = (0, import_react18.forwardRef)(
1155
+ ({ label, error, errorMessage, required, size, classInput, value, onChange, disabled, name, rows = 4, ...props }, ref) => {
1156
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex w-full flex-col gap-1", children: [
1157
+ label && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { htmlFor: name, className: "text-xs text-gray-700 flex items-start gap-0.5", children: [
1158
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: label }),
1159
+ required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
1160
+ ] }),
1161
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1162
+ "textarea",
1163
+ {
1164
+ ref,
1165
+ id: name,
1166
+ name,
1167
+ rows,
1168
+ value: value ?? "",
1169
+ onChange: (e) => onChange?.(e.target.value),
1170
+ disabled,
1171
+ "aria-invalid": !!error,
1172
+ className: textareaStyle({ error: !!error, disabled: !!disabled, className: classInput }),
1173
+ ...props
1174
+ }
1175
+ ),
1176
+ error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-red-500 mt-0.5", children: errorMessage })
1177
+ ] });
1178
+ }
1179
+ );
1180
+ Textarea.displayName = "Textarea";
65
1181
  // Annotate the CommonJS export names for ESM import in node:
66
1182
  0 && (module.exports = {
1183
+ Avatar,
67
1184
  Button,
68
- button
1185
+ Card,
1186
+ InputCNPJ,
1187
+ InputCPF,
1188
+ InputCep,
1189
+ InputCheckbox,
1190
+ InputCurrency,
1191
+ InputEmail,
1192
+ InputNumber,
1193
+ InputPassword,
1194
+ InputPhone,
1195
+ InputRadio,
1196
+ InputString,
1197
+ InputWrapper,
1198
+ Modal,
1199
+ Textarea,
1200
+ Tooltip,
1201
+ avatar,
1202
+ button,
1203
+ card,
1204
+ maskCEP,
1205
+ maskCNPJ,
1206
+ maskCPF,
1207
+ maskCurrency,
1208
+ maskPhone,
1209
+ modal,
1210
+ tooltip,
1211
+ unmask,
1212
+ unmaskCurrency
69
1213
  });