@x-plat/design-system 0.5.2 → 0.5.4

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 (50) hide show
  1. package/dist/components/Accordion/index.cjs +38 -31
  2. package/dist/components/Accordion/index.css +2 -0
  3. package/dist/components/Accordion/index.js +38 -31
  4. package/dist/components/Alert/index.css +1 -0
  5. package/dist/components/Breadcrumb/index.css +3 -0
  6. package/dist/components/Button/index.css +1 -0
  7. package/dist/components/Calendar/index.cjs +103 -62
  8. package/dist/components/Calendar/index.css +2 -0
  9. package/dist/components/Calendar/index.js +103 -62
  10. package/dist/components/Card/index.css +3 -1
  11. package/dist/components/CardTab/index.css +1 -0
  12. package/dist/components/Chart/index.cjs +106 -83
  13. package/dist/components/Chart/index.css +2 -0
  14. package/dist/components/Chart/index.js +106 -83
  15. package/dist/components/DatePicker/index.cjs +36 -15
  16. package/dist/components/DatePicker/index.css +2 -0
  17. package/dist/components/DatePicker/index.js +36 -15
  18. package/dist/components/Dropdown/index.css +1 -0
  19. package/dist/components/EmptyState/index.css +2 -0
  20. package/dist/components/FileUpload/index.css +3 -0
  21. package/dist/components/HtmlTypeWriter/index.css +1 -0
  22. package/dist/components/Pagination/index.css +8 -8
  23. package/dist/components/Select/index.css +1 -0
  24. package/dist/components/Spinner/index.css +7 -2
  25. package/dist/components/Steps/index.cjs +1 -4
  26. package/dist/components/Steps/index.css +15 -36
  27. package/dist/components/Steps/index.js +1 -4
  28. package/dist/components/Swiper/index.cjs +16 -12
  29. package/dist/components/Swiper/index.css +2 -0
  30. package/dist/components/Swiper/index.js +16 -12
  31. package/dist/components/Switch/index.css +20 -19
  32. package/dist/components/Tab/index.css +16 -2
  33. package/dist/components/Table/index.cjs +4 -4
  34. package/dist/components/Table/index.css +2 -0
  35. package/dist/components/Table/index.d.cts +2 -5
  36. package/dist/components/Table/index.d.ts +2 -5
  37. package/dist/components/Table/index.js +4 -4
  38. package/dist/components/Video/index.cjs +32 -43
  39. package/dist/components/Video/index.css +5 -4
  40. package/dist/components/Video/index.d.cts +1 -5
  41. package/dist/components/Video/index.d.ts +1 -5
  42. package/dist/components/Video/index.js +32 -43
  43. package/dist/components/index.cjs +339 -257
  44. package/dist/components/index.css +99 -72
  45. package/dist/components/index.js +339 -257
  46. package/dist/index.cjs +339 -257
  47. package/dist/index.css +99 -72
  48. package/dist/index.js +339 -257
  49. package/guidelines/Guidelines.md +11 -4
  50. package/package.json +1 -2
package/dist/index.cjs CHANGED
@@ -5884,38 +5884,45 @@ var clsx_default = clsx;
5884
5884
 
5885
5885
  // src/components/Accordion/Accordion.tsx
5886
5886
  var import_jsx_runtime295 = require("react/jsx-runtime");
