@x-plat/design-system 0.5.66 → 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/components/Accordion/index.css +6 -6
- package/dist/components/AutoResizeTextArea/index.css +5 -5
- package/dist/components/Avatar/index.css +2 -2
- package/dist/components/Badge/index.css +1 -1
- package/dist/components/Box/index.css +5 -5
- package/dist/components/Breadcrumb/index.css +4 -4
- package/dist/components/Button/index.cjs +1 -2
- package/dist/components/Button/index.css +6 -6
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +1 -2
- package/dist/components/Calendar/index.cjs +1 -1
- package/dist/components/Calendar/index.css +18 -18
- package/dist/components/Calendar/index.js +1 -1
- package/dist/components/CardTab/index.css +8 -8
- package/dist/components/Chart/index.css +11 -11
- package/dist/components/ChatInput/index.cjs +1 -2
- package/dist/components/ChatInput/index.css +16 -16
- package/dist/components/ChatInput/index.js +1 -2
- package/dist/components/CheckBox/index.css +2 -2
- package/dist/components/CheckBox/index.js +1 -1
- package/dist/components/Chip/index.css +5 -5
- package/dist/components/DatePicker/index.cjs +1 -2
- package/dist/components/DatePicker/index.css +36 -36
- package/dist/components/DatePicker/index.js +1 -2
- package/dist/components/Divider/index.css +2 -2
- package/dist/components/Drawer/index.css +5 -5
- package/dist/components/Dropdown/index.css +4 -4
- package/dist/components/Editor/index.css +36 -36
- package/dist/components/EmptyState/index.css +2 -2
- package/dist/components/FileUpload/index.css +4 -4
- package/dist/components/HtmlTypeWriter/index.css +1 -1
- package/dist/components/IconButton/index.cjs +1 -2
- package/dist/components/IconButton/index.css +5 -5
- package/dist/components/IconButton/index.d.cts +1 -1
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/IconButton/index.js +1 -2
- package/dist/components/ImageSelector/index.css +7 -7
- package/dist/components/Input/index.css +7 -7
- package/dist/components/Modal/index.css +1 -1
- package/dist/components/Pagination/index.css +3 -3
- package/dist/components/PopOver/index.css +1 -1
- package/dist/components/Progress/index.css +1 -1
- package/dist/components/Radio/index.css +5 -5
- package/dist/components/Select/index.css +9 -9
- package/dist/components/Skeleton/index.cjs +6 -6
- package/dist/components/Skeleton/index.js +6 -6
- package/dist/components/Spinner/index.css +1 -1
- package/dist/components/Steps/index.css +3 -3
- package/dist/components/Swiper/index.css +3 -3
- package/dist/components/Switch/index.css +3 -3
- package/dist/components/Tab/index.css +4 -4
- package/dist/components/Table/index.css +10 -10
- package/dist/components/Tag/index.css +3 -3
- package/dist/components/TextArea/index.css +5 -5
- package/dist/components/Tooltip/index.css +4 -4
- package/dist/components/Video/index.css +2 -2
- package/dist/components/index.cjs +249 -251
- package/dist/components/index.css +667 -1059
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +224 -226
- package/dist/index.cjs +249 -253
- package/dist/index.css +670 -1062
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +224 -227
- package/dist/layout/Header/index.css +2 -2
- package/dist/layout/Layout/index.css +1 -1
- package/dist/layout/index.css +404 -796
- package/dist/tokens/index.cjs +0 -2
- package/dist/tokens/index.d.cts +9 -10
- package/dist/tokens/index.d.ts +9 -10
- package/dist/tokens/index.js +1 -2
- package/guidelines/AGENT_PROMPT.md +8 -9
- package/guidelines/Guidelines.md +1 -1
- package/guidelines/components/chart.md +1 -1
- package/guidelines/foundations/color.md +22 -23
- package/guidelines/foundations/typography.md +86 -36
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1503,8 +1503,69 @@ var Alert = (props) => {
|
|
|
1503
1503
|
Alert.displayName = "Alert";
|
|
1504
1504
|
var Alert_default = Alert;
|
|
1505
1505
|
|
|
1506
|
-
// src/components/
|
|
1506
|
+
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
1507
|
+
import React2 from "react";
|
|
1507
1508
|
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
1509
|
+
var MAX_HEIGHT = 400;
|
|
1510
|
+
var AutoResizeTextArea = React2.forwardRef(
|
|
1511
|
+
(props, ref) => {
|
|
1512
|
+
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
1513
|
+
const localRef = React2.useRef(null);
|
|
1514
|
+
const setRefs = (el) => {
|
|
1515
|
+
localRef.current = el;
|
|
1516
|
+
if (!ref) return;
|
|
1517
|
+
if (typeof ref === "function") ref(el);
|
|
1518
|
+
else if (ref && "current" in ref)
|
|
1519
|
+
ref.current = el;
|
|
1520
|
+
};
|
|
1521
|
+
const updateHeight = () => {
|
|
1522
|
+
const el = localRef.current;
|
|
1523
|
+
if (!el) return;
|
|
1524
|
+
el.style.height = "0px";
|
|
1525
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
1526
|
+
};
|
|
1527
|
+
const handleChange = (e) => {
|
|
1528
|
+
if (onChange) {
|
|
1529
|
+
const event = {
|
|
1530
|
+
...e,
|
|
1531
|
+
target: { value: e.target.value }
|
|
1532
|
+
};
|
|
1533
|
+
onChange(event);
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
React2.useEffect(() => {
|
|
1537
|
+
updateHeight();
|
|
1538
|
+
}, [value]);
|
|
1539
|
+
if (bare) {
|
|
1540
|
+
return /* @__PURE__ */ jsx297(
|
|
1541
|
+
"textarea",
|
|
1542
|
+
{
|
|
1543
|
+
...textareaProps,
|
|
1544
|
+
ref: setRefs,
|
|
1545
|
+
className,
|
|
1546
|
+
disabled,
|
|
1547
|
+
value,
|
|
1548
|
+
onChange: handleChange
|
|
1549
|
+
}
|
|
1550
|
+
);
|
|
1551
|
+
}
|
|
1552
|
+
return /* @__PURE__ */ jsx297("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ jsx297("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ jsx297(
|
|
1553
|
+
"textarea",
|
|
1554
|
+
{
|
|
1555
|
+
...textareaProps,
|
|
1556
|
+
ref: setRefs,
|
|
1557
|
+
disabled,
|
|
1558
|
+
value,
|
|
1559
|
+
onChange: handleChange
|
|
1560
|
+
}
|
|
1561
|
+
) }) });
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1564
|
+
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
1565
|
+
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
1566
|
+
|
|
1567
|
+
// src/components/Avatar/Avatar.tsx
|
|
1568
|
+
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
1508
1569
|
var CATEGORICAL_COUNT = 8;
|
|
1509
1570
|
var getColorIndex = (name) => {
|
|
1510
1571
|
if (!name) return 1;
|
|
@@ -1521,13 +1582,13 @@ var Avatar = (props) => {
|
|
|
1521
1582
|
const fullInitials = name ? name.split(" ").map((s) => s[0]).join("").slice(0, 2).toUpperCase() : "";
|
|
1522
1583
|
const initials = size === "sm" ? fullInitials.slice(0, 1) : fullInitials;
|
|
1523
1584
|
const catIndex = getColorIndex(name || "");
|
|
1524
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ jsx298("div", { className: clsx_default("lib-xplat-avatar", size), children: src ? /* @__PURE__ */ jsx298("img", { src, alt: alt || name || "avatar" }) : /* @__PURE__ */ jsx298("div", { className: clsx_default("fallback", `cat-${catIndex}`), children: initials || /* @__PURE__ */ jsx298("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx298("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" }) }) }) });
|
|
1525
1586
|
};
|
|
1526
1587
|
Avatar.displayName = "Avatar";
|
|
1527
1588
|
var Avatar_default = Avatar;
|
|
1528
1589
|
|
|
1529
1590
|
// src/components/Badge/Badge.tsx
|
|
1530
|
-
import { jsx as
|
|
1591
|
+
import { jsx as jsx299, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
1531
1592
|
var Badge = (props) => {
|
|
1532
1593
|
const {
|
|
1533
1594
|
children,
|
|
@@ -1541,14 +1602,14 @@ var Badge = (props) => {
|
|
|
1541
1602
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
1542
1603
|
return /* @__PURE__ */ jsxs191("div", { className: clsx_default("lib-xplat-badge", size), children: [
|
|
1543
1604
|
children,
|
|
1544
|
-
showBadge && /* @__PURE__ */
|
|
1605
|
+
showBadge && /* @__PURE__ */ jsx299("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
|
|
1545
1606
|
] });
|
|
1546
1607
|
};
|
|
1547
1608
|
Badge.displayName = "Badge";
|
|
1548
1609
|
var Badge_default = Badge;
|
|
1549
1610
|
|
|
1550
1611
|
// src/components/Box/Box.tsx
|
|
1551
|
-
import { jsx as
|
|
1612
|
+
import { jsx as jsx300, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
1552
1613
|
var Box = ({
|
|
1553
1614
|
children,
|
|
1554
1615
|
title,
|
|
@@ -1556,22 +1617,22 @@ var Box = ({
|
|
|
1556
1617
|
padding = "md"
|
|
1557
1618
|
}) => {
|
|
1558
1619
|
return /* @__PURE__ */ jsxs192("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
1559
|
-
title && /* @__PURE__ */
|
|
1560
|
-
/* @__PURE__ */
|
|
1620
|
+
title && /* @__PURE__ */ jsx300("div", { className: "box-title", children: title }),
|
|
1621
|
+
/* @__PURE__ */ jsx300("div", { className: "box-content", children })
|
|
1561
1622
|
] });
|
|
1562
1623
|
};
|
|
1563
1624
|
Box.displayName = "Box";
|
|
1564
1625
|
var Box_default = Box;
|
|
1565
1626
|
|
|
1566
1627
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
1567
|
-
import { jsx as
|
|
1628
|
+
import { jsx as jsx301, jsxs as jsxs193 } from "react/jsx-runtime";
|
|
1568
1629
|
var Breadcrumb = (props) => {
|
|
1569
1630
|
const { items, separator = "/" } = props;
|
|
1570
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsx301("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ jsx301("ol", { children: items.map((item, index) => {
|
|
1571
1632
|
const isLast = index === items.length - 1;
|
|
1572
1633
|
return /* @__PURE__ */ jsxs193("li", { children: [
|
|
1573
|
-
isLast ? /* @__PURE__ */
|
|
1574
|
-
!isLast && /* @__PURE__ */
|
|
1634
|
+
isLast ? /* @__PURE__ */ jsx301("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ jsx301("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ jsx301("button", { className: "link", onClick: item.onClick, children: item.label }),
|
|
1635
|
+
!isLast && /* @__PURE__ */ jsx301("span", { className: "separator", children: separator })
|
|
1575
1636
|
] }, index);
|
|
1576
1637
|
}) }) });
|
|
1577
1638
|
};
|
|
@@ -1579,20 +1640,19 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
1579
1640
|
var Breadcrumb_default = Breadcrumb;
|
|
1580
1641
|
|
|
1581
1642
|
// src/components/Button/Button.tsx
|
|
1582
|
-
import { jsx as
|
|
1643
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
1583
1644
|
var Button = (props) => {
|
|
1584
1645
|
const {
|
|
1585
1646
|
children,
|
|
1586
|
-
className,
|
|
1587
1647
|
type = "primary",
|
|
1588
1648
|
size = "md",
|
|
1589
1649
|
disabled,
|
|
1590
1650
|
...rest
|
|
1591
1651
|
} = props;
|
|
1592
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ jsx302(
|
|
1593
1653
|
"button",
|
|
1594
1654
|
{
|
|
1595
|
-
className: clsx_default("lib-xplat-button", type, size
|
|
1655
|
+
className: clsx_default("lib-xplat-button", type, size),
|
|
1596
1656
|
disabled,
|
|
1597
1657
|
...rest,
|
|
1598
1658
|
children
|
|
@@ -1603,15 +1663,15 @@ Button.displayName = "Button";
|
|
|
1603
1663
|
var Button_default = Button;
|
|
1604
1664
|
|
|
1605
1665
|
// src/components/Calendar/Calendar.tsx
|
|
1606
|
-
import
|
|
1666
|
+
import React4 from "react";
|
|
1607
1667
|
|
|
1608
1668
|
// src/components/Calendar/useCalendar.ts
|
|
1609
|
-
import
|
|
1669
|
+
import React3 from "react";
|
|
1610
1670
|
var useCalendar = (initialYear, initialMonth) => {
|
|
1611
1671
|
const today = /* @__PURE__ */ new Date();
|
|
1612
|
-
const [year, setYear] =
|
|
1613
|
-
const [month, setMonth] =
|
|
1614
|
-
const days =
|
|
1672
|
+
const [year, setYear] = React3.useState(initialYear ?? today.getFullYear());
|
|
1673
|
+
const [month, setMonth] = React3.useState(initialMonth ?? today.getMonth());
|
|
1674
|
+
const days = React3.useMemo(() => {
|
|
1615
1675
|
const firstDay = new Date(year, month, 1);
|
|
1616
1676
|
const lastDay = new Date(year, month + 1, 0);
|
|
1617
1677
|
const startDayOfWeek = firstDay.getDay();
|
|
@@ -1654,7 +1714,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1654
1714
|
}
|
|
1655
1715
|
return result;
|
|
1656
1716
|
}, [year, month]);
|
|
1657
|
-
const goToPrevMonth =
|
|
1717
|
+
const goToPrevMonth = React3.useCallback(() => {
|
|
1658
1718
|
setMonth((prev) => {
|
|
1659
1719
|
if (prev === 0) {
|
|
1660
1720
|
setYear((y) => y - 1);
|
|
@@ -1663,7 +1723,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1663
1723
|
return prev - 1;
|
|
1664
1724
|
});
|
|
1665
1725
|
}, []);
|
|
1666
|
-
const goToNextMonth =
|
|
1726
|
+
const goToNextMonth = React3.useCallback(() => {
|
|
1667
1727
|
setMonth((prev) => {
|
|
1668
1728
|
if (prev === 11) {
|
|
1669
1729
|
setYear((y) => y + 1);
|
|
@@ -1672,7 +1732,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1672
1732
|
return prev + 1;
|
|
1673
1733
|
});
|
|
1674
1734
|
}, []);
|
|
1675
|
-
const goToToday =
|
|
1735
|
+
const goToToday = React3.useCallback(() => {
|
|
1676
1736
|
setYear(today.getFullYear());
|
|
1677
1737
|
setMonth(today.getMonth());
|
|
1678
1738
|
}, []);
|
|
@@ -1706,8 +1766,8 @@ var MONTH_LABELS = {
|
|
|
1706
1766
|
};
|
|
1707
1767
|
|
|
1708
1768
|
// src/components/Calendar/Calendar.tsx
|
|
1709
|
-
import { Fragment, jsx as
|
|
1710
|
-
var DayCell =
|
|
1769
|
+
import { Fragment, jsx as jsx303, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
1770
|
+
var DayCell = React4.memo(
|
|
1711
1771
|
({
|
|
1712
1772
|
day,
|
|
1713
1773
|
disabled,
|
|
@@ -1718,7 +1778,7 @@ var DayCell = React3.memo(
|
|
|
1718
1778
|
onEventClick
|
|
1719
1779
|
}) => {
|
|
1720
1780
|
if (renderDay) {
|
|
1721
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx303(
|
|
1722
1782
|
"div",
|
|
1723
1783
|
{
|
|
1724
1784
|
className: clsx_default(
|
|
@@ -1751,13 +1811,13 @@ var DayCell = React3.memo(
|
|
|
1751
1811
|
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
1752
1812
|
},
|
|
1753
1813
|
children: [
|
|
1754
|
-
/* @__PURE__ */
|
|
1814
|
+
/* @__PURE__ */ jsx303("span", { className: "calendar-day-number", children: day.day }),
|
|
1755
1815
|
dayEvents.length > 0 && /* @__PURE__ */ jsxs194("div", { className: "calendar-day-events", children: [
|
|
1756
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */
|
|
1816
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ jsx303(
|
|
1757
1817
|
"span",
|
|
1758
1818
|
{
|
|
1759
1819
|
className: "calendar-event-dot",
|
|
1760
|
-
style: { backgroundColor: event.color ?? "var(--
|
|
1820
|
+
style: { backgroundColor: event.color ?? "var(--semantic-surface-brand-default)" },
|
|
1761
1821
|
title: event.label,
|
|
1762
1822
|
onClick: (e) => {
|
|
1763
1823
|
e.stopPropagation();
|
|
@@ -1803,14 +1863,14 @@ var Calendar = (props) => {
|
|
|
1803
1863
|
setYear,
|
|
1804
1864
|
setMonth
|
|
1805
1865
|
} = useCalendar(yearProp, monthProp);
|
|
1806
|
-
const [pickerMode, setPickerMode] =
|
|
1807
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
1866
|
+
const [pickerMode, setPickerMode] = React4.useState("days");
|
|
1867
|
+
const [yearRangeStart, setYearRangeStart] = React4.useState(
|
|
1808
1868
|
Math.floor(year / 12) * 12
|
|
1809
1869
|
);
|
|
1810
|
-
|
|
1870
|
+
React4.useEffect(() => {
|
|
1811
1871
|
if (yearProp !== void 0) setYear(yearProp);
|
|
1812
1872
|
}, [yearProp, setYear]);
|
|
1813
|
-
|
|
1873
|
+
React4.useEffect(() => {
|
|
1814
1874
|
if (monthProp !== void 0) setMonth(monthProp);
|
|
1815
1875
|
}, [monthProp, setMonth]);
|
|
1816
1876
|
const handlePrev = () => {
|
|
@@ -1862,15 +1922,15 @@ var Calendar = (props) => {
|
|
|
1862
1922
|
setPickerMode("months");
|
|
1863
1923
|
onMonthChange?.(y, month);
|
|
1864
1924
|
};
|
|
1865
|
-
const minTime =
|
|
1925
|
+
const minTime = React4.useMemo(
|
|
1866
1926
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
1867
1927
|
[minDate]
|
|
1868
1928
|
);
|
|
1869
|
-
const maxTime =
|
|
1929
|
+
const maxTime = React4.useMemo(
|
|
1870
1930
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
1871
1931
|
[maxDate]
|
|
1872
1932
|
);
|
|
1873
|
-
const eventsMap =
|
|
1933
|
+
const eventsMap = React4.useMemo(() => {
|
|
1874
1934
|
const map = /* @__PURE__ */ new Map();
|
|
1875
1935
|
for (const e of events) {
|
|
1876
1936
|
const key = `${e.date.getFullYear()}-${e.date.getMonth()}-${e.date.getDate()}`;
|
|
@@ -1880,7 +1940,7 @@ var Calendar = (props) => {
|
|
|
1880
1940
|
}
|
|
1881
1941
|
return map;
|
|
1882
1942
|
}, [events]);
|
|
1883
|
-
const getEventsForDay =
|
|
1943
|
+
const getEventsForDay = React4.useCallback(
|
|
1884
1944
|
(date) => eventsMap.get(`${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`) ?? [],
|
|
1885
1945
|
[eventsMap]
|
|
1886
1946
|
);
|
|
@@ -1894,14 +1954,14 @@ var Calendar = (props) => {
|
|
|
1894
1954
|
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
1895
1955
|
children: [
|
|
1896
1956
|
/* @__PURE__ */ jsxs194("div", { className: "calendar-header", children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
showToday && /* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ jsx303(ChevronLeftIcon_default, {}) }),
|
|
1958
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
1959
|
+
/* @__PURE__ */ jsx303("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ jsx303(ChevronRightIcon_default, {}) }),
|
|
1960
|
+
showToday && /* @__PURE__ */ jsx303("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
1901
1961
|
] }),
|
|
1902
|
-
pickerMode === "years" && /* @__PURE__ */
|
|
1962
|
+
pickerMode === "years" && /* @__PURE__ */ jsx303("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
1903
1963
|
const y = yearRangeStart + i;
|
|
1904
|
-
return /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ jsx303(
|
|
1905
1965
|
"button",
|
|
1906
1966
|
{
|
|
1907
1967
|
type: "button",
|
|
@@ -1912,7 +1972,7 @@ var Calendar = (props) => {
|
|
|
1912
1972
|
y
|
|
1913
1973
|
);
|
|
1914
1974
|
}) }),
|
|
1915
|
-
pickerMode === "months" && /* @__PURE__ */
|
|
1975
|
+
pickerMode === "months" && /* @__PURE__ */ jsx303("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ jsx303(
|
|
1916
1976
|
"button",
|
|
1917
1977
|
{
|
|
1918
1978
|
type: "button",
|
|
@@ -1923,7 +1983,7 @@ var Calendar = (props) => {
|
|
|
1923
1983
|
i
|
|
1924
1984
|
)) }),
|
|
1925
1985
|
pickerMode === "days" && /* @__PURE__ */ jsxs194(Fragment, { children: [
|
|
1926
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx303("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ jsx303(
|
|
1927
1987
|
"div",
|
|
1928
1988
|
{
|
|
1929
1989
|
className: clsx_default(
|
|
@@ -1935,12 +1995,12 @@ var Calendar = (props) => {
|
|
|
1935
1995
|
},
|
|
1936
1996
|
label
|
|
1937
1997
|
)) }),
|
|
1938
|
-
/* @__PURE__ */
|
|
1998
|
+
/* @__PURE__ */ jsx303("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
1939
1999
|
const dayEvents = getEventsForDay(day.date);
|
|
1940
2000
|
const t = day.date.getTime();
|
|
1941
2001
|
const disabled = t < minTime || t > maxTime;
|
|
1942
2002
|
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
1943
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsx303(
|
|
1944
2004
|
DayCell,
|
|
1945
2005
|
{
|
|
1946
2006
|
day,
|
|
@@ -1963,13 +2023,13 @@ Calendar.displayName = "Calendar";
|
|
|
1963
2023
|
var Calendar_default = Calendar;
|
|
1964
2024
|
|
|
1965
2025
|
// src/components/CardTab/CardTab.tsx
|
|
1966
|
-
import
|
|
2026
|
+
import React5 from "react";
|
|
1967
2027
|
|
|
1968
2028
|
// src/components/CardTab/CardTabPanel.tsx
|
|
1969
|
-
import { jsx as
|
|
2029
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
1970
2030
|
var CardTabPanel = (props) => {
|
|
1971
2031
|
const { children, columns = 3 } = props;
|
|
1972
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ jsx304(
|
|
1973
2033
|
"div",
|
|
1974
2034
|
{
|
|
1975
2035
|
className: "card-tab-panel",
|
|
@@ -1982,7 +2042,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
1982
2042
|
var CardTabPanel_default = CardTabPanel;
|
|
1983
2043
|
|
|
1984
2044
|
// src/components/CardTab/CardTab.tsx
|
|
1985
|
-
import { jsx as
|
|
2045
|
+
import { jsx as jsx305, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
1986
2046
|
var CardTabRoot = (props) => {
|
|
1987
2047
|
const {
|
|
1988
2048
|
tabs,
|
|
@@ -1992,7 +2052,7 @@ var CardTabRoot = (props) => {
|
|
|
1992
2052
|
children
|
|
1993
2053
|
} = props;
|
|
1994
2054
|
const isControlled = activeValueProp !== void 0;
|
|
1995
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
2055
|
+
const [uncontrolledValue, setUncontrolledValue] = React5.useState(tabs[0]?.value ?? "");
|
|
1996
2056
|
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
1997
2057
|
const handleTabClick = (tab) => {
|
|
1998
2058
|
if (!isControlled) {
|
|
@@ -2000,16 +2060,16 @@ var CardTabRoot = (props) => {
|
|
|
2000
2060
|
}
|
|
2001
2061
|
onChange?.(tab);
|
|
2002
2062
|
};
|
|
2003
|
-
const panels =
|
|
2004
|
-
(child) =>
|
|
2063
|
+
const panels = React5.Children.toArray(children).filter(
|
|
2064
|
+
(child) => React5.isValidElement(child) && child.type === CardTabPanel_default
|
|
2005
2065
|
);
|
|
2006
2066
|
const activePanel = panels.find(
|
|
2007
2067
|
(panel) => panel.props.value === activeValue
|
|
2008
2068
|
);
|
|
2009
2069
|
return /* @__PURE__ */ jsxs195("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2011
2071
|
const isActive2 = tab.value === activeValue;
|
|
2012
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsx305(
|
|
2013
2073
|
"button",
|
|
2014
2074
|
{
|
|
2015
2075
|
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
@@ -2021,7 +2081,7 @@ var CardTabRoot = (props) => {
|
|
|
2021
2081
|
tab.value
|
|
2022
2082
|
);
|
|
2023
2083
|
}) }),
|
|
2024
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsx305("div", { className: "card-tab-body", children: activePanel })
|
|
2025
2085
|
] });
|
|
2026
2086
|
};
|
|
2027
2087
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -2031,8 +2091,8 @@ var CardTab = Object.assign(CardTabRoot, {
|
|
|
2031
2091
|
var CardTab_default = CardTab;
|
|
2032
2092
|
|
|
2033
2093
|
// src/components/Chart/Chart.tsx
|
|
2034
|
-
import
|
|
2035
|
-
import { Fragment as Fragment2, jsx as
|
|
2094
|
+
import React6 from "react";
|
|
2095
|
+
import { Fragment as Fragment2, jsx as jsx306, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
2036
2096
|
var CATEGORICAL_COUNT2 = 8;
|
|
2037
2097
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2038
2098
|
const n = i + 1;
|
|
@@ -2077,8 +2137,8 @@ var toSmoothPath = (points) => {
|
|
|
2077
2137
|
return d;
|
|
2078
2138
|
};
|
|
2079
2139
|
var useChartSize = (ref) => {
|
|
2080
|
-
const [size, setSize] =
|
|
2081
|
-
|
|
2140
|
+
const [size, setSize] = React6.useState({ width: 0, height: 0 });
|
|
2141
|
+
React6.useEffect(() => {
|
|
2082
2142
|
const el = ref.current;
|
|
2083
2143
|
if (!el) return;
|
|
2084
2144
|
let rafId = 0;
|
|
@@ -2104,10 +2164,10 @@ var useChartSize = (ref) => {
|
|
|
2104
2164
|
};
|
|
2105
2165
|
var prefersReducedMotion = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2106
2166
|
var useChartAnimation = (containerRef, dataKey) => {
|
|
2107
|
-
const [animate, setAnimate] =
|
|
2108
|
-
const prevDataKey =
|
|
2109
|
-
const hasAnimated =
|
|
2110
|
-
|
|
2167
|
+
const [animate, setAnimate] = React6.useState(false);
|
|
2168
|
+
const prevDataKey = React6.useRef(dataKey);
|
|
2169
|
+
const hasAnimated = React6.useRef(false);
|
|
2170
|
+
React6.useEffect(() => {
|
|
2111
2171
|
if (prefersReducedMotion()) return;
|
|
2112
2172
|
const el = containerRef.current;
|
|
2113
2173
|
if (!el) return;
|
|
@@ -2123,7 +2183,7 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2123
2183
|
observer.observe(el);
|
|
2124
2184
|
return () => observer.disconnect();
|
|
2125
2185
|
}, [containerRef]);
|
|
2126
|
-
|
|
2186
|
+
React6.useEffect(() => {
|
|
2127
2187
|
if (dataKey !== prevDataKey.current) {
|
|
2128
2188
|
prevDataKey.current = dataKey;
|
|
2129
2189
|
if (prefersReducedMotion()) return;
|
|
@@ -2137,15 +2197,15 @@ var useChartAnimation = (containerRef, dataKey) => {
|
|
|
2137
2197
|
};
|
|
2138
2198
|
var TOOLTIP_OFFSET = 12;
|
|
2139
2199
|
var useChartTooltip = (enabled) => {
|
|
2140
|
-
const [tooltip, setTooltip] =
|
|
2200
|
+
const [tooltip, setTooltip] = React6.useState({
|
|
2141
2201
|
visible: false,
|
|
2142
2202
|
x: 0,
|
|
2143
2203
|
y: 0,
|
|
2144
2204
|
content: ""
|
|
2145
2205
|
});
|
|
2146
|
-
const containerRef =
|
|
2147
|
-
const rafRef =
|
|
2148
|
-
const move =
|
|
2206
|
+
const containerRef = React6.useRef(null);
|
|
2207
|
+
const rafRef = React6.useRef(0);
|
|
2208
|
+
const move = React6.useCallback((e) => {
|
|
2149
2209
|
if (!enabled) return;
|
|
2150
2210
|
const cx = e.clientX;
|
|
2151
2211
|
const cy = e.clientY;
|
|
@@ -2156,24 +2216,24 @@ var useChartTooltip = (enabled) => {
|
|
|
2156
2216
|
setTooltip((prev) => ({ ...prev, x: cx - rect.left, y: cy - rect.top }));
|
|
2157
2217
|
});
|
|
2158
2218
|
}, [enabled]);
|
|
2159
|
-
const show =
|
|
2219
|
+
const show = React6.useCallback((e, content) => {
|
|
2160
2220
|
if (!enabled) return;
|
|
2161
2221
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
2162
2222
|
if (!rect) return;
|
|
2163
2223
|
setTooltip({ visible: true, x: e.clientX - rect.left, y: e.clientY - rect.top, content });
|
|
2164
2224
|
}, [enabled]);
|
|
2165
|
-
const hide =
|
|
2225
|
+
const hide = React6.useCallback(() => {
|
|
2166
2226
|
cancelAnimationFrame(rafRef.current);
|
|
2167
2227
|
setTooltip((prev) => ({ ...prev, visible: false }));
|
|
2168
2228
|
}, []);
|
|
2169
2229
|
return { tooltip, show, hide, move, containerRef };
|
|
2170
2230
|
};
|
|
2171
|
-
var GridLines =
|
|
2231
|
+
var GridLines = React6.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ jsx306(Fragment2, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2172
2232
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2173
2233
|
const val = Math.round(maxVal * ratio);
|
|
2174
2234
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2175
|
-
/* @__PURE__ */
|
|
2176
|
-
/* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ jsx306("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2236
|
+
/* @__PURE__ */ jsx306("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2177
2237
|
] }, ratio);
|
|
2178
2238
|
}) }));
|
|
2179
2239
|
GridLines.displayName = "GridLines";
|
|
@@ -2183,18 +2243,18 @@ var getLabelStep = (count, chartW) => {
|
|
|
2183
2243
|
if (count <= maxLabels) return 1;
|
|
2184
2244
|
return Math.ceil(count / maxLabels);
|
|
2185
2245
|
};
|
|
2186
|
-
var AxisLabels =
|
|
2246
|
+
var AxisLabels = React6.memo(({ labels, count, chartW, height }) => {
|
|
2187
2247
|
const step = getLabelStep(count, chartW);
|
|
2188
|
-
return /* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ jsx306(Fragment2, { children: labels.map((label, i) => {
|
|
2189
2249
|
if (i % step !== 0) return null;
|
|
2190
2250
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2191
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsx306("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2192
2252
|
}) });
|
|
2193
2253
|
});
|
|
2194
2254
|
AxisLabels.displayName = "AxisLabels";
|
|
2195
2255
|
var useCrosshair = (seriesPoints, entries, labels, chartH) => {
|
|
2196
|
-
const [activeIndex, setActiveIndex] =
|
|
2197
|
-
const handleMouseMove =
|
|
2256
|
+
const [activeIndex, setActiveIndex] = React6.useState(null);
|
|
2257
|
+
const handleMouseMove = React6.useCallback((e) => {
|
|
2198
2258
|
const svg = e.currentTarget;
|
|
2199
2259
|
const rect = svg.getBoundingClientRect();
|
|
2200
2260
|
const mx = (e.clientX - rect.left) / rect.width * svg.viewBox.baseVal.width;
|
|
@@ -2213,17 +2273,17 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
|
|
|
2213
2273
|
}
|
|
2214
2274
|
setActiveIndex(minDist <= threshold ? closest : null);
|
|
2215
2275
|
}, [seriesPoints]);
|
|
2216
|
-
const handleMouseLeave =
|
|
2276
|
+
const handleMouseLeave = React6.useCallback(() => {
|
|
2217
2277
|
setActiveIndex(null);
|
|
2218
2278
|
}, []);
|
|
2219
|
-
const tooltipContent =
|
|
2279
|
+
const tooltipContent = React6.useMemo(() => {
|
|
2220
2280
|
if (activeIndex === null) return "";
|
|
2221
2281
|
return entries.map(([key], di) => {
|
|
2222
2282
|
const p = seriesPoints[di]?.[activeIndex];
|
|
2223
2283
|
return p ? `${key}: ${p.v}` : "";
|
|
2224
2284
|
}).filter(Boolean).join(" / ");
|
|
2225
2285
|
}, [activeIndex, entries, seriesPoints]);
|
|
2226
|
-
const getTooltipAt =
|
|
2286
|
+
const getTooltipAt = React6.useCallback((idx) => {
|
|
2227
2287
|
return entries.map(([key], di) => {
|
|
2228
2288
|
const p = seriesPoints[di]?.[idx];
|
|
2229
2289
|
return p ? `${key}: ${p.v}` : "";
|
|
@@ -2231,16 +2291,16 @@ var useCrosshair = (seriesPoints, entries, labels, chartH) => {
|
|
|
2231
2291
|
}, [entries, seriesPoints]);
|
|
2232
2292
|
return { activeIndex, handleMouseMove, handleMouseLeave, tooltipContent, getTooltipAt };
|
|
2233
2293
|
};
|
|
2234
|
-
var LineChart =
|
|
2235
|
-
const entries =
|
|
2236
|
-
const maxVal =
|
|
2294
|
+
var LineChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2295
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2296
|
+
const maxVal = React6.useMemo(() => {
|
|
2237
2297
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2238
2298
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2239
2299
|
}, [entries]);
|
|
2240
2300
|
const count = labels.length;
|
|
2241
2301
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2242
2302
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2243
|
-
const seriesPoints =
|
|
2303
|
+
const seriesPoints = React6.useMemo(
|
|
2244
2304
|
() => entries.map(
|
|
2245
2305
|
([, values]) => values.map((v, i) => ({
|
|
2246
2306
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2250,9 +2310,9 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2250
2310
|
),
|
|
2251
2311
|
[entries, count, chartW, chartH, maxVal]
|
|
2252
2312
|
);
|
|
2253
|
-
const clipRef =
|
|
2313
|
+
const clipRef = React6.useRef(null);
|
|
2254
2314
|
const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
|
|
2255
|
-
|
|
2315
|
+
React6.useEffect(() => {
|
|
2256
2316
|
if (!animate || !clipRef.current) return;
|
|
2257
2317
|
clipRef.current.setAttribute("width", "0");
|
|
2258
2318
|
requestAnimationFrame(() => {
|
|
@@ -2282,9 +2342,9 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2282
2342
|
onLeave();
|
|
2283
2343
|
},
|
|
2284
2344
|
children: [
|
|
2285
|
-
animate && /* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
/* @__PURE__ */
|
|
2345
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("clipPath", { id: lineClipId, children: /* @__PURE__ */ jsx306("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2346
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2347
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2288
2348
|
entries.map(([key], di) => {
|
|
2289
2349
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2290
2350
|
const color = palette[2];
|
|
@@ -2294,15 +2354,15 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2294
2354
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
2295
2355
|
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`;
|
|
2296
2356
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
/* @__PURE__ */
|
|
2357
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2358
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
2359
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
2300
2360
|
] }) }),
|
|
2301
2361
|
/* @__PURE__ */ jsxs196("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ jsx306("path", { d: areaD, fill: `url(#${gradientId})` }),
|
|
2363
|
+
/* @__PURE__ */ jsx306("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2304
2364
|
] }),
|
|
2305
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */
|
|
2365
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx306(
|
|
2306
2366
|
"circle",
|
|
2307
2367
|
{
|
|
2308
2368
|
cx: points[activeIndex].x,
|
|
@@ -2314,7 +2374,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2314
2374
|
)
|
|
2315
2375
|
] }, di);
|
|
2316
2376
|
}),
|
|
2317
|
-
activeX !== null && /* @__PURE__ */
|
|
2377
|
+
activeX !== null && /* @__PURE__ */ jsx306(
|
|
2318
2378
|
"line",
|
|
2319
2379
|
{
|
|
2320
2380
|
x1: activeX,
|
|
@@ -2324,7 +2384,7 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2324
2384
|
className: "chart-crosshair"
|
|
2325
2385
|
}
|
|
2326
2386
|
),
|
|
2327
|
-
/* @__PURE__ */
|
|
2387
|
+
/* @__PURE__ */ jsx306(
|
|
2328
2388
|
"rect",
|
|
2329
2389
|
{
|
|
2330
2390
|
x: PADDING.left,
|
|
@@ -2340,16 +2400,16 @@ var LineChart = React5.memo(({ data, labels, width, height, animate, onHover, on
|
|
|
2340
2400
|
);
|
|
2341
2401
|
});
|
|
2342
2402
|
LineChart.displayName = "LineChart";
|
|
2343
|
-
var CurveChart =
|
|
2344
|
-
const entries =
|
|
2345
|
-
const maxVal =
|
|
2403
|
+
var CurveChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2404
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2405
|
+
const maxVal = React6.useMemo(() => {
|
|
2346
2406
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2347
2407
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2348
2408
|
}, [entries]);
|
|
2349
2409
|
const count = labels.length;
|
|
2350
2410
|
const chartW = width - PADDING.left - PADDING.right;
|
|
2351
2411
|
const chartH = height - PADDING.top - PADDING.bottom;
|
|
2352
|
-
const seriesPoints =
|
|
2412
|
+
const seriesPoints = React6.useMemo(
|
|
2353
2413
|
() => entries.map(
|
|
2354
2414
|
([, values]) => values.map((v, i) => ({
|
|
2355
2415
|
x: PADDING.left + i / (count - 1 || 1) * chartW,
|
|
@@ -2359,9 +2419,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2359
2419
|
),
|
|
2360
2420
|
[entries, count, chartW, chartH, maxVal]
|
|
2361
2421
|
);
|
|
2362
|
-
const curveClipRef =
|
|
2422
|
+
const curveClipRef = React6.useRef(null);
|
|
2363
2423
|
const { activeIndex, handleMouseMove, handleMouseLeave, getTooltipAt } = useCrosshair(seriesPoints, entries, labels, chartH);
|
|
2364
|
-
|
|
2424
|
+
React6.useEffect(() => {
|
|
2365
2425
|
if (!animate || !curveClipRef.current) return;
|
|
2366
2426
|
curveClipRef.current.setAttribute("width", "0");
|
|
2367
2427
|
requestAnimationFrame(() => {
|
|
@@ -2392,9 +2452,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2392
2452
|
onLeave();
|
|
2393
2453
|
},
|
|
2394
2454
|
children: [
|
|
2395
|
-
animate && /* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2455
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("clipPath", { id: curveClipId, children: /* @__PURE__ */ jsx306("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2456
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2457
|
+
/* @__PURE__ */ jsx306(AxisLabels, { labels, count, chartW, height }),
|
|
2398
2458
|
entries.map(([key], di) => {
|
|
2399
2459
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2400
2460
|
const color = palette[2];
|
|
@@ -2404,15 +2464,15 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2404
2464
|
const linePath = toSmoothPath(points);
|
|
2405
2465
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2406
2466
|
return /* @__PURE__ */ jsxs196("g", { children: [
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsxs196("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2468
|
+
/* @__PURE__ */ jsx306("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2469
|
+
/* @__PURE__ */ jsx306("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2410
2470
|
] }) }),
|
|
2411
2471
|
/* @__PURE__ */ jsxs196("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2472
|
+
/* @__PURE__ */ jsx306("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
2473
|
+
/* @__PURE__ */ jsx306("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2414
2474
|
] }),
|
|
2415
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */
|
|
2475
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ jsx306(
|
|
2416
2476
|
"circle",
|
|
2417
2477
|
{
|
|
2418
2478
|
cx: points[activeIndex].x,
|
|
@@ -2424,7 +2484,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2424
2484
|
)
|
|
2425
2485
|
] }, di);
|
|
2426
2486
|
}),
|
|
2427
|
-
activeX !== null && /* @__PURE__ */
|
|
2487
|
+
activeX !== null && /* @__PURE__ */ jsx306(
|
|
2428
2488
|
"line",
|
|
2429
2489
|
{
|
|
2430
2490
|
x1: activeX,
|
|
@@ -2434,7 +2494,7 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2434
2494
|
className: "chart-crosshair"
|
|
2435
2495
|
}
|
|
2436
2496
|
),
|
|
2437
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ jsx306(
|
|
2438
2498
|
"rect",
|
|
2439
2499
|
{
|
|
2440
2500
|
x: PADDING.left,
|
|
@@ -2450,9 +2510,9 @@ var CurveChart = React5.memo(({ data, labels, width, height, animate, onHover, o
|
|
|
2450
2510
|
);
|
|
2451
2511
|
});
|
|
2452
2512
|
CurveChart.displayName = "CurveChart";
|
|
2453
|
-
var BarChart =
|
|
2454
|
-
const entries =
|
|
2455
|
-
const maxVal =
|
|
2513
|
+
var BarChart = React6.memo(({ data, labels, width, height, animate, onHover, onMove, onLeave }) => {
|
|
2514
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2515
|
+
const maxVal = React6.useMemo(() => {
|
|
2456
2516
|
const allValues = entries.flatMap(([, v]) => v);
|
|
2457
2517
|
return Math.max(...allValues) * 1.2 || 1;
|
|
2458
2518
|
}, [entries]);
|
|
@@ -2464,7 +2524,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2464
2524
|
const barGap = groupCount > 1 ? 2 : 0;
|
|
2465
2525
|
const barW = Math.max(1, Math.min(32, (groupW * 0.7 - barGap * (groupCount - 1)) / groupCount));
|
|
2466
2526
|
const baseline = PADDING.top + chartH;
|
|
2467
|
-
const bars =
|
|
2527
|
+
const bars = React6.useMemo(
|
|
2468
2528
|
() => entries.map(
|
|
2469
2529
|
([, values], di) => values.map((v, i) => {
|
|
2470
2530
|
const totalBarsW = barW * groupCount + barGap * (groupCount - 1);
|
|
@@ -2478,10 +2538,10 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2478
2538
|
);
|
|
2479
2539
|
const barLabelStep = getLabelStep(count, chartW);
|
|
2480
2540
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2481
|
-
/* @__PURE__ */
|
|
2541
|
+
/* @__PURE__ */ jsx306(GridLines, { width, height, chartH, maxVal }),
|
|
2482
2542
|
labels.map((label, i) => {
|
|
2483
2543
|
if (i % barLabelStep !== 0) return null;
|
|
2484
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ jsx306("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2485
2545
|
}),
|
|
2486
2546
|
entries.map(([key], di) => {
|
|
2487
2547
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2490,7 +2550,7 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2490
2550
|
const r2 = Math.min(4, b.w / 2);
|
|
2491
2551
|
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`;
|
|
2492
2552
|
const delay = 100 + i * 80;
|
|
2493
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ jsx306(
|
|
2494
2554
|
"path",
|
|
2495
2555
|
{
|
|
2496
2556
|
d,
|
|
@@ -2511,11 +2571,11 @@ var BarChart = React5.memo(({ data, labels, width, height, animate, onHover, onM
|
|
|
2511
2571
|
] });
|
|
2512
2572
|
});
|
|
2513
2573
|
BarChart.displayName = "BarChart";
|
|
2514
|
-
var PieDonutChart =
|
|
2574
|
+
var PieDonutChart = React6.memo(
|
|
2515
2575
|
({ data, labels, width, height, animate, isDoughnut, onHover, onMove, onLeave }) => {
|
|
2516
|
-
const entries =
|
|
2517
|
-
const values =
|
|
2518
|
-
const total =
|
|
2576
|
+
const entries = React6.useMemo(() => Object.entries(data), [data]);
|
|
2577
|
+
const values = React6.useMemo(() => entries.flatMap(([, v]) => v), [entries]);
|
|
2578
|
+
const total = React6.useMemo(() => values.reduce((a, b) => a + b, 0) || 1, [values]);
|
|
2519
2579
|
const size = Math.min(width, height);
|
|
2520
2580
|
const cx = size / 2;
|
|
2521
2581
|
const cy = size / 2;
|
|
@@ -2523,10 +2583,10 @@ var PieDonutChart = React5.memo(
|
|
|
2523
2583
|
const innerR = isDoughnut ? r2 * 0.5 : 0;
|
|
2524
2584
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2525
2585
|
const colorOffset = hashString(firstKey);
|
|
2526
|
-
const maskRef =
|
|
2586
|
+
const maskRef = React6.useRef(null);
|
|
2527
2587
|
const maskR = r2 + 10;
|
|
2528
2588
|
const maskCircumference = 2 * Math.PI * maskR;
|
|
2529
|
-
|
|
2589
|
+
React6.useEffect(() => {
|
|
2530
2590
|
if (!animate || !maskRef.current) return;
|
|
2531
2591
|
const el = maskRef.current;
|
|
2532
2592
|
el.style.strokeDasharray = `${maskCircumference}`;
|
|
@@ -2536,7 +2596,7 @@ var PieDonutChart = React5.memo(
|
|
|
2536
2596
|
el.style.strokeDashoffset = "0";
|
|
2537
2597
|
});
|
|
2538
2598
|
}, [animate, maskCircumference]);
|
|
2539
|
-
const sliceData =
|
|
2599
|
+
const sliceData = React6.useMemo(() => {
|
|
2540
2600
|
let angle0 = -Math.PI / 2;
|
|
2541
2601
|
let cumulativeAngle = 0;
|
|
2542
2602
|
return values.map((v, i) => {
|
|
@@ -2571,7 +2631,7 @@ var PieDonutChart = React5.memo(
|
|
|
2571
2631
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2572
2632
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
2573
2633
|
return /* @__PURE__ */ jsxs196("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
2574
|
-
animate && /* @__PURE__ */
|
|
2634
|
+
animate && /* @__PURE__ */ jsx306("defs", { children: /* @__PURE__ */ jsx306("mask", { id: maskId, children: /* @__PURE__ */ jsx306(
|
|
2575
2635
|
"circle",
|
|
2576
2636
|
{
|
|
2577
2637
|
ref: maskRef,
|
|
@@ -2584,7 +2644,7 @@ var PieDonutChart = React5.memo(
|
|
|
2584
2644
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
2585
2645
|
}
|
|
2586
2646
|
) }) }),
|
|
2587
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ jsx306("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ jsx306("g", { children: /* @__PURE__ */ jsx306(
|
|
2588
2648
|
"path",
|
|
2589
2649
|
{
|
|
2590
2650
|
d: s.d,
|
|
@@ -2600,9 +2660,9 @@ var PieDonutChart = React5.memo(
|
|
|
2600
2660
|
);
|
|
2601
2661
|
PieDonutChart.displayName = "PieDonutChart";
|
|
2602
2662
|
var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, children }) => {
|
|
2603
|
-
const ref =
|
|
2604
|
-
const [pos, setPos] =
|
|
2605
|
-
|
|
2663
|
+
const ref = React6.useRef(null);
|
|
2664
|
+
const [pos, setPos] = React6.useState({ left: 0, top: 0 });
|
|
2665
|
+
React6.useLayoutEffect(() => {
|
|
2606
2666
|
const el = ref.current;
|
|
2607
2667
|
if (!el) return;
|
|
2608
2668
|
const w = el.offsetWidth;
|
|
@@ -2626,8 +2686,8 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
|
|
|
2626
2686
|
className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
|
|
2627
2687
|
style: { left: pos.left, top: pos.top },
|
|
2628
2688
|
children: [
|
|
2629
|
-
title && /* @__PURE__ */
|
|
2630
|
-
desc && /* @__PURE__ */
|
|
2689
|
+
title && /* @__PURE__ */ jsx306("div", { className: "tooltip-title", children: title }),
|
|
2690
|
+
desc && /* @__PURE__ */ jsx306("div", { className: "tooltip-desc", children: desc })
|
|
2631
2691
|
]
|
|
2632
2692
|
}
|
|
2633
2693
|
);
|
|
@@ -2639,13 +2699,13 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2639
2699
|
const total = values.reduce((a, b) => a + b, 0) || 1;
|
|
2640
2700
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2641
2701
|
const colorOffset = hashString(firstKey);
|
|
2642
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ jsx306("div", { className: "chart-legend", children: values.map((v, i) => {
|
|
2643
2703
|
const pct = Math.round(v / total * 100);
|
|
2644
2704
|
const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
|
|
2645
2705
|
return /* @__PURE__ */ jsxs196("div", { className: "chart-legend-item", children: [
|
|
2646
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2647
2707
|
/* @__PURE__ */ jsxs196("div", { className: "chart-legend-text", children: [
|
|
2648
|
-
/* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
|
|
2649
2709
|
/* @__PURE__ */ jsxs196("span", { className: "chart-legend-value", children: [
|
|
2650
2710
|
v.toLocaleString(),
|
|
2651
2711
|
"(",
|
|
@@ -2656,103 +2716,42 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2656
2716
|
] }, i);
|
|
2657
2717
|
}) });
|
|
2658
2718
|
}
|
|
2659
|
-
return /* @__PURE__ */
|
|
2719
|
+
return /* @__PURE__ */ jsx306("div", { className: "chart-legend", children: entries.map(([key], di) => {
|
|
2660
2720
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2661
2721
|
const color = palette[2];
|
|
2662
2722
|
const values = entries[di][1];
|
|
2663
2723
|
const sum = values.reduce((a, b) => a + b, 0);
|
|
2664
2724
|
return /* @__PURE__ */ jsxs196("div", { className: "chart-legend-item", children: [
|
|
2665
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2666
2726
|
/* @__PURE__ */ jsxs196("div", { className: "chart-legend-text", children: [
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2727
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-label", children: key }),
|
|
2728
|
+
/* @__PURE__ */ jsx306("span", { className: "chart-legend-value", children: sum.toLocaleString() })
|
|
2669
2729
|
] })
|
|
2670
2730
|
] }, di);
|
|
2671
2731
|
}) });
|
|
2672
2732
|
};
|
|
2673
|
-
var Chart =
|
|
2733
|
+
var Chart = React6.memo((props) => {
|
|
2674
2734
|
const { type, data, labels, tooltip: showTooltip = true, tooltipType = "light" } = props;
|
|
2675
2735
|
const { tooltip, show, hide, move, containerRef } = useChartTooltip(showTooltip);
|
|
2676
2736
|
const { width, height } = useChartSize(containerRef);
|
|
2677
|
-
const stableData =
|
|
2678
|
-
const stableLabels =
|
|
2679
|
-
const dataKey =
|
|
2737
|
+
const stableData = React6.useMemo(() => data, [JSON.stringify(data)]);
|
|
2738
|
+
const stableLabels = React6.useMemo(() => labels, [JSON.stringify(labels)]);
|
|
2739
|
+
const dataKey = React6.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2680
2740
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2681
2741
|
const ready = width > 0 && height > 0;
|
|
2682
2742
|
return /* @__PURE__ */ jsxs196("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2683
|
-
ready && type === "line" && /* @__PURE__ */
|
|
2684
|
-
ready && type === "curve" && /* @__PURE__ */
|
|
2685
|
-
ready && type === "bar" && /* @__PURE__ */
|
|
2686
|
-
ready && type === "pie" && /* @__PURE__ */
|
|
2687
|
-
ready && type === "doughnut" && /* @__PURE__ */
|
|
2688
|
-
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */
|
|
2689
|
-
tooltip.visible && tooltip.content && /* @__PURE__ */
|
|
2743
|
+
ready && type === "line" && /* @__PURE__ */ jsx306(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2744
|
+
ready && type === "curve" && /* @__PURE__ */ jsx306(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2745
|
+
ready && type === "bar" && /* @__PURE__ */ jsx306(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2746
|
+
ready && type === "pie" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2747
|
+
ready && type === "doughnut" && /* @__PURE__ */ jsx306(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2748
|
+
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ jsx306(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2749
|
+
tooltip.visible && tooltip.content && /* @__PURE__ */ jsx306(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
2690
2750
|
] });
|
|
2691
2751
|
});
|
|
2692
2752
|
Chart.displayName = "Chart";
|
|
2693
2753
|
var Chart_default = Chart;
|
|
2694
2754
|
|
|
2695
|
-
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
2696
|
-
import React6 from "react";
|
|
2697
|
-
import { jsx as jsx306 } from "react/jsx-runtime";
|
|
2698
|
-
var MAX_HEIGHT = 400;
|
|
2699
|
-
var AutoResizeTextArea = React6.forwardRef(
|
|
2700
|
-
(props, ref) => {
|
|
2701
|
-
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
2702
|
-
const localRef = React6.useRef(null);
|
|
2703
|
-
const setRefs = (el) => {
|
|
2704
|
-
localRef.current = el;
|
|
2705
|
-
if (!ref) return;
|
|
2706
|
-
if (typeof ref === "function") ref(el);
|
|
2707
|
-
else if (ref && "current" in ref)
|
|
2708
|
-
ref.current = el;
|
|
2709
|
-
};
|
|
2710
|
-
const updateHeight = () => {
|
|
2711
|
-
const el = localRef.current;
|
|
2712
|
-
if (!el) return;
|
|
2713
|
-
el.style.height = "0px";
|
|
2714
|
-
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
2715
|
-
};
|
|
2716
|
-
const handleChange = (e) => {
|
|
2717
|
-
if (onChange) {
|
|
2718
|
-
const event = {
|
|
2719
|
-
...e,
|
|
2720
|
-
target: { value: e.target.value }
|
|
2721
|
-
};
|
|
2722
|
-
onChange(event);
|
|
2723
|
-
}
|
|
2724
|
-
};
|
|
2725
|
-
React6.useEffect(() => {
|
|
2726
|
-
updateHeight();
|
|
2727
|
-
}, [value]);
|
|
2728
|
-
if (bare) {
|
|
2729
|
-
return /* @__PURE__ */ jsx306(
|
|
2730
|
-
"textarea",
|
|
2731
|
-
{
|
|
2732
|
-
...textareaProps,
|
|
2733
|
-
ref: setRefs,
|
|
2734
|
-
className,
|
|
2735
|
-
disabled,
|
|
2736
|
-
value,
|
|
2737
|
-
onChange: handleChange
|
|
2738
|
-
}
|
|
2739
|
-
);
|
|
2740
|
-
}
|
|
2741
|
-
return /* @__PURE__ */ jsx306("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ jsx306("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ jsx306(
|
|
2742
|
-
"textarea",
|
|
2743
|
-
{
|
|
2744
|
-
...textareaProps,
|
|
2745
|
-
ref: setRefs,
|
|
2746
|
-
disabled,
|
|
2747
|
-
value,
|
|
2748
|
-
onChange: handleChange
|
|
2749
|
-
}
|
|
2750
|
-
) }) });
|
|
2751
|
-
}
|
|
2752
|
-
);
|
|
2753
|
-
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
2754
|
-
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
2755
|
-
|
|
2756
2755
|
// src/components/ChatInput/ChatInput.tsx
|
|
2757
2756
|
import React7 from "react";
|
|
2758
2757
|
|
|
@@ -2761,7 +2760,6 @@ import { jsx as jsx307 } from "react/jsx-runtime";
|
|
|
2761
2760
|
var IconButton = (props) => {
|
|
2762
2761
|
const {
|
|
2763
2762
|
icon,
|
|
2764
|
-
className,
|
|
2765
2763
|
type = "primary",
|
|
2766
2764
|
size = "md",
|
|
2767
2765
|
disabled,
|
|
@@ -2770,7 +2768,7 @@ var IconButton = (props) => {
|
|
|
2770
2768
|
return /* @__PURE__ */ jsx307(
|
|
2771
2769
|
"button",
|
|
2772
2770
|
{
|
|
2773
|
-
className: clsx_default("lib-xplat-icon-button", type, size
|
|
2771
|
+
className: clsx_default("lib-xplat-icon-button", type, size),
|
|
2774
2772
|
disabled,
|
|
2775
2773
|
...rest,
|
|
2776
2774
|
children: icon
|
|
@@ -2845,7 +2843,7 @@ ChatInput.displayName = "ChatInput";
|
|
|
2845
2843
|
var ChatInput_default = ChatInput;
|
|
2846
2844
|
|
|
2847
2845
|
// src/tokens/colors.ts
|
|
2848
|
-
import {
|
|
2846
|
+
import { semantic } from "@x-plat/tokens-core";
|
|
2849
2847
|
|
|
2850
2848
|
// src/tokens/index.ts
|
|
2851
2849
|
import { cssVar } from "@x-plat/tokens-core";
|
|
@@ -5278,12 +5276,12 @@ var Select_default = Select;
|
|
|
5278
5276
|
// src/components/Skeleton/Skeleton.tsx
|
|
5279
5277
|
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
5280
5278
|
var SIZE_MAP = {
|
|
5281
|
-
xs: "var(--spacing-
|
|
5282
|
-
sm: "var(--spacing-
|
|
5283
|
-
md: "var(--spacing-
|
|
5284
|
-
lg: "var(--spacing-
|
|
5285
|
-
xl: "var(--spacing-
|
|
5286
|
-
"2xl": "var(--spacing-
|
|
5279
|
+
xs: "var(--spacing-space-1)",
|
|
5280
|
+
sm: "var(--spacing-space-2)",
|
|
5281
|
+
md: "var(--spacing-space-4)",
|
|
5282
|
+
lg: "var(--spacing-space-8)",
|
|
5283
|
+
xl: "var(--spacing-space-12)",
|
|
5284
|
+
"2xl": "var(--spacing-space-16)",
|
|
5287
5285
|
full: "100%"
|
|
5288
5286
|
};
|
|
5289
5287
|
var Skeleton = (props) => {
|