@x-plat/design-system 0.19.0 → 0.21.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/chunk-2EGVOUGV.cjs +93 -0
- package/dist/chunk-2T3BVV7R.js +0 -0
- package/dist/chunk-3FYYFDKQ.js +159 -0
- package/dist/chunk-3M3GFSHJ.js +67 -0
- package/dist/chunk-3WBHUFOA.cjs +48 -0
- package/dist/chunk-3XYYZQR5.cjs +22 -0
- package/dist/chunk-4EF7NVAL.js +67 -0
- package/dist/chunk-4ISERXK2.cjs +1 -0
- package/dist/chunk-4KYHHJ6Z.cjs +250 -0
- package/dist/chunk-4NSRDRXC.cjs +70 -0
- package/dist/chunk-4OXMRSVE.cjs +99 -0
- package/dist/chunk-55EPYLXN.js +30 -0
- package/dist/chunk-5CE3ADO5.js +254 -0
- package/dist/chunk-5F6Y2JD6.cjs +1 -0
- package/dist/chunk-5FMTMXSP.cjs +127 -0
- package/dist/chunk-5POCKDDY.js +36 -0
- package/dist/chunk-5VDI56BV.js +33 -0
- package/dist/chunk-5WLBUPSK.js +77 -0
- package/dist/chunk-5WNNWQHD.cjs +272 -0
- package/dist/chunk-66STZB6I.cjs +404 -0
- package/dist/chunk-6AIKCZN7.js +1455 -0
- package/dist/chunk-6IUJJUVP.js +18 -0
- package/dist/chunk-6P2B3ZGP.js +79 -0
- package/dist/chunk-764ILIDG.cjs +22 -0
- package/dist/chunk-7B44DWC4.js +0 -0
- package/dist/chunk-7BE6ETFY.js +18 -0
- package/dist/chunk-7BSUS5A4.js +97 -0
- package/dist/chunk-7RPWCDEW.cjs +20 -0
- package/dist/chunk-7ULXHGLO.cjs +77 -0
- package/dist/chunk-7YOI5XOW.js +55 -0
- package/dist/chunk-AFVTM5CP.js +0 -0
- package/dist/chunk-AN2WSL3B.cjs +1 -0
- package/dist/chunk-AT5Y5GLS.cjs +118 -0
- package/dist/chunk-AWPO2FI7.js +404 -0
- package/dist/chunk-BGXHIDUR.js +103 -0
- package/dist/chunk-BPZXL5TP.js +99 -0
- package/dist/chunk-BRTS5GWV.js +275 -0
- package/dist/chunk-BS3MLZCK.cjs +97 -0
- package/dist/chunk-BSPYYE2U.js +36 -0
- package/dist/chunk-BWJAEB42.js +48 -0
- package/dist/chunk-C4RMTISI.cjs +18 -0
- package/dist/chunk-C6M4XVR7.cjs +36 -0
- package/dist/chunk-CGC4D5MP.cjs +89 -0
- package/dist/chunk-CIRQYSQW.js +70 -0
- package/dist/chunk-CLOTWJNP.cjs +310 -0
- package/dist/chunk-CS7ZY35M.cjs +49 -0
- package/dist/chunk-CUV4RLDE.js +89 -0
- package/dist/chunk-CZAMLFSE.cjs +275 -0
- package/dist/chunk-D7QZLJ3Z.cjs +18 -0
- package/dist/chunk-DMSAAZ3M.cjs +92 -0
- package/dist/chunk-DUIZC7VJ.cjs +36 -0
- package/dist/chunk-DVBF4BDH.js +43 -0
- package/dist/chunk-EETYMP6K.cjs +584 -0
- package/dist/chunk-EFQL7JPX.js +0 -0
- package/dist/chunk-EFU7IAF5.cjs +12 -0
- package/dist/chunk-F3M2H5EX.cjs +79 -0
- package/dist/chunk-F436V2SX.cjs +254 -0
- package/dist/chunk-F664X2OY.js +250 -0
- package/dist/chunk-FF7ELUQW.cjs +1 -0
- package/dist/chunk-G3HE4S3Q.cjs +296 -0
- package/dist/chunk-GOPD5KUK.js +23 -0
- package/dist/chunk-GYTB24V6.cjs +107 -0
- package/dist/chunk-GZ657SGO.js +310 -0
- package/dist/chunk-H2QN65L6.cjs +1 -0
- package/dist/chunk-H6WUT7CK.js +22 -0
- package/dist/chunk-H76OQ75T.js +49 -0
- package/dist/chunk-HA3XONYI.js +18 -0
- package/dist/chunk-HF3UFXEU.js +296 -0
- package/dist/chunk-HGA47QVV.cjs +55 -0
- package/dist/chunk-HHPPAMXF.cjs +674 -0
- package/dist/chunk-HLV2XIE2.cjs +385 -0
- package/dist/chunk-HNQGIL45.cjs +96 -0
- package/dist/chunk-HQ37R7T3.js +53 -0
- package/dist/chunk-HXUGW4RR.js +187 -0
- package/dist/chunk-HYPRLWD3.js +272 -0
- package/dist/chunk-I7TLJUTP.cjs +6 -0
- package/dist/chunk-ICTWDTKC.cjs +1 -0
- package/dist/chunk-IPYKHDP4.cjs +187 -0
- package/dist/chunk-IRKREQ2X.cjs +18 -0
- package/dist/chunk-IVJJBMRY.js +92 -0
- package/dist/chunk-JPVIVOFG.js +26 -0
- package/dist/chunk-JYNBNSNF.js +151 -0
- package/dist/chunk-JZC3BXAC.js +93 -0
- package/dist/chunk-K5XPQWXN.cjs +92 -0
- package/dist/chunk-KQ3GOMHL.js +31 -0
- package/dist/chunk-KUJH72U6.cjs +159 -0
- package/dist/chunk-KVUXLC6M.cjs +479 -0
- package/dist/chunk-KZOJN57Q.js +19 -0
- package/dist/chunk-L3XPL4NP.cjs +53 -0
- package/dist/chunk-LOEMSXYB.js +0 -0
- package/dist/chunk-LU4KBPNG.cjs +23 -0
- package/dist/chunk-MWWWPQDB.js +26 -0
- package/dist/chunk-NCBB3WUJ.js +562 -0
- package/dist/chunk-NGCZTZST.cjs +562 -0
- package/dist/chunk-NSDKALIS.cjs +67 -0
- package/dist/chunk-NZHCRLNB.cjs +26 -0
- package/dist/chunk-OL4NANHB.js +0 -0
- package/dist/chunk-OTJRNKLR.js +96 -0
- package/dist/chunk-OWWFKTSK.js +0 -0
- package/dist/chunk-P2E3PB62.cjs +99 -0
- package/dist/chunk-P2QVFR7S.js +20 -0
- package/dist/chunk-P6ZGIYY7.cjs +18 -0
- package/dist/chunk-PFGSJJRY.cjs +19 -0
- package/dist/chunk-PNIUW7AJ.cjs +32 -0
- package/dist/chunk-Q2M2ONGO.js +70 -0
- package/dist/chunk-Q4PGP5KE.cjs +562 -0
- package/dist/chunk-QAI2YQPY.cjs +51 -0
- package/dist/chunk-QCD7UEZ3.cjs +59 -0
- package/dist/chunk-QEZ4R3SK.js +6 -0
- package/dist/chunk-QKDCPM2D.cjs +23 -0
- package/dist/chunk-QRGG3V7W.cjs +59 -0
- package/dist/chunk-QURIHUEC.js +107 -0
- package/dist/chunk-QY742LWN.js +30 -0
- package/dist/chunk-QYMRGYTN.js +127 -0
- package/dist/chunk-RLKJ2RZG.js +23 -0
- package/dist/chunk-RRR5BUOM.cjs +30 -0
- package/dist/chunk-RU3FCVXM.cjs +1 -0
- package/dist/chunk-RYTDVTV2.js +32 -0
- package/dist/chunk-RYYGUYDE.js +92 -0
- package/dist/chunk-SGLP4U3Y.cjs +67 -0
- package/dist/chunk-SJC543ZK.js +71 -0
- package/dist/chunk-SLYQK4SC.js +20 -0
- package/dist/chunk-SMLCOMLS.js +2888 -0
- package/dist/chunk-SNMOPLMH.cjs +372 -0
- package/dist/chunk-TRJUJYW7.cjs +151 -0
- package/dist/chunk-TTY5PE3P.js +30 -0
- package/dist/chunk-TXARYG3J.js +22 -0
- package/dist/chunk-TYXJU4EF.js +18 -0
- package/dist/chunk-U3PC7FYZ.cjs +26 -0
- package/dist/chunk-U67JM2WL.cjs +34 -0
- package/dist/chunk-UARGO5UG.js +59 -0
- package/dist/chunk-UCYE3H3F.cjs +43 -0
- package/dist/chunk-UGEGN35F.js +118 -0
- package/dist/chunk-UHUA3GQC.cjs +30 -0
- package/dist/chunk-UJQN477L.js +59 -0
- package/dist/chunk-UMX7DTFZ.cjs +70 -0
- package/dist/chunk-UT42P54P.js +372 -0
- package/dist/chunk-V76ZRGHQ.cjs +1 -0
- package/dist/chunk-VCIK366Y.cjs +1455 -0
- package/dist/chunk-VMA74ABT.cjs +137 -0
- package/dist/chunk-VSA62N2O.js +12 -0
- package/dist/chunk-WDAFLVQK.js +479 -0
- package/dist/chunk-WHMLMAMO.js +674 -0
- package/dist/chunk-WNBLKKLM.js +0 -0
- package/dist/chunk-WQ2GY7F3.js +46 -0
- package/dist/chunk-WRLCCK3M.cjs +30 -0
- package/dist/chunk-WVCZIOLY.js +562 -0
- package/dist/chunk-WZLGJQLW.js +385 -0
- package/dist/chunk-XB6FEBK6.js +34 -0
- package/dist/chunk-XMERDSRE.js +75 -0
- package/dist/chunk-XMLFKZYY.js +137 -0
- package/dist/chunk-XMM52J3T.js +584 -0
- package/dist/chunk-XZ7C5CGB.cjs +103 -0
- package/dist/chunk-YGFBAOKX.js +51 -0
- package/dist/chunk-YIN552MF.cjs +20 -0
- package/dist/chunk-YLC42E65.cjs +31 -0
- package/dist/chunk-YOTXRYJL.cjs +46 -0
- package/dist/chunk-ZAUGJZK7.js +99 -0
- package/dist/chunk-ZIZOQTDG.cjs +75 -0
- package/dist/chunk-ZMSV5VZI.cjs +2888 -0
- package/dist/chunk-ZN6MLZAE.cjs +71 -0
- package/dist/chunk-ZNCT6HXA.cjs +33 -0
- package/dist/components/Accordion/index.cjs +5 -1036
- package/dist/components/Accordion/index.js +5 -999
- package/dist/components/Alert/index.cjs +4 -69
- package/dist/components/Alert/index.js +4 -42
- package/dist/components/AutoResizeTextArea/index.cjs +6 -260
- package/dist/components/AutoResizeTextArea/index.js +6 -223
- package/dist/components/Avatar/index.cjs +4 -65
- package/dist/components/Avatar/index.js +4 -38
- package/dist/components/Badge/index.cjs +6 -69
- package/dist/components/Badge/index.js +5 -40
- package/dist/components/Box/index.cjs +4 -58
- package/dist/components/Box/index.js +4 -31
- package/dist/components/Breadcrumb/index.cjs +4 -42
- package/dist/components/Breadcrumb/index.js +3 -14
- package/dist/components/Button/index.cjs +5 -65
- package/dist/components/Button/index.js +5 -38
- package/dist/components/Calendar/index.cjs +6 -1317
- package/dist/components/Calendar/index.js +10 -1281
- package/dist/components/CardTab/index.cjs +4 -120
- package/dist/components/CardTab/index.js +4 -83
- package/dist/components/Chart/index.cjs +5 -708
- package/dist/components/Chart/index.js +4 -670
- package/dist/components/ChatInput/index.cjs +9 -390
- package/dist/components/ChatInput/index.js +9 -353
- package/dist/components/CheckBox/index.cjs +20 -1125
- package/dist/components/CheckBox/index.js +17 -1095
- package/dist/components/Chip/index.cjs +5 -55
- package/dist/components/Chip/index.js +5 -28
- package/dist/components/DatePicker/index.cjs +16 -2136
- package/dist/components/DatePicker/index.js +19 -2099
- package/dist/components/Divider/index.cjs +4 -58
- package/dist/components/Divider/index.js +4 -31
- package/dist/components/Drawer/index.cjs +5 -190
- package/dist/components/Drawer/index.js +5 -153
- package/dist/components/Dropdown/index.cjs +7 -375
- package/dist/components/Dropdown/index.js +7 -338
- package/dist/components/Editor/index.cjs +6 -1486
- package/dist/components/Editor/index.css +53 -0
- package/dist/components/Editor/index.d.cts +13 -0
- package/dist/components/Editor/index.d.ts +13 -0
- package/dist/components/Editor/index.js +6 -1453
- package/dist/components/EmptyState/index.cjs +4 -42
- package/dist/components/EmptyState/index.js +3 -14
- package/dist/components/FieldMessage/index.cjs +7 -182
- package/dist/components/FieldMessage/index.js +8 -154
- package/dist/components/FileUpload/index.cjs +7 -1171
- package/dist/components/FileUpload/index.js +7 -1134
- package/dist/components/HtmlTypeWriter/index.cjs +3 -171
- package/dist/components/HtmlTypeWriter/index.js +3 -133
- package/dist/components/IconButton/index.cjs +4 -65
- package/dist/components/IconButton/index.js +4 -38
- package/dist/components/ImageSelector/index.cjs +8 -1214
- package/dist/components/ImageSelector/index.js +8 -1177
- package/dist/components/Input/index.cjs +7 -429
- package/dist/components/Input/index.js +8 -392
- package/dist/components/Link/index.cjs +4 -61
- package/dist/components/Link/index.js +4 -34
- package/dist/components/LinkButton/index.cjs +5 -61
- package/dist/components/LinkButton/index.js +5 -34
- package/dist/components/Modal/index.cjs +5 -190
- package/dist/components/Modal/index.js +5 -153
- package/dist/components/NotificationBadge/index.cjs +5 -68
- package/dist/components/NotificationBadge/index.js +5 -40
- package/dist/components/Pagination/index.cjs +6 -1034
- package/dist/components/Pagination/index.js +6 -1007
- package/dist/components/PopOver/index.cjs +7 -363
- package/dist/components/PopOver/index.js +7 -326
- package/dist/components/Progress/index.cjs +5 -84
- package/dist/components/Progress/index.js +5 -57
- package/dist/components/Radio/index.cjs +7 -274
- package/dist/components/Radio/index.js +8 -237
- package/dist/components/Select/index.cjs +10 -1577
- package/dist/components/Select/index.js +11 -1540
- package/dist/components/Skeleton/index.cjs +4 -71
- package/dist/components/Skeleton/index.js +4 -44
- package/dist/components/Spinner/index.cjs +5 -88
- package/dist/components/Spinner/index.js +5 -61
- package/dist/components/Stat/index.cjs +5 -81
- package/dist/components/Stat/index.js +5 -54
- package/dist/components/Steps/index.cjs +7 -968
- package/dist/components/Steps/index.js +7 -941
- package/dist/components/Swiper/index.cjs +4 -357
- package/dist/components/Swiper/index.js +4 -320
- package/dist/components/Switch/index.cjs +7 -252
- package/dist/components/Switch/index.js +7 -215
- package/dist/components/Tab/index.cjs +4 -144
- package/dist/components/Tab/index.js +4 -107
- package/dist/components/Table/index.cjs +4 -310
- package/dist/components/Table/index.css +31 -5
- package/dist/components/Table/index.js +8 -273
- package/dist/components/Tag/index.cjs +6 -969
- package/dist/components/Tag/index.js +6 -942
- package/dist/components/TextArea/index.cjs +6 -229
- package/dist/components/TextArea/index.js +6 -192
- package/dist/components/TimePicker/index.cjs +9 -579
- package/dist/components/TimePicker/index.js +9 -542
- package/dist/components/Toast/index.cjs +5 -146
- package/dist/components/Toast/index.js +5 -108
- package/dist/components/ToggleChip/index.cjs +5 -66
- package/dist/components/ToggleChip/index.js +5 -39
- package/dist/components/Tooltip/index.cjs +6 -204
- package/dist/components/Tooltip/index.js +6 -167
- package/dist/components/Tour/index.cjs +6 -414
- package/dist/components/Tour/index.js +6 -377
- package/dist/components/Video/index.cjs +7 -796
- package/dist/components/Video/index.js +7 -759
- package/dist/components/index.cjs +140 -8315
- package/dist/components/index.css +31 -5
- package/dist/components/index.js +190 -8261
- package/dist/index.cjs +903 -13291
- package/dist/index.css +31 -5
- package/dist/index.js +524 -12499
- package/dist/layout/Grid/FullGrid/index.cjs +4 -46
- package/dist/layout/Grid/FullGrid/index.js +3 -18
- package/dist/layout/Grid/FullScreen/index.cjs +4 -46
- package/dist/layout/Grid/FullScreen/index.js +3 -18
- package/dist/layout/Grid/Item/index.cjs +5 -68
- package/dist/layout/Grid/Item/index.js +5 -41
- package/dist/layout/Grid/index.cjs +14 -109
- package/dist/layout/Grid/index.js +14 -79
- package/dist/layout/Header/index.cjs +4 -44
- package/dist/layout/Header/index.js +3 -16
- package/dist/layout/Layout/index.cjs +4 -42
- package/dist/layout/Layout/index.js +3 -14
- package/dist/layout/SideBar/index.cjs +6 -96
- package/dist/layout/SideBar/index.js +6 -57
- package/dist/layout/index.cjs +38 -209
- package/dist/layout/index.js +27 -153
- package/dist/tokens/index.cjs +627 -6119
- package/dist/tokens/index.js +324 -5489
- package/guidelines/components/editor.md +3 -0
- package/guidelines/components/table.md +23 -0
- package/guidelines/setup.md +7 -0
- package/package.json +6 -3
|
@@ -1,110 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function r(e) {
|
|
6
|
-
var t, f, n = "";
|
|
7
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
8
|
-
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
9
|
-
var o = e.length;
|
|
10
|
-
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
11
|
-
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
12
|
-
return n;
|
|
13
|
-
}
|
|
14
|
-
function clsx() {
|
|
15
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
16
|
-
return n;
|
|
17
|
-
}
|
|
18
|
-
var clsx_default = clsx;
|
|
19
|
-
|
|
20
|
-
// src/components/Tab/TabItem.tsx
|
|
21
|
-
import React from "react";
|
|
22
|
-
import { jsx } from "react/jsx-runtime";
|
|
23
|
-
var TabItem = React.forwardRef((props, ref) => {
|
|
24
|
-
const { isActive, title, onClick } = props;
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
ref,
|
|
29
|
-
type: "button",
|
|
30
|
-
role: "tab",
|
|
31
|
-
"aria-selected": isActive,
|
|
32
|
-
tabIndex: isActive ? 0 : -1,
|
|
33
|
-
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
34
|
-
onClick,
|
|
35
|
-
children: title
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
});
|
|
39
|
-
TabItem.displayName = "TabItem";
|
|
40
|
-
var TabItem_default = TabItem;
|
|
41
|
-
|
|
42
|
-
// src/components/Tab/Tab.tsx
|
|
43
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
44
|
-
var Tab = (props) => {
|
|
45
|
-
const { activeIndex, onChange, tabs, variant, type, size = "md" } = props;
|
|
46
|
-
const shape = variant ?? type ?? "default";
|
|
47
|
-
const [underlineStyle, setUnderlineStyle] = React2.useState({
|
|
48
|
-
left: 0,
|
|
49
|
-
width: 0
|
|
50
|
-
});
|
|
51
|
-
const itemRefs = React2.useRef([]);
|
|
52
|
-
const handleKeyDown = (e) => {
|
|
53
|
-
const last = tabs.length - 1;
|
|
54
|
-
let next = null;
|
|
55
|
-
if (e.key === "ArrowRight") next = activeIndex >= last ? 0 : activeIndex + 1;
|
|
56
|
-
else if (e.key === "ArrowLeft") next = activeIndex <= 0 ? last : activeIndex - 1;
|
|
57
|
-
else if (e.key === "Home") next = 0;
|
|
58
|
-
else if (e.key === "End") next = last;
|
|
59
|
-
if (next === null) return;
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
onChange(tabs[next], next);
|
|
62
|
-
itemRefs.current[next]?.focus();
|
|
63
|
-
};
|
|
64
|
-
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
65
|
-
onChange(tabItem, tabIdx);
|
|
66
|
-
};
|
|
67
|
-
React2.useEffect(() => {
|
|
68
|
-
const el = itemRefs.current[activeIndex];
|
|
69
|
-
if (el) {
|
|
70
|
-
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
71
|
-
}
|
|
72
|
-
}, [activeIndex, tabs.length]);
|
|
73
|
-
return /* @__PURE__ */ jsxs(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
className: clsx_default("lib-xplat-tab", `type-${shape}`, size),
|
|
77
|
-
role: "tablist",
|
|
78
|
-
onKeyDown: handleKeyDown,
|
|
79
|
-
children: [
|
|
80
|
-
tabs.map((tab, idx) => /* @__PURE__ */ jsx2(
|
|
81
|
-
TabItem_default,
|
|
82
|
-
{
|
|
83
|
-
onClick: () => handleChangeActiveTab(tab, idx),
|
|
84
|
-
isActive: activeIndex === idx,
|
|
85
|
-
ref: (el) => {
|
|
86
|
-
itemRefs.current[idx] = el;
|
|
87
|
-
},
|
|
88
|
-
title: tab.title
|
|
89
|
-
},
|
|
90
|
-
`${tab.value}_${idx}`
|
|
91
|
-
)),
|
|
92
|
-
shape === "toggle" && /* @__PURE__ */ jsx2(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
className: "tab-toggle-underline",
|
|
96
|
-
style: {
|
|
97
|
-
left: underlineStyle.left,
|
|
98
|
-
width: underlineStyle.width
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
Tab.displayName = "Tab";
|
|
107
|
-
var Tab_default = Tab;
|
|
1
|
+
import {
|
|
2
|
+
Tab_default
|
|
3
|
+
} from "../../chunk-BPZXL5TP.js";
|
|
4
|
+
import "../../chunk-KZOJN57Q.js";
|
|
108
5
|
export {
|
|
109
6
|
Tab_default as Tab
|
|
110
7
|
};
|
|
@@ -1,321 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
29
2
|
|
|
30
|
-
// src/components/Table/index.ts
|
|
31
|
-
var Table_exports = {};
|
|
32
|
-
__export(Table_exports, {
|
|
33
|
-
Table: () => Table_default,
|
|
34
|
-
TableBody: () => TableBody_default,
|
|
35
|
-
TableCell: () => TableCell_default,
|
|
36
|
-
TableHead: () => TableHead_default,
|
|
37
|
-
TableRow: () => TableRow_default
|
|
38
|
-
});
|
|
39
|
-
module.exports = __toCommonJS(Table_exports);
|
|
40
3
|
|
|
41
|
-
// src/components/Table/Table.tsx
|
|
42
|
-
var import_react2 = __toESM(require("react"), 1);
|
|
43
4
|
|
|
44
|
-
// src/components/Table/TableContext.tsx
|
|
45
|
-
var import_react = __toESM(require("react"), 1);
|
|
46
|
-
var TableContext = import_react.default.createContext(null);
|
|
47
|
-
var useTableContext = () => {
|
|
48
|
-
const ctx = import_react.default.useContext(TableContext);
|
|
49
|
-
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
50
|
-
return ctx;
|
|
51
|
-
};
|
|
52
|
-
var TableContext_default = TableContext;
|
|
53
5
|
|
|
54
|
-
// src/components/Table/Table.tsx
|
|
55
|
-
var import_jsx_runtime = (
|
|
56
|
-
/**
|
|
57
|
-
* 바깥 이름(`lib-xplat-table-wrapper`)을 그대로 둔다 — 소비처가 이 클래스를
|
|
58
|
-
* 자리 잡는 데 쓰고 있을 수 있어서다. 스크롤은 안쪽 `-scroller` 가 맡는다.
|
|
59
|
-
*/
|
|
60
|
-
require("react/jsx-runtime")
|
|
61
|
-
);
|
|
62
|
-
var useScrollExtent = (scrollerRef, thumbRef) => {
|
|
63
|
-
const [scrollable, setScrollable] = import_react2.default.useState(false);
|
|
64
|
-
import_react2.default.useEffect(() => {
|
|
65
|
-
const el = scrollerRef.current;
|
|
66
|
-
if (!el) return;
|
|
67
|
-
const update = () => {
|
|
68
|
-
const max = el.scrollWidth - el.clientWidth;
|
|
69
|
-
const can = max > 1;
|
|
70
|
-
setScrollable(can);
|
|
71
|
-
const thumb = thumbRef.current;
|
|
72
|
-
if (!thumb) return;
|
|
73
|
-
const ratio = can ? el.clientWidth / el.scrollWidth : 1;
|
|
74
|
-
const w = Math.max(ratio * 100, 8);
|
|
75
|
-
thumb.style.width = `${w.toFixed(2)}%`;
|
|
76
|
-
thumb.style.left = can ? `${(el.scrollLeft / max * (100 - w)).toFixed(2)}%` : "0%";
|
|
77
|
-
};
|
|
78
|
-
update();
|
|
79
|
-
el.addEventListener("scroll", update, { passive: true });
|
|
80
|
-
const ro = new ResizeObserver(update);
|
|
81
|
-
ro.observe(el);
|
|
82
|
-
const table = el.firstElementChild;
|
|
83
|
-
if (table) ro.observe(table);
|
|
84
|
-
return () => {
|
|
85
|
-
el.removeEventListener("scroll", update);
|
|
86
|
-
ro.disconnect();
|
|
87
|
-
};
|
|
88
|
-
}, [scrollerRef, thumbRef]);
|
|
89
|
-
return scrollable;
|
|
90
|
-
};
|
|
91
|
-
var Table = (props) => {
|
|
92
|
-
const {
|
|
93
|
-
children,
|
|
94
|
-
size = "md",
|
|
95
|
-
rowBorderUse = true,
|
|
96
|
-
colBorderUse = true,
|
|
97
|
-
headerSticky = false,
|
|
98
|
-
stickyShadow = true,
|
|
99
|
-
minWidth
|
|
100
|
-
} = props;
|
|
101
|
-
const scrollerRef = import_react2.default.useRef(null);
|
|
102
|
-
const thumbRef = import_react2.default.useRef(null);
|
|
103
|
-
const scrollable = useScrollExtent(scrollerRef, thumbRef);
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
className: `lib-xplat-table-wrapper ${size}`,
|
|
108
|
-
style: minWidth === void 0 ? void 0 : {
|
|
109
|
-
"--table-min-width": typeof minWidth === "number" ? `${minWidth}px` : minWidth
|
|
110
|
-
},
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
-
"div",
|
|
114
|
-
{
|
|
115
|
-
ref: scrollerRef,
|
|
116
|
-
className: "lib-xplat-table-scroller",
|
|
117
|
-
"data-xplat-overlay-escape": "",
|
|
118
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
119
|
-
TableContext_default.Provider,
|
|
120
|
-
{
|
|
121
|
-
value: {
|
|
122
|
-
rowBorderUse,
|
|
123
|
-
colBorderUse,
|
|
124
|
-
headerSticky,
|
|
125
|
-
stickyShadow
|
|
126
|
-
},
|
|
127
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "lib-xplat-table", children })
|
|
128
|
-
}
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `lib-xplat-table-scrollbar${scrollable ? " scrollable" : ""}`, "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: thumbRef, className: "table-scrollbar-thumb" }) })
|
|
133
|
-
]
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
Table.displayName = "Table";
|
|
138
|
-
var Table_default = Table;
|
|
139
6
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var TableBody = (props) => {
|
|
143
|
-
const { children } = props;
|
|
144
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { children });
|
|
145
|
-
};
|
|
146
|
-
TableBody.displayName = "TableBody";
|
|
147
|
-
var TableBody_default = TableBody;
|
|
7
|
+
var _chunkG3HE4S3Qcjs = require('../../chunk-G3HE4S3Q.cjs');
|
|
8
|
+
require('../../chunk-PFGSJJRY.cjs');
|
|
148
9
|
|
|
149
|
-
// src/components/Table/TableCell.tsx
|
|
150
|
-
var import_react5 = __toESM(require("react"), 1);
|
|
151
10
|
|
|
152
|
-
// ../../node_modules/clsx/dist/clsx.mjs
|
|
153
|
-
function r(e) {
|
|
154
|
-
var t, f, n = "";
|
|
155
|
-
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
156
|
-
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
157
|
-
var o = e.length;
|
|
158
|
-
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
159
|
-
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
160
|
-
return n;
|
|
161
|
-
}
|
|
162
|
-
function clsx() {
|
|
163
|
-
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
164
|
-
return n;
|
|
165
|
-
}
|
|
166
|
-
var clsx_default = clsx;
|
|
167
11
|
|
|
168
|
-
// src/components/Table/TableHeadContext.tsx
|
|
169
|
-
var import_react3 = __toESM(require("react"), 1);
|
|
170
|
-
var TableHeadContext = import_react3.default.createContext(
|
|
171
|
-
null
|
|
172
|
-
);
|
|
173
|
-
var useTableHeadContext = () => {
|
|
174
|
-
const ctx = import_react3.default.useContext(TableHeadContext);
|
|
175
|
-
return ctx;
|
|
176
|
-
};
|
|
177
|
-
var TableHeadContext_default = TableHeadContext;
|
|
178
12
|
|
|
179
|
-
// src/components/Table/TableRowContext.tsx
|
|
180
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
181
|
-
var TableRowContext = import_react4.default.createContext(null);
|
|
182
|
-
var useTableRowContext = () => {
|
|
183
|
-
const ctx = import_react4.default.useContext(TableRowContext);
|
|
184
|
-
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
185
|
-
return ctx;
|
|
186
|
-
};
|
|
187
|
-
var TableRowContext_default = TableRowContext;
|
|
188
13
|
|
|
189
|
-
// src/components/Table/TableCell.tsx
|
|
190
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
191
|
-
var TableCell = import_react5.default.memo((props) => {
|
|
192
|
-
const {
|
|
193
|
-
children,
|
|
194
|
-
align = "center",
|
|
195
|
-
isSticky = false,
|
|
196
|
-
width,
|
|
197
|
-
nowrap = false,
|
|
198
|
-
scope = "col",
|
|
199
|
-
colSpan,
|
|
200
|
-
onClick
|
|
201
|
-
} = props;
|
|
202
|
-
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
203
|
-
const { stickyShadow } = useTableContext();
|
|
204
|
-
const headContext = useTableHeadContext();
|
|
205
|
-
const [left, setLeft] = import_react5.default.useState(0);
|
|
206
|
-
const cellRef = import_react5.default.useRef(null);
|
|
207
|
-
const calculateLeft = import_react5.default.useCallback(() => {
|
|
208
|
-
if (!cellRef.current) return 0;
|
|
209
|
-
let totalLeft = 0;
|
|
210
|
-
for (const ref of stickyCells) {
|
|
211
|
-
if (ref === cellRef) break;
|
|
212
|
-
if (ref.current) totalLeft += ref.current.offsetWidth;
|
|
213
|
-
}
|
|
214
|
-
return totalLeft;
|
|
215
|
-
}, [stickyCells]);
|
|
216
|
-
import_react5.default.useEffect(() => {
|
|
217
|
-
if (!isSticky || !cellRef.current) return;
|
|
218
|
-
registerStickyCell(cellRef);
|
|
219
|
-
setLeft(calculateLeft());
|
|
220
|
-
const observer = new ResizeObserver(() => {
|
|
221
|
-
requestAnimationFrame(() => {
|
|
222
|
-
setLeft(calculateLeft());
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
if (cellRef.current) observer.observe(cellRef.current);
|
|
226
|
-
for (const ref of stickyCells) {
|
|
227
|
-
if (ref.current) observer.observe(ref.current);
|
|
228
|
-
}
|
|
229
|
-
return () => observer.disconnect();
|
|
230
|
-
}, [isSticky, registerStickyCell, calculateLeft]);
|
|
231
|
-
const isHeaderCell = headContext !== null;
|
|
232
|
-
const CellTag = isHeaderCell ? "th" : "td";
|
|
233
|
-
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
234
|
-
const enableHover = headContext && headContext.cellHover;
|
|
235
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
236
|
-
CellTag,
|
|
237
|
-
{
|
|
238
|
-
ref: cellRef,
|
|
239
|
-
className: clsx_default(
|
|
240
|
-
`align-${align}`,
|
|
241
|
-
isSticky && "table-sticky",
|
|
242
|
-
isLastSticky && stickyShadow && "right-shadow",
|
|
243
|
-
onClick && "clickable",
|
|
244
|
-
enableHover && "cell-hover",
|
|
245
|
-
nowrap && "nowrap"
|
|
246
|
-
),
|
|
247
|
-
scope: isHeaderCell ? scope : void 0,
|
|
248
|
-
colSpan,
|
|
249
|
-
style: {
|
|
250
|
-
...isSticky ? { left } : null,
|
|
251
|
-
...width != null ? { width: typeof width === "number" ? `${width}px` : width } : null
|
|
252
|
-
},
|
|
253
|
-
onClick,
|
|
254
|
-
children
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
});
|
|
258
|
-
TableCell.displayName = "TableCell";
|
|
259
|
-
var TableCell_default = TableCell;
|
|
260
14
|
|
|
261
|
-
|
|
262
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
263
|
-
var TableHead = ({
|
|
264
|
-
children,
|
|
265
|
-
cellHover = false
|
|
266
|
-
}) => {
|
|
267
|
-
const { headerSticky } = useTableContext();
|
|
268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TableHeadContext_default.Provider, { value: { cellHover }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("thead", { className: clsx_default(headerSticky ? "table-sticky" : null), children }) });
|
|
269
|
-
};
|
|
270
|
-
TableHead.displayName = "TableHead";
|
|
271
|
-
var TableHead_default = TableHead;
|
|
272
|
-
|
|
273
|
-
// src/components/Table/TableRow.tsx
|
|
274
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
275
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
276
|
-
var TableRow = import_react6.default.memo((props) => {
|
|
277
|
-
const {
|
|
278
|
-
children,
|
|
279
|
-
type = "secondary",
|
|
280
|
-
color,
|
|
281
|
-
isHover,
|
|
282
|
-
onClick
|
|
283
|
-
} = props;
|
|
284
|
-
const { rowBorderUse } = useTableContext();
|
|
285
|
-
const [stickyCells, setStickyCells] = import_react6.default.useState([]);
|
|
286
|
-
const registerStickyCell = (ref) => {
|
|
287
|
-
setStickyCells((prev) => {
|
|
288
|
-
if (prev.includes(ref)) return prev;
|
|
289
|
-
return [...prev, ref];
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
293
|
-
"tr",
|
|
294
|
-
{
|
|
295
|
-
className: clsx_default(
|
|
296
|
-
rowBorderUse ? "table-bottom-border" : null,
|
|
297
|
-
color != null ? "categorical" : type,
|
|
298
|
-
color === "neutral" && "cat-neutral",
|
|
299
|
-
isHover && "hover",
|
|
300
|
-
onClick && "clickable"
|
|
301
|
-
),
|
|
302
|
-
onClick,
|
|
303
|
-
style: color != null && color !== "neutral" ? {
|
|
304
|
-
"--cat-fill": `var(--semantic-categorical-${color}-fill)`,
|
|
305
|
-
"--cat-text": `var(--semantic-categorical-${color}-text)`,
|
|
306
|
-
"--cat-bg": `var(--semantic-categorical-${color}-bg)`
|
|
307
|
-
} : void 0,
|
|
308
|
-
children
|
|
309
|
-
}
|
|
310
|
-
) });
|
|
311
|
-
});
|
|
312
|
-
TableRow.displayName = "TableRow";
|
|
313
|
-
var TableRow_default = TableRow;
|
|
314
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
315
|
-
0 && (module.exports = {
|
|
316
|
-
Table,
|
|
317
|
-
TableBody,
|
|
318
|
-
TableCell,
|
|
319
|
-
TableHead,
|
|
320
|
-
TableRow
|
|
321
|
-
});
|
|
15
|
+
exports.Table = _chunkG3HE4S3Qcjs.Table_default; exports.TableBody = _chunkG3HE4S3Qcjs.TableBody_default; exports.TableCell = _chunkG3HE4S3Qcjs.TableCell_default; exports.TableHead = _chunkG3HE4S3Qcjs.TableHead_default; exports.TableRow = _chunkG3HE4S3Qcjs.TableRow_default;
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
height: 100%;
|
|
8
8
|
position: relative;
|
|
9
|
-
display:
|
|
10
|
-
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
11
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
11
12
|
}
|
|
12
13
|
.lib-xplat-table-wrapper > .lib-xplat-table-scroller {
|
|
13
|
-
|
|
14
|
+
grid-area: 1/1;
|
|
15
|
+
min-width: 0;
|
|
14
16
|
min-height: 0;
|
|
15
17
|
width: 100%;
|
|
16
18
|
overflow: auto;
|
|
@@ -22,13 +24,15 @@
|
|
|
22
24
|
.lib-xplat-table-wrapper {
|
|
23
25
|
}
|
|
24
26
|
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar {
|
|
25
|
-
|
|
27
|
+
grid-area: 2/1;
|
|
28
|
+
height: 0;
|
|
26
29
|
position: relative;
|
|
27
30
|
background-color: var(--semantic-border-primary);
|
|
28
31
|
opacity: 0;
|
|
29
|
-
transition: opacity 0.15s ease;
|
|
32
|
+
transition: height 0.15s ease, opacity 0.15s ease;
|
|
30
33
|
}
|
|
31
34
|
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar.scrollable {
|
|
35
|
+
height: 3px;
|
|
32
36
|
opacity: 1;
|
|
33
37
|
}
|
|
34
38
|
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar > .table-scrollbar-thumb {
|
|
@@ -39,6 +43,28 @@
|
|
|
39
43
|
background-color: var(--semantic-surface-brand-default);
|
|
40
44
|
opacity: 0.55;
|
|
41
45
|
}
|
|
46
|
+
.lib-xplat-table-wrapper {
|
|
47
|
+
}
|
|
48
|
+
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar-y {
|
|
49
|
+
grid-area: 1/2;
|
|
50
|
+
width: 0;
|
|
51
|
+
position: relative;
|
|
52
|
+
background-color: var(--semantic-border-primary);
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transition: width 0.15s ease, opacity 0.15s ease;
|
|
55
|
+
}
|
|
56
|
+
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar-y.scrollable {
|
|
57
|
+
width: 3px;
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
.lib-xplat-table-wrapper > .lib-xplat-table-scrollbar-y > .table-scrollbar-thumb {
|
|
61
|
+
position: absolute;
|
|
62
|
+
left: 0;
|
|
63
|
+
right: 0;
|
|
64
|
+
border-radius: var(--spacing-radius-full);
|
|
65
|
+
background-color: var(--semantic-surface-brand-default);
|
|
66
|
+
opacity: 0.55;
|
|
67
|
+
}
|
|
42
68
|
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > th,
|
|
43
69
|
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > td,
|
|
44
70
|
.lib-xplat-table-wrapper.sm > .lib-xplat-table > tbody > tr > th,
|