@x-plat/design-system 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{colors-BG91q_uV.d.cts → colors-DmMsWD7G.d.cts} +20 -4
- package/dist/{colors-BG91q_uV.d.ts → colors-DmMsWD7G.d.ts} +20 -4
- package/dist/components/Accordion/index.cjs +25 -14
- package/dist/components/Accordion/index.css +6 -6
- package/dist/components/Accordion/index.d.cts +16 -3
- package/dist/components/Accordion/index.d.ts +16 -3
- package/dist/components/Accordion/index.js +25 -14
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.css +16 -16
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.css +3 -279
- package/dist/components/Avatar/index.d.cts +2 -118
- package/dist/components/Avatar/index.d.ts +2 -118
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.cjs +3 -2
- package/dist/components/Badge/index.css +23 -279
- package/dist/components/Badge/index.d.cts +4 -118
- package/dist/components/Badge/index.d.ts +4 -118
- package/dist/components/Badge/index.js +3 -2
- package/dist/components/Breadcrumb/index.cjs +1 -1
- package/dist/components/Breadcrumb/index.css +4 -4
- package/dist/components/Breadcrumb/index.js +1 -1
- package/dist/components/Button/index.cjs +3 -2
- package/dist/components/Button/index.css +26 -1214
- package/dist/components/Button/index.d.cts +4 -118
- package/dist/components/Button/index.d.ts +4 -118
- package/dist/components/Button/index.js +3 -2
- package/dist/components/Card/index.cjs +1 -1
- package/dist/components/Card/index.css +3 -3
- package/dist/components/Card/index.js +1 -1
- package/dist/components/CardTab/index.cjs +124 -0
- package/dist/components/CardTab/index.css +78 -0
- package/dist/components/CardTab/index.d.cts +44 -0
- package/dist/components/CardTab/index.d.ts +44 -0
- package/dist/components/CardTab/index.js +87 -0
- package/dist/components/CheckBox/index.cjs +3 -2
- package/dist/components/CheckBox/index.css +27 -563
- package/dist/components/CheckBox/index.d.cts +5 -119
- package/dist/components/CheckBox/index.d.ts +5 -119
- package/dist/components/CheckBox/index.js +3 -2
- package/dist/components/Chip/index.cjs +3 -2
- package/dist/components/Chip/index.css +21 -1209
- package/dist/components/Chip/index.d.cts +4 -118
- package/dist/components/Chip/index.d.ts +4 -118
- package/dist/components/Chip/index.js +3 -2
- package/dist/components/DatePicker/index.cjs +5 -3
- package/dist/components/DatePicker/index.css +62 -1239
- package/dist/components/DatePicker/index.d.cts +3 -235
- package/dist/components/DatePicker/index.d.ts +3 -235
- package/dist/components/DatePicker/index.js +5 -3
- package/dist/components/Divider/index.cjs +1 -1
- package/dist/components/Divider/index.css +2 -2
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.css +5 -5
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Dropdown/index.cjs +1 -1
- package/dist/components/Dropdown/index.css +7 -7
- package/dist/components/Dropdown/index.js +1 -1
- package/dist/components/EmptyState/index.cjs +1 -1
- package/dist/components/EmptyState/index.css +3 -3
- package/dist/components/EmptyState/index.js +1 -1
- package/dist/components/FileUpload/index.cjs +1 -1
- package/dist/components/FileUpload/index.css +8 -8
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/HtmlTypeWriter/index.css +1 -1
- package/dist/components/ImageSelector/index.css +9 -9
- package/dist/components/Input/index.cjs +3 -2
- package/dist/components/Input/index.css +21 -10
- package/dist/components/Input/index.d.cts +6 -2
- package/dist/components/Input/index.d.ts +6 -2
- package/dist/components/Input/index.js +3 -2
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Pagination/index.cjs +3 -2
- package/dist/components/Pagination/index.css +33 -283
- package/dist/components/Pagination/index.d.cts +4 -118
- package/dist/components/Pagination/index.d.ts +4 -118
- package/dist/components/Pagination/index.js +3 -2
- package/dist/components/PopOver/index.cjs +1 -1
- package/dist/components/PopOver/index.js +1 -1
- package/dist/components/Progress/index.cjs +1 -1
- package/dist/components/Progress/index.css +3 -281
- package/dist/components/Progress/index.d.cts +2 -118
- package/dist/components/Progress/index.d.ts +2 -118
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/Radio/index.cjs +4 -1
- package/dist/components/Radio/index.css +36 -747
- package/dist/components/Radio/index.d.cts +6 -119
- package/dist/components/Radio/index.d.ts +6 -119
- package/dist/components/Radio/index.js +4 -1
- package/dist/components/Select/index.cjs +4 -2
- package/dist/components/Select/index.css +38 -18
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +4 -2
- package/dist/components/Skeleton/index.cjs +1 -1
- package/dist/components/Skeleton/index.css +1 -1
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Spinner/index.cjs +1 -1
- package/dist/components/Spinner/index.css +2 -280
- package/dist/components/Spinner/index.d.cts +2 -118
- package/dist/components/Spinner/index.d.ts +2 -118
- package/dist/components/Spinner/index.js +1 -1
- package/dist/components/Steps/index.cjs +1 -1
- package/dist/components/Steps/index.css +14 -846
- package/dist/components/Steps/index.d.cts +2 -118
- package/dist/components/Steps/index.d.ts +2 -118
- package/dist/components/Steps/index.js +1 -1
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.css +9 -745
- package/dist/components/Switch/index.d.cts +2 -118
- package/dist/components/Switch/index.d.ts +2 -118
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Tab/index.cjs +3 -3
- package/dist/components/Tab/index.css +20 -9
- package/dist/components/Tab/index.d.cts +2 -0
- package/dist/components/Tab/index.d.ts +2 -0
- package/dist/components/Tab/index.js +3 -3
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.css +47 -4003
- package/dist/components/Table/index.d.cts +2 -118
- package/dist/components/Table/index.d.ts +2 -118
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tag/index.cjs +3 -2
- package/dist/components/Tag/index.css +27 -467
- package/dist/components/Tag/index.d.cts +4 -118
- package/dist/components/Tag/index.d.ts +4 -118
- package/dist/components/Tag/index.js +3 -2
- package/dist/components/TextArea/index.cjs +1 -1
- package/dist/components/TextArea/index.css +4 -4
- package/dist/components/TextArea/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.css +8 -8
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Tooltip/index.cjs +1 -1
- package/dist/components/Tooltip/index.css +4 -560
- package/dist/components/Tooltip/index.d.cts +2 -118
- package/dist/components/Tooltip/index.d.ts +2 -118
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Video/index.cjs +1 -1
- package/dist/components/Video/index.css +3 -3
- package/dist/components/Video/index.js +1 -1
- package/dist/components/index.cjs +441 -347
- package/dist/components/index.css +1278 -12638
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +439 -346
- package/dist/index.cjs +466 -371
- package/dist/index.css +1281 -12641
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +466 -370
- package/dist/layout/Grid/FullGrid/index.cjs +1 -1
- package/dist/layout/Grid/FullGrid/index.js +1 -1
- package/dist/layout/Grid/FullScreen/index.cjs +1 -1
- package/dist/layout/Grid/FullScreen/index.js +1 -1
- package/dist/layout/Grid/Item/index.cjs +1 -1
- package/dist/layout/Grid/Item/index.js +1 -1
- package/dist/layout/Grid/index.cjs +1 -1
- package/dist/layout/Grid/index.js +1 -1
- package/dist/layout/Header/index.css +2 -2
- package/dist/layout/Layout/index.css +1 -1
- package/dist/layout/SideBar/index.cjs +1 -1
- package/dist/layout/SideBar/index.js +1 -1
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.css +3 -3
- package/dist/layout/index.js +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +12 -12
- package/README.md +0 -123
package/dist/components/index.js
CHANGED
|
@@ -1251,7 +1251,7 @@ var SuccessIcon = () => /* @__PURE__ */ jsx294(
|
|
|
1251
1251
|
);
|
|
1252
1252
|
var SuccessIcon_default = SuccessIcon;
|
|
1253
1253
|
|
|
1254
|
-
// node_modules/clsx/dist/clsx.mjs
|
|
1254
|
+
// ../../node_modules/clsx/dist/clsx.mjs
|
|
1255
1255
|
function r(e) {
|
|
1256
1256
|
var t, f, n = "";
|
|
1257
1257
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -1302,26 +1302,37 @@ var AccordionItem = ({ item, isOpen, onToggle }) => {
|
|
|
1302
1302
|
] });
|
|
1303
1303
|
};
|
|
1304
1304
|
var Accordion = (props) => {
|
|
1305
|
-
const { items,
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1305
|
+
const { items, className } = props;
|
|
1306
|
+
const isMultiple = props.multiple === true;
|
|
1307
|
+
const controlledKeys = isMultiple ? props.activeKeys : props.activeKey !== void 0 ? props.activeKey !== null ? [props.activeKey] : [] : void 0;
|
|
1308
|
+
const defaultKeys = isMultiple ? props.defaultActiveKeys ?? [] : props.defaultActiveKey ? [props.defaultActiveKey] : [];
|
|
1309
|
+
const isControlled = controlledKeys !== void 0;
|
|
1310
|
+
const [uncontrolledKeys, setUncontrolledKeys] = React.useState(
|
|
1311
|
+
new Set(defaultKeys)
|
|
1308
1312
|
);
|
|
1313
|
+
const currentKeys = isControlled ? new Set(controlledKeys) : uncontrolledKeys;
|
|
1309
1314
|
const toggle = (key) => {
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
}
|
|
1315
|
+
const next = new Set(isMultiple ? currentKeys : []);
|
|
1316
|
+
if (currentKeys.has(key)) {
|
|
1317
|
+
next.delete(key);
|
|
1318
|
+
} else {
|
|
1319
|
+
next.add(key);
|
|
1320
|
+
}
|
|
1321
|
+
if (!isControlled) {
|
|
1322
|
+
setUncontrolledKeys(next);
|
|
1323
|
+
}
|
|
1324
|
+
if (isMultiple) {
|
|
1325
|
+
props.onChange?.([...next]);
|
|
1326
|
+
} else {
|
|
1327
|
+
const first = [...next][0] ?? null;
|
|
1328
|
+
props.onChange?.(first);
|
|
1329
|
+
}
|
|
1319
1330
|
};
|
|
1320
1331
|
return /* @__PURE__ */ jsx295("div", { className: clsx_default("lib-xplat-accordion", className), children: items.map((item) => /* @__PURE__ */ jsx295(
|
|
1321
1332
|
AccordionItem,
|
|
1322
1333
|
{
|
|
1323
1334
|
item,
|
|
1324
|
-
isOpen:
|
|
1335
|
+
isOpen: currentKeys.has(item.key),
|
|
1325
1336
|
onToggle: () => toggle(item.key)
|
|
1326
1337
|
},
|
|
1327
1338
|
item.key
|
|
@@ -1516,6 +1527,7 @@ var Badge = (props) => {
|
|
|
1516
1527
|
count,
|
|
1517
1528
|
maxCount = 99,
|
|
1518
1529
|
dot = false,
|
|
1530
|
+
size = "md",
|
|
1519
1531
|
colorNamespace = "xplat",
|
|
1520
1532
|
color = "red",
|
|
1521
1533
|
colorDepth,
|
|
@@ -1528,7 +1540,7 @@ var Badge = (props) => {
|
|
|
1528
1540
|
);
|
|
1529
1541
|
const showBadge = dot || count !== void 0 && count > 0;
|
|
1530
1542
|
const displayCount = count !== void 0 && count > maxCount ? `${maxCount}+` : count;
|
|
1531
|
-
return /* @__PURE__ */ jsxs191("div", { className: clsx_default("lib-xplat-badge", className), children: [
|
|
1543
|
+
return /* @__PURE__ */ jsxs191("div", { className: clsx_default("lib-xplat-badge", size, className), children: [
|
|
1532
1544
|
children,
|
|
1533
1545
|
showBadge && /* @__PURE__ */ jsx298("span", { className: clsx_default("badge-indicator", colorClass, { dot }), children: !dot && displayCount })
|
|
1534
1546
|
] });
|
|
@@ -1557,6 +1569,7 @@ var Button = (props) => {
|
|
|
1557
1569
|
const {
|
|
1558
1570
|
children,
|
|
1559
1571
|
type = "primary",
|
|
1572
|
+
size = "md",
|
|
1560
1573
|
colorNamespace = "xplat",
|
|
1561
1574
|
color = "black",
|
|
1562
1575
|
colorDepth,
|
|
@@ -1572,7 +1585,7 @@ var Button = (props) => {
|
|
|
1572
1585
|
return /* @__PURE__ */ jsx300(
|
|
1573
1586
|
"button",
|
|
1574
1587
|
{
|
|
1575
|
-
className: clsx_default("lib-xplat-button", type, colorClass, className),
|
|
1588
|
+
className: clsx_default("lib-xplat-button", type, size, colorClass, className),
|
|
1576
1589
|
disabled,
|
|
1577
1590
|
...rest,
|
|
1578
1591
|
children
|
|
@@ -1593,8 +1606,77 @@ var Card = ({ children, title, className }) => {
|
|
|
1593
1606
|
Card.displayName = "Card";
|
|
1594
1607
|
var Card_default = Card;
|
|
1595
1608
|
|
|
1596
|
-
// src/components/
|
|
1609
|
+
// src/components/CardTab/CardTab.tsx
|
|
1597
1610
|
import React2 from "react";
|
|
1611
|
+
|
|
1612
|
+
// src/components/CardTab/CardTabPanel.tsx
|
|
1613
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
1614
|
+
var CardTabPanel = (props) => {
|
|
1615
|
+
const { children, columns = 3, className } = props;
|
|
1616
|
+
return /* @__PURE__ */ jsx302(
|
|
1617
|
+
"div",
|
|
1618
|
+
{
|
|
1619
|
+
className: clsx_default("card-tab-panel", className),
|
|
1620
|
+
style: { "--card-tab-columns": columns },
|
|
1621
|
+
children
|
|
1622
|
+
}
|
|
1623
|
+
);
|
|
1624
|
+
};
|
|
1625
|
+
CardTabPanel.displayName = "CardTab.Panel";
|
|
1626
|
+
var CardTabPanel_default = CardTabPanel;
|
|
1627
|
+
|
|
1628
|
+
// src/components/CardTab/CardTab.tsx
|
|
1629
|
+
import { jsx as jsx303, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
1630
|
+
var CardTabRoot = (props) => {
|
|
1631
|
+
const {
|
|
1632
|
+
tabs,
|
|
1633
|
+
activeValue: activeValueProp,
|
|
1634
|
+
onChange,
|
|
1635
|
+
size = "md",
|
|
1636
|
+
children,
|
|
1637
|
+
className
|
|
1638
|
+
} = props;
|
|
1639
|
+
const isControlled = activeValueProp !== void 0;
|
|
1640
|
+
const [uncontrolledValue, setUncontrolledValue] = React2.useState(tabs[0]?.value ?? "");
|
|
1641
|
+
const activeValue = isControlled ? activeValueProp : uncontrolledValue;
|
|
1642
|
+
const handleTabClick = (tab) => {
|
|
1643
|
+
if (!isControlled) {
|
|
1644
|
+
setUncontrolledValue(tab.value);
|
|
1645
|
+
}
|
|
1646
|
+
onChange?.(tab);
|
|
1647
|
+
};
|
|
1648
|
+
const panels = React2.Children.toArray(children).filter(
|
|
1649
|
+
(child) => React2.isValidElement(child) && child.type === CardTabPanel_default
|
|
1650
|
+
);
|
|
1651
|
+
const activePanel = panels.find(
|
|
1652
|
+
(panel) => panel.props.value === activeValue
|
|
1653
|
+
);
|
|
1654
|
+
return /* @__PURE__ */ jsxs194("div", { className: clsx_default("lib-xplat-card-tab", size, className), children: [
|
|
1655
|
+
/* @__PURE__ */ jsx303("div", { className: "card-tab-bar", children: tabs.map((tab) => {
|
|
1656
|
+
const isActive = tab.value === activeValue;
|
|
1657
|
+
return /* @__PURE__ */ jsx303(
|
|
1658
|
+
"button",
|
|
1659
|
+
{
|
|
1660
|
+
className: clsx_default("card-tab-trigger", isActive && "active"),
|
|
1661
|
+
onClick: () => handleTabClick(tab),
|
|
1662
|
+
role: "tab",
|
|
1663
|
+
"aria-selected": isActive,
|
|
1664
|
+
children: tab.title
|
|
1665
|
+
},
|
|
1666
|
+
tab.value
|
|
1667
|
+
);
|
|
1668
|
+
}) }),
|
|
1669
|
+
/* @__PURE__ */ jsx303("div", { className: "card-tab-body", children: activePanel })
|
|
1670
|
+
] });
|
|
1671
|
+
};
|
|
1672
|
+
CardTabRoot.displayName = "CardTab";
|
|
1673
|
+
var CardTab = Object.assign(CardTabRoot, {
|
|
1674
|
+
Panel: CardTabPanel_default
|
|
1675
|
+
});
|
|
1676
|
+
var CardTab_default = CardTab;
|
|
1677
|
+
|
|
1678
|
+
// src/components/Chart/Chart.tsx
|
|
1679
|
+
import React3 from "react";
|
|
1598
1680
|
import {
|
|
1599
1681
|
ArcElement,
|
|
1600
1682
|
BarElement,
|
|
@@ -1737,7 +1819,7 @@ var getIndexColorByPreset = (preset, index) => {
|
|
|
1737
1819
|
};
|
|
1738
1820
|
|
|
1739
1821
|
// src/components/Chart/Chart.tsx
|
|
1740
|
-
import { jsx as
|
|
1822
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
1741
1823
|
ChartJS.register(
|
|
1742
1824
|
CategoryScale,
|
|
1743
1825
|
LinearScale,
|
|
@@ -1752,12 +1834,12 @@ ChartJS.register(
|
|
|
1752
1834
|
);
|
|
1753
1835
|
var Chart = (props) => {
|
|
1754
1836
|
const { type, data, labels } = props;
|
|
1755
|
-
const chartInstanceRef =
|
|
1756
|
-
const containerRef =
|
|
1757
|
-
const chartRef =
|
|
1837
|
+
const chartInstanceRef = React3.useRef(null);
|
|
1838
|
+
const containerRef = React3.useRef(null);
|
|
1839
|
+
const chartRef = React3.useCallback((instance) => {
|
|
1758
1840
|
chartInstanceRef.current = instance ?? null;
|
|
1759
1841
|
}, []);
|
|
1760
|
-
const datasets =
|
|
1842
|
+
const datasets = React3.useMemo(() => {
|
|
1761
1843
|
const pallette = getChartColorPreset(type);
|
|
1762
1844
|
return Object.entries(data).map(([key, values], index) => {
|
|
1763
1845
|
const uniqueColors = getIndexColorByPreset(pallette, index);
|
|
@@ -1811,21 +1893,21 @@ var Chart = (props) => {
|
|
|
1811
1893
|
formatter: (value) => `${value}`
|
|
1812
1894
|
};
|
|
1813
1895
|
}
|
|
1814
|
-
const renderChart =
|
|
1896
|
+
const renderChart = React3.useMemo(() => {
|
|
1815
1897
|
switch (type) {
|
|
1816
1898
|
case "line":
|
|
1817
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsx304(Line, { ref: chartRef, data: chartData, options });
|
|
1818
1900
|
case "bar":
|
|
1819
|
-
return /* @__PURE__ */
|
|
1901
|
+
return /* @__PURE__ */ jsx304(Bar, { ref: chartRef, data: chartData, options });
|
|
1820
1902
|
case "pie":
|
|
1821
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsx304(Pie, { ref: chartRef, data: chartData, options });
|
|
1822
1904
|
case "doughnut":
|
|
1823
|
-
return /* @__PURE__ */
|
|
1905
|
+
return /* @__PURE__ */ jsx304(Doughnut, { ref: chartRef, data: chartData, options });
|
|
1824
1906
|
default:
|
|
1825
1907
|
return null;
|
|
1826
1908
|
}
|
|
1827
1909
|
}, [chartData, options, type]);
|
|
1828
|
-
|
|
1910
|
+
React3.useEffect(() => {
|
|
1829
1911
|
if (!containerRef.current || !chartInstanceRef.current) return;
|
|
1830
1912
|
const observer = new ResizeObserver(() => {
|
|
1831
1913
|
requestAnimationFrame(() => {
|
|
@@ -1835,13 +1917,13 @@ var Chart = (props) => {
|
|
|
1835
1917
|
observer.observe(containerRef.current);
|
|
1836
1918
|
return () => observer.disconnect();
|
|
1837
1919
|
}, []);
|
|
1838
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsx304("div", { className: "lib-xplat-chart", ref: containerRef, children: renderChart });
|
|
1839
1921
|
};
|
|
1840
1922
|
Chart.displayName = "Chart";
|
|
1841
1923
|
var Chart_default = Chart;
|
|
1842
1924
|
|
|
1843
1925
|
// src/components/CheckBox/CheckBox.tsx
|
|
1844
|
-
import { jsx as
|
|
1926
|
+
import { jsx as jsx305, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
1845
1927
|
var CheckBox = (props) => {
|
|
1846
1928
|
const {
|
|
1847
1929
|
colorNamespace = "xplat",
|
|
@@ -1852,6 +1934,7 @@ var CheckBox = (props) => {
|
|
|
1852
1934
|
onChange,
|
|
1853
1935
|
className,
|
|
1854
1936
|
disabled,
|
|
1937
|
+
size = "md",
|
|
1855
1938
|
...rest
|
|
1856
1939
|
} = props;
|
|
1857
1940
|
const handleChange = (e) => {
|
|
@@ -1866,8 +1949,8 @@ var CheckBox = (props) => {
|
|
|
1866
1949
|
const checkedClasses = `checked ${mainColor}`;
|
|
1867
1950
|
const disabledClasses = "disabled";
|
|
1868
1951
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
1869
|
-
return /* @__PURE__ */
|
|
1870
|
-
/* @__PURE__ */
|
|
1952
|
+
return /* @__PURE__ */ jsxs195("label", { className: clsx_default("lib-xplat-checkbox", size, className), children: [
|
|
1953
|
+
/* @__PURE__ */ jsx305(
|
|
1871
1954
|
"input",
|
|
1872
1955
|
{
|
|
1873
1956
|
type: "checkbox",
|
|
@@ -1877,15 +1960,15 @@ var CheckBox = (props) => {
|
|
|
1877
1960
|
...rest
|
|
1878
1961
|
}
|
|
1879
1962
|
),
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
label && /* @__PURE__ */
|
|
1963
|
+
/* @__PURE__ */ jsx305("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx305("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx305(CheckIcon_default, {}) }) }),
|
|
1964
|
+
label && /* @__PURE__ */ jsx305("span", { className: "label", children: label })
|
|
1882
1965
|
] });
|
|
1883
1966
|
};
|
|
1884
1967
|
CheckBox.displayName = "CheckBox";
|
|
1885
1968
|
var CheckBox_default = CheckBox;
|
|
1886
1969
|
|
|
1887
1970
|
// src/components/Chip/Chip.tsx
|
|
1888
|
-
import { jsx as
|
|
1971
|
+
import { jsx as jsx306 } from "react/jsx-runtime";
|
|
1889
1972
|
var Chip = (props) => {
|
|
1890
1973
|
const {
|
|
1891
1974
|
children,
|
|
@@ -1893,6 +1976,7 @@ var Chip = (props) => {
|
|
|
1893
1976
|
color = "black",
|
|
1894
1977
|
colorDepth,
|
|
1895
1978
|
type = "primary",
|
|
1979
|
+
size = "md",
|
|
1896
1980
|
className
|
|
1897
1981
|
} = props;
|
|
1898
1982
|
const colorClass = getColorClass(
|
|
@@ -1900,29 +1984,29 @@ var Chip = (props) => {
|
|
|
1900
1984
|
color,
|
|
1901
1985
|
colorDepth ?? 500
|
|
1902
1986
|
);
|
|
1903
|
-
return /* @__PURE__ */
|
|
1987
|
+
return /* @__PURE__ */ jsx306("div", { className: clsx_default("lib-xplat-chip", type, size, colorClass, className), children });
|
|
1904
1988
|
};
|
|
1905
1989
|
Chip.displayName = "Chip";
|
|
1906
1990
|
var Chip_default = Chip;
|
|
1907
1991
|
|
|
1908
1992
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
1909
|
-
import
|
|
1993
|
+
import React6 from "react";
|
|
1910
1994
|
|
|
1911
1995
|
// src/components/Input/Input.tsx
|
|
1912
|
-
import
|
|
1996
|
+
import React4 from "react";
|
|
1913
1997
|
|
|
1914
1998
|
// src/components/Input/InputValidations.tsx
|
|
1915
|
-
import { jsx as
|
|
1999
|
+
import { jsx as jsx307, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
1916
2000
|
var InputValidations = (props) => {
|
|
1917
2001
|
const { message, status = "default" } = props;
|
|
1918
|
-
return /* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
status === "default" && /* @__PURE__ */
|
|
1921
|
-
status === "success" && /* @__PURE__ */
|
|
1922
|
-
status === "warning" && /* @__PURE__ */
|
|
1923
|
-
status === "error" && /* @__PURE__ */
|
|
2002
|
+
return /* @__PURE__ */ jsxs196("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
|
|
2003
|
+
/* @__PURE__ */ jsxs196("div", { className: "icon", children: [
|
|
2004
|
+
status === "default" && /* @__PURE__ */ jsx307(InfoIcon_default, {}),
|
|
2005
|
+
status === "success" && /* @__PURE__ */ jsx307(SuccessIcon_default, {}),
|
|
2006
|
+
status === "warning" && /* @__PURE__ */ jsx307(InfoIcon_default, {}),
|
|
2007
|
+
status === "error" && /* @__PURE__ */ jsx307(ErrorIcon_default, {})
|
|
1924
2008
|
] }),
|
|
1925
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx307("div", { className: "message", children: message })
|
|
1926
2010
|
] });
|
|
1927
2011
|
};
|
|
1928
2012
|
InputValidations.displayName = "InputValidations";
|
|
@@ -1963,7 +2047,7 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
1963
2047
|
};
|
|
1964
2048
|
|
|
1965
2049
|
// src/components/Input/Input.tsx
|
|
1966
|
-
import { jsx as
|
|
2050
|
+
import { jsx as jsx308, jsxs as jsxs197 } from "react/jsx-runtime";
|
|
1967
2051
|
import { createElement } from "react";
|
|
1968
2052
|
var formatValue = (type, value) => {
|
|
1969
2053
|
if (value === null || value === void 0) return "";
|
|
@@ -2012,11 +2096,12 @@ var parseValue = (type, value) => {
|
|
|
2012
2096
|
return value;
|
|
2013
2097
|
}
|
|
2014
2098
|
};
|
|
2015
|
-
var Input =
|
|
2099
|
+
var Input = React4.forwardRef((props, ref) => {
|
|
2016
2100
|
const {
|
|
2017
2101
|
value,
|
|
2018
2102
|
onChange,
|
|
2019
2103
|
type = "text",
|
|
2104
|
+
size = "md",
|
|
2020
2105
|
suffix,
|
|
2021
2106
|
className,
|
|
2022
2107
|
disabled,
|
|
@@ -2038,13 +2123,13 @@ var Input = React3.forwardRef((props, ref) => {
|
|
|
2038
2123
|
onChange(event);
|
|
2039
2124
|
}
|
|
2040
2125
|
};
|
|
2041
|
-
return /* @__PURE__ */
|
|
2042
|
-
/* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsxs197("div", { className: clsx_default("lib-xplat-input-wrap", className), children: [
|
|
2127
|
+
/* @__PURE__ */ jsxs197(
|
|
2043
2128
|
"div",
|
|
2044
2129
|
{
|
|
2045
|
-
className: clsx_default("lib-xplat-input", disabled ? "disabled" : void 0),
|
|
2130
|
+
className: clsx_default("lib-xplat-input", size, disabled ? "disabled" : void 0),
|
|
2046
2131
|
children: [
|
|
2047
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ jsx308(
|
|
2048
2133
|
"input",
|
|
2049
2134
|
{
|
|
2050
2135
|
...inputProps,
|
|
@@ -2055,11 +2140,11 @@ var Input = React3.forwardRef((props, ref) => {
|
|
|
2055
2140
|
onChange: handleChange
|
|
2056
2141
|
}
|
|
2057
2142
|
),
|
|
2058
|
-
suffix && /* @__PURE__ */
|
|
2143
|
+
suffix && /* @__PURE__ */ jsx308("div", { className: "suffix", children: suffix })
|
|
2059
2144
|
]
|
|
2060
2145
|
}
|
|
2061
2146
|
),
|
|
2062
|
-
validations && /* @__PURE__ */
|
|
2147
|
+
validations && /* @__PURE__ */ jsx308("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ createElement(
|
|
2063
2148
|
InputValidations_default,
|
|
2064
2149
|
{
|
|
2065
2150
|
...validation,
|
|
@@ -2072,20 +2157,20 @@ Input.displayName = "Input";
|
|
|
2072
2157
|
var Input_default = Input;
|
|
2073
2158
|
|
|
2074
2159
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
2075
|
-
import
|
|
2076
|
-
import { jsx as
|
|
2077
|
-
var PasswordInput =
|
|
2160
|
+
import React5 from "react";
|
|
2161
|
+
import { jsx as jsx309 } from "react/jsx-runtime";
|
|
2162
|
+
var PasswordInput = React5.forwardRef(
|
|
2078
2163
|
(props, ref) => {
|
|
2079
2164
|
const { reg: _reg, ...inputProps } = props;
|
|
2080
|
-
const [isView, setIsView] =
|
|
2165
|
+
const [isView, setIsView] = React5.useState(false);
|
|
2081
2166
|
const handleChangeView = () => {
|
|
2082
2167
|
setIsView((prev) => !prev);
|
|
2083
2168
|
};
|
|
2084
|
-
return /* @__PURE__ */
|
|
2169
|
+
return /* @__PURE__ */ jsx309(
|
|
2085
2170
|
Input_default,
|
|
2086
2171
|
{
|
|
2087
2172
|
...inputProps,
|
|
2088
|
-
suffix: /* @__PURE__ */
|
|
2173
|
+
suffix: /* @__PURE__ */ jsx309("div", { className: "wrapper pointer", onClick: handleChangeView, children: isView ? /* @__PURE__ */ jsx309(OpenEyeIcon_default, {}) : /* @__PURE__ */ jsx309(CloseEyeIcon_default, {}) }),
|
|
2089
2174
|
type: isView ? "text" : "password",
|
|
2090
2175
|
ref
|
|
2091
2176
|
}
|
|
@@ -2098,8 +2183,8 @@ var PasswordInput_default = PasswordInput;
|
|
|
2098
2183
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
2099
2184
|
import DatePicker from "react-datepicker";
|
|
2100
2185
|
import "react-datepicker/dist/react-datepicker.css";
|
|
2101
|
-
import { jsx as
|
|
2102
|
-
var Suffix = () => /* @__PURE__ */
|
|
2186
|
+
import { jsx as jsx310 } from "react/jsx-runtime";
|
|
2187
|
+
var Suffix = () => /* @__PURE__ */ jsx310("div", { children: /* @__PURE__ */ jsx310(CalenderIcon_default, {}) });
|
|
2103
2188
|
var InputDatePicker = (props) => {
|
|
2104
2189
|
const { value, onChange, disabled, ...rest } = props;
|
|
2105
2190
|
const handleChange = (date) => {
|
|
@@ -2113,22 +2198,22 @@ var InputDatePicker = (props) => {
|
|
|
2113
2198
|
const d = String(date.getDate()).padStart(2, "0");
|
|
2114
2199
|
return `${y}/${m}/${d}`;
|
|
2115
2200
|
};
|
|
2116
|
-
const CustomInput =
|
|
2201
|
+
const CustomInput = React6.forwardRef(({ onClick }, _ref) => /* @__PURE__ */ jsx310("div", { onClick, children: /* @__PURE__ */ jsx310(
|
|
2117
2202
|
Input_default,
|
|
2118
2203
|
{
|
|
2119
2204
|
value: formatDate(value),
|
|
2120
|
-
suffix: /* @__PURE__ */
|
|
2205
|
+
suffix: /* @__PURE__ */ jsx310(Suffix, {}),
|
|
2121
2206
|
disabled
|
|
2122
2207
|
}
|
|
2123
2208
|
) }));
|
|
2124
2209
|
CustomInput.displayName = "InputDatePickerCustomInput";
|
|
2125
|
-
return /* @__PURE__ */
|
|
2210
|
+
return /* @__PURE__ */ jsx310("div", { className: "lib-xplat-datepicker", children: /* @__PURE__ */ jsx310(
|
|
2126
2211
|
DatePicker,
|
|
2127
2212
|
{
|
|
2128
2213
|
selected: value,
|
|
2129
2214
|
onChange: handleChange,
|
|
2130
2215
|
...rest,
|
|
2131
|
-
customInput: /* @__PURE__ */
|
|
2216
|
+
customInput: /* @__PURE__ */ jsx310(CustomInput, {}),
|
|
2132
2217
|
dateFormat: "YYYY/MM/dd"
|
|
2133
2218
|
}
|
|
2134
2219
|
) });
|
|
@@ -2137,18 +2222,18 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
2137
2222
|
var InputDatePicker_default = InputDatePicker;
|
|
2138
2223
|
|
|
2139
2224
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2140
|
-
import
|
|
2225
|
+
import React8 from "react";
|
|
2141
2226
|
|
|
2142
2227
|
// src/components/Modal/Modal.tsx
|
|
2143
|
-
import
|
|
2228
|
+
import React7 from "react";
|
|
2144
2229
|
import { createPortal } from "react-dom";
|
|
2145
|
-
import { jsx as
|
|
2230
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
2146
2231
|
var ANIMATION_DURATION_MS = 200;
|
|
2147
2232
|
var Modal = (props) => {
|
|
2148
2233
|
const { isOpen, onClose, children } = props;
|
|
2149
|
-
const [mounted, setMounted] =
|
|
2150
|
-
const [visible, setVisible] =
|
|
2151
|
-
|
|
2234
|
+
const [mounted, setMounted] = React7.useState(false);
|
|
2235
|
+
const [visible, setVisible] = React7.useState(false);
|
|
2236
|
+
React7.useEffect(() => {
|
|
2152
2237
|
if (isOpen) {
|
|
2153
2238
|
setMounted(true);
|
|
2154
2239
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2162,12 +2247,12 @@ var Modal = (props) => {
|
|
|
2162
2247
|
if (!mounted) return null;
|
|
2163
2248
|
const stateClass = visible ? "enter" : "exit";
|
|
2164
2249
|
return createPortal(
|
|
2165
|
-
/* @__PURE__ */
|
|
2250
|
+
/* @__PURE__ */ jsx311(
|
|
2166
2251
|
"div",
|
|
2167
2252
|
{
|
|
2168
2253
|
className: clsx_default("lib-xplat-modal", "dim", stateClass),
|
|
2169
2254
|
onClick: onClose,
|
|
2170
|
-
children: /* @__PURE__ */
|
|
2255
|
+
children: /* @__PURE__ */ jsx311(
|
|
2171
2256
|
"div",
|
|
2172
2257
|
{
|
|
2173
2258
|
className: clsx_default("lib-xplat-modal", "modal-box", stateClass),
|
|
@@ -2188,7 +2273,7 @@ var Modal_default = Modal;
|
|
|
2188
2273
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
2189
2274
|
import DatePicker2 from "react-datepicker";
|
|
2190
2275
|
import "react-datepicker/dist/react-datepicker.css";
|
|
2191
|
-
import { jsx as
|
|
2276
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
2192
2277
|
function getColorValue(ns, color, depth) {
|
|
2193
2278
|
const nsColors = colors[ns];
|
|
2194
2279
|
const colorEntry = nsColors[color];
|
|
@@ -2214,12 +2299,12 @@ var SingleDatePicker = (props) => {
|
|
|
2214
2299
|
color,
|
|
2215
2300
|
colorDepth ?? 500
|
|
2216
2301
|
);
|
|
2217
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ jsx312(
|
|
2218
2303
|
"div",
|
|
2219
2304
|
{
|
|
2220
2305
|
className: "lib-xplat-datepicker",
|
|
2221
2306
|
style: { "--datepicker-active-color": activeColor },
|
|
2222
|
-
children: /* @__PURE__ */
|
|
2307
|
+
children: /* @__PURE__ */ jsx312(
|
|
2223
2308
|
DatePicker2,
|
|
2224
2309
|
{
|
|
2225
2310
|
selected: value,
|
|
@@ -2236,10 +2321,10 @@ SingleDatePicker.displayName = "SingleDatePicker";
|
|
|
2236
2321
|
var SingleDatePicker_default = SingleDatePicker;
|
|
2237
2322
|
|
|
2238
2323
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
2239
|
-
import { jsx as
|
|
2324
|
+
import { jsx as jsx313, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
2240
2325
|
var PopupPicker = (props) => {
|
|
2241
2326
|
const { component, type } = props;
|
|
2242
|
-
const [isOpen, setIsOpen] =
|
|
2327
|
+
const [isOpen, setIsOpen] = React8.useState(false);
|
|
2243
2328
|
const handleClick = () => setIsOpen(true);
|
|
2244
2329
|
const handleClose = () => setIsOpen(false);
|
|
2245
2330
|
const handleSingleChange = (date) => {
|
|
@@ -2247,11 +2332,11 @@ var PopupPicker = (props) => {
|
|
|
2247
2332
|
props.onChange?.(date);
|
|
2248
2333
|
handleClose();
|
|
2249
2334
|
};
|
|
2250
|
-
return /* @__PURE__ */
|
|
2251
|
-
|
|
2252
|
-
/* @__PURE__ */
|
|
2253
|
-
/* @__PURE__ */
|
|
2254
|
-
type === "single" && /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ jsxs198("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
2336
|
+
React8.cloneElement(component, { onClick: handleClick }),
|
|
2337
|
+
/* @__PURE__ */ jsx313(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ jsxs198("div", { className: "lib-xplat-popup-datepicker-card", children: [
|
|
2338
|
+
/* @__PURE__ */ jsxs198("div", { className: "popup-datepicker-content", children: [
|
|
2339
|
+
type === "single" && /* @__PURE__ */ jsx313(
|
|
2255
2340
|
SingleDatePicker_default,
|
|
2256
2341
|
{
|
|
2257
2342
|
value: props.value,
|
|
@@ -2260,7 +2345,7 @@ var PopupPicker = (props) => {
|
|
|
2260
2345
|
maxDate: props.maxDate
|
|
2261
2346
|
}
|
|
2262
2347
|
),
|
|
2263
|
-
type === "range" && /* @__PURE__ */
|
|
2348
|
+
type === "range" && /* @__PURE__ */ jsx313(
|
|
2264
2349
|
RangePicker_default,
|
|
2265
2350
|
{
|
|
2266
2351
|
startDate: props.startDate,
|
|
@@ -2271,8 +2356,8 @@ var PopupPicker = (props) => {
|
|
|
2271
2356
|
}
|
|
2272
2357
|
)
|
|
2273
2358
|
] }),
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ jsxs198("div", { className: "popup-datepicker-footer", children: [
|
|
2360
|
+
/* @__PURE__ */ jsx313(
|
|
2276
2361
|
Button_default,
|
|
2277
2362
|
{
|
|
2278
2363
|
type: "secondary",
|
|
@@ -2282,7 +2367,7 @@ var PopupPicker = (props) => {
|
|
|
2282
2367
|
children: "\uCDE8\uC18C"
|
|
2283
2368
|
}
|
|
2284
2369
|
),
|
|
2285
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsx313(Button_default, { type: "primary", color: "blue", onClick: handleClose, children: "\uC801\uC6A9" })
|
|
2286
2371
|
] })
|
|
2287
2372
|
] }) })
|
|
2288
2373
|
] });
|
|
@@ -2291,8 +2376,8 @@ PopupPicker.displayName = "PopupPicker";
|
|
|
2291
2376
|
var PopupPicker_default = PopupPicker;
|
|
2292
2377
|
|
|
2293
2378
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
2294
|
-
import
|
|
2295
|
-
import { jsx as
|
|
2379
|
+
import React9 from "react";
|
|
2380
|
+
import { jsx as jsx314, jsxs as jsxs199 } from "react/jsx-runtime";
|
|
2296
2381
|
function getDatesBetween(start, end) {
|
|
2297
2382
|
const dates = [];
|
|
2298
2383
|
const current = new Date(start);
|
|
@@ -2316,7 +2401,7 @@ var RangePicker = (props) => {
|
|
|
2316
2401
|
color,
|
|
2317
2402
|
colorDepth
|
|
2318
2403
|
} = props;
|
|
2319
|
-
const rangeDates =
|
|
2404
|
+
const rangeDates = React9.useMemo(
|
|
2320
2405
|
() => getDatesBetween(startDate, endDate),
|
|
2321
2406
|
[startDate, endDate]
|
|
2322
2407
|
);
|
|
@@ -2325,10 +2410,10 @@ var RangePicker = (props) => {
|
|
|
2325
2410
|
...color !== void 0 && { color },
|
|
2326
2411
|
...colorDepth !== void 0 && { colorDepth }
|
|
2327
2412
|
};
|
|
2328
|
-
return /* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
-
/* @__PURE__ */
|
|
2331
|
-
/* @__PURE__ */
|
|
2413
|
+
return /* @__PURE__ */ jsxs199("div", { className: "lib-xplat-range-datepicker", children: [
|
|
2414
|
+
/* @__PURE__ */ jsxs199("div", { className: "lib-xplat-range-datepicker-from", children: [
|
|
2415
|
+
/* @__PURE__ */ jsx314("span", { className: "lib-xplat-range-datepicker-label", children: "\uC2DC\uC791" }),
|
|
2416
|
+
/* @__PURE__ */ jsx314(
|
|
2332
2417
|
SingleDatePicker_default,
|
|
2333
2418
|
{
|
|
2334
2419
|
value: startDate,
|
|
@@ -2340,9 +2425,9 @@ var RangePicker = (props) => {
|
|
|
2340
2425
|
}
|
|
2341
2426
|
)
|
|
2342
2427
|
] }),
|
|
2343
|
-
/* @__PURE__ */
|
|
2344
|
-
/* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2428
|
+
/* @__PURE__ */ jsxs199("div", { className: "lib-xplat-range-datepicker-to", children: [
|
|
2429
|
+
/* @__PURE__ */ jsx314("span", { className: "lib-xplat-range-datepicker-label", children: "\uC885\uB8CC" }),
|
|
2430
|
+
/* @__PURE__ */ jsx314(
|
|
2346
2431
|
SingleDatePicker_default,
|
|
2347
2432
|
{
|
|
2348
2433
|
value: endDate,
|
|
@@ -2360,10 +2445,10 @@ RangePicker.displayName = "RangePicker";
|
|
|
2360
2445
|
var RangePicker_default = RangePicker;
|
|
2361
2446
|
|
|
2362
2447
|
// src/components/Divider/Divider.tsx
|
|
2363
|
-
import { jsx as
|
|
2448
|
+
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
2364
2449
|
var Divider = (props) => {
|
|
2365
2450
|
const { orientation = "horizontal", className } = props;
|
|
2366
|
-
return /* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsx315(
|
|
2367
2452
|
"div",
|
|
2368
2453
|
{
|
|
2369
2454
|
className: clsx_default("lib-xplat-divider", orientation, className),
|
|
@@ -2376,15 +2461,15 @@ Divider.displayName = "Divider";
|
|
|
2376
2461
|
var Divider_default = Divider;
|
|
2377
2462
|
|
|
2378
2463
|
// src/components/Drawer/Drawer.tsx
|
|
2379
|
-
import
|
|
2464
|
+
import React10 from "react";
|
|
2380
2465
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2381
|
-
import { jsx as
|
|
2466
|
+
import { jsx as jsx316, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
2382
2467
|
var ANIMATION_DURATION_MS2 = 250;
|
|
2383
2468
|
var Drawer = (props) => {
|
|
2384
2469
|
const { isOpen, onClose, placement = "right", width = 320, title, children } = props;
|
|
2385
|
-
const [mounted, setMounted] =
|
|
2386
|
-
const [visible, setVisible] =
|
|
2387
|
-
|
|
2470
|
+
const [mounted, setMounted] = React10.useState(false);
|
|
2471
|
+
const [visible, setVisible] = React10.useState(false);
|
|
2472
|
+
React10.useEffect(() => {
|
|
2388
2473
|
if (isOpen) {
|
|
2389
2474
|
setMounted(true);
|
|
2390
2475
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2399,12 +2484,12 @@ var Drawer = (props) => {
|
|
|
2399
2484
|
const stateClass = visible ? "enter" : "exit";
|
|
2400
2485
|
const widthValue = typeof width === "number" ? `${width}px` : width;
|
|
2401
2486
|
return createPortal2(
|
|
2402
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx316(
|
|
2403
2488
|
"div",
|
|
2404
2489
|
{
|
|
2405
2490
|
className: clsx_default("lib-xplat-drawer-overlay", stateClass),
|
|
2406
2491
|
onClick: onClose,
|
|
2407
|
-
children: /* @__PURE__ */
|
|
2492
|
+
children: /* @__PURE__ */ jsxs200(
|
|
2408
2493
|
"div",
|
|
2409
2494
|
{
|
|
2410
2495
|
className: clsx_default("lib-xplat-drawer", placement, stateClass),
|
|
@@ -2413,11 +2498,11 @@ var Drawer = (props) => {
|
|
|
2413
2498
|
"aria-modal": "true",
|
|
2414
2499
|
onClick: (e) => e.stopPropagation(),
|
|
2415
2500
|
children: [
|
|
2416
|
-
title && /* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2501
|
+
title && /* @__PURE__ */ jsxs200("div", { className: "drawer-header", children: [
|
|
2502
|
+
/* @__PURE__ */ jsx316("span", { className: "drawer-title", children: title }),
|
|
2503
|
+
/* @__PURE__ */ jsx316("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
2419
2504
|
] }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2505
|
+
/* @__PURE__ */ jsx316("div", { className: "drawer-body", children })
|
|
2421
2506
|
]
|
|
2422
2507
|
}
|
|
2423
2508
|
)
|
|
@@ -2430,16 +2515,16 @@ Drawer.displayName = "Drawer";
|
|
|
2430
2515
|
var Drawer_default = Drawer;
|
|
2431
2516
|
|
|
2432
2517
|
// src/components/Dropdown/Dropdown.tsx
|
|
2433
|
-
import
|
|
2518
|
+
import React13 from "react";
|
|
2434
2519
|
|
|
2435
2520
|
// src/tokens/hooks/useAutoPosition.ts
|
|
2436
|
-
import
|
|
2521
|
+
import React11 from "react";
|
|
2437
2522
|
var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
2438
|
-
const [position, setPosition] =
|
|
2523
|
+
const [position, setPosition] = React11.useState({
|
|
2439
2524
|
position: {},
|
|
2440
2525
|
direction: "bottom"
|
|
2441
2526
|
});
|
|
2442
|
-
const calculatePosition =
|
|
2527
|
+
const calculatePosition = React11.useCallback(() => {
|
|
2443
2528
|
if (!triggerRef.current || !popRef.current) return;
|
|
2444
2529
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
2445
2530
|
const popRect = popRef.current.getBoundingClientRect();
|
|
@@ -2461,7 +2546,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
2461
2546
|
direction
|
|
2462
2547
|
});
|
|
2463
2548
|
}, [triggerRef, popRef]);
|
|
2464
|
-
|
|
2549
|
+
React11.useEffect(() => {
|
|
2465
2550
|
calculatePosition();
|
|
2466
2551
|
window.addEventListener("resize", calculatePosition);
|
|
2467
2552
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
@@ -2471,9 +2556,9 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
2471
2556
|
var useAutoPosition_default = useAutoPosition;
|
|
2472
2557
|
|
|
2473
2558
|
// src/tokens/hooks/useClickOutside.ts
|
|
2474
|
-
import
|
|
2559
|
+
import React12 from "react";
|
|
2475
2560
|
var useClickOutside = (refs, handler, enabled = true) => {
|
|
2476
|
-
|
|
2561
|
+
React12.useEffect(() => {
|
|
2477
2562
|
if (!enabled) return;
|
|
2478
2563
|
const refArray = Array.isArray(refs) ? refs : [refs];
|
|
2479
2564
|
const listener = (event) => {
|
|
@@ -2496,17 +2581,17 @@ var useClickOutside = (refs, handler, enabled = true) => {
|
|
|
2496
2581
|
var useClickOutside_default = useClickOutside;
|
|
2497
2582
|
|
|
2498
2583
|
// src/components/Dropdown/Dropdown.tsx
|
|
2499
|
-
import { jsx as
|
|
2584
|
+
import { jsx as jsx317, jsxs as jsxs201 } from "react/jsx-runtime";
|
|
2500
2585
|
var Dropdown = (props) => {
|
|
2501
2586
|
const { items, children, className } = props;
|
|
2502
|
-
const [isOpen, setIsOpen] =
|
|
2503
|
-
const [mounted, setMounted] =
|
|
2504
|
-
const [visible, setVisible] =
|
|
2505
|
-
const triggerRef =
|
|
2506
|
-
const menuRef =
|
|
2587
|
+
const [isOpen, setIsOpen] = React13.useState(false);
|
|
2588
|
+
const [mounted, setMounted] = React13.useState(false);
|
|
2589
|
+
const [visible, setVisible] = React13.useState(false);
|
|
2590
|
+
const triggerRef = React13.useRef(null);
|
|
2591
|
+
const menuRef = React13.useRef(null);
|
|
2507
2592
|
const { position, direction } = useAutoPosition_default(triggerRef, menuRef, isOpen);
|
|
2508
2593
|
useClickOutside_default([triggerRef, menuRef], () => setIsOpen(false));
|
|
2509
|
-
|
|
2594
|
+
React13.useEffect(() => {
|
|
2510
2595
|
if (isOpen) {
|
|
2511
2596
|
setMounted(true);
|
|
2512
2597
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2521,8 +2606,8 @@ var Dropdown = (props) => {
|
|
|
2521
2606
|
item.onClick?.();
|
|
2522
2607
|
setIsOpen(false);
|
|
2523
2608
|
};
|
|
2524
|
-
return /* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsxs201("div", { className: clsx_default("lib-xplat-dropdown", className), children: [
|
|
2610
|
+
/* @__PURE__ */ jsx317(
|
|
2526
2611
|
"div",
|
|
2527
2612
|
{
|
|
2528
2613
|
ref: triggerRef,
|
|
@@ -2531,14 +2616,14 @@ var Dropdown = (props) => {
|
|
|
2531
2616
|
children
|
|
2532
2617
|
}
|
|
2533
2618
|
),
|
|
2534
|
-
mounted && /* @__PURE__ */
|
|
2619
|
+
mounted && /* @__PURE__ */ jsx317(
|
|
2535
2620
|
"div",
|
|
2536
2621
|
{
|
|
2537
2622
|
ref: menuRef,
|
|
2538
2623
|
className: clsx_default("dropdown-menu", direction, { visible }),
|
|
2539
2624
|
style: { top: position.top, left: position.left },
|
|
2540
2625
|
role: "menu",
|
|
2541
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2626
|
+
children: items.map((item) => /* @__PURE__ */ jsx317(
|
|
2542
2627
|
"button",
|
|
2543
2628
|
{
|
|
2544
2629
|
className: clsx_default("dropdown-item", {
|
|
@@ -2560,23 +2645,23 @@ Dropdown.displayName = "Dropdown";
|
|
|
2560
2645
|
var Dropdown_default = Dropdown;
|
|
2561
2646
|
|
|
2562
2647
|
// src/components/EmptyState/EmptyState.tsx
|
|
2563
|
-
import { jsx as
|
|
2648
|
+
import { jsx as jsx318, jsxs as jsxs202 } from "react/jsx-runtime";
|
|
2564
2649
|
var EmptyState = (props) => {
|
|
2565
2650
|
const { icon, title = "\uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4", description, action, className } = props;
|
|
2566
|
-
return /* @__PURE__ */
|
|
2567
|
-
icon && /* @__PURE__ */
|
|
2568
|
-
!icon && /* @__PURE__ */
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
description && /* @__PURE__ */
|
|
2571
|
-
action && /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ jsxs202("div", { className: clsx_default("lib-xplat-empty-state", className), children: [
|
|
2652
|
+
icon && /* @__PURE__ */ jsx318("div", { className: "empty-icon", children: icon }),
|
|
2653
|
+
!icon && /* @__PURE__ */ jsx318("div", { className: "empty-icon", children: /* @__PURE__ */ jsx318("svg", { viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx318("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" }) }) }),
|
|
2654
|
+
/* @__PURE__ */ jsx318("p", { className: "empty-title", children: title }),
|
|
2655
|
+
description && /* @__PURE__ */ jsx318("p", { className: "empty-description", children: description }),
|
|
2656
|
+
action && /* @__PURE__ */ jsx318("div", { className: "empty-action", children: action })
|
|
2572
2657
|
] });
|
|
2573
2658
|
};
|
|
2574
2659
|
EmptyState.displayName = "EmptyState";
|
|
2575
2660
|
var EmptyState_default = EmptyState;
|
|
2576
2661
|
|
|
2577
2662
|
// src/components/FileUpload/FileUpload.tsx
|
|
2578
|
-
import
|
|
2579
|
-
import { jsx as
|
|
2663
|
+
import React14 from "react";
|
|
2664
|
+
import { jsx as jsx319, jsxs as jsxs203 } from "react/jsx-runtime";
|
|
2580
2665
|
var FileUpload = (props) => {
|
|
2581
2666
|
const {
|
|
2582
2667
|
accept,
|
|
@@ -2587,8 +2672,8 @@ var FileUpload = (props) => {
|
|
|
2587
2672
|
description,
|
|
2588
2673
|
className
|
|
2589
2674
|
} = props;
|
|
2590
|
-
const [isDragOver, setIsDragOver] =
|
|
2591
|
-
const inputRef =
|
|
2675
|
+
const [isDragOver, setIsDragOver] = React14.useState(false);
|
|
2676
|
+
const inputRef = React14.useRef(null);
|
|
2592
2677
|
const handleFiles = (fileList) => {
|
|
2593
2678
|
let files = Array.from(fileList);
|
|
2594
2679
|
if (maxSize) {
|
|
@@ -2618,7 +2703,7 @@ var FileUpload = (props) => {
|
|
|
2618
2703
|
handleFiles(e.target.files);
|
|
2619
2704
|
}
|
|
2620
2705
|
};
|
|
2621
|
-
return /* @__PURE__ */
|
|
2706
|
+
return /* @__PURE__ */ jsxs203(
|
|
2622
2707
|
"div",
|
|
2623
2708
|
{
|
|
2624
2709
|
className: clsx_default("lib-xplat-file-upload", { "drag-over": isDragOver }, className),
|
|
@@ -2627,7 +2712,7 @@ var FileUpload = (props) => {
|
|
|
2627
2712
|
onDragLeave: handleDragLeave,
|
|
2628
2713
|
onClick: () => inputRef.current?.click(),
|
|
2629
2714
|
children: [
|
|
2630
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ jsx319(
|
|
2631
2716
|
"input",
|
|
2632
2717
|
{
|
|
2633
2718
|
ref: inputRef,
|
|
@@ -2637,9 +2722,9 @@ var FileUpload = (props) => {
|
|
|
2637
2722
|
onChange: handleChange
|
|
2638
2723
|
}
|
|
2639
2724
|
),
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
-
description && /* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ jsx319("div", { className: "upload-icon", children: /* @__PURE__ */ jsx319(UploadIcon_default, {}) }),
|
|
2726
|
+
/* @__PURE__ */ jsx319("p", { className: "upload-label", children: label }),
|
|
2727
|
+
description && /* @__PURE__ */ jsx319("p", { className: "upload-description", children: description })
|
|
2643
2728
|
]
|
|
2644
2729
|
}
|
|
2645
2730
|
);
|
|
@@ -2648,19 +2733,19 @@ FileUpload.displayName = "FileUpload";
|
|
|
2648
2733
|
var FileUpload_default = FileUpload;
|
|
2649
2734
|
|
|
2650
2735
|
// src/components/Select/Select.tsx
|
|
2651
|
-
import
|
|
2736
|
+
import React17 from "react";
|
|
2652
2737
|
|
|
2653
2738
|
// src/components/Select/context.ts
|
|
2654
|
-
import
|
|
2655
|
-
var SelectContext =
|
|
2739
|
+
import React15 from "react";
|
|
2740
|
+
var SelectContext = React15.createContext(null);
|
|
2656
2741
|
var context_default = SelectContext;
|
|
2657
2742
|
|
|
2658
2743
|
// src/components/Select/SelectItem.tsx
|
|
2659
|
-
import
|
|
2660
|
-
import { jsx as
|
|
2744
|
+
import React16 from "react";
|
|
2745
|
+
import { jsx as jsx320 } from "react/jsx-runtime";
|
|
2661
2746
|
var SelectItem = (props) => {
|
|
2662
2747
|
const { children, value, onClick, disabled = false, className } = props;
|
|
2663
|
-
const ctx =
|
|
2748
|
+
const ctx = React16.useContext(context_default);
|
|
2664
2749
|
const handleClick = (e) => {
|
|
2665
2750
|
e.preventDefault();
|
|
2666
2751
|
e.stopPropagation();
|
|
@@ -2669,7 +2754,7 @@ var SelectItem = (props) => {
|
|
|
2669
2754
|
ctx?.close();
|
|
2670
2755
|
onClick?.();
|
|
2671
2756
|
};
|
|
2672
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ jsx320(
|
|
2673
2758
|
"div",
|
|
2674
2759
|
{
|
|
2675
2760
|
className: clsx_default("select-item", disabled && "disabled", className),
|
|
@@ -2690,7 +2775,7 @@ SelectItem.displayName = "Select.Item";
|
|
|
2690
2775
|
var SelectItem_default = SelectItem;
|
|
2691
2776
|
|
|
2692
2777
|
// src/components/Select/Select.tsx
|
|
2693
|
-
import { jsx as
|
|
2778
|
+
import { jsx as jsx321, jsxs as jsxs204 } from "react/jsx-runtime";
|
|
2694
2779
|
var ANIMATION_DURATION_MS3 = 200;
|
|
2695
2780
|
var SelectRoot = (props) => {
|
|
2696
2781
|
const {
|
|
@@ -2699,28 +2784,29 @@ var SelectRoot = (props) => {
|
|
|
2699
2784
|
onChange,
|
|
2700
2785
|
children,
|
|
2701
2786
|
disabled = false,
|
|
2702
|
-
error = false
|
|
2787
|
+
error = false,
|
|
2788
|
+
size = "md"
|
|
2703
2789
|
} = props;
|
|
2704
|
-
const itemChildren =
|
|
2705
|
-
(child) =>
|
|
2790
|
+
const itemChildren = React17.Children.toArray(children).filter(
|
|
2791
|
+
(child) => React17.isValidElement(child) && child.type === SelectItem_default
|
|
2706
2792
|
);
|
|
2707
2793
|
const isControlled = valueProp !== void 0;
|
|
2708
|
-
const [isOpen, setOpen] =
|
|
2709
|
-
const [uncontrolledLabel, setUncontrolledLabel] =
|
|
2710
|
-
const controlledLabel =
|
|
2794
|
+
const [isOpen, setOpen] = React17.useState(false);
|
|
2795
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React17.useState(null);
|
|
2796
|
+
const controlledLabel = React17.useMemo(() => {
|
|
2711
2797
|
if (!isControlled) return null;
|
|
2712
2798
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
2713
2799
|
return match ? match.props.children : null;
|
|
2714
2800
|
}, [isControlled, valueProp, itemChildren]);
|
|
2715
2801
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
2716
|
-
const triggerRef =
|
|
2717
|
-
const contentRef =
|
|
2718
|
-
const [mounted, setMounted] =
|
|
2719
|
-
const [visible, setVisible] =
|
|
2720
|
-
|
|
2802
|
+
const triggerRef = React17.useRef(null);
|
|
2803
|
+
const contentRef = React17.useRef(null);
|
|
2804
|
+
const [mounted, setMounted] = React17.useState(false);
|
|
2805
|
+
const [visible, setVisible] = React17.useState(false);
|
|
2806
|
+
React17.useEffect(() => {
|
|
2721
2807
|
if (disabled && isOpen) setOpen(false);
|
|
2722
2808
|
}, [disabled, isOpen]);
|
|
2723
|
-
|
|
2809
|
+
React17.useEffect(() => {
|
|
2724
2810
|
if (isOpen) {
|
|
2725
2811
|
setMounted(true);
|
|
2726
2812
|
const t2 = setTimeout(() => setVisible(true), 1);
|
|
@@ -2730,12 +2816,12 @@ var SelectRoot = (props) => {
|
|
|
2730
2816
|
const t = setTimeout(() => setMounted(false), ANIMATION_DURATION_MS3);
|
|
2731
2817
|
return () => clearTimeout(t);
|
|
2732
2818
|
}, [isOpen]);
|
|
2733
|
-
const open =
|
|
2734
|
-
const close =
|
|
2735
|
-
const toggle =
|
|
2819
|
+
const open = React17.useCallback(() => setOpen(true), []);
|
|
2820
|
+
const close = React17.useCallback(() => setOpen(false), []);
|
|
2821
|
+
const toggle = React17.useCallback(() => setOpen((prev) => !prev), []);
|
|
2736
2822
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
2737
2823
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
2738
|
-
const setSelected =
|
|
2824
|
+
const setSelected = React17.useCallback(
|
|
2739
2825
|
(label, itemValue) => {
|
|
2740
2826
|
if (!isControlled) {
|
|
2741
2827
|
setUncontrolledLabel(label);
|
|
@@ -2744,7 +2830,7 @@ var SelectRoot = (props) => {
|
|
|
2744
2830
|
},
|
|
2745
2831
|
[isControlled, onChange]
|
|
2746
2832
|
);
|
|
2747
|
-
const ctxValue =
|
|
2833
|
+
const ctxValue = React17.useMemo(
|
|
2748
2834
|
() => ({
|
|
2749
2835
|
isOpen,
|
|
2750
2836
|
mounted,
|
|
@@ -2765,17 +2851,18 @@ var SelectRoot = (props) => {
|
|
|
2765
2851
|
if (disabled) return;
|
|
2766
2852
|
toggle();
|
|
2767
2853
|
};
|
|
2768
|
-
return /* @__PURE__ */
|
|
2854
|
+
return /* @__PURE__ */ jsx321(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs204(
|
|
2769
2855
|
"div",
|
|
2770
2856
|
{
|
|
2771
2857
|
className: clsx_default(
|
|
2772
2858
|
"lib-xplat-select",
|
|
2859
|
+
size,
|
|
2773
2860
|
disabled && "disabled",
|
|
2774
2861
|
error && "error",
|
|
2775
2862
|
mounted && "is-open"
|
|
2776
2863
|
),
|
|
2777
2864
|
children: [
|
|
2778
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsxs204(
|
|
2779
2866
|
"div",
|
|
2780
2867
|
{
|
|
2781
2868
|
ref: triggerRef,
|
|
@@ -2799,7 +2886,7 @@ var SelectRoot = (props) => {
|
|
|
2799
2886
|
}
|
|
2800
2887
|
},
|
|
2801
2888
|
children: [
|
|
2802
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ jsx321(
|
|
2803
2890
|
"span",
|
|
2804
2891
|
{
|
|
2805
2892
|
className: clsx_default(
|
|
@@ -2809,18 +2896,18 @@ var SelectRoot = (props) => {
|
|
|
2809
2896
|
children: selectedLabel ?? placeholder
|
|
2810
2897
|
}
|
|
2811
2898
|
),
|
|
2812
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ jsx321(
|
|
2813
2900
|
"span",
|
|
2814
2901
|
{
|
|
2815
2902
|
className: clsx_default("select-trigger-icon", isOpen && "open"),
|
|
2816
2903
|
"aria-hidden": true,
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2904
|
+
children: /* @__PURE__ */ jsx321(ChevronDownIcon_default, {})
|
|
2818
2905
|
}
|
|
2819
2906
|
)
|
|
2820
2907
|
]
|
|
2821
2908
|
}
|
|
2822
2909
|
),
|
|
2823
|
-
mounted && /* @__PURE__ */
|
|
2910
|
+
mounted && /* @__PURE__ */ jsx321(
|
|
2824
2911
|
"div",
|
|
2825
2912
|
{
|
|
2826
2913
|
className: clsx_default("select-content", position.direction, stateClass),
|
|
@@ -2841,10 +2928,10 @@ var Select = Object.assign(SelectRoot, {
|
|
|
2841
2928
|
var Select_default = Select;
|
|
2842
2929
|
|
|
2843
2930
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
2844
|
-
import
|
|
2931
|
+
import React19 from "react";
|
|
2845
2932
|
|
|
2846
2933
|
// src/components/HtmlTypeWriter/utils.ts
|
|
2847
|
-
import
|
|
2934
|
+
import React18 from "react";
|
|
2848
2935
|
var voidTags = /* @__PURE__ */ new Set([
|
|
2849
2936
|
"br",
|
|
2850
2937
|
"img",
|
|
@@ -2912,40 +2999,40 @@ function convertNodeToReactWithRange(node, typedLen, rangeMap) {
|
|
|
2912
2999
|
props[attr.name] = attr.value;
|
|
2913
3000
|
});
|
|
2914
3001
|
if (voidTags.has(tag)) {
|
|
2915
|
-
return
|
|
3002
|
+
return React18.createElement(tag, props);
|
|
2916
3003
|
}
|
|
2917
3004
|
const children = Array.from(element.childNodes).map((child) => convertNodeToReactWithRange(child, typedLen, rangeMap)).filter((n) => n != null);
|
|
2918
|
-
return
|
|
3005
|
+
return React18.createElement(tag, props, ...children);
|
|
2919
3006
|
}
|
|
2920
3007
|
function htmlToReactProgressive(root, typedLen, rangeMap) {
|
|
2921
3008
|
const nodes = Array.from(root.childNodes).map((child, idx) => {
|
|
2922
3009
|
const node = convertNodeToReactWithRange(child, typedLen, rangeMap);
|
|
2923
|
-
return node == null ? null :
|
|
3010
|
+
return node == null ? null : React18.createElement(React18.Fragment, { key: idx }, node);
|
|
2924
3011
|
}).filter(Boolean);
|
|
2925
3012
|
return nodes.length === 0 ? null : nodes;
|
|
2926
3013
|
}
|
|
2927
3014
|
|
|
2928
3015
|
// src/components/HtmlTypeWriter/HtmlTypeWriter.tsx
|
|
2929
|
-
import { jsx as
|
|
3016
|
+
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
2930
3017
|
var HtmlTypeWriter = ({
|
|
2931
3018
|
html,
|
|
2932
3019
|
duration = 20,
|
|
2933
3020
|
onDone,
|
|
2934
3021
|
onChange
|
|
2935
3022
|
}) => {
|
|
2936
|
-
const [typedLen, setTypedLen] =
|
|
2937
|
-
const doneCalledRef =
|
|
2938
|
-
const { doc, rangeMap, totalLength } =
|
|
3023
|
+
const [typedLen, setTypedLen] = React19.useState(0);
|
|
3024
|
+
const doneCalledRef = React19.useRef(false);
|
|
3025
|
+
const { doc, rangeMap, totalLength } = React19.useMemo(() => {
|
|
2939
3026
|
const decoded = decodeHtmlEntities(html);
|
|
2940
3027
|
const doc2 = new DOMParser().parseFromString(decoded, "text/html");
|
|
2941
3028
|
const { rangeMap: rangeMap2, totalLength: totalLength2 } = buildRangeMap(doc2.body);
|
|
2942
3029
|
return { doc: doc2, rangeMap: rangeMap2, totalLength: totalLength2 };
|
|
2943
3030
|
}, [html]);
|
|
2944
|
-
|
|
3031
|
+
React19.useEffect(() => {
|
|
2945
3032
|
setTypedLen(0);
|
|
2946
3033
|
doneCalledRef.current = false;
|
|
2947
3034
|
}, [html]);
|
|
2948
|
-
|
|
3035
|
+
React19.useEffect(() => {
|
|
2949
3036
|
if (!totalLength) return;
|
|
2950
3037
|
if (typedLen >= totalLength) return;
|
|
2951
3038
|
const timer = window.setInterval(() => {
|
|
@@ -2953,33 +3040,33 @@ var HtmlTypeWriter = ({
|
|
|
2953
3040
|
}, duration);
|
|
2954
3041
|
return () => window.clearInterval(timer);
|
|
2955
3042
|
}, [typedLen, totalLength, duration]);
|
|
2956
|
-
|
|
3043
|
+
React19.useEffect(() => {
|
|
2957
3044
|
if (typedLen > 0 && typedLen < totalLength) {
|
|
2958
3045
|
onChange?.();
|
|
2959
3046
|
}
|
|
2960
3047
|
}, [typedLen, totalLength, onChange]);
|
|
2961
|
-
|
|
3048
|
+
React19.useEffect(() => {
|
|
2962
3049
|
if (typedLen === totalLength && totalLength > 0 && !doneCalledRef.current) {
|
|
2963
3050
|
doneCalledRef.current = true;
|
|
2964
3051
|
onDone?.();
|
|
2965
3052
|
}
|
|
2966
3053
|
}, [typedLen, totalLength, onDone]);
|
|
2967
|
-
const parsed =
|
|
3054
|
+
const parsed = React19.useMemo(
|
|
2968
3055
|
() => htmlToReactProgressive(doc.body, typedLen, rangeMap),
|
|
2969
3056
|
[doc.body, typedLen, rangeMap]
|
|
2970
3057
|
);
|
|
2971
|
-
return /* @__PURE__ */
|
|
3058
|
+
return /* @__PURE__ */ jsx322("div", { className: "lib-xplat-htmlTypewriter", children: parsed });
|
|
2972
3059
|
};
|
|
2973
3060
|
HtmlTypeWriter.displayName = "HtmlTypeWriter";
|
|
2974
3061
|
var HtmlTypeWriter_default = HtmlTypeWriter;
|
|
2975
3062
|
|
|
2976
3063
|
// src/components/ImageSelector/ImageSelector.tsx
|
|
2977
|
-
import
|
|
2978
|
-
import { jsx as
|
|
3064
|
+
import React20 from "react";
|
|
3065
|
+
import { jsx as jsx323, jsxs as jsxs205 } from "react/jsx-runtime";
|
|
2979
3066
|
var ImageSelector = (props) => {
|
|
2980
3067
|
const { value, label, onChange } = props;
|
|
2981
|
-
const [previewUrl, setPreviewUrl] =
|
|
2982
|
-
|
|
3068
|
+
const [previewUrl, setPreviewUrl] = React20.useState();
|
|
3069
|
+
React20.useEffect(() => {
|
|
2983
3070
|
if (!value) {
|
|
2984
3071
|
setPreviewUrl(void 0);
|
|
2985
3072
|
return;
|
|
@@ -2988,7 +3075,7 @@ var ImageSelector = (props) => {
|
|
|
2988
3075
|
setPreviewUrl(url);
|
|
2989
3076
|
return () => URL.revokeObjectURL(url);
|
|
2990
3077
|
}, [value]);
|
|
2991
|
-
const inputRef =
|
|
3078
|
+
const inputRef = React20.useRef(null);
|
|
2992
3079
|
const handleFileChange = (e) => {
|
|
2993
3080
|
const selectedFile = e.target.files?.[0];
|
|
2994
3081
|
if (selectedFile) {
|
|
@@ -3001,8 +3088,8 @@ var ImageSelector = (props) => {
|
|
|
3001
3088
|
const handleOpenFileDialog = () => {
|
|
3002
3089
|
inputRef.current?.click();
|
|
3003
3090
|
};
|
|
3004
|
-
return /* @__PURE__ */
|
|
3005
|
-
/* @__PURE__ */
|
|
3091
|
+
return /* @__PURE__ */ jsxs205("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
|
|
3092
|
+
/* @__PURE__ */ jsx323(
|
|
3006
3093
|
"input",
|
|
3007
3094
|
{
|
|
3008
3095
|
type: "file",
|
|
@@ -3012,13 +3099,13 @@ var ImageSelector = (props) => {
|
|
|
3012
3099
|
ref: inputRef
|
|
3013
3100
|
}
|
|
3014
3101
|
),
|
|
3015
|
-
value && /* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3017
|
-
/* @__PURE__ */
|
|
3102
|
+
value && /* @__PURE__ */ jsxs205("div", { className: "action-bar", children: [
|
|
3103
|
+
/* @__PURE__ */ jsx323("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx323(UploadIcon_default, {}) }),
|
|
3104
|
+
/* @__PURE__ */ jsx323("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx323(DeleteIcon_default, {}) })
|
|
3018
3105
|
] }),
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsx323("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx323("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs205("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
|
|
3107
|
+
/* @__PURE__ */ jsx323("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx323(ImageIcon_default, {}) }),
|
|
3108
|
+
/* @__PURE__ */ jsx323("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
|
|
3022
3109
|
] }) })
|
|
3023
3110
|
] });
|
|
3024
3111
|
};
|
|
@@ -3026,7 +3113,7 @@ ImageSelector.displayName = "ImageSelector";
|
|
|
3026
3113
|
var ImageSelector_default = ImageSelector;
|
|
3027
3114
|
|
|
3028
3115
|
// src/components/Pagination/Pagination.tsx
|
|
3029
|
-
import { jsx as
|
|
3116
|
+
import { jsx as jsx324, jsxs as jsxs206 } from "react/jsx-runtime";
|
|
3030
3117
|
function getPageRange(current, totalPages, siblingCount) {
|
|
3031
3118
|
const totalNumbers = siblingCount * 2 + 5;
|
|
3032
3119
|
if (totalPages <= totalNumbers) {
|
|
@@ -3059,6 +3146,7 @@ var Pagination = (props) => {
|
|
|
3059
3146
|
pageSize = 10,
|
|
3060
3147
|
siblingCount = 1,
|
|
3061
3148
|
onChange,
|
|
3149
|
+
size = "md",
|
|
3062
3150
|
colorNamespace = "xplat",
|
|
3063
3151
|
color = "blue",
|
|
3064
3152
|
colorDepth,
|
|
@@ -3076,19 +3164,19 @@ var Pagination = (props) => {
|
|
|
3076
3164
|
onChange?.(page);
|
|
3077
3165
|
}
|
|
3078
3166
|
};
|
|
3079
|
-
return /* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3167
|
+
return /* @__PURE__ */ jsxs206("nav", { className: clsx_default("lib-xplat-pagination", size, className), "aria-label": "\uD398\uC774\uC9C0 \uB124\uBE44\uAC8C\uC774\uC158", children: [
|
|
3168
|
+
/* @__PURE__ */ jsx324(
|
|
3081
3169
|
"button",
|
|
3082
3170
|
{
|
|
3083
3171
|
className: "page-btn prev",
|
|
3084
3172
|
disabled: current <= 1,
|
|
3085
3173
|
onClick: () => handleClick(current - 1),
|
|
3086
3174
|
"aria-label": "\uC774\uC804 \uD398\uC774\uC9C0",
|
|
3087
|
-
children: /* @__PURE__ */
|
|
3175
|
+
children: /* @__PURE__ */ jsx324(ChevronLeftIcon_default, {})
|
|
3088
3176
|
}
|
|
3089
3177
|
),
|
|
3090
3178
|
pages.map(
|
|
3091
|
-
(page, i) => page === "..." ? /* @__PURE__ */
|
|
3179
|
+
(page, i) => page === "..." ? /* @__PURE__ */ jsx324("span", { className: "dots", children: "..." }, `dots-${i}`) : /* @__PURE__ */ jsx324(
|
|
3092
3180
|
"button",
|
|
3093
3181
|
{
|
|
3094
3182
|
className: clsx_default("page-btn", colorClass, { active: page === current }),
|
|
@@ -3099,14 +3187,14 @@ var Pagination = (props) => {
|
|
|
3099
3187
|
page
|
|
3100
3188
|
)
|
|
3101
3189
|
),
|
|
3102
|
-
/* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ jsx324(
|
|
3103
3191
|
"button",
|
|
3104
3192
|
{
|
|
3105
3193
|
className: "page-btn next",
|
|
3106
3194
|
disabled: current >= totalPages,
|
|
3107
3195
|
onClick: () => handleClick(current + 1),
|
|
3108
3196
|
"aria-label": "\uB2E4\uC74C \uD398\uC774\uC9C0",
|
|
3109
|
-
children: /* @__PURE__ */
|
|
3197
|
+
children: /* @__PURE__ */ jsx324(ChevronRightIcon_default, {})
|
|
3110
3198
|
}
|
|
3111
3199
|
)
|
|
3112
3200
|
] });
|
|
@@ -3115,17 +3203,17 @@ Pagination.displayName = "Pagination";
|
|
|
3115
3203
|
var Pagination_default = Pagination;
|
|
3116
3204
|
|
|
3117
3205
|
// src/components/PopOver/PopOver.tsx
|
|
3118
|
-
import
|
|
3119
|
-
import { jsx as
|
|
3206
|
+
import React21 from "react";
|
|
3207
|
+
import { jsx as jsx325, jsxs as jsxs207 } from "react/jsx-runtime";
|
|
3120
3208
|
var PopOver = (props) => {
|
|
3121
3209
|
const { children, isOpen, onClose, PopOverEl } = props;
|
|
3122
|
-
const popRef =
|
|
3123
|
-
const triggerRef =
|
|
3124
|
-
const [localOpen, setLocalOpen] =
|
|
3125
|
-
const [eventTrigger, setEventTrigger] =
|
|
3210
|
+
const popRef = React21.useRef(null);
|
|
3211
|
+
const triggerRef = React21.useRef(null);
|
|
3212
|
+
const [localOpen, setLocalOpen] = React21.useState(false);
|
|
3213
|
+
const [eventTrigger, setEventTrigger] = React21.useState(false);
|
|
3126
3214
|
useClickOutside_default([popRef, triggerRef], onClose, isOpen);
|
|
3127
3215
|
const position = useAutoPosition_default(triggerRef, popRef, localOpen);
|
|
3128
|
-
|
|
3216
|
+
React21.useEffect(() => {
|
|
3129
3217
|
if (isOpen) {
|
|
3130
3218
|
setLocalOpen(isOpen);
|
|
3131
3219
|
setTimeout(() => {
|
|
@@ -3138,7 +3226,7 @@ var PopOver = (props) => {
|
|
|
3138
3226
|
}, 200);
|
|
3139
3227
|
}
|
|
3140
3228
|
}, [isOpen]);
|
|
3141
|
-
return /* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsxs207(
|
|
3142
3230
|
"div",
|
|
3143
3231
|
{
|
|
3144
3232
|
className: "lib-xplat-pop-over",
|
|
@@ -3148,7 +3236,7 @@ var PopOver = (props) => {
|
|
|
3148
3236
|
},
|
|
3149
3237
|
children: [
|
|
3150
3238
|
children,
|
|
3151
|
-
localOpen && /* @__PURE__ */
|
|
3239
|
+
localOpen && /* @__PURE__ */ jsx325(
|
|
3152
3240
|
"div",
|
|
3153
3241
|
{
|
|
3154
3242
|
className: clsx_default(
|
|
@@ -3171,7 +3259,7 @@ PopOver.displayName = "PopOver";
|
|
|
3171
3259
|
var PopOver_default = PopOver;
|
|
3172
3260
|
|
|
3173
3261
|
// src/components/Progress/Progress.tsx
|
|
3174
|
-
import { jsx as
|
|
3262
|
+
import { jsx as jsx326, jsxs as jsxs208 } from "react/jsx-runtime";
|
|
3175
3263
|
var Progress = (props) => {
|
|
3176
3264
|
const {
|
|
3177
3265
|
value,
|
|
@@ -3189,8 +3277,8 @@ var Progress = (props) => {
|
|
|
3189
3277
|
colorDepth ?? 500
|
|
3190
3278
|
);
|
|
3191
3279
|
const percentage = Math.min(100, Math.max(0, value / max * 100));
|
|
3192
|
-
return /* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3280
|
+
return /* @__PURE__ */ jsxs208("div", { className: clsx_default("lib-xplat-progress", size, className), children: [
|
|
3281
|
+
/* @__PURE__ */ jsx326(
|
|
3194
3282
|
"div",
|
|
3195
3283
|
{
|
|
3196
3284
|
className: "track",
|
|
@@ -3198,7 +3286,7 @@ var Progress = (props) => {
|
|
|
3198
3286
|
"aria-valuenow": value,
|
|
3199
3287
|
"aria-valuemin": 0,
|
|
3200
3288
|
"aria-valuemax": max,
|
|
3201
|
-
children: /* @__PURE__ */
|
|
3289
|
+
children: /* @__PURE__ */ jsx326(
|
|
3202
3290
|
"div",
|
|
3203
3291
|
{
|
|
3204
3292
|
className: clsx_default("bar", colorClass),
|
|
@@ -3207,7 +3295,7 @@ var Progress = (props) => {
|
|
|
3207
3295
|
)
|
|
3208
3296
|
}
|
|
3209
3297
|
),
|
|
3210
|
-
showLabel && /* @__PURE__ */
|
|
3298
|
+
showLabel && /* @__PURE__ */ jsxs208("span", { className: "label", children: [
|
|
3211
3299
|
Math.round(percentage),
|
|
3212
3300
|
"%"
|
|
3213
3301
|
] })
|
|
@@ -3217,17 +3305,17 @@ Progress.displayName = "Progress";
|
|
|
3217
3305
|
var Progress_default = Progress;
|
|
3218
3306
|
|
|
3219
3307
|
// src/components/Radio/RadioGroupContext.tsx
|
|
3220
|
-
import
|
|
3221
|
-
var RadioGroupContext =
|
|
3308
|
+
import React22 from "react";
|
|
3309
|
+
var RadioGroupContext = React22.createContext(
|
|
3222
3310
|
null
|
|
3223
3311
|
);
|
|
3224
3312
|
var useRadioGroupContext = () => {
|
|
3225
|
-
return
|
|
3313
|
+
return React22.useContext(RadioGroupContext);
|
|
3226
3314
|
};
|
|
3227
3315
|
var RadioGroupContext_default = RadioGroupContext;
|
|
3228
3316
|
|
|
3229
3317
|
// src/components/Radio/Radio.tsx
|
|
3230
|
-
import { jsx as
|
|
3318
|
+
import { jsx as jsx327, jsxs as jsxs209 } from "react/jsx-runtime";
|
|
3231
3319
|
var Radio = (props) => {
|
|
3232
3320
|
const {
|
|
3233
3321
|
label,
|
|
@@ -3236,9 +3324,11 @@ var Radio = (props) => {
|
|
|
3236
3324
|
colorNamespace = "xplat",
|
|
3237
3325
|
color = "blue",
|
|
3238
3326
|
colorDepth,
|
|
3327
|
+
size: sizeProp,
|
|
3239
3328
|
...rest
|
|
3240
3329
|
} = props;
|
|
3241
3330
|
const context = useRadioGroupContext();
|
|
3331
|
+
const size = sizeProp ?? context?.size ?? "md";
|
|
3242
3332
|
const isGroup = !!context;
|
|
3243
3333
|
const localChecked = isGroup ? context.value === value : rest.checked ?? false;
|
|
3244
3334
|
const inputProps = context ? { name: context.name, value, onChange: context.onChange } : {
|
|
@@ -3251,17 +3341,18 @@ var Radio = (props) => {
|
|
|
3251
3341
|
color,
|
|
3252
3342
|
colorDepth ?? 500
|
|
3253
3343
|
);
|
|
3254
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsxs209(
|
|
3255
3345
|
"label",
|
|
3256
3346
|
{
|
|
3257
3347
|
className: clsx_default(
|
|
3258
3348
|
"lib-xplat-radio",
|
|
3349
|
+
size,
|
|
3259
3350
|
localChecked ? "checked" : void 0,
|
|
3260
3351
|
className
|
|
3261
3352
|
),
|
|
3262
3353
|
children: [
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ jsx327("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
|
|
3355
|
+
/* @__PURE__ */ jsx327(
|
|
3265
3356
|
"div",
|
|
3266
3357
|
{
|
|
3267
3358
|
className: clsx_default(
|
|
@@ -3269,10 +3360,10 @@ var Radio = (props) => {
|
|
|
3269
3360
|
localChecked ? "checked" : void 0,
|
|
3270
3361
|
colorClass
|
|
3271
3362
|
),
|
|
3272
|
-
children: localChecked && /* @__PURE__ */
|
|
3363
|
+
children: localChecked && /* @__PURE__ */ jsx327("div", { className: "inner-circle" })
|
|
3273
3364
|
}
|
|
3274
3365
|
),
|
|
3275
|
-
label && /* @__PURE__ */
|
|
3366
|
+
label && /* @__PURE__ */ jsx327("span", { children: label })
|
|
3276
3367
|
]
|
|
3277
3368
|
}
|
|
3278
3369
|
);
|
|
@@ -3281,23 +3372,23 @@ Radio.displayName = "Radio";
|
|
|
3281
3372
|
var Radio_default = Radio;
|
|
3282
3373
|
|
|
3283
3374
|
// src/components/Radio/RadioGroup.tsx
|
|
3284
|
-
import { Fragment, jsx as
|
|
3375
|
+
import { Fragment, jsx as jsx328 } from "react/jsx-runtime";
|
|
3285
3376
|
var RadioGroup = (props) => {
|
|
3286
3377
|
const { children, ...rest } = props;
|
|
3287
|
-
return /* @__PURE__ */
|
|
3378
|
+
return /* @__PURE__ */ jsx328(Fragment, { children: /* @__PURE__ */ jsx328(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
3288
3379
|
};
|
|
3289
3380
|
RadioGroup.displayName = "RadioGroup";
|
|
3290
3381
|
var RadioGroup_default = RadioGroup;
|
|
3291
3382
|
|
|
3292
3383
|
// src/components/Skeleton/Skeleton.tsx
|
|
3293
|
-
import { jsx as
|
|
3384
|
+
import { jsx as jsx329 } from "react/jsx-runtime";
|
|
3294
3385
|
var Skeleton = (props) => {
|
|
3295
3386
|
const { variant = "text", width, height, className } = props;
|
|
3296
3387
|
const style = {
|
|
3297
3388
|
width: typeof width === "number" ? `${width}px` : width,
|
|
3298
3389
|
height: typeof height === "number" ? `${height}px` : height
|
|
3299
3390
|
};
|
|
3300
|
-
return /* @__PURE__ */
|
|
3391
|
+
return /* @__PURE__ */ jsx329(
|
|
3301
3392
|
"div",
|
|
3302
3393
|
{
|
|
3303
3394
|
className: clsx_default("lib-xplat-skeleton", variant, className),
|
|
@@ -3310,7 +3401,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
3310
3401
|
var Skeleton_default = Skeleton;
|
|
3311
3402
|
|
|
3312
3403
|
// src/components/Spinner/Spinner.tsx
|
|
3313
|
-
import { jsx as
|
|
3404
|
+
import { jsx as jsx330, jsxs as jsxs210 } from "react/jsx-runtime";
|
|
3314
3405
|
var Spinner = (props) => {
|
|
3315
3406
|
const {
|
|
3316
3407
|
size = "md",
|
|
@@ -3324,14 +3415,14 @@ var Spinner = (props) => {
|
|
|
3324
3415
|
color,
|
|
3325
3416
|
colorDepth ?? 500
|
|
3326
3417
|
);
|
|
3327
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ jsx330(
|
|
3328
3419
|
"div",
|
|
3329
3420
|
{
|
|
3330
3421
|
className: clsx_default("lib-xplat-spinner", size, colorClass, className),
|
|
3331
3422
|
role: "status",
|
|
3332
3423
|
"aria-label": "\uB85C\uB529 \uC911",
|
|
3333
|
-
children: /* @__PURE__ */
|
|
3334
|
-
/* @__PURE__ */
|
|
3424
|
+
children: /* @__PURE__ */ jsxs210("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
3425
|
+
/* @__PURE__ */ jsx330(
|
|
3335
3426
|
"circle",
|
|
3336
3427
|
{
|
|
3337
3428
|
className: "track",
|
|
@@ -3341,7 +3432,7 @@ var Spinner = (props) => {
|
|
|
3341
3432
|
strokeWidth: "3"
|
|
3342
3433
|
}
|
|
3343
3434
|
),
|
|
3344
|
-
/* @__PURE__ */
|
|
3435
|
+
/* @__PURE__ */ jsx330(
|
|
3345
3436
|
"circle",
|
|
3346
3437
|
{
|
|
3347
3438
|
className: "indicator",
|
|
@@ -3360,7 +3451,7 @@ Spinner.displayName = "Spinner";
|
|
|
3360
3451
|
var Spinner_default = Spinner;
|
|
3361
3452
|
|
|
3362
3453
|
// src/components/Steps/Steps.tsx
|
|
3363
|
-
import { jsx as
|
|
3454
|
+
import { jsx as jsx331, jsxs as jsxs211 } from "react/jsx-runtime";
|
|
3364
3455
|
var Steps = (props) => {
|
|
3365
3456
|
const {
|
|
3366
3457
|
items,
|
|
@@ -3375,16 +3466,16 @@ var Steps = (props) => {
|
|
|
3375
3466
|
color,
|
|
3376
3467
|
colorDepth ?? 500
|
|
3377
3468
|
);
|
|
3378
|
-
return /* @__PURE__ */
|
|
3469
|
+
return /* @__PURE__ */ jsx331("div", { className: clsx_default("lib-xplat-steps", className), children: items.map((item, index) => {
|
|
3379
3470
|
const status = index < current ? "completed" : index === current ? "active" : "pending";
|
|
3380
|
-
return /* @__PURE__ */
|
|
3381
|
-
/* @__PURE__ */
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
index < items.length - 1 && /* @__PURE__ */
|
|
3471
|
+
return /* @__PURE__ */ jsxs211("div", { className: clsx_default("step-item", status), children: [
|
|
3472
|
+
/* @__PURE__ */ jsxs211("div", { className: "step-indicator", children: [
|
|
3473
|
+
/* @__PURE__ */ jsx331("div", { className: clsx_default("step-circle", colorClass), children: status === "completed" ? /* @__PURE__ */ jsx331(CheckIcon_default, {}) : /* @__PURE__ */ jsx331("span", { children: index + 1 }) }),
|
|
3474
|
+
index < items.length - 1 && /* @__PURE__ */ jsx331("div", { className: clsx_default("step-line", colorClass) })
|
|
3384
3475
|
] }),
|
|
3385
|
-
/* @__PURE__ */
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
item.description && /* @__PURE__ */
|
|
3476
|
+
/* @__PURE__ */ jsxs211("div", { className: "step-content", children: [
|
|
3477
|
+
/* @__PURE__ */ jsx331("span", { className: "step-title", children: item.title }),
|
|
3478
|
+
item.description && /* @__PURE__ */ jsx331("span", { className: "step-description", children: item.description })
|
|
3388
3479
|
] })
|
|
3389
3480
|
] }, index);
|
|
3390
3481
|
}) });
|
|
@@ -3393,8 +3484,8 @@ Steps.displayName = "Steps";
|
|
|
3393
3484
|
var Steps_default = Steps;
|
|
3394
3485
|
|
|
3395
3486
|
// src/components/Switch/Switch.tsx
|
|
3396
|
-
import
|
|
3397
|
-
import { jsx as
|
|
3487
|
+
import React23 from "react";
|
|
3488
|
+
import { jsx as jsx332 } from "react/jsx-runtime";
|
|
3398
3489
|
var KNOB_TRANSITION_MS = 250;
|
|
3399
3490
|
var Switch = (props) => {
|
|
3400
3491
|
const {
|
|
@@ -3407,9 +3498,9 @@ var Switch = (props) => {
|
|
|
3407
3498
|
colorDepth,
|
|
3408
3499
|
className
|
|
3409
3500
|
} = props;
|
|
3410
|
-
const [isAnimating, setIsAnimating] =
|
|
3411
|
-
const timeoutRef =
|
|
3412
|
-
|
|
3501
|
+
const [isAnimating, setIsAnimating] = React23.useState(false);
|
|
3502
|
+
const timeoutRef = React23.useRef(null);
|
|
3503
|
+
React23.useEffect(() => {
|
|
3413
3504
|
return () => {
|
|
3414
3505
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3415
3506
|
};
|
|
@@ -3429,7 +3520,7 @@ var Switch = (props) => {
|
|
|
3429
3520
|
color,
|
|
3430
3521
|
colorDepth ?? 500
|
|
3431
3522
|
);
|
|
3432
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ jsx332(
|
|
3433
3524
|
"div",
|
|
3434
3525
|
{
|
|
3435
3526
|
className: clsx_default(
|
|
@@ -3443,7 +3534,7 @@ var Switch = (props) => {
|
|
|
3443
3534
|
),
|
|
3444
3535
|
onClick: handleClick,
|
|
3445
3536
|
"aria-disabled": disabled || isAnimating,
|
|
3446
|
-
children: /* @__PURE__ */
|
|
3537
|
+
children: /* @__PURE__ */ jsx332("div", { className: clsx_default("knob", value ? "checked" : void 0) })
|
|
3447
3538
|
}
|
|
3448
3539
|
);
|
|
3449
3540
|
};
|
|
@@ -3451,14 +3542,14 @@ Switch.displayName = "Switch";
|
|
|
3451
3542
|
var Switch_default = Switch;
|
|
3452
3543
|
|
|
3453
3544
|
// src/components/Tab/Tab.tsx
|
|
3454
|
-
import
|
|
3545
|
+
import React25 from "react";
|
|
3455
3546
|
|
|
3456
3547
|
// src/components/Tab/TabItem.tsx
|
|
3457
|
-
import
|
|
3458
|
-
import { jsx as
|
|
3459
|
-
var TabItem =
|
|
3548
|
+
import React24 from "react";
|
|
3549
|
+
import { jsx as jsx333 } from "react/jsx-runtime";
|
|
3550
|
+
var TabItem = React24.forwardRef((props, ref) => {
|
|
3460
3551
|
const { isActive, title, onClick } = props;
|
|
3461
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx333(
|
|
3462
3553
|
"div",
|
|
3463
3554
|
{
|
|
3464
3555
|
ref,
|
|
@@ -3472,25 +3563,25 @@ TabItem.displayName = "TabItem";
|
|
|
3472
3563
|
var TabItem_default = TabItem;
|
|
3473
3564
|
|
|
3474
3565
|
// src/components/Tab/Tab.tsx
|
|
3475
|
-
import { jsx as
|
|
3566
|
+
import { jsx as jsx334, jsxs as jsxs212 } from "react/jsx-runtime";
|
|
3476
3567
|
var Tab = (props) => {
|
|
3477
|
-
const { activeIndex, onChange, tabs, type } = props;
|
|
3478
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
3568
|
+
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
3569
|
+
const [underlineStyle, setUnderlineStyle] = React25.useState({
|
|
3479
3570
|
left: 0,
|
|
3480
3571
|
width: 0
|
|
3481
3572
|
});
|
|
3482
|
-
const itemRefs =
|
|
3573
|
+
const itemRefs = React25.useRef([]);
|
|
3483
3574
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
3484
3575
|
onChange(tabItem, tabIdx);
|
|
3485
3576
|
};
|
|
3486
|
-
|
|
3577
|
+
React25.useEffect(() => {
|
|
3487
3578
|
const el = itemRefs.current[activeIndex];
|
|
3488
3579
|
if (el) {
|
|
3489
3580
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
3490
3581
|
}
|
|
3491
3582
|
}, [activeIndex, tabs.length]);
|
|
3492
|
-
return /* @__PURE__ */
|
|
3493
|
-
tabs.map((tab, idx) => /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ jsxs212("div", { className: clsx_default("lib-xplat-tab", `type-${type}`, size), children: [
|
|
3584
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx334(
|
|
3494
3585
|
TabItem_default,
|
|
3495
3586
|
{
|
|
3496
3587
|
onClick: () => handleChangeActiveTab(tab, idx),
|
|
@@ -3502,7 +3593,7 @@ var Tab = (props) => {
|
|
|
3502
3593
|
},
|
|
3503
3594
|
`${tab.value}_${idx}`
|
|
3504
3595
|
)),
|
|
3505
|
-
type === "toggle" && /* @__PURE__ */
|
|
3596
|
+
type === "toggle" && /* @__PURE__ */ jsx334(
|
|
3506
3597
|
"div",
|
|
3507
3598
|
{
|
|
3508
3599
|
className: "tab-toggle-underline",
|
|
@@ -3518,17 +3609,17 @@ Tab.displayName = "Tab";
|
|
|
3518
3609
|
var Tab_default = Tab;
|
|
3519
3610
|
|
|
3520
3611
|
// src/components/Table/TableContext.tsx
|
|
3521
|
-
import
|
|
3522
|
-
var TableContext =
|
|
3612
|
+
import React26 from "react";
|
|
3613
|
+
var TableContext = React26.createContext(null);
|
|
3523
3614
|
var useTableContext = () => {
|
|
3524
|
-
const ctx =
|
|
3615
|
+
const ctx = React26.useContext(TableContext);
|
|
3525
3616
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3526
3617
|
return ctx;
|
|
3527
3618
|
};
|
|
3528
3619
|
var TableContext_default = TableContext;
|
|
3529
3620
|
|
|
3530
3621
|
// src/components/Table/Table.tsx
|
|
3531
|
-
import { jsx as
|
|
3622
|
+
import { jsx as jsx335 } from "react/jsx-runtime";
|
|
3532
3623
|
var Table = (props) => {
|
|
3533
3624
|
const {
|
|
3534
3625
|
className,
|
|
@@ -3538,7 +3629,7 @@ var Table = (props) => {
|
|
|
3538
3629
|
headerSticky = false,
|
|
3539
3630
|
stickyShadow = true
|
|
3540
3631
|
} = props;
|
|
3541
|
-
return /* @__PURE__ */
|
|
3632
|
+
return /* @__PURE__ */ jsx335("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ jsx335(
|
|
3542
3633
|
TableContext_default.Provider,
|
|
3543
3634
|
{
|
|
3544
3635
|
value: {
|
|
@@ -3547,7 +3638,7 @@ var Table = (props) => {
|
|
|
3547
3638
|
headerSticky,
|
|
3548
3639
|
stickyShadow
|
|
3549
3640
|
},
|
|
3550
|
-
children: /* @__PURE__ */
|
|
3641
|
+
children: /* @__PURE__ */ jsx335("table", { className: "lib-xplat-table", children })
|
|
3551
3642
|
}
|
|
3552
3643
|
) });
|
|
3553
3644
|
};
|
|
@@ -3555,40 +3646,40 @@ Table.displayName = "Table";
|
|
|
3555
3646
|
var Table_default = Table;
|
|
3556
3647
|
|
|
3557
3648
|
// src/components/Table/TableBody.tsx
|
|
3558
|
-
import { jsx as
|
|
3649
|
+
import { jsx as jsx336 } from "react/jsx-runtime";
|
|
3559
3650
|
var TableBody = (props) => {
|
|
3560
3651
|
const { children, className } = props;
|
|
3561
|
-
return /* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ jsx336("tbody", { className, children });
|
|
3562
3653
|
};
|
|
3563
3654
|
TableBody.displayName = "TableBody";
|
|
3564
3655
|
var TableBody_default = TableBody;
|
|
3565
3656
|
|
|
3566
3657
|
// src/components/Table/TableCell.tsx
|
|
3567
|
-
import
|
|
3658
|
+
import React29 from "react";
|
|
3568
3659
|
|
|
3569
3660
|
// src/components/Table/TableHeadContext.tsx
|
|
3570
|
-
import
|
|
3571
|
-
var TableHeadContext =
|
|
3661
|
+
import React27 from "react";
|
|
3662
|
+
var TableHeadContext = React27.createContext(
|
|
3572
3663
|
null
|
|
3573
3664
|
);
|
|
3574
3665
|
var useTableHeadContext = () => {
|
|
3575
|
-
const ctx =
|
|
3666
|
+
const ctx = React27.useContext(TableHeadContext);
|
|
3576
3667
|
return ctx;
|
|
3577
3668
|
};
|
|
3578
3669
|
var TableHeadContext_default = TableHeadContext;
|
|
3579
3670
|
|
|
3580
3671
|
// src/components/Table/TableRowContext.tsx
|
|
3581
|
-
import
|
|
3582
|
-
var TableRowContext =
|
|
3672
|
+
import React28 from "react";
|
|
3673
|
+
var TableRowContext = React28.createContext(null);
|
|
3583
3674
|
var useTableRowContext = () => {
|
|
3584
|
-
const ctx =
|
|
3675
|
+
const ctx = React28.useContext(TableRowContext);
|
|
3585
3676
|
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
3586
3677
|
return ctx;
|
|
3587
3678
|
};
|
|
3588
3679
|
var TableRowContext_default = TableRowContext;
|
|
3589
3680
|
|
|
3590
3681
|
// src/components/Table/TableCell.tsx
|
|
3591
|
-
import { jsx as
|
|
3682
|
+
import { jsx as jsx337 } from "react/jsx-runtime";
|
|
3592
3683
|
var TableCell = (props) => {
|
|
3593
3684
|
const {
|
|
3594
3685
|
children,
|
|
@@ -3600,9 +3691,9 @@ var TableCell = (props) => {
|
|
|
3600
3691
|
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
3601
3692
|
const { stickyShadow } = useTableContext();
|
|
3602
3693
|
const headContext = useTableHeadContext();
|
|
3603
|
-
const [left, setLeft] =
|
|
3604
|
-
const cellRef =
|
|
3605
|
-
const calculateLeft =
|
|
3694
|
+
const [left, setLeft] = React29.useState(0);
|
|
3695
|
+
const cellRef = React29.useRef(null);
|
|
3696
|
+
const calculateLeft = React29.useCallback(() => {
|
|
3606
3697
|
if (!cellRef.current) return 0;
|
|
3607
3698
|
let totalLeft = 0;
|
|
3608
3699
|
for (const ref of stickyCells) {
|
|
@@ -3611,7 +3702,7 @@ var TableCell = (props) => {
|
|
|
3611
3702
|
}
|
|
3612
3703
|
return totalLeft;
|
|
3613
3704
|
}, [stickyCells]);
|
|
3614
|
-
|
|
3705
|
+
React29.useEffect(() => {
|
|
3615
3706
|
if (!isSticky || !cellRef.current) return;
|
|
3616
3707
|
registerStickyCell(cellRef);
|
|
3617
3708
|
setLeft(calculateLeft());
|
|
@@ -3629,7 +3720,7 @@ var TableCell = (props) => {
|
|
|
3629
3720
|
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
3630
3721
|
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
3631
3722
|
const enableHover = headContext && headContext.cellHover;
|
|
3632
|
-
return /* @__PURE__ */
|
|
3723
|
+
return /* @__PURE__ */ jsx337(
|
|
3633
3724
|
CellTag,
|
|
3634
3725
|
{
|
|
3635
3726
|
ref: cellRef,
|
|
@@ -3651,21 +3742,21 @@ TableCell.displayName = "TableCell";
|
|
|
3651
3742
|
var TableCell_default = TableCell;
|
|
3652
3743
|
|
|
3653
3744
|
// src/components/Table/TableHead.tsx
|
|
3654
|
-
import { jsx as
|
|
3745
|
+
import { jsx as jsx338 } from "react/jsx-runtime";
|
|
3655
3746
|
var TableHead = ({
|
|
3656
3747
|
children,
|
|
3657
3748
|
className = "",
|
|
3658
3749
|
cellHover = false
|
|
3659
3750
|
}) => {
|
|
3660
3751
|
const { headerSticky } = useTableContext();
|
|
3661
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ jsx338(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ jsx338("thead", { className: clsx_default(headerSticky ? "table-sticky" : null, className), children }) });
|
|
3662
3753
|
};
|
|
3663
3754
|
TableHead.displayName = "TableHead";
|
|
3664
3755
|
var TableHead_default = TableHead;
|
|
3665
3756
|
|
|
3666
3757
|
// src/components/Table/TableRow.tsx
|
|
3667
|
-
import
|
|
3668
|
-
import { jsx as
|
|
3758
|
+
import React30 from "react";
|
|
3759
|
+
import { jsx as jsx339 } from "react/jsx-runtime";
|
|
3669
3760
|
var TableRow = (props) => {
|
|
3670
3761
|
const {
|
|
3671
3762
|
children,
|
|
@@ -3678,7 +3769,7 @@ var TableRow = (props) => {
|
|
|
3678
3769
|
onClick
|
|
3679
3770
|
} = props;
|
|
3680
3771
|
const { rowBorderUse } = useTableContext();
|
|
3681
|
-
const [stickyCells, setStickyCells] =
|
|
3772
|
+
const [stickyCells, setStickyCells] = React30.useState([]);
|
|
3682
3773
|
const registerStickyCell = (ref) => {
|
|
3683
3774
|
setStickyCells((prev) => {
|
|
3684
3775
|
if (prev.includes(ref)) return prev;
|
|
@@ -3690,7 +3781,7 @@ var TableRow = (props) => {
|
|
|
3690
3781
|
color,
|
|
3691
3782
|
colorDepth ?? 500
|
|
3692
3783
|
);
|
|
3693
|
-
return /* @__PURE__ */
|
|
3784
|
+
return /* @__PURE__ */ jsx339(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ jsx339(
|
|
3694
3785
|
"tr",
|
|
3695
3786
|
{
|
|
3696
3787
|
className: clsx_default(
|
|
@@ -3710,11 +3801,12 @@ TableRow.displayName = "TableRow";
|
|
|
3710
3801
|
var TableRow_default = TableRow;
|
|
3711
3802
|
|
|
3712
3803
|
// src/components/Tag/Tag.tsx
|
|
3713
|
-
import { jsx as
|
|
3804
|
+
import { jsx as jsx340, jsxs as jsxs213 } from "react/jsx-runtime";
|
|
3714
3805
|
var Tag = (props) => {
|
|
3715
3806
|
const {
|
|
3716
3807
|
children,
|
|
3717
3808
|
onClose,
|
|
3809
|
+
size = "md",
|
|
3718
3810
|
colorNamespace = "xplat",
|
|
3719
3811
|
color = "neutral",
|
|
3720
3812
|
colorDepth,
|
|
@@ -3725,21 +3817,21 @@ var Tag = (props) => {
|
|
|
3725
3817
|
color,
|
|
3726
3818
|
colorDepth ?? 500
|
|
3727
3819
|
);
|
|
3728
|
-
return /* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3730
|
-
onClose && /* @__PURE__ */
|
|
3820
|
+
return /* @__PURE__ */ jsxs213("span", { className: clsx_default("lib-xplat-tag", size, colorClass, className), children: [
|
|
3821
|
+
/* @__PURE__ */ jsx340("span", { className: "tag-label", children }),
|
|
3822
|
+
onClose && /* @__PURE__ */ jsx340("button", { className: "tag-close", onClick: onClose, "aria-label": "\uC0AD\uC81C", children: /* @__PURE__ */ jsx340(XIcon_default, {}) })
|
|
3731
3823
|
] });
|
|
3732
3824
|
};
|
|
3733
3825
|
Tag.displayName = "Tag";
|
|
3734
3826
|
var Tag_default = Tag;
|
|
3735
3827
|
|
|
3736
3828
|
// src/components/TextArea/TextArea.tsx
|
|
3737
|
-
import
|
|
3738
|
-
import { jsx as
|
|
3739
|
-
var TextArea =
|
|
3829
|
+
import React31 from "react";
|
|
3830
|
+
import { jsx as jsx341 } from "react/jsx-runtime";
|
|
3831
|
+
var TextArea = React31.forwardRef(
|
|
3740
3832
|
(props, ref) => {
|
|
3741
3833
|
const { value, onChange, className, disabled, ...textareaProps } = props;
|
|
3742
|
-
const localRef =
|
|
3834
|
+
const localRef = React31.useRef(null);
|
|
3743
3835
|
const setRefs = (el) => {
|
|
3744
3836
|
localRef.current = el;
|
|
3745
3837
|
if (!ref) return;
|
|
@@ -3759,21 +3851,21 @@ var TextArea = React30.forwardRef(
|
|
|
3759
3851
|
onChange(event);
|
|
3760
3852
|
}
|
|
3761
3853
|
};
|
|
3762
|
-
|
|
3854
|
+
React31.useEffect(() => {
|
|
3763
3855
|
const el = localRef.current;
|
|
3764
3856
|
if (!el) return;
|
|
3765
3857
|
el.style.height = "0px";
|
|
3766
3858
|
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
3767
3859
|
el.style.height = `${nextHeight}px`;
|
|
3768
3860
|
}, [value]);
|
|
3769
|
-
return /* @__PURE__ */
|
|
3861
|
+
return /* @__PURE__ */ jsx341("div", { className: clsx_default("lib-xplat-textarea-wrapper", className), children: /* @__PURE__ */ jsx341(
|
|
3770
3862
|
"div",
|
|
3771
3863
|
{
|
|
3772
3864
|
className: clsx_default(
|
|
3773
3865
|
"lib-xplat-textarea",
|
|
3774
3866
|
disabled ? "disabled" : void 0
|
|
3775
3867
|
),
|
|
3776
|
-
children: /* @__PURE__ */
|
|
3868
|
+
children: /* @__PURE__ */ jsx341(
|
|
3777
3869
|
"textarea",
|
|
3778
3870
|
{
|
|
3779
3871
|
...textareaProps,
|
|
@@ -3791,25 +3883,25 @@ TextArea.displayName = "TextArea";
|
|
|
3791
3883
|
var TextArea_default = TextArea;
|
|
3792
3884
|
|
|
3793
3885
|
// src/components/Toast/Toast.tsx
|
|
3794
|
-
import
|
|
3886
|
+
import React32 from "react";
|
|
3795
3887
|
import { createPortal as createPortal3 } from "react-dom";
|
|
3796
|
-
import { jsx as
|
|
3797
|
-
var ToastContext =
|
|
3888
|
+
import { jsx as jsx342, jsxs as jsxs214 } from "react/jsx-runtime";
|
|
3889
|
+
var ToastContext = React32.createContext(null);
|
|
3798
3890
|
var useToast = () => {
|
|
3799
|
-
const ctx =
|
|
3891
|
+
const ctx = React32.useContext(ToastContext);
|
|
3800
3892
|
if (!ctx) throw new Error("useToast must be used within ToastProvider");
|
|
3801
3893
|
return ctx;
|
|
3802
3894
|
};
|
|
3803
3895
|
var EXIT_DURATION = 300;
|
|
3804
3896
|
var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
3805
|
-
const ref =
|
|
3806
|
-
const [height, setHeight] =
|
|
3807
|
-
|
|
3897
|
+
const ref = React32.useRef(null);
|
|
3898
|
+
const [height, setHeight] = React32.useState(void 0);
|
|
3899
|
+
React32.useEffect(() => {
|
|
3808
3900
|
if (ref.current && !isExiting) {
|
|
3809
3901
|
setHeight(ref.current.offsetHeight);
|
|
3810
3902
|
}
|
|
3811
3903
|
}, [isExiting]);
|
|
3812
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ jsx342(
|
|
3813
3905
|
"div",
|
|
3814
3906
|
{
|
|
3815
3907
|
className: clsx_default("lib-xplat-toast-wrapper", { exit: isExiting }),
|
|
@@ -3817,15 +3909,15 @@ var ToastItemComponent = ({ item, isExiting, onClose }) => {
|
|
|
3817
3909
|
maxHeight: isExiting ? 0 : height ?? "none",
|
|
3818
3910
|
marginBottom: isExiting ? 0 : void 0
|
|
3819
3911
|
},
|
|
3820
|
-
children: /* @__PURE__ */
|
|
3912
|
+
children: /* @__PURE__ */ jsxs214(
|
|
3821
3913
|
"div",
|
|
3822
3914
|
{
|
|
3823
3915
|
ref,
|
|
3824
3916
|
className: clsx_default("lib-xplat-toast", item.type, { exit: isExiting }),
|
|
3825
3917
|
role: "alert",
|
|
3826
3918
|
children: [
|
|
3827
|
-
/* @__PURE__ */
|
|
3828
|
-
/* @__PURE__ */
|
|
3919
|
+
/* @__PURE__ */ jsx342("span", { className: "message", children: item.message }),
|
|
3920
|
+
/* @__PURE__ */ jsx342("button", { className: "close-btn", onClick: onClose, "aria-label": "\uB2EB\uAE30", children: "\xD7" })
|
|
3829
3921
|
]
|
|
3830
3922
|
}
|
|
3831
3923
|
)
|
|
@@ -3836,13 +3928,13 @@ var ToastProvider = ({
|
|
|
3836
3928
|
children,
|
|
3837
3929
|
position = "top-right"
|
|
3838
3930
|
}) => {
|
|
3839
|
-
const [toasts, setToasts] =
|
|
3840
|
-
const [removing, setRemoving] =
|
|
3841
|
-
const [mounted, setMounted] =
|
|
3842
|
-
|
|
3931
|
+
const [toasts, setToasts] = React32.useState([]);
|
|
3932
|
+
const [removing, setRemoving] = React32.useState(/* @__PURE__ */ new Set());
|
|
3933
|
+
const [mounted, setMounted] = React32.useState(false);
|
|
3934
|
+
React32.useEffect(() => {
|
|
3843
3935
|
setMounted(true);
|
|
3844
3936
|
}, []);
|
|
3845
|
-
const remove =
|
|
3937
|
+
const remove = React32.useCallback((id) => {
|
|
3846
3938
|
setRemoving((prev) => new Set(prev).add(id));
|
|
3847
3939
|
setTimeout(() => {
|
|
3848
3940
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
@@ -3853,7 +3945,7 @@ var ToastProvider = ({
|
|
|
3853
3945
|
});
|
|
3854
3946
|
}, EXIT_DURATION);
|
|
3855
3947
|
}, []);
|
|
3856
|
-
const toast =
|
|
3948
|
+
const toast = React32.useCallback(
|
|
3857
3949
|
(type, message, duration = 3e3) => {
|
|
3858
3950
|
const id = `${Date.now()}-${Math.random()}`;
|
|
3859
3951
|
setToasts((prev) => [...prev, { id, type, message }]);
|
|
@@ -3863,10 +3955,10 @@ var ToastProvider = ({
|
|
|
3863
3955
|
},
|
|
3864
3956
|
[remove]
|
|
3865
3957
|
);
|
|
3866
|
-
return /* @__PURE__ */
|
|
3958
|
+
return /* @__PURE__ */ jsxs214(ToastContext.Provider, { value: { toast }, children: [
|
|
3867
3959
|
children,
|
|
3868
3960
|
mounted && createPortal3(
|
|
3869
|
-
/* @__PURE__ */
|
|
3961
|
+
/* @__PURE__ */ jsx342("div", { className: clsx_default("lib-xplat-toast-container", position), children: toasts.map((t) => /* @__PURE__ */ jsx342(
|
|
3870
3962
|
ToastItemComponent,
|
|
3871
3963
|
{
|
|
3872
3964
|
item: t,
|
|
@@ -3882,8 +3974,8 @@ var ToastProvider = ({
|
|
|
3882
3974
|
ToastProvider.displayName = "ToastProvider";
|
|
3883
3975
|
|
|
3884
3976
|
// src/components/Tooltip/Tooltip.tsx
|
|
3885
|
-
import
|
|
3886
|
-
import { jsx as
|
|
3977
|
+
import React33 from "react";
|
|
3978
|
+
import { jsx as jsx343, jsxs as jsxs215 } from "react/jsx-runtime";
|
|
3887
3979
|
var Tooltip2 = (props) => {
|
|
3888
3980
|
const {
|
|
3889
3981
|
type = "primary",
|
|
@@ -3893,24 +3985,24 @@ var Tooltip2 = (props) => {
|
|
|
3893
3985
|
description,
|
|
3894
3986
|
children
|
|
3895
3987
|
} = props;
|
|
3896
|
-
const iconRef =
|
|
3988
|
+
const iconRef = React33.useRef(null);
|
|
3897
3989
|
const colorClass = getColorClass(
|
|
3898
3990
|
colorNamespace,
|
|
3899
3991
|
color,
|
|
3900
3992
|
colorDepth ?? 500
|
|
3901
3993
|
);
|
|
3902
|
-
return /* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3994
|
+
return /* @__PURE__ */ jsxs215("div", { className: "lib-xplat-tooltip", children: [
|
|
3995
|
+
/* @__PURE__ */ jsx343("div", { className: "tooltip-content", ref: iconRef, children: children || "Tooltip" }),
|
|
3996
|
+
/* @__PURE__ */ jsx343("div", { className: clsx_default("tooltip-wrapper", colorClass, type), children: description })
|
|
3905
3997
|
] });
|
|
3906
3998
|
};
|
|
3907
3999
|
Tooltip2.displayName = "Tooltip";
|
|
3908
4000
|
var Tooltip_default = Tooltip2;
|
|
3909
4001
|
|
|
3910
4002
|
// src/components/Video/Video.tsx
|
|
3911
|
-
import
|
|
3912
|
-
import { jsx as
|
|
3913
|
-
var Video =
|
|
4003
|
+
import React34 from "react";
|
|
4004
|
+
import { jsx as jsx344, jsxs as jsxs216 } from "react/jsx-runtime";
|
|
4005
|
+
var Video = React34.forwardRef((props, ref) => {
|
|
3914
4006
|
const {
|
|
3915
4007
|
src,
|
|
3916
4008
|
poster,
|
|
@@ -3924,10 +4016,10 @@ var Video = React33.forwardRef((props, ref) => {
|
|
|
3924
4016
|
onPause,
|
|
3925
4017
|
...rest
|
|
3926
4018
|
} = props;
|
|
3927
|
-
const videoRef =
|
|
3928
|
-
const [isPlaying, setIsPlaying] =
|
|
3929
|
-
const [isLoaded, setIsLoaded] =
|
|
3930
|
-
const setRefs =
|
|
4019
|
+
const videoRef = React34.useRef(null);
|
|
4020
|
+
const [isPlaying, setIsPlaying] = React34.useState(Boolean(autoPlay));
|
|
4021
|
+
const [isLoaded, setIsLoaded] = React34.useState(false);
|
|
4022
|
+
const setRefs = React34.useCallback(
|
|
3931
4023
|
(el) => {
|
|
3932
4024
|
videoRef.current = el;
|
|
3933
4025
|
if (typeof ref === "function") ref(el);
|
|
@@ -3955,7 +4047,7 @@ var Video = React33.forwardRef((props, ref) => {
|
|
|
3955
4047
|
}
|
|
3956
4048
|
};
|
|
3957
4049
|
const showCustomOverlay = !controls;
|
|
3958
|
-
return /* @__PURE__ */
|
|
4050
|
+
return /* @__PURE__ */ jsxs216(
|
|
3959
4051
|
"div",
|
|
3960
4052
|
{
|
|
3961
4053
|
className: clsx_default(
|
|
@@ -3964,7 +4056,7 @@ var Video = React33.forwardRef((props, ref) => {
|
|
|
3964
4056
|
className
|
|
3965
4057
|
),
|
|
3966
4058
|
children: [
|
|
3967
|
-
/* @__PURE__ */
|
|
4059
|
+
/* @__PURE__ */ jsx344(
|
|
3968
4060
|
"video",
|
|
3969
4061
|
{
|
|
3970
4062
|
ref: setRefs,
|
|
@@ -3981,7 +4073,7 @@ var Video = React33.forwardRef((props, ref) => {
|
|
|
3981
4073
|
...rest
|
|
3982
4074
|
}
|
|
3983
4075
|
),
|
|
3984
|
-
showCustomOverlay && /* @__PURE__ */
|
|
4076
|
+
showCustomOverlay && /* @__PURE__ */ jsx344(
|
|
3985
4077
|
"button",
|
|
3986
4078
|
{
|
|
3987
4079
|
type: "button",
|
|
@@ -3992,7 +4084,7 @@ var Video = React33.forwardRef((props, ref) => {
|
|
|
3992
4084
|
),
|
|
3993
4085
|
onClick: togglePlay,
|
|
3994
4086
|
"aria-label": isPlaying ? "\uC77C\uC2DC\uC815\uC9C0" : "\uC7AC\uC0DD",
|
|
3995
|
-
children: isPlaying ? /* @__PURE__ */
|
|
4087
|
+
children: isPlaying ? /* @__PURE__ */ jsx344(PauseIcon_default, {}) : /* @__PURE__ */ jsx344("span", { className: "play-icon", children: /* @__PURE__ */ jsx344(PlayCircleIcon_default, {}) })
|
|
3996
4088
|
}
|
|
3997
4089
|
)
|
|
3998
4090
|
]
|
|
@@ -4009,6 +4101,7 @@ export {
|
|
|
4009
4101
|
Breadcrumb_default as Breadcrumb,
|
|
4010
4102
|
Button_default as Button,
|
|
4011
4103
|
Card_default as Card,
|
|
4104
|
+
CardTab_default as CardTab,
|
|
4012
4105
|
Chart_default as Chart,
|
|
4013
4106
|
CheckBox_default as CheckBox,
|
|
4014
4107
|
Chip_default as Chip,
|