@x-plat/design-system 0.6.1 → 0.7.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 +10 -3
- package/dist/components/Alert/index.css +7 -0
- package/dist/components/AutoResizeTextArea/index.css +3 -0
- package/dist/components/Avatar/index.css +13 -1
- package/dist/components/Badge/index.cjs +10 -7
- package/dist/components/Badge/index.css +26 -15
- package/dist/components/Badge/index.d.cts +3 -19
- package/dist/components/Badge/index.d.ts +3 -19
- package/dist/components/Badge/index.js +8 -6
- package/dist/components/Box/index.css +8 -5
- package/dist/components/Breadcrumb/index.css +5 -1
- package/dist/components/Button/index.css +10 -1
- package/dist/components/Calendar/index.css +10 -6
- package/dist/components/CardTab/index.css +14 -2
- package/dist/components/Chart/index.css +32 -11
- package/dist/components/ChatInput/index.css +6 -0
- package/dist/components/CheckBox/index.css +10 -1
- package/dist/components/Chip/index.css +12 -0
- package/dist/components/DatePicker/index.css +51 -12
- package/dist/components/Drawer/index.css +14 -7
- package/dist/components/Dropdown/index.css +5 -1
- package/dist/components/Editor/index.css +49 -10
- package/dist/components/EmptyState/index.css +9 -2
- package/dist/components/FileUpload/index.css +9 -2
- package/dist/components/HtmlTypeWriter/index.cjs +2 -0
- package/dist/components/HtmlTypeWriter/index.css +13 -1
- package/dist/components/HtmlTypeWriter/index.d.cts +3 -3
- package/dist/components/HtmlTypeWriter/index.d.ts +3 -3
- package/dist/components/HtmlTypeWriter/index.js +1 -0
- package/dist/components/ImageSelector/index.css +8 -0
- package/dist/components/Input/index.css +12 -0
- package/dist/components/Modal/index.css +1 -1
- package/dist/components/NotificationBadge/index.cjs +68 -0
- package/dist/components/NotificationBadge/index.css +75 -0
- package/dist/components/NotificationBadge/index.d.cts +47 -0
- package/dist/components/NotificationBadge/index.d.ts +47 -0
- package/dist/components/NotificationBadge/index.js +40 -0
- package/dist/components/Pagination/index.css +25 -1
- package/dist/components/PopOver/index.css +1 -1
- package/dist/components/Progress/index.css +5 -2
- package/dist/components/Radio/index.css +9 -0
- package/dist/components/Select/index.css +20 -3
- package/dist/components/Steps/index.css +14 -4
- package/dist/components/Switch/index.css +1 -1
- package/dist/components/Tab/index.css +16 -1
- package/dist/components/Table/index.cjs +6 -1
- package/dist/components/Table/index.css +12 -0
- package/dist/components/Table/index.d.cts +4 -0
- package/dist/components/Table/index.d.ts +4 -0
- package/dist/components/Table/index.js +6 -1
- package/dist/components/Tag/index.css +12 -0
- package/dist/components/TextArea/index.css +9 -0
- package/dist/components/Toast/index.css +8 -1
- package/dist/components/Tooltip/index.css +8 -4
- package/dist/components/Video/index.css +30 -19
- package/dist/components/index.cjs +274 -265
- package/dist/components/index.css +547 -162
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +272 -265
- package/dist/index.cjs +274 -265
- package/dist/index.css +547 -162
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +272 -265
- package/dist/layout/index.css +40 -0
- package/guidelines/AGENT_PROMPT.md +1 -1
- package/guidelines/Guidelines.md +1 -1
- package/guidelines/components/accordion.md +1 -1
- package/guidelines/components/avatar.md +1 -1
- package/guidelines/components/card.md +1 -1
- package/guidelines/components/chart.md +1 -1
- package/guidelines/components/data-display.md +4 -4
- package/guidelines/components/dropdown.md +1 -1
- package/guidelines/components/feedback.md +39 -11
- package/guidelines/components/file-media.md +3 -3
- package/guidelines/components/html-typewriter.md +1 -1
- package/guidelines/components/navigation.md +144 -20
- package/guidelines/components/swiper.md +2 -2
- package/guidelines/components/table.md +68 -5
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ __export(components_exports, {
|
|
|
34
34
|
Alert: () => Alert_default,
|
|
35
35
|
AutoResizeTextArea: () => AutoResizeTextArea_default,
|
|
36
36
|
Avatar: () => Avatar_default,
|
|
37
|
-
Badge: () =>
|
|
37
|
+
Badge: () => NotificationBadge_default,
|
|
38
38
|
Box: () => Box_default,
|
|
39
39
|
Breadcrumb: () => Breadcrumb_default,
|
|
40
40
|
Button: () => Button_default,
|
|
@@ -50,12 +50,14 @@ __export(components_exports, {
|
|
|
50
50
|
Editor: () => Editor_default,
|
|
51
51
|
EmptyState: () => EmptyState_default,
|
|
52
52
|
FileUpload: () => FileUpload_default,
|
|
53
|
+
HtmlTypeWriter: () => HtmlTypeWriter_default,
|
|
53
54
|
HtmlTypewriter: () => HtmlTypeWriter_default,
|
|
54
55
|
IconButton: () => IconButton_default,
|
|
55
56
|
ImageSelector: () => ImageSelector_default,
|
|
56
57
|
Input: () => Input_default,
|
|
57
58
|
InputDatePicker: () => InputDatePicker_default,
|
|
58
59
|
Modal: () => Modal_default,
|
|
60
|
+
NotificationBadge: () => NotificationBadge_default,
|
|
59
61
|
Pagination: () => Pagination_default,
|
|
60
62
|
PasswordInput: () => PasswordInput_default,
|
|
61
63
|
PopOver: () => PopOver_default,
|
|
@@ -1679,52 +1681,31 @@ var Avatar = (props) => {
|
|
|
1679
1681
|
Avatar.displayName = "Avatar";
|
|
1680
1682
|
var Avatar_default = Avatar;
|
|
1681
1683
|
|
|
1682
|
-
// src/components/Badge/Badge.tsx
|
|
1683
|
-
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
1684
|
-
var Badge = (props) => {
|
|
1685
|
-
const {
|
|
1686
|
-
children,
|
|
1687
|
-
type = "error",
|
|
1688
|
-
count,
|
|
1689
|
-
maxCount = 99,
|
|
1690
|
-
dot = false,
|
|
1691
|
-
size = "md"
|
|
1692
|
-
} = props;
|
|
1693
|
-
const showBadge = dot || count !== void 0 && count > 0;
|
|
1694
|
-
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
1695
|
-
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-badge", size), children: [
|
|
1696
|
-
children,
|
|
1697
|
-
showBadge && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
|
|
1698
|
-
] });
|
|
1699
|
-
};
|
|
1700
|
-
Badge.displayName = "Badge";
|
|
1701
|
-
var Badge_default = Badge;
|
|
1702
|
-
|
|
1703
1684
|
// src/components/Box/Box.tsx
|
|
1704
|
-
var
|
|
1685
|
+
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
1705
1686
|
var Box = ({
|
|
1706
1687
|
children,
|
|
1707
1688
|
title,
|
|
1708
1689
|
variant = "outlined",
|
|
1709
1690
|
padding = "md"
|
|
1710
1691
|
}) => {
|
|
1711
|
-
return /* @__PURE__ */ (0,
|
|
1712
|
-
title && /* @__PURE__ */ (0,
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1692
|
+
return /* @__PURE__ */ (0, import_jsx_runtime299.jsxs)("div", { className: clsx_default("lib-xplat-box", variant, `pad-${padding}`), children: [
|
|
1693
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-title", children: title }),
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime299.jsx)("div", { className: "box-content", children })
|
|
1714
1695
|
] });
|
|
1715
1696
|
};
|
|
1716
1697
|
Box.displayName = "Box";
|
|
1717
1698
|
var Box_default = Box;
|
|
1718
1699
|
|
|
1719
1700
|
// src/components/Breadcrumb/Breadcrumb.tsx
|
|
1720
|
-
var
|
|
1701
|
+
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
1721
1702
|
var Breadcrumb = (props) => {
|
|
1722
1703
|
const { items, separator = "/" } = props;
|
|
1723
|
-
return /* @__PURE__ */ (0,
|
|
1704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("nav", { className: "lib-xplat-breadcrumb", "aria-label": "\uACBD\uB85C", children: /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("ol", { children: items.map((item, index) => {
|
|
1724
1705
|
const isLast = index === items.length - 1;
|
|
1725
|
-
return /* @__PURE__ */ (0,
|
|
1726
|
-
isLast ? /* @__PURE__ */ (0,
|
|
1727
|
-
!isLast && /* @__PURE__ */ (0,
|
|
1706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)("li", { children: [
|
|
1707
|
+
isLast ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "current", "aria-current": "page", children: item.label }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("a", { href: item.href, className: "link", children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("button", { className: "link", onClick: item.onClick, children: item.label }),
|
|
1708
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("span", { className: "separator", children: separator })
|
|
1728
1709
|
] }, index);
|
|
1729
1710
|
}) }) });
|
|
1730
1711
|
};
|
|
@@ -1732,7 +1713,7 @@ Breadcrumb.displayName = "Breadcrumb";
|
|
|
1732
1713
|
var Breadcrumb_default = Breadcrumb;
|
|
1733
1714
|
|
|
1734
1715
|
// src/components/Button/Button.tsx
|
|
1735
|
-
var
|
|
1716
|
+
var import_jsx_runtime301 = require("react/jsx-runtime");
|
|
1736
1717
|
var Button = (props) => {
|
|
1737
1718
|
const {
|
|
1738
1719
|
children,
|
|
@@ -1741,7 +1722,7 @@ var Button = (props) => {
|
|
|
1741
1722
|
disabled,
|
|
1742
1723
|
...rest
|
|
1743
1724
|
} = props;
|
|
1744
|
-
return /* @__PURE__ */ (0,
|
|
1725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(
|
|
1745
1726
|
"button",
|
|
1746
1727
|
{
|
|
1747
1728
|
className: clsx_default("lib-xplat-button", type, size),
|
|
@@ -1858,7 +1839,7 @@ var MONTH_LABELS = {
|
|
|
1858
1839
|
};
|
|
1859
1840
|
|
|
1860
1841
|
// src/components/Calendar/Calendar.tsx
|
|
1861
|
-
var
|
|
1842
|
+
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
1862
1843
|
var DayCell = import_react4.default.memo(
|
|
1863
1844
|
({
|
|
1864
1845
|
day,
|
|
@@ -1870,7 +1851,7 @@ var DayCell = import_react4.default.memo(
|
|
|
1870
1851
|
onEventClick
|
|
1871
1852
|
}) => {
|
|
1872
1853
|
if (renderDay) {
|
|
1873
|
-
return /* @__PURE__ */ (0,
|
|
1854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
1874
1855
|
"div",
|
|
1875
1856
|
{
|
|
1876
1857
|
className: clsx_default(
|
|
@@ -1887,7 +1868,7 @@ var DayCell = import_react4.default.memo(
|
|
|
1887
1868
|
}
|
|
1888
1869
|
);
|
|
1889
1870
|
}
|
|
1890
|
-
return /* @__PURE__ */ (0,
|
|
1871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
|
|
1891
1872
|
"div",
|
|
1892
1873
|
{
|
|
1893
1874
|
className: clsx_default(
|
|
@@ -1903,9 +1884,9 @@ var DayCell = import_react4.default.memo(
|
|
|
1903
1884
|
if (!disabled && day.isCurrentMonth) onSelect?.(day.date);
|
|
1904
1885
|
},
|
|
1905
1886
|
children: [
|
|
1906
|
-
/* @__PURE__ */ (0,
|
|
1907
|
-
dayEvents.length > 0 && /* @__PURE__ */ (0,
|
|
1908
|
-
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0,
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("span", { className: "calendar-day-number", children: day.day }),
|
|
1888
|
+
dayEvents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-day-events", children: [
|
|
1889
|
+
dayEvents.slice(0, 3).map((event, ei) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
1909
1890
|
"span",
|
|
1910
1891
|
{
|
|
1911
1892
|
className: "calendar-event-dot",
|
|
@@ -1918,7 +1899,7 @@ var DayCell = import_react4.default.memo(
|
|
|
1918
1899
|
},
|
|
1919
1900
|
ei
|
|
1920
1901
|
)),
|
|
1921
|
-
dayEvents.length > 3 && /* @__PURE__ */ (0,
|
|
1902
|
+
dayEvents.length > 3 && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("span", { className: "calendar-event-more", children: [
|
|
1922
1903
|
"+",
|
|
1923
1904
|
dayEvents.length - 3
|
|
1924
1905
|
] })
|
|
@@ -2039,21 +2020,21 @@ var Calendar = (props) => {
|
|
|
2039
2020
|
const weekdays = WEEKDAY_LABELS[locale];
|
|
2040
2021
|
const monthLabels = MONTH_LABELS[locale];
|
|
2041
2022
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(
|
|
2043
2024
|
"div",
|
|
2044
2025
|
{
|
|
2045
2026
|
className: "lib-xplat-calendar",
|
|
2046
2027
|
style: selectedColor ? { "--calendar-selected-color": `var(--${selectedColor})` } : void 0,
|
|
2047
2028
|
children: [
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2052
|
-
showToday && /* @__PURE__ */ (0,
|
|
2029
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { className: "calendar-header", children: [
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handlePrev, "aria-label": "\uC774\uC804", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronLeftIcon_default, {}) }),
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
2032
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-nav", onClick: handleNext, "aria-label": "\uB2E4\uC74C", children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(ChevronRightIcon_default, {}) }),
|
|
2033
|
+
showToday && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("button", { className: "calendar-today-btn", onClick: handleToday, children: locale === "ko" ? "\uC624\uB298" : "Today" })
|
|
2053
2034
|
] }),
|
|
2054
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
2035
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
2055
2036
|
const y = yearRangeStart + i;
|
|
2056
|
-
return /* @__PURE__ */ (0,
|
|
2037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2057
2038
|
"button",
|
|
2058
2039
|
{
|
|
2059
2040
|
type: "button",
|
|
@@ -2064,7 +2045,7 @@ var Calendar = (props) => {
|
|
|
2064
2045
|
y
|
|
2065
2046
|
);
|
|
2066
2047
|
}) }),
|
|
2067
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
2048
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2068
2049
|
"button",
|
|
2069
2050
|
{
|
|
2070
2051
|
type: "button",
|
|
@@ -2074,8 +2055,8 @@ var Calendar = (props) => {
|
|
|
2074
2055
|
},
|
|
2075
2056
|
i
|
|
2076
2057
|
)) }),
|
|
2077
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
2078
|
-
/* @__PURE__ */ (0,
|
|
2058
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)(import_jsx_runtime302.Fragment, { children: [
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2079
2060
|
"div",
|
|
2080
2061
|
{
|
|
2081
2062
|
className: clsx_default(
|
|
@@ -2087,12 +2068,12 @@ var Calendar = (props) => {
|
|
|
2087
2068
|
},
|
|
2088
2069
|
label
|
|
2089
2070
|
)) }),
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2071
|
+
/* @__PURE__ */ (0, import_jsx_runtime302.jsx)("div", { className: "calendar-grid", children: days.map((day, idx) => {
|
|
2091
2072
|
const dayEvents = getEventsForDay(day.date);
|
|
2092
2073
|
const t = day.date.getTime();
|
|
2093
2074
|
const disabled = t < minTime || t > maxTime;
|
|
2094
2075
|
const isSelected = selectedDate ? isSameDay(day.date, selectedDate) : false;
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
2096
2077
|
DayCell,
|
|
2097
2078
|
{
|
|
2098
2079
|
day,
|
|
@@ -2118,10 +2099,10 @@ var Calendar_default = Calendar;
|
|
|
2118
2099
|
var import_react5 = __toESM(require("react"), 1);
|
|
2119
2100
|
|
|
2120
2101
|
// src/components/CardTab/CardTabPanel.tsx
|
|
2121
|
-
var
|
|
2102
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
2122
2103
|
var CardTabPanel = (props) => {
|
|
2123
2104
|
const { children, columns = 3 } = props;
|
|
2124
|
-
return /* @__PURE__ */ (0,
|
|
2105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
2125
2106
|
"div",
|
|
2126
2107
|
{
|
|
2127
2108
|
className: "card-tab-panel",
|
|
@@ -2134,7 +2115,7 @@ CardTabPanel.displayName = "CardTab.Panel";
|
|
|
2134
2115
|
var CardTabPanel_default = CardTabPanel;
|
|
2135
2116
|
|
|
2136
2117
|
// src/components/CardTab/CardTab.tsx
|
|
2137
|
-
var
|
|
2118
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
2138
2119
|
var CardTabRoot = (props) => {
|
|
2139
2120
|
const {
|
|
2140
2121
|
tabs,
|
|
@@ -2158,10 +2139,10 @@ var CardTabRoot = (props) => {
|
|
|
2158
2139
|
const activePanel = panels.find(
|
|
2159
2140
|
(panel) => panel.props.value === activeValue
|
|
2160
2141
|
);
|
|
2161
|
-
return /* @__PURE__ */ (0,
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size), children: [
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
2163
2144
|
const isActive2 = tab.value === activeValue;
|
|
2164
|
-
return /* @__PURE__ */ (0,
|
|
2145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(
|
|
2165
2146
|
"button",
|
|
2166
2147
|
{
|
|
2167
2148
|
className: clsx_default("card-tab-trigger", isActive2 && "active"),
|
|
@@ -2173,7 +2154,7 @@ var CardTabRoot = (props) => {
|
|
|
2173
2154
|
tab.value
|
|
2174
2155
|
);
|
|
2175
2156
|
}) }),
|
|
2176
|
-
/* @__PURE__ */ (0,
|
|
2157
|
+
/* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "card-tab-body", children: activePanel })
|
|
2177
2158
|
] });
|
|
2178
2159
|
};
|
|
2179
2160
|
CardTabRoot.displayName = "CardTab";
|
|
@@ -2184,7 +2165,7 @@ var CardTab_default = CardTab;
|
|
|
2184
2165
|
|
|
2185
2166
|
// src/components/Chart/Chart.tsx
|
|
2186
2167
|
var import_react6 = __toESM(require("react"), 1);
|
|
2187
|
-
var
|
|
2168
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
2188
2169
|
var CATEGORICAL_COUNT2 = 8;
|
|
2189
2170
|
var LINE_BAR_PALETTES = Array.from({ length: CATEGORICAL_COUNT2 }, (_, i) => {
|
|
2190
2171
|
const n = i + 1;
|
|
@@ -2320,12 +2301,12 @@ var useChartTooltip = (enabled) => {
|
|
|
2320
2301
|
}, []);
|
|
2321
2302
|
return { tooltip, show, hide, move, containerRef };
|
|
2322
2303
|
};
|
|
2323
|
-
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0,
|
|
2304
|
+
var GridLines = import_react6.default.memo(({ width, height, chartH, maxVal }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: [0, 0.25, 0.5, 0.75, 1].map((ratio) => {
|
|
2324
2305
|
const y = PADDING.top + (1 - ratio) * chartH;
|
|
2325
2306
|
const val = Math.round(maxVal * ratio);
|
|
2326
|
-
return /* @__PURE__ */ (0,
|
|
2327
|
-
/* @__PURE__ */ (0,
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("line", { x1: PADDING.left, y1: y, x2: width - PADDING.right, y2: y, className: "chart-grid" }),
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left - 8, y: y + 4, className: "chart-axis-label", textAnchor: "end", children: val })
|
|
2329
2310
|
] }, ratio);
|
|
2330
2311
|
}) }));
|
|
2331
2312
|
GridLines.displayName = "GridLines";
|
|
@@ -2337,10 +2318,10 @@ var getLabelStep = (count, chartW) => {
|
|
|
2337
2318
|
};
|
|
2338
2319
|
var AxisLabels = import_react6.default.memo(({ labels, count, chartW, height }) => {
|
|
2339
2320
|
const step = getLabelStep(count, chartW);
|
|
2340
|
-
return /* @__PURE__ */ (0,
|
|
2321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: labels.map((label, i) => {
|
|
2341
2322
|
if (i % step !== 0) return null;
|
|
2342
2323
|
const x = PADDING.left + i / (count - 1 || 1) * chartW;
|
|
2343
|
-
return /* @__PURE__ */ (0,
|
|
2324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2344
2325
|
}) });
|
|
2345
2326
|
});
|
|
2346
2327
|
AxisLabels.displayName = "AxisLabels";
|
|
@@ -2416,7 +2397,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
2416
2397
|
}, [animate, width]);
|
|
2417
2398
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
2418
2399
|
const lineClipId = "line-area-clip";
|
|
2419
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
2420
2401
|
"svg",
|
|
2421
2402
|
{
|
|
2422
2403
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -2434,9 +2415,9 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
2434
2415
|
onLeave();
|
|
2435
2416
|
},
|
|
2436
2417
|
children: [
|
|
2437
|
-
animate && /* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2439
|
-
/* @__PURE__ */ (0,
|
|
2418
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: lineClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: clipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2419
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2420
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
2440
2421
|
entries.map(([key], di) => {
|
|
2441
2422
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2442
2423
|
const color = palette[2];
|
|
@@ -2445,16 +2426,16 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
2445
2426
|
const gradientId = `line-gradient-${di}`;
|
|
2446
2427
|
const polyPoints = points.map((p) => `${p.x},${p.y}`).join(" ");
|
|
2447
2428
|
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`;
|
|
2448
|
-
return /* @__PURE__ */ (0,
|
|
2449
|
-
/* @__PURE__ */ (0,
|
|
2450
|
-
/* @__PURE__ */ (0,
|
|
2451
|
-
/* @__PURE__ */ (0,
|
|
2429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
2430
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.2" }),
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0" })
|
|
2452
2433
|
] }) }),
|
|
2453
|
-
/* @__PURE__ */ (0,
|
|
2454
|
-
/* @__PURE__ */ (0,
|
|
2455
|
-
/* @__PURE__ */ (0,
|
|
2434
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${lineClipId})` : void 0, children: [
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaD, fill: `url(#${gradientId})` }),
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("polyline", { points: polyPoints, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2456
2437
|
] }),
|
|
2457
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0,
|
|
2438
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2458
2439
|
"circle",
|
|
2459
2440
|
{
|
|
2460
2441
|
cx: points[activeIndex].x,
|
|
@@ -2466,7 +2447,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
2466
2447
|
)
|
|
2467
2448
|
] }, di);
|
|
2468
2449
|
}),
|
|
2469
|
-
activeX !== null && /* @__PURE__ */ (0,
|
|
2450
|
+
activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2470
2451
|
"line",
|
|
2471
2452
|
{
|
|
2472
2453
|
x1: activeX,
|
|
@@ -2476,7 +2457,7 @@ var LineChart = import_react6.default.memo(({ data, labels, width, height, anima
|
|
|
2476
2457
|
className: "chart-crosshair"
|
|
2477
2458
|
}
|
|
2478
2459
|
),
|
|
2479
|
-
/* @__PURE__ */ (0,
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2480
2461
|
"rect",
|
|
2481
2462
|
{
|
|
2482
2463
|
x: PADDING.left,
|
|
@@ -2525,7 +2506,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
2525
2506
|
}, [animate, width]);
|
|
2526
2507
|
const activeX = activeIndex !== null ? seriesPoints[0]?.[activeIndex]?.x ?? null : null;
|
|
2527
2508
|
const curveClipId = "curve-area-clip";
|
|
2528
|
-
return /* @__PURE__ */ (0,
|
|
2509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
2529
2510
|
"svg",
|
|
2530
2511
|
{
|
|
2531
2512
|
viewBox: `0 0 ${width} ${height}`,
|
|
@@ -2544,9 +2525,9 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
2544
2525
|
onLeave();
|
|
2545
2526
|
},
|
|
2546
2527
|
children: [
|
|
2547
|
-
animate && /* @__PURE__ */ (0,
|
|
2548
|
-
/* @__PURE__ */ (0,
|
|
2549
|
-
/* @__PURE__ */ (0,
|
|
2528
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("clipPath", { id: curveClipId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("rect", { ref: curveClipRef, x: "0", y: "0", width: animate ? 0 : width, height }) }) }),
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(AxisLabels, { labels, count, chartW, height }),
|
|
2550
2531
|
entries.map(([key], di) => {
|
|
2551
2532
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2552
2533
|
const color = palette[2];
|
|
@@ -2555,16 +2536,16 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
2555
2536
|
const gradientId = `curve-gradient-${di}`;
|
|
2556
2537
|
const linePath = toSmoothPath(points);
|
|
2557
2538
|
const areaPath = linePath + ` L ${points[points.length - 1].x} ${PADDING.top + chartH} L ${points[0].x} ${PADDING.top + chartH} Z`;
|
|
2558
|
-
return /* @__PURE__ */ (0,
|
|
2559
|
-
/* @__PURE__ */ (0,
|
|
2560
|
-
/* @__PURE__ */ (0,
|
|
2561
|
-
/* @__PURE__ */ (0,
|
|
2539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "0%", stopColor: areaColor, stopOpacity: "0.4" }),
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("stop", { offset: "100%", stopColor: areaColor, stopOpacity: "0.02" })
|
|
2562
2543
|
] }) }),
|
|
2563
|
-
/* @__PURE__ */ (0,
|
|
2564
|
-
/* @__PURE__ */ (0,
|
|
2565
|
-
/* @__PURE__ */ (0,
|
|
2544
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("g", { clipPath: animate ? `url(#${curveClipId})` : void 0, children: [
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: areaPath, fill: `url(#${gradientId})` }),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("path", { d: linePath, fill: "none", stroke: color, strokeWidth: "2" })
|
|
2566
2547
|
] }),
|
|
2567
|
-
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0,
|
|
2548
|
+
activeIndex !== null && points[activeIndex] && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2568
2549
|
"circle",
|
|
2569
2550
|
{
|
|
2570
2551
|
cx: points[activeIndex].x,
|
|
@@ -2576,7 +2557,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
2576
2557
|
)
|
|
2577
2558
|
] }, di);
|
|
2578
2559
|
}),
|
|
2579
|
-
activeX !== null && /* @__PURE__ */ (0,
|
|
2560
|
+
activeX !== null && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2580
2561
|
"line",
|
|
2581
2562
|
{
|
|
2582
2563
|
x1: activeX,
|
|
@@ -2586,7 +2567,7 @@ var CurveChart = import_react6.default.memo(({ data, labels, width, height, anim
|
|
|
2586
2567
|
className: "chart-crosshair"
|
|
2587
2568
|
}
|
|
2588
2569
|
),
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2590
2571
|
"rect",
|
|
2591
2572
|
{
|
|
2592
2573
|
x: PADDING.left,
|
|
@@ -2629,11 +2610,11 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
|
|
|
2629
2610
|
[entries, maxVal, chartH, groupW, barW, barGap, groupCount]
|
|
2630
2611
|
);
|
|
2631
2612
|
const barLabelStep = getLabelStep(count, chartW);
|
|
2632
|
-
return /* @__PURE__ */ (0,
|
|
2633
|
-
/* @__PURE__ */ (0,
|
|
2613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${width} ${height}`, className: "chart-svg", children: [
|
|
2614
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(GridLines, { width, height, chartH, maxVal }),
|
|
2634
2615
|
labels.map((label, i) => {
|
|
2635
2616
|
if (i % barLabelStep !== 0) return null;
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("text", { x: PADDING.left + groupW * i + groupW / 2, y: height - 8, className: "chart-axis-label", textAnchor: "middle", children: label }, i);
|
|
2637
2618
|
}),
|
|
2638
2619
|
entries.map(([key], di) => {
|
|
2639
2620
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
@@ -2642,7 +2623,7 @@ var BarChart = import_react6.default.memo(({ data, labels, width, height, animat
|
|
|
2642
2623
|
const r2 = Math.min(4, b.w / 2);
|
|
2643
2624
|
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`;
|
|
2644
2625
|
const delay = 100 + i * 80;
|
|
2645
|
-
return /* @__PURE__ */ (0,
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2646
2627
|
"path",
|
|
2647
2628
|
{
|
|
2648
2629
|
d,
|
|
@@ -2722,8 +2703,8 @@ var PieDonutChart = import_react6.default.memo(
|
|
|
2722
2703
|
});
|
|
2723
2704
|
}, [values, total, cx, cy, r2, innerR, labels]);
|
|
2724
2705
|
const maskId = `pie-mask-${isDoughnut ? "d" : "p"}`;
|
|
2725
|
-
return /* @__PURE__ */ (0,
|
|
2726
|
-
animate && /* @__PURE__ */ (0,
|
|
2706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("svg", { viewBox: `0 0 ${size} ${size}`, className: "chart-svg chart-pie", children: [
|
|
2707
|
+
animate && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("mask", { id: maskId, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2727
2708
|
"circle",
|
|
2728
2709
|
{
|
|
2729
2710
|
ref: maskRef,
|
|
@@ -2736,7 +2717,7 @@ var PieDonutChart = import_react6.default.memo(
|
|
|
2736
2717
|
transform: `rotate(-90 ${cx} ${cy})`
|
|
2737
2718
|
}
|
|
2738
2719
|
) }) }),
|
|
2739
|
-
/* @__PURE__ */ (0,
|
|
2720
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { mask: animate ? `url(#${maskId})` : void 0, children: sliceData.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
2740
2721
|
"path",
|
|
2741
2722
|
{
|
|
2742
2723
|
d: s.d,
|
|
@@ -2771,15 +2752,15 @@ var ChartTooltip = ({ x, y, containerWidth, containerHeight, tooltipType, childr
|
|
|
2771
2752
|
const sepIdx = content.indexOf(" \u2014 ");
|
|
2772
2753
|
const title = sepIdx >= 0 ? content.slice(0, sepIdx) : content;
|
|
2773
2754
|
const desc = sepIdx >= 0 ? content.slice(sepIdx + 3) : "";
|
|
2774
|
-
return /* @__PURE__ */ (0,
|
|
2755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(
|
|
2775
2756
|
"div",
|
|
2776
2757
|
{
|
|
2777
2758
|
ref,
|
|
2778
2759
|
className: `lib-xplat-tooltip ${tooltipType} chart-tooltip-pos`,
|
|
2779
2760
|
style: { left: pos.left, top: pos.top },
|
|
2780
2761
|
children: [
|
|
2781
|
-
title && /* @__PURE__ */ (0,
|
|
2782
|
-
desc && /* @__PURE__ */ (0,
|
|
2762
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-title", children: title }),
|
|
2763
|
+
desc && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "tooltip-desc", children: desc })
|
|
2783
2764
|
]
|
|
2784
2765
|
}
|
|
2785
2766
|
);
|
|
@@ -2791,14 +2772,14 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2791
2772
|
const total = values.reduce((a, b) => a + b, 0) || 1;
|
|
2792
2773
|
const firstKey = entries[0]?.[0] ?? "";
|
|
2793
2774
|
const colorOffset = hashString(firstKey);
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: values.map((v, i) => {
|
|
2795
2776
|
const pct = Math.round(v / total * 100);
|
|
2796
2777
|
const color = PIE_COLORS[(i + colorOffset) % PIE_COLORS.length];
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2800
|
-
/* @__PURE__ */ (0,
|
|
2801
|
-
/* @__PURE__ */ (0,
|
|
2778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
|
|
2781
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: labels[i] || `${i + 1}` }),
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("span", { className: "chart-legend-value", children: [
|
|
2802
2783
|
v.toLocaleString(),
|
|
2803
2784
|
"(",
|
|
2804
2785
|
pct,
|
|
@@ -2808,16 +2789,16 @@ var ChartLegend = ({ data, labels, type }) => {
|
|
|
2808
2789
|
] }, i);
|
|
2809
2790
|
}) });
|
|
2810
2791
|
}
|
|
2811
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { className: "chart-legend", children: entries.map(([key], di) => {
|
|
2812
2793
|
const palette = getPalette(LINE_BAR_PALETTES, di, key);
|
|
2813
2794
|
const color = palette[2];
|
|
2814
2795
|
const values = entries[di][1];
|
|
2815
2796
|
const sum = values.reduce((a, b) => a + b, 0);
|
|
2816
|
-
return /* @__PURE__ */ (0,
|
|
2817
|
-
/* @__PURE__ */ (0,
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-item", children: [
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-dot", style: { backgroundColor: color } }),
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "chart-legend-text", children: [
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-label", children: key }),
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "chart-legend-value", children: sum.toLocaleString() })
|
|
2821
2802
|
] })
|
|
2822
2803
|
] }, di);
|
|
2823
2804
|
}) });
|
|
@@ -2831,14 +2812,14 @@ var Chart = import_react6.default.memo((props) => {
|
|
|
2831
2812
|
const dataKey = import_react6.default.useMemo(() => JSON.stringify(labels), [labels]);
|
|
2832
2813
|
const animate = useChartAnimation(containerRef, dataKey);
|
|
2833
2814
|
const ready = width > 0 && height > 0;
|
|
2834
|
-
return /* @__PURE__ */ (0,
|
|
2835
|
-
ready && type === "line" && /* @__PURE__ */ (0,
|
|
2836
|
-
ready && type === "curve" && /* @__PURE__ */ (0,
|
|
2837
|
-
ready && type === "bar" && /* @__PURE__ */ (0,
|
|
2838
|
-
ready && type === "pie" && /* @__PURE__ */ (0,
|
|
2839
|
-
ready && type === "doughnut" && /* @__PURE__ */ (0,
|
|
2840
|
-
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0,
|
|
2841
|
-
tooltip.visible && tooltip.content && /* @__PURE__ */ (0,
|
|
2815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-chart", ref: containerRef, children: [
|
|
2816
|
+
ready && type === "line" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(LineChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2817
|
+
ready && type === "curve" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CurveChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2818
|
+
ready && type === "bar" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(BarChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2819
|
+
ready && type === "pie" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, onHover: show, onMove: move, onLeave: hide }),
|
|
2820
|
+
ready && type === "doughnut" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(PieDonutChart, { data: stableData, labels: stableLabels, width, height, animate, isDoughnut: true, onHover: show, onMove: move, onLeave: hide }),
|
|
2821
|
+
ready && (type === "pie" || type === "doughnut") && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartLegend, { data: stableData, labels: stableLabels, type }),
|
|
2822
|
+
tooltip.visible && tooltip.content && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(ChartTooltip, { x: tooltip.x, y: tooltip.y, containerWidth: width, containerHeight: height, tooltipType, children: tooltip.content })
|
|
2842
2823
|
] });
|
|
2843
2824
|
});
|
|
2844
2825
|
Chart.displayName = "Chart";
|
|
@@ -2848,7 +2829,7 @@ var Chart_default = Chart;
|
|
|
2848
2829
|
var import_react7 = __toESM(require("react"), 1);
|
|
2849
2830
|
|
|
2850
2831
|
// src/components/IconButton/IconButton.tsx
|
|
2851
|
-
var
|
|
2832
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
2852
2833
|
var IconButton = (props) => {
|
|
2853
2834
|
const {
|
|
2854
2835
|
icon,
|
|
@@ -2857,7 +2838,7 @@ var IconButton = (props) => {
|
|
|
2857
2838
|
disabled,
|
|
2858
2839
|
...rest
|
|
2859
2840
|
} = props;
|
|
2860
|
-
return /* @__PURE__ */ (0,
|
|
2841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(
|
|
2861
2842
|
"button",
|
|
2862
2843
|
{
|
|
2863
2844
|
className: clsx_default("lib-xplat-icon-button", type, size),
|
|
@@ -2871,7 +2852,7 @@ IconButton.displayName = "IconButton";
|
|
|
2871
2852
|
var IconButton_default = IconButton;
|
|
2872
2853
|
|
|
2873
2854
|
// src/components/ChatInput/ChatInput.tsx
|
|
2874
|
-
var
|
|
2855
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
2875
2856
|
var ChatInput = import_react7.default.forwardRef(
|
|
2876
2857
|
(props, ref) => {
|
|
2877
2858
|
const {
|
|
@@ -2902,8 +2883,8 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
2902
2883
|
handleSubmit();
|
|
2903
2884
|
}
|
|
2904
2885
|
};
|
|
2905
|
-
return /* @__PURE__ */ (0,
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
2886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
2887
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
2907
2888
|
AutoResizeTextArea_default,
|
|
2908
2889
|
{
|
|
2909
2890
|
ref,
|
|
@@ -2917,10 +2898,10 @@ var ChatInput = import_react7.default.forwardRef(
|
|
|
2917
2898
|
onKeyDown: handleKeyDown
|
|
2918
2899
|
}
|
|
2919
2900
|
),
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)(
|
|
2921
2902
|
IconButton_default,
|
|
2922
2903
|
{
|
|
2923
|
-
icon: /* @__PURE__ */ (0,
|
|
2904
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(MessageSquareIcon_default, {}),
|
|
2924
2905
|
type: buttonType,
|
|
2925
2906
|
size: "sm",
|
|
2926
2907
|
disabled: !hasText || disabled,
|
|
@@ -2941,7 +2922,7 @@ var import_tokens_core = require("@x-plat/tokens-core");
|
|
|
2941
2922
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
2942
2923
|
|
|
2943
2924
|
// src/components/CheckBox/CheckBox.tsx
|
|
2944
|
-
var
|
|
2925
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
2945
2926
|
var CheckBox = (props) => {
|
|
2946
2927
|
const {
|
|
2947
2928
|
checked,
|
|
@@ -2960,8 +2941,8 @@ var CheckBox = (props) => {
|
|
|
2960
2941
|
const checkedClasses = `checked`;
|
|
2961
2942
|
const disabledClasses = "disabled";
|
|
2962
2943
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
2963
|
-
return /* @__PURE__ */ (0,
|
|
2964
|
-
/* @__PURE__ */ (0,
|
|
2944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
2945
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
2965
2946
|
"input",
|
|
2966
2947
|
{
|
|
2967
2948
|
type: "checkbox",
|
|
@@ -2971,22 +2952,22 @@ var CheckBox = (props) => {
|
|
|
2971
2952
|
...rest
|
|
2972
2953
|
}
|
|
2973
2954
|
),
|
|
2974
|
-
/* @__PURE__ */ (0,
|
|
2975
|
-
label && /* @__PURE__ */ (0,
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(CheckIcon_default, {}) }) }),
|
|
2956
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("span", { className: "label", children: label })
|
|
2976
2957
|
] });
|
|
2977
2958
|
};
|
|
2978
2959
|
CheckBox.displayName = "CheckBox";
|
|
2979
2960
|
var CheckBox_default = CheckBox;
|
|
2980
2961
|
|
|
2981
2962
|
// src/components/Chip/Chip.tsx
|
|
2982
|
-
var
|
|
2963
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
2983
2964
|
var Chip = (props) => {
|
|
2984
2965
|
const {
|
|
2985
2966
|
children,
|
|
2986
2967
|
type = "primary",
|
|
2987
2968
|
size = "md"
|
|
2988
2969
|
} = props;
|
|
2989
|
-
return /* @__PURE__ */ (0,
|
|
2970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size), children });
|
|
2990
2971
|
};
|
|
2991
2972
|
Chip.displayName = "Chip";
|
|
2992
2973
|
var Chip_default = Chip;
|
|
@@ -2998,17 +2979,17 @@ var import_react14 = __toESM(require("react"), 1);
|
|
|
2998
2979
|
var import_react8 = __toESM(require("react"), 1);
|
|
2999
2980
|
|
|
3000
2981
|
// src/components/Input/InputValidations.tsx
|
|
3001
|
-
var
|
|
2982
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
3002
2983
|
var InputValidations = (props) => {
|
|
3003
2984
|
const { message, status = "default" } = props;
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3006
|
-
status === "default" && /* @__PURE__ */ (0,
|
|
3007
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
3008
|
-
status === "warning" && /* @__PURE__ */ (0,
|
|
3009
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2986
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "icon", children: [
|
|
2987
|
+
status === "default" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
|
|
2988
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(SuccessIcon_default, {}),
|
|
2989
|
+
status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(InfoIcon_default, {}),
|
|
2990
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(ErrorIcon_default, {})
|
|
3010
2991
|
] }),
|
|
3011
|
-
/* @__PURE__ */ (0,
|
|
2992
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "message", children: message })
|
|
3012
2993
|
] });
|
|
3013
2994
|
};
|
|
3014
2995
|
InputValidations.displayName = "InputValidations";
|
|
@@ -3049,7 +3030,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
3049
3030
|
};
|
|
3050
3031
|
|
|
3051
3032
|
// src/components/Input/Input.tsx
|
|
3052
|
-
var
|
|
3033
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
3053
3034
|
var import_react9 = require("react");
|
|
3054
3035
|
var formatValue = (type, value) => {
|
|
3055
3036
|
if (value === null || value === void 0) return "";
|
|
@@ -3125,13 +3106,13 @@ var Input = import_react8.default.forwardRef((props, ref) => {
|
|
|
3125
3106
|
onChange(event);
|
|
3126
3107
|
}
|
|
3127
3108
|
};
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
-
/* @__PURE__ */ (0,
|
|
3109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)("div", { className: clsx_default("lib-xplat-input-wrap", className), children: [
|
|
3110
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(
|
|
3130
3111
|
"div",
|
|
3131
3112
|
{
|
|
3132
3113
|
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
3133
3114
|
children: [
|
|
3134
|
-
/* @__PURE__ */ (0,
|
|
3115
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
3135
3116
|
"input",
|
|
3136
3117
|
{
|
|
3137
3118
|
...inputProps,
|
|
@@ -3142,11 +3123,11 @@ var Input = import_react8.default.forwardRef((props, ref) => {
|
|
|
3142
3123
|
onChange: handleChange
|
|
3143
3124
|
}
|
|
3144
3125
|
),
|
|
3145
|
-
suffix && /* @__PURE__ */ (0,
|
|
3126
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "suffix", children: suffix })
|
|
3146
3127
|
]
|
|
3147
3128
|
}
|
|
3148
3129
|
),
|
|
3149
|
-
validations && /* @__PURE__ */ (0,
|
|
3130
|
+
validations && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react9.createElement)(
|
|
3150
3131
|
InputValidations_default,
|
|
3151
3132
|
{
|
|
3152
3133
|
...validation,
|
|
@@ -3160,7 +3141,7 @@ var Input_default = Input;
|
|
|
3160
3141
|
|
|
3161
3142
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
3162
3143
|
var import_react10 = __toESM(require("react"), 1);
|
|
3163
|
-
var
|
|
3144
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
3164
3145
|
var PasswordInput = import_react10.default.forwardRef(
|
|
3165
3146
|
(props, ref) => {
|
|
3166
3147
|
const { reg: _reg, ...inputProps } = props;
|
|
@@ -3168,11 +3149,11 @@ var PasswordInput = import_react10.default.forwardRef(
|
|
|
3168
3149
|
const handleChangeView = () => {
|
|
3169
3150
|
setIsView((prev) => !prev);
|
|
3170
3151
|
};
|
|
3171
|
-
return /* @__PURE__ */ (0,
|
|
3152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
3172
3153
|
Input_default,
|
|
3173
3154
|
{
|
|
3174
3155
|
...inputProps,
|
|
3175
|
-
suffix: /* @__PURE__ */ (0,
|
|
3156
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(OpenEyeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(CloseEyeIcon_default, {}) }),
|
|
3176
3157
|
type: isView ? "text" : "password",
|
|
3177
3158
|
ref
|
|
3178
3159
|
}
|
|
@@ -3189,9 +3170,9 @@ var import_react_dom2 = require("react-dom");
|
|
|
3189
3170
|
// src/tokens/hooks/Portal.tsx
|
|
3190
3171
|
var import_react11 = __toESM(require("react"), 1);
|
|
3191
3172
|
var import_react_dom = __toESM(require("react-dom"), 1);
|
|
3192
|
-
var
|
|
3173
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
3193
3174
|
var PortalContainerContext = import_react11.default.createContext(null);
|
|
3194
|
-
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0,
|
|
3175
|
+
var PortalProvider = ({ container, children }) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(PortalContainerContext.Provider, { value: container, children });
|
|
3195
3176
|
var Portal = ({ children }) => {
|
|
3196
3177
|
const contextContainer = import_react11.default.useContext(PortalContainerContext);
|
|
3197
3178
|
if (typeof document === "undefined") return null;
|
|
@@ -3202,7 +3183,7 @@ Portal.displayName = "Portal";
|
|
|
3202
3183
|
var Portal_default = Portal;
|
|
3203
3184
|
|
|
3204
3185
|
// src/components/Modal/Modal.tsx
|
|
3205
|
-
var
|
|
3186
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
3206
3187
|
var ANIMATION_DURATION_MS = 200;
|
|
3207
3188
|
var Modal = (props) => {
|
|
3208
3189
|
const { isOpen, onClose, children } = props;
|
|
@@ -3223,12 +3204,12 @@ var Modal = (props) => {
|
|
|
3223
3204
|
if (!mounted) return null;
|
|
3224
3205
|
const stateClass = visible ? "enter" : "exit";
|
|
3225
3206
|
return (0, import_react_dom2.createPortal)(
|
|
3226
|
-
/* @__PURE__ */ (0,
|
|
3207
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3227
3208
|
"div",
|
|
3228
3209
|
{
|
|
3229
3210
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
3230
3211
|
onClick: onClose,
|
|
3231
|
-
children: /* @__PURE__ */ (0,
|
|
3212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
3232
3213
|
"div",
|
|
3233
3214
|
{
|
|
3234
3215
|
ref: boxRef,
|
|
@@ -3236,7 +3217,7 @@ var Modal = (props) => {
|
|
|
3236
3217
|
role: "dialog",
|
|
3237
3218
|
"aria-modal": "true",
|
|
3238
3219
|
onClick: (e) => e.stopPropagation(),
|
|
3239
|
-
children: /* @__PURE__ */ (0,
|
|
3220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(PortalProvider, { container: boxRef.current, children })
|
|
3240
3221
|
}
|
|
3241
3222
|
)
|
|
3242
3223
|
}
|
|
@@ -3249,7 +3230,7 @@ var Modal_default = Modal;
|
|
|
3249
3230
|
|
|
3250
3231
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
3251
3232
|
var import_react13 = __toESM(require("react"), 1);
|
|
3252
|
-
var
|
|
3233
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
3253
3234
|
var DayCell2 = import_react13.default.memo(
|
|
3254
3235
|
({
|
|
3255
3236
|
day,
|
|
@@ -3260,7 +3241,7 @@ var DayCell2 = import_react13.default.memo(
|
|
|
3260
3241
|
isEnd,
|
|
3261
3242
|
inRange,
|
|
3262
3243
|
onSelect
|
|
3263
|
-
}) => /* @__PURE__ */ (0,
|
|
3244
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3264
3245
|
"button",
|
|
3265
3246
|
{
|
|
3266
3247
|
type: "button",
|
|
@@ -3358,20 +3339,20 @@ var SingleDatePicker = (props) => {
|
|
|
3358
3339
|
const monthLabels = MONTH_LABELS[locale];
|
|
3359
3340
|
const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
|
|
3360
3341
|
const hasRange = rangeStart != null && rangeEnd != null;
|
|
3361
|
-
return /* @__PURE__ */ (0,
|
|
3342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)(
|
|
3362
3343
|
"div",
|
|
3363
3344
|
{
|
|
3364
3345
|
className: clsx_default("lib-xplat-datepicker", "single"),
|
|
3365
3346
|
children: [
|
|
3366
|
-
/* @__PURE__ */ (0,
|
|
3367
|
-
/* @__PURE__ */ (0,
|
|
3368
|
-
/* @__PURE__ */ (0,
|
|
3369
|
-
/* @__PURE__ */ (0,
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "datepicker-header", children: [
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(ChevronLeftIcon_default, {}) }),
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("button", { className: "datepicker-title", onClick: handleTitleClick, type: "button", children: titleText }),
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("button", { className: "datepicker-nav", onClick: handleNext, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(ChevronRightIcon_default, {}) })
|
|
3370
3351
|
] }),
|
|
3371
|
-
/* @__PURE__ */ (0,
|
|
3372
|
-
pickerMode === "years" && /* @__PURE__ */ (0,
|
|
3352
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsxs)("div", { className: "datepicker-body", children: [
|
|
3353
|
+
pickerMode === "years" && /* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "datepicker-picker-grid", children: Array.from({ length: 12 }, (_, i) => {
|
|
3373
3354
|
const y = yearRangeStart + i;
|
|
3374
|
-
return /* @__PURE__ */ (0,
|
|
3355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3375
3356
|
"button",
|
|
3376
3357
|
{
|
|
3377
3358
|
type: "button",
|
|
@@ -3382,7 +3363,7 @@ var SingleDatePicker = (props) => {
|
|
|
3382
3363
|
y
|
|
3383
3364
|
);
|
|
3384
3365
|
}) }),
|
|
3385
|
-
pickerMode === "months" && /* @__PURE__ */ (0,
|
|
3366
|
+
pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3386
3367
|
"button",
|
|
3387
3368
|
{
|
|
3388
3369
|
type: "button",
|
|
@@ -3392,8 +3373,8 @@ var SingleDatePicker = (props) => {
|
|
|
3392
3373
|
},
|
|
3393
3374
|
i
|
|
3394
3375
|
)) }),
|
|
3395
|
-
pickerMode === "days" && /* @__PURE__ */ (0,
|
|
3396
|
-
/* @__PURE__ */ (0,
|
|
3376
|
+
pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime315.jsxs)(import_jsx_runtime315.Fragment, { children: [
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3397
3378
|
"div",
|
|
3398
3379
|
{
|
|
3399
3380
|
className: clsx_default(
|
|
@@ -3405,7 +3386,7 @@ var SingleDatePicker = (props) => {
|
|
|
3405
3386
|
},
|
|
3406
3387
|
label
|
|
3407
3388
|
)) }),
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3389
|
+
/* @__PURE__ */ (0, import_jsx_runtime315.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
|
|
3409
3390
|
const t = day.date.getTime();
|
|
3410
3391
|
const disabled = t < minTime || t > maxTime;
|
|
3411
3392
|
const selected = value ? isSameDay(day.date, value) : false;
|
|
@@ -3415,7 +3396,7 @@ var SingleDatePicker = (props) => {
|
|
|
3415
3396
|
const isStart = hasRange ? isSameDay(day.date, rangeStart) : false;
|
|
3416
3397
|
const isEnd = hasRange ? isSameDay(day.date, rangeEnd) : false;
|
|
3417
3398
|
const inRangeVal = hasRange ? isInRange(day.date, rangeStart, rangeEnd) : false;
|
|
3418
|
-
return /* @__PURE__ */ (0,
|
|
3399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
3419
3400
|
DayCell2,
|
|
3420
3401
|
{
|
|
3421
3402
|
day,
|
|
@@ -3440,7 +3421,7 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
3440
3421
|
var SingleDatePicker_default = SingleDatePicker;
|
|
3441
3422
|
|
|
3442
3423
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
3443
|
-
var
|
|
3424
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
3444
3425
|
var formatDate = (date) => {
|
|
3445
3426
|
if (!date || !(date instanceof Date) || isNaN(date.getTime())) return "";
|
|
3446
3427
|
const y = date.getFullYear();
|
|
@@ -3467,19 +3448,19 @@ var InputDatePicker = (props) => {
|
|
|
3467
3448
|
const handleClose = () => {
|
|
3468
3449
|
setIsOpen(false);
|
|
3469
3450
|
};
|
|
3470
|
-
return /* @__PURE__ */ (0,
|
|
3471
|
-
/* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: clsx_default("lib-xplat-datepicker input-datepicker", disabled && "disabled"), children: [
|
|
3452
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "input-datepicker-trigger", onClick: handleOpen, children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
3472
3453
|
Input_default,
|
|
3473
3454
|
{
|
|
3474
3455
|
value: formatDate(value),
|
|
3475
3456
|
placeholder,
|
|
3476
|
-
suffix: /* @__PURE__ */ (0,
|
|
3457
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(CalenderIcon_default, {}),
|
|
3477
3458
|
disabled,
|
|
3478
3459
|
readOnly: true
|
|
3479
3460
|
}
|
|
3480
3461
|
) }),
|
|
3481
|
-
/* @__PURE__ */ (0,
|
|
3482
|
-
/* @__PURE__ */ (0,
|
|
3462
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "popup-datepicker-content", children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
3483
3464
|
SingleDatePicker_default,
|
|
3484
3465
|
{
|
|
3485
3466
|
value: tempDate,
|
|
@@ -3489,9 +3470,9 @@ var InputDatePicker = (props) => {
|
|
|
3489
3470
|
locale
|
|
3490
3471
|
}
|
|
3491
3472
|
) }),
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
3493
|
-
/* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(Button_default, { type: "secondary", onClick: handleClose, children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel" }),
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(Button_default, { type: "primary", onClick: handleApply, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3495
3476
|
] })
|
|
3496
3477
|
] }) })
|
|
3497
3478
|
] });
|
|
@@ -3510,10 +3491,10 @@ var import_react16 = __toESM(require("react"), 1);
|
|
|
3510
3491
|
|
|
3511
3492
|
// src/components/Tab/TabItem.tsx
|
|
3512
3493
|
var import_react15 = __toESM(require("react"), 1);
|
|
3513
|
-
var
|
|
3494
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
3514
3495
|
var TabItem = import_react15.default.forwardRef((props, ref) => {
|
|
3515
3496
|
const { isActive: isActive2, title, onClick } = props;
|
|
3516
|
-
return /* @__PURE__ */ (0,
|
|
3497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
3517
3498
|
"div",
|
|
3518
3499
|
{
|
|
3519
3500
|
ref,
|
|
@@ -3527,7 +3508,7 @@ TabItem.displayName = "TabItem";
|
|
|
3527
3508
|
var TabItem_default = TabItem;
|
|
3528
3509
|
|
|
3529
3510
|
// src/components/Tab/Tab.tsx
|
|
3530
|
-
var
|
|
3511
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
3531
3512
|
var Tab = (props) => {
|
|
3532
3513
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3533
3514
|
const [underlineStyle, setUnderlineStyle] = import_react16.default.useState({
|
|
@@ -3544,8 +3525,8 @@ var Tab = (props) => {
|
|
|
3544
3525
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3545
3526
|
}
|
|
3546
3527
|
}, [activeIndex, tabs.length]);
|
|
3547
|
-
return /* @__PURE__ */ (0,
|
|
3548
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
3528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3529
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3549
3530
|
TabItem_default,
|
|
3550
3531
|
{
|
|
3551
3532
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3557,7 +3538,7 @@ var Tab = (props) => {
|
|
|
3557
3538
|
},
|
|
3558
3539
|
`${tab.value}_${idx}`
|
|
3559
3540
|
)),
|
|
3560
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
3541
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
|
|
3561
3542
|
"div",
|
|
3562
3543
|
{
|
|
3563
3544
|
className: "tab-toggle-underline",
|
|
@@ -3573,7 +3554,7 @@ Tab.displayName = "Tab";
|
|
|
3573
3554
|
var Tab_default = Tab;
|
|
3574
3555
|
|
|
3575
3556
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
3576
|
-
var
|
|
3557
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
3577
3558
|
var RangePicker = (props) => {
|
|
3578
3559
|
const {
|
|
3579
3560
|
startDate,
|
|
@@ -3596,8 +3577,8 @@ var RangePicker = (props) => {
|
|
|
3596
3577
|
};
|
|
3597
3578
|
const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
|
|
3598
3579
|
const endMinDate = minDate && startDate > minDate ? startDate : startDate;
|
|
3599
|
-
return /* @__PURE__ */ (0,
|
|
3600
|
-
/* @__PURE__ */ (0,
|
|
3580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3601
3582
|
Tab_default,
|
|
3602
3583
|
{
|
|
3603
3584
|
activeIndex: activeTab === "start" ? 0 : 1,
|
|
@@ -3610,8 +3591,8 @@ var RangePicker = (props) => {
|
|
|
3610
3591
|
size: "sm"
|
|
3611
3592
|
}
|
|
3612
3593
|
) }),
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
3594
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsxs)("div", { className: "datepicker-range-panels", children: [
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3615
3596
|
SingleDatePicker_default,
|
|
3616
3597
|
{
|
|
3617
3598
|
value: startDate,
|
|
@@ -3623,7 +3604,7 @@ var RangePicker = (props) => {
|
|
|
3623
3604
|
locale
|
|
3624
3605
|
}
|
|
3625
3606
|
),
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3627
3608
|
SingleDatePicker_default,
|
|
3628
3609
|
{
|
|
3629
3610
|
value: endDate,
|
|
@@ -3636,7 +3617,7 @@ var RangePicker = (props) => {
|
|
|
3636
3617
|
}
|
|
3637
3618
|
)
|
|
3638
3619
|
] }),
|
|
3639
|
-
/* @__PURE__ */ (0,
|
|
3620
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3640
3621
|
SingleDatePicker_default,
|
|
3641
3622
|
{
|
|
3642
3623
|
value: startDate,
|
|
@@ -3647,7 +3628,7 @@ var RangePicker = (props) => {
|
|
|
3647
3628
|
rangeEnd: endDate,
|
|
3648
3629
|
locale
|
|
3649
3630
|
}
|
|
3650
|
-
) : /* @__PURE__ */ (0,
|
|
3631
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
3651
3632
|
SingleDatePicker_default,
|
|
3652
3633
|
{
|
|
3653
3634
|
value: endDate,
|
|
@@ -3665,7 +3646,7 @@ RangePicker.displayName = "RangePicker";
|
|
|
3665
3646
|
var RangePicker_default = RangePicker;
|
|
3666
3647
|
|
|
3667
3648
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
3668
|
-
var
|
|
3649
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
3669
3650
|
var PopupPicker = (props) => {
|
|
3670
3651
|
const { component, type, locale } = props;
|
|
3671
3652
|
const [isOpen, setIsOpen] = import_react18.default.useState(false);
|
|
@@ -3676,11 +3657,11 @@ var PopupPicker = (props) => {
|
|
|
3676
3657
|
props.onChange?.(date);
|
|
3677
3658
|
handleClose();
|
|
3678
3659
|
};
|
|
3679
|
-
return /* @__PURE__ */ (0,
|
|
3660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
3680
3661
|
import_react18.default.cloneElement(component, { onClick: handleClick }),
|
|
3681
|
-
/* @__PURE__ */ (0,
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
3683
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
3662
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
3663
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
3664
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
3684
3665
|
SingleDatePicker_default,
|
|
3685
3666
|
{
|
|
3686
3667
|
value: props.value,
|
|
@@ -3690,7 +3671,7 @@ var PopupPicker = (props) => {
|
|
|
3690
3671
|
locale
|
|
3691
3672
|
}
|
|
3692
3673
|
),
|
|
3693
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
3674
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
3694
3675
|
RangePicker_default,
|
|
3695
3676
|
{
|
|
3696
3677
|
startDate: props.startDate,
|
|
@@ -3702,8 +3683,8 @@ var PopupPicker = (props) => {
|
|
|
3702
3683
|
}
|
|
3703
3684
|
)
|
|
3704
3685
|
] }),
|
|
3705
|
-
/* @__PURE__ */ (0,
|
|
3706
|
-
/* @__PURE__ */ (0,
|
|
3686
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
3687
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
3707
3688
|
Button_default,
|
|
3708
3689
|
{
|
|
3709
3690
|
type: "secondary",
|
|
@@ -3711,7 +3692,7 @@ var PopupPicker = (props) => {
|
|
|
3711
3692
|
children: locale === "ko" ? "\uCDE8\uC18C" : "Cancel"
|
|
3712
3693
|
}
|
|
3713
3694
|
),
|
|
3714
|
-
/* @__PURE__ */ (0,
|
|
3695
|
+
/* @__PURE__ */ (0, import_jsx_runtime320.jsx)(Button_default, { type: "primary", onClick: handleClose, children: locale === "ko" ? "\uC801\uC6A9" : "Apply" })
|
|
3715
3696
|
] })
|
|
3716
3697
|
] }) })
|
|
3717
3698
|
] });
|
|
@@ -3720,10 +3701,10 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
3720
3701
|
var PopupPicker_default = PopupPicker;
|
|
3721
3702
|
|
|
3722
3703
|
// src/components/Divider/Divider.tsx
|
|
3723
|
-
var
|
|
3704
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
3724
3705
|
var Divider = (props) => {
|
|
3725
3706
|
const { orientation = "horizontal" } = props;
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
3727
3708
|
"div",
|
|
3728
3709
|
{
|
|
3729
3710
|
className: clsx_default("lib-xplat-divider", orientation),
|
|
@@ -3738,7 +3719,7 @@ var Divider_default = Divider;
|
|
|
3738
3719
|
// src/components/Drawer/Drawer.tsx
|
|
3739
3720
|
var import_react19 = __toESM(require("react"), 1);
|
|
3740
3721
|
var import_react_dom3 = require("react-dom");
|
|
3741
|
-
var
|
|
3722
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
3742
3723
|
var ANIMATION_DURATION_MS2 = 250;
|
|
3743
3724
|
var Drawer = (props) => {
|
|
3744
3725
|
const { isOpen, onClose, placement = "right", size = "md", title, children } = props;
|
|
@@ -3758,12 +3739,12 @@ var Drawer = (props) => {
|
|
|
3758
3739
|
if (!mounted) return null;
|
|
3759
3740
|
const stateClass = visible ? "enter" : "exit";
|
|
3760
3741
|
return (0, import_react_dom3.createPortal)(
|
|
3761
|
-
/* @__PURE__ */ (0,
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)(
|
|
3762
3743
|
"div",
|
|
3763
3744
|
{
|
|
3764
3745
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
3765
3746
|
onClick: onClose,
|
|
3766
|
-
children: /* @__PURE__ */ (0,
|
|
3747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)(
|
|
3767
3748
|
"div",
|
|
3768
3749
|
{
|
|
3769
3750
|
className: clsx_default("lib-xplat-drawer", placement, size, stateClass),
|
|
@@ -3771,11 +3752,11 @@ var Drawer = (props) => {
|
|
|
3771
3752
|
"aria-modal": "true",
|
|
3772
3753
|
onClick: (e) => e.stopPropagation(),
|
|
3773
3754
|
children: [
|
|
3774
|
-
title && /* @__PURE__ */ (0,
|
|
3775
|
-
/* @__PURE__ */ (0,
|
|
3776
|
-
/* @__PURE__ */ (0,
|
|
3755
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime322.jsxs)("div", { className: "drawer-header", children: [
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("span", { className: "drawer-title", children: title }),
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3777
3758
|
] }),
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
3759
|
+
/* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "drawer-body", children })
|
|
3779
3760
|
]
|
|
3780
3761
|
}
|
|
3781
3762
|
)
|
|
@@ -3877,7 +3858,7 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
3877
3858
|
var useClickOutside_default = useClickOutside;
|
|
3878
3859
|
|
|
3879
3860
|
// src/components/Dropdown/Dropdown.tsx
|
|
3880
|
-
var
|
|
3861
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
3881
3862
|
var Dropdown = (props) => {
|
|
3882
3863
|
const { items, children } = props;
|
|
3883
3864
|
const [isOpen, setIsOpen] = import_react22.default.useState(false);
|
|
@@ -3902,8 +3883,8 @@ var Dropdown = (props) => {
|
|
|
3902
3883
|
item.onClick?.();
|
|
3903
3884
|
setIsOpen(false);
|
|
3904
3885
|
};
|
|
3905
|
-
return /* @__PURE__ */ (0,
|
|
3906
|
-
/* @__PURE__ */ (0,
|
|
3886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "lib-xplat-dropdown", children: [
|
|
3887
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
3907
3888
|
"div",
|
|
3908
3889
|
{
|
|
3909
3890
|
ref: triggerRef,
|
|
@@ -3912,14 +3893,14 @@ var Dropdown = (props) => {
|
|
|
3912
3893
|
children
|
|
3913
3894
|
}
|
|
3914
3895
|
),
|
|
3915
|
-
mounted && /* @__PURE__ */ (0,
|
|
3896
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
3916
3897
|
"div",
|
|
3917
3898
|
{
|
|
3918
3899
|
ref: menuRef,
|
|
3919
3900
|
className: clsx_default("lib-xplat-dropdown-menu", direction, { visible }),
|
|
3920
3901
|
style: { top: position.top, left: position.left },
|
|
3921
3902
|
role: "menu",
|
|
3922
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
3903
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
3923
3904
|
"button",
|
|
3924
3905
|
{
|
|
3925
3906
|
className: clsx_default("dropdown-item", {
|
|
@@ -3942,7 +3923,7 @@ var Dropdown_default = Dropdown;
|
|
|
3942
3923
|
|
|
3943
3924
|
// src/components/Editor/Editor.tsx
|
|
3944
3925
|
var import_react23 = __toESM(require("react"), 1);
|
|
3945
|
-
var
|
|
3926
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
3946
3927
|
var DEFAULT_TOOLBAR = [
|
|
3947
3928
|
"bold",
|
|
3948
3929
|
"italic",
|
|
@@ -4462,8 +4443,8 @@ var Editor = (props) => {
|
|
|
4462
4443
|
break;
|
|
4463
4444
|
}
|
|
4464
4445
|
};
|
|
4465
|
-
return /* @__PURE__ */ (0,
|
|
4466
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
4446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: clsx_default("lib-xplat-editor", isFocused && "focused", readOnly && "readonly"), children: [
|
|
4447
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4467
4448
|
EditorToolbar,
|
|
4468
4449
|
{
|
|
4469
4450
|
items: toolbar,
|
|
@@ -4471,9 +4452,9 @@ var Editor = (props) => {
|
|
|
4471
4452
|
onAction: onToolbarAction
|
|
4472
4453
|
}
|
|
4473
4454
|
),
|
|
4474
|
-
/* @__PURE__ */ (0,
|
|
4475
|
-
isEmpty && !isFocused && /* @__PURE__ */ (0,
|
|
4476
|
-
/* @__PURE__ */ (0,
|
|
4455
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("div", { className: "lib-xplat-editor__content", style: { minHeight }, children: [
|
|
4456
|
+
isEmpty && !isFocused && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "lib-xplat-editor__placeholder", children: placeholder }),
|
|
4457
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4477
4458
|
"div",
|
|
4478
4459
|
{
|
|
4479
4460
|
ref: editorRef,
|
|
@@ -4492,7 +4473,7 @@ var Editor = (props) => {
|
|
|
4492
4473
|
spellCheck: true
|
|
4493
4474
|
}
|
|
4494
4475
|
),
|
|
4495
|
-
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0,
|
|
4476
|
+
slashOpen && filteredSlashItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4496
4477
|
SlashMenu,
|
|
4497
4478
|
{
|
|
4498
4479
|
position: slashPos,
|
|
@@ -4502,7 +4483,7 @@ var Editor = (props) => {
|
|
|
4502
4483
|
onClose: closeSlashMenu
|
|
4503
4484
|
}
|
|
4504
4485
|
),
|
|
4505
|
-
linkOpen && /* @__PURE__ */ (0,
|
|
4486
|
+
linkOpen && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4506
4487
|
LinkPopover,
|
|
4507
4488
|
{
|
|
4508
4489
|
position: linkPos,
|
|
@@ -4554,7 +4535,7 @@ var isActive = (item, active) => {
|
|
|
4554
4535
|
return active.has(item);
|
|
4555
4536
|
};
|
|
4556
4537
|
var EditorToolbar = ({ items, active, onAction }) => {
|
|
4557
|
-
return /* @__PURE__ */ (0,
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("div", { className: "lib-xplat-editor__toolbar", children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4558
4539
|
"button",
|
|
4559
4540
|
{
|
|
4560
4541
|
type: "button",
|
|
@@ -4579,12 +4560,12 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
4579
4560
|
window.addEventListener("mousedown", handleClickOutside);
|
|
4580
4561
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
4581
4562
|
}, [onClose]);
|
|
4582
|
-
return /* @__PURE__ */ (0,
|
|
4563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4583
4564
|
"div",
|
|
4584
4565
|
{
|
|
4585
4566
|
className: "lib-xplat-editor__slash-menu",
|
|
4586
4567
|
style: { top: position.top, left: position.left },
|
|
4587
|
-
children: items.map((item, i) => /* @__PURE__ */ (0,
|
|
4568
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
4588
4569
|
"button",
|
|
4589
4570
|
{
|
|
4590
4571
|
type: "button",
|
|
@@ -4594,8 +4575,8 @@ var SlashMenu = ({ position, items, activeIndex, onSelect, onClose }) => {
|
|
|
4594
4575
|
onSelect(item);
|
|
4595
4576
|
},
|
|
4596
4577
|
children: [
|
|
4597
|
-
/* @__PURE__ */ (0,
|
|
4598
|
-
item.hint && /* @__PURE__ */ (0,
|
|
4578
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("span", { className: "label", children: item.label }),
|
|
4579
|
+
item.hint && /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("span", { className: "hint", children: item.hint })
|
|
4599
4580
|
]
|
|
4600
4581
|
},
|
|
4601
4582
|
item.key
|
|
@@ -4608,13 +4589,13 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4608
4589
|
import_react23.default.useEffect(() => {
|
|
4609
4590
|
inputRef.current?.focus();
|
|
4610
4591
|
}, []);
|
|
4611
|
-
return /* @__PURE__ */ (0,
|
|
4592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)(
|
|
4612
4593
|
"div",
|
|
4613
4594
|
{
|
|
4614
4595
|
className: "lib-xplat-editor__link-popover",
|
|
4615
4596
|
style: { top: position.top, left: position.left },
|
|
4616
4597
|
children: [
|
|
4617
|
-
/* @__PURE__ */ (0,
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
4618
4599
|
"input",
|
|
4619
4600
|
{
|
|
4620
4601
|
ref: inputRef,
|
|
@@ -4634,11 +4615,11 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4634
4615
|
}
|
|
4635
4616
|
}
|
|
4636
4617
|
),
|
|
4637
|
-
/* @__PURE__ */ (0,
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
4638
4619
|
e.preventDefault();
|
|
4639
4620
|
onConfirm();
|
|
4640
4621
|
}, children: "\uC801\uC6A9" }),
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)("button", { type: "button", onMouseDown: (e) => {
|
|
4642
4623
|
e.preventDefault();
|
|
4643
4624
|
onClose();
|
|
4644
4625
|
}, children: "\uCDE8\uC18C" })
|
|
@@ -4648,15 +4629,15 @@ var LinkPopover = ({ position, value, onChange, onConfirm, onClose }) => {
|
|
|
4648
4629
|
};
|
|
4649
4630
|
|
|
4650
4631
|
// src/components/EmptyState/EmptyState.tsx
|
|
4651
|
-
var
|
|
4632
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
4652
4633
|
var EmptyState = (props) => {
|
|
4653
4634
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action } = props;
|
|
4654
|
-
return /* @__PURE__ */ (0,
|
|
4655
|
-
icon && /* @__PURE__ */ (0,
|
|
4656
|
-
!icon && /* @__PURE__ */ (0,
|
|
4657
|
-
/* @__PURE__ */ (0,
|
|
4658
|
-
description && /* @__PURE__ */ (0,
|
|
4659
|
-
action && /* @__PURE__ */ (0,
|
|
4635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)("div", { className: "lib-xplat-empty-state", children: [
|
|
4636
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-icon", children: icon }),
|
|
4637
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("path", { d: "M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" }) }) }),
|
|
4638
|
+
/* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "empty-title", children: title }),
|
|
4639
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "empty-description", children: description }),
|
|
4640
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "empty-action", children: action })
|
|
4660
4641
|
] });
|
|
4661
4642
|
};
|
|
4662
4643
|
EmptyState.displayName = "EmptyState";
|
|
@@ -4664,7 +4645,7 @@ var EmptyState_default = EmptyState;
|
|
|
4664
4645
|
|
|
4665
4646
|
// src/components/FileUpload/FileUpload.tsx
|
|
4666
4647
|
var import_react24 = __toESM(require("react"), 1);
|
|
4667
|
-
var
|
|
4648
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
4668
4649
|
var FileUpload = (props) => {
|
|
4669
4650
|
const {
|
|
4670
4651
|
accept,
|
|
@@ -4705,7 +4686,7 @@ var FileUpload = (props) => {
|
|
|
4705
4686
|
handleFiles(e.target.files);
|
|
4706
4687
|
}
|
|
4707
4688
|
};
|
|
4708
|
-
return /* @__PURE__ */ (0,
|
|
4689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)(
|
|
4709
4690
|
"div",
|
|
4710
4691
|
{
|
|
4711
4692
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }),
|
|
@@ -4714,7 +4695,7 @@ var FileUpload = (props) => {
|
|
|
4714
4695
|
onDragLeave: handleDragLeave,
|
|
4715
4696
|
onClick: () => inputRef.current?.click(),
|
|
4716
4697
|
children: [
|
|
4717
|
-
/* @__PURE__ */ (0,
|
|
4698
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
4718
4699
|
"input",
|
|
4719
4700
|
{
|
|
4720
4701
|
ref: inputRef,
|
|
@@ -4724,9 +4705,9 @@ var FileUpload = (props) => {
|
|
|
4724
4705
|
onChange: handleChange
|
|
4725
4706
|
}
|
|
4726
4707
|
),
|
|
4727
|
-
/* @__PURE__ */ (0,
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4729
|
-
description && /* @__PURE__ */ (0,
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(UploadIcon_default, {}) }),
|
|
4709
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)("p", { className: "upload-label", children: label }),
|
|
4710
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("p", { className: "upload-description", children: description })
|
|
4730
4711
|
]
|
|
4731
4712
|
}
|
|
4732
4713
|
);
|
|
@@ -4820,7 +4801,7 @@ var htmlToReactProgressive = (root, typedLen, rangeMap) => {
|
|
|
4820
4801
|
};
|
|
4821
4802
|
|
|
4822
4803
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
4823
|
-
var
|
|
4804
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
4824
4805
|
var HtmlTypeWriter = ({
|
|
4825
4806
|
html,
|
|
4826
4807
|
duration = 20,
|
|
@@ -4863,14 +4844,14 @@ var HtmlTypeWriter = ({
|
|
|
4863
4844
|
() => doc ? htmlToReactProgressive(doc.body, typedLen, rangeMap) : null,
|
|
4864
4845
|
[doc, typedLen, rangeMap]
|
|
4865
4846
|
);
|
|
4866
|
-
return /* @__PURE__ */ (0,
|
|
4847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
4867
4848
|
};
|
|
4868
4849
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
4869
4850
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
4870
4851
|
|
|
4871
4852
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
4872
4853
|
var import_react27 = __toESM(require("react"), 1);
|
|
4873
|
-
var
|
|
4854
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
4874
4855
|
var ImageSelector = (props) => {
|
|
4875
4856
|
const { value, label, onChange } = props;
|
|
4876
4857
|
const [previewUrl, setPreviewUrl] = import_react27.default.useState();
|
|
@@ -4896,8 +4877,8 @@ var ImageSelector = (props) => {
|
|
|
4896
4877
|
const handleOpenFileDialog = () => {
|
|
4897
4878
|
inputRef.current?.click();
|
|
4898
4879
|
};
|
|
4899
|
-
return /* @__PURE__ */ (0,
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
4881
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)(
|
|
4901
4882
|
"input",
|
|
4902
4883
|
{
|
|
4903
4884
|
type: "file",
|
|
@@ -4907,19 +4888,40 @@ var ImageSelector = (props) => {
|
|
|
4907
4888
|
ref: inputRef
|
|
4908
4889
|
}
|
|
4909
4890
|
),
|
|
4910
|
-
value && /* @__PURE__ */ (0,
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4891
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: "action-bar", children: [
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(UploadIcon_default, {}) }),
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(DeleteIcon_default, {}) })
|
|
4913
4894
|
] }),
|
|
4914
|
-
/* @__PURE__ */ (0,
|
|
4915
|
-
/* @__PURE__ */ (0,
|
|
4916
|
-
/* @__PURE__ */ (0,
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(ImageIcon_default, {}) }),
|
|
4897
|
+
/* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
4917
4898
|
] }) })
|
|
4918
4899
|
] });
|
|
4919
4900
|
};
|
|
4920
4901
|
ImageSelector.displayName = "ImageSelector";
|
|
4921
4902
|
var ImageSelector_default = ImageSelector;
|
|
4922
4903
|
|
|
4904
|
+
// src/components/NotificationBadge/NotificationBadge.tsx
|
|
4905
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
4906
|
+
var NotificationBadge = (props) => {
|
|
4907
|
+
const {
|
|
4908
|
+
children,
|
|
4909
|
+
type = "error",
|
|
4910
|
+
count,
|
|
4911
|
+
maxCount = 99,
|
|
4912
|
+
dot = false,
|
|
4913
|
+
size = "md"
|
|
4914
|
+
} = props;
|
|
4915
|
+
const showBadge = dot || count !== void 0 && count > 0;
|
|
4916
|
+
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
4917
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { className: clsx_default("lib-xplat-notification-badge", size), children: [
|
|
4918
|
+
children,
|
|
4919
|
+
showBadge && /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("span", { className: clsx_default("badge-indicator", type, { dot }), children: !dot && displayCount })
|
|
4920
|
+
] });
|
|
4921
|
+
};
|
|
4922
|
+
NotificationBadge.displayName = "NotificationBadge";
|
|
4923
|
+
var NotificationBadge_default = NotificationBadge;
|
|
4924
|
+
|
|
4923
4925
|
// src/components/Pagination/Pagination.tsx
|
|
4924
4926
|
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
4925
4927
|
var getPageRange = (current, totalPages, siblingCount) => {
|
|
@@ -5889,6 +5891,8 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
5889
5891
|
isSticky = false,
|
|
5890
5892
|
width,
|
|
5891
5893
|
nowrap = false,
|
|
5894
|
+
scope = "col",
|
|
5895
|
+
colSpan,
|
|
5892
5896
|
onClick
|
|
5893
5897
|
} = props;
|
|
5894
5898
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
@@ -5920,7 +5924,8 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
5920
5924
|
}
|
|
5921
5925
|
return () => observer.disconnect();
|
|
5922
5926
|
}, [isSticky, registerStickyCell, calculateLeft]);
|
|
5923
|
-
const
|
|
5927
|
+
const isHeaderCell = headContext !== null;
|
|
5928
|
+
const CellTag = isHeaderCell ? "th" : "td";
|
|
5924
5929
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
5925
5930
|
const enableHover = headContext && headContext.cellHover;
|
|
5926
5931
|
return /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
@@ -5935,6 +5940,8 @@ var TableCell = import_react38.default.memo((props) => {
|
|
|
5935
5940
|
enableHover && "cell-hover",
|
|
5936
5941
|
nowrap && "nowrap"
|
|
5937
5942
|
),
|
|
5943
|
+
scope: isHeaderCell ? scope : void 0,
|
|
5944
|
+
colSpan,
|
|
5938
5945
|
style: {
|
|
5939
5946
|
...isSticky ? { left } : null,
|
|
5940
5947
|
...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
|
|
@@ -6629,12 +6636,14 @@ var Video_default = Video;
|
|
|
6629
6636
|
Editor,
|
|
6630
6637
|
EmptyState,
|
|
6631
6638
|
FileUpload,
|
|
6639
|
+
HtmlTypeWriter,
|
|
6632
6640
|
HtmlTypewriter,
|
|
6633
6641
|
IconButton,
|
|
6634
6642
|
ImageSelector,
|
|
6635
6643
|
Input,
|
|
6636
6644
|
InputDatePicker,
|
|
6637
6645
|
Modal,
|
|
6646
|
+
NotificationBadge,
|
|
6638
6647
|
Pagination,
|
|
6639
6648
|
PasswordInput,
|
|
6640
6649
|
PopOver,
|