@x-plat/design-system 0.6.0 → 0.6.1

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.
@@ -1595,8 +1595,69 @@ var Alert = (props) => {
1595
1595
  Alert.displayName = "Alert";
1596
1596
  var Alert_default = Alert;
1597
1597
 
1598
- // src/components/Avatar/Avatar.tsx
1598
+ // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
1599
+ var import_react2 = __toESM(require("react"), 1);
1599
1600
  var import_jsx_runtime297 = require("react/jsx-runtime");
1601
+ var MAX_HEIGHT = 400;
1602
+ var AutoResizeTextArea = import_react2.default.forwardRef(
1603
+ (props, ref) => {
1604
+ const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
1605
+ const localRef = import_react2.default.useRef(null);
1606
+ const setRefs = (el) => {
1607
+ localRef.current = el;
1608
+ if (!ref) return;
1609
+ if (typeof ref === "function") ref(el);
1610
+ else if (ref && "current" in ref)
1611
+ ref.current = el;
1612
+ };
1613
+ const updateHeight = () => {
1614
+ const el = localRef.current;
1615
+ if (!el) return;
1616
+ el.style.height = "0px";
1617
+ el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
1618
+ };
1619
+ const handleChange = (e) => {
1620
+ if (onChange) {
1621
+ const event = {
1622
+ ...e,
1623
+ target: { value: e.target.value }
1624
+ };
1625
+ onChange(event);
1626
+ }
1627
+ };
1628
+ import_react2.default.useEffect(() => {
1629
+ updateHeight();
1630
+ }, [value]);
1631
+ if (bare) {
1632
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1633
+ "textarea",
1634
+ {
1635
+ ...textareaProps,
1636
+ ref: setRefs,
1637
+ className,
1638
+ disabled,
1639
+ value,
1640
+ onChange: handleChange
1641
+ }
1642
+ );
1643
+ }
1644
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1645
+ "textarea",
1646
+ {
1647
+ ...textareaProps,
1648
+ ref: setRefs,
1649
+ disabled,
1650
+ value,
1651
+ onChange: handleChange
1652
+ }
1653
+ ) }) });
1654
+ }
1655
+ );
1656
+ AutoResizeTextArea.displayName = "AutoResizeTextArea";
1657
+ var AutoResizeTextArea_default = AutoResizeTextArea;
1658
+
1659
+ // src/components/Avatar/Avatar.tsx
1660
+ var import_jsx_runtime298 = require("react/jsx-runtime");
1600
1661
  var CATEGORICAL_COUNT = 8;
1601
1662
  var getColorIndex = (name) => {
1602
1663
  if (!name) return 1;
@@ -1613,13 +1674,13 @@ var Avatar = (props) => {
1613
1674
  const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
1614
1675
  const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
1615
1676
  const catIndex = getColorIndex(name || "");
1616
- return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
1677
+ return /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) }) }) });
1617
1678
  };
1618
1679
  Avatar.displayName = "Avatar";
1619
1680
  var Avatar_default = Avatar;
1620
1681
 
1621
1682
  // src/components/Badge/Badge.tsx
1622
- var import_jsx_runtime298 = require("react/jsx-runtime");
1683
+ var import_jsx_runtime299 = require("react/jsx-runtime");
1623
1684
  var Badge = (props) => {
1624
1685
  const {
1625
1686
  children,
@@ -1631,39 +1692,39 @@ var Badge = (props) => {
1631
1692
  } = props;
1632
1693
  const showBadge = dot || count !== void 0 && count > 0;
1633
1694
  const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
1634
- return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)("div", { className: clsx_default("lib-xplat-badge", size), children: [
1695
+ return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-badge", size), children: [
1635
1696
  children,
1636
- showBadge && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
1697
+ showBadge && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
1637
1698
  ] });
1638
1699
  };
1639
1700
  Badge.displayName = "Badge";
1640
1701
  var Badge_default = Badge;
1641
1702
 
1642
1703
  // src/components/Box/Box.tsx
1643
- var import_jsx_runtime299 = require("react/jsx-runtime");
1704
+ var import_jsx_runtime300 = require("react/jsx-runtime");
1644
1705
  var Box = ({
1645
1706
  children,
1646
1707
  title,
1647
1708
  variant = "outlined",
1648
1709
  padding = "md"
1649
1710
  }) => {
1650
- return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
1651
- title && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-title", children: title }),
1652
- /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-content", children })
1711
+ return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
1712
+ title && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-title", children: title }),
1713
+ /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-content", children })
1653
1714
  ] });
1654
1715
  };
1655
1716
  Box.displayName = "Box";
1656
1717
  var Box_default = Box;
1657
1718
 
1658
1719
  // src/components/Breadcrumb/Breadcrumb.tsx