5887
- var AccordionItem = ({ item, isOpen, onToggle }) => {
5888
- const bodyRef = import_react.default.useRef(null);
5889
- const [height, setHeight] = import_react.default.useState(0);
5890
- import_react.default.useEffect(() => {
5891
- if (bodyRef.current) {
5892
- setHeight(bodyRef.current.scrollHeight);
5893
- }
5894
- }, [isOpen, item.content]);
5895
- return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: clsx_default("accordion-item", { open: isOpen }), children: [
5896
- /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(
5897
- "button",
5898
- {
5899
- className: "accordion-header",
5900
- onClick: onToggle,
5901
- "aria-expanded": isOpen,
5902
- children: [
5903
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "title", children: item.title }),
5904
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "chevron", children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ChevronDownIcon_default, {}) })
5905
- ]
5906
- }
5907
- ),
5908
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
5909
- "div",
5910
- {
5911
- ref: bodyRef,
5912
- className: "accordion-body",
5913
- style: { maxHeight: isOpen ? height : 0 },
5914
- children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "accordion-content", children: item.content })
5887
+ var AccordionItem = import_react.default.memo(
5888
+ ({
5889
+ item,
5890
+ isOpen,
5891
+ onToggle
5892
+ }) => {
5893
+ const bodyRef = import_react.default.useRef(null);
5894
+ const [height, setHeight] = import_react.default.useState(0);
5895
+ import_react.default.useEffect(() => {
5896
+ if (bodyRef.current) {
5897
+ setHeight(bodyRef.current.scrollHeight);
5915
5898
  }
5916
- )
5917
- ] });
5918
- };
5899
+ }, [isOpen, item.content]);
5900
+ return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: clsx_default("accordion-item", { open: isOpen }), children: [
5901
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(
5902
+ "button",
5903
+ {
5904
+ className: "accordion-header",
5905
+ onClick: onToggle,
5906
+ "aria-expanded": isOpen,
5907
+ children: [
5908
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "title", children: item.title }),
5909
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "chevron", children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ChevronDownIcon_default, {}) })
5910
+ ]
5911
+ }
5912
+ ),
5913
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
5914
+ "div",
5915
+ {
5916
+ ref: bodyRef,
5917
+ className: "accordion-body",
5918
+ style: { maxHeight: isOpen ? height : 0 },
5919
+ children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "accordion-content", children: item.content })
5920
+ }
5921
+ )
5922
+ ] });
5923
+ }
5924
+ );
5925
+ AccordionItem.displayName = "AccordionItem";
5919
5926
  var Accordion = (props) => {
5920
5927
  const { items } = props;
5921
5928
  const isMultiple = props.multiple === true;
@@ -6170,6 +6177,76 @@ var MONTH_LABELS = {
6170
6177
 
6171
6178
  // src/components/Calendar/Calendar.tsx
6172
6179
  var import_jsx_runtime301 = require("react/jsx-runtime");
6180
+ var DayCell = import_react3.default.memo(
6181
+ ({
6182
+ day,
6183
+ disabled,
6184
+ selected,
6185
+ dayEvents,
6186
+ renderDay,
6187
+ onSelect,
6188
+ onEventClick
6189
+ }) => {
6190
+ if (renderDay) {
6191
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6192
+ "div",
6193
+ {
6194
+ className: clsx_default(
6195
+ "calendar-day",
6196
+ !day.isCurrentMonth && "outside",
6197
+ disabled && "disabled",
6198
+ selected && "selected",
6199
+ day.isToday && "today"
6200
+ ),
6201
+ onClick: () => {
6202
+ if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
6203
+ },
6204
+ children: renderDay(day, dayEvents)
6205
+ }
6206
+ );
6207
+ }
6208
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(
6209
+ "div",
6210
+ {
6211
+ className: clsx_default(
6212
+ "calendar-day",
6213
+ !day.isCurrentMonth && "outside",
6214
+ disabled && "disabled",
6215
+ selected && "selected",
6216
+ day.isToday && "today",
6217
+ day.isSunday && "sunday",
6218
+ day.isSaturday && "saturday"
6219
+ ),
6220
+ onClick: () => {
6221
+ if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
6222
+ },
6223
+ children: [
6224
+ /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "calendar-day-number", children: day.day }),
6225
+ dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("div", { className: "calendar-day-events", children: [
6226
+ dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6227
+ "span",
6228
+ {
6229
+ className: "calendar-event-dot",
6230
+ style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
6231
+ title: event.label,
6232
+ onClick: (e) => {
6233
+ e.stopPropagation();
6234
+ onEventClick?.(event);
6235
+ }
6236
+ },
6237
+ ei
6238
+ )),
6239
+ dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("span", { className: "calendar-event-more", children: [
6240
+ "+",
6241
+ dayEvents.length - 3
6242
+ ] })
6243
+ ] })
6244
+ ]
6245
+ }
6246
+ );
6247
+ }
6248
+ );
6249
+ DayCell.displayName = "DayCell";
6173
6250
  var Calendar = (props) => {
6174
6251
  const {
6175
6252
  year: yearProp,
@@ -6255,12 +6332,28 @@ var Calendar = (props) => {
6255
6332
  setPickerMode("months");
6256
6333
  onMonthChange?.(y, month);
6257
6334
  };
6258
- const isDisabled = (date) => {
6259
- if (minDate && date < new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate())) return true;
6260
- if (maxDate && date > new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate())) return true;
6261
- return false;
6262
- };
6263
- const getEventsForDay = (date) => events.filter((e) => isSameDay(e.date, date));
6335
+ const minTime = import_react3.default.useMemo(
6336
+ () => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
6337
+ [minDate]
6338
+ );
6339
+ const maxTime = import_react3.default.useMemo(
6340
+ () => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
6341
+ [maxDate]
6342
+ );
6343
+ const eventsMap = import_react3.default.useMemo(() => {
6344
+ const map = /* @__PURE__ */ new Map();
6345
+ for (const e of events) {
6346
+ const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
6347
+ const arr = map.get(key);
6348
+ if (arr) arr.push(e);
6349
+ else map.set(key, [e]);
6350
+ }
6351
+ return map;
6352
+ }, [events]);
6353
+ const getEventsForDay = import_react3.default.useCallback(
6354
+ (date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
6355
+ [eventsMap]
6356
+ );
6264
6357
  const weekdays = WEEKDAY_LABELS[locale];
6265
6358
  const monthLabels = MONTH_LABELS[locale];
6266
6359
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
@@ -6314,64 +6407,19 @@ var Calendar = (props) => {
6314
6407
  )) }),
