analytica-frontend-lib 1.0.42 → 1.0.44
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/Calendar/index.d.mts +60 -0
- package/dist/Calendar/index.d.ts +60 -0
- package/dist/Calendar/index.js +526 -0
- package/dist/Calendar/index.js.map +1 -0
- package/dist/Calendar/index.mjs +501 -0
- package/dist/Calendar/index.mjs.map +1 -0
- package/dist/Input/index.js +5 -2
- package/dist/Input/index.js.map +1 -1
- package/dist/Input/index.mjs +5 -2
- package/dist/Input/index.mjs.map +1 -1
- package/dist/ProgressBar/index.d.mts +36 -1
- package/dist/ProgressBar/index.d.ts +36 -1
- package/dist/ProgressBar/index.js +371 -75
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/ProgressBar/index.mjs +372 -76
- package/dist/ProgressBar/index.mjs.map +1 -1
- package/dist/index.css +141 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +952 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +933 -136
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +141 -0
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1254,7 +1254,7 @@ var STATE_CLASSES4 = {
|
|
|
1254
1254
|
default: "border-border-300 placeholder:text-text-600 hover:border-border-400",
|
|
1255
1255
|
error: "border-2 border-indicator-error placeholder:text-text-600",
|
|
1256
1256
|
disabled: "border-border-300 placeholder:text-text-600 cursor-not-allowed opacity-40",
|
|
1257
|
-
"read-only": "border-
|
|
1257
|
+
"read-only": "border-transparent !text-text-600 cursor-default focus:outline-none bg-transparent"
|
|
1258
1258
|
};
|
|
1259
1259
|
var VARIANT_CLASSES = {
|
|
1260
1260
|
outlined: "border rounded-lg",
|
|
@@ -1293,6 +1293,9 @@ var getCombinedClasses = (actualState, variant) => {
|
|
|
1293
1293
|
if (actualState === "error" && variant === "underlined") {
|
|
1294
1294
|
return "border-0 border-b-2 border-indicator-error rounded-none bg-transparent focus:outline-none focus:border-primary-950 placeholder:text-text-600";
|
|
1295
1295
|
}
|
|
1296
|
+
if (actualState === "read-only" && variant === "underlined") {
|
|
1297
|
+
return "border-0 border-b-0 rounded-none bg-transparent focus:outline-none !text-text-900 cursor-default";
|
|
1298
|
+
}
|
|
1296
1299
|
return `${stateClasses} ${variantClasses}`;
|
|
1297
1300
|
};
|
|
1298
1301
|
var Input = forwardRef8(
|
|
@@ -1323,7 +1326,7 @@ var Input = forwardRef8(
|
|
|
1323
1326
|
[actualState, variant]
|
|
1324
1327
|
);
|
|
1325
1328
|
const iconSize = getIconSize(size);
|
|
1326
|
-
const baseClasses =
|
|
1329
|
+
const baseClasses = `bg-background w-full py-2 ${actualState === "read-only" ? "px-0" : "px-3"} font-normal text-text-900 focus:outline-primary-950`;
|
|
1327
1330
|
const generatedId = useId4();
|
|
1328
1331
|
const inputId = id ?? `input-${generatedId}`;
|
|
1329
1332
|
const togglePasswordVisibility = () => setShowPassword(!showPassword);
|
|
@@ -1434,7 +1437,7 @@ var Chips = ({
|
|
|
1434
1437
|
var Chips_default = Chips;
|
|
1435
1438
|
|
|
1436
1439
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
1437
|
-
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1440
|
+
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1438
1441
|
var SIZE_CLASSES7 = {
|
|
1439
1442
|
small: {
|
|
1440
1443
|
container: "h-1",
|
|
@@ -1475,101 +1478,397 @@ var VARIANT_CLASSES2 = {
|
|
|
1475
1478
|
// Green for performance (#84D3A2)
|
|
1476
1479
|
}
|
|
1477
1480
|
};
|
|
1478
|
-
var
|
|
1479
|
-
value,
|
|
1480
|
-
max = 100,
|
|
1481
|
-
size = "medium",
|
|
1482
|
-
variant = "blue",
|
|
1483
|
-
label,
|
|
1484
|
-
showPercentage = false,
|
|
1485
|
-
className = "",
|
|
1486
|
-
labelClassName = "",
|
|
1487
|
-
percentageClassName = ""
|
|
1488
|
-
}) => {
|
|
1481
|
+
var calculateProgressValues = (value, max) => {
|
|
1489
1482
|
const safeValue = isNaN(value) ? 0 : value;
|
|
1490
1483
|
const clampedValue = Math.max(0, Math.min(safeValue, max));
|
|
1491
1484
|
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1485
|
+
return { clampedValue, percentage };
|
|
1486
|
+
};
|
|
1487
|
+
var shouldShowHeader = (label, showPercentage, showHitCount) => {
|
|
1488
|
+
return !!(label || showPercentage || showHitCount);
|
|
1489
|
+
};
|
|
1490
|
+
var getDisplayPriority = (showHitCount, showPercentage, label, clampedValue, max, percentage) => {
|
|
1491
|
+
if (showHitCount) {
|
|
1492
|
+
return {
|
|
1493
|
+
type: "hitCount",
|
|
1494
|
+
content: `${Math.round(clampedValue)} de ${max}`,
|
|
1495
|
+
hasMetrics: true
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
if (showPercentage) {
|
|
1499
|
+
return {
|
|
1500
|
+
type: "percentage",
|
|
1501
|
+
content: `${Math.round(percentage)}%`,
|
|
1502
|
+
hasMetrics: true
|
|
1503
|
+
};
|
|
1504
|
+
}
|
|
1505
|
+
return {
|
|
1506
|
+
type: "label",
|
|
1507
|
+
content: label,
|
|
1508
|
+
hasMetrics: false
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
var getCompactLayoutConfig = ({
|
|
1512
|
+
showPercentage,
|
|
1513
|
+
showHitCount,
|
|
1514
|
+
percentage,
|
|
1515
|
+
clampedValue,
|
|
1516
|
+
max,
|
|
1517
|
+
label,
|
|
1518
|
+
percentageClassName,
|
|
1519
|
+
labelClassName
|
|
1520
|
+
}) => {
|
|
1521
|
+
const displayPriority = getDisplayPriority(
|
|
1522
|
+
showHitCount,
|
|
1523
|
+
showPercentage,
|
|
1524
|
+
label,
|
|
1525
|
+
clampedValue,
|
|
1526
|
+
max,
|
|
1527
|
+
percentage
|
|
1528
|
+
);
|
|
1529
|
+
return {
|
|
1530
|
+
color: displayPriority.hasMetrics ? "text-primary-600" : "text-primary-700",
|
|
1531
|
+
className: displayPriority.hasMetrics ? percentageClassName : labelClassName,
|
|
1532
|
+
content: displayPriority.content
|
|
1533
|
+
};
|
|
1534
|
+
};
|
|
1535
|
+
var getDefaultLayoutDisplayConfig = (size, label, showPercentage) => ({
|
|
1536
|
+
showHeader: size === "small" && !!(label || showPercentage),
|
|
1537
|
+
showPercentage: size === "medium" && showPercentage,
|
|
1538
|
+
showLabel: size === "medium" && !!label && !showPercentage
|
|
1539
|
+
// Only show label when percentage is not shown
|
|
1540
|
+
});
|
|
1541
|
+
var renderStackedHitCountDisplay = (showHitCount, showPercentage, clampedValue, max, percentage, percentageClassName) => {
|
|
1542
|
+
if (!showHitCount && !showPercentage) return null;
|
|
1543
|
+
const displayPriority = getDisplayPriority(
|
|
1544
|
+
showHitCount,
|
|
1545
|
+
showPercentage,
|
|
1546
|
+
null,
|
|
1547
|
+
// label is not relevant for stacked layout metrics display
|
|
1548
|
+
clampedValue,
|
|
1549
|
+
max,
|
|
1550
|
+
percentage
|
|
1551
|
+
);
|
|
1552
|
+
return /* @__PURE__ */ jsx18(
|
|
1495
1553
|
"div",
|
|
1496
1554
|
{
|
|
1497
|
-
className: `
|
|
1498
|
-
children: [
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1555
|
+
className: `text-xs font-medium leading-[14px] text-right ${percentageClassName}`,
|
|
1556
|
+
children: displayPriority.type === "hitCount" ? /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1557
|
+
/* @__PURE__ */ jsx18("span", { className: "text-success-200", children: Math.round(clampedValue) }),
|
|
1558
|
+
/* @__PURE__ */ jsxs13("span", { className: "text-text-600", children: [
|
|
1559
|
+
" de ",
|
|
1560
|
+
max
|
|
1561
|
+
] })
|
|
1562
|
+
] }) : /* @__PURE__ */ jsxs13(Text_default, { size: "xs", weight: "medium", className: "text-success-200", children: [
|
|
1563
|
+
Math.round(percentage),
|
|
1564
|
+
"%"
|
|
1565
|
+
] })
|
|
1566
|
+
}
|
|
1567
|
+
);
|
|
1568
|
+
};
|
|
1569
|
+
var ProgressBarBase = ({
|
|
1570
|
+
clampedValue,
|
|
1571
|
+
max,
|
|
1572
|
+
percentage,
|
|
1573
|
+
label,
|
|
1574
|
+
variantClasses,
|
|
1575
|
+
containerClassName,
|
|
1576
|
+
fillClassName
|
|
1577
|
+
}) => /* @__PURE__ */ jsxs13(
|
|
1578
|
+
"div",
|
|
1579
|
+
{
|
|
1580
|
+
className: `${containerClassName} ${variantClasses.background} overflow-hidden relative`,
|
|
1581
|
+
children: [
|
|
1582
|
+
/* @__PURE__ */ jsx18(
|
|
1583
|
+
"progress",
|
|
1584
|
+
{
|
|
1585
|
+
value: clampedValue,
|
|
1586
|
+
max,
|
|
1587
|
+
"aria-label": typeof label === "string" ? `${label}: ${Math.round(percentage)}% complete` : `Progress: ${Math.round(percentage)}% of ${max}`,
|
|
1588
|
+
className: "absolute inset-0 w-full h-full opacity-0"
|
|
1589
|
+
}
|
|
1590
|
+
),
|
|
1591
|
+
/* @__PURE__ */ jsx18(
|
|
1592
|
+
"div",
|
|
1593
|
+
{
|
|
1594
|
+
className: `${fillClassName} ${variantClasses.fill} transition-all duration-300 ease-out`,
|
|
1595
|
+
style: { width: `${percentage}%` }
|
|
1596
|
+
}
|
|
1597
|
+
)
|
|
1598
|
+
]
|
|
1599
|
+
}
|
|
1600
|
+
);
|
|
1601
|
+
var StackedLayout = ({
|
|
1602
|
+
className,
|
|
1603
|
+
label,
|
|
1604
|
+
showPercentage,
|
|
1605
|
+
showHitCount,
|
|
1606
|
+
labelClassName,
|
|
1607
|
+
percentageClassName,
|
|
1608
|
+
clampedValue,
|
|
1609
|
+
max,
|
|
1610
|
+
percentage,
|
|
1611
|
+
variantClasses,
|
|
1612
|
+
dimensions
|
|
1613
|
+
}) => /* @__PURE__ */ jsxs13(
|
|
1614
|
+
"div",
|
|
1615
|
+
{
|
|
1616
|
+
className: `flex flex-col items-start gap-2 ${dimensions.width} ${dimensions.height} ${className}`,
|
|
1617
|
+
children: [
|
|
1618
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsxs13("div", { className: "flex flex-row justify-between items-center w-full h-[19px]", children: [
|
|
1619
|
+
label && /* @__PURE__ */ jsx18(
|
|
1548
1620
|
Text_default,
|
|
1549
1621
|
{
|
|
1550
|
-
|
|
1622
|
+
as: "div",
|
|
1623
|
+
size: "md",
|
|
1551
1624
|
weight: "medium",
|
|
1552
|
-
className: `text-text-
|
|
1553
|
-
children:
|
|
1554
|
-
Math.round(percentage),
|
|
1555
|
-
"%"
|
|
1556
|
-
]
|
|
1625
|
+
className: `text-text-600 leading-[19px] ${labelClassName}`,
|
|
1626
|
+
children: label
|
|
1557
1627
|
}
|
|
1558
1628
|
),
|
|
1559
|
-
|
|
1629
|
+
renderStackedHitCountDisplay(
|
|
1630
|
+
showHitCount,
|
|
1631
|
+
showPercentage,
|
|
1632
|
+
clampedValue,
|
|
1633
|
+
max,
|
|
1634
|
+
percentage,
|
|
1635
|
+
percentageClassName
|
|
1636
|
+
)
|
|
1637
|
+
] }),
|
|
1638
|
+
/* @__PURE__ */ jsx18(
|
|
1639
|
+
ProgressBarBase,
|
|
1640
|
+
{
|
|
1641
|
+
clampedValue,
|
|
1642
|
+
max,
|
|
1643
|
+
percentage,
|
|
1644
|
+
label,
|
|
1645
|
+
variantClasses,
|
|
1646
|
+
containerClassName: "w-full h-2 rounded-lg",
|
|
1647
|
+
fillClassName: "h-2 rounded-lg shadow-hard-shadow-3"
|
|
1648
|
+
}
|
|
1649
|
+
)
|
|
1650
|
+
]
|
|
1651
|
+
}
|
|
1652
|
+
);
|
|
1653
|
+
var CompactLayout = ({
|
|
1654
|
+
className,
|
|
1655
|
+
label,
|
|
1656
|
+
showPercentage,
|
|
1657
|
+
showHitCount,
|
|
1658
|
+
labelClassName,
|
|
1659
|
+
percentageClassName,
|
|
1660
|
+
clampedValue,
|
|
1661
|
+
max,
|
|
1662
|
+
percentage,
|
|
1663
|
+
variantClasses,
|
|
1664
|
+
dimensions
|
|
1665
|
+
}) => {
|
|
1666
|
+
const {
|
|
1667
|
+
color,
|
|
1668
|
+
className: compactClassName,
|
|
1669
|
+
content
|
|
1670
|
+
} = getCompactLayoutConfig({
|
|
1671
|
+
showPercentage,
|
|
1672
|
+
showHitCount,
|
|
1673
|
+
percentage,
|
|
1674
|
+
clampedValue,
|
|
1675
|
+
max,
|
|
1676
|
+
label,
|
|
1677
|
+
percentageClassName,
|
|
1678
|
+
labelClassName
|
|
1679
|
+
});
|
|
1680
|
+
return /* @__PURE__ */ jsxs13(
|
|
1681
|
+
"div",
|
|
1682
|
+
{
|
|
1683
|
+
className: `flex flex-col items-start gap-1 ${dimensions.width} ${dimensions.height} ${className}`,
|
|
1684
|
+
children: [
|
|
1685
|
+
shouldShowHeader(label, showPercentage, showHitCount) && /* @__PURE__ */ jsx18(
|
|
1560
1686
|
Text_default,
|
|
1561
1687
|
{
|
|
1562
1688
|
as: "div",
|
|
1563
|
-
size: "
|
|
1689
|
+
size: "sm",
|
|
1564
1690
|
weight: "medium",
|
|
1565
|
-
|
|
1566
|
-
|
|
1691
|
+
color,
|
|
1692
|
+
className: `leading-4 w-full ${compactClassName}`,
|
|
1693
|
+
children: content
|
|
1694
|
+
}
|
|
1695
|
+
),
|
|
1696
|
+
/* @__PURE__ */ jsx18(
|
|
1697
|
+
ProgressBarBase,
|
|
1698
|
+
{
|
|
1699
|
+
clampedValue,
|
|
1700
|
+
max,
|
|
1701
|
+
percentage,
|
|
1702
|
+
label,
|
|
1703
|
+
variantClasses,
|
|
1704
|
+
containerClassName: "w-full h-1 rounded-full",
|
|
1705
|
+
fillClassName: "h-1 rounded-full"
|
|
1567
1706
|
}
|
|
1568
1707
|
)
|
|
1569
1708
|
]
|
|
1570
1709
|
}
|
|
1571
1710
|
);
|
|
1572
1711
|
};
|
|
1712
|
+
var DefaultLayout = ({
|
|
1713
|
+
className,
|
|
1714
|
+
size,
|
|
1715
|
+
sizeClasses,
|
|
1716
|
+
variantClasses,
|
|
1717
|
+
label,
|
|
1718
|
+
showPercentage,
|
|
1719
|
+
labelClassName,
|
|
1720
|
+
percentageClassName,
|
|
1721
|
+
clampedValue,
|
|
1722
|
+
max,
|
|
1723
|
+
percentage
|
|
1724
|
+
}) => {
|
|
1725
|
+
const gapClass = size === "medium" ? "gap-2" : sizeClasses.spacing;
|
|
1726
|
+
const progressBarClass = size === "medium" ? "flex-grow" : "w-full";
|
|
1727
|
+
const displayConfig = getDefaultLayoutDisplayConfig(
|
|
1728
|
+
size,
|
|
1729
|
+
label,
|
|
1730
|
+
showPercentage
|
|
1731
|
+
);
|
|
1732
|
+
return /* @__PURE__ */ jsxs13("div", { className: `flex ${sizeClasses.layout} ${gapClass} ${className}`, children: [
|
|
1733
|
+
displayConfig.showHeader && /* @__PURE__ */ jsxs13("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1734
|
+
label && /* @__PURE__ */ jsx18(
|
|
1735
|
+
Text_default,
|
|
1736
|
+
{
|
|
1737
|
+
as: "div",
|
|
1738
|
+
size: "xs",
|
|
1739
|
+
weight: "medium",
|
|
1740
|
+
className: `text-text-950 leading-none tracking-normal text-center ${labelClassName}`,
|
|
1741
|
+
children: label
|
|
1742
|
+
}
|
|
1743
|
+
),
|
|
1744
|
+
showPercentage && /* @__PURE__ */ jsxs13(
|
|
1745
|
+
Text_default,
|
|
1746
|
+
{
|
|
1747
|
+
size: "xs",
|
|
1748
|
+
weight: "medium",
|
|
1749
|
+
className: `text-text-950 leading-none tracking-normal text-center ${percentageClassName}`,
|
|
1750
|
+
children: [
|
|
1751
|
+
Math.round(percentage),
|
|
1752
|
+
"%"
|
|
1753
|
+
]
|
|
1754
|
+
}
|
|
1755
|
+
)
|
|
1756
|
+
] }),
|
|
1757
|
+
/* @__PURE__ */ jsx18(
|
|
1758
|
+
ProgressBarBase,
|
|
1759
|
+
{
|
|
1760
|
+
clampedValue,
|
|
1761
|
+
max,
|
|
1762
|
+
percentage,
|
|
1763
|
+
label,
|
|
1764
|
+
variantClasses,
|
|
1765
|
+
containerClassName: `${progressBarClass} ${sizeClasses.container} ${sizeClasses.borderRadius}`,
|
|
1766
|
+
fillClassName: `${sizeClasses.bar} ${sizeClasses.borderRadius} shadow-hard-shadow-3`
|
|
1767
|
+
}
|
|
1768
|
+
),
|
|
1769
|
+
displayConfig.showPercentage && /* @__PURE__ */ jsxs13(
|
|
1770
|
+
Text_default,
|
|
1771
|
+
{
|
|
1772
|
+
size: "xs",
|
|
1773
|
+
weight: "medium",
|
|
1774
|
+
className: `text-text-950 leading-none tracking-normal text-center flex-none ${percentageClassName}`,
|
|
1775
|
+
children: [
|
|
1776
|
+
Math.round(percentage),
|
|
1777
|
+
"%"
|
|
1778
|
+
]
|
|
1779
|
+
}
|
|
1780
|
+
),
|
|
1781
|
+
displayConfig.showLabel && /* @__PURE__ */ jsx18(
|
|
1782
|
+
Text_default,
|
|
1783
|
+
{
|
|
1784
|
+
as: "div",
|
|
1785
|
+
size: "xs",
|
|
1786
|
+
weight: "medium",
|
|
1787
|
+
className: `text-text-950 leading-none tracking-normal text-center flex-none ${labelClassName}`,
|
|
1788
|
+
children: label
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
] });
|
|
1792
|
+
};
|
|
1793
|
+
var ProgressBar = ({
|
|
1794
|
+
value,
|
|
1795
|
+
max = 100,
|
|
1796
|
+
size = "medium",
|
|
1797
|
+
variant = "blue",
|
|
1798
|
+
layout = "default",
|
|
1799
|
+
label,
|
|
1800
|
+
showPercentage = false,
|
|
1801
|
+
showHitCount = false,
|
|
1802
|
+
className = "",
|
|
1803
|
+
labelClassName = "",
|
|
1804
|
+
percentageClassName = "",
|
|
1805
|
+
stackedWidth,
|
|
1806
|
+
stackedHeight,
|
|
1807
|
+
compactWidth,
|
|
1808
|
+
compactHeight
|
|
1809
|
+
}) => {
|
|
1810
|
+
const { clampedValue, percentage } = calculateProgressValues(value, max);
|
|
1811
|
+
const sizeClasses = SIZE_CLASSES7[size];
|
|
1812
|
+
const variantClasses = VARIANT_CLASSES2[variant];
|
|
1813
|
+
if (layout === "stacked") {
|
|
1814
|
+
return /* @__PURE__ */ jsx18(
|
|
1815
|
+
StackedLayout,
|
|
1816
|
+
{
|
|
1817
|
+
className,
|
|
1818
|
+
label,
|
|
1819
|
+
showPercentage,
|
|
1820
|
+
showHitCount,
|
|
1821
|
+
labelClassName,
|
|
1822
|
+
percentageClassName,
|
|
1823
|
+
clampedValue,
|
|
1824
|
+
max,
|
|
1825
|
+
percentage,
|
|
1826
|
+
variantClasses,
|
|
1827
|
+
dimensions: {
|
|
1828
|
+
width: stackedWidth ?? "w-[380px]",
|
|
1829
|
+
height: stackedHeight ?? "h-[35px]"
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
);
|
|
1833
|
+
}
|
|
1834
|
+
if (layout === "compact") {
|
|
1835
|
+
return /* @__PURE__ */ jsx18(
|
|
1836
|
+
CompactLayout,
|
|
1837
|
+
{
|
|
1838
|
+
className,
|
|
1839
|
+
label,
|
|
1840
|
+
showPercentage,
|
|
1841
|
+
showHitCount,
|
|
1842
|
+
labelClassName,
|
|
1843
|
+
percentageClassName,
|
|
1844
|
+
clampedValue,
|
|
1845
|
+
max,
|
|
1846
|
+
percentage,
|
|
1847
|
+
variantClasses,
|
|
1848
|
+
dimensions: {
|
|
1849
|
+
width: compactWidth ?? "w-[131px]",
|
|
1850
|
+
height: compactHeight ?? "h-[24px]"
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
);
|
|
1854
|
+
}
|
|
1855
|
+
return /* @__PURE__ */ jsx18(
|
|
1856
|
+
DefaultLayout,
|
|
1857
|
+
{
|
|
1858
|
+
className,
|
|
1859
|
+
size,
|
|
1860
|
+
sizeClasses,
|
|
1861
|
+
variantClasses,
|
|
1862
|
+
label,
|
|
1863
|
+
showPercentage,
|
|
1864
|
+
labelClassName,
|
|
1865
|
+
percentageClassName,
|
|
1866
|
+
clampedValue,
|
|
1867
|
+
max,
|
|
1868
|
+
percentage
|
|
1869
|
+
}
|
|
1870
|
+
);
|
|
1871
|
+
};
|
|
1573
1872
|
var ProgressBar_default = ProgressBar;
|
|
1574
1873
|
|
|
1575
1874
|
// src/components/ProgressCircle/ProgressCircle.tsx
|
|
@@ -1742,19 +2041,516 @@ var ProgressCircle = ({
|
|
|
1742
2041
|
};
|
|
1743
2042
|
var ProgressCircle_default = ProgressCircle;
|
|
1744
2043
|
|
|
2044
|
+
// src/components/Calendar/Calendar.tsx
|
|
2045
|
+
import { useState as useState5, useMemo as useMemo2, useEffect, useRef } from "react";
|
|
2046
|
+
import { jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2047
|
+
var WEEK_DAYS = ["SEG", "TER", "QUA", "QUI", "SEX", "S\xC1B", "DOM"];
|
|
2048
|
+
var WEEK_DAYS_SHORT = ["S", "T", "Q", "Q", "S", "S", "D"];
|
|
2049
|
+
var MONTH_NAMES = [
|
|
2050
|
+
"Janeiro",
|
|
2051
|
+
"Fevereiro",
|
|
2052
|
+
"Mar\xE7o",
|
|
2053
|
+
"Abril",
|
|
2054
|
+
"Maio",
|
|
2055
|
+
"Junho",
|
|
2056
|
+
"Julho",
|
|
2057
|
+
"Agosto",
|
|
2058
|
+
"Setembro",
|
|
2059
|
+
"Outubro",
|
|
2060
|
+
"Novembro",
|
|
2061
|
+
"Dezembro"
|
|
2062
|
+
];
|
|
2063
|
+
var MonthYearPicker = ({
|
|
2064
|
+
monthPickerRef,
|
|
2065
|
+
availableYears,
|
|
2066
|
+
currentDate,
|
|
2067
|
+
onYearChange,
|
|
2068
|
+
onMonthChange
|
|
2069
|
+
}) => /* @__PURE__ */ jsxs15(
|
|
2070
|
+
"div",
|
|
2071
|
+
{
|
|
2072
|
+
ref: monthPickerRef,
|
|
2073
|
+
className: "absolute top-full left-0 z-50 mt-1 bg-white rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]",
|
|
2074
|
+
children: [
|
|
2075
|
+
/* @__PURE__ */ jsxs15("div", { className: "mb-4", children: [
|
|
2076
|
+
/* @__PURE__ */ jsx20("h3", { className: "text-sm font-medium text-text-700 mb-2", children: "Selecionar Ano" }),
|
|
2077
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-4 gap-1 max-h-32 overflow-y-auto", children: availableYears.map((year) => /* @__PURE__ */ jsx20(
|
|
2078
|
+
"button",
|
|
2079
|
+
{
|
|
2080
|
+
onClick: () => onYearChange(year),
|
|
2081
|
+
className: `
|
|
2082
|
+
px-2 py-1 text-xs rounded text-center hover:bg-background-100 transition-colors
|
|
2083
|
+
${year === currentDate.getFullYear() ? "bg-primary-800 text-text font-medium hover:text-text-950" : "text-text-700"}
|
|
2084
|
+
`,
|
|
2085
|
+
children: year
|
|
2086
|
+
},
|
|
2087
|
+
year
|
|
2088
|
+
)) })
|
|
2089
|
+
] }),
|
|
2090
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
2091
|
+
/* @__PURE__ */ jsx20("h3", { className: "text-sm font-medium text-text-700 mb-2", children: "Selecionar M\xEAs" }),
|
|
2092
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-3 gap-1", children: MONTH_NAMES.map((month, index) => /* @__PURE__ */ jsx20(
|
|
2093
|
+
"button",
|
|
2094
|
+
{
|
|
2095
|
+
onClick: () => onMonthChange(index, currentDate.getFullYear()),
|
|
2096
|
+
className: `
|
|
2097
|
+
px-2 py-2 text-xs rounded text-center hover:bg-background-100 transition-colors
|
|
2098
|
+
${index === currentDate.getMonth() ? "bg-primary-800 text-text font-medium hover:text-text-950" : "text-text-700"}
|
|
2099
|
+
`,
|
|
2100
|
+
children: month.substring(0, 3)
|
|
2101
|
+
},
|
|
2102
|
+
month
|
|
2103
|
+
)) })
|
|
2104
|
+
] })
|
|
2105
|
+
]
|
|
2106
|
+
}
|
|
2107
|
+
);
|
|
2108
|
+
var getDayStyles = (day, variant, showActivities) => {
|
|
2109
|
+
let dayStyle = "";
|
|
2110
|
+
let textStyle = "";
|
|
2111
|
+
if (variant === "selection" && day.isSelected) {
|
|
2112
|
+
dayStyle = "bg-primary-800";
|
|
2113
|
+
textStyle = "text-white";
|
|
2114
|
+
} else if (day.isToday) {
|
|
2115
|
+
textStyle = "text-[#1c61b2]";
|
|
2116
|
+
} else if (variant === "navigation" && showActivities && day.activities?.length) {
|
|
2117
|
+
const primaryActivity = day.activities[0];
|
|
2118
|
+
if (primaryActivity.status === "near-deadline") {
|
|
2119
|
+
dayStyle = "bg-warning-background border-2 border-warning-400";
|
|
2120
|
+
textStyle = "text-text-950";
|
|
2121
|
+
} else if (primaryActivity.status === "in-deadline") {
|
|
2122
|
+
dayStyle = "bg-success-background border-2 border-success-300";
|
|
2123
|
+
textStyle = "text-text-950";
|
|
2124
|
+
} else if (primaryActivity.status === "overdue") {
|
|
2125
|
+
dayStyle = "bg-error-background border-2 border-error-300";
|
|
2126
|
+
textStyle = "text-text-950";
|
|
2127
|
+
} else {
|
|
2128
|
+
dayStyle = "border-2 border-blue-500";
|
|
2129
|
+
textStyle = "text-blue-500";
|
|
2130
|
+
}
|
|
2131
|
+
} else {
|
|
2132
|
+
textStyle = "text-text-950 hover:bg-background-100";
|
|
2133
|
+
}
|
|
2134
|
+
return { dayStyle, textStyle };
|
|
2135
|
+
};
|
|
2136
|
+
var Calendar = ({
|
|
2137
|
+
variant = "selection",
|
|
2138
|
+
selectedDate,
|
|
2139
|
+
onDateSelect,
|
|
2140
|
+
onMonthChange,
|
|
2141
|
+
activities = {},
|
|
2142
|
+
showActivities = true,
|
|
2143
|
+
className = ""
|
|
2144
|
+
}) => {
|
|
2145
|
+
const [currentDate, setCurrentDate] = useState5(selectedDate || /* @__PURE__ */ new Date());
|
|
2146
|
+
const [isMonthPickerOpen, setIsMonthPickerOpen] = useState5(false);
|
|
2147
|
+
const monthPickerRef = useRef(null);
|
|
2148
|
+
const monthPickerContainerRef = useRef(null);
|
|
2149
|
+
useEffect(() => {
|
|
2150
|
+
const handleClickOutside = (event) => {
|
|
2151
|
+
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
2152
|
+
setIsMonthPickerOpen(false);
|
|
2153
|
+
}
|
|
2154
|
+
};
|
|
2155
|
+
if (isMonthPickerOpen) {
|
|
2156
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
2157
|
+
}
|
|
2158
|
+
return () => {
|
|
2159
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
2160
|
+
};
|
|
2161
|
+
}, [isMonthPickerOpen]);
|
|
2162
|
+
const today = /* @__PURE__ */ new Date();
|
|
2163
|
+
const availableYears = useMemo2(() => {
|
|
2164
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2165
|
+
const years = [];
|
|
2166
|
+
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
2167
|
+
years.push(year);
|
|
2168
|
+
}
|
|
2169
|
+
return years;
|
|
2170
|
+
}, []);
|
|
2171
|
+
const calendarData = useMemo2(() => {
|
|
2172
|
+
const year = currentDate.getFullYear();
|
|
2173
|
+
const month = currentDate.getMonth();
|
|
2174
|
+
const firstDay = new Date(year, month, 1);
|
|
2175
|
+
const startDate = new Date(firstDay);
|
|
2176
|
+
const firstDayOfWeek = (firstDay.getDay() + 6) % 7;
|
|
2177
|
+
startDate.setDate(startDate.getDate() - firstDayOfWeek);
|
|
2178
|
+
const days = [];
|
|
2179
|
+
const currentCalendarDate = new Date(startDate);
|
|
2180
|
+
for (let i = 0; i < 42; i++) {
|
|
2181
|
+
const dateKey = currentCalendarDate.toISOString().split("T")[0];
|
|
2182
|
+
const dayActivities = activities[dateKey] || [];
|
|
2183
|
+
days.push({
|
|
2184
|
+
date: new Date(currentCalendarDate),
|
|
2185
|
+
isCurrentMonth: currentCalendarDate.getMonth() === month,
|
|
2186
|
+
isToday: currentCalendarDate.getFullYear() === today.getFullYear() && currentCalendarDate.getMonth() === today.getMonth() && currentCalendarDate.getDate() === today.getDate(),
|
|
2187
|
+
isSelected: selectedDate ? currentCalendarDate.getFullYear() === selectedDate.getFullYear() && currentCalendarDate.getMonth() === selectedDate.getMonth() && currentCalendarDate.getDate() === selectedDate.getDate() : false,
|
|
2188
|
+
activities: dayActivities
|
|
2189
|
+
});
|
|
2190
|
+
currentCalendarDate.setDate(currentCalendarDate.getDate() + 1);
|
|
2191
|
+
}
|
|
2192
|
+
return days;
|
|
2193
|
+
}, [currentDate, selectedDate, activities]);
|
|
2194
|
+
const goToPreviousMonth = () => {
|
|
2195
|
+
const newDate = new Date(currentDate);
|
|
2196
|
+
newDate.setMonth(newDate.getMonth() - 1);
|
|
2197
|
+
setCurrentDate(newDate);
|
|
2198
|
+
onMonthChange?.(newDate);
|
|
2199
|
+
};
|
|
2200
|
+
const goToNextMonth = () => {
|
|
2201
|
+
const newDate = new Date(currentDate);
|
|
2202
|
+
newDate.setMonth(newDate.getMonth() + 1);
|
|
2203
|
+
setCurrentDate(newDate);
|
|
2204
|
+
onMonthChange?.(newDate);
|
|
2205
|
+
};
|
|
2206
|
+
const goToMonth = (month, year) => {
|
|
2207
|
+
const newDate = new Date(year, month, 1);
|
|
2208
|
+
setCurrentDate(newDate);
|
|
2209
|
+
setIsMonthPickerOpen(false);
|
|
2210
|
+
onMonthChange?.(newDate);
|
|
2211
|
+
};
|
|
2212
|
+
const handleYearChange = (year) => {
|
|
2213
|
+
const newDate = new Date(year, currentDate.getMonth(), 1);
|
|
2214
|
+
setCurrentDate(newDate);
|
|
2215
|
+
};
|
|
2216
|
+
const toggleMonthPicker = (event) => {
|
|
2217
|
+
event.stopPropagation();
|
|
2218
|
+
setIsMonthPickerOpen(!isMonthPickerOpen);
|
|
2219
|
+
};
|
|
2220
|
+
const handleDateSelect = (day) => {
|
|
2221
|
+
onDateSelect?.(day.date);
|
|
2222
|
+
};
|
|
2223
|
+
if (variant === "navigation") {
|
|
2224
|
+
return /* @__PURE__ */ jsxs15("div", { className: `bg-background rounded-xl p-3 ${className}`, children: [
|
|
2225
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between mb-4 px-6", children: [
|
|
2226
|
+
/* @__PURE__ */ jsxs15("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
2227
|
+
/* @__PURE__ */ jsxs15(
|
|
2228
|
+
"button",
|
|
2229
|
+
{
|
|
2230
|
+
onClick: toggleMonthPicker,
|
|
2231
|
+
className: "flex items-center gap-1 hover:bg-background-100 rounded px-2 py-1 transition-colors",
|
|
2232
|
+
children: [
|
|
2233
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-sm font-medium text-text-600", children: [
|
|
2234
|
+
MONTH_NAMES[currentDate.getMonth()],
|
|
2235
|
+
" ",
|
|
2236
|
+
currentDate.getFullYear()
|
|
2237
|
+
] }),
|
|
2238
|
+
/* @__PURE__ */ jsx20(
|
|
2239
|
+
"svg",
|
|
2240
|
+
{
|
|
2241
|
+
className: `w-4 h-4 text-primary-950 transition-transform ${isMonthPickerOpen ? "rotate-180" : ""}`,
|
|
2242
|
+
fill: "none",
|
|
2243
|
+
stroke: "currentColor",
|
|
2244
|
+
viewBox: "0 0 24 24",
|
|
2245
|
+
children: /* @__PURE__ */ jsx20(
|
|
2246
|
+
"path",
|
|
2247
|
+
{
|
|
2248
|
+
strokeLinecap: "round",
|
|
2249
|
+
strokeLinejoin: "round",
|
|
2250
|
+
strokeWidth: 2,
|
|
2251
|
+
d: "M19 9l-7 7-7-7"
|
|
2252
|
+
}
|
|
2253
|
+
)
|
|
2254
|
+
}
|
|
2255
|
+
)
|
|
2256
|
+
]
|
|
2257
|
+
}
|
|
2258
|
+
),
|
|
2259
|
+
isMonthPickerOpen && /* @__PURE__ */ jsx20(
|
|
2260
|
+
MonthYearPicker,
|
|
2261
|
+
{
|
|
2262
|
+
monthPickerRef,
|
|
2263
|
+
availableYears,
|
|
2264
|
+
currentDate,
|
|
2265
|
+
onYearChange: handleYearChange,
|
|
2266
|
+
onMonthChange: goToMonth
|
|
2267
|
+
}
|
|
2268
|
+
)
|
|
2269
|
+
] }),
|
|
2270
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-10", children: [
|
|
2271
|
+
/* @__PURE__ */ jsx20(
|
|
2272
|
+
"button",
|
|
2273
|
+
{
|
|
2274
|
+
onClick: goToPreviousMonth,
|
|
2275
|
+
className: "p-1 rounded hover:bg-background-100 transition-colors",
|
|
2276
|
+
"aria-label": "M\xEAs anterior",
|
|
2277
|
+
children: /* @__PURE__ */ jsx20(
|
|
2278
|
+
"svg",
|
|
2279
|
+
{
|
|
2280
|
+
className: "w-6 h-6 text-primary-950",
|
|
2281
|
+
fill: "none",
|
|
2282
|
+
stroke: "currentColor",
|
|
2283
|
+
viewBox: "0 0 24 24",
|
|
2284
|
+
children: /* @__PURE__ */ jsx20(
|
|
2285
|
+
"path",
|
|
2286
|
+
{
|
|
2287
|
+
strokeLinecap: "round",
|
|
2288
|
+
strokeLinejoin: "round",
|
|
2289
|
+
strokeWidth: 2,
|
|
2290
|
+
d: "M15 19l-7-7 7-7"
|
|
2291
|
+
}
|
|
2292
|
+
)
|
|
2293
|
+
}
|
|
2294
|
+
)
|
|
2295
|
+
}
|
|
2296
|
+
),
|
|
2297
|
+
/* @__PURE__ */ jsx20(
|
|
2298
|
+
"button",
|
|
2299
|
+
{
|
|
2300
|
+
onClick: goToNextMonth,
|
|
2301
|
+
className: "p-1 rounded hover:bg-background-100 transition-colors",
|
|
2302
|
+
"aria-label": "Pr\xF3ximo m\xEAs",
|
|
2303
|
+
children: /* @__PURE__ */ jsx20(
|
|
2304
|
+
"svg",
|
|
2305
|
+
{
|
|
2306
|
+
className: "w-6 h-6 text-primary-950",
|
|
2307
|
+
fill: "none",
|
|
2308
|
+
stroke: "currentColor",
|
|
2309
|
+
viewBox: "0 0 24 24",
|
|
2310
|
+
children: /* @__PURE__ */ jsx20(
|
|
2311
|
+
"path",
|
|
2312
|
+
{
|
|
2313
|
+
strokeLinecap: "round",
|
|
2314
|
+
strokeLinejoin: "round",
|
|
2315
|
+
strokeWidth: 2,
|
|
2316
|
+
d: "M9 5l7 7-7 7"
|
|
2317
|
+
}
|
|
2318
|
+
)
|
|
2319
|
+
}
|
|
2320
|
+
)
|
|
2321
|
+
}
|
|
2322
|
+
)
|
|
2323
|
+
] })
|
|
2324
|
+
] }),
|
|
2325
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS_SHORT.map((day, index) => /* @__PURE__ */ jsx20(
|
|
2326
|
+
"div",
|
|
2327
|
+
{
|
|
2328
|
+
className: "h-9 flex items-center justify-center text-xs font-normal text-text-600",
|
|
2329
|
+
children: day
|
|
2330
|
+
},
|
|
2331
|
+
`${day}-${index}`
|
|
2332
|
+
)) }),
|
|
2333
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
|
|
2334
|
+
if (!day.isCurrentMonth) {
|
|
2335
|
+
return /* @__PURE__ */ jsx20(
|
|
2336
|
+
"div",
|
|
2337
|
+
{
|
|
2338
|
+
className: "flex items-center justify-center",
|
|
2339
|
+
children: /* @__PURE__ */ jsx20("div", { className: "w-9 h-9" })
|
|
2340
|
+
},
|
|
2341
|
+
day.date.getTime()
|
|
2342
|
+
);
|
|
2343
|
+
}
|
|
2344
|
+
const { dayStyle, textStyle } = getDayStyles(
|
|
2345
|
+
day,
|
|
2346
|
+
variant,
|
|
2347
|
+
showActivities
|
|
2348
|
+
);
|
|
2349
|
+
let spanClass = "";
|
|
2350
|
+
if (day.isSelected && day.isToday) {
|
|
2351
|
+
spanClass = "h-6 w-6 rounded-full bg-[#1c61b2] text-text";
|
|
2352
|
+
} else if (day.isSelected) {
|
|
2353
|
+
spanClass = "h-6 w-6 rounded-full bg-primary-950 text-text";
|
|
2354
|
+
}
|
|
2355
|
+
return /* @__PURE__ */ jsx20(
|
|
2356
|
+
"div",
|
|
2357
|
+
{
|
|
2358
|
+
className: "flex items-center justify-center",
|
|
2359
|
+
children: /* @__PURE__ */ jsx20(
|
|
2360
|
+
"button",
|
|
2361
|
+
{
|
|
2362
|
+
className: `
|
|
2363
|
+
w-9 h-9
|
|
2364
|
+
flex items-center justify-center
|
|
2365
|
+
text-md font-normal
|
|
2366
|
+
cursor-pointer
|
|
2367
|
+
rounded-full
|
|
2368
|
+
${dayStyle}
|
|
2369
|
+
${textStyle}
|
|
2370
|
+
`,
|
|
2371
|
+
onClick: () => handleDateSelect(day),
|
|
2372
|
+
"aria-label": `${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`,
|
|
2373
|
+
"aria-current": day.isToday ? "date" : void 0,
|
|
2374
|
+
tabIndex: 0,
|
|
2375
|
+
children: /* @__PURE__ */ jsx20("span", { className: spanClass, children: day.date.getDate() })
|
|
2376
|
+
}
|
|
2377
|
+
)
|
|
2378
|
+
},
|
|
2379
|
+
day.date.getTime()
|
|
2380
|
+
);
|
|
2381
|
+
}) })
|
|
2382
|
+
] });
|
|
2383
|
+
}
|
|
2384
|
+
return /* @__PURE__ */ jsxs15("div", { className: `bg-background rounded-xl p-4 ${className}`, children: [
|
|
2385
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between mb-3.5", children: [
|
|
2386
|
+
/* @__PURE__ */ jsxs15("div", { className: "relative", ref: monthPickerContainerRef, children: [
|
|
2387
|
+
/* @__PURE__ */ jsxs15(
|
|
2388
|
+
"button",
|
|
2389
|
+
{
|
|
2390
|
+
onClick: toggleMonthPicker,
|
|
2391
|
+
className: "flex items-center gap-2 hover:bg-background-100 rounded px-2 py-1 transition-colors",
|
|
2392
|
+
children: [
|
|
2393
|
+
/* @__PURE__ */ jsxs15("h2", { className: "text-lg font-semibold text-text-950", children: [
|
|
2394
|
+
MONTH_NAMES[currentDate.getMonth()],
|
|
2395
|
+
" ",
|
|
2396
|
+
currentDate.getFullYear()
|
|
2397
|
+
] }),
|
|
2398
|
+
/* @__PURE__ */ jsx20(
|
|
2399
|
+
"svg",
|
|
2400
|
+
{
|
|
2401
|
+
className: `w-4 h-4 text-text-400 transition-transform ${isMonthPickerOpen ? "rotate-180" : ""}`,
|
|
2402
|
+
fill: "none",
|
|
2403
|
+
stroke: "currentColor",
|
|
2404
|
+
viewBox: "0 0 24 24",
|
|
2405
|
+
children: /* @__PURE__ */ jsx20(
|
|
2406
|
+
"path",
|
|
2407
|
+
{
|
|
2408
|
+
strokeLinecap: "round",
|
|
2409
|
+
strokeLinejoin: "round",
|
|
2410
|
+
strokeWidth: 2,
|
|
2411
|
+
d: "M19 9l-7 7-7-7"
|
|
2412
|
+
}
|
|
2413
|
+
)
|
|
2414
|
+
}
|
|
2415
|
+
)
|
|
2416
|
+
]
|
|
2417
|
+
}
|
|
2418
|
+
),
|
|
2419
|
+
isMonthPickerOpen && /* @__PURE__ */ jsx20(
|
|
2420
|
+
MonthYearPicker,
|
|
2421
|
+
{
|
|
2422
|
+
monthPickerRef,
|
|
2423
|
+
availableYears,
|
|
2424
|
+
currentDate,
|
|
2425
|
+
onYearChange: handleYearChange,
|
|
2426
|
+
onMonthChange: goToMonth
|
|
2427
|
+
}
|
|
2428
|
+
)
|
|
2429
|
+
] }),
|
|
2430
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
|
|
2431
|
+
/* @__PURE__ */ jsx20(
|
|
2432
|
+
"button",
|
|
2433
|
+
{
|
|
2434
|
+
onClick: goToPreviousMonth,
|
|
2435
|
+
className: "p-1 rounded-md hover:bg-background-100 transition-colors",
|
|
2436
|
+
"aria-label": "M\xEAs anterior",
|
|
2437
|
+
children: /* @__PURE__ */ jsx20(
|
|
2438
|
+
"svg",
|
|
2439
|
+
{
|
|
2440
|
+
className: "w-6 h-6 text-primary-950",
|
|
2441
|
+
fill: "none",
|
|
2442
|
+
stroke: "currentColor",
|
|
2443
|
+
viewBox: "0 0 24 24",
|
|
2444
|
+
children: /* @__PURE__ */ jsx20(
|
|
2445
|
+
"path",
|
|
2446
|
+
{
|
|
2447
|
+
strokeLinecap: "round",
|
|
2448
|
+
strokeLinejoin: "round",
|
|
2449
|
+
strokeWidth: 2,
|
|
2450
|
+
d: "M15 19l-7-7 7-7"
|
|
2451
|
+
}
|
|
2452
|
+
)
|
|
2453
|
+
}
|
|
2454
|
+
)
|
|
2455
|
+
}
|
|
2456
|
+
),
|
|
2457
|
+
/* @__PURE__ */ jsx20(
|
|
2458
|
+
"button",
|
|
2459
|
+
{
|
|
2460
|
+
onClick: goToNextMonth,
|
|
2461
|
+
className: "p-1 rounded-md hover:bg-background-100 transition-colors",
|
|
2462
|
+
"aria-label": "Pr\xF3ximo m\xEAs",
|
|
2463
|
+
children: /* @__PURE__ */ jsx20(
|
|
2464
|
+
"svg",
|
|
2465
|
+
{
|
|
2466
|
+
className: "w-6 h-6 text-primary-950",
|
|
2467
|
+
fill: "none",
|
|
2468
|
+
stroke: "currentColor",
|
|
2469
|
+
viewBox: "0 0 24 24",
|
|
2470
|
+
children: /* @__PURE__ */ jsx20(
|
|
2471
|
+
"path",
|
|
2472
|
+
{
|
|
2473
|
+
strokeLinecap: "round",
|
|
2474
|
+
strokeLinejoin: "round",
|
|
2475
|
+
strokeWidth: 2,
|
|
2476
|
+
d: "M9 5l7 7-7 7"
|
|
2477
|
+
}
|
|
2478
|
+
)
|
|
2479
|
+
}
|
|
2480
|
+
)
|
|
2481
|
+
}
|
|
2482
|
+
)
|
|
2483
|
+
] })
|
|
2484
|
+
] }),
|
|
2485
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS.map((day) => /* @__PURE__ */ jsx20(
|
|
2486
|
+
"div",
|
|
2487
|
+
{
|
|
2488
|
+
className: "h-4 flex items-center justify-center text-xs font-semibold text-text-500",
|
|
2489
|
+
children: day
|
|
2490
|
+
},
|
|
2491
|
+
day
|
|
2492
|
+
)) }),
|
|
2493
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
|
|
2494
|
+
if (!day.isCurrentMonth) {
|
|
2495
|
+
return /* @__PURE__ */ jsx20(
|
|
2496
|
+
"div",
|
|
2497
|
+
{
|
|
2498
|
+
className: "flex items-center justify-center",
|
|
2499
|
+
children: /* @__PURE__ */ jsx20("div", { className: "w-10 h-10" })
|
|
2500
|
+
},
|
|
2501
|
+
day.date.getTime()
|
|
2502
|
+
);
|
|
2503
|
+
}
|
|
2504
|
+
const { dayStyle, textStyle } = getDayStyles(
|
|
2505
|
+
day,
|
|
2506
|
+
variant,
|
|
2507
|
+
showActivities
|
|
2508
|
+
);
|
|
2509
|
+
return /* @__PURE__ */ jsx20(
|
|
2510
|
+
"div",
|
|
2511
|
+
{
|
|
2512
|
+
className: "flex items-center justify-center",
|
|
2513
|
+
children: /* @__PURE__ */ jsx20(
|
|
2514
|
+
"button",
|
|
2515
|
+
{
|
|
2516
|
+
className: `
|
|
2517
|
+
w-10 h-10
|
|
2518
|
+
flex items-center justify-center
|
|
2519
|
+
text-xl font-normal
|
|
2520
|
+
cursor-pointer
|
|
2521
|
+
rounded-full
|
|
2522
|
+
focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-1
|
|
2523
|
+
${dayStyle}
|
|
2524
|
+
${textStyle}
|
|
2525
|
+
`,
|
|
2526
|
+
onClick: () => handleDateSelect(day),
|
|
2527
|
+
"aria-label": `${day.date.getDate()} de ${MONTH_NAMES[day.date.getMonth()]}`,
|
|
2528
|
+
"aria-current": day.isToday ? "date" : void 0,
|
|
2529
|
+
tabIndex: 0,
|
|
2530
|
+
children: day.date.getDate()
|
|
2531
|
+
}
|
|
2532
|
+
)
|
|
2533
|
+
},
|
|
2534
|
+
day.date.getTime()
|
|
2535
|
+
);
|
|
2536
|
+
}) })
|
|
2537
|
+
] });
|
|
2538
|
+
};
|
|
2539
|
+
var Calendar_default = Calendar;
|
|
2540
|
+
|
|
1745
2541
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1746
2542
|
import { SignOut, User } from "phosphor-react";
|
|
1747
2543
|
import {
|
|
1748
2544
|
forwardRef as forwardRef9,
|
|
1749
|
-
useEffect,
|
|
1750
|
-
useRef,
|
|
2545
|
+
useEffect as useEffect2,
|
|
2546
|
+
useRef as useRef2,
|
|
1751
2547
|
isValidElement,
|
|
1752
2548
|
Children,
|
|
1753
2549
|
cloneElement,
|
|
1754
|
-
useState as
|
|
2550
|
+
useState as useState6
|
|
1755
2551
|
} from "react";
|
|
1756
2552
|
import { create as create2, useStore } from "zustand";
|
|
1757
|
-
import { jsx as
|
|
2553
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1758
2554
|
function createDropdownStore() {
|
|
1759
2555
|
return create2((set) => ({
|
|
1760
2556
|
open: false,
|
|
@@ -1785,7 +2581,7 @@ var injectStore = (children, store) => {
|
|
|
1785
2581
|
});
|
|
1786
2582
|
};
|
|
1787
2583
|
var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
1788
|
-
const storeRef =
|
|
2584
|
+
const storeRef = useRef2(null);
|
|
1789
2585
|
storeRef.current ??= createDropdownStore();
|
|
1790
2586
|
const store = storeRef.current;
|
|
1791
2587
|
const isControlled = open !== void 0;
|
|
@@ -1795,7 +2591,7 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
1795
2591
|
onOpenChange?.(newOpen);
|
|
1796
2592
|
if (!isControlled) store.setState({ open: newOpen });
|
|
1797
2593
|
};
|
|
1798
|
-
const menuRef =
|
|
2594
|
+
const menuRef = useRef2(null);
|
|
1799
2595
|
const handleArrowDownOrArrowUp = (event) => {
|
|
1800
2596
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
1801
2597
|
if (menuContent) {
|
|
@@ -1829,7 +2625,7 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
1829
2625
|
setOpen(false);
|
|
1830
2626
|
}
|
|
1831
2627
|
};
|
|
1832
|
-
|
|
2628
|
+
useEffect2(() => {
|
|
1833
2629
|
onOpenChange?.(currentOpen);
|
|
1834
2630
|
if (currentOpen) {
|
|
1835
2631
|
document.addEventListener("mousedown", handleClickOutside);
|
|
@@ -1840,12 +2636,12 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
1840
2636
|
document.removeEventListener("keydown", handleDownkey);
|
|
1841
2637
|
};
|
|
1842
2638
|
}, [currentOpen]);
|
|
1843
|
-
|
|
2639
|
+
useEffect2(() => {
|
|
1844
2640
|
if (isControlled) {
|
|
1845
2641
|
store.setState({ open });
|
|
1846
2642
|
}
|
|
1847
2643
|
}, []);
|
|
1848
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ jsx21("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
|
|
1849
2645
|
};
|
|
1850
2646
|
var DropdownMenuTrigger = ({
|
|
1851
2647
|
className,
|
|
@@ -1857,7 +2653,7 @@ var DropdownMenuTrigger = ({
|
|
|
1857
2653
|
const store = useDropdownStore(externalStore);
|
|
1858
2654
|
const open = useStore(store, (s) => s.open);
|
|
1859
2655
|
const toggleOpen = () => store.setState({ open: !open });
|
|
1860
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ jsx21(
|
|
1861
2657
|
Button_default,
|
|
1862
2658
|
{
|
|
1863
2659
|
variant: "outline",
|
|
@@ -1894,7 +2690,7 @@ var MENUCONTENT_VARIANT_CLASSES = {
|
|
|
1894
2690
|
profile: "p-6"
|
|
1895
2691
|
};
|
|
1896
2692
|
var MenuLabel = forwardRef9(({ className, inset, store: _store, ...props }, ref) => {
|
|
1897
|
-
return /* @__PURE__ */
|
|
2693
|
+
return /* @__PURE__ */ jsx21(
|
|
1898
2694
|
"div",
|
|
1899
2695
|
{
|
|
1900
2696
|
ref,
|
|
@@ -1917,8 +2713,8 @@ var MenuContent = forwardRef9(
|
|
|
1917
2713
|
}, ref) => {
|
|
1918
2714
|
const store = useDropdownStore(externalStore);
|
|
1919
2715
|
const open = useStore(store, (s) => s.open);
|
|
1920
|
-
const [isVisible, setIsVisible] =
|
|
1921
|
-
|
|
2716
|
+
const [isVisible, setIsVisible] = useState6(open);
|
|
2717
|
+
useEffect2(() => {
|
|
1922
2718
|
if (open) {
|
|
1923
2719
|
setIsVisible(true);
|
|
1924
2720
|
} else {
|
|
@@ -1933,7 +2729,7 @@ var MenuContent = forwardRef9(
|
|
|
1933
2729
|
return `absolute ${vertical} ${horizontal}`;
|
|
1934
2730
|
};
|
|
1935
2731
|
const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
|
|
1936
|
-
return /* @__PURE__ */
|
|
2732
|
+
return /* @__PURE__ */ jsx21(
|
|
1937
2733
|
"div",
|
|
1938
2734
|
{
|
|
1939
2735
|
ref,
|
|
@@ -1992,7 +2788,7 @@ var DropdownMenuItem = forwardRef9(
|
|
|
1992
2788
|
const getVariantProps = () => {
|
|
1993
2789
|
return variant === "profile" ? { "data-variant": "profile" } : {};
|
|
1994
2790
|
};
|
|
1995
|
-
return /* @__PURE__ */
|
|
2791
|
+
return /* @__PURE__ */ jsxs16(
|
|
1996
2792
|
"div",
|
|
1997
2793
|
{
|
|
1998
2794
|
ref,
|
|
@@ -2014,7 +2810,7 @@ var DropdownMenuItem = forwardRef9(
|
|
|
2014
2810
|
...props,
|
|
2015
2811
|
children: [
|
|
2016
2812
|
iconLeft,
|
|
2017
|
-
/* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx21("span", { className: "w-full text-md", children }),
|
|
2018
2814
|
iconRight
|
|
2019
2815
|
]
|
|
2020
2816
|
}
|
|
@@ -2022,7 +2818,7 @@ var DropdownMenuItem = forwardRef9(
|
|
|
2022
2818
|
}
|
|
2023
2819
|
);
|
|
2024
2820
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
2025
|
-
var DropdownMenuSeparator = forwardRef9(({ className, store: _store, ...props }, ref) => /* @__PURE__ */
|
|
2821
|
+
var DropdownMenuSeparator = forwardRef9(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2026
2822
|
"div",
|
|
2027
2823
|
{
|
|
2028
2824
|
ref,
|
|
@@ -2035,7 +2831,7 @@ var ProfileMenuTrigger = forwardRef9(({ className, onClick, store: externalStore
|
|
|
2035
2831
|
const store = useDropdownStore(externalStore);
|
|
2036
2832
|
const open = useStore(store, (s) => s.open);
|
|
2037
2833
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2038
|
-
return /* @__PURE__ */
|
|
2834
|
+
return /* @__PURE__ */ jsx21(
|
|
2039
2835
|
"button",
|
|
2040
2836
|
{
|
|
2041
2837
|
ref,
|
|
@@ -2047,13 +2843,13 @@ var ProfileMenuTrigger = forwardRef9(({ className, onClick, store: externalStore
|
|
|
2047
2843
|
},
|
|
2048
2844
|
"aria-expanded": open,
|
|
2049
2845
|
...props,
|
|
2050
|
-
children: /* @__PURE__ */
|
|
2846
|
+
children: /* @__PURE__ */ jsx21("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ jsx21(User, { className: "text-background-950", size: 18 }) })
|
|
2051
2847
|
}
|
|
2052
2848
|
);
|
|
2053
2849
|
});
|
|
2054
2850
|
ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
|
|
2055
2851
|
var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ...props }, ref) => {
|
|
2056
|
-
return /* @__PURE__ */
|
|
2852
|
+
return /* @__PURE__ */ jsxs16(
|
|
2057
2853
|
"div",
|
|
2058
2854
|
{
|
|
2059
2855
|
ref,
|
|
@@ -2064,10 +2860,10 @@ var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ..
|
|
|
2064
2860
|
`,
|
|
2065
2861
|
...props,
|
|
2066
2862
|
children: [
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsx21("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx21(User, { size: 34, className: "text-background-950" }) }),
|
|
2864
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col ", children: [
|
|
2865
|
+
/* @__PURE__ */ jsx21("p", { className: "text-xl font-bold text-text-950", children: name }),
|
|
2866
|
+
/* @__PURE__ */ jsx21("p", { className: "text-md text-text-600", children: email })
|
|
2071
2867
|
] })
|
|
2072
2868
|
]
|
|
2073
2869
|
}
|
|
@@ -2075,7 +2871,7 @@ var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ..
|
|
|
2075
2871
|
});
|
|
2076
2872
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
2077
2873
|
var ProfileMenuSection = forwardRef9(({ className, children, store: _store, ...props }, ref) => {
|
|
2078
|
-
return /* @__PURE__ */
|
|
2874
|
+
return /* @__PURE__ */ jsx21(
|
|
2079
2875
|
"div",
|
|
2080
2876
|
{
|
|
2081
2877
|
ref,
|
|
@@ -2098,7 +2894,7 @@ var ProfileMenuFooter = ({
|
|
|
2098
2894
|
}) => {
|
|
2099
2895
|
const store = useDropdownStore(externalStore);
|
|
2100
2896
|
const setOpen = useStore(store, (s) => s.setOpen);
|
|
2101
|
-
return /* @__PURE__ */
|
|
2897
|
+
return /* @__PURE__ */ jsxs16(
|
|
2102
2898
|
Button_default,
|
|
2103
2899
|
{
|
|
2104
2900
|
variant: "outline",
|
|
@@ -2110,8 +2906,8 @@ var ProfileMenuFooter = ({
|
|
|
2110
2906
|
},
|
|
2111
2907
|
...props,
|
|
2112
2908
|
children: [
|
|
2113
|
-
/* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ jsx21("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx21(SignOut, {}) }),
|
|
2910
|
+
/* @__PURE__ */ jsx21("span", { children: "Sair" })
|
|
2115
2911
|
]
|
|
2116
2912
|
}
|
|
2117
2913
|
);
|
|
@@ -2122,15 +2918,15 @@ var DropdownMenu_default = DropdownMenu;
|
|
|
2122
2918
|
// src/components/Select/Select.tsx
|
|
2123
2919
|
import { create as create3, useStore as useStore2 } from "zustand";
|
|
2124
2920
|
import {
|
|
2125
|
-
useEffect as
|
|
2126
|
-
useRef as
|
|
2921
|
+
useEffect as useEffect3,
|
|
2922
|
+
useRef as useRef3,
|
|
2127
2923
|
forwardRef as forwardRef10,
|
|
2128
2924
|
isValidElement as isValidElement2,
|
|
2129
2925
|
Children as Children2,
|
|
2130
2926
|
cloneElement as cloneElement2
|
|
2131
2927
|
} from "react";
|
|
2132
2928
|
import { CaretDown, Check as Check3 } from "phosphor-react";
|
|
2133
|
-
import { Fragment as
|
|
2929
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2134
2930
|
var VARIANT_CLASSES4 = {
|
|
2135
2931
|
outlined: "border-2 rounded-sm focus:border-primary-950",
|
|
2136
2932
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -2176,7 +2972,7 @@ function getLabelAsNode(children) {
|
|
|
2176
2972
|
}
|
|
2177
2973
|
const flattened = Children2.toArray(children);
|
|
2178
2974
|
if (flattened.length === 1) return flattened[0];
|
|
2179
|
-
return /* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ jsx22(Fragment3, { children: flattened });
|
|
2180
2976
|
}
|
|
2181
2977
|
var injectStore2 = (children, store) => {
|
|
2182
2978
|
return Children2.map(children, (child) => {
|
|
@@ -2200,10 +2996,10 @@ var Select = ({
|
|
|
2200
2996
|
onValueChange,
|
|
2201
2997
|
size = "small"
|
|
2202
2998
|
}) => {
|
|
2203
|
-
const storeRef =
|
|
2999
|
+
const storeRef = useRef3(null);
|
|
2204
3000
|
storeRef.current ??= createSelectStore();
|
|
2205
3001
|
const store = storeRef.current;
|
|
2206
|
-
const selectRef =
|
|
3002
|
+
const selectRef = useRef3(null);
|
|
2207
3003
|
const { open, setOpen, setValue, value, selectedLabel } = useStore2(
|
|
2208
3004
|
store,
|
|
2209
3005
|
(s) => s
|
|
@@ -2227,13 +3023,13 @@ var Select = ({
|
|
|
2227
3023
|
search(children2);
|
|
2228
3024
|
return found;
|
|
2229
3025
|
};
|
|
2230
|
-
|
|
3026
|
+
useEffect3(() => {
|
|
2231
3027
|
if (!selectedLabel && defaultValue) {
|
|
2232
3028
|
const label = findLabelForValue(children, defaultValue);
|
|
2233
3029
|
if (label) store.setState({ selectedLabel: label });
|
|
2234
3030
|
}
|
|
2235
3031
|
}, [children, defaultValue, selectedLabel]);
|
|
2236
|
-
|
|
3032
|
+
useEffect3(() => {
|
|
2237
3033
|
setValue(currentValue);
|
|
2238
3034
|
const handleClickOutside = (event) => {
|
|
2239
3035
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
@@ -2269,13 +3065,13 @@ var Select = ({
|
|
|
2269
3065
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
2270
3066
|
};
|
|
2271
3067
|
}, [open]);
|
|
2272
|
-
|
|
3068
|
+
useEffect3(() => {
|
|
2273
3069
|
if (onValueChange) {
|
|
2274
3070
|
onValueChange(value);
|
|
2275
3071
|
}
|
|
2276
3072
|
}, [value]);
|
|
2277
3073
|
const sizeClasses = SIZE_CLASSES9[size];
|
|
2278
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ jsx22("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
|
|
2279
3075
|
};
|
|
2280
3076
|
var SelectValue = ({
|
|
2281
3077
|
placeholder,
|
|
@@ -2284,7 +3080,7 @@ var SelectValue = ({
|
|
|
2284
3080
|
const store = useSelectStore(externalStore);
|
|
2285
3081
|
const selectedLabel = useStore2(store, (s) => s.selectedLabel);
|
|
2286
3082
|
const value = useStore2(store, (s) => s.value);
|
|
2287
|
-
return /* @__PURE__ */
|
|
3083
|
+
return /* @__PURE__ */ jsx22("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
|
|
2288
3084
|
};
|
|
2289
3085
|
var SelectTrigger = forwardRef10(
|
|
2290
3086
|
({
|
|
@@ -2299,7 +3095,7 @@ var SelectTrigger = forwardRef10(
|
|
|
2299
3095
|
const open = useStore2(store, (s) => s.open);
|
|
2300
3096
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2301
3097
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
2302
|
-
return /* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ jsxs17(
|
|
2303
3099
|
"button",
|
|
2304
3100
|
{
|
|
2305
3101
|
ref,
|
|
@@ -2318,7 +3114,7 @@ var SelectTrigger = forwardRef10(
|
|
|
2318
3114
|
...props,
|
|
2319
3115
|
children: [
|
|
2320
3116
|
props.children,
|
|
2321
|
-
/* @__PURE__ */
|
|
3117
|
+
/* @__PURE__ */ jsx22(
|
|
2322
3118
|
CaretDown,
|
|
2323
3119
|
{
|
|
2324
3120
|
className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
|
|
@@ -2343,7 +3139,7 @@ var SelectContent = forwardRef10(
|
|
|
2343
3139
|
const open = useStore2(store, (s) => s.open);
|
|
2344
3140
|
if (!open) return null;
|
|
2345
3141
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
2346
|
-
return /* @__PURE__ */
|
|
3142
|
+
return /* @__PURE__ */ jsx22(
|
|
2347
3143
|
"div",
|
|
2348
3144
|
{
|
|
2349
3145
|
role: "menu",
|
|
@@ -2377,7 +3173,7 @@ var SelectItem = forwardRef10(
|
|
|
2377
3173
|
}
|
|
2378
3174
|
props.onClick?.(e);
|
|
2379
3175
|
};
|
|
2380
|
-
return /* @__PURE__ */
|
|
3176
|
+
return /* @__PURE__ */ jsxs17(
|
|
2381
3177
|
"div",
|
|
2382
3178
|
{
|
|
2383
3179
|
role: "menuitem",
|
|
@@ -2397,7 +3193,7 @@ var SelectItem = forwardRef10(
|
|
|
2397
3193
|
tabIndex: disabled ? -1 : 0,
|
|
2398
3194
|
...props,
|
|
2399
3195
|
children: [
|
|
2400
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ jsx22("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ jsx22(Check3, { className: "" }) }),
|
|
2401
3197
|
children
|
|
2402
3198
|
]
|
|
2403
3199
|
}
|
|
@@ -2410,16 +3206,16 @@ var Select_default = Select;
|
|
|
2410
3206
|
// src/components/Menu/Menu.tsx
|
|
2411
3207
|
import { create as create4, useStore as useStore3 } from "zustand";
|
|
2412
3208
|
import {
|
|
2413
|
-
useEffect as
|
|
2414
|
-
useRef as
|
|
3209
|
+
useEffect as useEffect4,
|
|
3210
|
+
useRef as useRef4,
|
|
2415
3211
|
forwardRef as forwardRef11,
|
|
2416
3212
|
isValidElement as isValidElement3,
|
|
2417
3213
|
Children as Children3,
|
|
2418
3214
|
cloneElement as cloneElement3,
|
|
2419
|
-
useState as
|
|
3215
|
+
useState as useState7
|
|
2420
3216
|
} from "react";
|
|
2421
3217
|
import { CaretLeft, CaretRight } from "phosphor-react";
|
|
2422
|
-
import { jsx as
|
|
3218
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2423
3219
|
var createMenuStore = () => create4((set) => ({
|
|
2424
3220
|
value: "",
|
|
2425
3221
|
setValue: (value) => set({ value })
|
|
@@ -2443,19 +3239,19 @@ var Menu = forwardRef11(
|
|
|
2443
3239
|
onValueChange,
|
|
2444
3240
|
...props
|
|
2445
3241
|
}, ref) => {
|
|
2446
|
-
const storeRef =
|
|
3242
|
+
const storeRef = useRef4(null);
|
|
2447
3243
|
storeRef.current ??= createMenuStore();
|
|
2448
3244
|
const store = storeRef.current;
|
|
2449
3245
|
const { setValue, value } = useStore3(store, (s) => s);
|
|
2450
|
-
|
|
3246
|
+
useEffect4(() => {
|
|
2451
3247
|
setValue(propValue ?? defaultValue);
|
|
2452
3248
|
}, [defaultValue, propValue, setValue]);
|
|
2453
|
-
|
|
3249
|
+
useEffect4(() => {
|
|
2454
3250
|
onValueChange?.(value);
|
|
2455
3251
|
}, [value, onValueChange]);
|
|
2456
3252
|
const baseClasses = "w-full flex flex-row items-center gap-2 py-2 px-6";
|
|
2457
3253
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
2458
|
-
return /* @__PURE__ */
|
|
3254
|
+
return /* @__PURE__ */ jsx23(
|
|
2459
3255
|
"ul",
|
|
2460
3256
|
{
|
|
2461
3257
|
ref,
|
|
@@ -2500,7 +3296,7 @@ var MenuItem = forwardRef11(
|
|
|
2500
3296
|
...props
|
|
2501
3297
|
};
|
|
2502
3298
|
const variants = {
|
|
2503
|
-
menu: /* @__PURE__ */
|
|
3299
|
+
menu: /* @__PURE__ */ jsx23(
|
|
2504
3300
|
"li",
|
|
2505
3301
|
{
|
|
2506
3302
|
"data-variant": "menu",
|
|
@@ -2515,7 +3311,7 @@ var MenuItem = forwardRef11(
|
|
|
2515
3311
|
children
|
|
2516
3312
|
}
|
|
2517
3313
|
),
|
|
2518
|
-
menu2: /* @__PURE__ */
|
|
3314
|
+
menu2: /* @__PURE__ */ jsx23(
|
|
2519
3315
|
"li",
|
|
2520
3316
|
{
|
|
2521
3317
|
"data-variant": "menu2",
|
|
@@ -2527,7 +3323,7 @@ var MenuItem = forwardRef11(
|
|
|
2527
3323
|
children
|
|
2528
3324
|
}
|
|
2529
3325
|
),
|
|
2530
|
-
breadcrumb: /* @__PURE__ */
|
|
3326
|
+
breadcrumb: /* @__PURE__ */ jsx23(
|
|
2531
3327
|
"li",
|
|
2532
3328
|
{
|
|
2533
3329
|
"data-variant": "breadcrumb",
|
|
@@ -2538,7 +3334,7 @@ var MenuItem = forwardRef11(
|
|
|
2538
3334
|
${className ?? ""}
|
|
2539
3335
|
`,
|
|
2540
3336
|
...commonProps,
|
|
2541
|
-
children: /* @__PURE__ */
|
|
3337
|
+
children: /* @__PURE__ */ jsx23(
|
|
2542
3338
|
"span",
|
|
2543
3339
|
{
|
|
2544
3340
|
className: `
|
|
@@ -2556,14 +3352,14 @@ var MenuItem = forwardRef11(
|
|
|
2556
3352
|
);
|
|
2557
3353
|
MenuItem.displayName = "MenuItem";
|
|
2558
3354
|
var MenuSeparator = forwardRef11(
|
|
2559
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
3355
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx23(
|
|
2560
3356
|
"li",
|
|
2561
3357
|
{
|
|
2562
3358
|
ref,
|
|
2563
3359
|
"aria-hidden": "true",
|
|
2564
3360
|
className: `[&>svg]:w-4 [&>svg]:h-4 text-text-600 ${className ?? ""}`,
|
|
2565
3361
|
...props,
|
|
2566
|
-
children: children ?? /* @__PURE__ */
|
|
3362
|
+
children: children ?? /* @__PURE__ */ jsx23(CaretRight, {})
|
|
2567
3363
|
}
|
|
2568
3364
|
)
|
|
2569
3365
|
);
|
|
@@ -2582,6 +3378,7 @@ export {
|
|
|
2582
3378
|
Alert_default as Alert,
|
|
2583
3379
|
Badge_default as Badge,
|
|
2584
3380
|
Button_default as Button,
|
|
3381
|
+
Calendar_default as Calendar,
|
|
2585
3382
|
CheckBox_default as CheckBox,
|
|
2586
3383
|
Chips_default as Chips,
|
|
2587
3384
|
Divider_default as Divider,
|