analytica-frontend-lib 1.0.35 → 1.0.36

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.mjs CHANGED
@@ -1459,6 +1459,148 @@ var Chips = ({
1459
1459
  };
1460
1460
  var Chips_default = Chips;
1461
1461
 
1462
+ // src/components/ProgressBar/ProgressBar.tsx
1463
+ import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1464
+ var SIZE_CLASSES7 = {
1465
+ small: {
1466
+ container: "h-1",
1467
+ // 4px height (h-1 = 4px in Tailwind)
1468
+ bar: "h-1",
1469
+ // 4px height for the fill bar
1470
+ labelSize: "xs",
1471
+ spacing: "gap-2",
1472
+ // 8px gap between label and progress bar
1473
+ layout: "flex-col",
1474
+ // vertical layout for small
1475
+ borderRadius: "rounded-full"
1476
+ // 9999px border radius
1477
+ },
1478
+ medium: {
1479
+ container: "h-2",
1480
+ // 8px height (h-2 = 8px in Tailwind)
1481
+ bar: "h-2",
1482
+ // 8px height for the fill bar
1483
+ labelSize: "xs",
1484
+ // 12px font size (xs in Tailwind)
1485
+ spacing: "gap-2",
1486
+ // 8px gap between progress bar and label
1487
+ layout: "flex-row items-center",
1488
+ // horizontal layout for medium
1489
+ borderRadius: "rounded-lg"
1490
+ // 8px border radius
1491
+ }
1492
+ };
1493
+ var VARIANT_CLASSES2 = {
1494
+ blue: {
1495
+ background: "bg-background-300",
1496
+ // Background track color (#D5D4D4)
1497
+ fill: "bg-primary-700"
1498
+ // Blue for activity progress (#2271C4)
1499
+ },
1500
+ green: {
1501
+ background: "bg-background-300",
1502
+ // Background track color (#D5D4D4)
1503
+ fill: "bg-success-200"
1504
+ // Green for performance (#84D3A2)
1505
+ }
1506
+ };
1507
+ var ProgressBar = ({
1508
+ value,
1509
+ max = 100,
1510
+ size = "medium",
1511
+ variant = "blue",
1512
+ label,
1513
+ showPercentage = false,
1514
+ className = "",
1515
+ labelClassName = "",
1516
+ percentageClassName = ""
1517
+ }) => {
1518
+ const safeValue = isNaN(value) ? 0 : value;
1519
+ const clampedValue = Math.max(0, Math.min(safeValue, max));
1520
+ const percentage = max === 0 ? 0 : clampedValue / max * 100;
1521
+ const sizeClasses = SIZE_CLASSES7[size];
1522
+ const variantClasses = VARIANT_CLASSES2[variant];
1523
+ return /* @__PURE__ */ jsxs13(
1524
+ "div",
1525
+ {
1526
+ className: `flex ${sizeClasses.layout} ${sizeClasses.spacing} ${className}`,
1527
+ children: [
1528
+ size === "small" && (label || showPercentage) && /* @__PURE__ */ jsxs13("div", { className: "flex flex-row items-center justify-between w-full", children: [
1529
+ label && /* @__PURE__ */ jsx18(
1530
+ Text_default,
1531
+ {
1532
+ as: "div",
1533
+ size: sizeClasses.labelSize,
1534
+ weight: "medium",
1535
+ className: `text-text-950 ${labelClassName}`,
1536
+ children: label
1537
+ }
1538
+ ),
1539
+ showPercentage && /* @__PURE__ */ jsxs13(
1540
+ Text_default,
1541
+ {
1542
+ size: sizeClasses.labelSize,
1543
+ weight: "medium",
1544
+ className: `text-text-700 text-center ${percentageClassName}`,
1545
+ children: [
1546
+ Math.round(percentage),
1547
+ "%"
1548
+ ]
1549
+ }
1550
+ )
1551
+ ] }),
1552
+ /* @__PURE__ */ jsxs13(
1553
+ "div",
1554
+ {
1555
+ className: `${size === "medium" ? "flex-grow" : "w-full"} ${sizeClasses.container} ${variantClasses.background} ${sizeClasses.borderRadius} overflow-hidden relative`,
1556
+ children: [
1557
+ /* @__PURE__ */ jsx18(
1558
+ "progress",
1559
+ {
1560
+ value: clampedValue,
1561
+ max,
1562
+ "aria-label": typeof label === "string" ? label : "Progress",
1563
+ className: "absolute inset-0 w-full h-full opacity-0"
1564
+ }
1565
+ ),
1566
+ /* @__PURE__ */ jsx18(
1567
+ "div",
1568
+ {
1569
+ className: `${sizeClasses.bar} ${variantClasses.fill} ${sizeClasses.borderRadius} transition-all duration-300 ease-out shadow-hard-shadow-3`,
1570
+ style: { width: `${percentage}%` }
1571
+ }
1572
+ )
1573
+ ]
1574
+ }
1575
+ ),
1576
+ size === "medium" && showPercentage && /* @__PURE__ */ jsxs13(
1577
+ Text_default,
1578
+ {
1579
+ size: sizeClasses.labelSize,
1580
+ weight: "medium",
1581
+ className: `text-text-950 text-center flex-none w-[70px] ${percentageClassName}`,
1582
+ children: [
1583
+ Math.round(percentage),
1584
+ "%"
1585
+ ]
1586
+ }
1587
+ ),
1588
+ size === "medium" && label && !showPercentage && /* @__PURE__ */ jsx18(
1589
+ Text_default,
1590
+ {
1591
+ as: "div",
1592
+ size: sizeClasses.labelSize,
1593
+ weight: "medium",
1594
+ className: `text-text-950 flex-none ${labelClassName}`,
1595
+ children: label
1596
+ }
1597
+ )
1598
+ ]
1599
+ }
1600
+ );
1601
+ };
1602
+ var ProgressBar_default = ProgressBar;
1603
+
1462
1604
  // src/components/DropdownMenu/DropdownMenu.tsx
1463
1605
  import { SignOut, User } from "phosphor-react";
1464
1606
  import {
@@ -1471,7 +1613,7 @@ import {
1471
1613
  useState as useState5
1472
1614
  } from "react";
1473
1615
  import { create as create2, useStore } from "zustand";
1474
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1616
+ import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1475
1617
  function createDropdownStore() {
1476
1618
  return create2((set) => ({
1477
1619
  open: false,
@@ -1562,13 +1704,13 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
1562
1704
  store.setState({ open });
1563
1705
  }
1564
1706
  }, []);
1565
- return /* @__PURE__ */ jsx18("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
1707
+ return /* @__PURE__ */ jsx19("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
1566
1708
  };
1567
1709
  var DropdownMenuTrigger = forwardRef9(({ className, children, onClick, store: externalStore, ...props }, ref) => {
1568
1710
  const store = useDropdownStore(externalStore);
1569
1711
  const open = useStore(store, (s) => s.open);
1570
1712
  const toggleOpen = () => store.setState({ open: !open });
1571
- return /* @__PURE__ */ jsx18(
1713
+ return /* @__PURE__ */ jsx19(
1572
1714
  "button",
1573
1715
  {
1574
1716
  ref,
@@ -1601,7 +1743,7 @@ var ALIGN_CLASSES = {
1601
1743
  end: "right-0"
1602
1744
  };
1603
1745
  var MenuLabel = forwardRef9(({ className, inset, store: _store, ...props }, ref) => {
1604
- return /* @__PURE__ */ jsx18(
1746
+ return /* @__PURE__ */ jsx19(
1605
1747
  "div",
1606
1748
  {
1607
1749
  ref,
@@ -1638,7 +1780,7 @@ var MenuContent = forwardRef9(
1638
1780
  const horizontal = ALIGN_CLASSES[align];
1639
1781
  return `absolute ${vertical} ${horizontal}`;
1640
1782
  };
1641
- return /* @__PURE__ */ jsx18(
1783
+ return /* @__PURE__ */ jsx19(
1642
1784
  "div",
1643
1785
  {
1644
1786
  ref,
@@ -1696,7 +1838,7 @@ var MenuItem = forwardRef9(
1696
1838
  const getVariantProps = () => {
1697
1839
  return variant === "profile" ? { "data-variant": "profile" } : {};
1698
1840
  };
1699
- return /* @__PURE__ */ jsxs13(
1841
+ return /* @__PURE__ */ jsxs14(
1700
1842
  "div",
1701
1843
  {
1702
1844
  ref,
@@ -1726,7 +1868,7 @@ var MenuItem = forwardRef9(
1726
1868
  }
1727
1869
  );
1728
1870
  MenuItem.displayName = "MenuItem";
1729
- var MenuSeparator = forwardRef9(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx18(
1871
+ var MenuSeparator = forwardRef9(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx19(
1730
1872
  "div",
1731
1873
  {
1732
1874
  ref,
@@ -1739,7 +1881,7 @@ var ProfileMenuTrigger = forwardRef9(({ className, onClick, store: externalStore
1739
1881
  const store = useDropdownStore(externalStore);
1740
1882
  const open = useStore(store, (s) => s.open);
1741
1883
  const toggleOpen = () => store.setState({ open: !open });
1742
- return /* @__PURE__ */ jsx18(
1884
+ return /* @__PURE__ */ jsx19(
1743
1885
  "button",
1744
1886
  {
1745
1887
  ref,
@@ -1751,13 +1893,13 @@ var ProfileMenuTrigger = forwardRef9(({ className, onClick, store: externalStore
1751
1893
  },
1752
1894
  "aria-expanded": open,
1753
1895
  ...props,
1754
- children: /* @__PURE__ */ jsx18("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ jsx18(User, { className: "text-background-950", size: 18 }) })
1896
+ children: /* @__PURE__ */ jsx19("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ jsx19(User, { className: "text-background-950", size: 18 }) })
1755
1897
  }
1756
1898
  );
1757
1899
  });
1758
1900
  ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
1759
1901
  var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ...props }, ref) => {
1760
- return /* @__PURE__ */ jsxs13(
1902
+ return /* @__PURE__ */ jsxs14(
1761
1903
  "div",
1762
1904
  {
1763
1905
  ref,
@@ -1768,10 +1910,10 @@ var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ..
1768
1910
  `,
1769
1911
  ...props,
1770
1912
  children: [
1771
- /* @__PURE__ */ jsx18("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx18(User, { size: 34, className: "text-background-950" }) }),
1772
- /* @__PURE__ */ jsxs13("div", { className: "flex flex-col ", children: [
1773
- /* @__PURE__ */ jsx18("p", { className: "text-xl font-bold text-text-950", children: name }),
1774
- /* @__PURE__ */ jsx18("p", { className: "text-md text-text-600", children: email })
1913
+ /* @__PURE__ */ jsx19("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx19(User, { size: 34, className: "text-background-950" }) }),
1914
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col ", children: [
1915
+ /* @__PURE__ */ jsx19("p", { className: "text-xl font-bold text-text-950", children: name }),
1916
+ /* @__PURE__ */ jsx19("p", { className: "text-md text-text-600", children: email })
1775
1917
  ] })
1776
1918
  ]
1777
1919
  }
@@ -1779,7 +1921,7 @@ var ProfileMenuHeader = forwardRef9(({ className, name, email, store: _store, ..
1779
1921
  });
1780
1922
  ProfileMenuHeader.displayName = "ProfileMenuHeader";
1781
1923
  var ProfileMenuSection = forwardRef9(({ className, children, store: _store, ...props }, ref) => {
1782
- return /* @__PURE__ */ jsx18(
1924
+ return /* @__PURE__ */ jsx19(
1783
1925
  "div",
1784
1926
  {
1785
1927
  ref,
@@ -1797,7 +1939,7 @@ var ProfileMenuFooter = forwardRef9(
1797
1939
  ({ className, disabled = false, onClick, store: externalStore, ...props }, ref) => {
1798
1940
  const store = useDropdownStore(externalStore);
1799
1941
  const setOpen = useStore(store, (s) => s.setOpen);
1800
- return /* @__PURE__ */ jsxs13(
1942
+ return /* @__PURE__ */ jsxs14(
1801
1943
  "button",
1802
1944
  {
1803
1945
  ref,
@@ -1809,8 +1951,8 @@ var ProfileMenuFooter = forwardRef9(
1809
1951
  },
1810
1952
  ...props,
1811
1953
  children: [
1812
- /* @__PURE__ */ jsx18("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx18(SignOut, {}) }),
1813
- /* @__PURE__ */ jsx18("span", { children: "Sair" })
1954
+ /* @__PURE__ */ jsx19("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx19(SignOut, {}) }),
1955
+ /* @__PURE__ */ jsx19("span", { children: "Sair" })
1814
1956
  ]
1815
1957
  }
1816
1958
  );
@@ -1830,13 +1972,13 @@ import {
1830
1972
  cloneElement as cloneElement2
1831
1973
  } from "react";
1832
1974
  import { CaretDown, Check as Check3 } from "phosphor-react";
1833
- import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
1834
- var VARIANT_CLASSES2 = {
1975
+ import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
1976
+ var VARIANT_CLASSES3 = {
1835
1977
  outlined: "border-2 rounded-sm focus:border-primary-950",
1836
1978
  underlined: "border-b-2 focus:border-primary-950",
1837
1979
  rounded: "border-2 rounded-4xl focus:border-primary-950"
1838
1980
  };
1839
- var SIZE_CLASSES7 = {
1981
+ var SIZE_CLASSES8 = {
1840
1982
  small: "text-sm",
1841
1983
  medium: "text-md",
1842
1984
  large: "text-lg"
@@ -1876,7 +2018,7 @@ function getLabelAsNode(children) {
1876
2018
  }
1877
2019
  const flattened = Children2.toArray(children);
1878
2020
  if (flattened.length === 1) return flattened[0];
1879
- return /* @__PURE__ */ jsx19(Fragment2, { children: flattened });
2021
+ return /* @__PURE__ */ jsx20(Fragment2, { children: flattened });
1880
2022
  }
1881
2023
  var injectStore2 = (children, store) => {
1882
2024
  return Children2.map(children, (child) => {
@@ -1974,8 +2116,8 @@ var Select = ({
1974
2116
  onValueChange(value);
1975
2117
  }
1976
2118
  }, [value]);
1977
- const sizeClasses = SIZE_CLASSES7[size];
1978
- return /* @__PURE__ */ jsx19("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
2119
+ const sizeClasses = SIZE_CLASSES8[size];
2120
+ return /* @__PURE__ */ jsx20("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
1979
2121
  };
1980
2122
  var SelectValue = ({
1981
2123
  placeholder,
@@ -1984,7 +2126,7 @@ var SelectValue = ({
1984
2126
  const store = useSelectStore(externalStore);
1985
2127
  const selectedLabel = useStore2(store, (s) => s.selectedLabel);
1986
2128
  const value = useStore2(store, (s) => s.value);
1987
- return /* @__PURE__ */ jsx19("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
2129
+ return /* @__PURE__ */ jsx20("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
1988
2130
  };
1989
2131
  var SelectTrigger = forwardRef10(
1990
2132
  ({
@@ -1998,8 +2140,8 @@ var SelectTrigger = forwardRef10(
1998
2140
  const store = useSelectStore(externalStore);
1999
2141
  const open = useStore2(store, (s) => s.open);
2000
2142
  const toggleOpen = () => store.setState({ open: !open });
2001
- const variantClasses = VARIANT_CLASSES2[variant];
2002
- return /* @__PURE__ */ jsxs14(
2143
+ const variantClasses = VARIANT_CLASSES3[variant];
2144
+ return /* @__PURE__ */ jsxs15(
2003
2145
  "button",
2004
2146
  {
2005
2147
  ref,
@@ -2017,7 +2159,7 @@ var SelectTrigger = forwardRef10(
2017
2159
  ...props,
2018
2160
  children: [
2019
2161
  props.children,
2020
- /* @__PURE__ */ jsx19(
2162
+ /* @__PURE__ */ jsx20(
2021
2163
  CaretDown,
2022
2164
  {
2023
2165
  className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
@@ -2042,7 +2184,7 @@ var SelectContent = forwardRef10(
2042
2184
  const open = useStore2(store, (s) => s.open);
2043
2185
  if (!open) return null;
2044
2186
  const getPositionClasses = () => `absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
2045
- return /* @__PURE__ */ jsx19(
2187
+ return /* @__PURE__ */ jsx20(
2046
2188
  "div",
2047
2189
  {
2048
2190
  role: "menu",
@@ -2076,7 +2218,7 @@ var SelectItem = forwardRef10(
2076
2218
  }
2077
2219
  props.onClick?.(e);
2078
2220
  };
2079
- return /* @__PURE__ */ jsxs14(
2221
+ return /* @__PURE__ */ jsxs15(
2080
2222
  "div",
2081
2223
  {
2082
2224
  role: "menuitem",
@@ -2096,7 +2238,7 @@ var SelectItem = forwardRef10(
2096
2238
  tabIndex: disabled ? -1 : 0,
2097
2239
  ...props,
2098
2240
  children: [
2099
- /* @__PURE__ */ jsx19("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ jsx19(Check3, { className: "" }) }),
2241
+ /* @__PURE__ */ jsx20("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ jsx20(Check3, { className: "" }) }),
2100
2242
  children
2101
2243
  ]
2102
2244
  }
@@ -2126,6 +2268,7 @@ export {
2126
2268
  ProfileMenuHeader,
2127
2269
  ProfileMenuSection,
2128
2270
  ProfileMenuTrigger,
2271
+ ProgressBar_default as ProgressBar,
2129
2272
  Radio_default as Radio,
2130
2273
  Select_default as Select,
2131
2274
  SelectContent,