@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
package/dist/index.cjs CHANGED
@@ -200,6 +200,7 @@ __export(index_exports, {
200
200
  HelpCircleIcon: () => HelpCircleIcon_default,
201
201
  HexagonIcon: () => HexagonIcon_default,
202
202
  HomeIcon: () => HomeIcon_default,
203
+ HtmlTypeWriter: () => HtmlTypeWriter_default,
203
204
  HtmlTypewriter: () => HtmlTypeWriter_default,
204
205
  IconButton: () => IconButton_default,
205
206
  ImageIcon: () => ImageIcon_default,
@@ -5993,8 +5994,69 @@ var Alert = (props) => {
5993
5994
  Alert.displayName = "Alert";
5994
5995
  var Alert_default = Alert;
5995
5996
 
5996
- // src/components/Avatar/Avatar.tsx
5997
+ // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
5998
+ var import_react2 = __toESM(require("react"), 1);
5997
5999
  var import_jsx_runtime297 = require("react/jsx-runtime");
6000
+ var MAX_HEIGHT = 400;
6001
+ var AutoResizeTextArea = import_react2.default.forwardRef(
6002
+ (props, ref) => {
6003
+ const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
6004
+ const localRef = import_react2.default.useRef(null);
6005
+ const setRefs = (el) => {
6006
+ localRef.current = el;
6007
+ if (!ref) return;
6008
+ if (typeof ref === "function") ref(el);
6009
+ else if (ref && "current" in ref)
6010
+ ref.current = el;
6011
+ };
6012
+ const updateHeight = () => {
6013
+ const el = localRef.current;
6014
+ if (!el) return;
6015
+ el.style.height = "0px";
6016
+ el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
6017
+ };
6018
+ const handleChange = (e) => {
6019
+ if (onChange) {
6020
+ const event = {
6021
+ ...e,
6022
+ target: { value: e.target.value }
6023
+ };
6024
+ onChange(event);
6025
+ }
6026
+ };
6027
+ import_react2.default.useEffect(() => {
6028
+ updateHeight();
6029
+ }, [value]);
6030
+ if (bare) {
6031
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
6032
+ "textarea",
6033
+ {
6034
+ ...textareaProps,
6035
+ ref: setRefs,
6036
+ className,
6037
+ disabled,
6038
+ value,
6039
+ onChange: handleChange
6040
+ }
6041
+ );
6042
+ }
6043
+ 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)(
6044
+ "textarea",
6045
+ {
6046
+ ...textareaProps,
6047
+ ref: setRefs,
6048
+ disabled,
6049
+ value,
6050
+ onChange: handleChange
6051
+ }
6052
+ ) }) });
6053
+ }
6054
+ );
6055
+ AutoResizeTextArea.displayName = "AutoResizeTextArea";
6056
+ var AutoResizeTextArea_default = AutoResizeTextArea;
6057
+
6058
+ // src/components/Avatar/Avatar.tsx
6059
+ var import_jsx_runtime298 = require("react/jsx-runtime");
5998
6060
  var CATEGORICAL_COUNT = 8;
5999
6061
  var getColorIndex = (name) => {
6000
6062
  if (!name) return 1;
@@ -6011,13 +6073,13 @@ var Avatar = (props) => {
6011
6073
  const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
6012
6074
  const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
6013
6075
  const catIndex = getColorIndex(name || "");
6014
- 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" }) }) }) });
6076
+ 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" }) }) }) });
6015
6077
  };
6016
6078
  Avatar.displayName = "Avatar";
6017
6079
  var Avatar_default = Avatar;
6018
6080
 
6019
6081
  // src/components/Badge/Badge.tsx
6020
- var import_jsx_runtime298 = require("react/jsx-runtime");
6082
+ var import_jsx_runtime299 = require("react/jsx-runtime");
6021
6083
  var Badge = (props) => {
6022
6084
  const {
6023
6085
  children,
@@ -6029,39 +6091,39 @@ var Badge = (props) => {
6029
6091
  } = props;
6030
6092
  const showBadge = dot || count !== void 0 && count > 0;
6031
6093
  const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
6032
- return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)("div", { className: clsx_default("lib-xplat-badge", size), children: [
6094
+ return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-badge", size), children: [
6033
6095
  children,
6034
- showBadge && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
6096
+ showBadge && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
6035
6097
  ] });
6036
6098
  };
6037
6099
  Badge.displayName = "Badge";
6038
6100
  var Badge_default = Badge;
6039
6101
 
6040
6102
  // src/components/Box/Box.tsx
6041
- var import_jsx_runtime299 = require("react/jsx-runtime");
6103
+ var import_jsx_runtime300 = require("react/jsx-runtime");
6042
6104
  var Box = ({
6043
6105
  children,
6044
6106
  title,
6045
6107
  variant = "outlined",
6046
6108
  padding = "md"
6047
6109
  }) => {
6048
- return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
6049
- title && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-title", children: title }),
6050
- /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-content", children })
6110
+ return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
6111
+ title && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-title", children: title }),
6112
+ /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "box-content", children })
6051
6113
  ] });
6052
6114
  };
6053
6115
  Box.displayName = "Box";
6054
6116
  var Box_default = Box;
6055
6117
 
6056
6118
  // src/components/Breadcrumb/Breadcrumb.tsx
6057
- var import_jsx_runtime300 = require("react/jsx-runtime");
6119
+ var import_jsx_runtime301 = require("react/jsx-runtime");
6058
6120
  var Breadcrumb = (props) => {
6059
6121
  const { items, separator = "/" } = props;
6060
- 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) => {
6122
+ 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) => {
6061
6123
  const isLast = index === items.length - 1;
6062
- return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("li", { children: [
6063
- 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 }),
6064
- !isLast && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "separator", children: separator })
6124
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("li", { children: [
6125
+ 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 }),
6126
+ !isLast && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "separator", children: separator })
6065
6127
  ] }, index);
6066
6128
  }) }) });
6067
6129
  };