6315
6408
  /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
6316
6409
  const dayEvents = getEventsForDay(day.date);
6317
- const disabled = isDisabled(day.date);
6410
+ const t = day.date.getTime();
6411
+ const disabled = t < minTime || t > maxTime;
6318
6412
  const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
6319
- if (renderDay) {
6320
- return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6321
- "div",
6322
- {
6323
- className: clsx_default(
6324
- "calendar-day",
6325
- !day.isCurrentMonth && "outside",
6326
- disabled && "disabled",
6327
- isSelected && "selected",
6328
- day.isToday && "today"
6329
- ),
6330
- onClick: () => {
6331
- if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
6332
- },
6333
- children: renderDay(day, dayEvents)
6334
- },
6335
- idx
6336
- );
6337
- }
6338
- return /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(
6339
- "div",
6413
+ return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6414
+ DayCell,
6340
6415
  {
6341
- className: clsx_default(
6342
- "calendar-day",
6343
- !day.isCurrentMonth && "outside",
6344
- disabled && "disabled",
6345
- isSelected && "selected",
6346
- day.isToday && "today",
6347
- day.isSunday && "sunday",
6348
- day.isSaturday && "saturday"
6349
- ),
6350
- onClick: () => {
6351
- if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
6352
- },
6353
- children: [
6354
- /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("span", { className: "calendar-day-number", children: day.day }),
6355
- dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("div", { className: "calendar-day-events", children: [
6356
- dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
6357
- "span",
6358
- {
6359
- className: "calendar-event-dot",
6360
- style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
6361
- title: event.label,
6362
- onClick: (e) => {
6363
- e.stopPropagation();
6364
- onEventClick?.(event);
6365
- }
6366
- },
6367
- ei
6368
- )),
6369
- dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)("span", { className: "calendar-event-more", children: [
6370
- "+",
6371
- dayEvents.length - 3
6372
- ] })
6373
- ] })
6374
- ]
6416
+ day,
6417
+ disabled,
6418
+ selected: isSelected,
6419
+ dayEvents,
6420
+ renderDay,
6421
+ onSelect,
6422
+ onEventClick
6375
6423
  },
6376
6424
  idx
6377
6425
  );
@@ -6519,14 +6567,28 @@ var useChartTooltip = (enabled) => {
6519
6567
  }, []);
6520
6568
  return { tooltip, show, hide, move, containerRef };
6521
6569
  };
