@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
@@ -1269,38 +1269,45 @@ var clsx_default = clsx;
1269
1269
 
1270
1270
  // src/components/Accordion/Accordion.tsx
1271
1271
  import { jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
1272
- var AccordionItem = ({ item, isOpen, onToggle }) => {
1273
- const bodyRef = React.useRef(null);
1274
- const [height, setHeight] = React.useState(0);
1275
- React.useEffect(() => {
1276
- if (bodyRef.current) {
1277
- setHeight(bodyRef.current.scrollHeight);
1278
- }
1279
- }, [isOpen, item.content]);
1280
- return /* @__PURE__ */ jsxs189("div", { className: clsx_default("accordion-item", { open: isOpen }), children: [
1281
- /* @__PURE__ */ jsxs189(
1282
- "button",
1283
- {
1284
- className: "accordion-header",
1285
- onClick: onToggle,
1286
- "aria-expanded": isOpen,
1287
- children: [
1288
- /* @__PURE__ */ jsx295("span", { className: "title", children: item.title }),
1289
- /* @__PURE__ */ jsx295("span", { className: "chevron", children: /* @__PURE__ */ jsx295(ChevronDownIcon_default, {}) })
1290
- ]
1291
- }
1292
- ),
1293
- /* @__PURE__ */ jsx295(
1294
- "div",
1295
- {
1296
- ref: bodyRef,
1297
- className: "accordion-body",
1298
- style: { maxHeight: isOpen ? height : 0 },
1299
- children: /* @__PURE__ */ jsx295("div", { className: "accordion-content", children: item.content })
1272
+ var AccordionItem = React.memo(
1273
+ ({
1274
+ item,
1275
+ isOpen,
1276
+ onToggle
1277
+ }) => {
1278
+ const bodyRef = React.useRef(null);
1279
+ const [height, setHeight] = React.useState(0);
1280
+ React.useEffect(() => {
1281
+ if (bodyRef.current) {
1282
+ setHeight(bodyRef.current.scrollHeight);
1300
1283
  }
1301
- )
1302
- ] });
1303
- };
1284
+ }, [isOpen, item.content]);
1285
+ return /* @__PURE__ */ jsxs189("div", { className: clsx_default("accordion-item", { open: isOpen }), children: [
1286
+ /* @__PURE__ */ jsxs189(
1287
+ "button",
1288
+ {
1289
+ className: "accordion-header",
1290
+ onClick: onToggle,
1291
+ "aria-expanded": isOpen,
1292
+ children: [
1293
+ /* @__PURE__ */ jsx295("span", { className: "title", children: item.title }),
1294
+ /* @__PURE__ */ jsx295("span", { className: "chevron", children: /* @__PURE__ */ jsx295(ChevronDownIcon_default, {}) })
1295
+ ]
1296
+ }
1297
+ ),
1298
+ /* @__PURE__ */ jsx295(
1299
+ "div",
1300
+ {
1301
+ ref: bodyRef,
1302
+ className: "accordion-body",
1303
+ style: { maxHeight: isOpen ? height : 0 },
1304
+ children: /* @__PURE__ */ jsx295("div", { className: "accordion-content", children: item.content })
1305
+ }
1306
+ )
1307
+ ] });
1308
+ }
1309
+ );
1310
+ AccordionItem.displayName = "AccordionItem";
1304
1311
  var Accordion = (props) => {
1305
1312
  const { items } = props;
1306
1313
  const isMultiple = props.multiple === true;
@@ -1555,6 +1562,76 @@ var MONTH_LABELS = {
1555
1562
 
1556
1563
  // src/components/Calendar/Calendar.tsx
1557
1564
  import { Fragment, jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
1565
+ var DayCell = React3.memo(
1566
+ ({
1567
+ day,
1568
+ disabled,
1569
+ selected,
1570
+ dayEvents,
1571
+ renderDay,
1572
+ onSelect,
1573
+ onEventClick
1574
+ }) => {
1575
+ if (renderDay) {
1576
+ return /* @__PURE__ */ jsx301(
1577
+ "div",
1578
+ {
1579
+ className: clsx_default(
1580
+ "calendar-day",
1581
+ !day.isCurrentMonth && "outside",
1582
+ disabled && "disabled",
1583
+ selected && "selected",
1584
+ day.isToday && "today"
1585
+ ),
1586
+ onClick: () => {
1587
+ if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1588
+ },
1589
+ children: renderDay(day, dayEvents)
1590
+ }
1591
+ );
1592
+ }
1593
+ return /* @__PURE__ */ jsxs193(
1594
+ "div",
1595
+ {
1596
+ className: clsx_default(
1597
+ "calendar-day",
1598
+ !day.isCurrentMonth && "outside",
1599
+ disabled && "disabled",
1600
+ selected && "selected",
1601
+ day.isToday && "today",
1602
+ day.isSunday && "sunday",
1603
+ day.isSaturday && "saturday"
1604
+ ),
1605
+ onClick: () => {
1606
+ if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1607
+ },
1608
+ children: [
1609
+ /* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
1610
+ dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
1611
+ dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
1612
+ "span",
1613
+ {
1614
+ className: "calendar-event-dot",
1615
+ style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
1616
+ title: event.label,
1617
+ onClick: (e) => {
1618
+ e.stopPropagation();
1619
+ onEventClick?.(event);
1620
+ }
1621
+ },
1622
+ ei
1623
+ )),
1624
+ dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
1625
+ "+",
1626
+ dayEvents.length - 3
1627
+ ] })
1628
+ ] })
1629
+ ]
1630
+ }
1631
+ );
1632
+ }
1633
+ );
1634
+ DayCell.displayName = "DayCell";
1558
1635
  var Calendar = (props) => {
1559
1636
  const {
1560
1637
  year: yearProp,
@@ -1640,12 +1717,28 @@ var Calendar = (props) => {
1640
1717
  setPickerMode("months");
1641
1718
  onMonthChange?.(y, month);
1642
1719
  };
1643
- const isDisabled = (date) => {
1644
- if (minDate && date < new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate())) return true;
1645
- if (maxDate && date > new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate())) return true;
1646
- return false;
1647
- };
1648
- const getEventsForDay = (date) => events.filter((e) => isSameDay(e.date, date));
1720
+ const minTime = React3.useMemo(
1721
+ () => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
1722
+ [minDate]
1723
+ );
1724
+ const maxTime = React3.useMemo(
1725
+ () => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
1726
+ [maxDate]
1727
+ );
1728
+ const eventsMap = React3.useMemo(() => {
1729
+ const map = /* @__PURE__ */ new Map();
1730
+ for (const e of events) {
1731
+ const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
1732
+ const arr = map.get(key);
1733
+ if (arr) arr.push(e);
1734
+ else map.set(key, [e]);
1735
+ }
1736
+ return map;
1737
+ }, [events]);
1738
+ const getEventsForDay = React3.useCallback(
1739
+ (date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
1740
+ [eventsMap]
1741
+ );
1649
1742
  const weekdays = WEEKDAY_LABELS[locale];
1650
1743
  const monthLabels = MONTH_LABELS[locale];
1651
1744
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
@@ -1699,64 +1792,19 @@ var Calendar = (props) => {
1699
1792
  )) }),
1700
1793
  /* @__PURE__ */ jsx301("div", { className: "calendar-grid", children: days.map((day, idx) => {
1701
1794
  const dayEvents = getEventsForDay(day.date);
1702
- const disabled = isDisabled(day.date);
1795
+ const t = day.date.getTime();
1796
+ const disabled = t < minTime || t > maxTime;
1703
1797
  const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
1704
- if (renderDay) {
1705
- return /* @__PURE__ */ jsx301(
1706
- "div",
1707
- {
1708
- className: clsx_default(
1709
- "calendar-day",
1710
- !day.isCurrentMonth && "outside",
1711
- disabled && "disabled",
1712
- isSelected && "selected",
1713
- day.isToday && "today"
1714
- ),
1715
- onClick: () => {
1716
- if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1717
- },
1718
- children: renderDay(day, dayEvents)
1719
- },
1720
- idx
1721
- );
1722
- }
1723
- return /* @__PURE__ */ jsxs193(
1724
- "div",
1798
+ return /* @__PURE__ */ jsx301(
1799
+ DayCell,
1725
1800
  {
1726
- className: clsx_default(
1727
- "calendar-day",
1728
- !day.isCurrentMonth && "outside",
1729
- disabled && "disabled",
1730
- isSelected && "selected",
1731
- day.isToday && "today",
1732
- day.isSunday && "sunday",
1733
- day.isSaturday && "saturday"
1734
- ),
1735
- onClick: () => {
1736
- if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
1737
- },
1738
- children: [
1739
- /* @__PURE__ */ jsx301("span", { className: "calendar-day-number", children: day.day }),
1740
- dayEvents.length > 0 && /* @__PURE__ */ jsxs193("div", { className: "calendar-day-events", children: [
1741
- dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx301(
1742
- "span",
1743
- {
1744
- className: "calendar-event-dot",
1745
- style: { backgroundColor: event.color ?? "var(--xplat-blue-500)" },
1746
- title: event.label,
1747
- onClick: (e) => {
1748
- e.stopPropagation();
1749
- onEventClick?.(event);
1750
- }
1751
- },
1752
- ei
1753
- )),
1754
- dayEvents.length > 3 && /* @__PURE__ */ jsxs193("span", { className: "calendar-event-more", children: [
1755
- "+",
1756
- dayEvents.length - 3
1757
- ] })
1758
- ] })
1759
- ]
1801
+ day,
1802
+ disabled,
1803
+ selected: isSelected,
1804
+ dayEvents,
1805
+ renderDay,
1806
+ onSelect,
1807
+ onEventClick
1760
1808
  },
1761
1809
  idx
1762
1810
  );
@@ -1904,14 +1952,28 @@ var useChartTooltip = (enabled) => {
1904
1952
  }, []);
1905
1953
  return { tooltip, show, hide, move, containerRef };
1906
1954
  };
1907
- var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
1908
- const entries = Object.entries(data);
1909
- const allValues = entries.flatMap(([, v]) => v);
1910
- const maxVal = Math.max(...allValues) * 1.2 || 1;
1955
+ var LineChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
1956
+ const entries = React5.useMemo(() => Object.entries(data), [data]);
1957
+ const maxVal = React5.useMemo(() => {
1958
+ const allValues = entries.flatMap(([, v]) => v);
1959
+ return Math.max(...allValues) * 1.2 || 1;
1960
+ }, [entries]);
1911
1961
  const count = labels.length;
1962
+ const chartW = 600 - PADDING.left - PADDING.right;
1963
+ const chartH = 300 - PADDING.top - PADDING.bottom;
1964
+ const seriesPoints = React5.useMemo(
1965
+ () => entries.map(
1966
+ ([, values]) => values.map((v, i) => ({
1967
+ x: PADDING.left + i / (count - 1 || 1) * chartW,
1968
+ y: PADDING.top + (1 - v / maxVal) * chartH,
1969
+ v
1970
+ }))
1971
+ ),
1972
+ [entries, count, chartW, chartH, maxVal]
1973
+ );
1912
1974
  return /* @__PURE__ */ jsxs196("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
1913
1975
  [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
1914
- const y = PADDING.top + (1 - ratio) * (300 - PADDING.top - PADDING.bottom);
1976
+ const y = PADDING.top + (1 - ratio) * chartH;
1915
1977
  const val = Math.round(maxVal * ratio);
1916
1978
  return /* @__PURE__ */ jsxs196("g", { children: [
1917
1979
  /* @__PURE__ */ jsx305("line", { x1: PADDING.left, y1: y, x2: 600 - PADDING.right, y2: y, className: "chart-grid" }),
@@ -1919,17 +1981,13 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
1919
1981
  ] }, ratio);
1920
1982
  }),
1921
1983
  labels.map((label, i) => {
1922
- const x = PADDING.left + i / (count - 1 || 1) * (600 - PADDING.left - PADDING.right);
1984
+ const x = PADDING.left + i / (count - 1 || 1) * chartW;
1923
1985
  return /* @__PURE__ */ jsx305("text", { x, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
1924
1986
  }),
1925
- entries.map(([key, values], di) => {
1987
+ entries.map(([key], di) => {
1926
1988
  const palette = getPalette(LINE_BAR_PALETTES, di);
1927
1989
  const color = palette[4];
1928
- const points = values.map((v, i) => {
1929
- const x = PADDING.left + i / (count - 1 || 1) * (600 - PADDING.left - PADDING.right);
1930
- const y = PADDING.top + (1 - v / maxVal) * (300 - PADDING.top - PADDING.bottom);
1931
- return { x, y, v };
1932
- });
1990
+ const points = seriesPoints[di];
1933
1991
  return /* @__PURE__ */ jsxs196("g", { children: [
1934
1992
  /* @__PURE__ */ jsx305(
1935
1993
  "polyline",
@@ -1957,17 +2015,31 @@ var LineChart = ({ data, labels, onHover, onMove, onLeave }) => {
1957
2015
  ] }, di);
1958
2016
  })
1959
2017
  ] });
1960
- };
1961
- var BarChart = ({ data, labels, onHover, onMove, onLeave }) => {
1962
- const entries = Object.entries(data);
1963
- const allValues = entries.flatMap(([, v]) => v);
1964
- const maxVal = Math.max(...allValues) * 1.2 || 1;
2018
+ });
2019
+ LineChart.displayName = "LineChart";
2020
+ var BarChart = React5.memo(({ data, labels, onHover, onMove, onLeave }) => {
2021
+ const entries = React5.useMemo(() => Object.entries(data), [data]);
2022
+ const maxVal = React5.useMemo(() => {
2023
+ const allValues = entries.flatMap(([, v]) => v);
2024
+ return Math.max(...allValues) * 1.2 || 1;
2025
+ }, [entries]);
1965
2026
  const count = labels.length;
1966
2027
  const groupCount = entries.length;
1967
2028
  const chartW = 600 - PADDING.left - PADDING.right;
1968
2029
  const chartH = 300 - PADDING.top - PADDING.bottom;
1969
2030
  const groupW = chartW / count;
1970
2031
  const barW = Math.min(32, groupW * 0.7 / groupCount);
2032
+ const bars = React5.useMemo(
2033
+ () => entries.map(
2034
+ ([, values], di) => values.map((v, i) => {
2035
+ const h = v / maxVal * chartH;
2036
+ const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
2037
+ const y = PADDING.top + chartH - h;
2038
+ return { x, y, w: barW, h, v };
2039
+ })
2040
+ ),
2041
+ [entries, maxVal, chartH, groupW, barW, groupCount]
2042
+ );
1971
2043
  return /* @__PURE__ */ jsxs196("svg", { viewBox: "0 0 600 300", className: "chart-svg", children: [
1972
2044
  [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
1973
2045
  const y = PADDING.top + (1 - ratio) * chartH;
@@ -1978,85 +2050,84 @@ var BarChart = ({ data, labels, onHover, onMove, onLeave }) => {
1978
2050
  ] }, ratio);
1979
2051
  }),
1980
2052
  labels.map((label, i) => /* @__PURE__ */ jsx305("text", { x: PADDING.left + groupW * i + groupW / 2, y: 300 - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i)),
1981
- entries.map(([key, values], di) => {
2053
+ entries.map(([key], di) => {
1982
2054
  const palette = getPalette(LINE_BAR_PALETTES, di);
1983
2055
  const color = palette[4];
1984
- return values.map((v, i) => {
1985
- const h = v / maxVal * chartH;
1986
- const x = PADDING.left + groupW * i + (groupW - barW * groupCount) / 2 + barW * di;
1987
- const y = PADDING.top + chartH - h;
1988
- return /* @__PURE__ */ jsx305(
1989
- "rect",
1990
- {
1991
- x,
1992
- y,
1993
- width: barW,
1994
- height: h,
1995
- rx: "2",
1996
- fill: color,
1997
- className: "chart-bar",
1998
- onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${v}`),
1999
- onMouseMove: onMove,
2000
- onMouseLeave: onLeave
2001
- },
2002
- `${di}-${i}`
2003
- );
2004
- });
2056
+ return bars[di].map((b, i) => /* @__PURE__ */ jsx305(
2057
+ "rect",
2058
+ {
2059
+ x: b.x,
2060
+ y: b.y,
2061
+ width: b.w,
2062
+ height: b.h,
2063
+ rx: "2",
2064
+ fill: color,
2065
+ className: "chart-bar",
2066
+ onMouseEnter: (e) => onHover(e, `${key}: ${labels[i]} \u2014 ${b.v}`),
2067
+ onMouseMove: onMove,
2068
+ onMouseLeave: onLeave
2069
+ },
2070
+ `${di}-${i}`
2071
+ ));
2005
2072
  })
2006
2073
  ] });
2007
- };
2008
- var PieDonutChart = ({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
2009
- const entries = Object.entries(data);
2010
- const values = entries.flatMap(([, v]) => v);
2011
- const total = values.reduce((a, b) => a + b, 0) || 1;
2012
- const cx = 150;
2013
- const cy = 150;
2014
- const r2 = 120;
2015
- const innerR = isDoughnut ? 60 : 0;
2016
- const palette = getPalette(PIE_PALETTES, 0);
2017
- let startAngle = -Math.PI / 2;
2018
- const slices = values.map((v, i) => {
2019
- const angle = v / total * Math.PI * 2;
2020
- const endAngle = startAngle + angle;
2021
- const largeArc = angle > Math.PI ? 1 : 0;
2022
- const x1 = cx + r2 * Math.cos(startAngle);
2023
- const y1 = cy + r2 * Math.sin(startAngle);
2024
- const x2 = cx + r2 * Math.cos(endAngle);
2025
- const y2 = cy + r2 * Math.sin(endAngle);
2026
- let d;
2027
- if (innerR > 0) {
2028
- const ix1 = cx + innerR * Math.cos(startAngle);
2029
- const iy1 = cy + innerR * Math.sin(startAngle);
2030
- const ix2 = cx + innerR * Math.cos(endAngle);
2031
- const iy2 = cy + innerR * Math.sin(endAngle);
2032
- 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`;
2033
- } else {
2034
- d = `M ${cx} ${cy} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} Z`;
2035
- }
2036
- const midAngle = startAngle + angle / 2;
2037
- const labelR = innerR > 0 ? (r2 + innerR) / 2 : r2 * 0.6;
2038
- const lx = cx + labelR * Math.cos(midAngle);
2039
- const ly = cy + labelR * Math.sin(midAngle);
2040
- const pct = Math.round(v / total * 100);
2041
- const label = labels[i] || `${i + 1}`;
2042
- startAngle = endAngle;
2043
- return /* @__PURE__ */ jsxs196("g", { children: [
2074
+ });
2075
+ BarChart.displayName = "BarChart";
2076
+ var PieDonutChart = React5.memo(
2077
+ ({ data, labels, isDoughnut, onHover, onMove, onLeave }) => {
2078
+ const values = React5.useMemo(() => Object.entries(data).flatMap(([, v]) => v), [data]);
2079
+ const total = React5.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
2080
+ const cx = 150;
2081
+ const cy = 150;
2082
+ const r2 = 120;
2083
+ const innerR = isDoughnut ? 60 : 0;
2084
+ const palette = getPalette(PIE_PALETTES, 0);
2085
+ const sliceData = React5.useMemo(() => {
2086
+ let angle0 = -Math.PI / 2;
2087
+ return values.map((v, i) => {
2088
+ const angle = v / total * Math.PI * 2;
2089
+ const endAngle = angle0 + angle;
2090
+ const largeArc = angle > Math.PI ? 1 : 0;
2091
+ const x1 = cx + r2 * Math.cos(angle0);
2092
+ const y1 = cy + r2 * Math.sin(angle0);
2093
+ const x2 = cx + r2 * Math.cos(endAngle);
2094
+ const y2 = cy + r2 * Math.sin(endAngle);
2095
+ let d;
2096
+ if (innerR > 0) {
2097
+ const ix1 = cx + innerR * Math.cos(angle0);
2098
+ const iy1 = cy + innerR * Math.sin(angle0);
2099
+ const ix2 = cx + innerR * Math.cos(endAngle);
2100
+ const iy2 = cy + innerR * Math.sin(endAngle);
2101
+ 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`;
2102
+ } else {
2103
+ d = `M ${cx} ${cy} L ${x1} ${y1} A ${r2} ${r2} 0 ${largeArc} 1 ${x2} ${y2} Z`;
2104
+ }
2105
+ const midAngle = angle0 + angle / 2;
2106
+ const labelR = innerR > 0 ? (r2 + innerR) / 2 : r2 * 0.6;
2107
+ const lx = cx + labelR * Math.cos(midAngle);
2108
+ const ly = cy + labelR * Math.sin(midAngle);
2109
+ const pct = Math.round(v / total * 100);
2110
+ angle0 = endAngle;
2111
+ return { d, lx, ly, v, pct, angle, label: labels[i] || `${i + 1}` };
2112
+ });
2113
+ }, [values, total, innerR, labels]);
2114
+ return /* @__PURE__ */ jsx305("svg", { viewBox: "0 0 300 300", className: "chart-svg chart-pie", children: sliceData.map((s, i) => /* @__PURE__ */ jsxs196("g", { children: [
2044
2115
  /* @__PURE__ */ jsx305(
2045
2116
  "path",
2046
2117
  {
2047
- d,
2118
+ d: s.d,
2048
2119
  fill: palette[i % palette.length],
2049
2120
  className: "chart-slice",
2050
- onMouseEnter: (e) => onHover(e, `${label}: ${v} (${pct}%)`),
2121
+ onMouseEnter: (e) => onHover(e, `${s.label}: ${s.v} (${s.pct}%)`),
2051
2122
  onMouseMove: onMove,
2052
2123
  onMouseLeave: onLeave
2053
2124
  }
2054
2125
  ),
2055
- angle > 0.2 && /* @__PURE__ */ jsx305("text", { x: lx, y: ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: v })
2056
- ] }, i);
2057
- });
2058
- return /* @__PURE__ */ jsx305("svg", { viewBox: "0 0 300 300", className: "chart-svg chart-pie", children: slices });
2059
- };
2126
+ s.angle > 0.2 && /* @__PURE__ */ jsx305("text", { x: s.lx, y: s.ly, className: "chart-pie-label", textAnchor: "middle", dominantBaseline: "central", children: s.v })
2127
+ ] }, i)) });
2128
+ }
2129
+ );
2130
+ PieDonutChart.displayName = "PieDonutChart";
2060
2131
  var Chart = (props) => {
2061
2132
  const { type, data, labels, tooltip: showTooltip = true } = props;
2062
2133
  const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
@@ -2352,7 +2423,7 @@ var useClickOutside_default = useClickOutside;
2352
2423
  // src/components/DatePicker/SingleDatePicker/index.tsx
2353
2424
  import React9 from "react";
2354
2425
  import { Fragment as Fragment2, jsx as jsx311, jsxs as jsxs200 } from "react/jsx-runtime";
2355
- var DayCell = React9.memo(
2426
+ var DayCell2 = React9.memo(
2356
2427
  ({
2357
2428
  day,
2358
2429
  disabled,
@@ -2382,7 +2453,7 @@ var DayCell = React9.memo(
2382
2453
  ),
2383
2454
  (prev, next) => prev.selected === next.selected && prev.disabled === next.disabled && prev.highlighted === next.highlighted && prev.day === next.day
2384
2455
  );
2385
- DayCell.displayName = "DayCell";
2456
+ DayCell2.displayName = "DayCell";
2386
2457
  var SingleDatePicker = (props) => {
2387
2458
  const {
2388
2459
  value,
@@ -2505,7 +2576,7 @@ var SingleDatePicker = (props) => {
2505
2576
  `${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
2506
2577
  );
2507
2578
  return /* @__PURE__ */ jsx311(
2508
- DayCell,
2579
+ DayCell2,
2509
2580
  {
2510
2581
  day,
2511
2582
  disabled,
@@ -2620,6 +2691,35 @@ var Modal_default = Modal;
2620
2691
  // src/components/DatePicker/RangePicker/index.tsx
2621
2692
  import React12 from "react";
2622
2693
  import { jsx as jsx314, jsxs as jsxs202 } from "react/jsx-runtime";
2694
+ var RangeDayCell = React12.memo(
2695
+ ({
2696
+ day,
2697
+ disabled,
2698
+ isStart,
2699
+ isEnd,
2700
+ inRange,
2701
+ onClick
2702
+ }) => /* @__PURE__ */ jsx314(
2703
+ "button",
2704
+ {
2705
+ type: "button",
2706
+ className: clsx_default(
2707
+ "datepicker-day",
2708
+ !day.isCurrentMonth && "outside",
2709
+ disabled && "disabled",
2710
+ (isStart || isEnd) && "selected",
2711
+ inRange && !isStart && !isEnd && "in-range",
2712
+ day.isToday && "today",
2713
+ day.isSunday && "sunday",
2714
+ day.isSaturday && "saturday"
2715
+ ),
2716
+ disabled: disabled || !day.isCurrentMonth,
2717
+ onClick,
2718
+ children: day.day
2719
+ }
2720
+ )
2721
+ );
2722
+ RangeDayCell.displayName = "RangeDayCell";
2623
2723
  var RangePicker = (props) => {
2624
2724
  const {
2625
2725
  startDate,
@@ -2696,20 +2796,13 @@ var RangePicker = (props) => {
2696
2796
  const isEnd = isSameDay(day.date, endDate);
2697
2797
  const inRange = isInRange(day.date, startDate, endDate);
2698
2798
  return /* @__PURE__ */ jsx314(
2699
- "button",
2799
+ RangeDayCell,
2700
2800
  {
2701
- type: "button",
2702
- className: clsx_default(
2703
- "datepicker-day",
2704
- !day.isCurrentMonth && "outside",
2705
- disabled && "disabled",
2706
- (isStart || isEnd) && "selected",
2707
- inRange && !isStart && !isEnd && "in-range",
2708
- day.isToday && "today",
2709
- day.isSunday && "sunday",
2710
- day.isSaturday && "saturday"
2711
- ),
2712
- disabled: disabled || !day.isCurrentMonth,
2801
+ day,
2802
+ disabled,
2803
+ isStart,
2804
+ isEnd,
2805
+ inRange,
2713
2806
  onClick: () => {
2714
2807
  if (!disabled && day.isCurrentMonth) {
2715
2808
  if (type === "start") {
@@ -2720,8 +2813,7 @@ var RangePicker = (props) => {
2720
2813
  onChange?.({ startDate, endDate: newEnd });
2721
2814
  }
2722
2815
  }
2723
- },
2724
- children: day.day
2816
+ }
2725
2817
  },
2726
2818
  idx
2727
2819
  );
@@ -3779,10 +3871,7 @@ var Steps = (props) => {
3779
3871
  return /* @__PURE__ */ jsx332("div", { className: clsx_default("lib-xplat-steps", type), children: items.map((item, index) => {
3780
3872
  const status = index < current ? "completed" : index === current ? "active" : "pending";
3781
3873
  return /* @__PURE__ */ jsxs215("div", { className: clsx_default("step-item", status), children: [
3782
- /* @__PURE__ */ jsxs215("div", { className: "step-indicator", children: [
3783
- /* @__PURE__ */ jsx332("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx332(CheckIcon_default, {}) : /* @__PURE__ */ jsx332("span", { children: index + 1 }) }),
3784
- index < items.length - 1 && /* @__PURE__ */ jsx332("div", { className: "step-line" })
3785
- ] }),
3874
+ /* @__PURE__ */ jsx332("div", { className: "step-circle", children: status === "completed" ? /* @__PURE__ */ jsx332(CheckIcon_default, {}) : /* @__PURE__ */ jsx332("span", { children: index + 1 }) }),
3786
3875
  /* @__PURE__ */ jsxs215("div", { className: "step-content", children: [
3787
3876
  /* @__PURE__ */ jsx332("span", { className: "step-title", children: item.title }),
3788
3877
  item.description && /* @__PURE__ */ jsx332("span", { className: "step-description", children: item.description })
@@ -3993,6 +4082,21 @@ var Swiper = (props) => {
3993
4082
  }, [isDragging, dragOffset, innerIndex, useLoop, maxIndex, slideStep, moveToInner]);
3994
4083
  const slideWidthPercent = 100 / viewItemCount;
3995
4084
  const gapAdjust = spaceBetween * (viewItemCount - 1) / viewItemCount;
4085
+ const slideElements = React26.useMemo(
4086
+ () => extendedItems.map((item, idx) => /* @__PURE__ */ jsx333(
4087
+ "div",
4088
+ {
4089
+ className: "lib-xplat-swiper__slide",
4090
+ style: {
4091
+ minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
4092
+ maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
4093
+ },
4094
+ children: item
4095
+ },
4096
+ idx
4097
+ )),
4098
+ [extendedItems, slideWidthPercent, gapAdjust]
4099
+ );
3996
4100
  const totalSteps = Math.ceil((maxIndex + 1) / slideBy);
3997
4101
  const currentStep = Math.min(
3998
4102
  Math.floor(realIndex / slideBy),
@@ -4018,18 +4122,7 @@ var Swiper = (props) => {
4018
4122
  gap: `${spaceBetween}px`
4019
4123
  },
4020
4124
  onTransitionEnd: handleTransitionEnd,
4021
- children: extendedItems.map((item, idx) => /* @__PURE__ */ jsx333(
4022
- "div",
4023
- {
4024
- className: "lib-xplat-swiper__slide",
4025
- style: {
4026
- minWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`,
4027
- maxWidth: `calc(${slideWidthPercent}% - ${gapAdjust}px)`
4028
- },
4029
- children: item
4030
- },
4031
- idx
4032
- ))
4125
+ children: slideElements
4033
4126
  }
4034
4127
  )
4035
4128
  }
@@ -4248,7 +4341,7 @@ var TableRowContext_default = TableRowContext;
4248
4341
 
4249
4342
  // src/components/Table/TableCell.tsx
4250
4343
  import { jsx as jsx339 } from "react/jsx-runtime";
4251
- var TableCell = (props) => {
4344
+ var TableCell = React33.memo((props) => {
4252
4345
  const {
4253
4346
  children,
4254
4347
  align = "center",
@@ -4303,7 +4396,7 @@ var TableCell = (props) => {
4303
4396
  children
4304
4397
  }
4305
4398
  );
4306
- };
4399
+ });
4307
4400
  TableCell.displayName = "TableCell";
4308
4401
  var TableCell_default = TableCell;
4309
4402
 
@@ -4322,7 +4415,7 @@ var TableHead_default = TableHead;
4322
4415
  // src/components/Table/TableRow.tsx
4323
4416
  import React34 from "react";
4324
4417
  import { jsx as jsx341 } from "react/jsx-runtime";
4325
- var TableRow = (props) => {
4418
+ var TableRow = React34.memo((props) => {
4326
4419
  const {
4327
4420
  children,
4328
4421
  type = "secondary",
@@ -4350,7 +4443,7 @@ var TableRow = (props) => {
4350
4443
  children
4351
4444
  }
4352
4445
  ) });
4353
- };
4446
+ });
4354
4447
  TableRow.displayName = "TableRow";
4355
4448
  var TableRow_default = TableRow;
4356
4449
 
@@ -4558,7 +4651,6 @@ var Video = React38.forwardRef((props, ref) => {
4558
4651
  const {
4559
4652
  src,
4560
4653
  poster,
4561
- controls = true,
4562
4654
  autoPlay,
4563
4655
  muted,
4564
4656
  loop,
@@ -4597,49 +4689,39 @@ var Video = React38.forwardRef((props, ref) => {
4597
4689
  videoRef.current.play();
4598
4690
  }
4599
4691
  };
4600
- const showCustomOverlay = !controls;
4601
- return /* @__PURE__ */ jsxs221(
4602
- "div",
4603
- {
4604
- className: clsx_default(
4605
- "lib-xplat-video",
4606
- showCustomOverlay && "custom-overlay"
4607
- ),
4608
- children: [
4609
- /* @__PURE__ */ jsx346(
4610
- "video",
4611
- {
4612
- ref: setRefs,
4613
- src,
4614
- poster,
4615
- controls,
4616
- autoPlay,
4617
- muted,
4618
- loop,
4619
- playsInline: playsInline ?? true,
4620
- onPlay: handlePlay,
4621
- onPause: handlePause,
4622
- onLoadedData: handleLoadedData,
4623
- ...rest
4624
- }
4692
+ return /* @__PURE__ */ jsxs221("div", { className: "lib-xplat-video custom-overlay", children: [
4693
+ /* @__PURE__ */ jsx346(
4694
+ "video",
4695
+ {
4696
+ ref: setRefs,
4697
+ src,
4698
+ poster,
4699
+ autoPlay,
4700
+ muted,
4701
+ loop,
4702
+ playsInline: playsInline ?? true,
4703
+ onPlay: handlePlay,
4704
+ onPause: handlePause,
4705
+ onLoadedData: handleLoadedData,
4706
+ onClick: togglePlay,
4707
+ ...rest
4708
+ }
4709
+ ),
4710
+ /* @__PURE__ */ jsx346(
4711
+ "button",
4712
+ {
4713
+ type: "button",
4714
+ className: clsx_default(
4715
+ "play-overlay",
4716
+ isPlaying && "is-playing",
4717
+ !isLoaded && "is-loading"
4625
4718
  ),
4626
- showCustomOverlay && /* @__PURE__ */ jsx346(
4627
- "button",
4628
- {
4629
- type: "button",
4630
- className: clsx_default(
4631
- "play-overlay",
4632
- isPlaying && "is-playing",
4633
- !isLoaded && "is-loading"
4634
- ),
4635
- onClick: togglePlay,
4636
- "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
4637
- children: isPlaying ? /* @__PURE__ */ jsx346(PauseIcon_default, {}) : /* @__PURE__ */ jsx346("span", { className: "play-icon", children: /* @__PURE__ */ jsx346(PlayCircleIcon_default, {}) })
4638
- }
4639
- )
4640
- ]
4641
- }
4642
- );
4719
+ onClick: togglePlay,
4720
+ "aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
4721
+ children: isPlaying ? /* @__PURE__ */ jsx346(PauseIcon_default, {}) : /* @__PURE__ */ jsx346("span", { className: "play-icon", children: /* @__PURE__ */ jsx346(PlayCircleIcon_default, {}) })
4722
+ }
4723
+ )
4724
+ ] });
4643
4725
  });
4644
4726
  Video.displayName = "Video";
4645
4727
  var Video_default = Video;