@@ -6069,7 +6131,7 @@ Breadcrumb.displayName = "Breadcrumb";
6069
6131
  var Breadcrumb_default = Breadcrumb;
6070
6132
 
6071
6133
  // src/components/Button/Button.tsx
6072
- var import_jsx_runtime301 = require("react/jsx-runtime");
6134
+ var import_jsx_runtime302 = require("react/jsx-runtime");
6073
6135
  var Button = (props) => {
6074
6136
  const {
6075
6137
  children,
@@ -6078,7 +6140,7 @@ var Button = (props) => {
6078
6140
  disabled,
6079
6141
  ...rest
6080
6142
  } = props;
6081
- return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6143
+ return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6082
6144
  "button",
6083
6145
  {
6084
6146
  className: clsx_default("lib-xplat-button", type, size),
@@ -6092,15 +6154,15 @@ Button.displayName = "Button";
6092
6154
  var Button_default = Button;
6093
6155
 
6094
6156
  // src/components/Calendar/Calendar.tsx
6095
- var import_react3 = __toESM(require("react"), 1);
6157
+ var import_react4 = __toESM(require("react"), 1);
6096
6158
 
6097
6159
  // src/components/Calendar/useCalendar.ts
6098
- var import_react2 = __toESM(require("react"), 1);
6160
+ var import_react3 = __toESM(require("react"), 1);
6099
6161
  var useCalendar = (initialYear, initialMonth) => {
6100
6162
  const today = /* @__PURE__ */ new Date();
6101
- const [year, setYear] = import_react2.default.useState(initialYear ?? today.getFullYear());
6102
- const [month, setMonth] = import_react2.default.useState(initialMonth ?? today.getMonth());
6103
- const days = import_react2.default.useMemo(() => {
6163
+ const [year, setYear] = import_react3.default.useState(initialYear ?? today.getFullYear());
6164
+ const [month, setMonth] = import_react3.default.useState(initialMonth ?? today.getMonth());
6165
+ const days = import_react3.default.useMemo(() => {
6104
6166
  const firstDay = new Date(year, month, 1);
6105
6167
  const lastDay = new Date(year, month + 1, 0);
6106
6168
  const startDayOfWeek = firstDay.getDay();
@@ -6143,7 +6205,7 @@ var useCalendar = (initialYear, initialMonth) => {
6143
6205
  }
6144
6206
  return result;
6145
6207
  }, [year, month]);
6146
- const goToPrevMonth = import_react2.default.useCallback(() => {
6208
+ const goToPrevMonth = import_react3.default.useCallback(() => {
6147
6209
  setMonth((prev) => {
6148
6210
  if (prev === 0) {
6149
6211
  setYear((y) => y - 1);
@@ -6152,7 +6214,7 @@ var useCalendar = (initialYear, initialMonth) => {
6152
6214
  return prev - 1;
6153
6215
  });
6154
6216
  }, []);
6155
- const goToNextMonth = import_react2.default.useCallback(() => {
6217
+ const goToNextMonth = import_react3.default.useCallback(() => {
6156
6218
  setMonth((prev) => {
6157
6219
  if (prev === 11) {
6158
6220
  setYear((y) => y + 1);
@@ -6161,7 +6223,7 @@ var useCalendar = (initialYear, initialMonth) => {
6161
6223
  return prev + 1;
6162
6224
  });
6163
6225
  }, []);
6164
- const goToToday = import_react2.default.useCallback(() => {
6226
+ const goToToday = import_react3.default.useCallback(() => {
6165
6227
  setYear(today.getFullYear());
6166
6228
  setMonth(today.getMonth());
6167
6229
  }, []);
@@ -6195,8 +6257,8 @@ var MONTH_LABELS = {
6195
6257
  };
6196
6258
 
6197
6259
  // src/components/Calendar/Calendar.tsx
6198
- var import_jsx_runtime302 = require("react/jsx-runtime");
6199
- var DayCell = import_react3.default.memo(
6260
+ var import_jsx_runtime303 = require("react/jsx-runtime");
6261
+ var DayCell = import_react4.default.memo(
6200
6262
  ({
6201
6263
  day,
6202
6264
  disabled,
@@ -6207,7 +6269,7 @@ var DayCell = import_react3.default.memo(
6207
6269
  onEventClick
6208
6270
  }) => {
6209
6271
  if (renderDay) {
6210
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6272
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6211
6273
  "div",
6212
6274
  {
6213
6275
  className: clsx_default(
@@ -6224,7 +6286,7 @@ var DayCell = import_react3.default.memo(
6224
6286
  }
6225
6287
  );
6226
6288
  }
6227
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
6289
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
6228
6290
  "div",
6229
6291
  {
6230
6292
  className: clsx_default(
@@ -6240,13 +6302,13 @@ var DayCell = import_react3.default.memo(
6240
6302
  if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
6241
6303
  },
6242
6304
  children: [
6243
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("span", { className: "calendar-day-number", children: day.day }),
6244
- dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-day-events", children: [
6245
- dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6305
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "calendar-day-number", children: day.day }),
6306
+ dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-day-events", children: [
6307
+ dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6246
6308
  "span",
6247
6309
  {
6248
6310
  className: "calendar-event-dot",
6249
- style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
6311
+ style: { backgroundColor: event.color ?? "var(--semantic-surface-brand-default)" },
6250
6312
  title: event.label,
6251
6313
  onClick: (e) => {
6252
6314
  e.stopPropagation();
@@ -6255,7 +6317,7 @@ var DayCell = import_react3.default.memo(
6255
6317
  },
6256
6318
  ei
6257
6319
  )),
6258
- dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("span", { className: "calendar-event-more", children: [
6320
+ dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("span", { className: "calendar-event-more", children: [
6259
6321
  "+",
6260
6322
  dayEvents.length - 3
6261
6323
  ] })
@@ -6292,14 +6354,14 @@ var Calendar = (props) => {
6292
6354
  setYear,
6293
6355
  setMonth
6294
6356
  } = useCalendar(yearProp, monthProp);
6295
- const [pickerMode, setPickerMode] = import_react3.default.useState("days");
6296
- const [yearRangeStart, setYearRangeStart] = import_react3.default.useState(
6357
+ const [pickerMode, setPickerMode] = import_react4.default.useState("days");
6358
+ const [yearRangeStart, setYearRangeStart] = import_react4.default.useState(
6297
6359
  Math.floor(year / 12) * 12
6298
6360
  );
6299
- import_react3.default.useEffect(() => {
6361
+ import_react4.default.useEffect(() => {
6300
6362
  if (yearProp !== void 0) setYear(yearProp);
6301
6363
  }, [yearProp, setYear]);
6302
- import_react3.default.useEffect(() => {
6364
+ import_react4.default.useEffect(() => {
6303
6365
  if (monthProp !== void 0) setMonth(monthProp);
6304
6366
  }, [monthProp, setMonth]);
6305
6367
  const handlePrev = () => {
@@ -6351,15 +6413,15 @@ var Calendar = (props) => {
6351
6413
  setPickerMode("months");
6352
6414
  onMonthChange?.(y, month);
6353
6415
  };
6354
- const minTime = import_react3.default.useMemo(
6416
+ const minTime = import_react4.default.useMemo(
6355
6417
  () => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
6356
6418
  [minDate]
6357
6419
  );
6358
- const maxTime = import_react3.default.useMemo(
6420
+ const maxTime = import_react4.default.useMemo(
6359
6421
  () => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
6360
6422
  [maxDate]
6361
6423
  );
6362
- const eventsMap = import_react3.default.useMemo(() => {
6424
+ const eventsMap = import_react4.default.useMemo(() => {
6363
6425
  const map = /* @__PURE__ */ new Map();
6364
6426
  for (const e of events) {
6365
6427
  const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
@@ -6369,28 +6431,28 @@ var Calendar = (props) => {
6369
6431
  }
6370
6432
  return map;
6371
6433
  }, [events]);
6372
- const getEventsForDay = import_react3.default.useCallback(
6434
+ const getEventsForDay = import_react4.default.useCallback(
6373
6435
  (date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
6374
6436
  [eventsMap]
6375
6437
  );
6376
6438
  const weekdays = WEEKDAY_LABELS[locale];
6377
6439
  const monthLabels = MONTH_LABELS[locale];
6378
6440
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
6379
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
6441
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(
6380
6442
  "div",
6381
6443
  {
6382
6444
  className: "lib-xplat-calendar",
6383
6445
  style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
6384
6446
  children: [
6385
- /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-header", children: [
6386
- /* @__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, {}) }),
6387
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
6388
- /* @__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, {}) }),
6389
- showToday && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
6447
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: "calendar-header", children: [
6448
+ /* @__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, {}) }),
6449
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
6450
+ /* @__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, {}) }),
6451
+ showToday && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
6390
6452
  ] }),
6391
- pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
6453
+ pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
6392
6454
  const y = yearRangeStart + i;
6393
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6455
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6394
6456
  "button",
6395
6457
  {
6396
6458
  type: "button",
@@ -6401,7 +6463,7 @@ var Calendar = (props) => {
6401
6463
  y
6402
6464
  );
6403
6465
  }) }),
6404
- pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6466
+ pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6405
6467
  "button",
6406
6468
  {
6407
6469
  type: "button",
@@ -6411,8 +6473,8 @@ var Calendar = (props) => {
6411
6473
  },
6412
6474
  i
6413
6475
  )) }),
6414
- pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(import_jsx_runtime302.Fragment, { children: [
6415
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6476
+ pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)(import_jsx_runtime303.Fragment, { children: [
6477
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6416
6478
  "div",
6417
6479
  {
6418
6480
  className: clsx_default(
@@ -6424,12 +6486,12 @@ var Calendar = (props) => {
6424
6486
  },
6425
6487
  label
6426
6488
  )) }),
6427
- /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
6489
+ /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
6428
6490
  const dayEvents = getEventsForDay(day.date);
6429
6491
  const t = day.date.getTime();
6430
6492
  const disabled = t < minTime || t > maxTime;
6431
6493
  const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
6432
- return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
6494
+ return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6433
6495
  DayCell,
6434
6496
  {
6435
6497
  day,
@@ -6452,13 +6514,13 @@ Calendar.displayName = "Calendar";
6452
6514
  var Calendar_default = Calendar;
6453
6515
 
6454
6516
  // src/components/CardTab/CardTab.tsx
6455
- var import_react4 = __toESM(require("react"), 1);
6517
+ var import_react5 = __toESM(require("react"), 1);
6456
6518
 
6457
6519
  // src/components/CardTab/CardTabPanel.tsx
6458
- var import_jsx_runtime303 = require("react/jsx-runtime");
6520
+ var import_jsx_runtime304 = require("react/jsx-runtime");
6459
6521
  var CardTabPanel = (props) => {
6460
6522
  const { children, columns = 3 } = props;
6461
- return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
6523
+ return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
6462
6524
  "div",
6463
6525
  {
6464
6526
  className: "card-tab-panel",
@@ -6471,7 +6533,7 @@ CardTabPanel.displayName = "CardTab.Panel";
6471
6533
  var CardTabPanel_default = CardTabPanel;
6472
6534
 
6473
6535
  // src/components/CardTab/CardTab.tsx
6474
- var import_jsx_runtime304 = require("react/jsx-runtime");
6536
+ var import_jsx_runtime305 = require("react/jsx-runtime");
6475
6537
  var CardTabRoot = (props) => {
6476
6538
  const {
6477
6539
  tabs,
@@ -6481,7 +6543,7 @@ var CardTabRoot = (props) => {
6481
6543
  children
6482
6544
  } = props;
6483
6545
  const isControlled = activeValueProp !== void 0;
6484
- const [uncontrolledValue, setUncontrolledValue] = import_react4.default.useState(tabs[0]?.value ?? "");
6546
+ const [uncontrolledValue, setUncontrolledValue] = import_react5.default.useState(tabs[0]?.value ?? "");
6485
6547
  const activeValue = isControlled ? activeValueProp : uncontrolledValue;
6486
6548
  const handleTabClick = (tab) => {
6487
6549
  if (!isControlled) {
@@ -6489,16 +6551,16 @@ var CardTabRoot = (props) => {
6489
6551
  }
6490
6552
  onChange?.(tab);
6491
6553
  };
6492
- const panels = import_react4.default.Children.toArray(children).filter(
6493
- (child) => import_react4.default.isValidElement(child) && child.type === CardTabPanel_default
6554
+ const panels = import_react5.default.Children.toArray(children).filter(
6555
+ (child) => import_react5.default.isValidElement(child) && child.type === CardTabPanel_default
6494
6556
  );
6495
6557
  const activePanel = panels.find(
6496
6558
  (panel) => panel.props.value === activeValue
6497
6559
  );
6498
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
6499
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
6560
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
6561
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
6500
6562
  const isActive2 = tab.value === activeValue;
6501
- return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
6563
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6502
6564
  "button",
6503
6565
  {
6504
6566
  className: clsx_default("card-tab-trigger", isActive2 && "active"),
@@ -6510,7 +6572,7 @@ var CardTabRoot = (props) => {
6510
6572
  tab.value
6511
6573
  );
6512
6574
  }) }),
6513
- /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-body", children: activePanel })
6575
+ /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "card-tab-body", children: activePanel })
6514
6576
  ] });
6515
6577
  };
6516
6578
  CardTabRoot.displayName = "CardTab";
@@ -6520,8 +6582,8 @@ var CardTab = Object.assign(CardTabRoot, {
6520
6582
  var CardTab_default = CardTab;
6521
6583
 
6522
6584
  // src/components/Chart/Chart.tsx
6523
- var import_react5 = __toESM(require("react"), 1);
6524
- var import_jsx_runtime305 = require("react/jsx-runtime");
6585
+ var import_react6 = __toESM(require("react"), 1);
6586
+ var import_jsx_runtime306 = require("react/jsx-runtime");
6525
6587
  var CATEGORICAL_COUNT2 = 8;
6526
6588
  var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
6527
6589
  const n = i + 1;
@@ -6566,8 +6628,8 @@ var toSmoothPath = (points) => {
6566
6628
  return d;
6567
6629
  };
6568
6630
  var useChartSize = (ref) => {
6569
- const [size, setSize] = import_react5.default.useState({ width: 0, height: 0 });
6570
- import_react5.default.useEffect(() => {
6631
+ const [size, setSize] = import_react6.default.useState({ width: 0, height: 0 });
6632
+ import_react6.default.useEffect(() => {
6571
6633
  const el = ref.current;
6572
6634
  if (!el) return;
6573
6635
  let rafId = 0;
@@ -6593,10 +6655,10 @@ var useChartSize = (ref) => {
6593
6655
  };
6594
6656
  var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
6595
6657
  var useChartAnimation = (containerRef, dataKey) => {
6596
- const [animate, setAnimate] = import_react5.default.useState(false);
6597
- const prevDataKey = import_react5.default.useRef(dataKey);
6598
- const hasAnimated = import_react5.default.useRef(false);
6599
- import_react5.default.useEffect(() => {
6658
+ const [animate, setAnimate] = import_react6.default.useState(false);
6659
+ const prevDataKey = import_react6.default.useRef(dataKey);
6660
+ const hasAnimated = import_react6.default.useRef(false);
6661
+ import_react6.default.useEffect(() => {
6600
6662
  if (prefersReducedMotion()) return;
6601
6663
  const el = containerRef.current;
6602
6664
  if (!el) return;
@@ -6612,7 +6674,7 @@ var useChartAnimation = (containerRef, dataKey) => {
6612
6674
  observer.observe(el);
6613
6675
  return () => observer.disconnect();
6614
6676
  }, [containerRef]);
6615
- import_react5.default.useEffect(() => {
6677
+ import_react6.default.useEffect(() => {
6616
6678
  if (dataKey !== prevDataKey.current) {
6617
6679
  prevDataKey.current = dataKey;
6618
6680
  if (prefersReducedMotion()) return;
@@ -6626,15 +6688,15 @@ var useChartAnimation = (containerRef, dataKey) => {
6626
6688
  };
6627
6689
  var TOOLTIP_OFFSET = 12;
6628
6690
  var useChartTooltip = (enabled) => {
6629
- const [tooltip, setTooltip] = import_react5.default.useState({
6691
+ const [tooltip, setTooltip] = import_react6.default.useState({
6630
6692
  visible: false,
6631
6693
  x: 0,
6632
6694
  y: 0,
6633
6695
  content: ""
6634
6696
  });
6635
- const containerRef = import_react5.default.useRef(null);
6636
- const rafRef = import_react5.default.useRef(0);
6637
- const move = import_react5.default.useCallback((e) => {
6697
+ const containerRef = import_react6.default.useRef(null);
6698
+ const rafRef = import_react6.default.useRef(0);
6699
+ const move = import_react6.default.useCallback((e) => {
6638
6700
  if (!enabled) return;
6639
6701
  const cx = e.clientX;
6640
6702
  const cy = e.clientY;
@@ -6645,24 +6707,24 @@ var useChartTooltip = (enabled) => {
6645
6707
  setTooltip((prev) => ({ ...prev, x: cx - rect.left, y: cy - rect.top }));
6646
6708
  });
6647
6709
  }, [enabled]);
6648
- const show = import_react5.default.useCallback((e, content) => {
6710
+ const show = import_react6.default.useCallback((e, content) => {
6649
6711
  if (!enabled) return;
6650
6712
  const rect = containerRef.current?.getBoundingClientRect();
6651
6713
  if (!rect) return;
6652
6714
  setTooltip({ visible: true, x: e.clientX - rect.left, y: e.clientY - rect.top, content });
6653
6715
  }, [enabled]);
6654
- const hide = import_react5.default.useCallback(() => {
6716
+ const hide = import_react6.default.useCallback(() => {
6655
6717
  cancelAnimationFrame(rafRef.current);
6656
6718
  setTooltip((prev) => ({ ...prev, visible: false }));
6657
6719
  }, []);
6658
6720
  return { tooltip, show, hide, move, containerRef };
6659
6721
  };
6660
- 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) => {
6722
+ 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) => {
6661
6723
  const y = PADDING.top + (1 - ratio) * chartH;
6662
6724
  const val = Math.round(maxVal * ratio);
6663
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6664
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
6665
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
6725
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
6726
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
6727
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
6666
6728
  ] }, ratio);
6667
6729
  }) }));
6668
6730
  GridLines.displayName = "GridLines";
@@ -6672,18 +6734,18 @@ var getLabelStep = (count, chartW) => {
6672
6734
  if (count <= maxLabels) return 1;
6673
6735
  return Math.ceil(count / maxLabels);
6674
6736
  };
6675
- var AxisLabels = import_react5.default.memo(({ labels, count, chartW, height }) => {
6737
+ var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
6676
6738
  const step = getLabelStep(count, chartW);
6677
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: labels.map((label, i) => {
6739
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_jsx_runtime306.Fragment, { children: labels.map((label, i) => {
6678
6740
  if (i % step !== 0) return null;
6679
6741
  const x = PADDING.left + i / (count - 1 || 1) * chartW;
6680
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
6742
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
6681
6743
  }) });
6682
6744
  });
6683
6745
  AxisLabels.displayName = "AxisLabels";
6684
6746
  var useCrosshair = (seriesPoints, entries, labels, chartH) => {
6685
- const [activeIndex, setActiveIndex] = import_react5.default.useState(null);
6686
- const handleMouseMove = import_react5.default.useCallback((e) => {
6747
+ const [activeIndex, setActiveIndex] = import_react6.default.useState(null);
6748
+ const handleMouseMove = import_react6.default.useCallback((e) => {
6687
6749
  const svg = e.currentTarget;
6688
6750
  const rect = svg.getBoundingClientRect();
6689
6751
  const mx = (e.clientX - rect.left) / rect.width * svg.viewBox.baseVal.width;
@@ -6702,17 +6764,17 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
6702
6764
  }
6703
6765
  setActiveIndex(minDist <= threshold ? closest : null);
6704
6766
  }, [seriesPoints]);
6705
- const handleMouseLeave = import_react5.default.useCallback(() => {
6767
+ const handleMouseLeave = import_react6.default.useCallback(() => {
6706
6768
  setActiveIndex(null);
6707
6769
  }, []);
6708
- const tooltipContent = import_react5.default.useMemo(() => {
6770
+ const tooltipContent = import_react6.default.useMemo(() => {
6709
6771
  if (activeIndex === null) return "";
6710
6772
  return entries.map(([key], di) => {
6711
6773
  const p = seriesPoints[di]?.[activeIndex];
6712
6774
  return p ? `${key}: ${p.v}` : "";
6713
6775
  }).filter(Boolean).join(" / ");
6714
6776
  }, [activeIndex, entries, seriesPoints]);
6715
- const getTooltipAt = import_react5.default.useCallback((idx) => {
6777
+ const getTooltipAt = import_react6.default.useCallback((idx) => {
6716
6778
  return entries.map(([key], di) => {
6717
6779
  const p = seriesPoints[di]?.[idx];
6718
6780
  return p ? `${key}: ${p.v}` : "";
@@ -6720,16 +6782,16 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
6720
6782
  }, [entries, seriesPoints]);
6721
6783
  return { activeIndex, handleMouseMove, handleMouseLeave, tooltipContent, getTooltipAt };
6722
6784
  };
6723
- var LineChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6724
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
6725
- const maxVal = import_react5.default.useMemo(() => {
6785
+ var LineChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6786
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
6787
+ const maxVal = import_react6.default.useMemo(() => {
6726
6788
  const allValues = entries.flatMap(([, v]) => v);
6727
6789
  return Math.max(...allValues) * 1.2 || 1;
6728
6790
  }, [entries]);
6729
6791
  const count = labels.length;
6730
6792
  const chartW = width - PADDING.left - PADDING.right;
6731
6793
  const chartH = height - PADDING.top - PADDING.bottom;
6732
- const seriesPoints = import_react5.default.useMemo(
6794
+ const seriesPoints = import_react6.default.useMemo(
6733
6795
  () => entries.map(
6734
6796
  ([, values]) => values.map((v, i) => ({
6735
6797
  x: PADDING.left + i / (count - 1 || 1) * chartW,
@@ -6739,9 +6801,9 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6739
6801
  ),
6740
6802
  [entries, count, chartW, chartH, maxVal]
6741
6803
  );
6742
- const clipRef = import_react5.default.useRef(null);
6804
+ const clipRef = import_react6.default.useRef(null);
6743
6805
  const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
6744
- import_react5.default.useEffect(() => {
6806
+ import_react6.default.useEffect(() => {
6745
6807
  if (!animate || !clipRef.current) return;
6746
6808
  clipRef.current.setAttribute("width", "0");
6747
6809
  requestAnimationFrame(() => {
@@ -6753,7 +6815,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6753
6815
  }, [animate, width]);
6754
6816
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
6755
6817
  const lineClipId = "line-area-clip";
6756
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
6818
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
6757
6819
  "svg",
6758
6820
  {
6759
6821
  viewBox: `0 0 ${width} ${height}`,
@@ -6771,9 +6833,9 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6771
6833
  onLeave();
6772
6834
  },
6773
6835
  children: [
6774
- 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 }) }) }),
6775
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
6776
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
6836
+ 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 }) }) }),
6837
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
6838
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
6777
6839
  entries.map(([key], di) => {
6778
6840
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
6779
6841
  const color = palette[2];
@@ -6782,16 +6844,16 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6782
6844
  const gradientId = `line-gradient-${di}`;
6783
6845
  const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
6784
6846
  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`;
6785
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6786
- /* @__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: [
6787
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
6788
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
6847
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
6848
+ /* @__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: [
6849
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
6850
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
6789
6851
  ] }) }),
6790
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
6791
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
6792
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
6852
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
6853
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
6854
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
6793
6855
  ] }),
6794
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6856
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6795
6857
  "circle",
6796
6858
  {
6797
6859
  cx: points[activeIndex].x,
@@ -6803,7 +6865,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6803
6865
  )
6804
6866
  ] }, di);
6805
6867
  }),
6806
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6868
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6807
6869
  "line",
6808
6870
  {
6809
6871
  x1: activeX,
@@ -6813,7 +6875,7 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6813
6875
  className: "chart-crosshair"
6814
6876
  }
6815
6877
  ),
6816
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6878
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6817
6879
  "rect",
6818
6880
  {
6819
6881
  x: PADDING.left,
@@ -6829,16 +6891,16 @@ var LineChart = import_react5.default.memo(({ data, labels, width, height, anima
6829
6891
  );
6830
6892
  });
6831
6893
  LineChart.displayName = "LineChart";
6832
- var CurveChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6833
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
6834
- const maxVal = import_react5.default.useMemo(() => {
6894
+ var CurveChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6895
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
6896
+ const maxVal = import_react6.default.useMemo(() => {
6835
6897
  const allValues = entries.flatMap(([, v]) => v);
6836
6898
  return Math.max(...allValues) * 1.2 || 1;
6837
6899
  }, [entries]);
6838
6900
  const count = labels.length;
6839
6901
  const chartW = width - PADDING.left - PADDING.right;
6840
6902
  const chartH = height - PADDING.top - PADDING.bottom;
6841
- const seriesPoints = import_react5.default.useMemo(
6903
+ const seriesPoints = import_react6.default.useMemo(
6842
6904
  () => entries.map(
6843
6905
  ([, values]) => values.map((v, i) => ({
6844
6906
  x: PADDING.left + i / (count - 1 || 1) * chartW,
@@ -6848,9 +6910,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6848
6910
  ),
6849
6911
  [entries, count, chartW, chartH, maxVal]
6850
6912
  );
6851
- const curveClipRef = import_react5.default.useRef(null);
6913
+ const curveClipRef = import_react6.default.useRef(null);
6852
6914
  const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
6853
- import_react5.default.useEffect(() => {
6915
+ import_react6.default.useEffect(() => {
6854
6916
  if (!animate || !curveClipRef.current) return;
6855
6917
  curveClipRef.current.setAttribute("width", "0");
6856
6918
  requestAnimationFrame(() => {
@@ -6862,7 +6924,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6862
6924
  }, [animate, width]);
6863
6925
  const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
6864
6926
  const curveClipId = "curve-area-clip";
6865
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
6927
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
6866
6928
  "svg",
6867
6929
  {
6868
6930
  viewBox: `0 0 ${width} ${height}`,
@@ -6881,9 +6943,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6881
6943
  onLeave();
6882
6944
  },
6883
6945
  children: [
6884
- 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 }) }) }),
6885
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
6886
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
6946
+ 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 }) }) }),
6947
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
6948
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(AxisLabels, { labels, count, chartW, height }),
6887
6949
  entries.map(([key], di) => {
6888
6950
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
6889
6951
  const color = palette[2];
@@ -6892,16 +6954,16 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6892
6954
  const gradientId = `curve-gradient-${di}`;
6893
6955
  const linePath = toSmoothPath(points);
6894
6956
  const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
6895
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6896
- /* @__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: [
6897
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
6898
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
6957
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { children: [
6958
+ /* @__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: [
6959
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
6960
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
6899
6961
  ] }) }),
6900
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
6901
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
6902
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
6962
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
6963
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
6964
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
6903
6965
  ] }),
6904
- activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6966
+ activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6905
6967
  "circle",
6906
6968
  {
6907
6969
  cx: points[activeIndex].x,
@@ -6913,7 +6975,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6913
6975
  )
6914
6976
  ] }, di);
6915
6977
  }),
6916
- activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6978
+ activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6917
6979
  "line",
6918
6980
  {
6919
6981
  x1: activeX,
@@ -6923,7 +6985,7 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6923
6985
  className: "chart-crosshair"
6924
6986
  }
6925
6987
  ),
6926
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6988
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6927
6989
  "rect",
6928
6990
  {
6929
6991
  x: PADDING.left,
@@ -6939,9 +7001,9 @@ var CurveChart = import_react5.default.memo(({ data, labels, width, height, anim
6939
7001
  );
6940
7002
  });
6941
7003
  CurveChart.displayName = "CurveChart";
6942
- var BarChart = import_react5.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
6943
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
6944
- const maxVal = import_react5.default.useMemo(() => {
7004
+ var BarChart = import_react6.default.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
7005
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
7006
+ const maxVal = import_react6.default.useMemo(() => {
6945
7007
  const allValues = entries.flatMap(([, v]) => v);
6946
7008
  return Math.max(...allValues) * 1.2 || 1;
6947
7009
  }, [entries]);
@@ -6953,7 +7015,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
6953
7015
  const barGap = groupCount > 1 ? 2 : 0;
6954
7016
  const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
6955
7017
  const baseline = PADDING.top + chartH;
6956
- const bars = import_react5.default.useMemo(
7018
+ const bars = import_react6.default.useMemo(
6957
7019
  () => entries.map(
6958
7020
  ([, values], di) => values.map((v, i) => {
6959
7021
  const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
@@ -6966,11 +7028,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
6966
7028
  [entries, maxVal, chartH, groupW, barW, barGap, groupCount]
6967
7029
  );
6968
7030
  const barLabelStep = getLabelStep(count, chartW);
6969
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
6970
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
7031
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
7032
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(GridLines, { width, height, chartH, maxVal }),
6971
7033
  labels.map((label, i) => {
6972
7034
  if (i % barLabelStep !== 0) return null;
6973
- 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);
7035
+ 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);
6974
7036
  }),
6975
7037
  entries.map(([key], di) => {
6976
7038
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
@@ -6979,7 +7041,7 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
6979
7041
  const r2 = Math.min(4, b.w / 2);
6980
7042
  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`;
6981
7043
  const delay = 100 + i * 80;
6982
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
7044
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
6983
7045
  "path",
6984
7046
  {
6985
7047
  d,
@@ -7000,11 +7062,11 @@ var BarChart = import_react5.default.memo(({ data, labels, width, height, animat
7000
7062
  ] });
7001
7063
  });
7002
7064
  BarChart.displayName = "BarChart";
7003
- var PieDonutChart = import_react5.default.memo(
7065
+ var PieDonutChart = import_react6.default.memo(
7004
7066
  ({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
7005
- const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
7006
- const values = import_react5.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
7007
- const total = import_react5.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
7067
+ const entries = import_react6.default.useMemo(() => Object.entries(data), [data]);
7068
+ const values = import_react6.default.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
7069
+ const total = import_react6.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
7008
7070
  const size = Math.min(width, height);
7009
7071
  const cx = size / 2;
7010
7072
  const cy = size / 2;
@@ -7012,10 +7074,10 @@ var PieDonutChart = import_react5.default.memo(
7012
7074
  const innerR = isDoughnut ? r2 * 0.5 : 0;
7013
7075
  const firstKey = entries[0]?.[0] ?? "";
7014
7076
  const colorOffset = hashString(firstKey);
7015
- const maskRef = import_react5.default.useRef(null);
7077
+ const maskRef = import_react6.default.useRef(null);
7016
7078
  const maskR = r2 + 10;
7017
7079
  const maskCircumference = 2 * Math.PI * maskR;
7018
- import_react5.default.useEffect(() => {
7080
+ import_react6.default.useEffect(() => {
7019
7081
  if (!animate || !maskRef.current) return;
7020
7082
  const el = maskRef.current;
7021
7083
  el.style.strokeDasharray = `${maskCircumference}`;
@@ -7025,7 +7087,7 @@ var PieDonutChart = import_react5.default.memo(
7025
7087
  el.style.strokeDashoffset = "0";
7026
7088
  });
7027
7089
  }, [animate, maskCircumference]);
7028
- const sliceData = import_react5.default.useMemo(() => {
7090
+ const sliceData = import_react6.default.useMemo(() => {
7029
7091
  let angle0 = -Math.PI / 2;
7030
7092
  let cumulativeAngle = 0;
7031
7093
  return values.map((v, i) => {
@@ -7059,8 +7121,8 @@ var PieDonutChart = import_react5.default.memo(
7059
7121
  });
7060
7122
  }, [values, total, cx, cy, r2, innerR, labels]);
7061
7123
  const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
7062
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
7063
- 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)(
7124
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
7125
+ 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)(
7064
7126
  "circle",
7065
7127
  {
7066
7128
  ref: maskRef,
@@ -7073,7 +7135,7 @@ var PieDonutChart = import_react5.default.memo(
7073
7135
  transform: `rotate(-90 ${cx} ${cy})`
7074
7136
  }
7075
7137
  ) }) }),
7076
- /* @__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)(
7138
+ /* @__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)(
7077
7139
  "path",
7078
7140
  {
7079
7141
  d: s.d,
@@ -7089,9 +7151,9 @@ var PieDonutChart = import_react5.default.memo(
7089
7151
  );
7090
7152
  PieDonutChart.displayName = "PieDonutChart";
7091
7153
  var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, children }) => {
7092
- const ref = import_react5.default.useRef(null);
7093
- const [pos, setPos] = import_react5.default.useState({ left: 0, top: 0 });
7094
- import_react5.default.useLayoutEffect(() => {
7154
+ const ref = import_react6.default.useRef(null);
7155
+ const [pos, setPos] = import_react6.default.useState({ left: 0, top: 0 });
7156
+ import_react6.default.useLayoutEffect(() => {
7095
7157
  const el = ref.current;
7096
7158
  if (!el) return;
7097
7159
  const w = el.offsetWidth;
@@ -7108,15 +7170,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
7108
7170
  const sepIdx = content.indexOf(" \u2014 ");
7109
7171
  const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
7110
7172
  const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
7111
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
7173
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)(
7112
7174
  "div",
7113
7175
  {
7114
7176
  ref,
7115
7177
  className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
7116
7178
  style: { left: pos.left, top: pos.top },
7117
7179
  children: [
7118
- title && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-title", children: title }),
7119
- desc && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-desc", children: desc })
7180
+ title && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-title", children: title }),
7181
+ desc && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "tooltip-desc", children: desc })
7120
7182
  ]
7121
7183
  }
7122
7184
  );
@@ -7128,14 +7190,14 @@ var ChartLegend = ({ data, labels, type }) => {
7128
7190
  const total = values.reduce((a, b) => a + b, 0) || 1;
7129
7191
  const firstKey = entries[0]?.[0] ?? "";
7130
7192
  const colorOffset = hashString(firstKey);
7131
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
7193
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
7132
7194
  const pct = Math.round(v / total * 100);
7133
7195
  const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
7134
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
7135
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
7136
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
7137
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
7138
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("span", { className: "chart-legend-value", children: [
7196
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
7197
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
7198
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
7199
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
7200
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("span", { className: "chart-legend-value", children: [
7139
7201
  v.toLocaleString(),
7140
7202
  "(",
7141
7203
  pct,
@@ -7145,103 +7207,42 @@ var ChartLegend = ({ data, labels, type }) => {
7145
7207
  ] }, i);
7146
7208
  }) });
7147
7209
  }
7148
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
7210
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
7149
7211
  const palette = getPalette(LINE_BAR_PALETTES, di, key);
7150
7212
  const color = palette[2];
7151
7213
  const values = entries[di][1];
7152
7214
  const sum = values.reduce((a, b) => a + b, 0);
7153
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
7154
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
7155
- /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
7156
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: key }),
7157
- /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
7215
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-item", children: [
7216
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
7217
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "chart-legend-text", children: [
7218
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-label", children: key }),
7219
+ /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
7158
7220
  ] })
7159
7221
  ] }, di);
7160
7222
  }) });
7161
7223
  };
7162
- var Chart = import_react5.default.memo((props) => {
7224
+ var Chart = import_react6.default.memo((props) => {
7163
7225
  const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
7164
7226
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
7165
7227
  const { width, height } = useChartSize(containerRef);
7166
- const stableData = import_react5.default.useMemo(() => data, [JSON.stringify(data)]);
7167
- const stableLabels = import_react5.default.useMemo(() => labels, [JSON.stringify(labels)]);
7168
- const dataKey = import_react5.default.useMemo(() => JSON.stringify(labels), [labels]);
7228
+ const stableData = import_react6.default.useMemo(() => data, [JSON.stringify(data)]);
7229
+ const stableLabels = import_react6.default.useMemo(() => labels, [JSON.stringify(labels)]);
7230
+ const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
7169
7231
  const animate = useChartAnimation(containerRef, dataKey);
7170
7232
  const ready = width > 0 && height > 0;
7171
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
7172
- ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7173
- ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7174
- ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7175
- ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7176
- 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 }),
7177
- ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
7178
- 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 })
7233
+ return /* @__PURE__ */ (0, import_jsx_runtime306.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
7234
+ ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7235
+ ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7236
+ ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7237
+ ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
7238
+ 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 }),
7239
+ ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
7240
+ 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 })
7179
7241
  ] });
7180
7242
  });
7181
7243
  Chart.displayName = "Chart";
7182
7244
  var Chart_default = Chart;
7183
7245
 
7184
- // src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
7185
- var import_react6 = __toESM(require("react"), 1);
7186
- var import_jsx_runtime306 = require("react/jsx-runtime");
7187
- var MAX_HEIGHT = 400;
7188
- var AutoResizeTextArea = import_react6.default.forwardRef(
7189
- (props, ref) => {
7190
- const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
7191
- const localRef = import_react6.default.useRef(null);
7192
- const setRefs = (el) => {
7193
- localRef.current = el;
7194
- if (!ref) return;
7195
- if (typeof ref === "function") ref(el);
7196
- else if (ref && "current" in ref)
7197
- ref.current = el;
7198
- };
7199
- const updateHeight = () => {
7200
- const el = localRef.current;
7201
- if (!el) return;
7202
- el.style.height = "0px";
7203
- el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
7204
- };
7205
- const handleChange = (e) => {
7206
- if (onChange) {
7207
- const event = {
7208
- ...e,
7209
- target: { value: e.target.value }
7210
- };
7211
- onChange(event);
7212
- }
7213
- };
7214
- import_react6.default.useEffect(() => {
7215
- updateHeight();
7216
- }, [value]);
7217
- if (bare) {
7218
- return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
7219
- "textarea",
7220
- {
7221
- ...textareaProps,
7222
- ref: setRefs,
7223
- className,
7224
- disabled,
7225
- value,
7226
- onChange: handleChange
7227
- }
7228
- );
7229
- }
7230
- 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)(
7231
- "textarea",
7232
- {
7233
- ...textareaProps,
7234
- ref: setRefs,
7235
- disabled,
7236
- value,
7237
- onChange: handleChange
7238
- }
7239
- ) }) });
7240
- }
7241
- );
7242
- AutoResizeTextArea.displayName = "AutoResizeTextArea";
7243
- var AutoResizeTextArea_default = AutoResizeTextArea;
7244
-
7245
7246
  // src/components/ChatInput/ChatInput.tsx
7246
7247
  var import_react7 = __toESM(require("react"), 1);
7247
7248
 
@@ -9779,12 +9780,12 @@ var Select_default = Select;
9779
9780
  // src/components/Skeleton/Skeleton.tsx
9780
9781
  var import_jsx_runtime337 = require("react/jsx-runtime");
9781
9782
  var SIZE_MAP = {
9782
- xs: "var(--spacing-size-1)",
9783
- sm: "var(--spacing-size-2)",
9784
- md: "var(--spacing-size-4)",
9785
- lg: "var(--spacing-size-8)",
9786
- xl: "var(--spacing-size-12)",
9787
- "2xl": "var(--spacing-size-16)",
9783
+ xs: "var(--spacing-space-1)",
9784
+ sm: "var(--spacing-space-2)",
9785
+ md: "var(--spacing-space-4)",
9786
+ lg: "var(--spacing-space-8)",
9787
+ xl: "var(--spacing-space-12)",
9788
+ "2xl": "var(--spacing-space-16)",
9788
9789
  full: "100%"
9789
9790
  };
9790
9791
  var Skeleton = (props) => {
@@ -10300,6 +10301,7 @@ var TableCell = import_react38.default.memo((props) => {
10300
10301
  isSticky = false,
10301
10302
  width,
10302
10303
  nowrap = false,
10304
+ scope = "col",
10303
10305
  onClick
10304
10306
  } = props;
10305
10307
  const { registerStickyCell, stickyCells } = useTableRowContext();
@@ -10331,7 +10333,8 @@ var TableCell = import_react38.default.memo((props) => {
10331
10333
  }
10332
10334
  return () => observer.disconnect();
10333
10335
  }, [isSticky, registerStickyCell, calculateLeft]);
10334
- const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
10336
+ const isHeaderCell = headContext !== null;
10337
+ const CellTag = isHeaderCell ? "th" : "td";
10335
10338
  const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
10336
10339
  const enableHover = headContext && headContext.cellHover;
10337
10340
  return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
@@ -10346,6 +10349,7 @@ var TableCell = import_react38.default.memo((props) => {
10346
10349
  enableHover && "cell-hover",
10347
10350
  nowrap && "nowrap"
10348
10351
  ),
10352
+ scope: isHeaderCell ? scope : void 0,
10349
10353
  style: {
10350
10354
  ...isSticky ? { left } : null,
10351
10355
  ...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
@@ -11324,6 +11328,7 @@ var SideBar_default = SideBar;
11324
11328
  HelpCircleIcon,
11325
11329
  HexagonIcon,
11326
11330
  HomeIcon,
11331
+ HtmlTypeWriter,
11327
11332
  HtmlTypewriter,
11328
11333
  IconButton,
11329
11334
  ImageIcon,