6522
- var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
6523
- const entries = Object.entries(data);
6524
- const allValues = entries.flatMap(([, v]) => v);
6525
- const maxVal = Math.max(...allValues) * 1.2 || 1;
6570
+ var LineChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLeave }) => {
6571
+ const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
6572
+ const maxVal = import_react5.default.useMemo(() => {
6573
+ const allValues = entries.flatMap(([, v]) => v);
6574
+ return Math.max(...allValues) * 1.2 || 1;
6575
+ }, [entries]);
6526
6576
  const count = labels.length;
6577
+ const chartW = 600 - PADDING.left - PADDING.right;
6578
+ const chartH = 300 - PADDING.top - PADDING.bottom;
6579
+ const seriesPoints = import_react5.default.useMemo(
6580
+ () => entries.map(
6581
+ ([, values]) => values.map((v, i) => ({
6582
+ x: PADDING.left + i / (count - 1 || 1) * chartW,
6583
+ y: PADDING.top + (1 - v / maxVal) * chartH,
6584
+ v
6585
+ }))
6586
+ ),
6587
+ [entries, count, chartW, chartH, maxVal]
6588
+ );
6527
6589
  return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
6528
6590
  [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
6529
- const y = PADDING.top + (1 - ratio) * (300 - PADDING.top - PADDING.bottom);
6591
+ const y = PADDING.top + (1 - ratio) * chartH;
6530
6592
  const val = Math.round(maxVal * ratio);
6531
6593
  return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6532
6594
  /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: 600 - PADDING.right, y2: y, className: "chart-grid" }),
@@ -6534,17 +6596,13 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
6534
6596
  ] }, ratio);
6535
6597
  }),
6536
6598
  labels.map((label, i) => {
6537
- const x = PADDING.left + i / (count - 1 || 1) * (600 - PADDING.left - PADDING.right);
6599
+ const x = PADDING.left + i / (count - 1 || 1) * chartW;
6538
6600
  return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
6539
6601
  }),
6540
- entries.map(([key, values], di) => {
6602
+ entries.map(([key], di) => {
6541
6603
  const palette = getPalette(LINE_BAR_PALETTES, di);
6542
6604
  const color = palette[4];
6543
- const points = values.map((v, i) => {
6544
- const x = PADDING.left + i / (count - 1 || 1) * (600 - PADDING.left - PADDING.right);
6545
- const y = PADDING.top + (1 - v / maxVal) * (300 - PADDING.top - PADDING.bottom);
6546
- return { x, y, v };
6547
- });
6605
+ const points = seriesPoints[di];
6548
6606
  return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6549
6607
  /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6550
6608
  "polyline",
@@ -6572,17 +6630,31 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
6572
6630
  ] }, di);
6573
6631
  })
6574
6632
  ] });
6575
- };
6576
- var BarChart = ({ data, labels, onHover, onMove, onLeave }) => {
6577
- const entries = Object.entries(data);
6578
- const allValues = entries.flatMap(([, v]) => v);
6579
- const maxVal = Math.max(...allValues) * 1.2 || 1;
6633
+ });
6634
+ LineChart.displayName = "LineChart";
6635
+ var BarChart = import_react5.default.memo(({ data, labels, onHover, onMove, onLeave }) => {
6636
+ const entries = import_react5.default.useMemo(() => Object.entries(data), [data]);
6637
+ const maxVal = import_react5.default.useMemo(() => {
6638
+ const allValues = entries.flatMap(([, v]) => v);
6639
+ return Math.max(...allValues) * 1.2 || 1;
6640
+ }, [entries]);
6580
6641
  const count = labels.length;
6581
6642
  const groupCount = entries.length;
6582
6643
  const chartW = 600 - PADDING.left - PADDING.right;
6583
6644
  const chartH = 300 - PADDING.top - PADDING.bottom;
6584
6645
  const groupW = chartW / count;
6585
6646
  const barW = Math.min(32, groupW * 0.7 / groupCount);
6647
+ const bars = import_react5.default.useMemo(
6648
+ () => entries.map(
6649
+ ([, values], di) => values.map((v, i) => {
6650
+ const h = v / maxVal * chartH;
6651
+ const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
6652
+ const y = PADDING.top + chartH - h;
6653
+ return { x, y, w: barW, h, v };
6654
+ })
6655
+ ),
6656
+ [entries, maxVal, chartH, groupW, barW, groupCount]
6657
+ );
6586
6658
  return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
6587
6659
  [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
6588
6660
  const y = PADDING.top + (1 - ratio) * chartH;
@@ -6593,85 +6665,84 @@ var BarChart = ({ data, labels, onHover, onMove, onLeave }) => {
6593
6665
  ] }, ratio);
6594
6666
  }),
6595
6667
  labels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i)),
