@x-plat/design-system 0.6.0 → 0.6.1

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