@x-plat/design-system 0.1.4 → 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 +21 -9
- package/dist/components/Select/index.css +38 -18
- package/dist/components/Select/index.d.cts +5 -0
- package/dist/components/Select/index.d.ts +5 -0
- package/dist/components/Select/index.js +21 -9
- 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 +3 -1
- package/dist/components/Switch/index.css +41 -751
- package/dist/components/Switch/index.d.cts +4 -118
- package/dist/components/Switch/index.d.ts +4 -118
- package/dist/components/Switch/index.js +3 -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 +456 -350
- package/dist/components/index.css +1278 -12612
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +454 -349
- package/dist/index.cjs +481 -374
- package/dist/index.css +1281 -12615
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +481 -373
- 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,29 +2847,38 @@ 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 {
|
|
2768
2854
|
placeholder = "\uC120\uD0DD\uD558\uC138\uC694",
|
|
2855
|
+
value: valueProp,
|
|
2769
2856
|
onChange,
|
|
2770
2857
|
children,
|
|
2771
2858
|
disabled = false,
|
|
2772
|
-
error = false
|
|
2859
|
+
error = false,
|
|
2860
|
+
size = "md"
|
|
2773
2861
|
} = props;
|
|
2774
|
-
const itemChildren =
|
|
2775
|
-
(child) =>
|
|
2862
|
+
const itemChildren = import_react18.default.Children.toArray(children).filter(
|
|
2863
|
+
(child) => import_react18.default.isValidElement(child) && child.type === SelectItem_default
|
|
2776
2864
|
);
|
|
2777
|
-
const
|
|
2778
|
-
const [
|
|
2779
|
-
const
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2865
|
+
const isControlled = valueProp !== void 0;
|
|
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(() => {
|
|
2869
|
+
if (!isControlled) return null;
|
|
2870
|
+
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
2871
|
+
return match ? match.props.children : null;
|
|
2872
|
+
}, [isControlled, valueProp, itemChildren]);
|
|
2873
|
+
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
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(() => {
|
|
2784
2879
|
if (disabled && isOpen) setOpen(false);
|
|
2785
2880
|
}, [disabled, isOpen]);
|
|
2786
|
-
|
|
2881
|
+
import_react18.default.useEffect(() => {
|
|
2787
2882
|
if (isOpen) {
|
|
2788
2883
|
setMounted(true);
|
|
2789
2884
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2793,19 +2888,21 @@ var SelectRoot = (props) => {
|
|
|
2793
2888
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
2794
2889
|
return () => clearTimeout(t);
|
|
2795
2890
|
}, [isOpen]);
|
|
2796
|
-
const open =
|
|
2797
|
-
const close =
|
|
2798
|
-
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), []);
|
|
2799
2894
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
2800
2895
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
2801
|
-
const setSelected =
|
|
2802
|
-
(label,
|
|
2803
|
-
|
|
2804
|
-
|
|
2896
|
+
const setSelected = import_react18.default.useCallback(
|
|
2897
|
+
(label, itemValue) => {
|
|
2898
|
+
if (!isControlled) {
|
|
2899
|
+
setUncontrolledLabel(label);
|
|
2900
|
+
}
|
|
2901
|
+
onChange?.(itemValue, label);
|
|
2805
2902
|
},
|
|
2806
|
-
[onChange]
|
|
2903
|
+
[isControlled, onChange]
|
|
2807
2904
|
);
|
|
2808
|
-
const
|
|
2905
|
+
const ctxValue = import_react18.default.useMemo(
|
|
2809
2906
|
() => ({
|
|
2810
2907
|
isOpen,
|
|
2811
2908
|
mounted,
|
|
@@ -2826,17 +2923,18 @@ var SelectRoot = (props) => {
|
|
|
2826
2923
|
if (disabled) return;
|
|
2827
2924
|
toggle();
|
|
2828
2925
|
};
|
|
2829
|
-
return /* @__PURE__ */ (0,
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
2830
2927
|
"div",
|
|
2831
2928
|
{
|
|
2832
2929
|
className: clsx_default(
|
|
2833
2930
|
"lib-xplat-select",
|
|
2931
|
+
size,
|
|
2834
2932
|
disabled && "disabled",
|
|
2835
2933
|
error && "error",
|
|
2836
2934
|
mounted && "is-open"
|
|
2837
2935
|
),
|
|
2838
2936
|
children: [
|
|
2839
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsxs)(
|
|
2840
2938
|
"div",
|
|
2841
2939
|
{
|
|
2842
2940
|
ref: triggerRef,
|
|
@@ -2860,7 +2958,7 @@ var SelectRoot = (props) => {
|
|
|
2860
2958
|
}
|
|
2861
2959
|
},
|
|
2862
2960
|
children: [
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2864
2962
|
"span",
|
|
2865
2963
|
{
|
|
2866
2964
|
className: clsx_default(
|
|
@@ -2870,18 +2968,18 @@ var SelectRoot = (props) => {
|
|
|
2870
2968
|
children: selectedLabel ?? placeholder
|
|
2871
2969
|
}
|
|
2872
2970
|
),
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2971
|
+
/* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2874
2972
|
"span",
|
|
2875
2973
|
{
|
|
2876
2974
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
2877
2975
|
"aria-hidden": true,
|
|
2878
|
-
children: /* @__PURE__ */ (0,
|
|
2976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(ChevronDownIcon_default, {})
|
|
2879
2977
|
}
|
|
2880
2978
|
)
|
|
2881
2979
|
]
|
|
2882
2980
|
}
|
|
2883
2981
|
),
|
|
2884
|
-
mounted && /* @__PURE__ */ (0,
|
|
2982
|
+
mounted && /* @__PURE__ */ (0, import_jsx_runtime321.jsx)(
|
|
2885
2983
|
"div",
|
|
2886
2984
|
{
|
|
2887
2985
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -2902,10 +3000,10 @@ var Select = Object.assign(SelectRoot, {
|
|
|
2902
3000
|
var Select_default = Select;
|
|
2903
3001
|
|
|
2904
3002
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
2905
|
-
var
|
|
3003
|
+
var import_react20 = __toESM(require("react"), 1);
|
|
2906
3004
|
|
|
2907
3005
|
// src/components/HtmlTypeWriter/utils.ts
|
|
2908
|
-
var
|
|
3006
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
2909
3007
|
var voidTags = /* @__PURE__ */ new Set([
|
|
2910
3008
|
"br",
|
|
2911
3009
|
"img",
|
|
@@ -2973,40 +3071,40 @@ function convertNodeToReactWithRange(node, typedLen, rangeMap) {
|
|
|
2973
3071
|
props[attr.name] = attr.value;
|
|
2974
3072
|
});
|
|
2975
3073
|
if (voidTags.has(tag)) {
|
|
2976
|
-
return
|
|
3074
|
+
return import_react19.default.createElement(tag, props);
|
|
2977
3075
|
}
|
|
2978
3076
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
2979
|
-
return
|
|
3077
|
+
return import_react19.default.createElement(tag, props, ...children);
|
|
2980
3078
|
}
|
|
2981
3079
|
function htmlToReactProgressive(root, typedLen, rangeMap) {
|
|
2982
3080
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
2983
3081
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
2984
|
-
return node == null ? null :
|
|
3082
|
+
return node == null ? null : import_react19.default.createElement(import_react19.default.Fragment, { key: idx }, node);
|
|
2985
3083
|
}).filter(Boolean);
|
|
2986
3084
|
return nodes.length === 0 ? null : nodes;
|
|
2987
3085
|
}
|
|
2988
3086
|
|
|
2989
3087
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
2990
|
-
var
|
|
3088
|
+
var import_jsx_runtime322 = require("react/jsx-runtime");
|
|
2991
3089
|
var HtmlTypeWriter = ({
|
|
2992
3090
|
html,
|
|
2993
3091
|
duration = 20,
|
|
2994
3092
|
onDone,
|
|
2995
3093
|
onChange
|
|
2996
3094
|
}) => {
|
|
2997
|
-
const [typedLen, setTypedLen] =
|
|
2998
|
-
const doneCalledRef =
|
|
2999
|
-
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(() => {
|
|
3000
3098
|
const decoded = decodeHtmlEntities(html);
|
|
3001
3099
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
3002
3100
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
3003
3101
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
3004
3102
|
}, [html]);
|
|
3005
|
-
|
|
3103
|
+
import_react20.default.useEffect(() => {
|
|
3006
3104
|
setTypedLen(0);
|
|
3007
3105
|
doneCalledRef.current = false;
|
|
3008
3106
|
}, [html]);
|
|
3009
|
-
|
|
3107
|
+
import_react20.default.useEffect(() => {
|
|
3010
3108
|
if (!totalLength) return;
|
|
3011
3109
|
if (typedLen >= totalLength) return;
|
|
3012
3110
|
const timer = window.setInterval(() => {
|
|
@@ -3014,33 +3112,33 @@ var HtmlTypeWriter = ({
|
|
|
3014
3112
|
}, duration);
|
|
3015
3113
|
return () => window.clearInterval(timer);
|
|
3016
3114
|
}, [typedLen, totalLength, duration]);
|
|
3017
|
-
|
|
3115
|
+
import_react20.default.useEffect(() => {
|
|
3018
3116
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
3019
3117
|
onChange?.();
|
|
3020
3118
|
}
|
|
3021
3119
|
}, [typedLen, totalLength, onChange]);
|
|
3022
|
-
|
|
3120
|
+
import_react20.default.useEffect(() => {
|
|
3023
3121
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
3024
3122
|
doneCalledRef.current = true;
|
|
3025
3123
|
onDone?.();
|
|
3026
3124
|
}
|
|
3027
3125
|
}, [typedLen, totalLength, onDone]);
|
|
3028
|
-
const parsed =
|
|
3126
|
+
const parsed = import_react20.default.useMemo(
|
|
3029
3127
|
() => htmlToReactProgressive(doc.body, typedLen, rangeMap),
|
|
3030
3128
|
[doc.body, typedLen, rangeMap]
|
|
3031
3129
|
);
|
|
3032
|
-
return /* @__PURE__ */ (0,
|
|
3130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
3033
3131
|
};
|
|
3034
3132
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
3035
3133
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
3036
3134
|
|
|
3037
3135
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
3038
|
-
var
|
|
3039
|
-
var
|
|
3136
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
3137
|
+
var import_jsx_runtime323 = require("react/jsx-runtime");
|
|
3040
3138
|
var ImageSelector = (props) => {
|
|
3041
3139
|
const { value, label, onChange } = props;
|
|
3042
|
-
const [previewUrl, setPreviewUrl] =
|
|
3043
|
-
|
|
3140
|
+
const [previewUrl, setPreviewUrl] = import_react21.default.useState();
|
|
3141
|
+
import_react21.default.useEffect(() => {
|
|
3044
3142
|
if (!value) {
|
|
3045
3143
|
setPreviewUrl(void 0);
|
|
3046
3144
|
return;
|
|
@@ -3049,7 +3147,7 @@ var ImageSelector = (props) => {
|
|
|
3049
3147
|
setPreviewUrl(url);
|
|
3050
3148
|
return () => URL.revokeObjectURL(url);
|
|
3051
3149
|
}, [value]);
|
|
3052
|
-
const inputRef =
|
|
3150
|
+
const inputRef = import_react21.default.useRef(null);
|
|
3053
3151
|
const handleFileChange = (e) => {
|
|
3054
3152
|
const selectedFile = e.target.files?.[0];
|
|
3055
3153
|
if (selectedFile) {
|
|
@@ -3062,8 +3160,8 @@ var ImageSelector = (props) => {
|
|
|
3062
3160
|
const handleOpenFileDialog = () => {
|
|
3063
3161
|
inputRef.current?.click();
|
|
3064
3162
|
};
|
|
3065
|
-
return /* @__PURE__ */ (0,
|
|
3066
|
-
/* @__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)(
|
|
3067
3165
|
"input",
|
|
3068
3166
|
{
|
|
3069
3167
|
type: "file",
|
|
@@ -3073,13 +3171,13 @@ var ImageSelector = (props) => {
|
|
|
3073
3171
|
ref: inputRef
|
|
3074
3172
|
}
|
|
3075
3173
|
),
|
|
3076
|
-
value && /* @__PURE__ */ (0,
|
|
3077
|
-
/* @__PURE__ */ (0,
|
|
3078
|
-
/* @__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, {}) })
|
|
3079
3177
|
] }),
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
3081
|
-
/* @__PURE__ */ (0,
|
|
3082
|
-
/* @__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" })
|
|
3083
3181
|
] }) })
|
|
3084
3182
|
] });
|
|
3085
3183
|
};
|
|
@@ -3087,7 +3185,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3087
3185
|
var ImageSelector_default = ImageSelector;
|
|
3088
3186
|
|
|
3089
3187
|
// src/components/Pagination/Pagination.tsx
|
|
3090
|
-
var
|
|
3188
|
+
var import_jsx_runtime324 = require("react/jsx-runtime");
|
|
3091
3189
|
function getPageRange(current, totalPages, siblingCount) {
|
|
3092
3190
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3093
3191
|
if (totalPages <= totalNumbers) {
|
|
@@ -3120,6 +3218,7 @@ var Pagination = (props) => {
|
|
|
3120
3218
|
pageSize = 10,
|
|
3121
3219
|
siblingCount = 1,
|
|
3122
3220
|
onChange,
|
|
3221
|
+
size = "md",
|
|
3123
3222
|
colorNamespace = "xplat",
|
|
3124
3223
|
color = "blue",
|
|
3125
3224
|
colorDepth,
|
|
@@ -3137,19 +3236,19 @@ var Pagination = (props) => {
|
|
|
3137
3236
|
onChange?.(page);
|
|
3138
3237
|
}
|
|
3139
3238
|
};
|
|
3140
|
-
return /* @__PURE__ */ (0,
|
|
3141
|
-
/* @__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)(
|
|
3142
3241
|
"button",
|
|
3143
3242
|
{
|
|
3144
3243
|
className: "page-btn prev",
|
|
3145
3244
|
disabled: current <= 1,
|
|
3146
3245
|
onClick: () => handleClick(current - 1),
|
|
3147
3246
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
3148
|
-
children: /* @__PURE__ */ (0,
|
|
3247
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(ChevronLeftIcon_default, {})
|
|
3149
3248
|
}
|
|
3150
3249
|
),
|
|
3151
3250
|
pages.map(
|
|
3152
|
-
(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)(
|
|
3153
3252
|
"button",
|
|
3154
3253
|
{
|
|
3155
3254
|
className: clsx_default("page-btn", colorClass, { active: page === current }),
|
|
@@ -3160,14 +3259,14 @@ var Pagination = (props) => {
|
|
|
3160
3259
|
page
|
|
3161
3260
|
)
|
|
3162
3261
|
),
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3262
|
+
/* @__PURE__ */ (0, import_jsx_runtime324.jsx)(
|
|
3164
3263
|
"button",
|
|
3165
3264
|
{
|
|
3166
3265
|
className: "page-btn next",
|
|
3167
3266
|
disabled: current >= totalPages,
|
|
3168
3267
|
onClick: () => handleClick(current + 1),
|
|
3169
3268
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
3170
|
-
children: /* @__PURE__ */ (0,
|
|
3269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(ChevronRightIcon_default, {})
|
|
3171
3270
|
}
|
|
3172
3271
|
)
|
|
3173
3272
|
] });
|
|
@@ -3176,17 +3275,17 @@ Pagination.displayName = "Pagination";
|
|
|
3176
3275
|
var Pagination_default = Pagination;
|
|
3177
3276
|
|
|
3178
3277
|
// src/components/PopOver/PopOver.tsx
|
|
3179
|
-
var
|
|
3180
|
-
var
|
|
3278
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3279
|
+
var import_jsx_runtime325 = require("react/jsx-runtime");
|
|
3181
3280
|
var PopOver = (props) => {
|
|
3182
3281
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
3183
|
-
const popRef =
|
|
3184
|
-
const triggerRef =
|
|
3185
|
-
const [localOpen, setLocalOpen] =
|
|
3186
|
-
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);
|
|
3187
3286
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
3188
3287
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
3189
|
-
|
|
3288
|
+
import_react22.default.useEffect(() => {
|
|
3190
3289
|
if (isOpen) {
|
|
3191
3290
|
setLocalOpen(isOpen);
|
|
3192
3291
|
setTimeout(() => {
|
|
@@ -3199,7 +3298,7 @@ var PopOver = (props) => {
|
|
|
3199
3298
|
}, 200);
|
|
3200
3299
|
}
|
|
3201
3300
|
}, [isOpen]);
|
|
3202
|
-
return /* @__PURE__ */ (0,
|
|
3301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(
|
|
3203
3302
|
"div",
|
|
3204
3303
|
{
|
|
3205
3304
|
className: "lib-xplat-pop-over",
|
|
@@ -3209,7 +3308,7 @@ var PopOver = (props) => {
|
|
|
3209
3308
|
},
|
|
3210
3309
|
children: [
|
|
3211
3310
|
children,
|
|
3212
|
-
localOpen && /* @__PURE__ */ (0,
|
|
3311
|
+
localOpen && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(
|
|
3213
3312
|
"div",
|
|
3214
3313
|
{
|
|
3215
3314
|
className: clsx_default(
|
|
@@ -3232,7 +3331,7 @@ PopOver.displayName = "PopOver";
|
|
|
3232
3331
|
var PopOver_default = PopOver;
|
|
3233
3332
|
|
|
3234
3333
|
// src/components/Progress/Progress.tsx
|
|
3235
|
-
var
|
|
3334
|
+
var import_jsx_runtime326 = require("react/jsx-runtime");
|
|
3236
3335
|
var Progress = (props) => {
|
|
3237
3336
|
const {
|
|
3238
3337
|
value,
|
|
@@ -3250,8 +3349,8 @@ var Progress = (props) => {
|
|
|
3250
3349
|
colorDepth ?? 500
|
|
3251
3350
|
);
|
|
3252
3351
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
3253
|
-
return /* @__PURE__ */ (0,
|
|
3254
|
-
/* @__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)(
|
|
3255
3354
|
"div",
|
|
3256
3355
|
{
|
|
3257
3356
|
className: "track",
|
|
@@ -3259,7 +3358,7 @@ var Progress = (props) => {
|
|
|
3259
3358
|
"aria-valuenow": value,
|
|
3260
3359
|
"aria-valuemin": 0,
|
|
3261
3360
|
"aria-valuemax": max,
|
|
3262
|
-
children: /* @__PURE__ */ (0,
|
|
3361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(
|
|
3263
3362
|
"div",
|
|
3264
3363
|
{
|
|
3265
3364
|
className: clsx_default("bar", colorClass),
|
|
@@ -3268,7 +3367,7 @@ var Progress = (props) => {
|
|
|
3268
3367
|
)
|
|
3269
3368
|
}
|
|
3270
3369
|
),
|
|
3271
|
-
showLabel && /* @__PURE__ */ (0,
|
|
3370
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("span", { className: "label", children: [
|
|
3272
3371
|
Math.round(percentage),
|
|
3273
3372
|
"%"
|
|
3274
3373
|
] })
|
|
@@ -3278,17 +3377,17 @@ Progress.displayName = "Progress";
|
|
|
3278
3377
|
var Progress_default = Progress;
|
|
3279
3378
|
|
|
3280
3379
|
// src/components/Radio/RadioGroupContext.tsx
|
|
3281
|
-
var
|
|
3282
|
-
var RadioGroupContext =
|
|
3380
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
3381
|
+
var RadioGroupContext = import_react23.default.createContext(
|
|
3283
3382
|
null
|
|
3284
3383
|
);
|
|
3285
3384
|
var useRadioGroupContext = () => {
|
|
3286
|
-
return
|
|
3385
|
+
return import_react23.default.useContext(RadioGroupContext);
|
|
3287
3386
|
};
|
|
3288
3387
|
var RadioGroupContext_default = RadioGroupContext;
|
|
3289
3388
|
|
|
3290
3389
|
// src/components/Radio/Radio.tsx
|
|
3291
|
-
var
|
|
3390
|
+
var import_jsx_runtime327 = require("react/jsx-runtime");
|
|
3292
3391
|
var Radio = (props) => {
|
|
3293
3392
|
const {
|
|
3294
3393
|
label,
|
|
@@ -3297,9 +3396,11 @@ var Radio = (props) => {
|
|
|
3297
3396
|
colorNamespace = "xplat",
|
|
3298
3397
|
color = "blue",
|
|
3299
3398
|
colorDepth,
|
|
3399
|
+
size: sizeProp,
|
|
3300
3400
|
...rest
|
|
3301
3401
|
} = props;
|
|
3302
3402
|
const context = useRadioGroupContext();
|
|
3403
|
+
const size = sizeProp ?? context?.size ?? "md";
|
|
3303
3404
|
const isGroup = !!context;
|
|
3304
3405
|
const localChecked = isGroup ? context.value === value : rest.checked ?? false;
|
|
3305
3406
|
const inputProps = context ? { name: context.name, value, onChange: context.onChange } : {
|
|
@@ -3312,17 +3413,18 @@ var Radio = (props) => {
|
|
|
3312
3413
|
color,
|
|
3313
3414
|
colorDepth ?? 500
|
|
3314
3415
|
);
|
|
3315
|
-
return /* @__PURE__ */ (0,
|
|
3416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(
|
|
3316
3417
|
"label",
|
|
3317
3418
|
{
|
|
3318
3419
|
className: clsx_default(
|
|
3319
3420
|
"lib-xplat-radio",
|
|
3421
|
+
size,
|
|
3320
3422
|
localChecked ? "checked" : void 0,
|
|
3321
3423
|
className
|
|
3322
3424
|
),
|
|
3323
3425
|
children: [
|
|
3324
|
-
/* @__PURE__ */ (0,
|
|
3325
|
-
/* @__PURE__ */ (0,
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
3427
|
+
/* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
|
|
3326
3428
|
"div",
|
|
3327
3429
|
{
|
|
3328
3430
|
className: clsx_default(
|
|
@@ -3330,10 +3432,10 @@ var Radio = (props) => {
|
|
|
3330
3432
|
localChecked ? "checked" : void 0,
|
|
3331
3433
|
colorClass
|
|
3332
3434
|
),
|
|
3333
|
-
children: localChecked && /* @__PURE__ */ (0,
|
|
3435
|
+
children: localChecked && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "inner-circle" })
|
|
3334
3436
|
}
|
|
3335
3437
|
),
|
|
3336
|
-
label && /* @__PURE__ */ (0,
|
|
3438
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("span", { children: label })
|
|
3337
3439
|
]
|
|
3338
3440
|
}
|
|
3339
3441
|
);
|
|
@@ -3342,23 +3444,23 @@ Radio.displayName = "Radio";
|
|
|
3342
3444
|
var Radio_default = Radio;
|
|
3343
3445
|
|
|
3344
3446
|
// src/components/Radio/RadioGroup.tsx
|
|
3345
|
-
var
|
|
3447
|
+
var import_jsx_runtime328 = require("react/jsx-runtime");
|
|
3346
3448
|
var RadioGroup = (props) => {
|
|
3347
3449
|
const { children, ...rest } = props;
|
|
3348
|
-
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 }) });
|
|
3349
3451
|
};
|
|
3350
3452
|
RadioGroup.displayName = "RadioGroup";
|
|
3351
3453
|
var RadioGroup_default = RadioGroup;
|
|
3352
3454
|
|
|
3353
3455
|
// src/components/Skeleton/Skeleton.tsx
|
|
3354
|
-
var
|
|
3456
|
+
var import_jsx_runtime329 = require("react/jsx-runtime");
|
|
3355
3457
|
var Skeleton = (props) => {
|
|
3356
3458
|
const { variant = "text", width, height, className } = props;
|
|
3357
3459
|
const style = {
|
|
3358
3460
|
width: typeof width === "number" ? `${width}px` : width,
|
|
3359
3461
|
height: typeof height === "number" ? `${height}px` : height
|
|
3360
3462
|
};
|
|
3361
|
-
return /* @__PURE__ */ (0,
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime329.jsx)(
|
|
3362
3464
|
"div",
|
|
3363
3465
|
{
|
|
3364
3466
|
className: clsx_default("lib-xplat-skeleton", variant, className),
|
|
@@ -3371,7 +3473,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
3371
3473
|
var Skeleton_default = Skeleton;
|
|
3372
3474
|
|
|
3373
3475
|
// src/components/Spinner/Spinner.tsx
|
|
3374
|
-
var
|
|
3476
|
+
var import_jsx_runtime330 = require("react/jsx-runtime");
|
|
3375
3477
|
var Spinner = (props) => {
|
|
3376
3478
|
const {
|
|
3377
3479
|
size = "md",
|
|
@@ -3385,14 +3487,14 @@ var Spinner = (props) => {
|
|
|
3385
3487
|
color,
|
|
3386
3488
|
colorDepth ?? 500
|
|
3387
3489
|
);
|
|
3388
|
-
return /* @__PURE__ */ (0,
|
|
3490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
3389
3491
|
"div",
|
|
3390
3492
|
{
|
|
3391
3493
|
className: clsx_default("lib-xplat-spinner", size, colorClass, className),
|
|
3392
3494
|
role: "status",
|
|
3393
3495
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
3394
|
-
children: /* @__PURE__ */ (0,
|
|
3395
|
-
/* @__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)(
|
|
3396
3498
|
"circle",
|
|
3397
3499
|
{
|
|
3398
3500
|
className: "track",
|
|
@@ -3402,7 +3504,7 @@ var Spinner = (props) => {
|
|
|
3402
3504
|
strokeWidth: "3"
|
|
3403
3505
|
}
|
|
3404
3506
|
),
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3507
|
+
/* @__PURE__ */ (0, import_jsx_runtime330.jsx)(
|
|
3406
3508
|
"circle",
|
|
3407
3509
|
{
|
|
3408
3510
|
className: "indicator",
|
|
@@ -3421,7 +3523,7 @@ Spinner.displayName = "Spinner";
|
|
|
3421
3523
|
var Spinner_default = Spinner;
|
|
3422
3524
|
|
|
3423
3525
|
// src/components/Steps/Steps.tsx
|
|
3424
|
-
var
|
|
3526
|
+
var import_jsx_runtime331 = require("react/jsx-runtime");
|
|
3425
3527
|
var Steps = (props) => {
|
|
3426
3528
|
const {
|
|
3427
3529
|
items,
|
|
@@ -3436,16 +3538,16 @@ var Steps = (props) => {
|
|
|
3436
3538
|
color,
|
|
3437
3539
|
colorDepth ?? 500
|
|
3438
3540
|
);
|
|
3439
|
-
return /* @__PURE__ */ (0,
|
|
3541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime331.jsx)("div", { className: clsx_default("lib-xplat-steps", className), children: items.map((item, index) => {
|
|
3440
3542
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
3441
|
-
return /* @__PURE__ */ (0,
|
|
3442
|
-
/* @__PURE__ */ (0,
|
|
3443
|
-
/* @__PURE__ */ (0,
|
|
3444
|
-
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) })
|
|
3445
3547
|
] }),
|
|
3446
|
-
/* @__PURE__ */ (0,
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3448
|
-
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 })
|
|
3449
3551
|
] })
|
|
3450
3552
|
] }, index);
|
|
3451
3553
|
}) });
|
|
@@ -3454,12 +3556,13 @@ Steps.displayName = "Steps";
|
|
|
3454
3556
|
var Steps_default = Steps;
|
|
3455
3557
|
|
|
3456
3558
|
// src/components/Switch/Switch.tsx
|
|
3457
|
-
var
|
|
3458
|
-
var
|
|
3559
|
+
var import_react24 = __toESM(require("react"), 1);
|
|
3560
|
+
var import_jsx_runtime332 = require("react/jsx-runtime");
|
|
3459
3561
|
var KNOB_TRANSITION_MS = 250;
|
|
3460
3562
|
var Switch = (props) => {
|
|
3461
3563
|
const {
|
|
3462
3564
|
value,
|
|
3565
|
+
size = "md",
|
|
3463
3566
|
disabled,
|
|
3464
3567
|
onChange,
|
|
3465
3568
|
colorNamespace = "xplat",
|
|
@@ -3467,9 +3570,9 @@ var Switch = (props) => {
|
|
|
3467
3570
|
colorDepth,
|
|
3468
3571
|
className
|
|
3469
3572
|
} = props;
|
|
3470
|
-
const [isAnimating, setIsAnimating] =
|
|
3471
|
-
const timeoutRef =
|
|
3472
|
-
|
|
3573
|
+
const [isAnimating, setIsAnimating] = import_react24.default.useState(false);
|
|
3574
|
+
const timeoutRef = import_react24.default.useRef(null);
|
|
3575
|
+
import_react24.default.useEffect(() => {
|
|
3473
3576
|
return () => {
|
|
3474
3577
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3475
3578
|
};
|
|
@@ -3489,11 +3592,12 @@ var Switch = (props) => {
|
|
|
3489
3592
|
color,
|
|
3490
3593
|
colorDepth ?? 500
|
|
3491
3594
|
);
|
|
3492
|
-
return /* @__PURE__ */ (0,
|
|
3595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime332.jsx)(
|
|
3493
3596
|
"div",
|
|
3494
3597
|
{
|
|
3495
3598
|
className: clsx_default(
|
|
3496
3599
|
"lib-xplat-switch",
|
|
3600
|
+
size,
|
|
3497
3601
|
value ? "checked" : void 0,
|
|
3498
3602
|
disabled && "disabled",
|
|
3499
3603
|
isAnimating && "animating",
|
|
@@ -3502,7 +3606,7 @@ var Switch = (props) => {
|
|
|
3502
3606
|
),
|
|
3503
3607
|
onClick: handleClick,
|
|
3504
3608
|
"aria-disabled": disabled || isAnimating,
|
|
3505
|
-
children: /* @__PURE__ */ (0,
|
|
3609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime332.jsx)("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
3506
3610
|
}
|
|
3507
3611
|
);
|
|
3508
3612
|
};
|
|
@@ -3510,14 +3614,14 @@ Switch.displayName = "Switch";
|
|
|
3510
3614
|
var Switch_default = Switch;
|
|
3511
3615
|
|
|
3512
3616
|
// src/components/Tab/Tab.tsx
|
|
3513
|
-
var
|
|
3617
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
3514
3618
|
|
|
3515
3619
|
// src/components/Tab/TabItem.tsx
|
|
3516
|
-
var
|
|
3517
|
-
var
|
|
3518
|
-
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) => {
|
|
3519
3623
|
const { isActive, title, onClick } = props;
|
|
3520
|
-
return /* @__PURE__ */ (0,
|
|
3624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime333.jsx)(
|
|
3521
3625
|
"div",
|
|
3522
3626
|
{
|
|
3523
3627
|
ref,
|
|
@@ -3531,25 +3635,25 @@ TabItem.displayName = "TabItem";
|
|
|
3531
3635
|
var TabItem_default = TabItem;
|
|
3532
3636
|
|
|
3533
3637
|
// src/components/Tab/Tab.tsx
|
|
3534
|
-
var
|
|
3638
|
+
var import_jsx_runtime334 = require("react/jsx-runtime");
|
|
3535
3639
|
var Tab = (props) => {
|
|
3536
|
-
const { activeIndex, onChange, tabs, type } = props;
|
|
3537
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3640
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3641
|
+
const [underlineStyle, setUnderlineStyle] = import_react26.default.useState({
|
|
3538
3642
|
left: 0,
|
|
3539
3643
|
width: 0
|
|
3540
3644
|
});
|
|
3541
|
-
const itemRefs =
|
|
3645
|
+
const itemRefs = import_react26.default.useRef([]);
|
|
3542
3646
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3543
3647
|
onChange(tabItem, tabIdx);
|
|
3544
3648
|
};
|
|
3545
|
-
|
|
3649
|
+
import_react26.default.useEffect(() => {
|
|
3546
3650
|
const el = itemRefs.current[activeIndex];
|
|
3547
3651
|
if (el) {
|
|
3548
3652
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3549
3653
|
}
|
|
3550
3654
|
}, [activeIndex, tabs.length]);
|
|
3551
|
-
return /* @__PURE__ */ (0,
|
|
3552
|
-
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)(
|
|
3553
3657
|
TabItem_default,
|
|
3554
3658
|
{
|
|
3555
3659
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3561,7 +3665,7 @@ var Tab = (props) => {
|
|
|
3561
3665
|
},
|
|
3562
3666
|
`${tab.value}_${idx}`
|
|
3563
3667
|
)),
|
|
3564
|
-
type === "toggle" && /* @__PURE__ */ (0,
|
|
3668
|
+
type === "toggle" && /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
3565
3669
|
"div",
|
|
3566
3670
|
{
|
|
3567
3671
|
className: "tab-toggle-underline",
|
|
@@ -3577,17 +3681,17 @@ Tab.displayName = "Tab";
|
|
|
3577
3681
|
var Tab_default = Tab;
|
|
3578
3682
|
|
|
3579
3683
|
// src/components/Table/TableContext.tsx
|
|
3580
|
-
var
|
|
3581
|
-
var TableContext =
|
|
3684
|
+
var import_react27 = __toESM(require("react"), 1);
|
|
3685
|
+
var TableContext = import_react27.default.createContext(null);
|
|
3582
3686
|
var useTableContext = () => {
|
|
3583
|
-
const ctx =
|
|
3687
|
+
const ctx = import_react27.default.useContext(TableContext);
|
|
3584
3688
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3585
3689
|
return ctx;
|
|
3586
3690
|
};
|
|
3587
3691
|
var TableContext_default = TableContext;
|
|
3588
3692
|
|
|
3589
3693
|
// src/components/Table/Table.tsx
|
|
3590
|
-
var
|
|
3694
|
+
var import_jsx_runtime335 = require("react/jsx-runtime");
|
|
3591
3695
|
var Table = (props) => {
|
|
3592
3696
|
const {
|
|
3593
3697
|
className,
|
|
@@ -3597,7 +3701,7 @@ var Table = (props) => {
|
|
|
3597
3701
|
headerSticky = false,
|
|
3598
3702
|
stickyShadow = true
|
|
3599
3703
|
} = props;
|
|
3600
|
-
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)(
|
|
3601
3705
|
TableContext_default.Provider,
|
|
3602
3706
|
{
|
|
3603
3707
|
value: {
|
|
@@ -3606,7 +3710,7 @@ var Table = (props) => {
|
|
|
3606
3710
|
headerSticky,
|
|
3607
3711
|
stickyShadow
|
|
3608
3712
|
},
|
|
3609
|
-
children: /* @__PURE__ */ (0,
|
|
3713
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime335.jsx)("table", { className: "lib-xplat-table", children })
|
|
3610
3714
|
}
|
|
3611
3715
|
) });
|
|
3612
3716
|
};
|
|
@@ -3614,40 +3718,40 @@ Table.displayName = "Table";
|
|
|
3614
3718
|
var Table_default = Table;
|
|
3615
3719
|
|
|
3616
3720
|
// src/components/Table/TableBody.tsx
|
|
3617
|
-
var
|
|
3721
|
+
var import_jsx_runtime336 = require("react/jsx-runtime");
|
|
3618
3722
|
var TableBody = (props) => {
|
|
3619
3723
|
const { children, className } = props;
|
|
3620
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime336.jsx)("tbody", { className, children });
|
|
3621
3725
|
};
|
|
3622
3726
|
TableBody.displayName = "TableBody";
|
|
3623
3727
|
var TableBody_default = TableBody;
|
|
3624
3728
|
|
|
3625
3729
|
// src/components/Table/TableCell.tsx
|
|
3626
|
-
var
|
|
3730
|
+
var import_react30 = __toESM(require("react"), 1);
|
|
3627
3731
|
|
|
3628
3732
|
// src/components/Table/TableHeadContext.tsx
|
|
3629
|
-
var
|
|
3630
|
-
var TableHeadContext =
|
|
3733
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
3734
|
+
var TableHeadContext = import_react28.default.createContext(
|
|
3631
3735
|
null
|
|
3632
3736
|
);
|
|
3633
3737
|
var useTableHeadContext = () => {
|
|
3634
|
-
const ctx =
|
|
3738
|
+
const ctx = import_react28.default.useContext(TableHeadContext);
|
|
3635
3739
|
return ctx;
|
|
3636
3740
|
};
|
|
3637
3741
|
var TableHeadContext_default = TableHeadContext;
|
|
3638
3742
|
|
|
3639
3743
|
// src/components/Table/TableRowContext.tsx
|
|
3640
|
-
var
|
|
3641
|
-
var TableRowContext =
|
|
3744
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
3745
|
+
var TableRowContext = import_react29.default.createContext(null);
|
|
3642
3746
|
var useTableRowContext = () => {
|
|
3643
|
-
const ctx =
|
|
3747
|
+
const ctx = import_react29.default.useContext(TableRowContext);
|
|
3644
3748
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3645
3749
|
return ctx;
|
|
3646
3750
|
};
|
|
3647
3751
|
var TableRowContext_default = TableRowContext;
|
|
3648
3752
|
|
|
3649
3753
|
// src/components/Table/TableCell.tsx
|
|
3650
|
-
var
|
|
3754
|
+
var import_jsx_runtime337 = require("react/jsx-runtime");
|
|
3651
3755
|
var TableCell = (props) => {
|
|
3652
3756
|
const {
|
|
3653
3757
|
children,
|
|
@@ -3659,9 +3763,9 @@ var TableCell = (props) => {
|
|
|
3659
3763
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
3660
3764
|
const { stickyShadow } = useTableContext();
|
|
3661
3765
|
const headContext = useTableHeadContext();
|
|
3662
|
-
const [left, setLeft] =
|
|
3663
|
-
const cellRef =
|
|
3664
|
-
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(() => {
|
|
3665
3769
|
if (!cellRef.current) return 0;
|
|
3666
3770
|
let totalLeft = 0;
|
|
3667
3771
|
for (const ref of stickyCells) {
|
|
@@ -3670,7 +3774,7 @@ var TableCell = (props) => {
|
|
|
3670
3774
|
}
|
|
3671
3775
|
return totalLeft;
|
|
3672
3776
|
}, [stickyCells]);
|
|
3673
|
-
|
|
3777
|
+
import_react30.default.useEffect(() => {
|
|
3674
3778
|
if (!isSticky || !cellRef.current) return;
|
|
3675
3779
|
registerStickyCell(cellRef);
|
|
3676
3780
|
setLeft(calculateLeft());
|
|
@@ -3688,7 +3792,7 @@ var TableCell = (props) => {
|
|
|
3688
3792
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
3689
3793
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
3690
3794
|
const enableHover = headContext && headContext.cellHover;
|
|
3691
|
-
return /* @__PURE__ */ (0,
|
|
3795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime337.jsx)(
|
|
3692
3796
|
CellTag,
|
|
3693
3797
|
{
|
|
3694
3798
|
ref: cellRef,
|
|
@@ -3710,21 +3814,21 @@ TableCell.displayName = "TableCell";
|
|
|
3710
3814
|
var TableCell_default = TableCell;
|
|
3711
3815
|
|
|
3712
3816
|
// src/components/Table/TableHead.tsx
|
|
3713
|
-
var
|
|
3817
|
+
var import_jsx_runtime338 = require("react/jsx-runtime");
|
|
3714
3818
|
var TableHead = ({
|
|
3715
3819
|
children,
|
|
3716
3820
|
className = "",
|
|
3717
3821
|
cellHover = false
|
|
3718
3822
|
}) => {
|
|
3719
3823
|
const { headerSticky } = useTableContext();
|
|
3720
|
-
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 }) });
|
|
3721
3825
|
};
|
|
3722
3826
|
TableHead.displayName = "TableHead";
|
|
3723
3827
|
var TableHead_default = TableHead;
|
|
3724
3828
|
|
|
3725
3829
|
// src/components/Table/TableRow.tsx
|
|
3726
|
-
var
|
|
3727
|
-
var
|
|
3830
|
+
var import_react31 = __toESM(require("react"), 1);
|
|
3831
|
+
var import_jsx_runtime339 = require("react/jsx-runtime");
|
|
3728
3832
|
var TableRow = (props) => {
|
|
3729
3833
|
const {
|
|
3730
3834
|
children,
|
|
@@ -3737,7 +3841,7 @@ var TableRow = (props) => {
|
|
|
3737
3841
|
onClick
|
|
3738
3842
|
} = props;
|
|
3739
3843
|
const { rowBorderUse } = useTableContext();
|
|
3740
|
-
const [stickyCells, setStickyCells] =
|
|
3844
|
+
const [stickyCells, setStickyCells] = import_react31.default.useState([]);
|
|
3741
3845
|
const registerStickyCell = (ref) => {
|
|
3742
3846
|
setStickyCells((prev) => {
|
|
3743
3847
|
if (prev.includes(ref)) return prev;
|
|
@@ -3749,7 +3853,7 @@ var TableRow = (props) => {
|
|
|
3749
3853
|
color,
|
|
3750
3854
|
colorDepth ?? 500
|
|
3751
3855
|
);
|
|
3752
|
-
return /* @__PURE__ */ (0,
|
|
3856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
3753
3857
|
"tr",
|
|
3754
3858
|
{
|
|
3755
3859
|
className: clsx_default(
|
|
@@ -3769,11 +3873,12 @@ TableRow.displayName = "TableRow";
|
|
|
3769
3873
|
var TableRow_default = TableRow;
|
|
3770
3874
|
|
|
3771
3875
|
// src/components/Tag/Tag.tsx
|
|
3772
|
-
var
|
|
3876
|
+
var import_jsx_runtime340 = require("react/jsx-runtime");
|
|
3773
3877
|
var Tag = (props) => {
|
|
3774
3878
|
const {
|
|
3775
3879
|
children,
|
|
3776
3880
|
onClose,
|
|
3881
|
+
size = "md",
|
|
3777
3882
|
colorNamespace = "xplat",
|
|
3778
3883
|
color = "neutral",
|
|
3779
3884
|
colorDepth,
|
|
@@ -3784,21 +3889,21 @@ var Tag = (props) => {
|
|
|
3784
3889
|
color,
|
|
3785
3890
|
colorDepth ?? 500
|
|
3786
3891
|
);
|
|
3787
|
-
return /* @__PURE__ */ (0,
|
|
3788
|
-
/* @__PURE__ */ (0,
|
|
3789
|
-
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, {}) })
|
|
3790
3895
|
] });
|
|
3791
3896
|
};
|
|
3792
3897
|
Tag.displayName = "Tag";
|
|
3793
3898
|
var Tag_default = Tag;
|
|
3794
3899
|
|
|
3795
3900
|
// src/components/TextArea/TextArea.tsx
|
|
3796
|
-
var
|
|
3797
|
-
var
|
|
3798
|
-
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(
|
|
3799
3904
|
(props, ref) => {
|
|
3800
3905
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
3801
|
-
const localRef =
|
|
3906
|
+
const localRef = import_react32.default.useRef(null);
|
|
3802
3907
|
const setRefs = (el) => {
|
|
3803
3908
|
localRef.current = el;
|
|
3804
3909
|
if (!ref) return;
|
|
@@ -3818,21 +3923,21 @@ var TextArea = import_react31.default.forwardRef(
|
|
|
3818
3923
|
onChange(event);
|
|
3819
3924
|
}
|
|
3820
3925
|
};
|
|
3821
|
-
|
|
3926
|
+
import_react32.default.useEffect(() => {
|
|
3822
3927
|
const el = localRef.current;
|
|
3823
3928
|
if (!el) return;
|
|
3824
3929
|
el.style.height = "0px";
|
|
3825
3930
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
3826
3931
|
el.style.height = `${nextHeight}px`;
|
|
3827
3932
|
}, [value]);
|
|
3828
|
-
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)(
|
|
3829
3934
|
"div",
|
|
3830
3935
|
{
|
|
3831
3936
|
className: clsx_default(
|
|
3832
3937
|
"lib-xplat-textarea",
|
|
3833
3938
|
disabled ? "disabled" : void 0
|
|
3834
3939
|
),
|
|
3835
|
-
children: /* @__PURE__ */ (0,
|
|
3940
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime341.jsx)(
|
|
3836
3941
|
"textarea",
|
|
3837
3942
|
{
|
|
3838
3943
|
...textareaProps,
|
|
@@ -3850,25 +3955,25 @@ TextArea.displayName = "TextArea";
|
|
|
3850
3955
|
var TextArea_default = TextArea;
|
|
3851
3956
|
|
|
3852
3957
|
// src/components/Toast/Toast.tsx
|
|
3853
|
-
var
|
|
3958
|
+
var import_react33 = __toESM(require("react"), 1);
|
|
3854
3959
|
var import_react_dom3 = require("react-dom");
|
|
3855
|
-
var
|
|
3856
|
-
var ToastContext =
|
|
3960
|
+
var import_jsx_runtime342 = require("react/jsx-runtime");
|
|
3961
|
+
var ToastContext = import_react33.default.createContext(null);
|
|
3857
3962
|
var useToast = () => {
|
|
3858
|
-
const ctx =
|
|
3963
|
+
const ctx = import_react33.default.useContext(ToastContext);
|
|
3859
3964
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
3860
3965
|
return ctx;
|
|
3861
3966
|
};
|
|
3862
3967
|
var EXIT_DURATION = 300;
|
|
3863
3968
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
3864
|
-
const ref =
|
|
3865
|
-
const [height, setHeight] =
|
|
3866
|
-
|
|
3969
|
+
const ref = import_react33.default.useRef(null);
|
|
3970
|
+
const [height, setHeight] = import_react33.default.useState(void 0);
|
|
3971
|
+
import_react33.default.useEffect(() => {
|
|
3867
3972
|
if (ref.current && !isExiting) {
|
|
3868
3973
|
setHeight(ref.current.offsetHeight);
|
|
3869
3974
|
}
|
|
3870
3975
|
}, [isExiting]);
|
|
3871
|
-
return /* @__PURE__ */ (0,
|
|
3976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsx)(
|
|
3872
3977
|
"div",
|
|
3873
3978
|
{
|
|
3874
3979
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -3876,15 +3981,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
3876
3981
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
3877
3982
|
marginBottom: isExiting ? 0 : void 0
|
|
3878
3983
|
},
|
|
3879
|
-
children: /* @__PURE__ */ (0,
|
|
3984
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(
|
|
3880
3985
|
"div",
|
|
3881
3986
|
{
|
|
3882
3987
|
ref,
|
|
3883
3988
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
3884
3989
|
role: "alert",
|
|
3885
3990
|
children: [
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
3887
|
-
/* @__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" })
|
|
3888
3993
|
]
|
|
3889
3994
|
}
|
|
3890
3995
|
)
|
|
@@ -3895,13 +4000,13 @@ var ToastProvider = ({
|
|
|
3895
4000
|
children,
|
|
3896
4001
|
position = "top-right"
|
|
3897
4002
|
}) => {
|
|
3898
|
-
const [toasts, setToasts] =
|
|
3899
|
-
const [removing, setRemoving] =
|
|
3900
|
-
const [mounted, setMounted] =
|
|
3901
|
-
|
|
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(() => {
|
|
3902
4007
|
setMounted(true);
|
|
3903
4008
|
}, []);
|
|
3904
|
-
const remove =
|
|
4009
|
+
const remove = import_react33.default.useCallback((id) => {
|
|
3905
4010
|
setRemoving((prev) => new Set(prev).add(id));
|
|
3906
4011
|
setTimeout(() => {
|
|
3907
4012
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -3912,7 +4017,7 @@ var ToastProvider = ({
|
|
|
3912
4017
|
});
|
|
3913
4018
|
}, EXIT_DURATION);
|
|
3914
4019
|
}, []);
|
|
3915
|
-
const toast =
|
|
4020
|
+
const toast = import_react33.default.useCallback(
|
|
3916
4021
|
(type, message, duration = 3e3) => {
|
|
3917
4022
|
const id = `${Date.now()}-${Math.random()}`;
|
|
3918
4023
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -3922,10 +4027,10 @@ var ToastProvider = ({
|
|
|
3922
4027
|
},
|
|
3923
4028
|
[remove]
|
|
3924
4029
|
);
|
|
3925
|
-
return /* @__PURE__ */ (0,
|
|
4030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime342.jsxs)(ToastContext.Provider, { value: { toast }, children: [
|
|
3926
4031
|
children,
|
|
3927
4032
|
mounted && (0, import_react_dom3.createPortal)(
|
|
3928
|
-
/* @__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)(
|
|
3929
4034
|
ToastItemComponent,
|
|
3930
4035
|
{
|
|
3931
4036
|
item: t,
|
|
@@ -3941,8 +4046,8 @@ var ToastProvider = ({
|
|
|
3941
4046
|
ToastProvider.displayName = "ToastProvider";
|
|
3942
4047
|
|
|
3943
4048
|
// src/components/Tooltip/Tooltip.tsx
|
|
3944
|
-
var
|
|
3945
|
-
var
|
|
4049
|
+
var import_react34 = __toESM(require("react"), 1);
|
|
4050
|
+
var import_jsx_runtime343 = require("react/jsx-runtime");
|
|
3946
4051
|
var Tooltip2 = (props) => {
|
|
3947
4052
|
const {
|
|
3948
4053
|
type = "primary",
|
|
@@ -3952,24 +4057,24 @@ var Tooltip2 = (props) => {
|
|
|
3952
4057
|
description,
|
|
3953
4058
|
children
|
|
3954
4059
|
} = props;
|
|
3955
|
-
const iconRef =
|
|
4060
|
+
const iconRef = import_react34.default.useRef(null);
|
|
3956
4061
|
const colorClass = getColorClass(
|
|
3957
4062
|
colorNamespace,
|
|
3958
4063
|
color,
|
|
3959
4064
|
colorDepth ?? 500
|
|
3960
4065
|
);
|
|
3961
|
-
return /* @__PURE__ */ (0,
|
|
3962
|
-
/* @__PURE__ */ (0,
|
|
3963
|
-
/* @__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 })
|
|
3964
4069
|
] });
|
|
3965
4070
|
};
|
|
3966
4071
|
Tooltip2.displayName = "Tooltip";
|
|
3967
4072
|
var Tooltip_default = Tooltip2;
|
|
3968
4073
|
|
|
3969
4074
|
// src/components/Video/Video.tsx
|
|
3970
|
-
var
|
|
3971
|
-
var
|
|
3972
|
-
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) => {
|
|
3973
4078
|
const {
|
|
3974
4079
|
src,
|
|
3975
4080
|
poster,
|
|
@@ -3983,10 +4088,10 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
3983
4088
|
onPause,
|
|
3984
4089
|
...rest
|
|
3985
4090
|
} = props;
|
|
3986
|
-
const videoRef =
|
|
3987
|
-
const [isPlaying, setIsPlaying] =
|
|
3988
|
-
const [isLoaded, setIsLoaded] =
|
|
3989
|
-
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(
|
|
3990
4095
|
(el) => {
|
|
3991
4096
|
videoRef.current = el;
|
|
3992
4097
|
if (typeof ref === "function") ref(el);
|
|
@@ -4014,7 +4119,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4014
4119
|
}
|
|
4015
4120
|
};
|
|
4016
4121
|
const showCustomOverlay = !controls;
|
|
4017
|
-
return /* @__PURE__ */ (0,
|
|
4122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime344.jsxs)(
|
|
4018
4123
|
"div",
|
|
4019
4124
|
{
|
|
4020
4125
|
className: clsx_default(
|
|
@@ -4023,7 +4128,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4023
4128
|
className
|
|
4024
4129
|
),
|
|
4025
4130
|
children: [
|
|
4026
|
-
/* @__PURE__ */ (0,
|
|
4131
|
+
/* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
4027
4132
|
"video",
|
|
4028
4133
|
{
|
|
4029
4134
|
ref: setRefs,
|
|
@@ -4040,7 +4145,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4040
4145
|
...rest
|
|
4041
4146
|
}
|
|
4042
4147
|
),
|
|
4043
|
-
showCustomOverlay && /* @__PURE__ */ (0,
|
|
4148
|
+
showCustomOverlay && /* @__PURE__ */ (0, import_jsx_runtime344.jsx)(
|
|
4044
4149
|
"button",
|
|
4045
4150
|
{
|
|
4046
4151
|
type: "button",
|
|
@@ -4051,7 +4156,7 @@ var Video = import_react34.default.forwardRef((props, ref) => {
|
|
|
4051
4156
|
),
|
|
4052
4157
|
onClick: togglePlay,
|
|
4053
4158
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
4054
|
-
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, {}) })
|
|
4055
4160
|
}
|
|
4056
4161
|
)
|
|
4057
4162
|
]
|
|
@@ -4069,6 +4174,7 @@ var Video_default = Video;
|
|
|
4069
4174
|
Breadcrumb,
|
|
4070
4175
|
Button,
|
|
4071
4176
|
Card,
|
|
4177
|
+
CardTab,
|
|
4072
4178
|
Chart,
|
|
4073
4179
|
CheckBox,
|
|
4074
4180
|
Chip,
|