@x-plat/design-system 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -0
- package/dist/attributes-DJIWir_0.d.cts +7 -0
- package/dist/attributes-DJIWir_0.d.ts +7 -0
- package/dist/breakpoints-DsXkJgdl.d.cts +35 -0
- package/dist/breakpoints-DsXkJgdl.d.ts +35 -0
- package/dist/colors-BG91q_uV.d.cts +133 -0
- package/dist/colors-BG91q_uV.d.ts +133 -0
- package/dist/components/Button/index.cjs +203 -0
- package/dist/components/Button/index.css +1231 -0
- package/dist/components/Button/index.d.cts +132 -0
- package/dist/components/Button/index.d.ts +132 -0
- package/dist/components/Button/index.js +176 -0
- package/dist/components/Card/index.cjs +56 -0
- package/dist/components/Card/index.css +27 -0
- package/dist/components/Card/index.d.cts +13 -0
- package/dist/components/Card/index.d.ts +13 -0
- package/dist/components/Card/index.js +29 -0
- package/dist/components/Chart/index.cjs +393 -0
- package/dist/components/Chart/index.css +4 -0
- package/dist/components/Chart/index.d.cts +10 -0
- package/dist/components/Chart/index.d.ts +10 -0
- package/dist/components/Chart/index.js +367 -0
- package/dist/components/CheckBox/index.cjs +1116 -0
- package/dist/components/CheckBox/index.css +598 -0
- package/dist/components/CheckBox/index.d.cts +132 -0
- package/dist/components/CheckBox/index.d.ts +132 -0
- package/dist/components/CheckBox/index.js +1089 -0
- package/dist/components/Chip/index.cjs +193 -0
- package/dist/components/Chip/index.css +1227 -0
- package/dist/components/Chip/index.d.cts +132 -0
- package/dist/components/Chip/index.d.ts +132 -0
- package/dist/components/Chip/index.js +166 -0
- package/dist/components/DatePicker/index.cjs +1653 -0
- package/dist/components/DatePicker/index.css +1417 -0
- package/dist/components/DatePicker/index.d.cts +56 -0
- package/dist/components/DatePicker/index.d.ts +56 -0
- package/dist/components/DatePicker/index.js +1613 -0
- package/dist/components/HtmlTypeWriter/index.cjs +172 -0
- package/dist/components/HtmlTypeWriter/index.css +23 -0
- package/dist/components/HtmlTypeWriter/index.d.cts +14 -0
- package/dist/components/HtmlTypeWriter/index.d.ts +14 -0
- package/dist/components/HtmlTypeWriter/index.js +135 -0
- package/dist/components/ImageSelector/index.cjs +1063 -0
- package/dist/components/ImageSelector/index.css +85 -0
- package/dist/components/ImageSelector/index.d.cts +10 -0
- package/dist/components/ImageSelector/index.d.ts +10 -0
- package/dist/components/ImageSelector/index.js +1026 -0
- package/dist/components/Input/index.cjs +410 -0
- package/dist/components/Input/index.css +74 -0
- package/dist/components/Input/index.d.cts +23 -0
- package/dist/components/Input/index.d.ts +23 -0
- package/dist/components/Input/index.js +372 -0
- package/dist/components/Modal/index.cjs +101 -0
- package/dist/components/Modal/index.css +39 -0
- package/dist/components/Modal/index.d.cts +16 -0
- package/dist/components/Modal/index.d.ts +16 -0
- package/dist/components/Modal/index.js +64 -0
- package/dist/components/PopOver/index.cjs +176 -0
- package/dist/components/PopOver/index.css +27 -0
- package/dist/components/PopOver/index.d.cts +15 -0
- package/dist/components/PopOver/index.d.ts +15 -0
- package/dist/components/PopOver/index.js +139 -0
- package/dist/components/Radio/index.cjs +257 -0
- package/dist/components/Radio/index.css +777 -0
- package/dist/components/Radio/index.d.cts +154 -0
- package/dist/components/Radio/index.d.ts +154 -0
- package/dist/components/Radio/index.js +219 -0
- package/dist/components/Select/index.cjs +1203 -0
- package/dist/components/Select/index.css +136 -0
- package/dist/components/Select/index.d.cts +44 -0
- package/dist/components/Select/index.d.ts +44 -0
- package/dist/components/Select/index.js +1165 -0
- package/dist/components/Swiper/index.cjs +144 -0
- package/dist/components/Swiper/index.d.cts +24 -0
- package/dist/components/Swiper/index.d.ts +24 -0
- package/dist/components/Swiper/index.js +128 -0
- package/dist/components/Switch/index.cjs +240 -0
- package/dist/components/Switch/index.css +780 -0
- package/dist/components/Switch/index.d.cts +131 -0
- package/dist/components/Switch/index.d.ts +131 -0
- package/dist/components/Switch/index.js +203 -0
- package/dist/components/Tab/index.cjs +122 -0
- package/dist/components/Tab/index.css +59 -0
- package/dist/components/Tab/index.d.cts +18 -0
- package/dist/components/Tab/index.d.ts +18 -0
- package/dist/components/Tab/index.js +85 -0
- package/dist/components/Table/index.cjs +384 -0
- package/dist/components/Table/index.css +4093 -0
- package/dist/components/Table/index.d.cts +174 -0
- package/dist/components/Table/index.d.ts +174 -0
- package/dist/components/Table/index.js +343 -0
- package/dist/components/TextArea/index.cjs +114 -0
- package/dist/components/TextArea/index.css +34 -0
- package/dist/components/TextArea/index.d.cts +6 -0
- package/dist/components/TextArea/index.d.ts +6 -0
- package/dist/components/TextArea/index.js +77 -0
- package/dist/components/Tooltip/index.cjs +210 -0
- package/dist/components/Tooltip/index.css +599 -0
- package/dist/components/Tooltip/index.d.cts +134 -0
- package/dist/components/Tooltip/index.d.ts +134 -0
- package/dist/components/Tooltip/index.js +173 -0
- package/dist/components/Video/index.cjs +269 -0
- package/dist/components/Video/index.css +71 -0
- package/dist/components/Video/index.d.cts +15 -0
- package/dist/components/Video/index.d.ts +15 -0
- package/dist/components/Video/index.js +232 -0
- package/dist/components/index.cjs +3221 -0
- package/dist/components/index.css +9972 -0
- package/dist/components/index.d.cts +23 -0
- package/dist/components/index.d.ts +23 -0
- package/dist/components/index.js +3167 -0
- package/dist/index.cjs +8216 -0
- package/dist/index.css +10087 -0
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +7855 -0
- package/dist/layout/Grid/FullGrid/index.cjs +54 -0
- package/dist/layout/Grid/FullGrid/index.css +21 -0
- package/dist/layout/Grid/FullGrid/index.d.cts +9 -0
- package/dist/layout/Grid/FullGrid/index.d.ts +9 -0
- package/dist/layout/Grid/FullGrid/index.js +27 -0
- package/dist/layout/Grid/FullScreen/index.cjs +54 -0
- package/dist/layout/Grid/FullScreen/index.css +23 -0
- package/dist/layout/Grid/FullScreen/index.d.cts +9 -0
- package/dist/layout/Grid/FullScreen/index.d.ts +9 -0
- package/dist/layout/Grid/FullScreen/index.js +27 -0
- package/dist/layout/Grid/GapGrid/index.cjs +32 -0
- package/dist/layout/Grid/GapGrid/index.d.cts +12 -0
- package/dist/layout/Grid/GapGrid/index.d.ts +12 -0
- package/dist/layout/Grid/GapGrid/index.js +11 -0
- package/dist/layout/Grid/Item/index.cjs +71 -0
- package/dist/layout/Grid/Item/index.css +19 -0
- package/dist/layout/Grid/Item/index.d.cts +20 -0
- package/dist/layout/Grid/Item/index.d.ts +20 -0
- package/dist/layout/Grid/Item/index.js +44 -0
- package/dist/layout/Grid/index.cjs +95 -0
- package/dist/layout/Grid/index.css +65 -0
- package/dist/layout/Grid/index.d.cts +5 -0
- package/dist/layout/Grid/index.d.ts +5 -0
- package/dist/layout/Grid/index.js +65 -0
- package/dist/layout/Header/index.cjs +45 -0
- package/dist/layout/Header/index.css +11 -0
- package/dist/layout/Header/index.d.cts +10 -0
- package/dist/layout/Header/index.d.ts +10 -0
- package/dist/layout/Header/index.js +18 -0
- package/dist/layout/Layout/index.cjs +44 -0
- package/dist/layout/Layout/index.css +23 -0
- package/dist/layout/Layout/index.d.cts +15 -0
- package/dist/layout/Layout/index.d.ts +15 -0
- package/dist/layout/Layout/index.js +17 -0
- package/dist/layout/SideBar/index.cjs +101 -0
- package/dist/layout/SideBar/index.css +10 -0
- package/dist/layout/SideBar/index.d.cts +16 -0
- package/dist/layout/SideBar/index.d.ts +16 -0
- package/dist/layout/SideBar/index.js +62 -0
- package/dist/layout/index.cjs +188 -0
- package/dist/layout/index.css +112 -0
- package/dist/layout/index.d.cts +8 -0
- package/dist/layout/index.d.ts +8 -0
- package/dist/layout/index.js +143 -0
- package/dist/tokens/index.cjs +6225 -0
- package/dist/tokens/index.d.cts +593 -0
- package/dist/tokens/index.d.ts +593 -0
- package/dist/tokens/index.js +5900 -0
- package/package.json +86 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/components/Tab/Tab.tsx
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
|
|
4
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
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
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref,
|
|
29
|
+
className: clsx_default("tab-item", isActive ? "active" : null),
|
|
30
|
+
onClick,
|
|
31
|
+
children: title
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
TabItem.displayName = "TabItem";
|
|
36
|
+
var TabItem_default = TabItem;
|
|
37
|
+
|
|
38
|
+
// src/components/Tab/Tab.tsx
|
|
39
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
40
|
+
var Tab = (props) => {
|
|
41
|
+
const { activeIndex, onChange, tabs, type } = props;
|
|
42
|
+
const [underlineStyle, setUnderlineStyle] = React2.useState({
|
|
43
|
+
left: 0,
|
|
44
|
+
width: 0
|
|
45
|
+
});
|
|
46
|
+
const itemRefs = React2.useRef([]);
|
|
47
|
+
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
48
|
+
onChange(tabItem, tabIdx);
|
|
49
|
+
};
|
|
50
|
+
React2.useEffect(() => {
|
|
51
|
+
const el = itemRefs.current[activeIndex];
|
|
52
|
+
if (el) {
|
|
53
|
+
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
54
|
+
}
|
|
55
|
+
}, [activeIndex, tabs.length]);
|
|
56
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx_default("lib-xplat-tab", `type-${type}`), children: [
|
|
57
|
+
tabs.map((tab, idx) => /* @__PURE__ */ jsx2(
|
|
58
|
+
TabItem_default,
|
|
59
|
+
{
|
|
60
|
+
onClick: () => handleChangeActiveTab(tab, idx),
|
|
61
|
+
isActive: activeIndex === idx,
|
|
62
|
+
ref: (el) => {
|
|
63
|
+
itemRefs.current[idx] = el;
|
|
64
|
+
},
|
|
65
|
+
title: tab.title
|
|
66
|
+
},
|
|
67
|
+
`${tab.value}_${idx}`
|
|
68
|
+
)),
|
|
69
|
+
type === "toggle" && /* @__PURE__ */ jsx2(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: "tab-toggle-underline",
|
|
73
|
+
style: {
|
|
74
|
+
left: underlineStyle.left,
|
|
75
|
+
width: underlineStyle.width
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
80
|
+
};
|
|
81
|
+
Tab.displayName = "Tab";
|
|
82
|
+
var Tab_default = Tab;
|
|
83
|
+
export {
|
|
84
|
+
Tab_default as Tab
|
|
85
|
+
};
|
|
@@ -0,0 +1,384 @@
|
|
|
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);
|
|
29
|
+
|
|
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
|
+
|
|
41
|
+
// node_modules/clsx/dist/clsx.mjs
|
|
42
|
+
function r(e) {
|
|
43
|
+
var t, f, n = "";
|
|
44
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
45
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
46
|
+
var o = e.length;
|
|
47
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
48
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
49
|
+
return n;
|
|
50
|
+
}
|
|
51
|
+
function clsx() {
|
|
52
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
53
|
+
return n;
|
|
54
|
+
}
|
|
55
|
+
var clsx_default = clsx;
|
|
56
|
+
|
|
57
|
+
// src/components/Table/TableContext.tsx
|
|
58
|
+
var import_react = __toESM(require("react"), 1);
|
|
59
|
+
var TableContext = import_react.default.createContext(null);
|
|
60
|
+
var useTableContext = () => {
|
|
61
|
+
const ctx = import_react.default.useContext(TableContext);
|
|
62
|
+
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
63
|
+
return ctx;
|
|
64
|
+
};
|
|
65
|
+
var TableContext_default = TableContext;
|
|
66
|
+
|
|
67
|
+
// src/components/Table/Table.tsx
|
|
68
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
69
|
+
var Table = (props) => {
|
|
70
|
+
const {
|
|
71
|
+
className,
|
|
72
|
+
children,
|
|
73
|
+
rowBorderUse = true,
|
|
74
|
+
colBorderUse = true,
|
|
75
|
+
headerSticky = false,
|
|
76
|
+
stickyShadow = true
|
|
77
|
+
} = props;
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: clsx_default("lib-xplat-table-wrapper", className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
TableContext_default.Provider,
|
|
80
|
+
{
|
|
81
|
+
value: {
|
|
82
|
+
rowBorderUse,
|
|
83
|
+
colBorderUse,
|
|
84
|
+
headerSticky,
|
|
85
|
+
stickyShadow
|
|
86
|
+
},
|
|
87
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { className: "lib-xplat-table", children })
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
};
|
|
91
|
+
Table.displayName = "Table";
|
|
92
|
+
var Table_default = Table;
|
|
93
|
+
|
|
94
|
+
// src/components/Table/TableBody.tsx
|
|
95
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
96
|
+
var TableBody = (props) => {
|
|
97
|
+
const { children, className } = props;
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("tbody", { className, children });
|
|
99
|
+
};
|
|
100
|
+
TableBody.displayName = "TableBody";
|
|
101
|
+
var TableBody_default = TableBody;
|
|
102
|
+
|
|
103
|
+
// src/components/Table/TableCell.tsx
|
|
104
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
105
|
+
|
|
106
|
+
// src/components/Table/TableHeadContext.tsx
|
|
107
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
108
|
+
var TableHeadContext = import_react2.default.createContext(
|
|
109
|
+
null
|
|
110
|
+
);
|
|
111
|
+
var useTableHeadContext = () => {
|
|
112
|
+
const ctx = import_react2.default.useContext(TableHeadContext);
|
|
113
|
+
return ctx;
|
|
114
|
+
};
|
|
115
|
+
var TableHeadContext_default = TableHeadContext;
|
|
116
|
+
|
|
117
|
+
// src/components/Table/TableRowContext.tsx
|
|
118
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
119
|
+
var TableRowContext = import_react3.default.createContext(null);
|
|
120
|
+
var useTableRowContext = () => {
|
|
121
|
+
const ctx = import_react3.default.useContext(TableRowContext);
|
|
122
|
+
if (!ctx) throw new Error("Table components must be used inside <Table>");
|
|
123
|
+
return ctx;
|
|
124
|
+
};
|
|
125
|
+
var TableRowContext_default = TableRowContext;
|
|
126
|
+
|
|
127
|
+
// src/components/Table/TableCell.tsx
|
|
128
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
129
|
+
var TableCell = (props) => {
|
|
130
|
+
const {
|
|
131
|
+
children,
|
|
132
|
+
align = "center",
|
|
133
|
+
className,
|
|
134
|
+
isSticky = false,
|
|
135
|
+
onClick
|
|
136
|
+
} = props;
|
|
137
|
+
const { registerStickyCell, stickyCells } = useTableRowContext();
|
|
138
|
+
const { stickyShadow } = useTableContext();
|
|
139
|
+
const headContext = useTableHeadContext();
|
|
140
|
+
const [left, setLeft] = import_react4.default.useState(0);
|
|
141
|
+
const cellRef = import_react4.default.useRef(null);
|
|
142
|
+
const calculateLeft = import_react4.default.useCallback(() => {
|
|
143
|
+
if (!cellRef.current) return 0;
|
|
144
|
+
let totalLeft = 0;
|
|
145
|
+
for (const ref of stickyCells) {
|
|
146
|
+
if (ref === cellRef) break;
|
|
147
|
+
if (ref.current) totalLeft += ref.current.offsetWidth;
|
|
148
|
+
}
|
|
149
|
+
return totalLeft;
|
|
150
|
+
}, [stickyCells]);
|
|
151
|
+
import_react4.default.useEffect(() => {
|
|
152
|
+
if (!isSticky || !cellRef.current) return;
|
|
153
|
+
registerStickyCell(cellRef);
|
|
154
|
+
setLeft(calculateLeft());
|
|
155
|
+
const observer = new ResizeObserver(() => {
|
|
156
|
+
requestAnimationFrame(() => {
|
|
157
|
+
setLeft(calculateLeft());
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
if (cellRef.current) observer.observe(cellRef.current);
|
|
161
|
+
for (const ref of stickyCells) {
|
|
162
|
+
if (ref.current) observer.observe(ref.current);
|
|
163
|
+
}
|
|
164
|
+
return () => observer.disconnect();
|
|
165
|
+
}, [isSticky, registerStickyCell, calculateLeft]);
|
|
166
|
+
const CellTag = cellRef.current?.tagName === "TH" ? "th" : "td";
|
|
167
|
+
const isLastSticky = isSticky && stickyCells[stickyCells.length - 1] === cellRef;
|
|
168
|
+
const enableHover = headContext && headContext.cellHover;
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
170
|
+
CellTag,
|
|
171
|
+
{
|
|
172
|
+
ref: cellRef,
|
|
173
|
+
className: clsx_default(
|
|
174
|
+
`align-${align}`,
|
|
175
|
+
isSticky && "table-sticky",
|
|
176
|
+
isLastSticky && stickyShadow && "right-shadow",
|
|
177
|
+
onClick && "clickable",
|
|
178
|
+
enableHover && "cell-hover",
|
|
179
|
+
className
|
|
180
|
+
),
|
|
181
|
+
style: isSticky ? { left } : void 0,
|
|
182
|
+
onClick,
|
|
183
|
+
children
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
TableCell.displayName = "TableCell";
|
|
188
|
+
var TableCell_default = TableCell;
|
|
189
|
+
|
|
190
|
+
// src/components/Table/TableHead.tsx
|
|
191
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
192
|
+
var TableHead = ({
|
|
193
|
+
children,
|
|
194
|
+
className = "",
|
|
195
|
+
cellHover = false
|
|
196
|
+
}) => {
|
|
197
|
+
const { headerSticky } = useTableContext();
|
|
198
|
+
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, className), children }) });
|
|
199
|
+
};
|
|
200
|
+
TableHead.displayName = "TableHead";
|
|
201
|
+
var TableHead_default = TableHead;
|
|
202
|
+
|
|
203
|
+
// src/components/Table/TableRow.tsx
|
|
204
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
205
|
+
|
|
206
|
+
// src/tokens/colors.ts
|
|
207
|
+
var colors = {
|
|
208
|
+
xplat: {
|
|
209
|
+
red: {
|
|
210
|
+
50: "#FFF0F0",
|
|
211
|
+
100: "#FFDDDE",
|
|
212
|
+
200: "#FFC1C2",
|
|
213
|
+
300: "#FF9698",
|
|
214
|
+
400: "#FF5A5D",
|
|
215
|
+
500: "#FF272B",
|
|
216
|
+
600: "#F80409",
|
|
217
|
+
700: "#D40105",
|
|
218
|
+
800: "#AE0609",
|
|
219
|
+
900: "#900C0F"
|
|
220
|
+
},
|
|
221
|
+
green: {
|
|
222
|
+
50: "#E5F6EA",
|
|
223
|
+
100: "#C1E7CC",
|
|
224
|
+
200: "#98D8AC",
|
|
225
|
+
300: "#6CCA8B",
|
|
226
|
+
400: "#47BE72",
|
|
227
|
+
500: "#10B259",
|
|
228
|
+
600: "#00A34F",
|
|
229
|
+
700: "#009143",
|
|
230
|
+
800: "#007F38",
|
|
231
|
+
900: "#006024"
|
|
232
|
+
},
|
|
233
|
+
orange: {
|
|
234
|
+
50: "#FFF8EC",
|
|
235
|
+
100: "#FFF0D3",
|
|
236
|
+
200: "#FFDDA5",
|
|
237
|
+
300: "#FFC46D",
|
|
238
|
+
400: "#FF9F32",
|
|
239
|
+
500: "#FF820A",
|
|
240
|
+
600: "#FF6900",
|
|
241
|
+
700: "#CC4B02",
|
|
242
|
+
800: "#A13A0B",
|
|
243
|
+
900: "#82320C"
|
|
244
|
+
},
|
|
245
|
+
yellow: {
|
|
246
|
+
50: "#FFFDE7",
|
|
247
|
+
100: "#FFFAC1",
|
|
248
|
+
200: "#FFF186",
|
|
249
|
+
300: "#FFE041",
|
|
250
|
+
400: "#FFCC0D",
|
|
251
|
+
500: "#F0B100",
|
|
252
|
+
600: "#D18800",
|
|
253
|
+
700: "#A66002",
|
|
254
|
+
800: "#894B0A",
|
|
255
|
+
900: "#743D0F"
|
|
256
|
+
},
|
|
257
|
+
blue: {
|
|
258
|
+
50: "#F1F4FD",
|
|
259
|
+
100: "#DFE7FA",
|
|
260
|
+
200: "#C5D4F8",
|
|
261
|
+
300: "#9EB8F2",
|
|
262
|
+
400: "#7093EA",
|
|
263
|
+
500: "#4D6DE3",
|
|
264
|
+
600: "#3950D7",
|
|
265
|
+
700: "#303EC5",
|
|
266
|
+
800: "#2D35A0",
|
|
267
|
+
900: "#29317F"
|
|
268
|
+
},
|
|
269
|
+
lightblue: {
|
|
270
|
+
50: "#EEFAFF",
|
|
271
|
+
100: "#D9F4FF",
|
|
272
|
+
200: "#BBEDFF",
|
|
273
|
+
300: "#8DE3FF",
|
|
274
|
+
400: "#57D0FF",
|
|
275
|
+
500: "#30B6FF",
|
|
276
|
+
600: "#1999F7",
|
|
277
|
+
700: "#1280E3",
|
|
278
|
+
800: "#1566B8",
|
|
279
|
+
900: "#175791"
|
|
280
|
+
},
|
|
281
|
+
purple: {
|
|
282
|
+
50: "#FBF6FE",
|
|
283
|
+
100: "#F5EAFD",
|
|
284
|
+
200: "#EDD8FC",
|
|
285
|
+
300: "#E0BAF8",
|
|
286
|
+
400: "#CD8DF3",
|
|
287
|
+
500: "#B961EB",
|
|
288
|
+
600: "#A541DC",
|
|
289
|
+
700: "#9230C5",
|
|
290
|
+
800: "#782B9E",
|
|
291
|
+
900: "#62247F"
|
|
292
|
+
},
|
|
293
|
+
pink: {
|
|
294
|
+
50: "#FFF4FE",
|
|
295
|
+
100: "#FFE7FD",
|
|
296
|
+
200: "#FFCFFA",
|
|
297
|
+
300: "#FEA9F1",
|
|
298
|
+
400: "#FD75E7",
|
|
299
|
+
500: "#F553DA",
|
|
300
|
+
600: "#D821B6",
|
|
301
|
+
700: "#B31892",
|
|
302
|
+
800: "#921676",
|
|
303
|
+
900: "#781761"
|
|
304
|
+
},
|
|
305
|
+
neutral: {
|
|
306
|
+
50: "#FAFAFA",
|
|
307
|
+
100: "#F5F5F5",
|
|
308
|
+
200: "#E5E5E5",
|
|
309
|
+
300: "#D4D4D4",
|
|
310
|
+
400: "#A1A1A1",
|
|
311
|
+
500: "#737373",
|
|
312
|
+
600: "#525252",
|
|
313
|
+
700: "#404040",
|
|
314
|
+
800: "#262626",
|
|
315
|
+
900: "#171717"
|
|
316
|
+
},
|
|
317
|
+
black: "#000000",
|
|
318
|
+
white: "#FFFFFF"
|
|
319
|
+
},
|
|
320
|
+
test: {
|
|
321
|
+
default: "#ffffff"
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// src/util/getColor.ts
|
|
326
|
+
var getColorClass = (namespace, palette, shade) => {
|
|
327
|
+
const namespaceMap = colors[namespace];
|
|
328
|
+
const paletteMap = namespaceMap[palette];
|
|
329
|
+
const hasShade = paletteMap && typeof paletteMap === "object" && shade !== void 0 && shade in paletteMap;
|
|
330
|
+
return `${String(namespace)}-${String(palette)}${hasShade ? `-${String(shade)}` : ""}`;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
// src/components/Table/TableRow.tsx
|
|
334
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
335
|
+
var TableRow = (props) => {
|
|
336
|
+
const {
|
|
337
|
+
children,
|
|
338
|
+
className,
|
|
339
|
+
colorNamespace = "xplat",
|
|
340
|
+
color = "black",
|
|
341
|
+
colorDepth,
|
|
342
|
+
type = "secondary",
|
|
343
|
+
isHover,
|
|
344
|
+
onClick
|
|
345
|
+
} = props;
|
|
346
|
+
const { rowBorderUse } = useTableContext();
|
|
347
|
+
const [stickyCells, setStickyCells] = import_react5.default.useState([]);
|
|
348
|
+
const registerStickyCell = (ref) => {
|
|
349
|
+
setStickyCells((prev) => {
|
|
350
|
+
if (prev.includes(ref)) return prev;
|
|
351
|
+
return [...prev, ref];
|
|
352
|
+
});
|
|
353
|
+
};
|
|
354
|
+
const colorClass = getColorClass(
|
|
355
|
+
colorNamespace,
|
|
356
|
+
color,
|
|
357
|
+
colorDepth ?? 500
|
|
358
|
+
);
|
|
359
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TableRowContext_default.Provider, { value: { stickyCells, registerStickyCell }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
360
|
+
"tr",
|
|
361
|
+
{
|
|
362
|
+
className: clsx_default(
|
|
363
|
+
rowBorderUse ? "table-bottom-border" : null,
|
|
364
|
+
type,
|
|
365
|
+
colorClass,
|
|
366
|
+
isHover && "hover",
|
|
367
|
+
onClick && "clickable",
|
|
368
|
+
className
|
|
369
|
+
),
|
|
370
|
+
onClick,
|
|
371
|
+
children
|
|
372
|
+
}
|
|
373
|
+
) });
|
|
374
|
+
};
|
|
375
|
+
TableRow.displayName = "TableRow";
|
|
376
|
+
var TableRow_default = TableRow;
|
|
377
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
378
|
+
0 && (module.exports = {
|
|
379
|
+
Table,
|
|
380
|
+
TableBody,
|
|
381
|
+
TableCell,
|
|
382
|
+
TableHead,
|
|
383
|
+
TableRow
|
|
384
|
+
});
|