@sigep/react 1.1.3 → 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 +861 -1
- package/dist/index.d.ts +861 -1
- package/dist/index.js +633 -0
- package/dist/index.mjs +611 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1252,10 +1252,604 @@ var Textarea = forwardRef18(
|
|
|
1252
1252
|
}
|
|
1253
1253
|
);
|
|
1254
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";
|
|
1255
1844
|
export {
|
|
1845
|
+
Accordion,
|
|
1846
|
+
Alert,
|
|
1256
1847
|
Avatar,
|
|
1848
|
+
Badge,
|
|
1849
|
+
Breadcrumb,
|
|
1257
1850
|
Button,
|
|
1258
1851
|
Card,
|
|
1852
|
+
Divider,
|
|
1259
1853
|
InputCNPJ,
|
|
1260
1854
|
InputCPF,
|
|
1261
1855
|
InputCep,
|
|
@@ -1269,17 +1863,34 @@ export {
|
|
|
1269
1863
|
InputString,
|
|
1270
1864
|
InputWrapper,
|
|
1271
1865
|
Modal,
|
|
1866
|
+
Skeleton,
|
|
1867
|
+
Spinner,
|
|
1868
|
+
Tabs,
|
|
1272
1869
|
Textarea,
|
|
1273
1870
|
Tooltip,
|
|
1871
|
+
accordion,
|
|
1872
|
+
accordionContent,
|
|
1873
|
+
accordionItem,
|
|
1874
|
+
accordionTrigger,
|
|
1875
|
+
alert,
|
|
1274
1876
|
avatar,
|
|
1877
|
+
badge,
|
|
1878
|
+
breadcrumb,
|
|
1879
|
+
breadcrumbItem,
|
|
1275
1880
|
button,
|
|
1276
1881
|
card,
|
|
1882
|
+
divider,
|
|
1277
1883
|
maskCEP,
|
|
1278
1884
|
maskCNPJ,
|
|
1279
1885
|
maskCPF,
|
|
1280
1886
|
maskCurrency,
|
|
1281
1887
|
maskPhone,
|
|
1282
1888
|
modal,
|
|
1889
|
+
skeleton,
|
|
1890
|
+
spinner,
|
|
1891
|
+
tabList,
|
|
1892
|
+
tabTrigger,
|
|
1893
|
+
tabs,
|
|
1283
1894
|
tooltip,
|
|
1284
1895
|
unmask,
|
|
1285
1896
|
unmaskCurrency
|