@sigep/react 1.1.2 → 1.1.4
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.d.mts +862 -2
- package/dist/index.d.ts +862 -2
- package/dist/index.js +823 -72
- package/dist/index.mjs +806 -73
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12,9 +12,9 @@ var avatar = tv({
|
|
|
12
12
|
xl: "h-16 w-16 text-lg"
|
|
13
13
|
},
|
|
14
14
|
variant: {
|
|
15
|
-
primary: "bg-blue-
|
|
16
|
-
secondary: "bg-gray-200 text-gray-
|
|
17
|
-
outline: "bg-white text-blue-
|
|
15
|
+
primary: "bg-blue-500 text-white",
|
|
16
|
+
secondary: "bg-gray-200 text-gray-600",
|
|
17
|
+
outline: "bg-white text-blue-500 ring-2 ring-blue-500 ring-offset-2"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
@@ -29,14 +29,22 @@ function getInitials(name) {
|
|
|
29
29
|
}
|
|
30
30
|
var Avatar = forwardRef(
|
|
31
31
|
({ name, src, alt, size, variant, className, ...props }, ref) => {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
"
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
34
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
ref,
|
|
36
|
+
className: avatar({ size, variant, className }),
|
|
37
|
+
...props,
|
|
38
|
+
children: src ? /* @__PURE__ */ jsx(
|
|
39
|
+
"img",
|
|
40
|
+
{
|
|
41
|
+
src,
|
|
42
|
+
alt: alt || name || "avatar",
|
|
43
|
+
className: "h-full w-full object-cover"
|
|
44
|
+
}
|
|
45
|
+
) : /* @__PURE__ */ jsx("span", { children: name ? getInitials(name) : "?" })
|
|
38
46
|
}
|
|
39
|
-
)
|
|
47
|
+
);
|
|
40
48
|
}
|
|
41
49
|
);
|
|
42
50
|
Avatar.displayName = "Avatar";
|
|
@@ -49,10 +57,10 @@ var button = tv2({
|
|
|
49
57
|
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",
|
|
50
58
|
variants: {
|
|
51
59
|
variant: {
|
|
52
|
-
primary: "bg-blue-
|
|
53
|
-
secondary: "border border-blue-
|
|
54
|
-
tertiary: "text-blue-
|
|
55
|
-
danger: "bg-red-
|
|
60
|
+
primary: "bg-blue-500 text-white hover:bg-blue-700 focus-visible:outline-blue-500",
|
|
61
|
+
secondary: "border border-blue-500 text-blue-500 hover:bg-blue-50 focus-visible:outline-blue-500",
|
|
62
|
+
tertiary: "text-blue-500 hover:bg-blue-50 focus-visible:outline-blue-500",
|
|
63
|
+
danger: "bg-red-500 text-white hover:bg-red-500/90 focus-visible:outline-red-500"
|
|
56
64
|
},
|
|
57
65
|
size: {
|
|
58
66
|
sm: "h-9 px-3 text-sm",
|
|
@@ -115,7 +123,11 @@ var Card = forwardRef3(
|
|
|
115
123
|
Card.displayName = "Card";
|
|
116
124
|
|
|
117
125
|
// src/components/Modal/index.tsx
|
|
118
|
-
import {
|
|
126
|
+
import {
|
|
127
|
+
forwardRef as forwardRef4,
|
|
128
|
+
useEffect,
|
|
129
|
+
useCallback
|
|
130
|
+
} from "react";
|
|
119
131
|
import { tv as tv4 } from "tailwind-variants";
|
|
120
132
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
121
133
|
var overlay = tv4({
|
|
@@ -169,7 +181,7 @@ var Modal = forwardRef4(
|
|
|
169
181
|
"button",
|
|
170
182
|
{
|
|
171
183
|
type: "button",
|
|
172
|
-
className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-500 hover:bg-gray-200 hover:text-gray-
|
|
184
|
+
className: "inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-500 hover:bg-gray-200 hover:text-gray-600 transition-colors",
|
|
173
185
|
onClick: onClose,
|
|
174
186
|
"aria-label": "Fechar",
|
|
175
187
|
children: "\u2715"
|
|
@@ -396,7 +408,7 @@ var wrapper = tv6({
|
|
|
396
408
|
base: "flex w-full flex-col gap-1"
|
|
397
409
|
});
|
|
398
410
|
var labelStyle = tv6({
|
|
399
|
-
base: "text-xs text-gray-
|
|
411
|
+
base: "text-xs text-gray-600 flex items-start gap-0.5"
|
|
400
412
|
});
|
|
401
413
|
var containerStyle = tv6({
|
|
402
414
|
base: "flex items-center w-full rounded-md border bg-white transition-colors",
|
|
@@ -423,13 +435,35 @@ var errorStyle = tv6({
|
|
|
423
435
|
base: "text-xs text-red-500 mt-0.5"
|
|
424
436
|
});
|
|
425
437
|
var InputWrapper = forwardRef6(
|
|
426
|
-
({
|
|
438
|
+
({
|
|
439
|
+
label,
|
|
440
|
+
error,
|
|
441
|
+
errorMessage,
|
|
442
|
+
required,
|
|
443
|
+
disabled,
|
|
444
|
+
size,
|
|
445
|
+
children,
|
|
446
|
+
className,
|
|
447
|
+
classContainer,
|
|
448
|
+
htmlFor
|
|
449
|
+
}, ref) => {
|
|
427
450
|
return /* @__PURE__ */ jsxs4("div", { ref, className: wrapper({ className }), children: [
|
|
428
451
|
label && /* @__PURE__ */ jsxs4("label", { htmlFor, className: labelStyle(), children: [
|
|
429
452
|
/* @__PURE__ */ jsx6("span", { children: label }),
|
|
430
453
|
required && /* @__PURE__ */ jsx6("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
431
454
|
] }),
|
|
432
|
-
/* @__PURE__ */ jsx6(
|
|
455
|
+
/* @__PURE__ */ jsx6(
|
|
456
|
+
"div",
|
|
457
|
+
{
|
|
458
|
+
className: containerStyle({
|
|
459
|
+
size,
|
|
460
|
+
error: !!error,
|
|
461
|
+
disabled: !!disabled,
|
|
462
|
+
className: classContainer
|
|
463
|
+
}),
|
|
464
|
+
children
|
|
465
|
+
}
|
|
466
|
+
),
|
|
433
467
|
error && errorMessage && /* @__PURE__ */ jsx6("span", { className: errorStyle(), children: errorMessage })
|
|
434
468
|
] });
|
|
435
469
|
}
|
|
@@ -964,7 +998,7 @@ var checkboxContainer = tv7({
|
|
|
964
998
|
base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded border cursor-pointer transition-colors",
|
|
965
999
|
variants: {
|
|
966
1000
|
checked: {
|
|
967
|
-
true: "bg-blue-
|
|
1001
|
+
true: "bg-blue-500 border-blue-500",
|
|
968
1002
|
false: "bg-white border-gray-300 hover:border-blue-500 hover:bg-blue-50"
|
|
969
1003
|
},
|
|
970
1004
|
disabled: {
|
|
@@ -978,10 +1012,34 @@ var checkboxContainer = tv7({
|
|
|
978
1012
|
checked: false
|
|
979
1013
|
}
|
|
980
1014
|
});
|
|
981
|
-
var CheckIcon = () => /* @__PURE__ */ jsx16(
|
|
1015
|
+
var CheckIcon = () => /* @__PURE__ */ jsx16(
|
|
1016
|
+
"svg",
|
|
1017
|
+
{
|
|
1018
|
+
width: "10",
|
|
1019
|
+
height: "10",
|
|
1020
|
+
viewBox: "0 0 24 24",
|
|
1021
|
+
fill: "none",
|
|
1022
|
+
stroke: "white",
|
|
1023
|
+
strokeWidth: "4",
|
|
1024
|
+
strokeLinecap: "round",
|
|
1025
|
+
strokeLinejoin: "round",
|
|
1026
|
+
children: /* @__PURE__ */ jsx16("polyline", { points: "20 6 9 17 4 12" })
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
982
1029
|
var IndeterminateIcon = () => /* @__PURE__ */ jsx16("div", { className: "w-2 h-2 rounded-sm bg-gray-300" });
|
|
983
1030
|
var InputCheckbox = forwardRef16(
|
|
984
|
-
({
|
|
1031
|
+
({
|
|
1032
|
+
label,
|
|
1033
|
+
checked = false,
|
|
1034
|
+
indeterminate = false,
|
|
1035
|
+
onChange,
|
|
1036
|
+
disabled,
|
|
1037
|
+
error,
|
|
1038
|
+
labelPosition = "right",
|
|
1039
|
+
className,
|
|
1040
|
+
name,
|
|
1041
|
+
required
|
|
1042
|
+
}, ref) => {
|
|
985
1043
|
function handleClick() {
|
|
986
1044
|
if (disabled) return;
|
|
987
1045
|
onChange?.(!checked);
|
|
@@ -995,7 +1053,11 @@ var InputCheckbox = forwardRef16(
|
|
|
995
1053
|
id: name,
|
|
996
1054
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
997
1055
|
"aria-required": required,
|
|
998
|
-
className: checkboxContainer({
|
|
1056
|
+
className: checkboxContainer({
|
|
1057
|
+
checked: checked || indeterminate,
|
|
1058
|
+
disabled: !!disabled,
|
|
1059
|
+
error: !!error
|
|
1060
|
+
}),
|
|
999
1061
|
onClick: handleClick,
|
|
1000
1062
|
disabled,
|
|
1001
1063
|
children: [
|
|
@@ -1006,9 +1068,23 @@ var InputCheckbox = forwardRef16(
|
|
|
1006
1068
|
);
|
|
1007
1069
|
if (!label) return /* @__PURE__ */ jsx16("div", { className, children: box });
|
|
1008
1070
|
return /* @__PURE__ */ jsxs9("div", { className: `flex items-center gap-2 ${className ?? ""}`, children: [
|
|
1009
|
-
labelPosition === "left" && /* @__PURE__ */ jsx16(
|
|
1071
|
+
labelPosition === "left" && /* @__PURE__ */ jsx16(
|
|
1072
|
+
"label",
|
|
1073
|
+
{
|
|
1074
|
+
htmlFor: name,
|
|
1075
|
+
className: "text-sm text-gray-600 cursor-pointer select-none",
|
|
1076
|
+
children: label
|
|
1077
|
+
}
|
|
1078
|
+
),
|
|
1010
1079
|
box,
|
|
1011
|
-
labelPosition === "right" && /* @__PURE__ */ jsx16(
|
|
1080
|
+
labelPosition === "right" && /* @__PURE__ */ jsx16(
|
|
1081
|
+
"label",
|
|
1082
|
+
{
|
|
1083
|
+
htmlFor: name,
|
|
1084
|
+
className: "text-sm text-gray-600 cursor-pointer select-none",
|
|
1085
|
+
children: label
|
|
1086
|
+
}
|
|
1087
|
+
),
|
|
1012
1088
|
required && /* @__PURE__ */ jsx16("span", { className: "text-red-500 text-[10px]", children: "*" })
|
|
1013
1089
|
] });
|
|
1014
1090
|
}
|
|
@@ -1023,7 +1099,7 @@ var radioButton = tv8({
|
|
|
1023
1099
|
base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded-full border cursor-pointer transition-colors",
|
|
1024
1100
|
variants: {
|
|
1025
1101
|
selected: {
|
|
1026
|
-
true: "border-blue-
|
|
1102
|
+
true: "border-blue-500",
|
|
1027
1103
|
false: "border-gray-300 hover:border-blue-500 hover:bg-blue-50"
|
|
1028
1104
|
},
|
|
1029
1105
|
disabled: {
|
|
@@ -1038,48 +1114,70 @@ var radioButton = tv8({
|
|
|
1038
1114
|
}
|
|
1039
1115
|
});
|
|
1040
1116
|
var InputRadio = forwardRef17(
|
|
1041
|
-
({
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1117
|
+
({
|
|
1118
|
+
label,
|
|
1119
|
+
options,
|
|
1120
|
+
value,
|
|
1121
|
+
onChange,
|
|
1122
|
+
disabled,
|
|
1123
|
+
error,
|
|
1124
|
+
required,
|
|
1125
|
+
name,
|
|
1126
|
+
className,
|
|
1127
|
+
direction = "horizontal"
|
|
1128
|
+
}, ref) => {
|
|
1129
|
+
return /* @__PURE__ */ jsxs10(
|
|
1130
|
+
"div",
|
|
1131
|
+
{
|
|
1132
|
+
ref,
|
|
1133
|
+
className: `flex w-full flex-col gap-1 ${className ?? ""}`,
|
|
1134
|
+
children: [
|
|
1135
|
+
label && /* @__PURE__ */ jsxs10("span", { className: "text-xs text-gray-600 flex items-start gap-0.5", children: [
|
|
1136
|
+
/* @__PURE__ */ jsx17("span", { children: label }),
|
|
1137
|
+
required && /* @__PURE__ */ jsx17("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
1138
|
+
] }),
|
|
1139
|
+
/* @__PURE__ */ jsx17(
|
|
1140
|
+
"div",
|
|
1141
|
+
{
|
|
1142
|
+
role: "radiogroup",
|
|
1143
|
+
"aria-label": label,
|
|
1144
|
+
className: `flex gap-3 ${direction === "vertical" ? "flex-col" : "items-center"}`,
|
|
1145
|
+
children: options.map((option) => {
|
|
1146
|
+
const isSelected = value === option.value;
|
|
1147
|
+
const isDisabled = disabled || option.disabled;
|
|
1148
|
+
return /* @__PURE__ */ jsxs10(
|
|
1149
|
+
"label",
|
|
1150
|
+
{
|
|
1151
|
+
className: `flex items-center gap-2 cursor-pointer select-none ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
1152
|
+
children: [
|
|
1153
|
+
/* @__PURE__ */ jsx17(
|
|
1154
|
+
"button",
|
|
1155
|
+
{
|
|
1156
|
+
type: "button",
|
|
1157
|
+
role: "radio",
|
|
1158
|
+
"aria-checked": isSelected,
|
|
1159
|
+
className: radioButton({
|
|
1160
|
+
selected: isSelected,
|
|
1161
|
+
disabled: !!isDisabled,
|
|
1162
|
+
error: !!error
|
|
1163
|
+
}),
|
|
1164
|
+
onClick: () => !isDisabled && onChange?.(option.value),
|
|
1165
|
+
disabled: isDisabled,
|
|
1166
|
+
children: isSelected && /* @__PURE__ */ jsx17("div", { className: "w-[10px] h-[10px] rounded-full bg-blue-500" })
|
|
1167
|
+
}
|
|
1168
|
+
),
|
|
1169
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm text-gray-600", children: option.label })
|
|
1170
|
+
]
|
|
1171
|
+
},
|
|
1172
|
+
String(option.value)
|
|
1173
|
+
);
|
|
1174
|
+
})
|
|
1175
|
+
}
|
|
1176
|
+
),
|
|
1177
|
+
error && /* @__PURE__ */ jsx17("span", { className: "text-xs text-red-500 mt-0.5", children: "Selecione uma op\xE7\xE3o" })
|
|
1178
|
+
]
|
|
1179
|
+
}
|
|
1180
|
+
);
|
|
1083
1181
|
}
|
|
1084
1182
|
);
|
|
1085
1183
|
InputRadio.displayName = "InputRadio";
|
|
@@ -1104,12 +1202,32 @@ var textareaStyle = tv9({
|
|
|
1104
1202
|
}
|
|
1105
1203
|
});
|
|
1106
1204
|
var Textarea = forwardRef18(
|
|
1107
|
-
({
|
|
1205
|
+
({
|
|
1206
|
+
label,
|
|
1207
|
+
error,
|
|
1208
|
+
errorMessage,
|
|
1209
|
+
required,
|
|
1210
|
+
size,
|
|
1211
|
+
classInput,
|
|
1212
|
+
value,
|
|
1213
|
+
onChange,
|
|
1214
|
+
disabled,
|
|
1215
|
+
name,
|
|
1216
|
+
rows = 4,
|
|
1217
|
+
...props
|
|
1218
|
+
}, ref) => {
|
|
1108
1219
|
return /* @__PURE__ */ jsxs11("div", { className: "flex w-full flex-col gap-1", children: [
|
|
1109
|
-
label && /* @__PURE__ */ jsxs11(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1220
|
+
label && /* @__PURE__ */ jsxs11(
|
|
1221
|
+
"label",
|
|
1222
|
+
{
|
|
1223
|
+
htmlFor: name,
|
|
1224
|
+
className: "text-xs text-gray-600 flex items-start gap-0.5",
|
|
1225
|
+
children: [
|
|
1226
|
+
/* @__PURE__ */ jsx18("span", { children: label }),
|
|
1227
|
+
required && /* @__PURE__ */ jsx18("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
),
|
|
1113
1231
|
/* @__PURE__ */ jsx18(
|
|
1114
1232
|
"textarea",
|
|
1115
1233
|
{
|
|
@@ -1121,7 +1239,11 @@ var Textarea = forwardRef18(
|
|
|
1121
1239
|
onChange: (e) => onChange?.(e.target.value),
|
|
1122
1240
|
disabled,
|
|
1123
1241
|
"aria-invalid": !!error,
|
|
1124
|
-
className: textareaStyle({
|
|
1242
|
+
className: textareaStyle({
|
|
1243
|
+
error: !!error,
|
|
1244
|
+
disabled: !!disabled,
|
|
1245
|
+
className: classInput
|
|
1246
|
+
}),
|
|
1125
1247
|
...props
|
|
1126
1248
|
}
|
|
1127
1249
|
),
|
|
@@ -1130,10 +1252,604 @@ var Textarea = forwardRef18(
|
|
|
1130
1252
|
}
|
|
1131
1253
|
);
|
|
1132
1254
|
Textarea.displayName = "Textarea";
|
|
1255
|
+
|
|
1256
|
+
// src/components/Accordion/index.tsx
|
|
1257
|
+
import { forwardRef as forwardRef19, useState as useState4, useId } from "react";
|
|
1258
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
1259
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1260
|
+
var accordion = tv10({
|
|
1261
|
+
base: "divide-y divide-gray-200",
|
|
1262
|
+
variants: {
|
|
1263
|
+
variant: {
|
|
1264
|
+
default: "border border-gray-200 rounded-lg",
|
|
1265
|
+
separated: "space-y-2 divide-y-0",
|
|
1266
|
+
flush: ""
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
defaultVariants: {
|
|
1270
|
+
variant: "default"
|
|
1271
|
+
}
|
|
1272
|
+
});
|
|
1273
|
+
var accordionItem = tv10({
|
|
1274
|
+
base: "",
|
|
1275
|
+
variants: {
|
|
1276
|
+
variant: {
|
|
1277
|
+
default: "",
|
|
1278
|
+
separated: "border border-gray-200 rounded-lg overflow-hidden",
|
|
1279
|
+
flush: "border-b border-gray-200 last:border-b-0"
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
var accordionTrigger = tv10({
|
|
1284
|
+
base: "flex w-full items-center justify-between px-4 py-3 text-left text-sm font-medium text-gray-900 transition-colors hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1285
|
+
variants: {
|
|
1286
|
+
open: {
|
|
1287
|
+
true: "",
|
|
1288
|
+
false: ""
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
});
|
|
1292
|
+
var accordionContent = tv10({
|
|
1293
|
+
base: "overflow-hidden transition-all duration-200",
|
|
1294
|
+
variants: {
|
|
1295
|
+
open: {
|
|
1296
|
+
true: "max-h-[2000px] opacity-100",
|
|
1297
|
+
false: "max-h-0 opacity-0"
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
var Accordion = forwardRef19(
|
|
1302
|
+
({
|
|
1303
|
+
variant = "default",
|
|
1304
|
+
items,
|
|
1305
|
+
type = "single",
|
|
1306
|
+
defaultValue = [],
|
|
1307
|
+
value,
|
|
1308
|
+
onChange,
|
|
1309
|
+
className,
|
|
1310
|
+
...props
|
|
1311
|
+
}, ref) => {
|
|
1312
|
+
const id = useId();
|
|
1313
|
+
const [internalValue, setInternalValue] = useState4(defaultValue);
|
|
1314
|
+
const openItems = value !== void 0 ? value : internalValue;
|
|
1315
|
+
const handleToggle = (itemValue) => {
|
|
1316
|
+
let next;
|
|
1317
|
+
if (type === "single") {
|
|
1318
|
+
next = openItems.includes(itemValue) ? [] : [itemValue];
|
|
1319
|
+
} else {
|
|
1320
|
+
next = openItems.includes(itemValue) ? openItems.filter((v) => v !== itemValue) : [...openItems, itemValue];
|
|
1321
|
+
}
|
|
1322
|
+
if (value === void 0) {
|
|
1323
|
+
setInternalValue(next);
|
|
1324
|
+
}
|
|
1325
|
+
onChange?.(next);
|
|
1326
|
+
};
|
|
1327
|
+
return /* @__PURE__ */ jsx19("div", { ref, className: accordion({ variant, className }), ...props, children: items.map((item) => {
|
|
1328
|
+
const isOpen = openItems.includes(item.value);
|
|
1329
|
+
return /* @__PURE__ */ jsxs12(
|
|
1330
|
+
"div",
|
|
1331
|
+
{
|
|
1332
|
+
className: accordionItem({ variant }),
|
|
1333
|
+
children: [
|
|
1334
|
+
/* @__PURE__ */ jsxs12(
|
|
1335
|
+
"button",
|
|
1336
|
+
{
|
|
1337
|
+
type: "button",
|
|
1338
|
+
id: `${id}-trigger-${item.value}`,
|
|
1339
|
+
"aria-expanded": isOpen,
|
|
1340
|
+
"aria-controls": `${id}-content-${item.value}`,
|
|
1341
|
+
disabled: item.disabled,
|
|
1342
|
+
className: accordionTrigger({ open: isOpen }),
|
|
1343
|
+
onClick: () => handleToggle(item.value),
|
|
1344
|
+
children: [
|
|
1345
|
+
item.trigger,
|
|
1346
|
+
/* @__PURE__ */ jsx19(
|
|
1347
|
+
"svg",
|
|
1348
|
+
{
|
|
1349
|
+
className: `h-4 w-4 flex-shrink-0 text-gray-500 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`,
|
|
1350
|
+
fill: "none",
|
|
1351
|
+
viewBox: "0 0 24 24",
|
|
1352
|
+
stroke: "currentColor",
|
|
1353
|
+
strokeWidth: 2,
|
|
1354
|
+
children: /* @__PURE__ */ jsx19("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
1355
|
+
}
|
|
1356
|
+
)
|
|
1357
|
+
]
|
|
1358
|
+
}
|
|
1359
|
+
),
|
|
1360
|
+
/* @__PURE__ */ jsx19(
|
|
1361
|
+
"div",
|
|
1362
|
+
{
|
|
1363
|
+
id: `${id}-content-${item.value}`,
|
|
1364
|
+
role: "region",
|
|
1365
|
+
"aria-labelledby": `${id}-trigger-${item.value}`,
|
|
1366
|
+
className: accordionContent({ open: isOpen }),
|
|
1367
|
+
children: /* @__PURE__ */ jsx19("div", { className: "px-4 pb-3 text-sm text-gray-600", children: item.content })
|
|
1368
|
+
}
|
|
1369
|
+
)
|
|
1370
|
+
]
|
|
1371
|
+
},
|
|
1372
|
+
item.value
|
|
1373
|
+
);
|
|
1374
|
+
}) });
|
|
1375
|
+
}
|
|
1376
|
+
);
|
|
1377
|
+
Accordion.displayName = "Accordion";
|
|
1378
|
+
|
|
1379
|
+
// src/components/Alert/index.tsx
|
|
1380
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1381
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
1382
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1383
|
+
var alert = tv11({
|
|
1384
|
+
base: "flex gap-3 rounded-lg border p-4 text-sm",
|
|
1385
|
+
variants: {
|
|
1386
|
+
variant: {
|
|
1387
|
+
info: "bg-blue-50 border-blue-200 text-blue-800",
|
|
1388
|
+
success: "bg-green-50 border-green-200 text-green-800",
|
|
1389
|
+
warning: "bg-yellow-50 border-yellow-200 text-yellow-800",
|
|
1390
|
+
danger: "bg-red-50 border-red-200 text-red-800"
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
defaultVariants: {
|
|
1394
|
+
variant: "info"
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
var iconMap = {
|
|
1398
|
+
info: "\u2139",
|
|
1399
|
+
success: "\u2713",
|
|
1400
|
+
warning: "\u26A0",
|
|
1401
|
+
danger: "\u2715"
|
|
1402
|
+
};
|
|
1403
|
+
var iconColorMap = {
|
|
1404
|
+
info: "text-blue-500",
|
|
1405
|
+
success: "text-green-500",
|
|
1406
|
+
warning: "text-yellow-500",
|
|
1407
|
+
danger: "text-red-500"
|
|
1408
|
+
};
|
|
1409
|
+
var Alert = forwardRef20(
|
|
1410
|
+
({ variant = "info", title, icon, onClose, className, children, ...props }, ref) => {
|
|
1411
|
+
const resolvedIcon = icon !== void 0 ? icon : /* @__PURE__ */ jsx20("span", { className: `text-base font-bold flex-shrink-0 ${iconColorMap[variant || "info"]}`, children: iconMap[variant || "info"] });
|
|
1412
|
+
return /* @__PURE__ */ jsxs13(
|
|
1413
|
+
"div",
|
|
1414
|
+
{
|
|
1415
|
+
ref,
|
|
1416
|
+
role: "alert",
|
|
1417
|
+
className: alert({ variant, className }),
|
|
1418
|
+
...props,
|
|
1419
|
+
children: [
|
|
1420
|
+
resolvedIcon,
|
|
1421
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
1422
|
+
title && /* @__PURE__ */ jsx20("p", { className: "font-semibold mb-1", children: title }),
|
|
1423
|
+
/* @__PURE__ */ jsx20("div", { children })
|
|
1424
|
+
] }),
|
|
1425
|
+
onClose && /* @__PURE__ */ jsx20(
|
|
1426
|
+
"button",
|
|
1427
|
+
{
|
|
1428
|
+
type: "button",
|
|
1429
|
+
onClick: onClose,
|
|
1430
|
+
className: "flex-shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
1431
|
+
"aria-label": "Fechar alerta",
|
|
1432
|
+
children: "\u2715"
|
|
1433
|
+
}
|
|
1434
|
+
)
|
|
1435
|
+
]
|
|
1436
|
+
}
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
Alert.displayName = "Alert";
|
|
1441
|
+
|
|
1442
|
+
// src/components/Badge/index.tsx
|
|
1443
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
1444
|
+
import { tv as tv12 } from "tailwind-variants";
|
|
1445
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1446
|
+
var badge = tv12({
|
|
1447
|
+
base: "inline-flex items-center font-medium transition-colors",
|
|
1448
|
+
variants: {
|
|
1449
|
+
variant: {
|
|
1450
|
+
primary: "bg-blue-50 text-blue-700 border border-blue-200",
|
|
1451
|
+
success: "bg-green-50 text-green-700 border border-green-200",
|
|
1452
|
+
danger: "bg-red-50 text-red-700 border border-red-200",
|
|
1453
|
+
warning: "bg-yellow-50 text-yellow-700 border border-yellow-200",
|
|
1454
|
+
neutral: "bg-gray-100 text-gray-700 border border-gray-200"
|
|
1455
|
+
},
|
|
1456
|
+
size: {
|
|
1457
|
+
sm: "px-2 py-0.5 text-xs rounded",
|
|
1458
|
+
md: "px-2.5 py-0.5 text-xs rounded-md",
|
|
1459
|
+
lg: "px-3 py-1 text-sm rounded-md"
|
|
1460
|
+
},
|
|
1461
|
+
dot: {
|
|
1462
|
+
true: "gap-1.5",
|
|
1463
|
+
false: ""
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
defaultVariants: {
|
|
1467
|
+
variant: "primary",
|
|
1468
|
+
size: "md",
|
|
1469
|
+
dot: false
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
var dotColors = {
|
|
1473
|
+
primary: "bg-blue-500",
|
|
1474
|
+
success: "bg-green-500",
|
|
1475
|
+
danger: "bg-red-500",
|
|
1476
|
+
warning: "bg-yellow-500",
|
|
1477
|
+
neutral: "bg-gray-500"
|
|
1478
|
+
};
|
|
1479
|
+
var Badge = forwardRef21(
|
|
1480
|
+
({ variant = "primary", size, dot, className, children, ...props }, ref) => {
|
|
1481
|
+
return /* @__PURE__ */ jsxs14(
|
|
1482
|
+
"span",
|
|
1483
|
+
{
|
|
1484
|
+
ref,
|
|
1485
|
+
className: badge({ variant, size, dot, className }),
|
|
1486
|
+
...props,
|
|
1487
|
+
children: [
|
|
1488
|
+
dot && /* @__PURE__ */ jsx21(
|
|
1489
|
+
"span",
|
|
1490
|
+
{
|
|
1491
|
+
className: `inline-block h-1.5 w-1.5 rounded-full ${dotColors[variant || "primary"]}`
|
|
1492
|
+
}
|
|
1493
|
+
),
|
|
1494
|
+
children
|
|
1495
|
+
]
|
|
1496
|
+
}
|
|
1497
|
+
);
|
|
1498
|
+
}
|
|
1499
|
+
);
|
|
1500
|
+
Badge.displayName = "Badge";
|
|
1501
|
+
|
|
1502
|
+
// src/components/Breadcrumb/index.tsx
|
|
1503
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
1504
|
+
import { tv as tv13 } from "tailwind-variants";
|
|
1505
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1506
|
+
var breadcrumb = tv13({
|
|
1507
|
+
base: "flex items-center text-sm",
|
|
1508
|
+
variants: {
|
|
1509
|
+
variant: {
|
|
1510
|
+
default: "",
|
|
1511
|
+
contained: "bg-gray-50 px-4 py-2 rounded-lg"
|
|
1512
|
+
}
|
|
1513
|
+
},
|
|
1514
|
+
defaultVariants: {
|
|
1515
|
+
variant: "default"
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
var breadcrumbItem = tv13({
|
|
1519
|
+
base: "transition-colors",
|
|
1520
|
+
variants: {
|
|
1521
|
+
active: {
|
|
1522
|
+
true: "text-gray-900 font-medium",
|
|
1523
|
+
false: "text-gray-500 hover:text-gray-700"
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
});
|
|
1527
|
+
var defaultSeparator = /* @__PURE__ */ jsx22(
|
|
1528
|
+
"svg",
|
|
1529
|
+
{
|
|
1530
|
+
className: "h-4 w-4 text-gray-400 flex-shrink-0",
|
|
1531
|
+
fill: "none",
|
|
1532
|
+
viewBox: "0 0 24 24",
|
|
1533
|
+
stroke: "currentColor",
|
|
1534
|
+
strokeWidth: 2,
|
|
1535
|
+
children: /* @__PURE__ */ jsx22("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
1536
|
+
}
|
|
1537
|
+
);
|
|
1538
|
+
var Breadcrumb = forwardRef22(
|
|
1539
|
+
({ variant, items, separator = defaultSeparator, className, ...props }, ref) => {
|
|
1540
|
+
return /* @__PURE__ */ jsx22(
|
|
1541
|
+
"nav",
|
|
1542
|
+
{
|
|
1543
|
+
ref,
|
|
1544
|
+
"aria-label": "Breadcrumb",
|
|
1545
|
+
className: breadcrumb({ variant, className }),
|
|
1546
|
+
...props,
|
|
1547
|
+
children: /* @__PURE__ */ jsx22("ol", { className: "flex items-center gap-2", children: items.map((item, index) => {
|
|
1548
|
+
const isLast = index === items.length - 1;
|
|
1549
|
+
return /* @__PURE__ */ jsxs15("li", { className: "flex items-center gap-2", children: [
|
|
1550
|
+
item.href || item.onClick ? /* @__PURE__ */ jsx22(
|
|
1551
|
+
"a",
|
|
1552
|
+
{
|
|
1553
|
+
href: item.href,
|
|
1554
|
+
onClick: item.onClick,
|
|
1555
|
+
className: breadcrumbItem({ active: isLast }),
|
|
1556
|
+
...isLast && { "aria-current": "page" },
|
|
1557
|
+
children: item.label
|
|
1558
|
+
}
|
|
1559
|
+
) : /* @__PURE__ */ jsx22(
|
|
1560
|
+
"span",
|
|
1561
|
+
{
|
|
1562
|
+
className: breadcrumbItem({ active: isLast }),
|
|
1563
|
+
...isLast && { "aria-current": "page" },
|
|
1564
|
+
children: item.label
|
|
1565
|
+
}
|
|
1566
|
+
),
|
|
1567
|
+
!isLast && separator
|
|
1568
|
+
] }, index);
|
|
1569
|
+
}) })
|
|
1570
|
+
}
|
|
1571
|
+
);
|
|
1572
|
+
}
|
|
1573
|
+
);
|
|
1574
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
1575
|
+
|
|
1576
|
+
// src/components/Divider/index.tsx
|
|
1577
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
1578
|
+
import { tv as tv14 } from "tailwind-variants";
|
|
1579
|
+
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1580
|
+
var divider = tv14({
|
|
1581
|
+
base: "",
|
|
1582
|
+
variants: {
|
|
1583
|
+
orientation: {
|
|
1584
|
+
horizontal: "w-full flex items-center",
|
|
1585
|
+
vertical: "h-full inline-flex flex-col items-center"
|
|
1586
|
+
},
|
|
1587
|
+
variant: {
|
|
1588
|
+
solid: "",
|
|
1589
|
+
dashed: ""
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
defaultVariants: {
|
|
1593
|
+
orientation: "horizontal",
|
|
1594
|
+
variant: "solid"
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
var dividerLine = tv14({
|
|
1598
|
+
base: "bg-gray-200 flex-1",
|
|
1599
|
+
variants: {
|
|
1600
|
+
orientation: {
|
|
1601
|
+
horizontal: "h-px w-full",
|
|
1602
|
+
vertical: "w-px h-full"
|
|
1603
|
+
},
|
|
1604
|
+
variant: {
|
|
1605
|
+
solid: "",
|
|
1606
|
+
dashed: "bg-transparent border-gray-200 border-dashed"
|
|
1607
|
+
}
|
|
1608
|
+
},
|
|
1609
|
+
compoundVariants: [
|
|
1610
|
+
{ orientation: "horizontal", variant: "dashed", className: "border-t h-0" },
|
|
1611
|
+
{ orientation: "vertical", variant: "dashed", className: "border-l w-0" }
|
|
1612
|
+
]
|
|
1613
|
+
});
|
|
1614
|
+
var Divider = forwardRef23(
|
|
1615
|
+
({ orientation = "horizontal", variant, label, className, ...props }, ref) => {
|
|
1616
|
+
return /* @__PURE__ */ jsxs16(
|
|
1617
|
+
"div",
|
|
1618
|
+
{
|
|
1619
|
+
ref,
|
|
1620
|
+
role: "separator",
|
|
1621
|
+
"aria-orientation": orientation || "horizontal",
|
|
1622
|
+
className: divider({ orientation, variant, className }),
|
|
1623
|
+
...props,
|
|
1624
|
+
children: [
|
|
1625
|
+
/* @__PURE__ */ jsx23("div", { className: dividerLine({ orientation, variant }) }),
|
|
1626
|
+
label && /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
1627
|
+
/* @__PURE__ */ jsx23(
|
|
1628
|
+
"span",
|
|
1629
|
+
{
|
|
1630
|
+
className: `flex-shrink-0 text-xs text-gray-500 ${orientation === "horizontal" ? "px-3" : "py-2"}`,
|
|
1631
|
+
children: label
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
/* @__PURE__ */ jsx23("div", { className: dividerLine({ orientation, variant }) })
|
|
1635
|
+
] })
|
|
1636
|
+
]
|
|
1637
|
+
}
|
|
1638
|
+
);
|
|
1639
|
+
}
|
|
1640
|
+
);
|
|
1641
|
+
Divider.displayName = "Divider";
|
|
1642
|
+
|
|
1643
|
+
// src/components/Skeleton/index.tsx
|
|
1644
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
1645
|
+
import { tv as tv15 } from "tailwind-variants";
|
|
1646
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1647
|
+
var skeleton = tv15({
|
|
1648
|
+
base: "animate-pulse bg-gray-200",
|
|
1649
|
+
variants: {
|
|
1650
|
+
variant: {
|
|
1651
|
+
text: "rounded-md h-4 w-full",
|
|
1652
|
+
circular: "rounded-full",
|
|
1653
|
+
rectangular: "rounded-md"
|
|
1654
|
+
},
|
|
1655
|
+
size: {
|
|
1656
|
+
sm: "",
|
|
1657
|
+
md: "",
|
|
1658
|
+
lg: ""
|
|
1659
|
+
}
|
|
1660
|
+
},
|
|
1661
|
+
compoundVariants: [
|
|
1662
|
+
{ variant: "circular", size: "sm", className: "h-8 w-8" },
|
|
1663
|
+
{ variant: "circular", size: "md", className: "h-10 w-10" },
|
|
1664
|
+
{ variant: "circular", size: "lg", className: "h-16 w-16" },
|
|
1665
|
+
{ variant: "text", size: "sm", className: "h-3" },
|
|
1666
|
+
{ variant: "text", size: "md", className: "h-4" },
|
|
1667
|
+
{ variant: "text", size: "lg", className: "h-5" }
|
|
1668
|
+
],
|
|
1669
|
+
defaultVariants: {
|
|
1670
|
+
variant: "text",
|
|
1671
|
+
size: "md"
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
var Skeleton = forwardRef24(
|
|
1675
|
+
({ variant, size, width, height, lines = 1, className, style, ...props }, ref) => {
|
|
1676
|
+
const customStyle = {
|
|
1677
|
+
...style,
|
|
1678
|
+
...width !== void 0 && { width },
|
|
1679
|
+
...height !== void 0 && { height }
|
|
1680
|
+
};
|
|
1681
|
+
if (lines > 1 && variant !== "circular") {
|
|
1682
|
+
return /* @__PURE__ */ jsx24("div", { ref, className: "flex flex-col gap-2", ...props, children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ jsx24(
|
|
1683
|
+
"div",
|
|
1684
|
+
{
|
|
1685
|
+
className: skeleton({ variant, size, className }),
|
|
1686
|
+
style: {
|
|
1687
|
+
...customStyle,
|
|
1688
|
+
...i === lines - 1 && { width: "75%" }
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
i
|
|
1692
|
+
)) });
|
|
1693
|
+
}
|
|
1694
|
+
return /* @__PURE__ */ jsx24(
|
|
1695
|
+
"div",
|
|
1696
|
+
{
|
|
1697
|
+
ref,
|
|
1698
|
+
className: skeleton({ variant, size, className }),
|
|
1699
|
+
style: customStyle,
|
|
1700
|
+
...props
|
|
1701
|
+
}
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
);
|
|
1705
|
+
Skeleton.displayName = "Skeleton";
|
|
1706
|
+
|
|
1707
|
+
// src/components/Spinner/index.tsx
|
|
1708
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
1709
|
+
import { tv as tv16 } from "tailwind-variants";
|
|
1710
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1711
|
+
var spinner = tv16({
|
|
1712
|
+
base: "inline-block animate-spin rounded-full border-solid border-current border-r-transparent",
|
|
1713
|
+
variants: {
|
|
1714
|
+
size: {
|
|
1715
|
+
sm: "h-4 w-4 border-2",
|
|
1716
|
+
md: "h-6 w-6 border-2",
|
|
1717
|
+
lg: "h-8 w-8 border-[3px]",
|
|
1718
|
+
xl: "h-12 w-12 border-4"
|
|
1719
|
+
},
|
|
1720
|
+
variant: {
|
|
1721
|
+
primary: "text-blue-500",
|
|
1722
|
+
secondary: "text-gray-400",
|
|
1723
|
+
white: "text-white"
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
defaultVariants: {
|
|
1727
|
+
size: "md",
|
|
1728
|
+
variant: "primary"
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
var Spinner = forwardRef25(
|
|
1732
|
+
({ size, variant, label = "Carregando...", className, ...props }, ref) => {
|
|
1733
|
+
return /* @__PURE__ */ jsx25(
|
|
1734
|
+
"div",
|
|
1735
|
+
{
|
|
1736
|
+
ref,
|
|
1737
|
+
role: "status",
|
|
1738
|
+
className: spinner({ size, variant, className }),
|
|
1739
|
+
...props,
|
|
1740
|
+
children: /* @__PURE__ */ jsx25("span", { className: "sr-only", children: label })
|
|
1741
|
+
}
|
|
1742
|
+
);
|
|
1743
|
+
}
|
|
1744
|
+
);
|
|
1745
|
+
Spinner.displayName = "Spinner";
|
|
1746
|
+
|
|
1747
|
+
// src/components/Tabs/index.tsx
|
|
1748
|
+
import { forwardRef as forwardRef26, useState as useState5, useId as useId2 } from "react";
|
|
1749
|
+
import { tv as tv17 } from "tailwind-variants";
|
|
1750
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1751
|
+
var tabs = tv17({
|
|
1752
|
+
base: "",
|
|
1753
|
+
variants: {
|
|
1754
|
+
variant: {
|
|
1755
|
+
line: "",
|
|
1756
|
+
enclosed: "",
|
|
1757
|
+
pill: ""
|
|
1758
|
+
}
|
|
1759
|
+
},
|
|
1760
|
+
defaultVariants: {
|
|
1761
|
+
variant: "line"
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
var tabList = tv17({
|
|
1765
|
+
base: "flex",
|
|
1766
|
+
variants: {
|
|
1767
|
+
variant: {
|
|
1768
|
+
line: "border-b border-gray-200 gap-0",
|
|
1769
|
+
enclosed: "border-b border-gray-200 gap-0",
|
|
1770
|
+
pill: "gap-1 bg-gray-100 p-1 rounded-lg"
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
});
|
|
1774
|
+
var tabTrigger = tv17({
|
|
1775
|
+
base: "inline-flex items-center justify-center gap-2 font-medium text-sm transition-colors whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1776
|
+
variants: {
|
|
1777
|
+
variant: {
|
|
1778
|
+
line: "px-4 py-2.5 border-b-2 -mb-px text-gray-500 hover:text-gray-900 hover:border-gray-300",
|
|
1779
|
+
enclosed: "px-4 py-2 border border-transparent rounded-t-md -mb-px text-gray-500 hover:text-gray-900",
|
|
1780
|
+
pill: "px-3 py-1.5 rounded-md text-gray-600 hover:text-gray-900"
|
|
1781
|
+
},
|
|
1782
|
+
active: {
|
|
1783
|
+
true: "",
|
|
1784
|
+
false: ""
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
compoundVariants: [
|
|
1788
|
+
{ variant: "line", active: true, className: "text-blue-500 border-b-blue-500" },
|
|
1789
|
+
{ variant: "enclosed", active: true, className: "bg-white text-blue-500 border-gray-200 border-b-white" },
|
|
1790
|
+
{ variant: "pill", active: true, className: "bg-white text-blue-500 shadow-sm" }
|
|
1791
|
+
],
|
|
1792
|
+
defaultVariants: {
|
|
1793
|
+
variant: "line",
|
|
1794
|
+
active: false
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
var Tabs = forwardRef26(
|
|
1798
|
+
({ variant = "line", items, defaultValue, value, onChange, className, ...props }, ref) => {
|
|
1799
|
+
const id = useId2();
|
|
1800
|
+
const [internalValue, setInternalValue] = useState5(
|
|
1801
|
+
defaultValue || items[0]?.value || ""
|
|
1802
|
+
);
|
|
1803
|
+
const activeValue = value !== void 0 ? value : internalValue;
|
|
1804
|
+
const handleChange = (val) => {
|
|
1805
|
+
if (value === void 0) {
|
|
1806
|
+
setInternalValue(val);
|
|
1807
|
+
}
|
|
1808
|
+
onChange?.(val);
|
|
1809
|
+
};
|
|
1810
|
+
const activeItem = items.find((item) => item.value === activeValue);
|
|
1811
|
+
return /* @__PURE__ */ jsxs17("div", { ref, className: tabs({ variant, className }), ...props, children: [
|
|
1812
|
+
/* @__PURE__ */ jsx26("div", { role: "tablist", className: tabList({ variant }), children: items.map((item) => /* @__PURE__ */ jsx26(
|
|
1813
|
+
"button",
|
|
1814
|
+
{
|
|
1815
|
+
role: "tab",
|
|
1816
|
+
type: "button",
|
|
1817
|
+
id: `${id}-tab-${item.value}`,
|
|
1818
|
+
"aria-selected": activeValue === item.value,
|
|
1819
|
+
"aria-controls": `${id}-panel-${item.value}`,
|
|
1820
|
+
disabled: item.disabled,
|
|
1821
|
+
className: tabTrigger({
|
|
1822
|
+
variant,
|
|
1823
|
+
active: activeValue === item.value
|
|
1824
|
+
}),
|
|
1825
|
+
onClick: () => handleChange(item.value),
|
|
1826
|
+
children: item.label
|
|
1827
|
+
},
|
|
1828
|
+
item.value
|
|
1829
|
+
)) }),
|
|
1830
|
+
activeItem && /* @__PURE__ */ jsx26(
|
|
1831
|
+
"div",
|
|
1832
|
+
{
|
|
1833
|
+
role: "tabpanel",
|
|
1834
|
+
id: `${id}-panel-${activeItem.value}`,
|
|
1835
|
+
"aria-labelledby": `${id}-tab-${activeItem.value}`,
|
|
1836
|
+
className: "py-4",
|
|
1837
|
+
children: activeItem.content
|
|
1838
|
+
}
|
|
1839
|
+
)
|
|
1840
|
+
] });
|
|
1841
|
+
}
|
|
1842
|
+
);
|
|
1843
|
+
Tabs.displayName = "Tabs";
|
|
1133
1844
|
export {
|
|
1845
|
+
Accordion,
|
|
1846
|
+
Alert,
|
|
1134
1847
|
Avatar,
|
|
1848
|
+
Badge,
|
|
1849
|
+
Breadcrumb,
|
|
1135
1850
|
Button,
|
|
1136
1851
|
Card,
|
|
1852
|
+
Divider,
|
|
1137
1853
|
InputCNPJ,
|
|
1138
1854
|
InputCPF,
|
|
1139
1855
|
InputCep,
|
|
@@ -1147,17 +1863,34 @@ export {
|
|
|
1147
1863
|
InputString,
|
|
1148
1864
|
InputWrapper,
|
|
1149
1865
|
Modal,
|
|
1866
|
+
Skeleton,
|
|
1867
|
+
Spinner,
|
|
1868
|
+
Tabs,
|
|
1150
1869
|
Textarea,
|
|
1151
1870
|
Tooltip,
|
|
1871
|
+
accordion,
|
|
1872
|
+
accordionContent,
|
|
1873
|
+
accordionItem,
|
|
1874
|
+
accordionTrigger,
|
|
1875
|
+
alert,
|
|
1152
1876
|
avatar,
|
|
1877
|
+
badge,
|
|
1878
|
+
breadcrumb,
|
|
1879
|
+
breadcrumbItem,
|
|
1153
1880
|
button,
|
|
1154
1881
|
card,
|
|
1882
|
+
divider,
|
|
1155
1883
|
maskCEP,
|
|
1156
1884
|
maskCNPJ,
|
|
1157
1885
|
maskCPF,
|
|
1158
1886
|
maskCurrency,
|
|
1159
1887
|
maskPhone,
|
|
1160
1888
|
modal,
|
|
1889
|
+
skeleton,
|
|
1890
|
+
spinner,
|
|
1891
|
+
tabList,
|
|
1892
|
+
tabTrigger,
|
|
1893
|
+
tabs,
|
|
1161
1894
|
tooltip,
|
|
1162
1895
|
unmask,
|
|
1163
1896
|
unmaskCurrency
|