@x-plat/design-system 0.6.0 → 0.7.0

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