analytica-frontend-lib 1.0.36 → 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/index.js CHANGED
@@ -41,6 +41,7 @@ __export(src_exports, {
41
41
  ProfileMenuSection: () => ProfileMenuSection,
42
42
  ProfileMenuTrigger: () => ProfileMenuTrigger,
43
43
  ProgressBar: () => ProgressBar_default,
44
+ ProgressCircle: () => ProgressCircle_default,
44
45
  Radio: () => Radio_default,
45
46
  Select: () => Select_default,
46
47
  SelectContent: () => SelectContent,
@@ -1643,11 +1644,177 @@ var ProgressBar = ({
1643
1644
  };
1644
1645
  var ProgressBar_default = ProgressBar;
1645
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
+
1646
1813
  // src/components/DropdownMenu/DropdownMenu.tsx
1647
1814
  var import_phosphor_react7 = require("phosphor-react");
1648
1815
  var import_react9 = require("react");
1649
1816
  var import_zustand2 = require("zustand");
1650
- var import_jsx_runtime19 = require("react/jsx-runtime");
1817
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1651
1818
  function createDropdownStore() {
1652
1819
  return (0, import_zustand2.create)((set) => ({
1653
1820
  open: false,
@@ -1738,13 +1905,13 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
1738
1905
  store.setState({ open });
1739
1906
  }
1740
1907
  }, []);
1741
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
1908
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
1742
1909
  };
1743
1910
  var DropdownMenuTrigger = (0, import_react9.forwardRef)(({ className, children, onClick, store: externalStore, ...props }, ref) => {
1744
1911
  const store = useDropdownStore(externalStore);
1745
1912
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
1746
1913
  const toggleOpen = () => store.setState({ open: !open });
1747
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1914
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1748
1915
  "button",
1749
1916
  {
1750
1917
  ref,
@@ -1777,7 +1944,7 @@ var ALIGN_CLASSES = {
1777
1944
  end: "right-0"
1778
1945
  };
1779
1946
  var MenuLabel = (0, import_react9.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
1780
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1947
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1781
1948
  "div",
1782
1949
  {
1783
1950
  ref,
@@ -1814,7 +1981,7 @@ var MenuContent = (0, import_react9.forwardRef)(
1814
1981
  const horizontal = ALIGN_CLASSES[align];
1815
1982
  return `absolute ${vertical} ${horizontal}`;
1816
1983
  };
1817
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1984
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1818
1985
  "div",
1819
1986
  {
1820
1987
  ref,
@@ -1872,7 +2039,7 @@ var MenuItem = (0, import_react9.forwardRef)(
1872
2039
  const getVariantProps = () => {
1873
2040
  return variant === "profile" ? { "data-variant": "profile" } : {};
1874
2041
  };
1875
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2042
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1876
2043
  "div",
1877
2044
  {
1878
2045
  ref,
@@ -1902,7 +2069,7 @@ var MenuItem = (0, import_react9.forwardRef)(
1902
2069
  }
1903
2070
  );
1904
2071
  MenuItem.displayName = "MenuItem";
1905
- var MenuSeparator = (0, import_react9.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2072
+ var MenuSeparator = (0, import_react9.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1906
2073
  "div",
1907
2074
  {
1908
2075
  ref,
@@ -1915,7 +2082,7 @@ var ProfileMenuTrigger = (0, import_react9.forwardRef)(({ className, onClick, st
1915
2082
  const store = useDropdownStore(externalStore);
1916
2083
  const open = (0, import_zustand2.useStore)(store, (s) => s.open);
1917
2084
  const toggleOpen = () => store.setState({ open: !open });
1918
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2085
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1919
2086
  "button",
1920
2087
  {
1921
2088
  ref,
@@ -1927,13 +2094,13 @@ var ProfileMenuTrigger = (0, import_react9.forwardRef)(({ className, onClick, st
1927
2094
  },
1928
2095
  "aria-expanded": open,
1929
2096
  ...props,
1930
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_phosphor_react7.User, { className: "text-background-950", size: 18 }) })
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 }) })
1931
2098
  }
1932
2099
  );
1933
2100
  });
1934
2101
  ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
1935
2102
  var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email, store: _store, ...props }, ref) => {
1936
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2103
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1937
2104
  "div",
1938
2105
  {
1939
2106
  ref,
@@ -1944,10 +2111,10 @@ var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email,
1944
2111
  `,
1945
2112
  ...props,
1946
2113
  children: [
1947
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_phosphor_react7.User, { size: 34, className: "text-background-950" }) }),
1948
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col ", children: [
1949
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xl font-bold text-text-950", children: name }),
1950
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-md text-text-600", children: email })
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 })
1951
2118
  ] })
1952
2119
  ]
1953
2120
  }
@@ -1955,7 +2122,7 @@ var ProfileMenuHeader = (0, import_react9.forwardRef)(({ className, name, email,
1955
2122
  });
1956
2123
  ProfileMenuHeader.displayName = "ProfileMenuHeader";
1957
2124
  var ProfileMenuSection = (0, import_react9.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
1958
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2125
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1959
2126
  "div",
1960
2127
  {
1961
2128
  ref,
@@ -1973,7 +2140,7 @@ var ProfileMenuFooter = (0, import_react9.forwardRef)(
1973
2140
  ({ className, disabled = false, onClick, store: externalStore, ...props }, ref) => {
1974
2141
  const store = useDropdownStore(externalStore);
1975
2142
  const setOpen = (0, import_zustand2.useStore)(store, (s) => s.setOpen);
1976
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2143
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1977
2144
  "button",
1978
2145
  {
1979
2146
  ref,
@@ -1985,8 +2152,8 @@ var ProfileMenuFooter = (0, import_react9.forwardRef)(
1985
2152
  },
1986
2153
  ...props,
1987
2154
  children: [
1988
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_phosphor_react7.SignOut, {}) }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: "Sair" })
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" })
1990
2157
  ]
1991
2158
  }
1992
2159
  );
@@ -1999,13 +2166,13 @@ var DropdownMenu_default = DropdownMenu;
1999
2166
  var import_zustand3 = require("zustand");
2000
2167
  var import_react10 = require("react");
2001
2168
  var import_phosphor_react8 = require("phosphor-react");
2002
- var import_jsx_runtime20 = require("react/jsx-runtime");
2003
- var VARIANT_CLASSES3 = {
2169
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2170
+ var VARIANT_CLASSES4 = {
2004
2171
  outlined: "border-2 rounded-sm focus:border-primary-950",
2005
2172
  underlined: "border-b-2 focus:border-primary-950",
2006
2173
  rounded: "border-2 rounded-4xl focus:border-primary-950"
2007
2174
  };
2008
- var SIZE_CLASSES8 = {
2175
+ var SIZE_CLASSES9 = {
2009
2176
  small: "text-sm",
2010
2177
  medium: "text-md",
2011
2178
  large: "text-lg"
@@ -2045,7 +2212,7 @@ function getLabelAsNode(children) {
2045
2212
  }
2046
2213
  const flattened = import_react10.Children.toArray(children);
2047
2214
  if (flattened.length === 1) return flattened[0];
2048
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: flattened });
2215
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: flattened });
2049
2216
  }
2050
2217
  var injectStore2 = (children, store) => {
2051
2218
  return import_react10.Children.map(children, (child) => {
@@ -2143,8 +2310,8 @@ var Select = ({
2143
2310
  onValueChange(value);
2144
2311
  }
2145
2312
  }, [value]);
2146
- const sizeClasses = SIZE_CLASSES8[size];
2147
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: `relative ${sizeClasses} w-[288px]`, ref: selectRef, children: injectStore2(children, store) });
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) });
2148
2315
  };
2149
2316
  var SelectValue = ({
2150
2317
  placeholder,
@@ -2153,7 +2320,7 @@ var SelectValue = ({
2153
2320
  const store = useSelectStore(externalStore);
2154
2321
  const selectedLabel = (0, import_zustand3.useStore)(store, (s) => s.selectedLabel);
2155
2322
  const value = (0, import_zustand3.useStore)(store, (s) => s.value);
2156
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
2323
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-inherit", children: selectedLabel || placeholder || value });
2157
2324
  };
2158
2325
  var SelectTrigger = (0, import_react10.forwardRef)(
2159
2326
  ({
@@ -2167,8 +2334,8 @@ var SelectTrigger = (0, import_react10.forwardRef)(
2167
2334
  const store = useSelectStore(externalStore);
2168
2335
  const open = (0, import_zustand3.useStore)(store, (s) => s.open);
2169
2336
  const toggleOpen = () => store.setState({ open: !open });
2170
- const variantClasses = VARIANT_CLASSES3[variant];
2171
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2337
+ const variantClasses = VARIANT_CLASSES4[variant];
2338
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2172
2339
  "button",
2173
2340
  {
2174
2341
  ref,
@@ -2186,7 +2353,7 @@ var SelectTrigger = (0, import_react10.forwardRef)(
2186
2353
  ...props,
2187
2354
  children: [
2188
2355
  props.children,
2189
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2356
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2190
2357
  import_phosphor_react8.CaretDown,
2191
2358
  {
2192
2359
  className: `h-[1em] w-[1em] opacity-50 transition-transform ${open ? "rotate-180" : ""}`
@@ -2211,7 +2378,7 @@ var SelectContent = (0, import_react10.forwardRef)(
2211
2378
  const open = (0, import_zustand3.useStore)(store, (s) => s.open);
2212
2379
  if (!open) return null;
2213
2380
  const getPositionClasses = () => `absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
2214
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2381
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2215
2382
  "div",
2216
2383
  {
2217
2384
  role: "menu",
@@ -2245,7 +2412,7 @@ var SelectItem = (0, import_react10.forwardRef)(
2245
2412
  }
2246
2413
  props.onClick?.(e);
2247
2414
  };
2248
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2415
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2249
2416
  "div",
2250
2417
  {
2251
2418
  role: "menuitem",
@@ -2265,7 +2432,7 @@ var SelectItem = (0, import_react10.forwardRef)(
2265
2432
  tabIndex: disabled ? -1 : 0,
2266
2433
  ...props,
2267
2434
  children: [
2268
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react8.Check, { className: "" }) }),
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: "" }) }),
2269
2436
  children
2270
2437
  ]
2271
2438
  }
@@ -2297,6 +2464,7 @@ var Select_default = Select;
2297
2464
  ProfileMenuSection,
2298
2465
  ProfileMenuTrigger,
2299
2466
  ProgressBar,
2467
+ ProgressCircle,
2300
2468
  Radio,
2301
2469
  Select,
2302
2470
  SelectContent,