6596
- entries.map(([key, values], di) => {
6668
+ entries.map(([key], di) => {
6597
6669
  const palette = getPalette(LINE_BAR_PALETTES, di);
6598
6670
  const color = palette[4];
6599
- return values.map((v, i) => {
6600
- const h = v / maxVal * chartH;
6601
- const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
6602
- const y = PADDING.top + chartH - h;
6603
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6604
- "rect",
6605
- {
6606
- x,
6607
- y,
6608
- width: barW,
6609
- height: h,
6610
- rx: "2",
6611
- fill: color,
6612
- className: "chart-bar",
6613
- onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${v}`),
6614
- onMouseMove: onMove,
6615
- onMouseLeave: onLeave
6616
- },
6617
- `${di}-${i}`
6618
- );
6619
- });
6671
+ return bars[di].map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6672
+ "rect",
6673
+ {
6674
+ x: b.x,
6675
+ y: b.y,
6676
+ width: b.w,
6677
+ height: b.h,
6678
+ rx: "2",
6679
+ fill: color,
6680
+ className: "chart-bar",
6681
+ onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
6682
+ onMouseMove: onMove,
6683
+ onMouseLeave: onLeave
6684
+ },
6685
+ `${di}-${i}`
6686
+ ));
6620
6687
  })
6621
6688
  ] });
6622
- };
6623
- var PieDonutChart = ({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
6624
- const entries = Object.entries(data);
6625
- const values = entries.flatMap(([, v]) => v);
6626
- const total = values.reduce((a, b) => a + b, 0) || 1;
6627
- const cx = 150;
6628
- const cy = 150;
6629
- const r2 = 120;
6630
- const innerR = isDoughnut ? 60 : 0;
6631
- const palette = getPalette(PIE_PALETTES, 0);
6632
- let startAngle = -Math.PI / 2;
6633
- const slices = values.map((v, i) => {
6634
- const angle = v / total * Math.PI * 2;
6635
- const endAngle = startAngle + angle;
6636
- const largeArc = angle > Math.PI ? 1 : 0;
6637
- const x1 = cx + r2 * Math.cos(startAngle);
6638
- const y1 = cy + r2 * Math.sin(startAngle);
6639
- const x2 = cx + r2 * Math.cos(endAngle);
6640
- const y2 = cy + r2 * Math.sin(endAngle);
6641
- let d;
6642
- if (innerR > 0) {
6643
- const ix1 = cx + innerR * Math.cos(startAngle);
6644
- const iy1 = cy + innerR * Math.sin(startAngle);
6645
- const ix2 = cx + innerR * Math.cos(endAngle);
6646
- const iy2 = cy + innerR * Math.sin(endAngle);
6647
- d = `M ${ix1} ${iy1} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} L ${ix2} ${iy2} A ${innerR} ${innerR} 0 ${largeArc} 0 ${ix1} ${iy1} Z`;
6648
- } else {
6649
- d = `M ${cx} ${cy} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} Z`;
6650
- }
6651
- const midAngle = startAngle + angle / 2;
6652
- const labelR = innerR > 0 ? (r2 + innerR) / 2 : r2 * 0.6;
6653
- const lx = cx + labelR * Math.cos(midAngle);
6654
- const ly = cy + labelR * Math.sin(midAngle);
6655
- const pct = Math.round(v / total * 100);
6656
- const label = labels[i] || `${i + 1}`;
6657
- startAngle = endAngle;
6658
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6689
+ });
6690
+ BarChart.displayName = "BarChart";
6691
+ var PieDonutChart = import_react5.default.memo(
6692
+ ({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
6693
+ const values = import_react5.default.useMemo(() => Object.entries(data).flatMap(([, v]) => v), [data]);
6694
+ const total = import_react5.default.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
6695
+ const cx = 150;
6696
+ const cy = 150;
6697
+ const r2 = 120;
6698
+ const innerR = isDoughnut ? 60 : 0;
6699
+ const palette = getPalette(PIE_PALETTES, 0);
6700
+ const sliceData = import_react5.default.useMemo(() => {
6701
+ let angle0 = -Math.PI / 2;
6702
+ return values.map((v, i) => {
6703
+ const angle = v / total * Math.PI * 2;
6704
+ const endAngle = angle0 + angle;
6705
+ const largeArc = angle > Math.PI ? 1 : 0;
6706
+ const x1 = cx + r2 * Math.cos(angle0);
6707
+ const y1 = cy + r2 * Math.sin(angle0);
6708
+ const x2 = cx + r2 * Math.cos(endAngle);
6709
+ const y2 = cy + r2 * Math.sin(endAngle);
6710
+ let d;
6711
+ if (innerR > 0) {
6712
+ const ix1 = cx + innerR * Math.cos(angle0);
6713
+ const iy1 = cy + innerR * Math.sin(angle0);
6714
+ const ix2 = cx + innerR * Math.cos(endAngle);
6715
+ const iy2 = cy + innerR * Math.sin(endAngle);
6716
+ d = `M ${ix1} ${iy1} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} L ${ix2} ${iy2} A ${innerR} ${innerR} 0 ${largeArc} 0 ${ix1} ${iy1} Z`;
6717
+ } else {
6718
+ d = `M ${cx} ${cy} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} Z`;
6719
+ }
6720
+ const midAngle = angle0 + angle / 2;
6721
+ const labelR = innerR > 0 ? (r2 + innerR) / 2 : r2 * 0.6;
6722
+ const lx = cx + labelR * Math.cos(midAngle);
6723
+ const ly = cy + labelR * Math.sin(midAngle);
6724
+ const pct = Math.round(v / total * 100);
6725
+ angle0 = endAngle;
6726
+ return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
6727
+ });
6728
+ }, [values, total, innerR, labels]);
6729
+ return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("svg", { viewBox: "0 0 300 300", className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
6659
6730
  /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
6660
6731
  "path",
6661
6732
  {
6662
- d,
6733
+ d: s.d,
6663
6734
  fill: palette[i % palette.length],
6664
6735
  className: "chart-slice",
6665
- onMouseEnter: (e) => onHover(e, `${label}: ${v} (${pct}%)`),
6736
+ onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
6666
6737
  onMouseMove: onMove,
6667
6738
  onMouseLeave: onLeave
6668
6739
  }
6669
6740
  ),
6670
- angle > 0.2 && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: lx, y: ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: v })
6671
- ] }, i);
6672
- });
6673
- return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("svg", { viewBox: "0 0 300 300", className: "chart-svg chart-pie", children: slices });
6674
- };
6741
+ s.angle > 0.2 && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: s.lx, y: s.ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: s.v })
6742
+ ] }, i)) });
6743
+ }
6744
+ );
6745
+ PieDonutChart.displayName = "PieDonutChart";
6675
6746
  var Chart = (props) => {
6676
6747
  const { type, data, labels, tooltip: showTooltip = true } = props;
6677
6748
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
@@ -6980,7 +7051,7 @@ var useClickOutside_default = useClickOutside;
6980
7051
  // src/components/DatePicker/SingleDatePicker/index.tsx
6981
7052
  var import_react10 = __toESM(require("react"), 1);
6982
7053
  var import_jsx_runtime311 = require("react/jsx-runtime");
6983
- var DayCell = import_react10.default.memo(
7054
+ var DayCell2 = import_react10.default.memo(
6984
7055
  ({
6985
7056
  day,
6986
7057
  disabled,
@@ -7010,7 +7081,7 @@ var DayCell = import_react10.default.memo(
7010
7081
  ),
7011
7082
  (prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
7012
7083
  );
7013
- DayCell.displayName = "DayCell";
7084
+ DayCell2.displayName = "DayCell";
7014
7085
  var SingleDatePicker = (props) => {
7015
7086
  const {
7016
7087
  value,
@@ -7133,7 +7204,7 @@ var SingleDatePicker = (props) => {
7133
7204
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
7134
7205
  );
7135
7206
  return /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
7136
- DayCell,
7207
+ DayCell2,
7137
7208
  {
7138
7209
  day,
7139
7210
  disabled,
@@ -7248,6 +7319,35 @@ var Modal_default = Modal;
7248
7319
  // src/components/DatePicker/RangePicker/index.tsx
7249
7320
  var import_react13 = __toESM(require("react"), 1);
7250
7321
  var import_jsx_runtime314 = require("react/jsx-runtime");
7322
+ var RangeDayCell = import_react13.default.memo(
7323
+ ({
7324
+ day,
7325
+ disabled,
7326
+ isStart,
7327
+ isEnd,
7328
+ inRange,
7329
+ onClick
7330
+ }) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
7331
+ "button",
7332
+ {
7333
+ type: "button",
7334
+ className: clsx_default(
7335
+ "datepicker-day",
7336
+ !day.isCurrentMonth && "outside",
7337
+ disabled && "disabled",
7338
+ (isStart || isEnd) && "selected",
7339
+ inRange && !isStart && !isEnd && "in-range",
7340
+ day.isToday && "today",
7341
+ day.isSunday && "sunday",
7342
+ day.isSaturday && "saturday"
7343
+ ),
7344
+ disabled: disabled || !day.isCurrentMonth,
7345
+ onClick,
7346
+ children: day.day
7347
+ }
7348
+ )
7349
+ );
7350
+ RangeDayCell.displayName = "RangeDayCell";
7251
7351
  var RangePicker = (props) => {
7252
7352
  const {
7253
7353
  startDate,
@@ -7324,20 +7424,13 @@ var RangePicker = (props) => {
7324
7424
  const isEnd = isSameDay(day.date, endDate);
7325
7425
  const inRange = isInRange(day.date, startDate, endDate);
7326
7426
  return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
7327
- "button",
7427
+ RangeDayCell,
7328
7428
  {
7329
- type: "button",
7330
- className: clsx_default(
7331
- "datepicker-day",
7332
- !day.isCurrentMonth && "outside",
7333
- disabled && "disabled",
7334
- (isStart || isEnd) && "selected",
7335
- inRange && !isStart && !isEnd && "in-range",
7336
- day.isToday && "today",
7337
- day.isSunday && "sunday",
7338
- day.isSaturday && "saturday"
7339
- ),
7340
- disabled: disabled || !day.isCurrentMonth,
7429
+ day,
7430
+ disabled,
7431
+ isStart,
7432
+ isEnd,
7433
+ inRange,
7341
7434
  onClick: () => {
7342
7435
  if (!disabled && day.isCurrentMonth) {
7343
7436
  if (type === "start") {
@@ -7348,8 +7441,7 @@ var RangePicker = (props) => {
7348
7441
  onChange?.({ startDate, endDate: newEnd });
7349
7442
  }
7350
7443
  }
7351
- },
7352
- children: day.day
7444
+ }
7353
7445
  },
7354
7446
  idx
7355
7447
  );
@@ -8407,10 +8499,7 @@ var Steps = (props) => {
8407
8499
  return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
8408
8500
  const status = index < current ? "completed" : index === current ? "active" : "pending";
8409
8501
  return /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)("div", { className: clsx_default("step-item", status), children: [
8410
- /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)("div", { className: "step-indicator", children: [
8411
- /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("span", { children: index + 1 }) }),
8412
- index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: "step-line" })
8413
- ] }),
8502
+ /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("span", { children: index + 1 }) }),
8414
8503
  /* @__PURE__ */ (0, import_jsx_runtime332.jsxs)("div", { className: "step-content", children: [
8415
8504
  /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("span", { className: "step-title", children: item.title }),
8416
8505
  item.description && /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("span", { className: "step-description", children: item.description })
@@ -8621,6 +8710,21 @@ var Swiper = (props) => {
8621
8710
  }, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
8622
8711
  const slideWidthPercent = 100 / viewItemCount;
8623
8712
  const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
8713
+ const slideElements = import_react27.default.useMemo(
8714
+ () => extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
8715
+ "div",
8716
+ {
8717
+ className: "lib-xplat-swiper__slide",
8718
+ style: {
8719
+ minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
8720
+ maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
8721
+ },
8722
+ children: item
8723
+ },
8724
+ idx
8725
+ )),
8726
+ [extendedItems, slideWidthPercent, gapAdjust]
8727
+ );
8624
8728
  const totalSteps = Math.ceil((maxIndex + 1) / slideBy);
8625
8729
  const currentStep = Math.min(
8626
8730
  Math.floor(realIndex / slideBy),
@@ -8646,18 +8750,7 @@ var Swiper = (props) => {
8646
8750
  gap: `${spaceBetween}px`
8647
8751
  },
8648
8752
  onTransitionEnd: handleTransitionEnd,
8649
- children: extendedItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
8650
- "div",
8651
- {
8652
- className: "lib-xplat-swiper__slide",
8653
- style: {
8654
- minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
8655
- maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
8656
- },
8657
- children: item
8658
- },
8659
- idx
8660
- ))
8753
+ children: slideElements
8661
8754
  }
8662
8755
  )
8663
8756
  }
@@ -8876,7 +8969,7 @@ var TableRowContext_default = TableRowContext;
8876
8969
 
8877
8970
  // src/components/Table/TableCell.tsx
8878
8971
  var import_jsx_runtime339 = require("react/jsx-runtime");
8879
- var TableCell = (props) => {
8972
+ var TableCell = import_react34.default.memo((props) => {
8880
8973
  const {
8881
8974
  children,
8882
8975
  align = "center",
@@ -8931,7 +9024,7 @@ var TableCell = (props) => {
8931
9024
  children
8932
9025
  }
8933
9026
  );
8934
- };
9027
+ });
8935
9028
  TableCell.displayName = "TableCell";
8936
9029
  var TableCell_default = TableCell;
8937
9030
 
@@ -8950,7 +9043,7 @@ var TableHead_default = TableHead;
8950
9043
  // src/components/Table/TableRow.tsx
8951
9044
  var import_react35 = __toESM(require("react"), 1);
8952
9045
  var import_jsx_runtime341 = require("react/jsx-runtime");
8953
- var TableRow = (props) => {
9046
+ var TableRow = import_react35.default.memo((props) => {
8954
9047
  const {
8955
9048
  children,
8956
9049
  type = "secondary",
@@ -8978,7 +9071,7 @@ var TableRow = (props) => {
8978
9071
  children
8979
9072
  }
8980
9073
  ) });
8981
- };
9074
+ });
8982
9075
  TableRow.displayName = "TableRow";
8983
9076
  var TableRow_default = TableRow;
8984
9077
 
@@ -9186,7 +9279,6 @@ var Video = import_react39.default.forwardRef((props, ref) => {
9186
9279
  const {
9187
9280
  src,
9188
9281
  poster,
9189
- controls = true,
9190
9282
  autoPlay,
9191
9283
  muted,
9192
9284
  loop,
@@ -9225,49 +9317,39 @@ var Video = import_react39.default.forwardRef((props, ref) => {
9225
9317
  videoRef.current.play();
9226
9318
  }
9227
9319
  };
9228
- const showCustomOverlay = !controls;
9229
- return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)(
9230
- "div",
9231
- {
9232
- className: clsx_default(
9233
- "lib-xplat-video",
9234
- showCustomOverlay && "custom-overlay"
9235
- ),
9236
- children: [
9237
- /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
9238
- "video",
9239
- {
9240
- ref: setRefs,
9241
- src,
9242
- poster,
9243
- controls,
9244
- autoPlay,
9245
- muted,
9246
- loop,
9247
- playsInline: playsInline ?? true,
9248
- onPlay: handlePlay,
9249
- onPause: handlePause,
9250
- onLoadedData: handleLoadedData,
9251
- ...rest
9252
- }
9320
+ return /* @__PURE__ */ (0, import_jsx_runtime346.jsxs)("div", { className: "lib-xplat-video custom-overlay", children: [
9321
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
9322
+ "video",
9323
+ {
9324
+ ref: setRefs,
9325
+ src,
9326
+ poster,
9327
+ autoPlay,
9328
+ muted,
9329
+ loop,
9330
+ playsInline: playsInline ?? true,
9331
+ onPlay: handlePlay,
9332
+ onPause: handlePause,
9333
+ onLoadedData: handleLoadedData,
9334
+ onClick: togglePlay,
9335
+ ...rest
9336
+ }
9337
+ ),
9338
+ /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
9339
+ "button",
9340
+ {
9341
+ type: "button",
9342
+ className: clsx_default(
9343
+ "play-overlay",
9344
+ isPlaying && "is-playing",
9345
+ !isLoaded && "is-loading"
9253
9346
  ),
9254
- showCustomOverlay && /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(
9255
- "button",
9256
- {
9257
- type: "button",
9258
- className: clsx_default(
9259
- "play-overlay",
9260
- isPlaying && "is-playing",
9261
- !isLoaded && "is-loading"
9262
- ),
9263
- onClick: togglePlay,
9264
- "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
9265
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PlayCircleIcon_default, {}) })
9266
- }
9267
- )
9268
- ]
9269
- }
9270
- );
9347
+ onClick: togglePlay,
9348
+ "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
9349
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime346.jsx)("span", { className: "play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime346.jsx)(PlayCircleIcon_default, {}) })
9350
+ }
9351
+ )
9352
+ ] });
9271
9353
  });
9272
9354
  Video.displayName = "Video";
9273
9355
  var Video_default = Video;