@x-plat/design-system 0.1.5 → 0.2.0
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/{colors-BG91q_uV.d.cts → colors-DmMsWD7G.d.cts} +20 -4
- package/dist/{colors-BG91q_uV.d.ts → colors-DmMsWD7G.d.ts} +20 -4
- package/dist/components/Accordion/index.cjs +25 -14
- package/dist/components/Accordion/index.css +6 -6
- package/dist/components/Accordion/index.d.cts +16 -3
- package/dist/components/Accordion/index.d.ts +16 -3
- package/dist/components/Accordion/index.js +25 -14
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.css +16 -16
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.css +3 -279
- package/dist/components/Avatar/index.d.cts +2 -118
- package/dist/components/Avatar/index.d.ts +2 -118
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.cjs +3 -2
- package/dist/components/Badge/index.css +23 -279
- package/dist/components/Badge/index.d.cts +4 -118
- package/dist/components/Badge/index.d.ts +4 -118
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Breadcrumb/index.cjs +1 -1
- package/dist/components/Breadcrumb/index.css +4 -4
- package/dist/components/Breadcrumb/index.js +1 -1
- package/dist/components/Button/index.cjs +3 -2
- package/dist/components/Button/index.css +26 -1214
- package/dist/components/Button/index.d.cts +4 -118
- package/dist/components/Button/index.d.ts +4 -118
- package/dist/components/Button/index.js +3 -2
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.css +3 -3
- package/dist/components/Card/index.js +1 -1
- package/dist/components/CardTab/index.cjs +124 -0
- package/dist/components/CardTab/index.css +78 -0
- package/dist/components/CardTab/index.d.cts +44 -0
- package/dist/components/CardTab/index.d.ts +44 -0
- package/dist/components/CardTab/index.js +87 -0
- package/dist/components/CheckBox/index.cjs +3 -2
- package/dist/components/CheckBox/index.css +27 -563
- package/dist/components/CheckBox/index.d.cts +5 -119
- package/dist/components/CheckBox/index.d.ts +5 -119
- package/dist/components/CheckBox/index.js +3 -2
- package/dist/components/Chip/index.cjs +3 -2
- package/dist/components/Chip/index.css +21 -1209
- package/dist/components/Chip/index.d.cts +4 -118
- package/dist/components/Chip/index.d.ts +4 -118
- package/dist/components/Chip/index.js +3 -2
- package/dist/components/DatePicker/index.cjs +5 -3
- package/dist/components/DatePicker/index.css +62 -1239
- package/dist/components/DatePicker/index.d.cts +3 -235
- package/dist/components/DatePicker/index.d.ts +3 -235
- package/dist/components/DatePicker/index.js +5 -3
- package/dist/components/Divider/index.cjs +1 -1
- package/dist/components/Divider/index.css +2 -2
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.css +5 -5
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Dropdown/index.cjs +1 -1
- package/dist/components/Dropdown/index.css +7 -7
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/EmptyState/index.cjs +1 -1
- package/dist/components/EmptyState/index.css +3 -3
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/FileUpload/index.cjs +1 -1
- package/dist/components/FileUpload/index.css +8 -8
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/HtmlTypeWriter/index.css +1 -1
- package/dist/components/ImageSelector/index.css +9 -9
- package/dist/components/Input/index.cjs +3 -2
- package/dist/components/Input/index.css +21 -10
- package/dist/components/Input/index.d.cts +6 -2
- package/dist/components/Input/index.d.ts +6 -2
- package/dist/components/Input/index.js +3 -2
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Pagination/index.cjs +3 -2
- package/dist/components/Pagination/index.css +33 -283
- package/dist/components/Pagination/index.d.cts +4 -118
- package/dist/components/Pagination/index.d.ts +4 -118
- package/dist/components/Pagination/index.js +3 -2
- package/dist/components/PopOver/index.cjs +1 -1
- package/dist/components/PopOver/index.js +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.css +3 -281
- package/dist/components/Progress/index.d.cts +2 -118
- package/dist/components/Progress/index.d.ts +2 -118
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Radio/index.cjs +4 -1
- package/dist/components/Radio/index.css +36 -747
- package/dist/components/Radio/index.d.cts +6 -119
- package/dist/components/Radio/index.d.ts +6 -119
- package/dist/components/Radio/index.js +4 -1
- package/dist/components/Select/index.cjs +4 -2
- package/dist/components/Select/index.css +38 -18
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +4 -2
- package/dist/components/Skeleton/index.cjs +1 -1
- package/dist/components/Skeleton/index.css +1 -1
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Spinner/index.cjs +1 -1
- package/dist/components/Spinner/index.css +2 -280
- package/dist/components/Spinner/index.d.cts +2 -118
- package/dist/components/Spinner/index.d.ts +2 -118
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/Steps/index.cjs +1 -1
- package/dist/components/Steps/index.css +14 -846
- package/dist/components/Steps/index.d.cts +2 -118
- package/dist/components/Steps/index.d.ts +2 -118
- package/dist/components/Steps/index.js +1 -1
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.css +9 -745
- package/dist/components/Switch/index.d.cts +2 -118
- package/dist/components/Switch/index.d.ts +2 -118
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tab/index.cjs +3 -3
- package/dist/components/Tab/index.css +20 -9
- package/dist/components/Tab/index.d.cts +2 -0
- package/dist/components/Tab/index.d.ts +2 -0
- package/dist/components/Tab/index.js +3 -3
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.css +47 -4003
- package/dist/components/Table/index.d.cts +2 -118
- package/dist/components/Table/index.d.ts +2 -118
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tag/index.cjs +3 -2
- package/dist/components/Tag/index.css +27 -467
- package/dist/components/Tag/index.d.cts +4 -118
- package/dist/components/Tag/index.d.ts +4 -118
- package/dist/components/Tag/index.js +3 -2
- package/dist/components/TextArea/index.cjs +1 -1
- package/dist/components/TextArea/index.css +4 -4
- package/dist/components/TextArea/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.css +8 -8
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.css +4 -560
- package/dist/components/Tooltip/index.d.cts +2 -118
- package/dist/components/Tooltip/index.d.ts +2 -118
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Video/index.cjs +1 -1
- package/dist/components/Video/index.css +3 -3
- package/dist/components/Video/index.js +1 -1
- package/dist/components/index.cjs +441 -347
- package/dist/components/index.css +1278 -12638
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +439 -346
- package/dist/index.cjs +466 -371
- package/dist/index.css +1281 -12641
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +466 -370
- package/dist/layout/Grid/FullGrid/index.cjs +1 -1
- package/dist/layout/Grid/FullGrid/index.js +1 -1
- package/dist/layout/Grid/FullScreen/index.cjs +1 -1
- package/dist/layout/Grid/FullScreen/index.js +1 -1
- package/dist/layout/Grid/Item/index.cjs +1 -1
- package/dist/layout/Grid/Item/index.js +1 -1
- package/dist/layout/Grid/index.cjs +1 -1
- package/dist/layout/Grid/index.js +1 -1
- package/dist/layout/Header/index.css +2 -2
- package/dist/layout/Layout/index.css +1 -1
- package/dist/layout/SideBar/index.cjs +1 -1
- package/dist/layout/SideBar/index.js +1 -1
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.css +3 -3
- package/dist/layout/index.js +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +12 -12
- package/README.md +0 -123
|
@@ -37,6 +37,7 @@ __export(components_exports, {
|
|
|
37
37
|
Breadcrumb: () => Breadcrumb_default,
|
|
38
38
|
Button: () => Button_default,
|
|
39
39
|
Card: () => Card_default,
|
|
40
|
+
CardTab: () => CardTab_default,
|
|
40
41
|
Chart: () => Chart_default,
|
|
41
42
|
CheckBox: () => CheckBox_default,
|
|
42
43
|
Chip: () => Chip_default,
|
|
@@ -1333,7 +1334,7 @@ var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(
|
|
|
1333
1334
|
);
|
|
1334
1335
|
var SuccessIcon_default = SuccessIcon;
|
|
1335
1336
|
|
|
1336
|
-
// node_modules/clsx/dist/clsx.mjs
|
|
1337
|
+
// ../../node_modules/clsx/dist/clsx.mjs
|
|
1337
1338
|
function r(e) {
|
|
1338
1339
|
var t, f, n = "";
|
|
1339
1340
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -1384,26 +1385,37 @@ var AccordionItem = ({ item, isOpen, onToggle }) => {
|
|
|
1384
1385
|
] });
|
|
1385
1386
|
};
|
|
1386
1387
|
var Accordion = (props) => {
|
|
1387
|
-
const { items,
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1388
|
+
const { items, className } = props;
|
|
1389
|
+
const isMultiple = props.multiple === true;
|
|
1390
|
+
const controlledKeys = isMultiple ? props.activeKeys : props.activeKey !== void 0 ? props.activeKey !== null ? [props.activeKey] : [] : void 0;
|
|
1391
|
+
const defaultKeys = isMultiple ? props.defaultActiveKeys ?? [] : props.defaultActiveKey ? [props.defaultActiveKey] : [];
|
|
1392
|
+
const isControlled = controlledKeys !== void 0;
|
|
1393
|
+
const [uncontrolledKeys, setUncontrolledKeys] = import_react.default.useState(
|
|
1394
|
+
new Set(defaultKeys)
|
|
1390
1395
|
);
|
|
1396
|
+
const currentKeys = isControlled ? new Set(controlledKeys) : uncontrolledKeys;
|
|
1391
1397
|
const toggle = (key) => {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1398
|
+
const next = new Set(isMultiple ? currentKeys : []);
|
|
1399
|
+
if (currentKeys.has(key)) {
|
|
1400
|
+
next.delete(key);
|
|
1401
|
+
} else {
|
|
1402
|
+
next.add(key);
|
|
1403
|
+
}
|
|
1404
|
+
if (!isControlled) {
|
|
1405
|
+
setUncontrolledKeys(next);
|
|
1406
|
+
}
|
|
1407
|
+
if (isMultiple) {
|
|
1408
|
+
props.onChange?.([...next]);
|
|
1409
|
+
} else {
|
|
1410
|
+
const first = [...next][0] ?? null;
|
|
1411
|
+
props.onChange?.(first);
|
|
1412
|
+
}
|
|
1401
1413
|
};
|
|
1402
1414
|
return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: clsx_default("lib-xplat-accordion", className), children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
|
|
1403
1415
|
AccordionItem,
|
|
1404
1416
|
{
|
|
1405
1417
|
item,
|
|
1406
|
-
isOpen:
|
|
1418
|
+
isOpen: currentKeys.has(item.key),
|
|
1407
1419
|
onToggle: () => toggle(item.key)
|
|
1408
1420
|
},
|
|
1409
1421
|
item.key
|
|
@@ -1598,6 +1610,7 @@ var Badge = (props) => {
|
|
|
1598
1610
|
count,
|
|
1599
1611
|
maxCount = 99,
|
|
1600
1612
|
dot = false,
|
|
1613
|
+
size = "md",
|
|
1601
1614
|
colorNamespace = "xplat",
|
|
1602
1615
|
color = "red",
|
|
1603
1616
|
colorDepth,
|
|
@@ -1610,7 +1623,7 @@ var Badge = (props) => {
|
|
|
1610
1623
|
);
|
|
1611
1624
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
1612
1625
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
1613
|
-
return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)("div", { className: clsx_default("lib-xplat-badge", className), children: [
|
|
1626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)("div", { className: clsx_default("lib-xplat-badge", size, className), children: [
|
|
1614
1627
|
children,
|
|
1615
1628
|
showBadge && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("span", { className: clsx_default("badge-indicator", colorClass, { dot }), children: !dot && displayCount })
|
|
1616
1629
|
] });
|
|
@@ -1639,6 +1652,7 @@ var Button = (props) => {
|
|
|
1639
1652
|
const {
|
|
1640
1653
|
children,
|
|
1641
1654
|
type = "primary",
|
|
1655
|
+
size = "md",
|
|
1642
1656
|
colorNamespace = "xplat",
|
|
1643
1657
|
color = "black",
|
|
1644
1658
|
colorDepth,
|
|
@@ -1654,7 +1668,7 @@ var Button = (props) => {
|
|
|
1654
1668
|
return /* @__PURE__ */ (0, import_jsx_runtime300.jsx)(
|
|
1655
1669
|
"button",
|
|
1656
1670
|
{
|
|
1657
|
-
className: clsx_default("lib-xplat-button", type, colorClass, className),
|
|
1671
|
+
className: clsx_default("lib-xplat-button", type, size, colorClass, className),
|
|
1658
1672
|
disabled,
|
|
1659
1673
|
...rest,
|
|
1660
1674
|
children
|
|
@@ -1675,8 +1689,77 @@ var Card = ({ children, title, className }) => {
|
|
|
1675
1689
|
Card.displayName = "Card";
|
|
1676
1690
|
var Card_default = Card;
|
|
1677
1691
|
|
|
1678
|
-
// src/components/
|
|
1692
|
+
// src/components/CardTab/CardTab.tsx
|
|
1679
1693
|
var import_react2 = __toESM(require("react"), 1);
|
|
1694
|
+
|
|
1695
|
+
// src/components/CardTab/CardTabPanel.tsx
|
|
1696
|
+
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
1697
|
+
var CardTabPanel = (props) => {
|
|
1698
|
+
const { children, columns = 3, className } = props;
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
1700
|
+
"div",
|
|
1701
|
+
{
|
|
1702
|
+
className: clsx_default("card-tab-panel", className),
|
|
1703
|
+
style: { "--card-tab-columns": columns },
|
|
1704
|
+
children
|
|
1705
|
+
}
|
|
1706
|
+
);
|
|
1707
|
+
};
|
|
1708
|
+
CardTabPanel.displayName = "CardTab.Panel";
|
|
1709
|
+
var CardTabPanel_default = CardTabPanel;
|
|
1710
|
+
|
|
1711
|
+
// src/components/CardTab/CardTab.tsx
|
|
1712
|
+
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
1713
|
+
var CardTabRoot = (props) => {
|
|
1714
|
+
const {
|
|
1715
|
+
tabs,
|
|
1716
|
+
activeValue: activeValueProp,
|
|
1717
|
+
onChange,
|
|
1718
|
+
size = "md",
|
|
1719
|
+
children,
|
|
1720
|
+
className
|
|
1721
|
+
} = props;
|
|
1722
|
+
const isControlled = activeValueProp !== void 0;
|
|
1723
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react2.default.useState(tabs[0]?.value ?? "");
|
|
1724
|
+
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
1725
|
+
const handleTabClick = (tab) => {
|
|
1726
|
+
if (!isControlled) {
|
|
1727
|
+
setUncontrolledValue(tab.value);
|
|
1728
|
+
}
|
|
1729
|
+
onChange?.(tab);
|
|
1730
|
+
};
|
|
1731
|
+
const panels = import_react2.default.Children.toArray(children).filter(
|
|
1732
|
+
(child) => import_react2.default.isValidElement(child) && child.type === CardTabPanel_default
|
|
1733
|
+
);
|
|
1734
|
+
const activePanel = panels.find(
|
|
1735
|
+
(panel) => panel.props.value === activeValue
|
|
1736
|
+
);
|
|
1737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)("div", { className: clsx_default("lib-xplat-card-tab", size, className), children: [
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
1739
|
+
const isActive = tab.value === activeValue;
|
|
1740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(
|
|
1741
|
+
"button",
|
|
1742
|
+
{
|
|
1743
|
+
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
1744
|
+
onClick: () => handleTabClick(tab),
|
|
1745
|
+
role: "tab",
|
|
1746
|
+
"aria-selected": isActive,
|
|
1747
|
+
children: tab.title
|
|
1748
|
+
},
|
|
1749
|
+
tab.value
|
|
1750
|
+
);
|
|
1751
|
+
}) }),
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "card-tab-body", children: activePanel })
|
|
1753
|
+
] });
|
|
1754
|
+
};
|
|
1755
|
+
CardTabRoot.displayName = "CardTab";
|
|
1756
|
+
var CardTab = Object.assign(CardTabRoot, {
|
|
1757
|
+
Panel: CardTabPanel_default
|
|
1758
|
+
});
|
|
1759
|
+
var CardTab_default = CardTab;
|
|
1760
|
+
|
|
1761
|
+
// src/components/Chart/Chart.tsx
|
|
1762
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
1680
1763
|
var import_chart = require("chart.js");
|
|
1681
1764
|
var import_chartjs_plugin_datalabels = __toESM(require("chartjs-plugin-datalabels"), 1);
|
|
1682
1765
|
var import_react_chartjs_2 = require("react-chartjs-2");
|
|
@@ -1808,7 +1891,7 @@ var getIndexColorByPreset = (preset, index) => {
|
|
|
1808
1891
|
};
|
|
1809
1892
|
|
|
1810
1893
|
// src/components/Chart/Chart.tsx
|
|
1811
|
-
var
|
|
1894
|
+
var import_jsx_runtime304 = require("react/jsx-runtime");
|
|
1812
1895
|
import_chart.Chart.register(
|
|
1813
1896
|
import_chart.CategoryScale,
|
|
1814
1897
|
import_chart.LinearScale,
|
|
@@ -1823,12 +1906,12 @@ import_chart.Chart.register(
|
|
|
1823
1906
|
);
|
|
1824
1907
|
var Chart = (props) => {
|
|
1825
1908
|
const { type, data, labels } = props;
|
|
1826
|
-
const chartInstanceRef =
|
|
1827
|
-
const containerRef =
|
|
1828
|
-
const chartRef =
|
|
1909
|
+
const chartInstanceRef = import_react3.default.useRef(null);
|
|
1910
|
+
const containerRef = import_react3.default.useRef(null);
|
|
1911
|
+
const chartRef = import_react3.default.useCallback((instance) => {
|
|
1829
1912
|
chartInstanceRef.current = instance ?? null;
|
|
1830
1913
|
}, []);
|
|
1831
|
-
const datasets =
|
|
1914
|
+
const datasets = import_react3.default.useMemo(() => {
|
|
1832
1915
|
const pallette = getChartColorPreset(type);
|
|
1833
1916
|
return Object.entries(data).map(([key, values], index) => {
|
|
1834
1917
|
const uniqueColors = getIndexColorByPreset(pallette, index);
|
|
@@ -1882,21 +1965,21 @@ var Chart = (props) => {
|
|
|
1882
1965
|
formatter: (value) => `${value}`
|
|
1883
1966
|
};
|
|
1884
1967
|
}
|
|
1885
|
-
const renderChart =
|
|
1968
|
+
const renderChart = import_react3.default.useMemo(() => {
|
|
1886
1969
|
switch (type) {
|
|
1887
1970
|
case "line":
|
|
1888
|
-
return /* @__PURE__ */ (0,
|
|
1971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_react_chartjs_2.Line, { ref: chartRef, data: chartData, options });
|
|
1889
1972
|
case "bar":
|
|
1890
|
-
return /* @__PURE__ */ (0,
|
|
1973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_react_chartjs_2.Bar, { ref: chartRef, data: chartData, options });
|
|
1891
1974
|
case "pie":
|
|
1892
|
-
return /* @__PURE__ */ (0,
|
|
1975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_react_chartjs_2.Pie, { ref: chartRef, data: chartData, options });
|
|
1893
1976
|
case "doughnut":
|
|
1894
|
-
return /* @__PURE__ */ (0,
|
|
1977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_react_chartjs_2.Doughnut, { ref: chartRef, data: chartData, options });
|
|
1895
1978
|
default:
|
|
1896
1979
|
return null;
|
|
1897
1980
|
}
|
|
1898
1981
|
}, [chartData, options, type]);
|
|
1899
|
-
|
|
1982
|
+
import_react3.default.useEffect(() => {
|
|
1900
1983
|
if (!containerRef.current || !chartInstanceRef.current) return;
|
|
1901
1984
|
const observer = new ResizeObserver(() => {
|
|
1902
1985
|
requestAnimationFrame(() => {
|
|
@@ -1906,13 +1989,13 @@ var Chart = (props) => {
|
|
|
1906
1989
|
observer.observe(containerRef.current);
|
|
1907
1990
|
return () => observer.disconnect();
|
|
1908
1991
|
}, []);
|
|
1909
|
-
return /* @__PURE__ */ (0,
|
|
1992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)("div", { className: "lib-xplat-chart", ref: containerRef, children: renderChart });
|
|
1910
1993
|
};
|
|
1911
1994
|
Chart.displayName = "Chart";
|
|
1912
1995
|
var Chart_default = Chart;
|
|
1913
1996
|
|
|
1914
1997
|
// src/components/CheckBox/CheckBox.tsx
|
|
1915
|
-
var
|
|
1998
|
+
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
1916
1999
|
var CheckBox = (props) => {
|
|
1917
2000
|
const {
|
|
1918
2001
|
colorNamespace = "xplat",
|
|
@@ -1923,6 +2006,7 @@ var CheckBox = (props) => {
|
|
|
1923
2006
|
onChange,
|
|
1924
2007
|
className,
|
|
1925
2008
|
disabled,
|
|
2009
|
+
size = "md",
|
|
1926
2010
|
...rest
|
|
1927
2011
|
} = props;
|
|
1928
2012
|
const handleChange = (e) => {
|
|
@@ -1937,8 +2021,8 @@ var CheckBox = (props) => {
|
|
|
1937
2021
|
const checkedClasses = `checked ${mainColor}`;
|
|
1938
2022
|
const disabledClasses = "disabled";
|
|
1939
2023
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
1940
|
-
return /* @__PURE__ */ (0,
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
2024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, className), children: [
|
|
2025
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
1942
2026
|
"input",
|
|
1943
2027
|
{
|
|
1944
2028
|
type: "checkbox",
|
|
@@ -1948,15 +2032,15 @@ var CheckBox = (props) => {
|
|
|
1948
2032
|
...rest
|
|
1949
2033
|
}
|
|
1950
2034
|
),
|
|
1951
|
-
/* @__PURE__ */ (0,
|
|
1952
|
-
label && /* @__PURE__ */ (0,
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(CheckIcon_default, {}) }) }),
|
|
2036
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("span", { className: "label", children: label })
|
|
1953
2037
|
] });
|
|
1954
2038
|
};
|
|
1955
2039
|
CheckBox.displayName = "CheckBox";
|
|
1956
2040
|
var CheckBox_default = CheckBox;
|
|
1957
2041
|
|
|
1958
2042
|
// src/components/Chip/Chip.tsx
|
|
1959
|
-
var
|
|
2043
|
+
var import_jsx_runtime306 = require("react/jsx-runtime");
|
|
1960
2044
|
var Chip = (props) => {
|
|
1961
2045
|
const {
|
|
1962
2046
|
children,
|
|
@@ -1964,6 +2048,7 @@ var Chip = (props) => {
|
|
|
1964
2048
|
color = "black",
|
|
1965
2049
|
colorDepth,
|
|
1966
2050
|
type = "primary",
|
|
2051
|
+
size = "md",
|
|
1967
2052
|
className
|
|
1968
2053
|
} = props;
|
|
1969
2054
|
const colorClass = getColorClass(
|
|
@@ -1971,29 +2056,29 @@ var Chip = (props) => {
|
|
|
1971
2056
|
color,
|
|
1972
2057
|
colorDepth ?? 500
|
|
1973
2058
|
);
|
|
1974
|
-
return /* @__PURE__ */ (0,
|
|
2059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime306.jsx)("div", { className: clsx_default("lib-xplat-chip", type, size, colorClass, className), children });
|
|
1975
2060
|
};
|
|
1976
2061
|
Chip.displayName = "Chip";
|
|
1977
2062
|
var Chip_default = Chip;
|
|
1978
2063
|
|
|
1979
2064
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
1980
|
-
var
|
|
2065
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
1981
2066
|
|
|
1982
2067
|
// src/components/Input/Input.tsx
|
|
1983
|
-
var
|
|
2068
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
1984
2069
|
|
|
1985
2070
|
// src/components/Input/InputValidations.tsx
|
|
1986
|
-
var
|
|
2071
|
+
var import_jsx_runtime307 = require("react/jsx-runtime");
|
|
1987
2072
|
var InputValidations = (props) => {
|
|
1988
2073
|
const { message, status = "default" } = props;
|
|
1989
|
-
return /* @__PURE__ */ (0,
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
status === "default" && /* @__PURE__ */ (0,
|
|
1992
|
-
status === "success" && /* @__PURE__ */ (0,
|
|
1993
|
-
status === "warning" && /* @__PURE__ */ (0,
|
|
1994
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
2074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("div", { className: "icon", children: [
|
|
2076
|
+
status === "default" && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(InfoIcon_default, {}),
|
|
2077
|
+
status === "success" && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(SuccessIcon_default, {}),
|
|
2078
|
+
status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(InfoIcon_default, {}),
|
|
2079
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(ErrorIcon_default, {})
|
|
1995
2080
|
] }),
|
|
1996
|
-
/* @__PURE__ */ (0,
|
|
2081
|
+
/* @__PURE__ */ (0, import_jsx_runtime307.jsx)("div", { className: "message", children: message })
|
|
1997
2082
|
] });
|
|
1998
2083
|
};
|
|
1999
2084
|
InputValidations.displayName = "InputValidations";
|
|
@@ -2034,8 +2119,8 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
2034
2119
|
};
|
|
2035
2120
|
|
|
2036
2121
|
// src/components/Input/Input.tsx
|
|
2037
|
-
var
|
|
2038
|
-
var
|
|
2122
|
+
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
2123
|
+
var import_react5 = require("react");
|
|
2039
2124
|
var formatValue = (type, value) => {
|
|
2040
2125
|
if (value === null || value === void 0) return "";
|
|
2041
2126
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -2083,11 +2168,12 @@ var parseValue = (type, value) => {
|
|
|
2083
2168
|
return value;
|
|
2084
2169
|
}
|
|
2085
2170
|
};
|
|
2086
|
-
var Input =
|
|
2171
|
+
var Input = import_react4.default.forwardRef((props, ref) => {
|
|
2087
2172
|
const {
|
|
2088
2173
|
value,
|
|
2089
2174
|
onChange,
|
|
2090
2175
|
type = "text",
|
|
2176
|
+
size = "md",
|
|
2091
2177
|
suffix,
|
|
2092
2178
|
className,
|
|
2093
2179
|
disabled,
|
|
@@ -2109,13 +2195,13 @@ var Input = import_react3.default.forwardRef((props, ref) => {
|
|
|
2109
2195
|
onChange(event);
|
|
2110
2196
|
}
|
|
2111
2197
|
};
|
|
2112
|
-
return /* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)("div", { className: clsx_default("lib-xplat-input-wrap", className), children: [
|
|
2199
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(
|
|
2114
2200
|
"div",
|
|
2115
2201
|
{
|
|
2116
|
-
className: clsx_default("lib-xplat-input", disabled ? "disabled" : void 0),
|
|
2202
|
+
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
2117
2203
|
children: [
|
|
2118
|
-
/* @__PURE__ */ (0,
|
|
2204
|
+
/* @__PURE__ */ (0, import_jsx_runtime308.jsx)(
|
|
2119
2205
|
"input",
|
|
2120
2206
|
{
|
|
2121
2207
|
...inputProps,
|
|
@@ -2126,11 +2212,11 @@ var Input = import_react3.default.forwardRef((props, ref) => {
|
|
|
2126
2212
|
onChange: handleChange
|
|
2127
2213
|
}
|
|
2128
2214
|
),
|
|
2129
|
-
suffix && /* @__PURE__ */ (0,
|
|
2215
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { className: "suffix", children: suffix })
|
|
2130
2216
|
]
|
|
2131
2217
|
}
|
|
2132
2218
|
),
|
|
2133
|
-
validations && /* @__PURE__ */ (0,
|
|
2219
|
+
validations && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react5.createElement)(
|
|
2134
2220
|
InputValidations_default,
|
|
2135
2221
|
{
|
|
2136
2222
|
...validation,
|
|
@@ -2143,20 +2229,20 @@ Input.displayName = "Input";
|
|
|
2143
2229
|
var Input_default = Input;
|
|
2144
2230
|
|
|
2145
2231
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
2146
|
-
var
|
|
2147
|
-
var
|
|
2148
|
-
var PasswordInput =
|
|
2232
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
2233
|
+
var import_jsx_runtime309 = require("react/jsx-runtime");
|
|
2234
|
+
var PasswordInput = import_react6.default.forwardRef(
|
|
2149
2235
|
(props, ref) => {
|
|
2150
2236
|
const { reg: _reg, ...inputProps } = props;
|
|
2151
|
-
const [isView, setIsView] =
|
|
2237
|
+
const [isView, setIsView] = import_react6.default.useState(false);
|
|
2152
2238
|
const handleChangeView = () => {
|
|
2153
2239
|
setIsView((prev) => !prev);
|
|
2154
2240
|
};
|
|
2155
|
-
return /* @__PURE__ */ (0,
|
|
2241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(
|
|
2156
2242
|
Input_default,
|
|
2157
2243
|
{
|
|
2158
2244
|
...inputProps,
|
|
2159
|
-
suffix: /* @__PURE__ */ (0,
|
|
2245
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(OpenEyeIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(CloseEyeIcon_default, {}) }),
|
|
2160
2246
|
type: isView ? "text" : "password",
|
|
2161
2247
|
ref
|
|
2162
2248
|
}
|
|
@@ -2169,8 +2255,8 @@ var PasswordInput_default = PasswordInput;
|
|
|
2169
2255
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2170
2256
|
var import_react_datepicker = __toESM(require("react-datepicker"), 1);
|
|
2171
2257
|
var import_react_datepicker2 = require("react-datepicker/dist/react-datepicker.css");
|
|
2172
|
-
var
|
|
2173
|
-
var Suffix = () => /* @__PURE__ */ (0,
|
|
2258
|
+
var import_jsx_runtime310 = require("react/jsx-runtime");
|
|
2259
|
+
var Suffix = () => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(CalenderIcon_default, {}) });
|
|
2174
2260
|
var InputDatePicker = (props) => {
|
|
2175
2261
|
const { value, onChange, disabled, ...rest } = props;
|
|
2176
2262
|
const handleChange = (date) => {
|
|
@@ -2184,22 +2270,22 @@ var InputDatePicker = (props) => {
|
|
|
2184
2270
|
const d = String(date.getDate()).padStart(2, "0");
|
|
2185
2271
|
return `${y}/${m}/${d}`;
|
|
2186
2272
|
};
|
|
2187
|
-
const CustomInput =
|
|
2273
|
+
const CustomInput = import_react7.default.forwardRef(({ onClick }, _ref) => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { onClick, children: /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
2188
2274
|
Input_default,
|
|
2189
2275
|
{
|
|
2190
2276
|
value: formatDate(value),
|
|
2191
|
-
suffix: /* @__PURE__ */ (0,
|
|
2277
|
+
suffix: /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(Suffix, {}),
|
|
2192
2278
|
disabled
|
|
2193
2279
|
}
|
|
2194
2280
|
) }));
|
|
2195
2281
|
CustomInput.displayName = "InputDatePickerCustomInput";
|
|
2196
|
-
return /* @__PURE__ */ (0,
|
|
2282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)("div", { className: "lib-xplat-datepicker", children: /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
2197
2283
|
import_react_datepicker.default,
|
|
2198
2284
|
{
|
|
2199
2285
|
selected: value,
|
|
2200
2286
|
onChange: handleChange,
|
|
2201
2287
|
...rest,
|
|
2202
|
-
customInput: /* @__PURE__ */ (0,
|
|
2288
|
+
customInput: /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(CustomInput, {}),
|
|
2203
2289
|
dateFormat: "YYYY/MM/dd"
|
|
2204
2290
|
}
|
|
2205
2291
|
) });
|
|
@@ -2208,18 +2294,18 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
2208
2294
|
var InputDatePicker_default = InputDatePicker;
|
|
2209
2295
|
|
|
2210
2296
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2211
|
-
var
|
|
2297
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
2212
2298
|
|
|
2213
2299
|
// src/components/Modal/Modal.tsx
|
|
2214
|
-
var
|
|
2300
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
2215
2301
|
var import_react_dom = require("react-dom");
|
|
2216
|
-
var
|
|
2302
|
+
var import_jsx_runtime311 = require("react/jsx-runtime");
|
|
2217
2303
|
var ANIMATION_DURATION_MS = 200;
|
|
2218
2304
|
var Modal = (props) => {
|
|
2219
2305
|
const { isOpen, onClose, children } = props;
|
|
2220
|
-
const [mounted, setMounted] =
|
|
2221
|
-
const [visible, setVisible] =
|
|
2222
|
-
|
|
2306
|
+
const [mounted, setMounted] = import_react8.default.useState(false);
|
|
2307
|
+
const [visible, setVisible] = import_react8.default.useState(false);
|
|
2308
|
+
import_react8.default.useEffect(() => {
|
|
2223
2309
|
if (isOpen) {
|
|
2224
2310
|
setMounted(true);
|
|
2225
2311
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2233,12 +2319,12 @@ var Modal = (props) => {
|
|
|
2233
2319
|
if (!mounted) return null;
|
|
2234
2320
|
const stateClass = visible ? "enter" : "exit";
|
|
2235
2321
|
return (0, import_react_dom.createPortal)(
|
|
2236
|
-
/* @__PURE__ */ (0,
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
2237
2323
|
"div",
|
|
2238
2324
|
{
|
|
2239
2325
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
2240
2326
|
onClick: onClose,
|
|
2241
|
-
children: /* @__PURE__ */ (0,
|
|
2327
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(
|
|
2242
2328
|
"div",
|
|
2243
2329
|
{
|
|
2244
2330
|
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
@@ -2259,7 +2345,7 @@ var Modal_default = Modal;
|
|
|
2259
2345
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
2260
2346
|
var import_react_datepicker3 = __toESM(require("react-datepicker"), 1);
|
|
2261
2347
|
var import_react_datepicker4 = require("react-datepicker/dist/react-datepicker.css");
|
|
2262
|
-
var
|
|
2348
|
+
var import_jsx_runtime312 = require("react/jsx-runtime");
|
|
2263
2349
|
function getColorValue(ns, color, depth) {
|
|
2264
2350
|
const nsColors = colors[ns];
|
|
2265
2351
|
const colorEntry = nsColors[color];
|
|
@@ -2285,12 +2371,12 @@ var SingleDatePicker = (props) => {
|
|
|
2285
2371
|
color,
|
|
2286
2372
|
colorDepth ?? 500
|
|
2287
2373
|
);
|
|
2288
|
-
return /* @__PURE__ */ (0,
|
|
2374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
2289
2375
|
"div",
|
|
2290
2376
|
{
|
|
2291
2377
|
className: "lib-xplat-datepicker",
|
|
2292
2378
|
style: { "--datepicker-active-color": activeColor },
|
|
2293
|
-
children: /* @__PURE__ */ (0,
|
|
2379
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime312.jsx)(
|
|
2294
2380
|
import_react_datepicker3.default,
|
|
2295
2381
|
{
|
|
2296
2382
|
selected: value,
|
|
@@ -2307,10 +2393,10 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
2307
2393
|
var SingleDatePicker_default = SingleDatePicker;
|
|
2308
2394
|
|
|
2309
2395
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2310
|
-
var
|
|
2396
|
+
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
2311
2397
|
var PopupPicker = (props) => {
|
|
2312
2398
|
const { component, type } = props;
|
|
2313
|
-
const [isOpen, setIsOpen] =
|
|
2399
|
+
const [isOpen, setIsOpen] = import_react9.default.useState(false);
|
|
2314
2400
|
const handleClick = () => setIsOpen(true);
|
|
2315
2401
|
const handleClose = () => setIsOpen(false);
|
|
2316
2402
|
const handleSingleChange = (date) => {
|
|
@@ -2318,11 +2404,11 @@ var PopupPicker = (props) => {
|
|
|
2318
2404
|
props.onChange?.(date);
|
|
2319
2405
|
handleClose();
|
|
2320
2406
|
};
|
|
2321
|
-
return /* @__PURE__ */ (0,
|
|
2322
|
-
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2325
|
-
type === "single" && /* @__PURE__ */ (0,
|
|
2407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
2408
|
+
import_react9.default.cloneElement(component, { onClick: handleClick }),
|
|
2409
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
2411
|
+
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
2326
2412
|
SingleDatePicker_default,
|
|
2327
2413
|
{
|
|
2328
2414
|
value: props.value,
|
|
@@ -2331,7 +2417,7 @@ var PopupPicker = (props) => {
|
|
|
2331
2417
|
maxDate: props.maxDate
|
|
2332
2418
|
}
|
|
2333
2419
|
),
|
|
2334
|
-
type === "range" && /* @__PURE__ */ (0,
|
|
2420
|
+
type === "range" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
2335
2421
|
RangePicker_default,
|
|
2336
2422
|
{
|
|
2337
2423
|
startDate: props.startDate,
|
|
@@ -2342,8 +2428,8 @@ var PopupPicker = (props) => {
|
|
|
2342
2428
|
}
|
|
2343
2429
|
)
|
|
2344
2430
|
] }),
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2346
|
-
/* @__PURE__ */ (0,
|
|
2431
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsxs)("div", { className: "popup-datepicker-footer", children: [
|
|
2432
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
2347
2433
|
Button_default,
|
|
2348
2434
|
{
|
|
2349
2435
|
type: "secondary",
|
|
@@ -2353,7 +2439,7 @@ var PopupPicker = (props) => {
|
|
|
2353
2439
|
children: "\uCDE8\uC18C"
|
|
2354
2440
|
}
|
|
2355
2441
|
),
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2442
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Button_default, { type: "primary", color: "blue", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
2357
2443
|
] })
|
|
2358
2444
|
] }) })
|
|
2359
2445
|
] });
|
|
@@ -2362,8 +2448,8 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
2362
2448
|
var PopupPicker_default = PopupPicker;
|
|
2363
2449
|
|
|
2364
2450
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
2365
|
-
var
|
|
2366
|
-
var
|
|
2451
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
2452
|
+
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
2367
2453
|
function getDatesBetween(start, end) {
|
|
2368
2454
|
const dates = [];
|
|
2369
2455
|
const current = new Date(start);
|
|
@@ -2387,7 +2473,7 @@ var RangePicker = (props) => {
|
|
|
2387
2473
|
color,
|
|
2388
2474
|
colorDepth
|
|
2389
2475
|
} = props;
|
|
2390
|
-
const rangeDates =
|
|
2476
|
+
const rangeDates = import_react10.default.useMemo(
|
|
2391
2477
|
() => getDatesBetween(startDate, endDate),
|
|
2392
2478
|
[startDate, endDate]
|
|
2393
2479
|
);
|
|
@@ -2396,10 +2482,10 @@ var RangePicker = (props) => {
|
|
|
2396
2482
|
...color !== void 0 && { color },
|
|
2397
2483
|
...colorDepth !== void 0 && { colorDepth }
|
|
2398
2484
|
};
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2402
|
-
/* @__PURE__ */ (0,
|
|
2485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "lib-xplat-range-datepicker", children: [
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "lib-xplat-range-datepicker-from", children: [
|
|
2487
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "lib-xplat-range-datepicker-label", children: "\uC2DC\uC791" }),
|
|
2488
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
2403
2489
|
SingleDatePicker_default,
|
|
2404
2490
|
{
|
|
2405
2491
|
value: startDate,
|
|
@@ -2411,9 +2497,9 @@ var RangePicker = (props) => {
|
|
|
2411
2497
|
}
|
|
2412
2498
|
)
|
|
2413
2499
|
] }),
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2415
|
-
/* @__PURE__ */ (0,
|
|
2416
|
-
/* @__PURE__ */ (0,
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "lib-xplat-range-datepicker-to", children: [
|
|
2501
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "lib-xplat-range-datepicker-label", children: "\uC885\uB8CC" }),
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
2417
2503
|
SingleDatePicker_default,
|
|
2418
2504
|
{
|
|
2419
2505
|
value: endDate,
|
|
@@ -2431,10 +2517,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
2431
2517
|
var RangePicker_default = RangePicker;
|
|
2432
2518
|
|
|
2433
2519
|
// src/components/Divider/Divider.tsx
|
|
2434
|
-
var
|
|
2520
|
+
var import_jsx_runtime315 = require("react/jsx-runtime");
|
|
2435
2521
|
var Divider = (props) => {
|
|
2436
2522
|
const { orientation = "horizontal", className } = props;
|
|
2437
|
-
return /* @__PURE__ */ (0,
|
|
2523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(
|
|
2438
2524
|
"div",
|
|
2439
2525
|
{
|
|
2440
2526
|
className: clsx_default("lib-xplat-divider", orientation, className),
|
|
@@ -2447,15 +2533,15 @@ Divider.displayName = "Divider";
|
|
|
2447
2533
|
var Divider_default = Divider;
|
|
2448
2534
|
|
|
2449
2535
|
// src/components/Drawer/Drawer.tsx
|
|
2450
|
-
var
|
|
2536
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
2451
2537
|
var import_react_dom2 = require("react-dom");
|
|
2452
|
-
var
|
|
2538
|
+
var import_jsx_runtime316 = require("react/jsx-runtime");
|
|
2453
2539
|
var ANIMATION_DURATION_MS2 = 250;
|
|
2454
2540
|
var Drawer = (props) => {
|
|
2455
2541
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
2456
|
-
const [mounted, setMounted] =
|
|
2457
|
-
const [visible, setVisible] =
|
|
2458
|
-
|
|
2542
|
+
const [mounted, setMounted] = import_react11.default.useState(false);
|
|
2543
|
+
const [visible, setVisible] = import_react11.default.useState(false);
|
|
2544
|
+
import_react11.default.useEffect(() => {
|
|
2459
2545
|
if (isOpen) {
|
|
2460
2546
|
setMounted(true);
|
|
2461
2547
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2470,12 +2556,12 @@ var Drawer = (props) => {
|
|
|
2470
2556
|
const stateClass = visible ? "enter" : "exit";
|
|
2471
2557
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
2472
2558
|
return (0, import_react_dom2.createPortal)(
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2559
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)(
|
|
2474
2560
|
"div",
|
|
2475
2561
|
{
|
|
2476
2562
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
2477
2563
|
onClick: onClose,
|
|
2478
|
-
children: /* @__PURE__ */ (0,
|
|
2564
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)(
|
|
2479
2565
|
"div",
|
|
2480
2566
|
{
|
|
2481
2567
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -2484,11 +2570,11 @@ var Drawer = (props) => {
|
|
|
2484
2570
|
"aria-modal": "true",
|
|
2485
2571
|
onClick: (e) => e.stopPropagation(),
|
|
2486
2572
|
children: [
|
|
2487
|
-
title && /* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2573
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)("div", { className: "drawer-header", children: [
|
|
2574
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("span", { className: "drawer-title", children: title }),
|
|
2575
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
2490
2576
|
] }),
|
|
2491
|
-
/* @__PURE__ */ (0,
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime316.jsx)("div", { className: "drawer-body", children })
|
|
2492
2578
|
]
|
|
2493
2579
|
}
|
|
2494
2580
|
)
|
|
@@ -2501,16 +2587,16 @@ Drawer.displayName = "Drawer";
|
|
|
2501
2587
|
var Drawer_default = Drawer;
|
|
2502
2588
|
|
|
2503
2589
|
// src/components/Dropdown/Dropdown.tsx
|
|
2504
|
-
var
|
|
2590
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
2505
2591
|
|
|
2506
2592
|
// src/tokens/hooks/useAutoPosition.ts
|
|
2507
|
-
var
|
|
2593
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
2508
2594
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
2509
|
-
const [position, setPosition] =
|
|
2595
|
+
const [position, setPosition] = import_react12.default.useState({
|
|
2510
2596
|
position: {},
|
|
2511
2597
|
direction: "bottom"
|
|
2512
2598
|
});
|
|
2513
|
-
const calculatePosition =
|
|
2599
|
+
const calculatePosition = import_react12.default.useCallback(() => {
|
|
2514
2600
|
if (!triggerRef.current || !popRef.current) return;
|
|
2515
2601
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
2516
2602
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -2532,7 +2618,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
2532
2618
|
direction
|
|
2533
2619
|
});
|
|
2534
2620
|
}, [triggerRef, popRef]);
|
|
2535
|
-
|
|
2621
|
+
import_react12.default.useEffect(() => {
|
|
2536
2622
|
calculatePosition();
|
|
2537
2623
|
window.addEventListener("resize", calculatePosition);
|
|
2538
2624
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -2542,9 +2628,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
2542
2628
|
var useAutoPosition_default = useAutoPosition;
|
|
2543
2629
|
|
|
2544
2630
|
// src/tokens/hooks/useClickOutside.ts
|
|
2545
|
-
var
|
|
2631
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2546
2632
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
2547
|
-
|
|
2633
|
+
import_react13.default.useEffect(() => {
|
|
2548
2634
|
if (!enabled) return;
|
|
2549
2635
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
2550
2636
|
const listener = (event) => {
|
|
@@ -2567,17 +2653,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
2567
2653
|
var useClickOutside_default = useClickOutside;
|
|
2568
2654
|
|
|
2569
2655
|
// src/components/Dropdown/Dropdown.tsx
|
|
2570
|
-
var
|
|
2656
|
+
var import_jsx_runtime317 = require("react/jsx-runtime");
|
|
2571
2657
|
var Dropdown = (props) => {
|
|
2572
2658
|
const { items, children, className } = props;
|
|
2573
|
-
const [isOpen, setIsOpen] =
|
|
2574
|
-
const [mounted, setMounted] =
|
|
2575
|
-
const [visible, setVisible] =
|
|
2576
|
-
const triggerRef =
|
|
2577
|
-
const menuRef =
|
|
2659
|
+
const [isOpen, setIsOpen] = import_react14.default.useState(false);
|
|
2660
|
+
const [mounted, setMounted] = import_react14.default.useState(false);
|
|
2661
|
+
const [visible, setVisible] = import_react14.default.useState(false);
|
|
2662
|
+
const triggerRef = import_react14.default.useRef(null);
|
|
2663
|
+
const menuRef = import_react14.default.useRef(null);
|
|
2578
2664
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
2579
2665
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
2580
|
-
|
|
2666
|
+
import_react14.default.useEffect(() => {
|
|
2581
2667
|
if (isOpen) {
|
|
2582
2668
|
setMounted(true);
|
|
2583
2669
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2592,8 +2678,8 @@ var Dropdown = (props) => {
|
|
|
2592
2678
|
item.onClick?.();
|
|
2593
2679
|
setIsOpen(false);
|
|
2594
2680
|
};
|
|
2595
|
-
return /* @__PURE__ */ (0,
|
|
2596
|
-
/* @__PURE__ */ (0,
|
|
2681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime317.jsxs)("div", { className: clsx_default("lib-xplat-dropdown", className), children: [
|
|
2682
|
+
/* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
2597
2683
|
"div",
|
|
2598
2684
|
{
|
|
2599
2685
|
ref: triggerRef,
|
|
@@ -2602,14 +2688,14 @@ var Dropdown = (props) => {
|
|
|
2602
2688
|
children
|
|
2603
2689
|
}
|
|
2604
2690
|
),
|
|
2605
|
-
mounted && /* @__PURE__ */ (0,
|
|
2691
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
2606
2692
|
"div",
|
|
2607
2693
|
{
|
|
2608
2694
|
ref: menuRef,
|
|
2609
2695
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
2610
2696
|
style: { top: position.top, left: position.left },
|
|
2611
2697
|
role: "menu",
|
|
2612
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
2698
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(
|
|
2613
2699
|
"button",
|
|
2614
2700
|
{
|
|
2615
2701
|
className: clsx_default("dropdown-item", {
|
|
@@ -2631,23 +2717,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
2631
2717
|
var Dropdown_default = Dropdown;
|
|
2632
2718
|
|
|
2633
2719
|
// src/components/EmptyState/EmptyState.tsx
|
|
2634
|
-
var
|
|
2720
|
+
var import_jsx_runtime318 = require("react/jsx-runtime");
|
|
2635
2721
|
var EmptyState = (props) => {
|
|
2636
2722
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action, className } = props;
|
|
2637
|
-
return /* @__PURE__ */ (0,
|
|
2638
|
-
icon && /* @__PURE__ */ (0,
|
|
2639
|
-
!icon && /* @__PURE__ */ (0,
|
|
2640
|
-
/* @__PURE__ */ (0,
|
|
2641
|
-
description && /* @__PURE__ */ (0,
|
|
2642
|
-
action && /* @__PURE__ */ (0,
|
|
2723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-empty-state", className), children: [
|
|
2724
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "empty-icon", children: icon }),
|
|
2725
|
+
!icon && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime318.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" }) }) }),
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime318.jsx)("p", { className: "empty-title", children: title }),
|
|
2727
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("p", { className: "empty-description", children: description }),
|
|
2728
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "empty-action", children: action })
|
|
2643
2729
|
] });
|
|
2644
2730
|
};
|
|
2645
2731
|
EmptyState.displayName = "EmptyState";
|
|
2646
2732
|
var EmptyState_default = EmptyState;
|
|
2647
2733
|
|
|
2648
2734
|
// src/components/FileUpload/FileUpload.tsx
|
|
2649
|
-
var
|
|
2650
|
-
var
|
|
2735
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
2736
|
+
var import_jsx_runtime319 = require("react/jsx-runtime");
|
|
2651
2737
|
var FileUpload = (props) => {
|
|
2652
2738
|
const {
|
|
2653
2739
|
accept,
|
|
@@ -2658,8 +2744,8 @@ var FileUpload = (props) => {
|
|
|
2658
2744
|
description,
|
|
2659
2745
|
className
|
|
2660
2746
|
} = props;
|
|
2661
|
-
const [isDragOver, setIsDragOver] =
|
|
2662
|
-
const inputRef =
|
|
2747
|
+
const [isDragOver, setIsDragOver] = import_react15.default.useState(false);
|
|
2748
|
+
const inputRef = import_react15.default.useRef(null);
|
|
2663
2749
|
const handleFiles = (fileList) => {
|
|
2664
2750
|
let files = Array.from(fileList);
|
|
2665
2751
|
if (maxSize) {
|
|
@@ -2689,7 +2775,7 @@ var FileUpload = (props) => {
|
|
|
2689
2775
|
handleFiles(e.target.files);
|
|
2690
2776
|
}
|
|
2691
2777
|
};
|
|
2692
|
-
return /* @__PURE__ */ (0,
|
|
2778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime319.jsxs)(
|
|
2693
2779
|
"div",
|
|
2694
2780
|
{
|
|
2695
2781
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }, className),
|
|
@@ -2698,7 +2784,7 @@ var FileUpload = (props) => {
|
|
|
2698
2784
|
onDragLeave: handleDragLeave,
|
|
2699
2785
|
onClick: () => inputRef.current?.click(),
|
|
2700
2786
|
children: [
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)(
|
|
2702
2788
|
"input",
|
|
2703
2789
|
{
|
|
2704
2790
|
ref: inputRef,
|
|
@@ -2708,9 +2794,9 @@ var FileUpload = (props) => {
|
|
|
2708
2794
|
onChange: handleChange
|
|
2709
2795
|
}
|
|
2710
2796
|
),
|
|
2711
|
-
/* @__PURE__ */ (0,
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2713
|
-
description && /* @__PURE__ */ (0,
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(UploadIcon_default, {}) }),
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime319.jsx)("p", { className: "upload-label", children: label }),
|
|
2799
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime319.jsx)("p", { className: "upload-description", children: description })
|
|
2714
2800
|
]
|
|
2715
2801
|
}
|
|
2716
2802
|
);
|
|
@@ -2719,19 +2805,19 @@ FileUpload.displayName = "FileUpload";
|
|
|
2719
2805
|
var FileUpload_default = FileUpload;
|
|
2720
2806
|
|
|
2721
2807
|
// src/components/Select/Select.tsx
|
|
2722
|
-
var
|
|
2808
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
2723
2809
|
|
|
2724
2810
|
// src/components/Select/context.ts
|
|
2725
|
-
var
|
|
2726
|
-
var SelectContext =
|
|
2811
|
+
var import_react16 = __toESM(require("react"), 1);
|
|
2812
|
+
var SelectContext = import_react16.default.createContext(null);
|
|
2727
2813
|
var context_default = SelectContext;
|
|
2728
2814
|
|
|
2729
2815
|
// src/components/Select/SelectItem.tsx
|
|
2730
|
-
var
|
|
2731
|
-
var
|
|
2816
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2817
|
+
var import_jsx_runtime320 = require("react/jsx-runtime");
|
|
2732
2818
|
var SelectItem = (props) => {
|
|
2733
2819
|
const { children, value, onClick, disabled = false, className } = props;
|
|
2734
|
-
const ctx =
|
|
2820
|
+
const ctx = import_react17.default.useContext(context_default);
|
|
2735
2821
|
const handleClick = (e) => {
|
|
2736
2822
|
e.preventDefault();
|
|
2737
2823
|
e.stopPropagation();
|
|
@@ -2740,7 +2826,7 @@ var SelectItem = (props) => {
|
|
|
2740
2826
|
ctx?.close();
|
|
2741
2827
|
onClick?.();
|
|
2742
2828
|
};
|
|
2743
|
-
return /* @__PURE__ */ (0,
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime320.jsx)(
|
|
2744
2830
|
"div",
|
|
2745
2831
|
{
|
|
2746
2832
|
className: clsx_default("select-item", disabled && "disabled", className),
|
|
@@ -2761,7 +2847,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
2761
2847
|
var SelectItem_default = SelectItem;
|
|
2762
2848
|
|
|
2763
2849
|
// src/components/Select/Select.tsx
|
|
2764
|
-
var
|
|
2850
|
+
var import_jsx_runtime321 = require("react/jsx-runtime");
|
|
2765
2851
|
var ANIMATION_DURATION_MS3 = 200;
|
|
2766
2852
|
var SelectRoot = (props) => {
|
|
2767
2853
|
const {
|
|
@@ -2770,28 +2856,29 @@ var SelectRoot = (props) => {
|
|
|
2770
2856
|
onChange,
|
|
2771
2857
|
children,
|
|
2772
2858
|
disabled = false,
|
|
2773
|
-
error = false
|
|
2859
|
+
error = false,
|
|
2860
|
+
size = "md"
|
|
2774
2861
|
} = props;
|
|
2775
|
-
const itemChildren =
|
|
2776
|
-
(child) =>
|
|
2862
|
+
const itemChildren = import_react18.default.Children.toArray(children).filter(
|
|
2863
|
+
(child) => import_react18.default.isValidElement(child) && child.type === SelectItem_default
|
|
2777
2864
|
);
|
|
2778
2865
|
const isControlled = valueProp !== void 0;
|
|
2779
|
-
const [isOpen, setOpen] =
|
|
2780
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
2781
|
-
const controlledLabel =
|
|
2866
|
+
const [isOpen, setOpen] = import_react18.default.useState(false);
|
|
2867
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react18.default.useState(null);
|
|
2868
|
+
const controlledLabel = import_react18.default.useMemo(() => {
|
|
2782
2869
|
if (!isControlled) return null;
|
|
2783
2870
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
2784
2871
|
return match ? match.props.children : null;
|
|
2785
2872
|
}, [isControlled, valueProp, itemChildren]);
|
|
2786
2873
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
2787
|
-
const triggerRef =
|
|
2788
|
-
const contentRef =
|
|
2789
|
-
const [mounted, setMounted] =
|
|
2790
|
-
const [visible, setVisible] =
|
|
2791
|
-
|
|
2874
|
+
const triggerRef = import_react18.default.useRef(null);
|
|
2875
|
+
const contentRef = import_react18.default.useRef(null);
|
|
2876
|
+
const [mounted, setMounted] = import_react18.default.useState(false);
|
|
2877
|
+
const [visible, setVisible] = import_react18.default.useState(false);
|
|
2878
|
+
import_react18.default.useEffect(() => {
|
|
2792
2879
|
if (disabled && isOpen) setOpen(false);
|
|
2793
2880
|
}, [disabled, isOpen]);
|
|
2794
|
-
|
|
2881
|
+
import_react18.default.useEffect(() => {
|
|
2795
2882
|
if (isOpen) {
|
|
2796
2883
|
setMounted(true);
|
|
2797
2884
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2801,12 +2888,12 @@ var SelectRoot = (props) => {
|
|
|
2801
2888
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
2802
2889
|
return () => clearTimeout(t);
|
|
2803
2890
|
}, [isOpen]);
|
|
2804
|
-
const open =
|
|
2805
|
-
const close =
|
|
2806
|
-
const toggle =
|
|
2891
|
+
const open = import_react18.default.useCallback(() => setOpen(true), []);
|
|
2892
|
+
const close = import_react18.default.useCallback(() => setOpen(false), []);
|
|
2893
|
+
const toggle = import_react18.default.useCallback(() => setOpen((prev) => !prev), []);
|
|
2807
2894
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
2808
2895
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
2809
|
-
const setSelected =
|
|
2896
|
+
const setSelected = import_react18.default.useCallback(
|
|
2810
2897
|
(label, itemValue) => {
|
|
2811
2898
|
if (!isControlled) {
|
|
2812
2899
|
setUncontrolledLabel(label);
|
|
@@ -2815,7 +2902,7 @@ var SelectRoot = (props) => {
|
|
|
2815
2902
|
},
|
|
2816
2903
|
[isControlled, onChange]
|
|
2817
2904
|
);
|
|
2818
|
-
const ctxValue =
|
|
2905
|
+
const ctxValue = import_react18.default.useMemo(
|
|
2819
2906
|
() => ({
|
|
2820
2907
|
isOpen,
|
|
2821
2908
|
mounted,
|
|
@@ -2836,17 +2923,18 @@ var SelectRoot = (props) => {
|
|
|
2836
2923
|
if (disabled) return;
|
|
2837
2924
|
toggle();
|
|
2838
2925
|
};
|
|
2839
|
-
return /* @__PURE__ */ (0,
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
2840
2927
|
"div",
|
|
2841
2928
|
{
|
|
2842
2929
|
className: clsx_default(
|
|
2843
2930
|
"lib-xplat-select",
|
|
2931
|
+
size,
|
|
2844
2932
|
disabled && "disabled",
|
|
2845
2933
|
error && "error",
|
|
2846
2934
|
mounted && "is-open"
|
|
2847
2935
|
),
|
|
2848
2936
|
children: [
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
2850
2938
|
"div",
|
|
2851
2939
|
{
|
|
2852
2940
|
ref: triggerRef,
|
|
@@ -2870,7 +2958,7 @@ var SelectRoot = (props) => {
|
|
|
2870
2958
|
}
|
|
2871
2959
|
},
|
|
2872
2960
|
children: [
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2874
2962
|
"span",
|
|
2875
2963
|
{
|
|
2876
2964
|
className: clsx_default(
|
|
@@ -2880,18 +2968,18 @@ var SelectRoot = (props) => {
|
|
|
2880
2968
|
children: selectedLabel ?? placeholder
|
|
2881
2969
|
}
|
|
2882
2970
|
),
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2884
2972
|
"span",
|
|
2885
2973
|
{
|
|
2886
2974
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
2887
2975
|
"aria-hidden": true,
|
|
2888
|
-
children: /* @__PURE__ */ (0,
|
|
2976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(ChevronDownIcon_default, {})
|
|
2889
2977
|
}
|
|
2890
2978
|
)
|
|
2891
2979
|
]
|
|
2892
2980
|
}
|
|
2893
2981
|
),
|
|
2894
|
-
mounted && /* @__PURE__ */ (0,
|
|
2982
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2895
2983
|
"div",
|
|
2896
2984
|
{
|
|
2897
2985
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -2912,10 +3000,10 @@ var Select = Object.assign(SelectRoot, {
|
|
|
2912
3000
|
var Select_default = Select;
|
|
2913
3001
|
|
|
2914
3002
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
2915
|
-
var
|
|
3003
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
2916
3004
|
|
|
2917
3005
|
// src/components/HtmlTypeWriter/utils.ts
|
|
2918
|
-
var
|
|
3006
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
2919
3007
|
var voidTags = /* @__PURE__ */ new Set([
|
|
2920
3008
|
"br",
|
|
2921
3009
|
"img",
|
|
@@ -2983,40 +3071,40 @@ function convertNodeToReactWithRange(node, typedLen, rangeMap) {
|
|
|
2983
3071
|
props[attr.name] = attr.value;
|
|
2984
3072
|
});
|
|
2985
3073
|
if (voidTags.has(tag)) {
|
|
2986
|
-
return
|
|
3074
|
+
return import_react19.default.createElement(tag, props);
|
|
2987
3075
|
}
|
|
2988
3076
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
2989
|
-
return
|
|
3077
|
+
return import_react19.default.createElement(tag, props, ...children);
|
|
2990
3078
|
}
|
|
2991
3079
|
function htmlToReactProgressive(root, typedLen, rangeMap) {
|
|
2992
3080
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
2993
3081
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
2994
|
-
return node == null ? null :
|
|
3082
|
+
return node == null ? null : import_react19.default.createElement(import_react19.default.Fragment, { key: idx }, node);
|
|
2995
3083
|
}).filter(Boolean);
|
|
2996
3084
|
return nodes.length === 0 ? null : nodes;
|
|
2997
3085
|
}
|
|
2998
3086
|
|
|
2999
3087
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
3000
|
-
var
|
|
3088
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
3001
3089
|
var HtmlTypeWriter = ({
|
|
3002
3090
|
html,
|
|
3003
3091
|
duration = 20,
|
|
3004
3092
|
onDone,
|
|
3005
3093
|
onChange
|
|
3006
3094
|
}) => {
|
|
3007
|
-
const [typedLen, setTypedLen] =
|
|
3008
|
-
const doneCalledRef =
|
|
3009
|
-
const { doc, rangeMap, totalLength } =
|
|
3095
|
+
const [typedLen, setTypedLen] = import_react20.default.useState(0);
|
|
3096
|
+
const doneCalledRef = import_react20.default.useRef(false);
|
|
3097
|
+
const { doc, rangeMap, totalLength } = import_react20.default.useMemo(() => {
|
|
3010
3098
|
const decoded = decodeHtmlEntities(html);
|
|
3011
3099
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3012
3100
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3013
3101
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3014
3102
|
}, [html]);
|
|
3015
|
-
|
|
3103
|
+
import_react20.default.useEffect(() => {
|
|
3016
3104
|
setTypedLen(0);
|
|
3017
3105
|
doneCalledRef.current = false;
|
|
3018
3106
|
}, [html]);
|
|
3019
|
-
|
|
3107
|
+
import_react20.default.useEffect(() => {
|
|
3020
3108
|
if (!totalLength) return;
|
|
3021
3109
|
if (typedLen >= totalLength) return;
|
|
3022
3110
|
const timer = window.setInterval(() => {
|
|
@@ -3024,33 +3112,33 @@ var HtmlTypeWriter = ({
|
|
|
3024
3112
|
}, duration);
|
|
3025
3113
|
return () => window.clearInterval(timer);
|
|
3026
3114
|
}, [typedLen, totalLength, duration]);
|
|
3027
|
-
|
|
3115
|
+
import_react20.default.useEffect(() => {
|
|
3028
3116
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3029
3117
|
onChange?.();
|
|
3030
3118
|
}
|
|
3031
3119
|
}, [typedLen, totalLength, onChange]);
|
|
3032
|
-
|
|
3120
|
+
import_react20.default.useEffect(() => {
|
|
3033
3121
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3034
3122
|
doneCalledRef.current = true;
|
|
3035
3123
|
onDone?.();
|
|
3036
3124
|
}
|
|
3037
3125
|
}, [typedLen, totalLength, onDone]);
|
|
3038
|
-
const parsed =
|
|
3126
|
+
const parsed = import_react20.default.useMemo(
|
|
3039
3127
|
() => htmlToReactProgressive(doc.body, typedLen, rangeMap),
|
|
3040
3128
|
[doc.body, typedLen, rangeMap]
|
|
3041
3129
|
);
|
|
3042
|
-
return /* @__PURE__ */ (0,
|
|
3130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3043
3131
|
};
|
|
3044
3132
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3045
3133
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3046
3134
|
|
|
3047
3135
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3048
|
-
var
|
|
3049
|
-
var
|
|
3136
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
3137
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
3050
3138
|
var ImageSelector = (props) => {
|
|
3051
3139
|
const { value, label, onChange } = props;
|
|
3052
|
-
const [previewUrl, setPreviewUrl] =
|
|
3053
|
-
|
|
3140
|
+
const [previewUrl, setPreviewUrl] = import_react21.default.useState();
|
|
3141
|
+
import_react21.default.useEffect(() => {
|
|
3054
3142
|
if (!value) {
|
|
3055
3143
|
setPreviewUrl(void 0);
|
|
3056
3144
|
return;
|
|
@@ -3059,7 +3147,7 @@ var ImageSelector = (props) => {
|
|
|
3059
3147
|
setPreviewUrl(url);
|
|
3060
3148
|
return () => URL.revokeObjectURL(url);
|
|
3061
3149
|
}, [value]);
|
|
3062
|
-
const inputRef =
|
|
3150
|
+
const inputRef = import_react21.default.useRef(null);
|
|
3063
3151
|
const handleFileChange = (e) => {
|
|
3064
3152
|
const selectedFile = e.target.files?.[0];
|
|
3065
3153
|
if (selectedFile) {
|
|
@@ -3072,8 +3160,8 @@ var ImageSelector = (props) => {
|
|
|
3072
3160
|
const handleOpenFileDialog = () => {
|
|
3073
3161
|
inputRef.current?.click();
|
|
3074
3162
|
};
|
|
3075
|
-
return /* @__PURE__ */ (0,
|
|
3076
|
-
/* @__PURE__ */ (0,
|
|
3163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
3164
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)(
|
|
3077
3165
|
"input",
|
|
3078
3166
|
{
|
|
3079
3167
|
type: "file",
|
|
@@ -3083,13 +3171,13 @@ var ImageSelector = (props) => {
|
|
|
3083
3171
|
ref: inputRef
|
|
3084
3172
|
}
|
|
3085
3173
|
),
|
|
3086
|
-
value && /* @__PURE__ */ (0,
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3088
|
-
/* @__PURE__ */ (0,
|
|
3174
|
+
value && /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "action-bar", children: [
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(UploadIcon_default, {}) }),
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(DeleteIcon_default, {}) })
|
|
3089
3177
|
] }),
|
|
3090
|
-
/* @__PURE__ */ (0,
|
|
3091
|
-
/* @__PURE__ */ (0,
|
|
3092
|
-
/* @__PURE__ */ (0,
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime323.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
3179
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(ImageIcon_default, {}) }),
|
|
3180
|
+
/* @__PURE__ */ (0, import_jsx_runtime323.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
3093
3181
|
] }) })
|
|
3094
3182
|
] });
|
|
3095
3183
|
};
|
|
@@ -3097,7 +3185,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3097
3185
|
var ImageSelector_default = ImageSelector;
|
|
3098
3186
|
|
|
3099
3187
|
// src/components/Pagination/Pagination.tsx
|
|
3100
|
-
var
|
|
3188
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
3101
3189
|
function getPageRange(current, totalPages, siblingCount) {
|
|
3102
3190
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3103
3191
|
if (totalPages <= totalNumbers) {
|
|
@@ -3130,6 +3218,7 @@ var Pagination = (props) => {
|
|
|
3130
3218
|
pageSize = 10,
|
|
3131
3219
|
siblingCount = 1,
|
|
3132
3220
|
onChange,
|
|
3221
|
+
size = "md",
|
|
3133
3222
|
colorNamespace = "xplat",
|
|
3134
3223
|
color = "blue",
|
|
3135
3224
|
colorDepth,
|
|
@@ -3147,19 +3236,19 @@ var Pagination = (props) => {
|
|
|
3147
3236
|
onChange?.(page);
|
|
3148
3237
|
}
|
|
3149
3238
|
};
|
|
3150
|
-
return /* @__PURE__ */ (0,
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("nav", { className: clsx_default("lib-xplat-pagination", size, className), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
3240
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
3152
3241
|
"button",
|
|
3153
3242
|
{
|
|
3154
3243
|
className: "page-btn prev",
|
|
3155
3244
|
disabled: current <= 1,
|
|
3156
3245
|
onClick: () => handleClick(current - 1),
|
|
3157
3246
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
3158
|
-
children: /* @__PURE__ */ (0,
|
|
3247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(ChevronLeftIcon_default, {})
|
|
3159
3248
|
}
|
|
3160
3249
|
),
|
|
3161
3250
|
pages.map(
|
|
3162
|
-
(page, i) => page === "..." ? /* @__PURE__ */ (0,
|
|
3251
|
+
(page, i) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime324.jsx)("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
3163
3252
|
"button",
|
|
3164
3253
|
{
|
|
3165
3254
|
className: clsx_default("page-btn", colorClass, { active: page === current }),
|
|
@@ -3170,14 +3259,14 @@ var Pagination = (props) => {
|
|
|
3170
3259
|
page
|
|
3171
3260
|
)
|
|
3172
3261
|
),
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
3174
3263
|
"button",
|
|
3175
3264
|
{
|
|
3176
3265
|
className: "page-btn next",
|
|
3177
3266
|
disabled: current >= totalPages,
|
|
3178
3267
|
onClick: () => handleClick(current + 1),
|
|
3179
3268
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
3180
|
-
children: /* @__PURE__ */ (0,
|
|
3269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(ChevronRightIcon_default, {})
|
|
3181
3270
|
}
|
|
3182
3271
|
)
|
|
3183
3272
|
] });
|
|
@@ -3186,17 +3275,17 @@ Pagination.displayName = "Pagination";
|
|
|
3186
3275
|
var Pagination_default = Pagination;
|
|
3187
3276
|
|
|
3188
3277
|
// src/components/PopOver/PopOver.tsx
|
|
3189
|
-
var
|
|
3190
|
-
var
|
|
3278
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3279
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
3191
3280
|
var PopOver = (props) => {
|
|
3192
3281
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
3193
|
-
const popRef =
|
|
3194
|
-
const triggerRef =
|
|
3195
|
-
const [localOpen, setLocalOpen] =
|
|
3196
|
-
const [eventTrigger, setEventTrigger] =
|
|
3282
|
+
const popRef = import_react22.default.useRef(null);
|
|
3283
|
+
const triggerRef = import_react22.default.useRef(null);
|
|
3284
|
+
const [localOpen, setLocalOpen] = import_react22.default.useState(false);
|
|
3285
|
+
const [eventTrigger, setEventTrigger] = import_react22.default.useState(false);
|
|
3197
3286
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
3198
3287
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
3199
|
-
|
|
3288
|
+
import_react22.default.useEffect(() => {
|
|
3200
3289
|
if (isOpen) {
|
|
3201
3290
|
setLocalOpen(isOpen);
|
|
3202
3291
|
setTimeout(() => {
|
|
@@ -3209,7 +3298,7 @@ var PopOver = (props) => {
|
|
|
3209
3298
|
}, 200);
|
|
3210
3299
|
}
|
|
3211
3300
|
}, [isOpen]);
|
|
3212
|
-
return /* @__PURE__ */ (0,
|
|
3301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
|
|
3213
3302
|
"div",
|
|
3214
3303
|
{
|
|
3215
3304
|
className: "lib-xplat-pop-over",
|
|
@@ -3219,7 +3308,7 @@ var PopOver = (props) => {
|
|
|
3219
3308
|
},
|
|
3220
3309
|
children: [
|
|
3221
3310
|
children,
|
|
3222
|
-
localOpen && /* @__PURE__ */ (0,
|
|
3311
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
3223
3312
|
"div",
|
|
3224
3313
|
{
|
|
3225
3314
|
className: clsx_default(
|
|
@@ -3242,7 +3331,7 @@ PopOver.displayName = "PopOver";
|
|
|
3242
3331
|
var PopOver_default = PopOver;
|
|
3243
3332
|
|
|
3244
3333
|
// src/components/Progress/Progress.tsx
|
|
3245
|
-
var
|
|
3334
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
3246
3335
|
var Progress = (props) => {
|
|
3247
3336
|
const {
|
|
3248
3337
|
value,
|
|
@@ -3260,8 +3349,8 @@ var Progress = (props) => {
|
|
|
3260
3349
|
colorDepth ?? 500
|
|
3261
3350
|
);
|
|
3262
3351
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
3263
|
-
return /* @__PURE__ */ (0,
|
|
3264
|
-
/* @__PURE__ */ (0,
|
|
3352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className: clsx_default("lib-xplat-progress", size, className), children: [
|
|
3353
|
+
/* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
3265
3354
|
"div",
|
|
3266
3355
|
{
|
|
3267
3356
|
className: "track",
|
|
@@ -3269,7 +3358,7 @@ var Progress = (props) => {
|
|
|
3269
3358
|
"aria-valuenow": value,
|
|
3270
3359
|
"aria-valuemin": 0,
|
|
3271
3360
|
"aria-valuemax": max,
|
|
3272
|
-
children: /* @__PURE__ */ (0,
|
|
3361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
3273
3362
|
"div",
|
|
3274
3363
|
{
|
|
3275
3364
|
className: clsx_default("bar", colorClass),
|
|
@@ -3278,7 +3367,7 @@ var Progress = (props) => {
|
|
|
3278
3367
|
)
|
|
3279
3368
|
}
|
|
3280
3369
|
),
|
|
3281
|
-
showLabel && /* @__PURE__ */ (0,
|
|
3370
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("span", { className: "label", children: [
|
|
3282
3371
|
Math.round(percentage),
|
|
3283
3372
|
"%"
|
|
3284
3373
|
] })
|
|
@@ -3288,17 +3377,17 @@ Progress.displayName = "Progress";
|
|
|
3288
3377
|
var Progress_default = Progress;
|
|
3289
3378
|
|
|
3290
3379
|
// src/components/Radio/RadioGroupContext.tsx
|
|
3291
|
-
var
|
|
3292
|
-
var RadioGroupContext =
|
|
3380
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
3381
|
+
var RadioGroupContext = import_react23.default.createContext(
|
|
3293
3382
|
null
|
|
3294
3383
|
);
|
|
3295
3384
|
var useRadioGroupContext = () => {
|
|
3296
|
-
return
|
|
3385
|
+
return import_react23.default.useContext(RadioGroupContext);
|
|
3297
3386
|
};
|
|
3298
3387
|
var RadioGroupContext_default = RadioGroupContext;
|
|
3299
3388
|
|
|
3300
3389
|
// src/components/Radio/Radio.tsx
|
|
3301
|
-
var
|
|
3390
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
3302
3391
|
var Radio = (props) => {
|
|
3303
3392
|
const {
|
|
3304
3393
|
label,
|
|
@@ -3307,9 +3396,11 @@ var Radio = (props) => {
|
|
|
3307
3396
|
colorNamespace = "xplat",
|
|
3308
3397
|
color = "blue",
|
|
3309
3398
|
colorDepth,
|
|
3399
|
+
size: sizeProp,
|
|
3310
3400
|
...rest
|
|
3311
3401
|
} = props;
|
|
3312
3402
|
const context = useRadioGroupContext();
|
|
3403
|
+
const size = sizeProp ?? context?.size ?? "md";
|
|
3313
3404
|
const isGroup = !!context;
|
|
3314
3405
|
const localChecked = isGroup ? context.value === value : rest.checked ?? false;
|
|
3315
3406
|
const inputProps = context ? { name: context.name, value, onChange: context.onChange } : {
|
|
@@ -3322,17 +3413,18 @@ var Radio = (props) => {
|
|
|
3322
3413
|
color,
|
|
3323
3414
|
colorDepth ?? 500
|
|
3324
3415
|
);
|
|
3325
|
-
return /* @__PURE__ */ (0,
|
|
3416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
|
|
3326
3417
|
"label",
|
|
3327
3418
|
{
|
|
3328
3419
|
className: clsx_default(
|
|
3329
3420
|
"lib-xplat-radio",
|
|
3421
|
+
size,
|
|
3330
3422
|
localChecked ? "checked" : void 0,
|
|
3331
3423
|
className
|
|
3332
3424
|
),
|
|
3333
3425
|
children: [
|
|
3334
|
-
/* @__PURE__ */ (0,
|
|
3335
|
-
/* @__PURE__ */ (0,
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
3336
3428
|
"div",
|
|
3337
3429
|
{
|
|
3338
3430
|
className: clsx_default(
|
|
@@ -3340,10 +3432,10 @@ var Radio = (props) => {
|
|
|
3340
3432
|
localChecked ? "checked" : void 0,
|
|
3341
3433
|
colorClass
|
|
3342
3434
|
),
|
|
3343
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
3435
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "inner-circle" })
|
|
3344
3436
|
}
|
|
3345
3437
|
),
|
|
3346
|
-
label && /* @__PURE__ */ (0,
|
|
3438
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("span", { children: label })
|
|
3347
3439
|
]
|
|
3348
3440
|
}
|
|
3349
3441
|
);
|
|
@@ -3352,23 +3444,23 @@ Radio.displayName = "Radio";
|
|
|
3352
3444
|
var Radio_default = Radio;
|
|
3353
3445
|
|
|
3354
3446
|
// src/components/Radio/RadioGroup.tsx
|
|
3355
|
-
var
|
|
3447
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
3356
3448
|
var RadioGroup = (props) => {
|
|
3357
3449
|
const { children, ...rest } = props;
|
|
3358
|
-
return /* @__PURE__ */ (0,
|
|
3450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(import_jsx_runtime328.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
3359
3451
|
};
|
|
3360
3452
|
RadioGroup.displayName = "RadioGroup";
|
|
3361
3453
|
var RadioGroup_default = RadioGroup;
|
|
3362
3454
|
|
|
3363
3455
|
// src/components/Skeleton/Skeleton.tsx
|
|
3364
|
-
var
|
|
3456
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
3365
3457
|
var Skeleton = (props) => {
|
|
3366
3458
|
const { variant = "text", width, height, className } = props;
|
|
3367
3459
|
const style = {
|
|
3368
3460
|
width: typeof width === "number" ? `${width}px` : width,
|
|
3369
3461
|
height: typeof height === "number" ? `${height}px` : height
|
|
3370
3462
|
};
|
|
3371
|
-
return /* @__PURE__ */ (0,
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
3372
3464
|
"div",
|
|
3373
3465
|
{
|
|
3374
3466
|
className: clsx_default("lib-xplat-skeleton", variant, className),
|
|
@@ -3381,7 +3473,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
3381
3473
|
var Skeleton_default = Skeleton;
|
|
3382
3474
|
|
|
3383
3475
|
// src/components/Spinner/Spinner.tsx
|
|
3384
|
-
var
|
|
3476
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
3385
3477
|
var Spinner = (props) => {
|
|
3386
3478
|
const {
|
|
3387
3479
|
size = "md",
|
|
@@ -3395,14 +3487,14 @@ var Spinner = (props) => {
|
|
|
3395
3487
|
color,
|
|
3396
3488
|
colorDepth ?? 500
|
|
3397
3489
|
);
|
|
3398
|
-
return /* @__PURE__ */ (0,
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
3399
3491
|
"div",
|
|
3400
3492
|
{
|
|
3401
3493
|
className: clsx_default("lib-xplat-spinner", size, colorClass, className),
|
|
3402
3494
|
role: "status",
|
|
3403
3495
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
3404
|
-
children: /* @__PURE__ */ (0,
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3496
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime330.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
3497
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
3406
3498
|
"circle",
|
|
3407
3499
|
{
|
|
3408
3500
|
className: "track",
|
|
@@ -3412,7 +3504,7 @@ var Spinner = (props) => {
|
|
|
3412
3504
|
strokeWidth: "3"
|
|
3413
3505
|
}
|
|
3414
3506
|
),
|
|
3415
|
-
/* @__PURE__ */ (0,
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
3416
3508
|
"circle",
|
|
3417
3509
|
{
|
|
3418
3510
|
className: "indicator",
|
|
@@ -3431,7 +3523,7 @@ Spinner.displayName = "Spinner";
|
|
|
3431
3523
|
var Spinner_default = Spinner;
|
|
3432
3524
|
|
|
3433
3525
|
// src/components/Steps/Steps.tsx
|
|
3434
|
-
var
|
|
3526
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
3435
3527
|
var Steps = (props) => {
|
|
3436
3528
|
const {
|
|
3437
3529
|
items,
|
|
@@ -3446,16 +3538,16 @@ var Steps = (props) => {
|
|
|
3446
3538
|
color,
|
|
3447
3539
|
colorDepth ?? 500
|
|
3448
3540
|
);
|
|
3449
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("div", { className: clsx_default("lib-xplat-steps", className), children: items.map((item, index) => {
|
|
3450
3542
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
3451
|
-
return /* @__PURE__ */ (0,
|
|
3452
|
-
/* @__PURE__ */ (0,
|
|
3453
|
-
/* @__PURE__ */ (0,
|
|
3454
|
-
index < items.length - 1 && /* @__PURE__ */ (0,
|
|
3543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("div", { className: clsx_default("step-item", status), children: [
|
|
3544
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("div", { className: "step-indicator", children: [
|
|
3545
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)("div", { className: clsx_default("step-circle", colorClass), children: status === "completed" ? /* @__PURE__ */ (0, import_jsx_runtime331.jsx)(CheckIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("span", { children: index + 1 }) }),
|
|
3546
|
+
index < items.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("div", { className: clsx_default("step-line", colorClass) })
|
|
3455
3547
|
] }),
|
|
3456
|
-
/* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3458
|
-
item.description && /* @__PURE__ */ (0,
|
|
3548
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsxs)("div", { className: "step-content", children: [
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime331.jsx)("span", { className: "step-title", children: item.title }),
|
|
3550
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("span", { className: "step-description", children: item.description })
|
|
3459
3551
|
] })
|
|
3460
3552
|
] }, index);
|
|
3461
3553
|
}) });
|
|
@@ -3464,8 +3556,8 @@ Steps.displayName = "Steps";
|
|
|
3464
3556
|
var Steps_default = Steps;
|
|
3465
3557
|
|
|
3466
3558
|
// src/components/Switch/Switch.tsx
|
|
3467
|
-
var
|
|
3468
|
-
var
|
|
3559
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3560
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
3469
3561
|
var KNOB_TRANSITION_MS = 250;
|
|
3470
3562
|
var Switch = (props) => {
|
|
3471
3563
|
const {
|
|
@@ -3478,9 +3570,9 @@ var Switch = (props) => {
|
|
|
3478
3570
|
colorDepth,
|
|
3479
3571
|
className
|
|
3480
3572
|
} = props;
|
|
3481
|
-
const [isAnimating, setIsAnimating] =
|
|
3482
|
-
const timeoutRef =
|
|
3483
|
-
|
|
3573
|
+
const [isAnimating, setIsAnimating] = import_react24.default.useState(false);
|
|
3574
|
+
const timeoutRef = import_react24.default.useRef(null);
|
|
3575
|
+
import_react24.default.useEffect(() => {
|
|
3484
3576
|
return () => {
|
|
3485
3577
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3486
3578
|
};
|
|
@@ -3500,7 +3592,7 @@ var Switch = (props) => {
|
|
|
3500
3592
|
color,
|
|
3501
3593
|
colorDepth ?? 500
|
|
3502
3594
|
);
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
3504
3596
|
"div",
|
|
3505
3597
|
{
|
|
3506
3598
|
className: clsx_default(
|
|
@@ -3514,7 +3606,7 @@ var Switch = (props) => {
|
|
|
3514
3606
|
),
|
|
3515
3607
|
onClick: handleClick,
|
|
3516
3608
|
"aria-disabled": disabled || isAnimating,
|
|
3517
|
-
children: /* @__PURE__ */ (0,
|
|
3609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
3518
3610
|
}
|
|
3519
3611
|
);
|
|
3520
3612
|
};
|
|
@@ -3522,14 +3614,14 @@ Switch.displayName = "Switch";
|
|
|
3522
3614
|
var Switch_default = Switch;
|
|
3523
3615
|
|
|
3524
3616
|
// src/components/Tab/Tab.tsx
|
|
3525
|
-
var
|
|
3617
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
3526
3618
|
|
|
3527
3619
|
// src/components/Tab/TabItem.tsx
|
|
3528
|
-
var
|
|
3529
|
-
var
|
|
3530
|
-
var TabItem =
|
|
3620
|
+
var import_react25 = __toESM(require("react"), 1);
|
|
3621
|
+
var import_jsx_runtime333 = require("react/jsx-runtime");
|
|
3622
|
+
var TabItem = import_react25.default.forwardRef((props, ref) => {
|
|
3531
3623
|
const { isActive, title, onClick } = props;
|
|
3532
|
-
return /* @__PURE__ */ (0,
|
|
3624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
3533
3625
|
"div",
|
|
3534
3626
|
{
|
|
3535
3627
|
ref,
|
|
@@ -3543,25 +3635,25 @@ TabItem.displayName = "TabItem";
|
|
|
3543
3635
|
var TabItem_default = TabItem;
|
|
3544
3636
|
|
|
3545
3637
|
// src/components/Tab/Tab.tsx
|
|
3546
|
-
var
|
|
3638
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
3547
3639
|
var Tab = (props) => {
|
|
3548
|
-
const { activeIndex, onChange, tabs, type } = props;
|
|
3549
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3640
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3641
|
+
const [underlineStyle, setUnderlineStyle] = import_react26.default.useState({
|
|
3550
3642
|
left: 0,
|
|
3551
3643
|
width: 0
|
|
3552
3644
|
});
|
|
3553
|
-
const itemRefs =
|
|
3645
|
+
const itemRefs = import_react26.default.useRef([]);
|
|
3554
3646
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3555
3647
|
onChange(tabItem, tabIdx);
|
|
3556
3648
|
};
|
|
3557
|
-
|
|
3649
|
+
import_react26.default.useEffect(() => {
|
|
3558
3650
|
const el = itemRefs.current[activeIndex];
|
|
3559
3651
|
if (el) {
|
|
3560
3652
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3561
3653
|
}
|
|
3562
3654
|
}, [activeIndex, tabs.length]);
|
|
3563
|
-
return /* @__PURE__ */ (0,
|
|
3564
|
-
tabs.map((tab, idx) => /* @__PURE__ */ (0,
|
|
3655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime334.jsxs)("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3656
|
+
tabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
3565
3657
|
TabItem_default,
|
|
3566
3658
|
{
|
|
3567
3659
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3573,7 +3665,7 @@ var Tab = (props) => {
|
|
|
3573
3665
|
},
|
|
3574
3666
|
`${tab.value}_${idx}`
|
|
3575
3667
|
)),
|
|
3576
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
3668
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
3577
3669
|
"div",
|
|
3578
3670
|
{
|
|
3579
3671
|
className: "tab-toggle-underline",
|
|
@@ -3589,17 +3681,17 @@ Tab.displayName = "Tab";
|
|
|
3589
3681
|
var Tab_default = Tab;
|
|
3590
3682
|
|
|
3591
3683
|
// src/components/Table/TableContext.tsx
|
|
3592
|
-
var
|
|
3593
|
-
var TableContext =
|
|
3684
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
3685
|
+
var TableContext = import_react27.default.createContext(null);
|
|
3594
3686
|
var useTableContext = () => {
|
|
3595
|
-
const ctx =
|
|
3687
|
+
const ctx = import_react27.default.useContext(TableContext);
|
|
3596
3688
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3597
3689
|
return ctx;
|
|
3598
3690
|
};
|
|
3599
3691
|
var TableContext_default = TableContext;
|
|
3600
3692
|
|
|
3601
3693
|
// src/components/Table/Table.tsx
|
|
3602
|
-
var
|
|
3694
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
3603
3695
|
var Table = (props) => {
|
|
3604
3696
|
const {
|
|
3605
3697
|
className,
|
|
@@ -3609,7 +3701,7 @@ var Table = (props) => {
|
|
|
3609
3701
|
headerSticky = false,
|
|
3610
3702
|
stickyShadow = true
|
|
3611
3703
|
} = props;
|
|
3612
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)(
|
|
3613
3705
|
TableContext_default.Provider,
|
|
3614
3706
|
{
|
|
3615
3707
|
value: {
|
|
@@ -3618,7 +3710,7 @@ var Table = (props) => {
|
|
|
3618
3710
|
headerSticky,
|
|
3619
3711
|
stickyShadow
|
|
3620
3712
|
},
|
|
3621
|
-
children: /* @__PURE__ */ (0,
|
|
3713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("table", { className: "lib-xplat-table", children })
|
|
3622
3714
|
}
|
|
3623
3715
|
) });
|
|
3624
3716
|
};
|
|
@@ -3626,40 +3718,40 @@ Table.displayName = "Table";
|
|
|
3626
3718
|
var Table_default = Table;
|
|
3627
3719
|
|
|
3628
3720
|
// src/components/Table/TableBody.tsx
|
|
3629
|
-
var
|
|
3721
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
3630
3722
|
var TableBody = (props) => {
|
|
3631
3723
|
const { children, className } = props;
|
|
3632
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("tbody", { className, children });
|
|
3633
3725
|
};
|
|
3634
3726
|
TableBody.displayName = "TableBody";
|
|
3635
3727
|
var TableBody_default = TableBody;
|
|
3636
3728
|
|
|
3637
3729
|
// src/components/Table/TableCell.tsx
|
|
3638
|
-
var
|
|
3730
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
3639
3731
|
|
|
3640
3732
|
// src/components/Table/TableHeadContext.tsx
|
|
3641
|
-
var
|
|
3642
|
-
var TableHeadContext =
|
|
3733
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
3734
|
+
var TableHeadContext = import_react28.default.createContext(
|
|
3643
3735
|
null
|
|
3644
3736
|
);
|
|
3645
3737
|
var useTableHeadContext = () => {
|
|
3646
|
-
const ctx =
|
|
3738
|
+
const ctx = import_react28.default.useContext(TableHeadContext);
|
|
3647
3739
|
return ctx;
|
|
3648
3740
|
};
|
|
3649
3741
|
var TableHeadContext_default = TableHeadContext;
|
|
3650
3742
|
|
|
3651
3743
|
// src/components/Table/TableRowContext.tsx
|
|
3652
|
-
var
|
|
3653
|
-
var TableRowContext =
|
|
3744
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
3745
|
+
var TableRowContext = import_react29.default.createContext(null);
|
|
3654
3746
|
var useTableRowContext = () => {
|
|
3655
|
-
const ctx =
|
|
3747
|
+
const ctx = import_react29.default.useContext(TableRowContext);
|
|
3656
3748
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3657
3749
|
return ctx;
|
|
3658
3750
|
};
|
|
3659
3751
|
var TableRowContext_default = TableRowContext;
|
|
3660
3752
|
|
|
3661
3753
|
// src/components/Table/TableCell.tsx
|
|
3662
|
-
var
|
|
3754
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
3663
3755
|
var TableCell = (props) => {
|
|
3664
3756
|
const {
|
|
3665
3757
|
children,
|
|
@@ -3671,9 +3763,9 @@ var TableCell = (props) => {
|
|
|
3671
3763
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
3672
3764
|
const { stickyShadow } = useTableContext();
|
|
3673
3765
|
const headContext = useTableHeadContext();
|
|
3674
|
-
const [left, setLeft] =
|
|
3675
|
-
const cellRef =
|
|
3676
|
-
const calculateLeft =
|
|
3766
|
+
const [left, setLeft] = import_react30.default.useState(0);
|
|
3767
|
+
const cellRef = import_react30.default.useRef(null);
|
|
3768
|
+
const calculateLeft = import_react30.default.useCallback(() => {
|
|
3677
3769
|
if (!cellRef.current) return 0;
|
|
3678
3770
|
let totalLeft = 0;
|
|
3679
3771
|
for (const ref of stickyCells) {
|
|
@@ -3682,7 +3774,7 @@ var TableCell = (props) => {
|
|
|
3682
3774
|
}
|
|
3683
3775
|
return totalLeft;
|
|
3684
3776
|
}, [stickyCells]);
|
|
3685
|
-
|
|
3777
|
+
import_react30.default.useEffect(() => {
|
|
3686
3778
|
if (!isSticky || !cellRef.current) return;
|
|
3687
3779
|
registerStickyCell(cellRef);
|
|
3688
3780
|
setLeft(calculateLeft());
|
|
@@ -3700,7 +3792,7 @@ var TableCell = (props) => {
|
|
|
3700
3792
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
3701
3793
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
3702
3794
|
const enableHover = headContext && headContext.cellHover;
|
|
3703
|
-
return /* @__PURE__ */ (0,
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
3704
3796
|
CellTag,
|
|
3705
3797
|
{
|
|
3706
3798
|
ref: cellRef,
|
|
@@ -3722,21 +3814,21 @@ TableCell.displayName = "TableCell";
|
|
|
3722
3814
|
var TableCell_default = TableCell;
|
|
3723
3815
|
|
|
3724
3816
|
// src/components/Table/TableHead.tsx
|
|
3725
|
-
var
|
|
3817
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
3726
3818
|
var TableHead = ({
|
|
3727
3819
|
children,
|
|
3728
3820
|
className = "",
|
|
3729
3821
|
cellHover = false
|
|
3730
3822
|
}) => {
|
|
3731
3823
|
const { headerSticky } = useTableContext();
|
|
3732
|
-
return /* @__PURE__ */ (0,
|
|
3824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime338.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime338.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null, className), children }) });
|
|
3733
3825
|
};
|
|
3734
3826
|
TableHead.displayName = "TableHead";
|
|
3735
3827
|
var TableHead_default = TableHead;
|
|
3736
3828
|
|
|
3737
3829
|
// src/components/Table/TableRow.tsx
|
|
3738
|
-
var
|
|
3739
|
-
var
|
|
3830
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3831
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
3740
3832
|
var TableRow = (props) => {
|
|
3741
3833
|
const {
|
|
3742
3834
|
children,
|
|
@@ -3749,7 +3841,7 @@ var TableRow = (props) => {
|
|
|
3749
3841
|
onClick
|
|
3750
3842
|
} = props;
|
|
3751
3843
|
const { rowBorderUse } = useTableContext();
|
|
3752
|
-
const [stickyCells, setStickyCells] =
|
|
3844
|
+
const [stickyCells, setStickyCells] = import_react31.default.useState([]);
|
|
3753
3845
|
const registerStickyCell = (ref) => {
|
|
3754
3846
|
setStickyCells((prev) => {
|
|
3755
3847
|
if (prev.includes(ref)) return prev;
|
|
@@ -3761,7 +3853,7 @@ var TableRow = (props) => {
|
|
|
3761
3853
|
color,
|
|
3762
3854
|
colorDepth ?? 500
|
|
3763
3855
|
);
|
|
3764
|
-
return /* @__PURE__ */ (0,
|
|
3856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
3765
3857
|
"tr",
|
|
3766
3858
|
{
|
|
3767
3859
|
className: clsx_default(
|
|
@@ -3781,11 +3873,12 @@ TableRow.displayName = "TableRow";
|
|
|
3781
3873
|
var TableRow_default = TableRow;
|
|
3782
3874
|
|
|
3783
3875
|
// src/components/Tag/Tag.tsx
|
|
3784
|
-
var
|
|
3876
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
3785
3877
|
var Tag = (props) => {
|
|
3786
3878
|
const {
|
|
3787
3879
|
children,
|
|
3788
3880
|
onClose,
|
|
3881
|
+
size = "md",
|
|
3789
3882
|
colorNamespace = "xplat",
|
|
3790
3883
|
color = "neutral",
|
|
3791
3884
|
colorDepth,
|
|
@@ -3796,21 +3889,21 @@ var Tag = (props) => {
|
|
|
3796
3889
|
color,
|
|
3797
3890
|
colorDepth ?? 500
|
|
3798
3891
|
);
|
|
3799
|
-
return /* @__PURE__ */ (0,
|
|
3800
|
-
/* @__PURE__ */ (0,
|
|
3801
|
-
onClose && /* @__PURE__ */ (0,
|
|
3892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime340.jsxs)("span", { className: clsx_default("lib-xplat-tag", size, colorClass, className), children: [
|
|
3893
|
+
/* @__PURE__ */ (0, import_jsx_runtime340.jsx)("span", { className: "tag-label", children }),
|
|
3894
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime340.jsx)("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ (0, import_jsx_runtime340.jsx)(XIcon_default, {}) })
|
|
3802
3895
|
] });
|
|
3803
3896
|
};
|
|
3804
3897
|
Tag.displayName = "Tag";
|
|
3805
3898
|
var Tag_default = Tag;
|
|
3806
3899
|
|
|
3807
3900
|
// src/components/TextArea/TextArea.tsx
|
|
3808
|
-
var
|
|
3809
|
-
var
|
|
3810
|
-
var TextArea =
|
|
3901
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
3902
|
+
var import_jsx_runtime341 = require("react/jsx-runtime");
|
|
3903
|
+
var TextArea = import_react32.default.forwardRef(
|
|
3811
3904
|
(props, ref) => {
|
|
3812
3905
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
3813
|
-
const localRef =
|
|
3906
|
+
const localRef = import_react32.default.useRef(null);
|
|
3814
3907
|
const setRefs = (el) => {
|
|
3815
3908
|
localRef.current = el;
|
|
3816
3909
|
if (!ref) return;
|
|
@@ -3830,21 +3923,21 @@ var TextArea = import_react31.default.forwardRef(
|
|
|
3830
3923
|
onChange(event);
|
|
3831
3924
|
}
|
|
3832
3925
|
};
|
|
3833
|
-
|
|
3926
|
+
import_react32.default.useEffect(() => {
|
|
3834
3927
|
const el = localRef.current;
|
|
3835
3928
|
if (!el) return;
|
|
3836
3929
|
el.style.height = "0px";
|
|
3837
3930
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
3838
3931
|
el.style.height = `${nextHeight}px`;
|
|
3839
3932
|
}, [value]);
|
|
3840
|
-
return /* @__PURE__ */ (0,
|
|
3933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime341.jsx)("div", { className: clsx_default("lib-xplat-textarea-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
3841
3934
|
"div",
|
|
3842
3935
|
{
|
|
3843
3936
|
className: clsx_default(
|
|
3844
3937
|
"lib-xplat-textarea",
|
|
3845
3938
|
disabled ? "disabled" : void 0
|
|
3846
3939
|
),
|
|
3847
|
-
children: /* @__PURE__ */ (0,
|
|
3940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
3848
3941
|
"textarea",
|
|
3849
3942
|
{
|
|
3850
3943
|
...textareaProps,
|
|
@@ -3862,25 +3955,25 @@ TextArea.displayName = "TextArea";
|
|
|
3862
3955
|
var TextArea_default = TextArea;
|
|
3863
3956
|
|
|
3864
3957
|
// src/components/Toast/Toast.tsx
|
|
3865
|
-
var
|
|
3958
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
3866
3959
|
var import_react_dom3 = require("react-dom");
|
|
3867
|
-
var
|
|
3868
|
-
var ToastContext =
|
|
3960
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
3961
|
+
var ToastContext = import_react33.default.createContext(null);
|
|
3869
3962
|
var useToast = () => {
|
|
3870
|
-
const ctx =
|
|
3963
|
+
const ctx = import_react33.default.useContext(ToastContext);
|
|
3871
3964
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
3872
3965
|
return ctx;
|
|
3873
3966
|
};
|
|
3874
3967
|
var EXIT_DURATION = 300;
|
|
3875
3968
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
3876
|
-
const ref =
|
|
3877
|
-
const [height, setHeight] =
|
|
3878
|
-
|
|
3969
|
+
const ref = import_react33.default.useRef(null);
|
|
3970
|
+
const [height, setHeight] = import_react33.default.useState(void 0);
|
|
3971
|
+
import_react33.default.useEffect(() => {
|
|
3879
3972
|
if (ref.current && !isExiting) {
|
|
3880
3973
|
setHeight(ref.current.offsetHeight);
|
|
3881
3974
|
}
|
|
3882
3975
|
}, [isExiting]);
|
|
3883
|
-
return /* @__PURE__ */ (0,
|
|
3976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
3884
3977
|
"div",
|
|
3885
3978
|
{
|
|
3886
3979
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -3888,15 +3981,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
3888
3981
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
3889
3982
|
marginBottom: isExiting ? 0 : void 0
|
|
3890
3983
|
},
|
|
3891
|
-
children: /* @__PURE__ */ (0,
|
|
3984
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(
|
|
3892
3985
|
"div",
|
|
3893
3986
|
{
|
|
3894
3987
|
ref,
|
|
3895
3988
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
3896
3989
|
role: "alert",
|
|
3897
3990
|
children: [
|
|
3898
|
-
/* @__PURE__ */ (0,
|
|
3899
|
-
/* @__PURE__ */ (0,
|
|
3991
|
+
/* @__PURE__ */ (0, import_jsx_runtime342.jsx)("span", { className: "message", children: item.message }),
|
|
3992
|
+
/* @__PURE__ */ (0, import_jsx_runtime342.jsx)("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3900
3993
|
]
|
|
3901
3994
|
}
|
|
3902
3995
|
)
|
|
@@ -3907,13 +4000,13 @@ var ToastProvider = ({
|
|
|
3907
4000
|
children,
|
|
3908
4001
|
position = "top-right"
|
|
3909
4002
|
}) => {
|
|
3910
|
-
const [toasts, setToasts] =
|
|
3911
|
-
const [removing, setRemoving] =
|
|
3912
|
-
const [mounted, setMounted] =
|
|
3913
|
-
|
|
4003
|
+
const [toasts, setToasts] = import_react33.default.useState([]);
|
|
4004
|
+
const [removing, setRemoving] = import_react33.default.useState(/* @__PURE__ */ new Set());
|
|
4005
|
+
const [mounted, setMounted] = import_react33.default.useState(false);
|
|
4006
|
+
import_react33.default.useEffect(() => {
|
|
3914
4007
|
setMounted(true);
|
|
3915
4008
|
}, []);
|
|
3916
|
-
const remove =
|
|
4009
|
+
const remove = import_react33.default.useCallback((id) => {
|
|
3917
4010
|
setRemoving((prev) => new Set(prev).add(id));
|
|
3918
4011
|
setTimeout(() => {
|
|
3919
4012
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -3924,7 +4017,7 @@ var ToastProvider = ({
|
|
|
3924
4017
|
});
|
|
3925
4018
|
}, EXIT_DURATION);
|
|
3926
4019
|
}, []);
|
|
3927
|
-
const toast =
|
|
4020
|
+
const toast = import_react33.default.useCallback(
|
|
3928
4021
|
(type, message, duration = 3e3) => {
|
|
3929
4022
|
const id = `${Date.now()}-${Math.random()}`;
|
|
3930
4023
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -3934,10 +4027,10 @@ var ToastProvider = ({
|
|
|
3934
4027
|
},
|
|
3935
4028
|
[remove]
|
|
3936
4029
|
);
|
|
3937
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
3938
4031
|
children,
|
|
3939
4032
|
mounted && (0, import_react_dom3.createPortal)(
|
|
3940
|
-
/* @__PURE__ */ (0,
|
|
4033
|
+
/* @__PURE__ */ (0, import_jsx_runtime342.jsx)("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
3941
4034
|
ToastItemComponent,
|
|
3942
4035
|
{
|
|
3943
4036
|
item: t,
|
|
@@ -3953,8 +4046,8 @@ var ToastProvider = ({
|
|
|
3953
4046
|
ToastProvider.displayName = "ToastProvider";
|
|
3954
4047
|
|
|
3955
4048
|
// src/components/Tooltip/Tooltip.tsx
|
|
3956
|
-
var
|
|
3957
|
-
var
|
|
4049
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
4050
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
3958
4051
|
var Tooltip2 = (props) => {
|
|
3959
4052
|
const {
|
|
3960
4053
|
type = "primary",
|
|
@@ -3964,24 +4057,24 @@ var Tooltip2 = (props) => {
|
|
|
3964
4057
|
description,
|
|
3965
4058
|
children
|
|
3966
4059
|
} = props;
|
|
3967
|
-
const iconRef =
|
|
4060
|
+
const iconRef = import_react34.default.useRef(null);
|
|
3968
4061
|
const colorClass = getColorClass(
|
|
3969
4062
|
colorNamespace,
|
|
3970
4063
|
color,
|
|
3971
4064
|
colorDepth ?? 500
|
|
3972
4065
|
);
|
|
3973
|
-
return /* @__PURE__ */ (0,
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime343.jsxs)("div", { className: "lib-xplat-tooltip", children: [
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsx)("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime343.jsx)("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
3976
4069
|
] });
|
|
3977
4070
|
};
|
|
3978
4071
|
Tooltip2.displayName = "Tooltip";
|
|
3979
4072
|
var Tooltip_default = Tooltip2;
|
|
3980
4073
|
|
|
3981
4074
|
// src/components/Video/Video.tsx
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
3984
|
-
var Video =
|
|
4075
|
+
var import_react35 = __toESM(require("react"), 1);
|
|
4076
|
+
var import_jsx_runtime344 = require("react/jsx-runtime");
|
|
4077
|
+
var Video = import_react35.default.forwardRef((props, ref) => {
|
|
3985
4078
|
const {
|
|
3986
4079
|
src,
|
|
3987
4080
|
poster,
|
|
@@ -3995,10 +4088,10 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
3995
4088
|
onPause,
|
|
3996
4089
|
...rest
|
|
3997
4090
|
} = props;
|
|
3998
|
-
const videoRef =
|
|
3999
|
-
const [isPlaying, setIsPlaying] =
|
|
4000
|
-
const [isLoaded, setIsLoaded] =
|
|
4001
|
-
const setRefs =
|
|
4091
|
+
const videoRef = import_react35.default.useRef(null);
|
|
4092
|
+
const [isPlaying, setIsPlaying] = import_react35.default.useState(Boolean(autoPlay));
|
|
4093
|
+
const [isLoaded, setIsLoaded] = import_react35.default.useState(false);
|
|
4094
|
+
const setRefs = import_react35.default.useCallback(
|
|
4002
4095
|
(el) => {
|
|
4003
4096
|
videoRef.current = el;
|
|
4004
4097
|
if (typeof ref === "function") ref(el);
|
|
@@ -4026,7 +4119,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4026
4119
|
}
|
|
4027
4120
|
};
|
|
4028
4121
|
const showCustomOverlay = !controls;
|
|
4029
|
-
return /* @__PURE__ */ (0,
|
|
4122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(
|
|
4030
4123
|
"div",
|
|
4031
4124
|
{
|
|
4032
4125
|
className: clsx_default(
|
|
@@ -4035,7 +4128,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4035
4128
|
className
|
|
4036
4129
|
),
|
|
4037
4130
|
children: [
|
|
4038
|
-
/* @__PURE__ */ (0,
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
4039
4132
|
"video",
|
|
4040
4133
|
{
|
|
4041
4134
|
ref: setRefs,
|
|
@@ -4052,7 +4145,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4052
4145
|
...rest
|
|
4053
4146
|
}
|
|
4054
4147
|
),
|
|
4055
|
-
showCustomOverlay && /* @__PURE__ */ (0,
|
|
4148
|
+
showCustomOverlay && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
4056
4149
|
"button",
|
|
4057
4150
|
{
|
|
4058
4151
|
type: "button",
|
|
@@ -4063,7 +4156,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4063
4156
|
),
|
|
4064
4157
|
onClick: togglePlay,
|
|
4065
4158
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
4066
|
-
children: isPlaying ? /* @__PURE__ */ (0,
|
|
4159
|
+
children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(PauseIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime344.jsx)("span", { className: "play-icon", children: /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(PlayCircleIcon_default, {}) })
|
|
4067
4160
|
}
|
|
4068
4161
|
)
|
|
4069
4162
|
]
|
|
@@ -4081,6 +4174,7 @@ var Video_default = Video;
|
|
|
4081
4174
|
Breadcrumb,
|
|
4082
4175
|
Button,
|
|
4083
4176
|
Card,
|
|
4177
|
+
CardTab,
|
|
4084
4178
|
Chart,
|
|
4085
4179
|
CheckBox,
|
|
4086
4180
|
Chip,
|