1659
- var import_jsx_runtime300 = require("react/jsx-runtime");
1720
+ var import_jsx_runtime301 = require("react/jsx-runtime");
1660
1721
  var Breadcrumb = (props) => {
1661
1722
  const { items, separator = "/" } = props;
1662
- return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("ol", { children: items.map((item, index) => {
1723
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("ol", { children: items.map((item, index) => {
1663
1724
  const isLast = index === items.length - 1;
1664
- return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("li", { children: [
1665
- isLast ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
1666
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "separator", children: separator })
1725
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("li", { children: [
1726
+ isLast ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
1727
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "separator", children: separator })
1667
1728
  ] }, index);
1668
1729
  }) }) });
1669
1730
  };
@@ -1671,7 +1732,7 @@ Breadcrumb.displayName = "Breadcrumb";
1671
1732
  var Breadcrumb_default = Breadcrumb;
1672
1733
 
1673
1734
  // src/components/Button/Button.tsx
1674
- var import_jsx_runtime301 = require("react/jsx-runtime");
1735
+ var import_jsx_runtime302 = require("react/jsx-runtime");
1675
1736
  var Button = (props) => {
1676
1737
  const {
1677
1738
  children,
@@ -1680,7 +1741,7 @@ var Button = (props) => {
1680
1741
  disabled,
1681
1742
  ...rest
1682
1743
  } = props;
1683
- return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
1744
+ return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1684
1745
  "button",
1685
1746
  {
1686
1747
  className: clsx_default("lib-xplat-button", type, size),
@@ -1694,15 +1755,15 @@ Button.displayName = "Button";
1694
1755
  var Button_default = Button;
1695
1756
 
1696
1757
  // src/components/Calendar/Calendar.tsx
1697
- var import_react3 = __toESM(require("react"), 1);
1758
+ var import_react4 = __toESM(require("react"), 1);
1698
1759
 
1699
1760
  // src/components/Calendar/useCalendar.ts
1700
- var import_react2 = __toESM(require("react"), 1);
1761
+ var import_react3 = __toESM(require("react"), 1);
1701
1762
  var useCalendar = (initialYear, initialMonth) => {
1702
1763
  const today = /* @__PURE__ */ new Date();
1703
- const [year, setYear] = import_react2.default.useState(initialYear ?? today.getFullYear());
1704
- const [month, setMonth] = import_react2.default.useState(initialMonth ?? today.getMonth());
1705
- const days = import_react2.default.useMemo(() => {
1764
+ const [year, setYear] = import_react3.default.useState(initialYear ?? today.getFullYear());
1765
+ const [month, setMonth] = import_react3.default.useState(initialMonth ?? today.getMonth());
1766
+ const days = import_react3.default.useMemo(() => {
1706
1767
  const firstDay = new Date(year, month, 1);
1707
1768
  const lastDay = new Date(year, month + 1, 0);
1708
1769
  const startDayOfWeek = firstDay.getDay();
@@ -1745,7 +1806,7 @@ var useCalendar = (initialYear, initialMonth) => {
1745
1806
  }
1746
1807
  return result;
1747
1808
  }, [year, month]);
1748
- const goToPrevMonth = import_react2.default.useCallback(() => {
1809
+ const goToPrevMonth = import_react3.default.useCallback(() => {
1749
1810
  setMonth((prev) => {
1750
1811
  if (prev === 0) {
1751
1812
  setYear((y) => y - 1);
@@ -1754,7 +1815,7 @@ var useCalendar = (initialYear, initialMonth) => {
1754
1815
  return prev - 1;
1755
1816
  });
1756
1817
  }, []);
1757
- const goToNextMonth = import_react2.default.useCallback(() => {
1818
+ const goToNextMonth = import_react3.default.useCallback(() => {
1758
1819
  setMonth((prev) => {
1759
1820
  if (prev === 11) {
1760
1821
  setYear((y) => y + 1);
@@ -1763,7 +1824,7 @@ var useCalendar = (initialYear, initialMonth) => {
1763
1824
  return prev + 1;
1764
1825
  });
1765
1826
  }, []);
1766
- const goToToday = import_react2.default.useCallback(() => {
1827
+ const goToToday = import_react3.default.useCallback(() => {
1767
1828
  setYear(today.getFullYear());
1768
1829
  setMonth(today.getMonth());
1769
1830
  }, []);
@@ -1797,8 +1858,8 @@ var MONTH_LABELS = {
1797
1858
  };
1798
1859
 
1799
1860
  // src/components/Calendar/Calendar.tsx
1800
- var import_jsx_runtime302 = require("react/jsx-runtime");
1801
- var DayCell = import_react3.default.memo(
1861
+ var import_jsx_runtime303 = require("react/jsx-runtime");
1862
+ var DayCell = import_react4.default.memo(
1802
1863
  ({
1803
1864
  day,
1804
1865
  disabled,
@@ -1809,7 +1870,7 @@ var DayCell = import_react3.default.memo(
1809
1870
  onEventClick
1810
1871
  }) => {
1811
1872
  if (renderDay) {
1812
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1873
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
1813
1874
  "div",
1814
1875
  {
1815
1876
  className: clsx_default(
@@ -1826,7 +1887,7 @@ var DayCell = import_react3.default.memo(
1826
1887
  }
1827
1888
  );
1828
1889
  }
1829
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
1890
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
1830
1891
  "div",
1831
1892
  {
1832
1893
  className: clsx_default(
@@ -1842,13 +1903,13 @@ var DayCell = import_react3.default.memo(
1842
1903
  if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1843
1904
  },
1844
1905
  children: [
1845
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("span", { className: "calendar-day-number", children: day.day }),
1846
- dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-day-events", children: [
1847
- dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
1906
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "calendar-day-number", children: day.day }),
1907
+ dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-day-events", children: [
1908
+ dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
1848
1909
  "span",
1849
1910
  {
1850
1911
  className: "calendar-event-dot",
1851
- style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
1912
+ style: { backgroundColor: event.color ?? "var(--semantic-surface-brand-default)" },
1852
1913
  title: event.label,
1853
1914
  onClick: (e) => {
1854
1915
  e.stopPropagation();
@@ -1857,7 +1918,7 @@ var DayCell = import_react3.default.memo(
1857
1918
  },
1858
1919
  ei
1859
1920
  )),
1860
- dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("span", { className: "calendar-event-more", children: [
1921
+ dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("span", { className: "calendar-event-more", children: [
1861
1922
  "+",
1862
1923
  dayEvents.length - 3
1863
1924
  ] })
@@ -1894,14 +1955,14 @@ var Calendar = (props) => {
1894
1955
  setYear,
1895
1956
  setMonth
1896
1957
  } = useCalendar(yearProp, monthProp);
1897
- const [pickerMode, setPickerMode] = import_react3.default.useState("days");
1898
- const [yearRangeStart, setYearRangeStart] = import_react3.default.useState(
1958
+ const [pickerMode, setPickerMode] = import_react4.default.useState("days");
1959
+ const [yearRangeStart, setYearRangeStart] = import_react4.default.useState(
1899
1960
  Math.floor(year / 12) * 12
1900
1961
  );
1901
- import_react3.default.useEffect(() => {
1962
+ import_react4.default.useEffect(() => {
1902
1963
  if (yearProp !== void 0) setYear(yearProp);
1903
1964
  }, [yearProp, setYear]);
1904
- import_react3.default.useEffect(() => {
1965
+ import_react4.default.useEffect(() => {
1905
1966
  if (monthProp !== void 0) setMonth(monthProp);
1906
1967
  }, [monthProp, setMonth]);
1907
1968
  const handlePrev = () => {
@@ -1953,15 +2014,15 @@ var Calendar = (props) => {
1953
2014
  setPickerMode("months");
1954
2015
  onMonthChange?.(y, month);
1955
2016
  };
1956
- const minTime = import_react3.default.useMemo(
2017
+ const minTime = import_react4.default.useMemo(
1957
2018
  () => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
1958
2019
  [minDate]
1959
2020
  );
1960
- const maxTime = import_react3.default.useMemo(
2021
+ const maxTime = import_react4.default.useMemo(
1961
2022
  () => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
1962
2023
  [maxDate]
1963
2024
  );
1964
- const eventsMap = import_react3.default.useMemo(() => {
2025
+ const eventsMap = import_react4.default.useMemo(() => {
1965
2026
  const map = /* @__PURE__ */ new Map();
1966
2027
  for (const e of events) {
1967
2028
  const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
@@ -1971,28 +2032,28 @@ var Calendar = (props) => {
1971
2032
  }
1972
2033
  return map;
1973
2034
  }, [events]);
1974
- const getEventsForDay = import_react3.default.useCallback(
2035
+ const getEventsForDay = import_react4.default.useCallback(
1975
2036
  (date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
1976
2037
  [eventsMap]
1977
2038
  );
1978
2039
  const weekdays = WEEKDAY_LABELS[locale];
1979
2040
  const monthLabels = MONTH_LABELS[locale];
1980
2041
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
1981
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
2042
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
1982
2043
  "div",
1983
2044
  {
1984
2045
  className: "lib-xplat-calendar",
1985
2046
  style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
1986
2047
  children: [
1987
- /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-header", children: [
1988
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronLeftIcon_default, {}) }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
1990
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronRightIcon_default, {}) }),
1991
- showToday && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
2048
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-header", children: [
2049
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronLeftIcon_default, {}) }),
2050
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
2051
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(ChevronRightIcon_default, {}) }),
2052
+ showToday && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
1992
2053
  ] }),
1993
- pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
2054
+ pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
1994
2055
  const y = yearRangeStart + i;
1995
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2056
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
1996
2057
  "button",
1997
2058
  {
1998
2059
  type: "button",
@@ -2003,7 +2064,7 @@ var Calendar = (props) => {
2003
2064
  y
2004
2065
  );
2005
2066
  }) }),
2006
- pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2067
+ pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2007
2068
  "button",
2008
2069
  {
2009
2070
  type: "button",
@@ -2013,8 +2074,8 @@ var Calendar = (props) => {
2013
2074
  },
2014
2075
  i
2015
2076
  )) }),
2016
- pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(import_jsx_runtime302.Fragment, { children: [
2017
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2077
+ pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(import_jsx_runtime303.Fragment, { children: [
2078
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2018
2079
  "div",
2019
2080
  {
2020
2081
  className: clsx_default(
@@ -2026,12 +2087,12 @@ var Calendar = (props) => {
2026
2087
  },
2027
2088
  label
2028
2089
  )) }),
2029
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
2090
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
2030
2091
  const dayEvents = getEventsForDay(day.date);
2031
2092
  const t = day.date.getTime();
2032
2093
  const disabled = t < minTime || t > maxTime;
2033
2094
  const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
2034
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
2095
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2035
2096
  DayCell,
2036
2097
  {
2037
2098
  day,
@@ -2054,13 +2115,13 @@ Calendar.displayName = "Calendar";
2054
2115
  var Calendar_default = Calendar;
2055
2116
 
2056
2117
  // src/components/CardTab/CardTab.tsx
2057
- var import_react4 = __toESM(require("react"), 1);
2118
+ var import_react5 = __toESM(require("react"), 1);
2058
2119
 
2059
2120
  // src/components/CardTab/CardTabPanel.tsx
2060
- var import_jsx_runtime303 = require("react/jsx-runtime");
2121
+ var import_jsx_runtime304 = require("react/jsx-runtime");
2061
2122
  var CardTabPanel = (props) => {
2062
2123
  const { children, columns = 3 } = props;
2063
- return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
2124
+ return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
2064
2125
  "div",
2065
2126
  {
2066
2127
  className: "card-tab-panel",
@@ -2073,7 +2134,7 @@ CardTabPanel.displayName = "CardTab.Panel";
2073
2134
  var CardTabPanel_default = CardTabPanel;
2074
2135
 
2075
2136
  // src/components/CardTab/CardTab.tsx
2076
- var import_jsx_runtime304 = require("react/jsx-runtime");
2137
+ var import_jsx_runtime305 = require("react/jsx-runtime");
2077
2138
  var CardTabRoot = (props) => {
2078
2139
  const {
2079
2140
  tabs,
@@ -2083,7 +2144,7 @@ var CardTabRoot = (props) => {
2083
2144
  children
2084
2145
  } = props;
2085
2146
  const isControlled = activeValueProp !== void 0;
2086
- const [uncontrolledValue, setUncontrolledValue] = import_react4.default.useState(tabs[0]?.value ?? "");
2147
+ const [uncontrolledValue, setUncontrolledValue] = import_react5.default.useState(tabs[0]?.value ?? "");
2087
2148
  const activeValue = isControlled ? activeValueProp : uncontrolledValue;
2088
2149
  const handleTabClick = (tab) => {
2089
2150
  if (!isControlled) {
@@ -2091,16 +2152,16 @@ var CardTabRoot = (props) => {
2091
2152
  }
2092
2153
  onChange?.(tab);
2093
2154
  };
2094
- const panels = import_react4.default.Children.toArray(children).filter(
2095
- (child) => import_react4.default.isValidElement(child) && child.type === CardTabPanel_default
2155
+ const panels = import_react5.default.Children.toArray(children).filter(
2156
+ (child) => import_react5.default.isValidElement(child) && child.type === CardTabPanel_default
2096
2157
  );
2097
2158
  const activePanel = panels.find(
2098
2159
  (panel) => panel.props.value === activeValue
2099
2160
  );
2100
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
2101
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
2161
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
2162
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
2102
2163
  const isActive2 = tab.value === activeValue;
2103
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
2164
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2104
2165
  "button",
2105
2166
  {
2106
2167
  className: clsx_default("card-tab-trigger", isActive2 && "active"),
@@ -2112,7 +2173,7 @@ var CardTabRoot = (props) => {
2112
2173
  tab.value
2113
2174
  );
2114
2175
  }) }),
2115
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-body", children: activePanel })
2176
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
2116
2177
  ] });
2117
2178
  };
2118
2179
  CardTabRoot.displayName = "CardTab";
@@ -2122,8 +2183,8 @@ var CardTab = Object.assign(CardTabRoot, {
2122
2183
  var CardTab_default = CardTab;
2123
2184
 
2124
2185
  // src/components/Chart/Chart.tsx
2125
- var import_react5 = __toESM(require("react"), 1);
2126
- var import_jsx_runtime305 = require("react/jsx-runtime");
2186
+ var import_react6 = __toESM(require("react"), 1);
2187
+ var import_jsx_runtime306 = require("react/jsx-runtime");
2127
2188
  var CATEGORICAL_COUNT2 = 8;
2128
2189
  var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
2129
2190
  const n = i + 1;
@@ -2168,8 +2229,8 @@ var toSmoothPath = (points) => {
2168
2229
  return d;
2169
2230
  };
2170
2231
  var useChartSize = (ref) => {
2171
- const [size, setSize] = import_react5.default.useState({ width: 0, height: 0 });
2172
- import_react5.default.useEffect(() => {
2232
+ const [size, setSize] = import_react6.default.useState({ width: 0, height: 0 });
2233
+ import_react6.default.useEffect(() => {
2173
2234
  const el = ref.current;
2174
2235
  if (!el) return;
2175
2236
  let rafId = 0;
@@ -2195,10 +2256,10 @@ var useChartSize = (ref) => {
2195
2256
  };
2196
2257
  var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2197
2258
  var useChartAnimation = (containerRef, dataKey) => {
2198
- const [animate, setAnimate] = import_react5.default.useState(false);
2199
- const prevDataKey = import_react5.default.useRef(dataKey);
2200
- const hasAnimated = import_react5.default.useRef(false);
2201
- import_react5.default.useEffect(() => {
2259
+ const [animate, setAnimate] = import_react6.default.useState(false);
2260
+ const prevDataKey = import_react6.default.useRef(dataKey);
2261
+ const hasAnimated = import_react6.default.useRef(false);
2262
+ import_react6.default.useEffect(() => {
2202
2263
  if (prefersReducedMotion()) return;
2203
2264
  const el = containerRef.current;
2204
2265
  if (!el) return;
@@ -2214,7 +2275,7 @@ var useChartAnimation = (containerRef, dataKey) => {
2214
2275
  observer.observe(el);
2215
2276
  return () => observer.disconnect();
2216
2277
  }, [containerRef]);
2217
- import_react5.default.useEffect(() => {
2278
+ import_react6.default.useEffect(() => {
2218
2279
  if (dataKey !== prevDataKey.current) {
2219
2280
  prevDataKey.current = dataKey;
2220
2281
  if (prefersReducedMotion()) return;
@@ -2228,15 +2289,15 @@ var useChartAnimation = (containerRef, dataKey) => {
2228
2289
  };
2229
2290
  var TOOLTIP_OFFSET = 12;
2230
2291
  var useChartTooltip = (enabled) => {
2231
- const [tooltip, setTooltip] = import_react5.default.useState({
2292
+ const [tooltip, setTooltip] = import_react6.default.useState({
2232
2293
  visible: false,
2233
2294
  x: 0,
2234
2295
  y: 0,
2235
2296
  content: ""
2236
2297
  });
2237
- const containerRef = import_react5.default.useRef(null);
2238
- const rafRef = import_react5.default.useRef(0);
2239
- const move = import_react5.default.useCallback((e) => {
2298
+ const containerRef = import_react6.default.useRef(null);
2299
+ const rafRef = import_react6.default.useRef(0);
2300
+ const move = import_react6.default.useCallback((e) => {
2240
2301
  if (!enabled) return;
2241
2302
  const cx = e.clientX;
2242
2303
  const cy = e.clientY;
@@ -2247,24 +2308,24 @@ var useChartTooltip = (enabled) => {
2247
2308
  setTooltip((prev) => ({ ...prev, x: cx - rect.left, y: cy - rect.top }));
2248
2309
  });
2249
2310
  }, [enabled]);
2250
- const show = import_react5.default.useCallback((e, content) => {
2311
+ const show = import_react6.default.useCallback((e, content) => {
2251
2312
  if (!enabled) return;
2252
2313
  const rect = containerRef.current?.getBoundingClientRect();
2253
2314
  if (!rect) return;
2254
2315
  setTooltip({ visible: true, x: e.clientX - rect.left, y: e.clientY - rect.top, content });
2255
2316
  }, [enabled]);
2256
- const hide = import_react5.default.useCallback(() => {
2317
+ const hide = import_react6.default.useCallback(() => {
2257
2318
  cancelAnimationFrame(rafRef.current);
2258
2319
  setTooltip((prev) => ({ ...prev, visible: false }));
2259
2320
  }, []);
2260
2321
  return { tooltip, show, hide, move, containerRef };
2261
2322
  };
2262
- var GridLines = import_react5.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
2323
+ var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
2263
2324
  const y = PADDING.top + (1 - ratio) * chartH;
2264
2325
  const val = Math.round(maxVal * ratio);
2265
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2266
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
2267
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
2326
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2327
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
2328
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
2268
2329
  ] }, ratio);
2269
2330
  }) }));
2270
2331
  GridLines.displayName = "GridLines";
@@ -2274,18 +2335,18 @@ var getLabelStep = (count, chartW) => {
2274
2335
  if (count <= maxLabels) return 1;
2275
2336
  return Math.ceil(count / maxLabels);
2276
2337
  };
2277
- var AxisLabels = import_react5.default.memo(({ labels, count, chartW, height }) => {
2338
+ var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
2278
2339
  const step = getLabelStep(count, chartW);
2279
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: labels.map((label, i) => {
2340
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
2280
2341
  if (i % step !== 0) return null;
2281
2342
  const x = PADDING.left + i / (count - 1 || 1) * chartW;
2282
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2343
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2283
2344
  }) });
2284
2345
  });
2285
2346
  AxisLabels.displayName = "AxisLabels";
2286
2347
  var useCrosshair = (seriesPoints, entries, labels, chartH) => {
2287
- const [activeIndex, setActiveIndex] = import_react5.default.useState(null);
2288
- const handleMouseMove = import_react5.default.useCallback((e) => {
2348
+ const [activeIndex, setActiveIndex] = import_react6.default.useState(null);
2349
+ const handleMouseMove = import_react6.default.useCallback((e) => {
2289
2350
  const svg = e.currentTarget;
2290
2351
  const rect = svg.getBoundingClientRect();
2291
2352
  const mx = (e.clientX - rect.left) / rect.width * svg.viewBox.baseVal.width;
@@ -2304,17 +2365,17 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
2304
2365
  }
2305
2366
  setActiveIndex(minDist <= threshold ? closest : null);
2306
2367
  }, [seriesPoints]);
2307
- const handleMouseLeave = import_react5.default.useCallback(() => {
2368
+ const handleMouseLeave = import_react6.default.useCallback(() => {
2308
2369
  setActiveIndex(null);
2309
2370
  }, []);
2310
- const tooltipContent = import_react5.default.useMemo(() => {
2371
+ const tooltipContent = import_react6.default.useMemo(() => {
2311
2372
  if (activeIndex === null) return "";
2312
2373
  return entries.map(([key], di) => {
2313
2374
  const p = seriesPoints[di]?.[activeIndex];
2314
2375
  return p ? `${key}: ${p.v}` : "";
2315
2376
  }).filter(Boolean).join(" / ");
2316
2377
  }, [activeIndex, entries, seriesPoints]);
2317
- const getTooltipAt = import_react5.default.useCallback((idx) => {
2378
+ const getTooltipAt = import_react6.default.useCallback((idx) => {
2318
2379
  return entries.map(([key], di) => {
2319
2380
  const p = seriesPoints[di]?.[idx];
2320
2381
  return p ? `${key}: ${p.v}` : "";
@@ -2322,16 +2383,16 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
2322
2383
  }, [entries, seriesPoints]);
2323
2384
  return { activeIndex, handleMouseMove, handleMouseLeave, tooltipContent, getTooltipAt };
2324
2385
  };
2325
- var LineChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2326
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
2327
- const maxVal = import_react5.default.useMemo(() => {
2386
+ var LineChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2387
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
2388
+ const maxVal = import_react6.default.useMemo(() => {
2328
2389
  const allValues = entries.flatMap(([, v]) => v);
2329
2390
  return Math.max(...allValues) * 1.2 || 1;
2330
2391
  }, [entries]);
2331
2392
  const count = labels.length;
2332
2393
  const chartW = width - PADDING.left - PADDING.right;
2333
2394
  const chartH = height - PADDING.top - PADDING.bottom;
2334
- const seriesPoints = import_react5.default.useMemo(
2395
+ const seriesPoints = import_react6.default.useMemo(
2335
2396
  () => entries.map(
2336
2397
  ([, values]) => values.map((v, i) => ({
2337
2398
  x: PADDING.left + i / (count - 1 || 1) * chartW,
@@ -2341,9 +2402,9 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2341
2402
  ),
2342
2403
  [entries, count, chartW, chartH, maxVal]
2343
2404
  );
2344
- const clipRef = import_react5.default.useRef(null);
2405
+ const clipRef = import_react6.default.useRef(null);
2345
2406
  const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
2346
- import_react5.default.useEffect(() => {
2407
+ import_react6.default.useEffect(() => {
2347
2408
  if (!animate || !clipRef.current) return;
2348
2409
  clipRef.current.setAttribute("width", "0");
2349
2410
  requestAnimationFrame(() => {
@@ -2355,7 +2416,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2355
2416
  }, [animate, width]);
2356
2417
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
2357
2418
  const lineClipId = "line-area-clip";
2358
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2419
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2359
2420
  "svg",
2360
2421
  {
2361
2422
  viewBox: `0 0 ${width} ${height}`,
@@ -2373,9 +2434,9 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2373
2434
  onLeave();
2374
2435
  },
2375
2436
  children: [
2376
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2377
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2378
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
2437
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2438
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2439
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
2379
2440
  entries.map(([key], di) => {
2380
2441
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2381
2442
  const color = palette[2];
@@ -2384,16 +2445,16 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2384
2445
  const gradientId = `line-gradient-${di}`;
2385
2446
  const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
2386
2447
  const areaD = `M ${points[0].x},${points[0].y} ${points.map((p) => `L ${p.x},${p.y}`).join(" ")} L ${points[points.length - 1].x},${PADDING.top + chartH} L ${points[0].x},${PADDING.top + chartH} Z`;
2387
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2388
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2389
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
2390
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
2448
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2449
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2450
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
2451
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
2391
2452
  ] }) }),
2392
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
2393
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
2394
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
2453
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
2454
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
2455
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
2395
2456
  ] }),
2396
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2457
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2397
2458
  "circle",
2398
2459
  {
2399
2460
  cx: points[activeIndex].x,
@@ -2405,7 +2466,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2405
2466
  )
2406
2467
  ] }, di);
2407
2468
  }),
2408
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2469
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2409
2470
  "line",
2410
2471
  {
2411
2472
  x1: activeX,
@@ -2415,7 +2476,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2415
2476
  className: "chart-crosshair"
2416
2477
  }
2417
2478
  ),
2418
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2479
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2419
2480
  "rect",
2420
2481
  {
2421
2482
  x: PADDING.left,
@@ -2431,16 +2492,16 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
2431
2492
  );
2432
2493
  });
2433
2494
  LineChart.displayName = "LineChart";
2434
- var CurveChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2435
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
2436
- const maxVal = import_react5.default.useMemo(() => {
2495
+ var CurveChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2496
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
2497
+ const maxVal = import_react6.default.useMemo(() => {
2437
2498
  const allValues = entries.flatMap(([, v]) => v);
2438
2499
  return Math.max(...allValues) * 1.2 || 1;
2439
2500
  }, [entries]);
2440
2501
  const count = labels.length;
2441
2502
  const chartW = width - PADDING.left - PADDING.right;
2442
2503
  const chartH = height - PADDING.top - PADDING.bottom;
2443
- const seriesPoints = import_react5.default.useMemo(
2504
+ const seriesPoints = import_react6.default.useMemo(
2444
2505
  () => entries.map(
2445
2506
  ([, values]) => values.map((v, i) => ({
2446
2507
  x: PADDING.left + i / (count - 1 || 1) * chartW,
@@ -2450,9 +2511,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2450
2511
  ),
2451
2512
  [entries, count, chartW, chartH, maxVal]
2452
2513
  );
2453
- const curveClipRef = import_react5.default.useRef(null);
2514
+ const curveClipRef = import_react6.default.useRef(null);
2454
2515
  const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
2455
- import_react5.default.useEffect(() => {
2516
+ import_react6.default.useEffect(() => {
2456
2517
  if (!animate || !curveClipRef.current) return;
2457
2518
  curveClipRef.current.setAttribute("width", "0");
2458
2519
  requestAnimationFrame(() => {
@@ -2464,7 +2525,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2464
2525
  }, [animate, width]);
2465
2526
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
2466
2527
  const curveClipId = "curve-area-clip";
2467
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2528
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2468
2529
  "svg",
2469
2530
  {
2470
2531
  viewBox: `0 0 ${width} ${height}`,
@@ -2483,9 +2544,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2483
2544
  onLeave();
2484
2545
  },
2485
2546
  children: [
2486
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2487
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2488
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
2547
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
2548
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2549
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
2489
2550
  entries.map(([key], di) => {
2490
2551
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2491
2552
  const color = palette[2];
@@ -2494,16 +2555,16 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2494
2555
  const gradientId = `curve-gradient-${di}`;
2495
2556
  const linePath = toSmoothPath(points);
2496
2557
  const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
2497
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
2498
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2499
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
2500
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
2558
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
2559
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
2560
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
2561
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
2501
2562
  ] }) }),
2502
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
2503
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
2504
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
2563
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
2564
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
2565
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
2505
2566
  ] }),
2506
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2567
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2507
2568
  "circle",
2508
2569
  {
2509
2570
  cx: points[activeIndex].x,
@@ -2515,7 +2576,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2515
2576
  )
2516
2577
  ] }, di);
2517
2578
  }),
2518
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2579
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2519
2580
  "line",
2520
2581
  {
2521
2582
  x1: activeX,
@@ -2525,7 +2586,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2525
2586
  className: "chart-crosshair"
2526
2587
  }
2527
2588
  ),
2528
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2589
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2529
2590
  "rect",
2530
2591
  {
2531
2592
  x: PADDING.left,
@@ -2541,9 +2602,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
2541
2602
  );
2542
2603
  });
2543
2604
  CurveChart.displayName = "CurveChart";
2544
- var BarChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2545
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
2546
- const maxVal = import_react5.default.useMemo(() => {
2605
+ var BarChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
2606
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
2607
+ const maxVal = import_react6.default.useMemo(() => {
2547
2608
  const allValues = entries.flatMap(([, v]) => v);
2548
2609
  return Math.max(...allValues) * 1.2 || 1;
2549
2610
  }, [entries]);
@@ -2555,7 +2616,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
2555
2616
  const barGap = groupCount > 1 ? 2 : 0;
2556
2617
  const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
2557
2618
  const baseline = PADDING.top + chartH;
2558
- const bars = import_react5.default.useMemo(
2619
+ const bars = import_react6.default.useMemo(
2559
2620
  () => entries.map(
2560
2621
  ([, values], di) => values.map((v, i) => {
2561
2622
  const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
@@ -2568,11 +2629,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
2568
2629
  [entries, maxVal, chartH, groupW, barW, barGap, groupCount]
2569
2630
  );
2570
2631
  const barLabelStep = getLabelStep(count, chartW);
2571
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
2572
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
2632
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
2633
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
2573
2634
  labels.map((label, i) => {
2574
2635
  if (i % barLabelStep !== 0) return null;
2575
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2636
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
2576
2637
  }),
2577
2638
  entries.map(([key], di) => {
2578
2639
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
@@ -2581,7 +2642,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
2581
2642
  const r2 = Math.min(4, b.w / 2);
2582
2643
  const d = b.h <= r2 ? `M ${b.x} ${b.y + b.h} V ${b.y} H ${b.x + b.w} V ${b.y + b.h} Z` : `M ${b.x} ${b.y + b.h} V ${b.y + r2} Q ${b.x} ${b.y} ${b.x + r2} ${b.y} H ${b.x + b.w - r2} Q ${b.x + b.w} ${b.y} ${b.x + b.w} ${b.y + r2} V ${b.y + b.h} Z`;
2583
2644
  const delay = 100 + i * 80;
2584
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2585
2646
  "path",
2586
2647
  {
2587
2648
  d,
@@ -2602,11 +2663,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
2602
2663
  ] });
2603
2664
  });
2604
2665
  BarChart.displayName = "BarChart";
2605
- var PieDonutChart = import_react5.default.memo(
2666
+ var PieDonutChart = import_react6.default.memo(
2606
2667
  ({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
2607
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
2608
- const values = import_react5.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
2609
- const total = import_react5.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
2668
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
2669
+ const values = import_react6.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
2670
+ const total = import_react6.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
2610
2671
  const size = Math.min(width, height);
2611
2672
  const cx = size / 2;
2612
2673
  const cy = size / 2;
@@ -2614,10 +2675,10 @@ var PieDonutChart = import_react5.default.memo(
2614
2675
  const innerR = isDoughnut ? r2 * 0.5 : 0;
2615
2676
  const firstKey = entries[0]?.[0] ?? "";
2616
2677
  const colorOffset = hashString(firstKey);
2617
- const maskRef = import_react5.default.useRef(null);
2678
+ const maskRef = import_react6.default.useRef(null);
2618
2679
  const maskR = r2 + 10;
2619
2680
  const maskCircumference = 2 * Math.PI * maskR;
2620
- import_react5.default.useEffect(() => {
2681
+ import_react6.default.useEffect(() => {
2621
2682
  if (!animate || !maskRef.current) return;
2622
2683
  const el = maskRef.current;
2623
2684
  el.style.strokeDasharray = `${maskCircumference}`;
@@ -2627,7 +2688,7 @@ var PieDonutChart = import_react5.default.memo(
2627
2688
  el.style.strokeDashoffset = "0";
2628
2689
  });
2629
2690
  }, [animate, maskCircumference]);
2630
- const sliceData = import_react5.default.useMemo(() => {
2691
+ const sliceData = import_react6.default.useMemo(() => {
2631
2692
  let angle0 = -Math.PI / 2;
2632
2693
  let cumulativeAngle = 0;
2633
2694
  return values.map((v, i) => {
@@ -2661,8 +2722,8 @@ var PieDonutChart = import_react5.default.memo(
2661
2722
  });
2662
2723
  }, [values, total, cx, cy, r2, innerR, labels]);
2663
2724
  const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
2664
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
2665
- animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2725
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
2726
+ animate && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2666
2727
  "circle",
2667
2728
  {
2668
2729
  ref: maskRef,
@@ -2675,7 +2736,7 @@ var PieDonutChart = import_react5.default.memo(
2675
2736
  transform: `rotate(-90 ${cx} ${cy})`
2676
2737
  }
2677
2738
  ) }) }),
2678
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
2739
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2679
2740
  "path",
2680
2741
  {
2681
2742
  d: s.d,
@@ -2691,9 +2752,9 @@ var PieDonutChart = import_react5.default.memo(
2691
2752
  );
2692
2753
  PieDonutChart.displayName = "PieDonutChart";
2693
2754
  var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, children }) => {
2694
- const ref = import_react5.default.useRef(null);
2695
- const [pos, setPos] = import_react5.default.useState({ left: 0, top: 0 });
2696
- import_react5.default.useLayoutEffect(() => {
2755
+ const ref = import_react6.default.useRef(null);
2756
+ const [pos, setPos] = import_react6.default.useState({ left: 0, top: 0 });
2757
+ import_react6.default.useLayoutEffect(() => {
2697
2758
  const el = ref.current;
2698
2759
  if (!el) return;
2699
2760
  const w = el.offsetWidth;
@@ -2710,15 +2771,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
2710
2771
  const sepIdx = content.indexOf(" \u2014 ");
2711
2772
  const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
2712
2773
  const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
2713
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
2774
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
2714
2775
  "div",
2715
2776
  {
2716
2777
  ref,
2717
2778
  className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
2718
2779
  style: { left: pos.left, top: pos.top },
2719
2780
  children: [
2720
- title && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-title", children: title }),
2721
- desc && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-desc", children: desc })
2781
+ title && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-title", children: title }),
2782
+ desc && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-desc", children: desc })
2722
2783
  ]
2723
2784
  }
2724
2785
  );
@@ -2730,14 +2791,14 @@ var ChartLegend = ({ data, labels, type }) => {
2730
2791
  const total = values.reduce((a, b) => a + b, 0) || 1;
2731
2792
  const firstKey = entries[0]?.[0] ?? "";
2732
2793
  const colorOffset = hashString(firstKey);
2733
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
2794
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
2734
2795
  const pct = Math.round(v / total * 100);
2735
2796
  const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
2736
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
2737
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2738
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
2739
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
2740
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("span", { className: "chart-legend-value", children: [
2797
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
2798
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2799
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
2800
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
2801
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("span", { className: "chart-legend-value", children: [
2741
2802
  v.toLocaleString(),
2742
2803
  "(",
2743
2804
  pct,
@@ -2747,103 +2808,42 @@ var ChartLegend = ({ data, labels, type }) => {
2747
2808
  ] }, i);
2748
2809
  }) });
2749
2810
  }
2750
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
2811
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
2751
2812
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
2752
2813
  const color = palette[2];
2753
2814
  const values = entries[di][1];
2754
2815
  const sum = values.reduce((a, b) => a + b, 0);
2755
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
2756
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2757
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
2758
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: key }),
2759
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
2816
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
2817
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
2818
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
2819
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: key }),
2820
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
2760
2821
  ] })
2761
2822
  ] }, di);
2762
2823
  }) });
2763
2824
  };
2764
- var Chart = import_react5.default.memo((props) => {
2825
+ var Chart = import_react6.default.memo((props) => {
2765
2826
  const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
2766
2827
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
2767
2828
  const { width, height } = useChartSize(containerRef);
2768
- const stableData = import_react5.default.useMemo(() => data, [JSON.stringify(data)]);
2769
- const stableLabels = import_react5.default.useMemo(() => labels, [JSON.stringify(labels)]);
2770
- const dataKey = import_react5.default.useMemo(() => JSON.stringify(labels), [labels]);
2829
+ const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
2830
+ const stableLabels = import_react6.default.useMemo(() => labels, [JSON.stringify(labels)]);
2831
+ const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
2771
2832
  const animate = useChartAnimation(containerRef, dataKey);
2772
2833
  const ready = width > 0 && height > 0;
2773
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
2774
- ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2775
- ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2776
- ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2777
- ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2778
- ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
2779
- ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
2780
- tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
2834
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
2835
+ ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2836
+ ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2837
+ ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2838
+ ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
2839
+ ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
2840
+ ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
2841
+ tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
2781
2842
  ] });
2782
2843
  });
2783
2844
  Chart.displayName = "Chart";
2784
2845
  var Chart_default = Chart;
2785
2846
 
2786
- // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
2787
- var import_react6 = __toESM(require("react"), 1);
2788
- var import_jsx_runtime306 = require("react/jsx-runtime");
2789
- var MAX_HEIGHT = 400;
2790
- var AutoResizeTextArea = import_react6.default.forwardRef(
2791
- (props, ref) => {
2792
- const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
2793
- const localRef = import_react6.default.useRef(null);
2794
- const setRefs = (el) => {
2795
- localRef.current = el;
2796
- if (!ref) return;
2797
- if (typeof ref === "function") ref(el);
2798
- else if (ref && "current" in ref)
2799
- ref.current = el;
2800
- };
2801
- const updateHeight = () => {
2802
- const el = localRef.current;
2803
- if (!el) return;
2804
- el.style.height = "0px";
2805
- el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
2806
- };
2807
- const handleChange = (e) => {
2808
- if (onChange) {
2809
- const event = {
2810
- ...e,
2811
- target: { value: e.target.value }
2812
- };
2813
- onChange(event);
2814
- }
2815
- };
2816
- import_react6.default.useEffect(() => {
2817
- updateHeight();
2818
- }, [value]);
2819
- if (bare) {
2820
- return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2821
- "textarea",
2822
- {
2823
- ...textareaProps,
2824
- ref: setRefs,
2825
- className,
2826
- disabled,
2827
- value,
2828
- onChange: handleChange
2829
- }
2830
- );
2831
- }
2832
- return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
2833
- "textarea",
2834
- {
2835
- ...textareaProps,
2836
- ref: setRefs,
2837
- disabled,
2838
- value,
2839
- onChange: handleChange
2840
- }
2841
- ) }) });
2842
- }
2843
- );
2844
- AutoResizeTextArea.displayName = "AutoResizeTextArea";
2845
- var AutoResizeTextArea_default = AutoResizeTextArea;
2846
-
2847
2847
  // src/components/ChatInput/ChatInput.tsx
2848
2848
  var import_react7 = __toESM(require("react"), 1);
2849
2849
 
@@ -5368,12 +5368,12 @@ var Select_default = Select;
5368
5368
  // src/components/Skeleton/Skeleton.tsx
5369
5369
  var import_jsx_runtime337 = require("react/jsx-runtime");
5370
5370
  var SIZE_MAP = {
5371
- xs: "var(--spacing-size-1)",
5372
- sm: "var(--spacing-size-2)",
5373
- md: "var(--spacing-size-4)",
5374
- lg: "var(--spacing-size-8)",
5375
- xl: "var(--spacing-size-12)",
5376
- "2xl": "var(--spacing-size-16)",
5371
+ xs: "var(--spacing-space-1)",
5372
+ sm: "var(--spacing-space-2)",
5373
+ md: "var(--spacing-space-4)",
5374
+ lg: "var(--spacing-space-8)",
5375
+ xl: "var(--spacing-space-12)",
5376
+ "2xl": "var(--spacing-space-16)",
5377
5377
  full: "100%"
5378
5378
  };
5379
5379
  var Skeleton = (props) => {