analytica-frontend-lib 1.0.35 → 1.0.37
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/ProgressBar/index.d.mts +60 -0
- package/dist/ProgressBar/index.d.ts +60 -0
- package/dist/ProgressBar/index.js +220 -0
- package/dist/ProgressBar/index.js.map +1 -0
- package/dist/ProgressBar/index.mjs +198 -0
- package/dist/ProgressBar/index.mjs.map +1 -0
- package/dist/ProgressCircle/index.d.mts +60 -0
- package/dist/ProgressCircle/index.d.ts +60 -0
- package/dist/ProgressCircle/index.js +244 -0
- package/dist/ProgressCircle/index.js.map +1 -0
- package/dist/ProgressCircle/index.mjs +222 -0
- package/dist/ProgressCircle/index.mjs.map +1 -0
- package/dist/Radio/index.d.mts +85 -0
- package/dist/Radio/index.d.ts +85 -0
- package/dist/Radio/index.js +299 -0
- package/dist/Radio/index.js.map +1 -0
- package/dist/Radio/index.mjs +283 -0
- package/dist/Radio/index.mjs.map +1 -0
- package/dist/index.css +244 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +6 -59
- package/dist/index.d.ts +6 -59
- package/dist/index.js +343 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -31
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +244 -0
- package/dist/styles.css.map +1 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,72 +8,19 @@ export { default as NavButton } from './NavButton/index.js';
|
|
|
8
8
|
export { default as SelectionButton } from './SelectionButton/index.js';
|
|
9
9
|
export { default as Table } from './Table/index.js';
|
|
10
10
|
export { default as CheckBox } from './CheckBox/index.js';
|
|
11
|
-
|
|
12
|
-
import { ReactNode, InputHTMLAttributes, HTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
11
|
+
export { default as Radio } from './Radio/index.js';
|
|
13
12
|
export { default as TextArea } from './TextArea/index.js';
|
|
14
13
|
export { default as Toast } from './Toast/index.js';
|
|
15
14
|
export { default as Toaster } from './Toast/Toaster/index.js';
|
|
16
15
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
16
|
+
import * as react from 'react';
|
|
17
|
+
import { HTMLAttributes, ReactNode, InputHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
17
18
|
export { default as useToastStore } from './Toast/ToastStore/index.js';
|
|
19
|
+
export { default as ProgressBar } from './ProgressBar/index.js';
|
|
20
|
+
export { default as ProgressCircle } from './ProgressCircle/index.js';
|
|
18
21
|
export { default as DropdownMenu, DropdownMenuTrigger, MenuContent, MenuItem, MenuLabel, MenuSeparator, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger } from './DropdownMenu/index.js';
|
|
19
22
|
import { StoreApi } from 'zustand';
|
|
20
23
|
|
|
21
|
-
/**
|
|
22
|
-
* Radio size variants
|
|
23
|
-
*/
|
|
24
|
-
type RadioSize = 'small' | 'medium' | 'large' | 'extraLarge';
|
|
25
|
-
/**
|
|
26
|
-
* Radio visual state
|
|
27
|
-
*/
|
|
28
|
-
type RadioState = 'default' | 'hovered' | 'focused' | 'invalid' | 'disabled';
|
|
29
|
-
/**
|
|
30
|
-
* Radio component for Analytica Ensino platforms
|
|
31
|
-
*
|
|
32
|
-
* A radio button component with essential states, sizes and themes.
|
|
33
|
-
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
34
|
-
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```tsx
|
|
38
|
-
* // Basic radio
|
|
39
|
-
* <Radio name="option" value="1" label="Option 1" />
|
|
40
|
-
*
|
|
41
|
-
* // Small size
|
|
42
|
-
* <Radio size="small" name="option" value="2" label="Small option" />
|
|
43
|
-
*
|
|
44
|
-
* // Invalid state
|
|
45
|
-
* <Radio state="invalid" name="option" value="3" label="Required field" />
|
|
46
|
-
*
|
|
47
|
-
* // Disabled state
|
|
48
|
-
* <Radio disabled name="option" value="4" label="Disabled option" />
|
|
49
|
-
*
|
|
50
|
-
* // Default checked (uncontrolled)
|
|
51
|
-
* <Radio defaultChecked name="option" value="5" label="Initially checked" />
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
declare const Radio: react.ForwardRefExoticComponent<{
|
|
55
|
-
/** Label text to display next to the radio */
|
|
56
|
-
label?: ReactNode;
|
|
57
|
-
/** Size variant of the radio */
|
|
58
|
-
size?: RadioSize;
|
|
59
|
-
/** Visual state of the radio */
|
|
60
|
-
state?: RadioState;
|
|
61
|
-
/** Error message to display */
|
|
62
|
-
errorMessage?: string;
|
|
63
|
-
/** Helper text to display */
|
|
64
|
-
helperText?: string;
|
|
65
|
-
/** Additional CSS classes */
|
|
66
|
-
className?: string;
|
|
67
|
-
/** Label CSS classes */
|
|
68
|
-
labelClassName?: string;
|
|
69
|
-
/** Radio group name */
|
|
70
|
-
name?: string;
|
|
71
|
-
/** Radio value */
|
|
72
|
-
value?: string;
|
|
73
|
-
/** Default checked state for uncontrolled radios */
|
|
74
|
-
defaultChecked?: boolean;
|
|
75
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "defaultChecked" | "type"> & react.RefAttributes<HTMLInputElement>>;
|
|
76
|
-
|
|
77
24
|
/**
|
|
78
25
|
* Divider component props interface
|
|
79
26
|
*/
|
|
@@ -204,4 +151,4 @@ interface SelectItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
204
151
|
}
|
|
205
152
|
declare const SelectItem: react.ForwardRefExoticComponent<SelectItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
206
153
|
|
|
207
|
-
export { Chips, Divider, Input,
|
|
154
|
+
export { Chips, Divider, Input, Select, SelectContent, SelectItem, SelectTrigger, SelectValue };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,8 @@ __export(src_exports, {
|
|
|
40
40
|
ProfileMenuHeader: () => ProfileMenuHeader,
|
|
41
41
|
ProfileMenuSection: () => ProfileMenuSection,
|
|
42
42
|
ProfileMenuTrigger: () => ProfileMenuTrigger,
|
|
43
|
+
ProgressBar: () => ProgressBar_default,
|
|
44
|
+
ProgressCircle: () => ProgressCircle_default,
|
|
43
45
|
Radio: () => Radio_default,
|
|
44
46
|
Select: () => Select_default,
|
|
45
47
|
SelectContent: () => SelectContent,
|
|
@@ -1500,11 +1502,319 @@ var Chips = ({
|
|
|
1500
1502
|
};
|
|
1501
1503
|
var Chips_default = Chips;
|
|
1502
1504
|
|
|
1505
|
+
// src/components/ProgressBar/ProgressBar.tsx
|
|
1506
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1507
|
+
var SIZE_CLASSES7 = {
|
|
1508
|
+
small: {
|
|
1509
|
+
container: "h-1",
|
|
1510
|
+
// 4px height (h-1 = 4px in Tailwind)
|
|
1511
|
+
bar: "h-1",
|
|
1512
|
+
// 4px height for the fill bar
|
|
1513
|
+
labelSize: "xs",
|
|
1514
|
+
spacing: "gap-2",
|
|
1515
|
+
// 8px gap between label and progress bar
|
|
1516
|
+
layout: "flex-col",
|
|
1517
|
+
// vertical layout for small
|
|
1518
|
+
borderRadius: "rounded-full"
|
|
1519
|
+
// 9999px border radius
|
|
1520
|
+
},
|
|
1521
|
+
medium: {
|
|
1522
|
+
container: "h-2",
|
|
1523
|
+
// 8px height (h-2 = 8px in Tailwind)
|
|
1524
|
+
bar: "h-2",
|
|
1525
|
+
// 8px height for the fill bar
|
|
1526
|
+
labelSize: "xs",
|
|
1527
|
+
// 12px font size (xs in Tailwind)
|
|
1528
|
+
spacing: "gap-2",
|
|
1529
|
+
// 8px gap between progress bar and label
|
|
1530
|
+
layout: "flex-row items-center",
|
|
1531
|
+
// horizontal layout for medium
|
|
1532
|
+
borderRadius: "rounded-lg"
|
|
1533
|
+
// 8px border radius
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
var VARIANT_CLASSES2 = {
|
|
1537
|
+
blue: {
|
|
1538
|
+
background: "bg-background-300",
|
|
1539
|
+
// Background track color (#D5D4D4)
|
|
1540
|
+
fill: "bg-primary-700"
|
|
1541
|
+
// Blue for activity progress (#2271C4)
|
|
1542
|
+
},
|
|
1543
|
+
green: {
|
|
1544
|
+
background: "bg-background-300",
|
|
1545
|
+
// Background track color (#D5D4D4)
|
|
1546
|
+
fill: "bg-success-200"
|
|
1547
|
+
// Green for performance (#84D3A2)
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
var ProgressBar = ({
|
|
1551
|
+
value,
|
|
1552
|
+
max = 100,
|
|
1553
|
+
size = "medium",
|
|
1554
|
+
variant = "blue",
|
|
1555
|
+
label,
|
|
1556
|
+
showPercentage = false,
|
|
1557
|
+
className = "",
|
|
1558
|
+
labelClassName = "",
|
|
1559
|
+
percentageClassName = ""
|
|
1560
|
+
}) => {
|
|
1561
|
+
const safeValue = isNaN(value) ? 0 : value;
|
|
1562
|
+
const clampedValue = Math.max(0, Math.min(safeValue, max));
|
|
1563
|
+
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
1564
|
+
const sizeClasses = SIZE_CLASSES7[size];
|
|
1565
|
+
const variantClasses = VARIANT_CLASSES2[variant];
|
|
1566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1567
|
+
"div",
|
|
1568
|
+
{
|
|
1569
|
+
className: `flex ${sizeClasses.layout} ${sizeClasses.spacing} ${className}`,
|
|
1570
|
+
children: [
|
|
1571
|
+
size === "small" && (label || showPercentage) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1572
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1573
|
+
Text_default,
|
|
1574
|
+
{
|
|
1575
|
+
as: "div",
|
|
1576
|
+
size: sizeClasses.labelSize,
|
|
1577
|
+
weight: "medium",
|
|
1578
|
+
className: `text-text-950 ${labelClassName}`,
|
|
1579
|
+
children: label
|
|
1580
|
+
}
|
|
1581
|
+
),
|
|
1582
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1583
|
+
Text_default,
|
|
1584
|
+
{
|
|
1585
|
+
size: sizeClasses.labelSize,
|
|
1586
|
+
weight: "medium",
|
|
1587
|
+
className: `text-text-700 text-center ${percentageClassName}`,
|
|
1588
|
+
children: [
|
|
1589
|
+
Math.round(percentage),
|
|
1590
|
+
"%"
|
|
1591
|
+
]
|
|
1592
|
+
}
|
|
1593
|
+
)
|
|
1594
|
+
] }),
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1596
|
+
"div",
|
|
1597
|
+
{
|
|
1598
|
+
className: `${size === "medium" ? "flex-grow" : "w-full"} ${sizeClasses.container} ${variantClasses.background} ${sizeClasses.borderRadius} overflow-hidden relative`,
|
|
1599
|
+
children: [
|
|
1600
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1601
|
+
"progress",
|
|
1602
|
+
{
|
|
1603
|
+
value: clampedValue,
|
|
1604
|
+
max,
|
|
1605
|
+
"aria-label": typeof label === "string" ? label : "Progress",
|
|
1606
|
+
className: "absolute inset-0 w-full h-full opacity-0"
|
|
1607
|
+
}
|
|
1608
|
+
),
|
|
1609
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1610
|
+
"div",
|
|
1611
|
+
{
|
|
1612
|
+
className: `${sizeClasses.bar} ${variantClasses.fill} ${sizeClasses.borderRadius} transition-all duration-300 ease-out shadow-hard-shadow-3`,
|
|
1613
|
+
style: { width: `${percentage}%` }
|
|
1614
|
+
}
|
|
1615
|
+
)
|
|
1616
|
+
]
|
|
1617
|
+
}
|
|
1618
|
+
),
|
|
1619
|
+
size === "medium" && showPercentage && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1620
|
+
Text_default,
|
|
1621
|
+
{
|
|
1622
|
+
size: sizeClasses.labelSize,
|
|
1623
|
+
weight: "medium",
|
|
1624
|
+
className: `text-text-950 text-center flex-none w-[70px] ${percentageClassName}`,
|
|
1625
|
+
children: [
|
|
1626
|
+
Math.round(percentage),
|
|
1627
|
+
"%"
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
),
|
|
1631
|
+
size === "medium" && label && !showPercentage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1632
|
+
Text_default,
|
|
1633
|
+
{
|
|
1634
|
+
as: "div",
|
|
1635
|
+
size: sizeClasses.labelSize,
|
|
1636
|
+
weight: "medium",
|
|
1637
|
+
className: `text-text-950 flex-none ${labelClassName}`,
|
|
1638
|
+
children: label
|
|
1639
|
+
}
|
|
1640
|
+
)
|
|
1641
|
+
]
|
|
1642
|
+
}
|
|
1643
|
+
);
|
|
1644
|
+
};
|
|
1645
|
+
var ProgressBar_default = ProgressBar;
|
|
1646
|
+
|
|
1647
|
+
// src/components/ProgressCircle/ProgressCircle.tsx
|
|
1648
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1649
|
+
var SIZE_CLASSES8 = {
|
|
1650
|
+
small: {
|
|
1651
|
+
container: "w-[90px] h-[90px]",
|
|
1652
|
+
// 90px circle from design specs
|
|
1653
|
+
strokeWidth: 4,
|
|
1654
|
+
// 4px stroke width - matches ProgressBar small (h-1)
|
|
1655
|
+
textSize: "2xl",
|
|
1656
|
+
// 24px for percentage (font-size: 24px)
|
|
1657
|
+
textWeight: "medium",
|
|
1658
|
+
// font-weight: 500
|
|
1659
|
+
labelSize: "2xs",
|
|
1660
|
+
// 10px for status label (closest to 8px design spec)
|
|
1661
|
+
labelWeight: "bold",
|
|
1662
|
+
// font-weight: 700
|
|
1663
|
+
spacing: "gap-1"
|
|
1664
|
+
// 4px gap between percentage and label
|
|
1665
|
+
},
|
|
1666
|
+
medium: {
|
|
1667
|
+
container: "w-[152px] h-[152px]",
|
|
1668
|
+
// 151.67px ≈ 152px circle from design specs
|
|
1669
|
+
strokeWidth: 8,
|
|
1670
|
+
// 8px stroke width - matches ProgressBar medium (h-2)
|
|
1671
|
+
textSize: "2xl",
|
|
1672
|
+
// 24px for percentage (font-size: 24px)
|
|
1673
|
+
textWeight: "medium",
|
|
1674
|
+
// font-weight: 500
|
|
1675
|
+
labelSize: "xs",
|
|
1676
|
+
// 12px for status label (font-size: 12px)
|
|
1677
|
+
labelWeight: "medium",
|
|
1678
|
+
// font-weight: 500 (changed from bold)
|
|
1679
|
+
spacing: "gap-1"
|
|
1680
|
+
// 4px gap between percentage and label
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
var VARIANT_CLASSES3 = {
|
|
1684
|
+
blue: {
|
|
1685
|
+
background: "stroke-primary-100",
|
|
1686
|
+
// Light blue background (#BBDCF7)
|
|
1687
|
+
fill: "stroke-primary-700",
|
|
1688
|
+
// Blue for activity progress (#2271C4)
|
|
1689
|
+
textColor: "text-primary-700",
|
|
1690
|
+
// Blue text color (#2271C4)
|
|
1691
|
+
labelColor: "text-text-700"
|
|
1692
|
+
// Gray text for label (#525252)
|
|
1693
|
+
},
|
|
1694
|
+
green: {
|
|
1695
|
+
background: "stroke-background-300",
|
|
1696
|
+
// Gray background (#D5D4D4 - matches design)
|
|
1697
|
+
fill: "stroke-success-200",
|
|
1698
|
+
// Green for performance (#84D3A2 - matches design)
|
|
1699
|
+
textColor: "text-text-800",
|
|
1700
|
+
// Dark gray text (#404040 - matches design)
|
|
1701
|
+
labelColor: "text-text-600"
|
|
1702
|
+
// Medium gray text for label (#737373 - matches design)
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
var ProgressCircle = ({
|
|
1706
|
+
value,
|
|
1707
|
+
max = 100,
|
|
1708
|
+
size = "small",
|
|
1709
|
+
variant = "blue",
|
|
1710
|
+
label,
|
|
1711
|
+
showPercentage = true,
|
|
1712
|
+
className = "",
|
|
1713
|
+
labelClassName = "",
|
|
1714
|
+
percentageClassName = ""
|
|
1715
|
+
}) => {
|
|
1716
|
+
const safeValue = isNaN(value) ? 0 : value;
|
|
1717
|
+
const clampedValue = Math.max(0, Math.min(safeValue, max));
|
|
1718
|
+
const percentage = max === 0 ? 0 : clampedValue / max * 100;
|
|
1719
|
+
const sizeClasses = SIZE_CLASSES8[size];
|
|
1720
|
+
const variantClasses = VARIANT_CLASSES3[variant];
|
|
1721
|
+
const radius = size === "small" ? 37 : 64;
|
|
1722
|
+
const circumference = 2 * Math.PI * radius;
|
|
1723
|
+
const strokeDashoffset = circumference - percentage / 100 * circumference;
|
|
1724
|
+
const center = size === "small" ? 45 : 76;
|
|
1725
|
+
const svgSize = size === "small" ? 90 : 152;
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1727
|
+
"div",
|
|
1728
|
+
{
|
|
1729
|
+
className: `relative flex flex-col items-center justify-center ${sizeClasses.container} rounded-lg ${className}`,
|
|
1730
|
+
children: [
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1732
|
+
"svg",
|
|
1733
|
+
{
|
|
1734
|
+
className: "absolute inset-0 transform -rotate-90",
|
|
1735
|
+
width: svgSize,
|
|
1736
|
+
height: svgSize,
|
|
1737
|
+
viewBox: `0 0 ${svgSize} ${svgSize}`,
|
|
1738
|
+
"aria-hidden": "true",
|
|
1739
|
+
children: [
|
|
1740
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1741
|
+
"circle",
|
|
1742
|
+
{
|
|
1743
|
+
cx: center,
|
|
1744
|
+
cy: center,
|
|
1745
|
+
r: radius,
|
|
1746
|
+
fill: "none",
|
|
1747
|
+
strokeWidth: sizeClasses.strokeWidth,
|
|
1748
|
+
className: `${variantClasses.background} rounded-lg`
|
|
1749
|
+
}
|
|
1750
|
+
),
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1752
|
+
"circle",
|
|
1753
|
+
{
|
|
1754
|
+
cx: center,
|
|
1755
|
+
cy: center,
|
|
1756
|
+
r: radius,
|
|
1757
|
+
fill: "none",
|
|
1758
|
+
strokeWidth: sizeClasses.strokeWidth,
|
|
1759
|
+
strokeLinecap: "round",
|
|
1760
|
+
strokeDasharray: circumference,
|
|
1761
|
+
strokeDashoffset,
|
|
1762
|
+
className: `${variantClasses.fill} transition-all duration-500 ease-out shadow-soft-shadow-3 rounded-lg`
|
|
1763
|
+
}
|
|
1764
|
+
)
|
|
1765
|
+
]
|
|
1766
|
+
}
|
|
1767
|
+
),
|
|
1768
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1769
|
+
"progress",
|
|
1770
|
+
{
|
|
1771
|
+
value: clampedValue,
|
|
1772
|
+
max,
|
|
1773
|
+
"aria-label": typeof label === "string" ? label : "Progress",
|
|
1774
|
+
className: "absolute opacity-0 w-0 h-0"
|
|
1775
|
+
}
|
|
1776
|
+
),
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1778
|
+
"div",
|
|
1779
|
+
{
|
|
1780
|
+
className: `relative z-10 flex flex-col items-center justify-center ${sizeClasses.spacing}`,
|
|
1781
|
+
children: [
|
|
1782
|
+
showPercentage && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1783
|
+
Text_default,
|
|
1784
|
+
{
|
|
1785
|
+
size: sizeClasses.textSize,
|
|
1786
|
+
weight: sizeClasses.textWeight,
|
|
1787
|
+
className: `text-center ${variantClasses.textColor} ${percentageClassName}`,
|
|
1788
|
+
children: [
|
|
1789
|
+
Math.round(percentage),
|
|
1790
|
+
"%"
|
|
1791
|
+
]
|
|
1792
|
+
}
|
|
1793
|
+
),
|
|
1794
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1795
|
+
Text_default,
|
|
1796
|
+
{
|
|
1797
|
+
as: "span",
|
|
1798
|
+
size: sizeClasses.labelSize,
|
|
1799
|
+
weight: sizeClasses.labelWeight,
|
|
1800
|
+
className: `${variantClasses.labelColor} text-center uppercase tracking-wide ${labelClassName}`,
|
|
1801
|
+
children: label
|
|
1802
|
+
}
|
|
1803
|
+
)
|
|
1804
|
+
]
|
|
1805
|
+
}
|
|
1806
|
+
)
|
|
1807
|
+
]
|
|
1808
|
+
}
|
|
1809
|
+
);
|
|
1810
|
+
};
|
|
1811
|
+
var ProgressCircle_default = ProgressCircle;
|
|
1812
|
+
|
|
1503
1813
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1504
1814
|
var import_phosphor_react7 = require("phosphor-react");
|
|
1505
1815
|
var import_react9 = require("react");
|
|
1506
1816
|
var import_zustand2 = require("zustand");
|
|
1507
|
-
var
|
|
1817
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1508
1818
|
function createDropdownStore() {
|
|
1509
1819
|
return (0, import_zustand2.create)((set) => ({
|
|
1510
1820
|
open: false,
|
|
@@ -1595,13 +1905,13 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
1595
1905
|
store.setState({ open });
|
|
1596
1906
|
}
|
|
1597
1907
|
}, []);
|
|
1598
|
-
return /* @__PURE__ */ (0,
|
|
1908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
|
|
1599
1909
|
};
|
|
1600
1910
|
var DropdownMenuTrigger = (0, import_react9.forwardRef)(({ className, children, onClick, store: externalStore, ...props }, ref) => {
|
|
1601
1911
|
const store = useDropdownStore(externalStore);
|
|
1602
1912
|
const open = (0, import_zustand2.useStore)(store, (s) => s.open);
|
|
1603
1913
|
const toggleOpen = () => store.setState({ open: !open });
|
|
1604
|
-
return /* @__PURE__ */ (0,
|
|
1914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1605
1915
|
"button",
|
|
1606
1916
|
{
|
|
1607
1917
|
ref,
|
|
@@ -1634,7 +1944,7 @@ var ALIGN_CLASSES = {
|
|
|
1634
1944
|
end: "right-0"
|
|
1635
1945
|
};
|
|
1636
1946
|
var MenuLabel = (0, import_react9.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
|
|
1637
|
-
return /* @__PURE__ */ (0,
|
|
1947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1638
1948
|
"div",
|
|
1639
1949
|
{
|
|
1640
1950
|
ref,
|
|
@@ -1671,7 +1981,7 @@ var MenuContent = (0, import_react9.forwardRef)(
|
|
|
1671
1981
|
const horizontal = ALIGN_CLASSES[align];
|
|
1672
1982
|
return `absolute ${vertical} ${horizontal}`;
|
|
1673
1983
|
};
|
|
1674
|
-
return /* @__PURE__ */ (0,
|
|
1984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1675
1985
|
"div",
|
|
1676
1986
|
{
|
|
1677
1987
|
ref,
|
|
@@ -1729,7 +2039,7 @@ var MenuItem = (0, import_react9.forwardRef)(
|
|
|
1729
2039
|
const getVariantProps = () => {
|
|
1730
2040
|
return variant === "profile" ? { "data-variant": "profile" } : {};
|
|
1731
2041
|
};
|
|
1732
|
-
return /* @__PURE__ */ (0,
|
|
2042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1733
2043
|
"div",
|
|
1734
2044
|
{
|
|
1735
2045
|
ref,
|
|
@@ -1759,7 +2069,7 @@ var MenuItem = (0, import_react9.forwardRef)(
|
|
|
1759
2069
|
}
|
|
1760
2070
|
);
|
|
1761
2071
|
MenuItem.displayName = "MenuItem";
|
|
1762
|
-
var MenuSeparator = (0, import_react9.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2072
|
+
var MenuSeparator = (0, import_react9.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1763
2073
|
"div",
|
|
1764
2074
|
{
|
|
1765
2075
|
ref,
|
|
@@ -1772,7 +2082,7 @@ var ProfileMenuTrigger = (0, import_react9.forwardRef)(({ className, onClick, st
|
|
|
1772
2082
|
const store = useDropdownStore(externalStore);
|
|
1773
2083
|
const open = (0, import_zustand2.useStore)(store, (s) => s.open);
|
|
1774
2084
|
const toggleOpen = () => store.setState({ open: !open });
|
|
1775
|
-
return /* @__PURE__ */ (0,
|
|
2085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1776
2086
|
"button",
|
|
1777
2087
|
{
|
|
1778
2088
|
ref,
|
|
@@ -1784,13 +2094,13 @@ var ProfileMenuTrigger = (0, import_react9.forwardRef)(({ className, onClick, st
|
|
|
1784
2094
|
},
|
|
1785
2095
|
"aria-expanded": open,
|
|
1786
2096
|
...props,
|
|
1787
|
-
children: /* @__PURE__ */ (0,
|
|
2097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react7.User, { className: "text-background-950", size: 18 }) })
|
|
1788
2098
|
}
|
|
1789
2099
|
);
|
|
1790
2100
|
});
|
|
1791
2101
|
ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
|
|
1792
2102
|
var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email, store: _store, ...props }, ref) => {
|
|
1793
|
-
return /* @__PURE__ */ (0,
|
|
2103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1794
2104
|
"div",
|
|
1795
2105
|
{
|
|
1796
2106
|
ref,
|
|
@@ -1801,10 +2111,10 @@ var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email,
|
|
|
1801
2111
|
`,
|
|
1802
2112
|
...props,
|
|
1803
2113
|
children: [
|
|
1804
|
-
/* @__PURE__ */ (0,
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react7.User, { size: 34, className: "text-background-950" }) }),
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col ", children: [
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xl font-bold text-text-950", children: name }),
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-md text-text-600", children: email })
|
|
1808
2118
|
] })
|
|
1809
2119
|
]
|
|
1810
2120
|
}
|
|
@@ -1812,7 +2122,7 @@ var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email,
|
|
|
1812
2122
|
});
|
|
1813
2123
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
1814
2124
|
var ProfileMenuSection = (0, import_react9.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
|
|
1815
|
-
return /* @__PURE__ */ (0,
|
|
2125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1816
2126
|
"div",
|
|
1817
2127
|
{
|
|
1818
2128
|
ref,
|
|
@@ -1830,7 +2140,7 @@ var ProfileMenuFooter = (0, import_react9.forwardRef)(
|
|
|
1830
2140
|
({ className, disabled = false, onClick, store: externalStore, ...props }, ref) => {
|
|
1831
2141
|
const store = useDropdownStore(externalStore);
|
|
1832
2142
|
const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
|
|
1833
|
-
return /* @__PURE__ */ (0,
|
|
2143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1834
2144
|
"button",
|
|
1835
2145
|
{
|
|
1836
2146
|
ref,
|
|
@@ -1842,8 +2152,8 @@ var ProfileMenuFooter = (0, import_react9.forwardRef)(
|
|
|
1842
2152
|
},
|
|
1843
2153
|
...props,
|
|
1844
2154
|
children: [
|
|
1845
|
-
/* @__PURE__ */ (0,
|
|
1846
|
-
/* @__PURE__ */ (0,
|
|
2155
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react7.SignOut, {}) }),
|
|
2156
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "Sair" })
|
|
1847
2157
|
]
|
|
1848
2158
|
}
|
|
1849
2159
|
);
|
|
@@ -1856,13 +2166,13 @@ var DropdownMenu_default = DropdownMenu;
|
|
|
1856
2166
|
var import_zustand3 = require("zustand");
|
|
1857
2167
|
var import_react10 = require("react");
|
|
1858
2168
|
var import_phosphor_react8 = require("phosphor-react");
|
|
1859
|
-
var
|
|
1860
|
-
var
|
|
2169
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2170
|
+
var VARIANT_CLASSES4 = {
|
|
1861
2171
|
outlined: "border-2 rounded-sm focus:border-primary-950",
|
|
1862
2172
|
underlined: "border-b-2 focus:border-primary-950",
|
|
1863
2173
|
rounded: "border-2 rounded-4xl focus:border-primary-950"
|
|
1864
2174
|
};
|
|
1865
|
-
var
|
|
2175
|
+
var SIZE_CLASSES9 = {
|
|
1866
2176
|
small: "text-sm",
|
|
1867
2177
|
medium: "text-md",
|
|
1868
2178
|
large: "text-lg"
|
|
@@ -1902,7 +2212,7 @@ function getLabelAsNode(children) {
|
|
|
1902
2212
|
}
|
|
1903
2213
|
const flattened = import_react10.Children.toArray(children);
|
|
1904
2214
|
if (flattened.length === 1) return flattened[0];
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
2215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: flattened });
|
|
1906
2216
|
}
|
|
1907
2217
|
var injectStore2 = (children, store) => {
|
|
1908
2218
|
return import_react10.Children.map(children, (child) => {
|
|
@@ -2000,8 +2310,8 @@ var Select = ({
|
|
|
2000
2310
|
onValueChange(value);
|
|
2001
2311
|
}
|
|
2002
2312
|
}, [value]);
|
|
2003
|
-
const sizeClasses =
|
|
2004
|
-
return /* @__PURE__ */ (0,
|
|
2313
|
+
const sizeClasses = SIZE_CLASSES9[size];
|
|
2314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
|
|
2005
2315
|
};
|
|
2006
2316
|
var SelectValue = ({
|
|
2007
2317
|
placeholder,
|
|
@@ -2010,7 +2320,7 @@ var SelectValue = ({
|
|
|
2010
2320
|
const store = useSelectStore(externalStore);
|
|
2011
2321
|
const selectedLabel = (0, import_zustand3.useStore)(store, (s) => s.selectedLabel);
|
|
2012
2322
|
const value = (0, import_zustand3.useStore)(store, (s) => s.value);
|
|
2013
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
|
|
2014
2324
|
};
|
|
2015
2325
|
var SelectTrigger = (0, import_react10.forwardRef)(
|
|
2016
2326
|
({
|
|
@@ -2024,8 +2334,8 @@ var SelectTrigger = (0, import_react10.forwardRef)(
|
|
|
2024
2334
|
const store = useSelectStore(externalStore);
|
|
2025
2335
|
const open = (0, import_zustand3.useStore)(store, (s) => s.open);
|
|
2026
2336
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2027
|
-
const variantClasses =
|
|
2028
|
-
return /* @__PURE__ */ (0,
|
|
2337
|
+
const variantClasses = VARIANT_CLASSES4[variant];
|
|
2338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2029
2339
|
"button",
|
|
2030
2340
|
{
|
|
2031
2341
|
ref,
|
|
@@ -2043,7 +2353,7 @@ var SelectTrigger = (0, import_react10.forwardRef)(
|
|
|
2043
2353
|
...props,
|
|
2044
2354
|
children: [
|
|
2045
2355
|
props.children,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2047
2357
|
import_phosphor_react8.CaretDown,
|
|
2048
2358
|
{
|
|
2049
2359
|
className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
|
|
@@ -2068,7 +2378,7 @@ var SelectContent = (0, import_react10.forwardRef)(
|
|
|
2068
2378
|
const open = (0, import_zustand3.useStore)(store, (s) => s.open);
|
|
2069
2379
|
if (!open) return null;
|
|
2070
2380
|
const getPositionClasses = () => `absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
2071
|
-
return /* @__PURE__ */ (0,
|
|
2381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2072
2382
|
"div",
|
|
2073
2383
|
{
|
|
2074
2384
|
role: "menu",
|
|
@@ -2102,7 +2412,7 @@ var SelectItem = (0, import_react10.forwardRef)(
|
|
|
2102
2412
|
}
|
|
2103
2413
|
props.onClick?.(e);
|
|
2104
2414
|
};
|
|
2105
|
-
return /* @__PURE__ */ (0,
|
|
2415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2106
2416
|
"div",
|
|
2107
2417
|
{
|
|
2108
2418
|
role: "menuitem",
|
|
@@ -2122,7 +2432,7 @@ var SelectItem = (0, import_react10.forwardRef)(
|
|
|
2122
2432
|
tabIndex: disabled ? -1 : 0,
|
|
2123
2433
|
...props,
|
|
2124
2434
|
children: [
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_phosphor_react8.Check, { className: "" }) }),
|
|
2126
2436
|
children
|
|
2127
2437
|
]
|
|
2128
2438
|
}
|
|
@@ -2153,6 +2463,8 @@ var Select_default = Select;
|
|
|
2153
2463
|
ProfileMenuHeader,
|
|
2154
2464
|
ProfileMenuSection,
|
|
2155
2465
|
ProfileMenuTrigger,
|
|
2466
|
+
ProgressBar,
|
|
2467
|
+
ProgressCircle,
|
|
2156
2468
|
Radio,
|
|
2157
2469
|
Select,
|
|
2158
2470
|
SelectContent,
|