@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.js
CHANGED
|
@@ -20,9 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
Accordion: () => Accordion,
|
|
24
|
+
Alert: () => Alert,
|
|
23
25
|
Avatar: () => Avatar,
|
|
26
|
+
Badge: () => Badge,
|
|
27
|
+
Breadcrumb: () => Breadcrumb,
|
|
24
28
|
Button: () => Button,
|
|
25
29
|
Card: () => Card,
|
|
30
|
+
Divider: () => Divider,
|
|
26
31
|
InputCNPJ: () => InputCNPJ,
|
|
27
32
|
InputCPF: () => InputCPF,
|
|
28
33
|
InputCep: () => InputCep,
|
|
@@ -36,17 +41,34 @@ __export(index_exports, {
|
|
|
36
41
|
InputString: () => InputString,
|
|
37
42
|
InputWrapper: () => InputWrapper,
|
|
38
43
|
Modal: () => Modal,
|
|
44
|
+
Skeleton: () => Skeleton,
|
|
45
|
+
Spinner: () => Spinner,
|
|
46
|
+
Tabs: () => Tabs,
|
|
39
47
|
Textarea: () => Textarea,
|
|
40
48
|
Tooltip: () => Tooltip,
|
|
49
|
+
accordion: () => accordion,
|
|
50
|
+
accordionContent: () => accordionContent,
|
|
51
|
+
accordionItem: () => accordionItem,
|
|
52
|
+
accordionTrigger: () => accordionTrigger,
|
|
53
|
+
alert: () => alert,
|
|
41
54
|
avatar: () => avatar,
|
|
55
|
+
badge: () => badge,
|
|
56
|
+
breadcrumb: () => breadcrumb,
|
|
57
|
+
breadcrumbItem: () => breadcrumbItem,
|
|
42
58
|
button: () => button,
|
|
43
59
|
card: () => card,
|
|
60
|
+
divider: () => divider,
|
|
44
61
|
maskCEP: () => maskCEP,
|
|
45
62
|
maskCNPJ: () => maskCNPJ,
|
|
46
63
|
maskCPF: () => maskCPF,
|
|
47
64
|
maskCurrency: () => maskCurrency,
|
|
48
65
|
maskPhone: () => maskPhone,
|
|
49
66
|
modal: () => modal,
|
|
67
|
+
skeleton: () => skeleton,
|
|
68
|
+
spinner: () => spinner,
|
|
69
|
+
tabList: () => tabList,
|
|
70
|
+
tabTrigger: () => tabTrigger,
|
|
71
|
+
tabs: () => tabs,
|
|
50
72
|
tooltip: () => tooltip,
|
|
51
73
|
unmask: () => unmask,
|
|
52
74
|
unmaskCurrency: () => unmaskCurrency
|
|
@@ -67,9 +89,9 @@ var avatar = (0, import_tailwind_variants.tv)({
|
|
|
67
89
|
xl: "h-16 w-16 text-lg"
|
|
68
90
|
},
|
|
69
91
|
variant: {
|
|
70
|
-
primary: "bg-blue-
|
|
71
|
-
secondary: "bg-gray-200 text-gray-
|
|
72
|
-
outline: "bg-white text-blue-
|
|
92
|
+
primary: "bg-blue-500 text-white",
|
|
93
|
+
secondary: "bg-gray-200 text-gray-600",
|
|
94
|
+
outline: "bg-white text-blue-500 ring-2 ring-blue-500 ring-offset-2"
|
|
73
95
|
}
|
|
74
96
|
},
|
|
75
97
|
defaultVariants: {
|
|
@@ -84,14 +106,22 @@ function getInitials(name) {
|
|
|
84
106
|
}
|
|
85
107
|
var Avatar = (0, import_react.forwardRef)(
|
|
86
108
|
({ name, src, alt, size, variant, className, ...props }, ref) => {
|
|
87
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
-
"
|
|
109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
"div",
|
|
89
111
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
112
|
+
ref,
|
|
113
|
+
className: avatar({ size, variant, className }),
|
|
114
|
+
...props,
|
|
115
|
+
children: src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
"img",
|
|
117
|
+
{
|
|
118
|
+
src,
|
|
119
|
+
alt: alt || name || "avatar",
|
|
120
|
+
className: "h-full w-full object-cover"
|
|
121
|
+
}
|
|
122
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: name ? getInitials(name) : "?" })
|
|
93
123
|
}
|
|
94
|
-
)
|
|
124
|
+
);
|
|
95
125
|
}
|
|
96
126
|
);
|
|
97
127
|
Avatar.displayName = "Avatar";
|
|
@@ -104,10 +134,10 @@ var button = (0, import_tailwind_variants2.tv)({
|
|
|
104
134
|
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",
|
|
105
135
|
variants: {
|
|
106
136
|
variant: {
|
|
107
|
-
primary: "bg-blue-
|
|
108
|
-
secondary: "border border-blue-
|
|
109
|
-
tertiary: "text-blue-
|
|
110
|
-
danger: "bg-red-
|
|
137
|
+
primary: "bg-blue-500 text-white hover:bg-blue-700 focus-visible:outline-blue-500",
|
|
138
|
+
secondary: "border border-blue-500 text-blue-500 hover:bg-blue-50 focus-visible:outline-blue-500",
|
|
139
|
+
tertiary: "text-blue-500 hover:bg-blue-50 focus-visible:outline-blue-500",
|
|
140
|
+
danger: "bg-red-500 text-white hover:bg-red-500/90 focus-visible:outline-red-500"
|
|
111
141
|
},
|
|
112
142
|
size: {
|
|
113
143
|
sm: "h-9 px-3 text-sm",
|
|
@@ -224,7 +254,7 @@ var Modal = (0, import_react4.forwardRef)(
|
|
|
224
254
|
"button",
|
|
225
255
|
{
|
|
226
256
|
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-
|
|
257
|
+
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",
|
|
228
258
|
onClick: onClose,
|
|
229
259
|
"aria-label": "Fechar",
|
|
230
260
|
children: "\u2715"
|
|
@@ -444,7 +474,7 @@ var wrapper = (0, import_tailwind_variants6.tv)({
|
|
|
444
474
|
base: "flex w-full flex-col gap-1"
|
|
445
475
|
});
|
|
446
476
|
var labelStyle = (0, import_tailwind_variants6.tv)({
|
|
447
|
-
base: "text-xs text-gray-
|
|
477
|
+
base: "text-xs text-gray-600 flex items-start gap-0.5"
|
|
448
478
|
});
|
|
449
479
|
var containerStyle = (0, import_tailwind_variants6.tv)({
|
|
450
480
|
base: "flex items-center w-full rounded-md border bg-white transition-colors",
|
|
@@ -471,13 +501,35 @@ var errorStyle = (0, import_tailwind_variants6.tv)({
|
|
|
471
501
|
base: "text-xs text-red-500 mt-0.5"
|
|
472
502
|
});
|
|
473
503
|
var InputWrapper = (0, import_react6.forwardRef)(
|
|
474
|
-
({
|
|
504
|
+
({
|
|
505
|
+
label,
|
|
506
|
+
error,
|
|
507
|
+
errorMessage,
|
|
508
|
+
required,
|
|
509
|
+
disabled,
|
|
510
|
+
size,
|
|
511
|
+
children,
|
|
512
|
+
className,
|
|
513
|
+
classContainer,
|
|
514
|
+
htmlFor
|
|
515
|
+
}, ref) => {
|
|
475
516
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { ref, className: wrapper({ className }), children: [
|
|
476
517
|
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("label", { htmlFor, className: labelStyle(), children: [
|
|
477
518
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: label }),
|
|
478
519
|
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
479
520
|
] }),
|
|
480
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
521
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
522
|
+
"div",
|
|
523
|
+
{
|
|
524
|
+
className: containerStyle({
|
|
525
|
+
size,
|
|
526
|
+
error: !!error,
|
|
527
|
+
disabled: !!disabled,
|
|
528
|
+
className: classContainer
|
|
529
|
+
}),
|
|
530
|
+
children
|
|
531
|
+
}
|
|
532
|
+
),
|
|
481
533
|
error && errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: errorStyle(), children: errorMessage })
|
|
482
534
|
] });
|
|
483
535
|
}
|
|
@@ -1012,7 +1064,7 @@ var checkboxContainer = (0, import_tailwind_variants7.tv)({
|
|
|
1012
1064
|
base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded border cursor-pointer transition-colors",
|
|
1013
1065
|
variants: {
|
|
1014
1066
|
checked: {
|
|
1015
|
-
true: "bg-blue-
|
|
1067
|
+
true: "bg-blue-500 border-blue-500",
|
|
1016
1068
|
false: "bg-white border-gray-300 hover:border-blue-500 hover:bg-blue-50"
|
|
1017
1069
|
},
|
|
1018
1070
|
disabled: {
|
|
@@ -1026,10 +1078,34 @@ var checkboxContainer = (0, import_tailwind_variants7.tv)({
|
|
|
1026
1078
|
checked: false
|
|
1027
1079
|
}
|
|
1028
1080
|
});
|
|
1029
|
-
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1081
|
+
var CheckIcon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1082
|
+
"svg",
|
|
1083
|
+
{
|
|
1084
|
+
width: "10",
|
|
1085
|
+
height: "10",
|
|
1086
|
+
viewBox: "0 0 24 24",
|
|
1087
|
+
fill: "none",
|
|
1088
|
+
stroke: "white",
|
|
1089
|
+
strokeWidth: "4",
|
|
1090
|
+
strokeLinecap: "round",
|
|
1091
|
+
strokeLinejoin: "round",
|
|
1092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
1093
|
+
}
|
|
1094
|
+
);
|
|
1030
1095
|
var IndeterminateIcon = () => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-2 h-2 rounded-sm bg-gray-300" });
|
|
1031
1096
|
var InputCheckbox = (0, import_react16.forwardRef)(
|
|
1032
|
-
({
|
|
1097
|
+
({
|
|
1098
|
+
label,
|
|
1099
|
+
checked = false,
|
|
1100
|
+
indeterminate = false,
|
|
1101
|
+
onChange,
|
|
1102
|
+
disabled,
|
|
1103
|
+
error,
|
|
1104
|
+
labelPosition = "right",
|
|
1105
|
+
className,
|
|
1106
|
+
name,
|
|
1107
|
+
required
|
|
1108
|
+
}, ref) => {
|
|
1033
1109
|
function handleClick() {
|
|
1034
1110
|
if (disabled) return;
|
|
1035
1111
|
onChange?.(!checked);
|
|
@@ -1043,7 +1119,11 @@ var InputCheckbox = (0, import_react16.forwardRef)(
|
|
|
1043
1119
|
id: name,
|
|
1044
1120
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
1045
1121
|
"aria-required": required,
|
|
1046
|
-
className: checkboxContainer({
|
|
1122
|
+
className: checkboxContainer({
|
|
1123
|
+
checked: checked || indeterminate,
|
|
1124
|
+
disabled: !!disabled,
|
|
1125
|
+
error: !!error
|
|
1126
|
+
}),
|
|
1047
1127
|
onClick: handleClick,
|
|
1048
1128
|
disabled,
|
|
1049
1129
|
children: [
|
|
@@ -1054,9 +1134,23 @@ var InputCheckbox = (0, import_react16.forwardRef)(
|
|
|
1054
1134
|
);
|
|
1055
1135
|
if (!label) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className, children: box });
|
|
1056
1136
|
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)(
|
|
1137
|
+
labelPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1138
|
+
"label",
|
|
1139
|
+
{
|
|
1140
|
+
htmlFor: name,
|
|
1141
|
+
className: "text-sm text-gray-600 cursor-pointer select-none",
|
|
1142
|
+
children: label
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1058
1145
|
box,
|
|
1059
|
-
labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1146
|
+
labelPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1147
|
+
"label",
|
|
1148
|
+
{
|
|
1149
|
+
htmlFor: name,
|
|
1150
|
+
className: "text-sm text-gray-600 cursor-pointer select-none",
|
|
1151
|
+
children: label
|
|
1152
|
+
}
|
|
1153
|
+
),
|
|
1060
1154
|
required && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-red-500 text-[10px]", children: "*" })
|
|
1061
1155
|
] });
|
|
1062
1156
|
}
|
|
@@ -1071,7 +1165,7 @@ var radioButton = (0, import_tailwind_variants8.tv)({
|
|
|
1071
1165
|
base: "inline-flex items-center justify-center w-[18px] h-[18px] rounded-full border cursor-pointer transition-colors",
|
|
1072
1166
|
variants: {
|
|
1073
1167
|
selected: {
|
|
1074
|
-
true: "border-blue-
|
|
1168
|
+
true: "border-blue-500",
|
|
1075
1169
|
false: "border-gray-300 hover:border-blue-500 hover:bg-blue-50"
|
|
1076
1170
|
},
|
|
1077
1171
|
disabled: {
|
|
@@ -1086,48 +1180,70 @@ var radioButton = (0, import_tailwind_variants8.tv)({
|
|
|
1086
1180
|
}
|
|
1087
1181
|
});
|
|
1088
1182
|
var InputRadio = (0, import_react17.forwardRef)(
|
|
1089
|
-
({
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1183
|
+
({
|
|
1184
|
+
label,
|
|
1185
|
+
options,
|
|
1186
|
+
value,
|
|
1187
|
+
onChange,
|
|
1188
|
+
disabled,
|
|
1189
|
+
error,
|
|
1190
|
+
required,
|
|
1191
|
+
name,
|
|
1192
|
+
className,
|
|
1193
|
+
direction = "horizontal"
|
|
1194
|
+
}, ref) => {
|
|
1195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1196
|
+
"div",
|
|
1197
|
+
{
|
|
1198
|
+
ref,
|
|
1199
|
+
className: `flex w-full flex-col gap-1 ${className ?? ""}`,
|
|
1200
|
+
children: [
|
|
1201
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "text-xs text-gray-600 flex items-start gap-0.5", children: [
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: label }),
|
|
1203
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
1204
|
+
] }),
|
|
1205
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1206
|
+
"div",
|
|
1207
|
+
{
|
|
1208
|
+
role: "radiogroup",
|
|
1209
|
+
"aria-label": label,
|
|
1210
|
+
className: `flex gap-3 ${direction === "vertical" ? "flex-col" : "items-center"}`,
|
|
1211
|
+
children: options.map((option) => {
|
|
1212
|
+
const isSelected = value === option.value;
|
|
1213
|
+
const isDisabled = disabled || option.disabled;
|
|
1214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1215
|
+
"label",
|
|
1216
|
+
{
|
|
1217
|
+
className: `flex items-center gap-2 cursor-pointer select-none ${isDisabled ? "opacity-50 cursor-not-allowed" : ""}`,
|
|
1218
|
+
children: [
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1220
|
+
"button",
|
|
1221
|
+
{
|
|
1222
|
+
type: "button",
|
|
1223
|
+
role: "radio",
|
|
1224
|
+
"aria-checked": isSelected,
|
|
1225
|
+
className: radioButton({
|
|
1226
|
+
selected: isSelected,
|
|
1227
|
+
disabled: !!isDisabled,
|
|
1228
|
+
error: !!error
|
|
1229
|
+
}),
|
|
1230
|
+
onClick: () => !isDisabled && onChange?.(option.value),
|
|
1231
|
+
disabled: isDisabled,
|
|
1232
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-[10px] h-[10px] rounded-full bg-blue-500" })
|
|
1233
|
+
}
|
|
1234
|
+
),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm text-gray-600", children: option.label })
|
|
1236
|
+
]
|
|
1237
|
+
},
|
|
1238
|
+
String(option.value)
|
|
1239
|
+
);
|
|
1240
|
+
})
|
|
1241
|
+
}
|
|
1242
|
+
),
|
|
1243
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-red-500 mt-0.5", children: "Selecione uma op\xE7\xE3o" })
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
);
|
|
1131
1247
|
}
|
|
1132
1248
|
);
|
|
1133
1249
|
InputRadio.displayName = "InputRadio";
|
|
@@ -1152,12 +1268,32 @@ var textareaStyle = (0, import_tailwind_variants9.tv)({
|
|
|
1152
1268
|
}
|
|
1153
1269
|
});
|
|
1154
1270
|
var Textarea = (0, import_react18.forwardRef)(
|
|
1155
|
-
({
|
|
1271
|
+
({
|
|
1272
|
+
label,
|
|
1273
|
+
error,
|
|
1274
|
+
errorMessage,
|
|
1275
|
+
required,
|
|
1276
|
+
size,
|
|
1277
|
+
classInput,
|
|
1278
|
+
value,
|
|
1279
|
+
onChange,
|
|
1280
|
+
disabled,
|
|
1281
|
+
name,
|
|
1282
|
+
rows = 4,
|
|
1283
|
+
...props
|
|
1284
|
+
}, ref) => {
|
|
1156
1285
|
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)(
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1286
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1287
|
+
"label",
|
|
1288
|
+
{
|
|
1289
|
+
htmlFor: name,
|
|
1290
|
+
className: "text-xs text-gray-600 flex items-start gap-0.5",
|
|
1291
|
+
children: [
|
|
1292
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: label }),
|
|
1293
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500 text-[10px] leading-none mt-0.5", children: "*" })
|
|
1294
|
+
]
|
|
1295
|
+
}
|
|
1296
|
+
),
|
|
1161
1297
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1162
1298
|
"textarea",
|
|
1163
1299
|
{
|
|
@@ -1169,7 +1305,11 @@ var Textarea = (0, import_react18.forwardRef)(
|
|
|
1169
1305
|
onChange: (e) => onChange?.(e.target.value),
|
|
1170
1306
|
disabled,
|
|
1171
1307
|
"aria-invalid": !!error,
|
|
1172
|
-
className: textareaStyle({
|
|
1308
|
+
className: textareaStyle({
|
|
1309
|
+
error: !!error,
|
|
1310
|
+
disabled: !!disabled,
|
|
1311
|
+
className: classInput
|
|
1312
|
+
}),
|
|
1173
1313
|
...props
|
|
1174
1314
|
}
|
|
1175
1315
|
),
|
|
@@ -1178,11 +1318,605 @@ var Textarea = (0, import_react18.forwardRef)(
|
|
|
1178
1318
|
}
|
|
1179
1319
|
);
|
|
1180
1320
|
Textarea.displayName = "Textarea";
|
|
1321
|
+
|
|
1322
|
+
// src/components/Accordion/index.tsx
|
|
1323
|
+
var import_react19 = require("react");
|
|
1324
|
+
var import_tailwind_variants10 = require("tailwind-variants");
|
|
1325
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1326
|
+
var accordion = (0, import_tailwind_variants10.tv)({
|
|
1327
|
+
base: "divide-y divide-gray-200",
|
|
1328
|
+
variants: {
|
|
1329
|
+
variant: {
|
|
1330
|
+
default: "border border-gray-200 rounded-lg",
|
|
1331
|
+
separated: "space-y-2 divide-y-0",
|
|
1332
|
+
flush: ""
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
defaultVariants: {
|
|
1336
|
+
variant: "default"
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
var accordionItem = (0, import_tailwind_variants10.tv)({
|
|
1340
|
+
base: "",
|
|
1341
|
+
variants: {
|
|
1342
|
+
variant: {
|
|
1343
|
+
default: "",
|
|
1344
|
+
separated: "border border-gray-200 rounded-lg overflow-hidden",
|
|
1345
|
+
flush: "border-b border-gray-200 last:border-b-0"
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
});
|
|
1349
|
+
var accordionTrigger = (0, import_tailwind_variants10.tv)({
|
|
1350
|
+
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",
|
|
1351
|
+
variants: {
|
|
1352
|
+
open: {
|
|
1353
|
+
true: "",
|
|
1354
|
+
false: ""
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
var accordionContent = (0, import_tailwind_variants10.tv)({
|
|
1359
|
+
base: "overflow-hidden transition-all duration-200",
|
|
1360
|
+
variants: {
|
|
1361
|
+
open: {
|
|
1362
|
+
true: "max-h-[2000px] opacity-100",
|
|
1363
|
+
false: "max-h-0 opacity-0"
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
var Accordion = (0, import_react19.forwardRef)(
|
|
1368
|
+
({
|
|
1369
|
+
variant = "default",
|
|
1370
|
+
items,
|
|
1371
|
+
type = "single",
|
|
1372
|
+
defaultValue = [],
|
|
1373
|
+
value,
|
|
1374
|
+
onChange,
|
|
1375
|
+
className,
|
|
1376
|
+
...props
|
|
1377
|
+
}, ref) => {
|
|
1378
|
+
const id = (0, import_react19.useId)();
|
|
1379
|
+
const [internalValue, setInternalValue] = (0, import_react19.useState)(defaultValue);
|
|
1380
|
+
const openItems = value !== void 0 ? value : internalValue;
|
|
1381
|
+
const handleToggle = (itemValue) => {
|
|
1382
|
+
let next;
|
|
1383
|
+
if (type === "single") {
|
|
1384
|
+
next = openItems.includes(itemValue) ? [] : [itemValue];
|
|
1385
|
+
} else {
|
|
1386
|
+
next = openItems.includes(itemValue) ? openItems.filter((v) => v !== itemValue) : [...openItems, itemValue];
|
|
1387
|
+
}
|
|
1388
|
+
if (value === void 0) {
|
|
1389
|
+
setInternalValue(next);
|
|
1390
|
+
}
|
|
1391
|
+
onChange?.(next);
|
|
1392
|
+
};
|
|
1393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: accordion({ variant, className }), ...props, children: items.map((item) => {
|
|
1394
|
+
const isOpen = openItems.includes(item.value);
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1396
|
+
"div",
|
|
1397
|
+
{
|
|
1398
|
+
className: accordionItem({ variant }),
|
|
1399
|
+
children: [
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1401
|
+
"button",
|
|
1402
|
+
{
|
|
1403
|
+
type: "button",
|
|
1404
|
+
id: `${id}-trigger-${item.value}`,
|
|
1405
|
+
"aria-expanded": isOpen,
|
|
1406
|
+
"aria-controls": `${id}-content-${item.value}`,
|
|
1407
|
+
disabled: item.disabled,
|
|
1408
|
+
className: accordionTrigger({ open: isOpen }),
|
|
1409
|
+
onClick: () => handleToggle(item.value),
|
|
1410
|
+
children: [
|
|
1411
|
+
item.trigger,
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1413
|
+
"svg",
|
|
1414
|
+
{
|
|
1415
|
+
className: `h-4 w-4 flex-shrink-0 text-gray-500 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`,
|
|
1416
|
+
fill: "none",
|
|
1417
|
+
viewBox: "0 0 24 24",
|
|
1418
|
+
stroke: "currentColor",
|
|
1419
|
+
strokeWidth: 2,
|
|
1420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
1421
|
+
}
|
|
1422
|
+
)
|
|
1423
|
+
]
|
|
1424
|
+
}
|
|
1425
|
+
),
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1427
|
+
"div",
|
|
1428
|
+
{
|
|
1429
|
+
id: `${id}-content-${item.value}`,
|
|
1430
|
+
role: "region",
|
|
1431
|
+
"aria-labelledby": `${id}-trigger-${item.value}`,
|
|
1432
|
+
className: accordionContent({ open: isOpen }),
|
|
1433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "px-4 pb-3 text-sm text-gray-600", children: item.content })
|
|
1434
|
+
}
|
|
1435
|
+
)
|
|
1436
|
+
]
|
|
1437
|
+
},
|
|
1438
|
+
item.value
|
|
1439
|
+
);
|
|
1440
|
+
}) });
|
|
1441
|
+
}
|
|
1442
|
+
);
|
|
1443
|
+
Accordion.displayName = "Accordion";
|
|
1444
|
+
|
|
1445
|
+
// src/components/Alert/index.tsx
|
|
1446
|
+
var import_react20 = require("react");
|
|
1447
|
+
var import_tailwind_variants11 = require("tailwind-variants");
|
|
1448
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1449
|
+
var alert = (0, import_tailwind_variants11.tv)({
|
|
1450
|
+
base: "flex gap-3 rounded-lg border p-4 text-sm",
|
|
1451
|
+
variants: {
|
|
1452
|
+
variant: {
|
|
1453
|
+
info: "bg-blue-50 border-blue-200 text-blue-800",
|
|
1454
|
+
success: "bg-green-50 border-green-200 text-green-800",
|
|
1455
|
+
warning: "bg-yellow-50 border-yellow-200 text-yellow-800",
|
|
1456
|
+
danger: "bg-red-50 border-red-200 text-red-800"
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
defaultVariants: {
|
|
1460
|
+
variant: "info"
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
var iconMap = {
|
|
1464
|
+
info: "\u2139",
|
|
1465
|
+
success: "\u2713",
|
|
1466
|
+
warning: "\u26A0",
|
|
1467
|
+
danger: "\u2715"
|
|
1468
|
+
};
|
|
1469
|
+
var iconColorMap = {
|
|
1470
|
+
info: "text-blue-500",
|
|
1471
|
+
success: "text-green-500",
|
|
1472
|
+
warning: "text-yellow-500",
|
|
1473
|
+
danger: "text-red-500"
|
|
1474
|
+
};
|
|
1475
|
+
var Alert = (0, import_react20.forwardRef)(
|
|
1476
|
+
({ variant = "info", title, icon, onClose, className, children, ...props }, ref) => {
|
|
1477
|
+
const resolvedIcon = icon !== void 0 ? icon : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `text-base font-bold flex-shrink-0 ${iconColorMap[variant || "info"]}`, children: iconMap[variant || "info"] });
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1479
|
+
"div",
|
|
1480
|
+
{
|
|
1481
|
+
ref,
|
|
1482
|
+
role: "alert",
|
|
1483
|
+
className: alert({ variant, className }),
|
|
1484
|
+
...props,
|
|
1485
|
+
children: [
|
|
1486
|
+
resolvedIcon,
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1488
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "font-semibold mb-1", children: title }),
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children })
|
|
1490
|
+
] }),
|
|
1491
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1492
|
+
"button",
|
|
1493
|
+
{
|
|
1494
|
+
type: "button",
|
|
1495
|
+
onClick: onClose,
|
|
1496
|
+
className: "flex-shrink-0 opacity-60 hover:opacity-100 transition-opacity",
|
|
1497
|
+
"aria-label": "Fechar alerta",
|
|
1498
|
+
children: "\u2715"
|
|
1499
|
+
}
|
|
1500
|
+
)
|
|
1501
|
+
]
|
|
1502
|
+
}
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
);
|
|
1506
|
+
Alert.displayName = "Alert";
|
|
1507
|
+
|
|
1508
|
+
// src/components/Badge/index.tsx
|
|
1509
|
+
var import_react21 = require("react");
|
|
1510
|
+
var import_tailwind_variants12 = require("tailwind-variants");
|
|
1511
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1512
|
+
var badge = (0, import_tailwind_variants12.tv)({
|
|
1513
|
+
base: "inline-flex items-center font-medium transition-colors",
|
|
1514
|
+
variants: {
|
|
1515
|
+
variant: {
|
|
1516
|
+
primary: "bg-blue-50 text-blue-700 border border-blue-200",
|
|
1517
|
+
success: "bg-green-50 text-green-700 border border-green-200",
|
|
1518
|
+
danger: "bg-red-50 text-red-700 border border-red-200",
|
|
1519
|
+
warning: "bg-yellow-50 text-yellow-700 border border-yellow-200",
|
|
1520
|
+
neutral: "bg-gray-100 text-gray-700 border border-gray-200"
|
|
1521
|
+
},
|
|
1522
|
+
size: {
|
|
1523
|
+
sm: "px-2 py-0.5 text-xs rounded",
|
|
1524
|
+
md: "px-2.5 py-0.5 text-xs rounded-md",
|
|
1525
|
+
lg: "px-3 py-1 text-sm rounded-md"
|
|
1526
|
+
},
|
|
1527
|
+
dot: {
|
|
1528
|
+
true: "gap-1.5",
|
|
1529
|
+
false: ""
|
|
1530
|
+
}
|
|
1531
|
+
},
|
|
1532
|
+
defaultVariants: {
|
|
1533
|
+
variant: "primary",
|
|
1534
|
+
size: "md",
|
|
1535
|
+
dot: false
|
|
1536
|
+
}
|
|
1537
|
+
});
|
|
1538
|
+
var dotColors = {
|
|
1539
|
+
primary: "bg-blue-500",
|
|
1540
|
+
success: "bg-green-500",
|
|
1541
|
+
danger: "bg-red-500",
|
|
1542
|
+
warning: "bg-yellow-500",
|
|
1543
|
+
neutral: "bg-gray-500"
|
|
1544
|
+
};
|
|
1545
|
+
var Badge = (0, import_react21.forwardRef)(
|
|
1546
|
+
({ variant = "primary", size, dot, className, children, ...props }, ref) => {
|
|
1547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1548
|
+
"span",
|
|
1549
|
+
{
|
|
1550
|
+
ref,
|
|
1551
|
+
className: badge({ variant, size, dot, className }),
|
|
1552
|
+
...props,
|
|
1553
|
+
children: [
|
|
1554
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1555
|
+
"span",
|
|
1556
|
+
{
|
|
1557
|
+
className: `inline-block h-1.5 w-1.5 rounded-full ${dotColors[variant || "primary"]}`
|
|
1558
|
+
}
|
|
1559
|
+
),
|
|
1560
|
+
children
|
|
1561
|
+
]
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1564
|
+
}
|
|
1565
|
+
);
|
|
1566
|
+
Badge.displayName = "Badge";
|
|
1567
|
+
|
|
1568
|
+
// src/components/Breadcrumb/index.tsx
|
|
1569
|
+
var import_react22 = require("react");
|
|
1570
|
+
var import_tailwind_variants13 = require("tailwind-variants");
|
|
1571
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1572
|
+
var breadcrumb = (0, import_tailwind_variants13.tv)({
|
|
1573
|
+
base: "flex items-center text-sm",
|
|
1574
|
+
variants: {
|
|
1575
|
+
variant: {
|
|
1576
|
+
default: "",
|
|
1577
|
+
contained: "bg-gray-50 px-4 py-2 rounded-lg"
|
|
1578
|
+
}
|
|
1579
|
+
},
|
|
1580
|
+
defaultVariants: {
|
|
1581
|
+
variant: "default"
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
var breadcrumbItem = (0, import_tailwind_variants13.tv)({
|
|
1585
|
+
base: "transition-colors",
|
|
1586
|
+
variants: {
|
|
1587
|
+
active: {
|
|
1588
|
+
true: "text-gray-900 font-medium",
|
|
1589
|
+
false: "text-gray-500 hover:text-gray-700"
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
});
|
|
1593
|
+
var defaultSeparator = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1594
|
+
"svg",
|
|
1595
|
+
{
|
|
1596
|
+
className: "h-4 w-4 text-gray-400 flex-shrink-0",
|
|
1597
|
+
fill: "none",
|
|
1598
|
+
viewBox: "0 0 24 24",
|
|
1599
|
+
stroke: "currentColor",
|
|
1600
|
+
strokeWidth: 2,
|
|
1601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" })
|
|
1602
|
+
}
|
|
1603
|
+
);
|
|
1604
|
+
var Breadcrumb = (0, import_react22.forwardRef)(
|
|
1605
|
+
({ variant, items, separator = defaultSeparator, className, ...props }, ref) => {
|
|
1606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1607
|
+
"nav",
|
|
1608
|
+
{
|
|
1609
|
+
ref,
|
|
1610
|
+
"aria-label": "Breadcrumb",
|
|
1611
|
+
className: breadcrumb({ variant, className }),
|
|
1612
|
+
...props,
|
|
1613
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ol", { className: "flex items-center gap-2", children: items.map((item, index) => {
|
|
1614
|
+
const isLast = index === items.length - 1;
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
1616
|
+
item.href || item.onClick ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1617
|
+
"a",
|
|
1618
|
+
{
|
|
1619
|
+
href: item.href,
|
|
1620
|
+
onClick: item.onClick,
|
|
1621
|
+
className: breadcrumbItem({ active: isLast }),
|
|
1622
|
+
...isLast && { "aria-current": "page" },
|
|
1623
|
+
children: item.label
|
|
1624
|
+
}
|
|
1625
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1626
|
+
"span",
|
|
1627
|
+
{
|
|
1628
|
+
className: breadcrumbItem({ active: isLast }),
|
|
1629
|
+
...isLast && { "aria-current": "page" },
|
|
1630
|
+
children: item.label
|
|
1631
|
+
}
|
|
1632
|
+
),
|
|
1633
|
+
!isLast && separator
|
|
1634
|
+
] }, index);
|
|
1635
|
+
}) })
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1638
|
+
}
|
|
1639
|
+
);
|
|
1640
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
1641
|
+
|
|
1642
|
+
// src/components/Divider/index.tsx
|
|
1643
|
+
var import_react23 = require("react");
|
|
1644
|
+
var import_tailwind_variants14 = require("tailwind-variants");
|
|
1645
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1646
|
+
var divider = (0, import_tailwind_variants14.tv)({
|
|
1647
|
+
base: "",
|
|
1648
|
+
variants: {
|
|
1649
|
+
orientation: {
|
|
1650
|
+
horizontal: "w-full flex items-center",
|
|
1651
|
+
vertical: "h-full inline-flex flex-col items-center"
|
|
1652
|
+
},
|
|
1653
|
+
variant: {
|
|
1654
|
+
solid: "",
|
|
1655
|
+
dashed: ""
|
|
1656
|
+
}
|
|
1657
|
+
},
|
|
1658
|
+
defaultVariants: {
|
|
1659
|
+
orientation: "horizontal",
|
|
1660
|
+
variant: "solid"
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
var dividerLine = (0, import_tailwind_variants14.tv)({
|
|
1664
|
+
base: "bg-gray-200 flex-1",
|
|
1665
|
+
variants: {
|
|
1666
|
+
orientation: {
|
|
1667
|
+
horizontal: "h-px w-full",
|
|
1668
|
+
vertical: "w-px h-full"
|
|
1669
|
+
},
|
|
1670
|
+
variant: {
|
|
1671
|
+
solid: "",
|
|
1672
|
+
dashed: "bg-transparent border-gray-200 border-dashed"
|
|
1673
|
+
}
|
|
1674
|
+
},
|
|
1675
|
+
compoundVariants: [
|
|
1676
|
+
{ orientation: "horizontal", variant: "dashed", className: "border-t h-0" },
|
|
1677
|
+
{ orientation: "vertical", variant: "dashed", className: "border-l w-0" }
|
|
1678
|
+
]
|
|
1679
|
+
});
|
|
1680
|
+
var Divider = (0, import_react23.forwardRef)(
|
|
1681
|
+
({ orientation = "horizontal", variant, label, className, ...props }, ref) => {
|
|
1682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1683
|
+
"div",
|
|
1684
|
+
{
|
|
1685
|
+
ref,
|
|
1686
|
+
role: "separator",
|
|
1687
|
+
"aria-orientation": orientation || "horizontal",
|
|
1688
|
+
className: divider({ orientation, variant, className }),
|
|
1689
|
+
...props,
|
|
1690
|
+
children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: dividerLine({ orientation, variant }) }),
|
|
1692
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1694
|
+
"span",
|
|
1695
|
+
{
|
|
1696
|
+
className: `flex-shrink-0 text-xs text-gray-500 ${orientation === "horizontal" ? "px-3" : "py-2"}`,
|
|
1697
|
+
children: label
|
|
1698
|
+
}
|
|
1699
|
+
),
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: dividerLine({ orientation, variant }) })
|
|
1701
|
+
] })
|
|
1702
|
+
]
|
|
1703
|
+
}
|
|
1704
|
+
);
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
Divider.displayName = "Divider";
|
|
1708
|
+
|
|
1709
|
+
// src/components/Skeleton/index.tsx
|
|
1710
|
+
var import_react24 = require("react");
|
|
1711
|
+
var import_tailwind_variants15 = require("tailwind-variants");
|
|
1712
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1713
|
+
var skeleton = (0, import_tailwind_variants15.tv)({
|
|
1714
|
+
base: "animate-pulse bg-gray-200",
|
|
1715
|
+
variants: {
|
|
1716
|
+
variant: {
|
|
1717
|
+
text: "rounded-md h-4 w-full",
|
|
1718
|
+
circular: "rounded-full",
|
|
1719
|
+
rectangular: "rounded-md"
|
|
1720
|
+
},
|
|
1721
|
+
size: {
|
|
1722
|
+
sm: "",
|
|
1723
|
+
md: "",
|
|
1724
|
+
lg: ""
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
compoundVariants: [
|
|
1728
|
+
{ variant: "circular", size: "sm", className: "h-8 w-8" },
|
|
1729
|
+
{ variant: "circular", size: "md", className: "h-10 w-10" },
|
|
1730
|
+
{ variant: "circular", size: "lg", className: "h-16 w-16" },
|
|
1731
|
+
{ variant: "text", size: "sm", className: "h-3" },
|
|
1732
|
+
{ variant: "text", size: "md", className: "h-4" },
|
|
1733
|
+
{ variant: "text", size: "lg", className: "h-5" }
|
|
1734
|
+
],
|
|
1735
|
+
defaultVariants: {
|
|
1736
|
+
variant: "text",
|
|
1737
|
+
size: "md"
|
|
1738
|
+
}
|
|
1739
|
+
});
|
|
1740
|
+
var Skeleton = (0, import_react24.forwardRef)(
|
|
1741
|
+
({ variant, size, width, height, lines = 1, className, style, ...props }, ref) => {
|
|
1742
|
+
const customStyle = {
|
|
1743
|
+
...style,
|
|
1744
|
+
...width !== void 0 && { width },
|
|
1745
|
+
...height !== void 0 && { height }
|
|
1746
|
+
};
|
|
1747
|
+
if (lines > 1 && variant !== "circular") {
|
|
1748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: "flex flex-col gap-2", ...props, children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1749
|
+
"div",
|
|
1750
|
+
{
|
|
1751
|
+
className: skeleton({ variant, size, className }),
|
|
1752
|
+
style: {
|
|
1753
|
+
...customStyle,
|
|
1754
|
+
...i === lines - 1 && { width: "75%" }
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
i
|
|
1758
|
+
)) });
|
|
1759
|
+
}
|
|
1760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1761
|
+
"div",
|
|
1762
|
+
{
|
|
1763
|
+
ref,
|
|
1764
|
+
className: skeleton({ variant, size, className }),
|
|
1765
|
+
style: customStyle,
|
|
1766
|
+
...props
|
|
1767
|
+
}
|
|
1768
|
+
);
|
|
1769
|
+
}
|
|
1770
|
+
);
|
|
1771
|
+
Skeleton.displayName = "Skeleton";
|
|
1772
|
+
|
|
1773
|
+
// src/components/Spinner/index.tsx
|
|
1774
|
+
var import_react25 = require("react");
|
|
1775
|
+
var import_tailwind_variants16 = require("tailwind-variants");
|
|
1776
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1777
|
+
var spinner = (0, import_tailwind_variants16.tv)({
|
|
1778
|
+
base: "inline-block animate-spin rounded-full border-solid border-current border-r-transparent",
|
|
1779
|
+
variants: {
|
|
1780
|
+
size: {
|
|
1781
|
+
sm: "h-4 w-4 border-2",
|
|
1782
|
+
md: "h-6 w-6 border-2",
|
|
1783
|
+
lg: "h-8 w-8 border-[3px]",
|
|
1784
|
+
xl: "h-12 w-12 border-4"
|
|
1785
|
+
},
|
|
1786
|
+
variant: {
|
|
1787
|
+
primary: "text-blue-500",
|
|
1788
|
+
secondary: "text-gray-400",
|
|
1789
|
+
white: "text-white"
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
defaultVariants: {
|
|
1793
|
+
size: "md",
|
|
1794
|
+
variant: "primary"
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
var Spinner = (0, import_react25.forwardRef)(
|
|
1798
|
+
({ size, variant, label = "Carregando...", className, ...props }, ref) => {
|
|
1799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1800
|
+
"div",
|
|
1801
|
+
{
|
|
1802
|
+
ref,
|
|
1803
|
+
role: "status",
|
|
1804
|
+
className: spinner({ size, variant, className }),
|
|
1805
|
+
...props,
|
|
1806
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: label })
|
|
1807
|
+
}
|
|
1808
|
+
);
|
|
1809
|
+
}
|
|
1810
|
+
);
|
|
1811
|
+
Spinner.displayName = "Spinner";
|
|
1812
|
+
|
|
1813
|
+
// src/components/Tabs/index.tsx
|
|
1814
|
+
var import_react26 = require("react");
|
|
1815
|
+
var import_tailwind_variants17 = require("tailwind-variants");
|
|
1816
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1817
|
+
var tabs = (0, import_tailwind_variants17.tv)({
|
|
1818
|
+
base: "",
|
|
1819
|
+
variants: {
|
|
1820
|
+
variant: {
|
|
1821
|
+
line: "",
|
|
1822
|
+
enclosed: "",
|
|
1823
|
+
pill: ""
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
defaultVariants: {
|
|
1827
|
+
variant: "line"
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
var tabList = (0, import_tailwind_variants17.tv)({
|
|
1831
|
+
base: "flex",
|
|
1832
|
+
variants: {
|
|
1833
|
+
variant: {
|
|
1834
|
+
line: "border-b border-gray-200 gap-0",
|
|
1835
|
+
enclosed: "border-b border-gray-200 gap-0",
|
|
1836
|
+
pill: "gap-1 bg-gray-100 p-1 rounded-lg"
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
});
|
|
1840
|
+
var tabTrigger = (0, import_tailwind_variants17.tv)({
|
|
1841
|
+
base: "inline-flex items-center justify-center gap-2 font-medium text-sm transition-colors whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1842
|
+
variants: {
|
|
1843
|
+
variant: {
|
|
1844
|
+
line: "px-4 py-2.5 border-b-2 -mb-px text-gray-500 hover:text-gray-900 hover:border-gray-300",
|
|
1845
|
+
enclosed: "px-4 py-2 border border-transparent rounded-t-md -mb-px text-gray-500 hover:text-gray-900",
|
|
1846
|
+
pill: "px-3 py-1.5 rounded-md text-gray-600 hover:text-gray-900"
|
|
1847
|
+
},
|
|
1848
|
+
active: {
|
|
1849
|
+
true: "",
|
|
1850
|
+
false: ""
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
compoundVariants: [
|
|
1854
|
+
{ variant: "line", active: true, className: "text-blue-500 border-b-blue-500" },
|
|
1855
|
+
{ variant: "enclosed", active: true, className: "bg-white text-blue-500 border-gray-200 border-b-white" },
|
|
1856
|
+
{ variant: "pill", active: true, className: "bg-white text-blue-500 shadow-sm" }
|
|
1857
|
+
],
|
|
1858
|
+
defaultVariants: {
|
|
1859
|
+
variant: "line",
|
|
1860
|
+
active: false
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
var Tabs = (0, import_react26.forwardRef)(
|
|
1864
|
+
({ variant = "line", items, defaultValue, value, onChange, className, ...props }, ref) => {
|
|
1865
|
+
const id = (0, import_react26.useId)();
|
|
1866
|
+
const [internalValue, setInternalValue] = (0, import_react26.useState)(
|
|
1867
|
+
defaultValue || items[0]?.value || ""
|
|
1868
|
+
);
|
|
1869
|
+
const activeValue = value !== void 0 ? value : internalValue;
|
|
1870
|
+
const handleChange = (val) => {
|
|
1871
|
+
if (value === void 0) {
|
|
1872
|
+
setInternalValue(val);
|
|
1873
|
+
}
|
|
1874
|
+
onChange?.(val);
|
|
1875
|
+
};
|
|
1876
|
+
const activeItem = items.find((item) => item.value === activeValue);
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { ref, className: tabs({ variant, className }), ...props, children: [
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { role: "tablist", className: tabList({ variant }), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1879
|
+
"button",
|
|
1880
|
+
{
|
|
1881
|
+
role: "tab",
|
|
1882
|
+
type: "button",
|
|
1883
|
+
id: `${id}-tab-${item.value}`,
|
|
1884
|
+
"aria-selected": activeValue === item.value,
|
|
1885
|
+
"aria-controls": `${id}-panel-${item.value}`,
|
|
1886
|
+
disabled: item.disabled,
|
|
1887
|
+
className: tabTrigger({
|
|
1888
|
+
variant,
|
|
1889
|
+
active: activeValue === item.value
|
|
1890
|
+
}),
|
|
1891
|
+
onClick: () => handleChange(item.value),
|
|
1892
|
+
children: item.label
|
|
1893
|
+
},
|
|
1894
|
+
item.value
|
|
1895
|
+
)) }),
|
|
1896
|
+
activeItem && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1897
|
+
"div",
|
|
1898
|
+
{
|
|
1899
|
+
role: "tabpanel",
|
|
1900
|
+
id: `${id}-panel-${activeItem.value}`,
|
|
1901
|
+
"aria-labelledby": `${id}-tab-${activeItem.value}`,
|
|
1902
|
+
className: "py-4",
|
|
1903
|
+
children: activeItem.content
|
|
1904
|
+
}
|
|
1905
|
+
)
|
|
1906
|
+
] });
|
|
1907
|
+
}
|
|
1908
|
+
);
|
|
1909
|
+
Tabs.displayName = "Tabs";
|
|
1181
1910
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1182
1911
|
0 && (module.exports = {
|
|
1912
|
+
Accordion,
|
|
1913
|
+
Alert,
|
|
1183
1914
|
Avatar,
|
|
1915
|
+
Badge,
|
|
1916
|
+
Breadcrumb,
|
|
1184
1917
|
Button,
|
|
1185
1918
|
Card,
|
|
1919
|
+
Divider,
|
|
1186
1920
|
InputCNPJ,
|
|
1187
1921
|
InputCPF,
|
|
1188
1922
|
InputCep,
|
|
@@ -1196,17 +1930,34 @@ Textarea.displayName = "Textarea";
|
|
|
1196
1930
|
InputString,
|
|
1197
1931
|
InputWrapper,
|
|
1198
1932
|
Modal,
|
|
1933
|
+
Skeleton,
|
|
1934
|
+
Spinner,
|
|
1935
|
+
Tabs,
|
|
1199
1936
|
Textarea,
|
|
1200
1937
|
Tooltip,
|
|
1938
|
+
accordion,
|
|
1939
|
+
accordionContent,
|
|
1940
|
+
accordionItem,
|
|
1941
|
+
accordionTrigger,
|
|
1942
|
+
alert,
|
|
1201
1943
|
avatar,
|
|
1944
|
+
badge,
|
|
1945
|
+
breadcrumb,
|
|
1946
|
+
breadcrumbItem,
|
|
1202
1947
|
button,
|
|
1203
1948
|
card,
|
|
1949
|
+
divider,
|
|
1204
1950
|
maskCEP,
|
|
1205
1951
|
maskCNPJ,
|
|
1206
1952
|
maskCPF,
|
|
1207
1953
|
maskCurrency,
|
|
1208
1954
|
maskPhone,
|
|
1209
1955
|
modal,
|
|
1956
|
+
skeleton,
|
|
1957
|
+
spinner,
|
|
1958
|
+
tabList,
|
|
1959
|
+
tabTrigger,
|
|
1960
|
+
tabs,
|
|
1210
1961
|
tooltip,
|
|
1211
1962
|
unmask,
|
|
1212
1963
|
unmaskCurrency
|