@x-plat/design-system 0.5.20 → 0.5.22
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/components/Chart/index.cjs +58 -29
- package/dist/components/Chart/index.css +2 -15
- package/dist/components/Chart/index.js +58 -29
- package/dist/components/ChatInput/index.cjs +214 -0
- package/dist/components/ChatInput/index.css +133 -0
- package/dist/components/ChatInput/index.d.cts +14 -0
- package/dist/components/ChatInput/index.d.ts +14 -0
- package/dist/components/ChatInput/index.js +177 -0
- package/dist/components/Dropdown/index.cjs +9 -0
- package/dist/components/Dropdown/index.js +9 -0
- package/dist/components/PopOver/index.cjs +9 -0
- package/dist/components/PopOver/index.js +9 -0
- package/dist/components/Select/index.cjs +9 -0
- package/dist/components/Select/index.js +9 -0
- package/dist/components/Table/index.cjs +2 -1
- package/dist/components/Table/index.css +117 -0
- package/dist/components/Table/index.d.cts +3 -1
- package/dist/components/Table/index.d.ts +3 -1
- package/dist/components/Table/index.js +2 -1
- package/dist/components/index.cjs +715 -595
- package/dist/components/index.css +253 -61
- package/dist/components/index.d.cts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +713 -594
- package/dist/index.cjs +724 -619
- package/dist/index.css +253 -61
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +722 -618
- package/package.json +1 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
|
|
4
|
+
// src/components/TextArea/TextArea.tsx
|
|
5
|
+
import React from "react";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/clsx/dist/clsx.mjs
|
|
8
|
+
function r(e) {
|
|
9
|
+
var t, f, n = "";
|
|
10
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
11
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
12
|
+
var o = e.length;
|
|
13
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
14
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
15
|
+
return n;
|
|
16
|
+
}
|
|
17
|
+
function clsx() {
|
|
18
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
var clsx_default = clsx;
|
|
22
|
+
|
|
23
|
+
// src/components/TextArea/TextArea.tsx
|
|
24
|
+
import { jsx } from "react/jsx-runtime";
|
|
25
|
+
var TextArea = React.forwardRef(
|
|
26
|
+
(props, ref) => {
|
|
27
|
+
const { value, onChange, disabled, ...textareaProps } = props;
|
|
28
|
+
const localRef = React.useRef(null);
|
|
29
|
+
const setRefs = (el) => {
|
|
30
|
+
localRef.current = el;
|
|
31
|
+
if (!ref) return;
|
|
32
|
+
if (typeof ref === "function") {
|
|
33
|
+
ref(el);
|
|
34
|
+
} else if (ref && typeof ref === "object" && "current" in ref) {
|
|
35
|
+
ref.current = el;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleOnChange = (e) => {
|
|
39
|
+
const val = e.target.value;
|
|
40
|
+
if (onChange) {
|
|
41
|
+
const event = {
|
|
42
|
+
...e,
|
|
43
|
+
target: { value: val }
|
|
44
|
+
};
|
|
45
|
+
onChange(event);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
const el = localRef.current;
|
|
50
|
+
if (!el) return;
|
|
51
|
+
el.style.height = "0px";
|
|
52
|
+
const nextHeight = Math.min(el.scrollHeight, 400);
|
|
53
|
+
el.style.height = `${nextHeight}px`;
|
|
54
|
+
}, [value]);
|
|
55
|
+
return /* @__PURE__ */ jsx("div", { className: "lib-xplat-textarea-wrapper", children: /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: clsx_default(
|
|
59
|
+
"lib-xplat-textarea",
|
|
60
|
+
disabled ? "disabled" : void 0
|
|
61
|
+
),
|
|
62
|
+
children: /* @__PURE__ */ jsx(
|
|
63
|
+
"textarea",
|
|
64
|
+
{
|
|
65
|
+
...textareaProps,
|
|
66
|
+
ref: setRefs,
|
|
67
|
+
disabled,
|
|
68
|
+
value,
|
|
69
|
+
onChange: handleOnChange
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
TextArea.displayName = "TextArea";
|
|
77
|
+
var TextArea_default = TextArea;
|
|
78
|
+
|
|
79
|
+
// src/tokens/svg/communication/BellIcon.tsx
|
|
80
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
81
|
+
|
|
82
|
+
// src/tokens/svg/communication/BellOffIcon.tsx
|
|
83
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
84
|
+
|
|
85
|
+
// src/tokens/svg/communication/InboxIcon.tsx
|
|
86
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
87
|
+
|
|
88
|
+
// src/tokens/svg/communication/MessageCircleIcon.tsx
|
|
89
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
90
|
+
|
|
91
|
+
// src/tokens/svg/communication/MessageSquareIcon.tsx
|
|
92
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
93
|
+
|
|
94
|
+
// src/tokens/svg/communication/PaperclipIcon.tsx
|
|
95
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
96
|
+
|
|
97
|
+
// src/tokens/svg/communication/SendIcon.tsx
|
|
98
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
99
|
+
var SendIcon = () => /* @__PURE__ */ jsxs3(
|
|
100
|
+
"svg",
|
|
101
|
+
{
|
|
102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103
|
+
width: "1em",
|
|
104
|
+
height: "1em",
|
|
105
|
+
viewBox: "0 0 20 20",
|
|
106
|
+
fill: "none",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx8("g", { clipPath: "url(#send-clip)", children: /* @__PURE__ */ jsx8("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.3558 0.918873C18.3887 0.919879 18.4212 0.9224 18.4535 0.927663C18.4642 0.929393 18.4751 0.930348 18.4857 0.932545C18.527 0.941123 18.5675 0.953269 18.6068 0.968678C18.6178 0.972968 18.6282 0.978499 18.639 0.983327C18.6672 0.995914 18.6945 1.01021 18.7211 1.0263C18.7403 1.03794 18.7594 1.04988 18.7777 1.0634C18.7803 1.06534 18.7829 1.0673 18.7855 1.06926C18.8126 1.08979 18.839 1.11195 18.8637 1.13665C18.8872 1.16018 18.9084 1.18517 18.9281 1.21087C18.9322 1.21625 18.9359 1.22198 18.9398 1.22747C18.9501 1.24168 18.959 1.25667 18.9681 1.27141C18.9866 1.30108 19.0029 1.33154 19.017 1.36321C19.0214 1.37309 19.0267 1.38248 19.0306 1.39251C19.0461 1.43186 19.0581 1.47231 19.0668 1.5136C19.069 1.52426 19.0699 1.5351 19.0717 1.54583C19.077 1.57815 19.0794 1.61062 19.0805 1.64348C19.0808 1.65621 19.0817 1.66884 19.0814 1.68157C19.0799 1.75981 19.0681 1.83872 19.0414 1.91497L13.2074 18.581C13.1058 18.871 12.8377 19.0703 12.5306 19.0829C12.2237 19.0954 11.9398 18.9192 11.8148 18.6386L8.59706 11.4003L1.3617 8.18547C1.08085 8.06057 0.90492 7.77678 0.917368 7.46965C0.929915 7.16252 1.12827 6.89358 1.41834 6.79192L18.0853 0.958913C18.1613 0.932334 18.2398 0.919479 18.3178 0.917897C18.3305 0.91763 18.3431 0.918498 18.3558 0.918873ZM10.0609 10.999L12.4164 16.2997L16.5375 4.52239L10.0609 10.999ZM3.69862 7.58294L9.00038 9.93841L15.4808 3.45794L3.69862 7.58294Z", fill: "currentColor" }) }),
|
|
109
|
+
/* @__PURE__ */ jsx8("defs", { children: /* @__PURE__ */ jsx8("clipPath", { id: "send-clip", children: /* @__PURE__ */ jsx8("rect", { width: "20", height: "20", fill: "currentColor" }) }) })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
var SendIcon_default = SendIcon;
|
|
114
|
+
|
|
115
|
+
// src/components/ChatInput/ChatInput.tsx
|
|
116
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
117
|
+
var ChatInput = React2.forwardRef(
|
|
118
|
+
(props, ref) => {
|
|
119
|
+
const {
|
|
120
|
+
placeholder,
|
|
121
|
+
value: valueProp,
|
|
122
|
+
disabled = false,
|
|
123
|
+
buttonType = "primary",
|
|
124
|
+
onSubmit,
|
|
125
|
+
onChange
|
|
126
|
+
} = props;
|
|
127
|
+
const isControlled = valueProp !== void 0;
|
|
128
|
+
const [internalValue, setInternalValue] = React2.useState("");
|
|
129
|
+
const value = isControlled ? valueProp : internalValue;
|
|
130
|
+
const hasText = value.trim().length > 0;
|
|
131
|
+
const handleChange = (e) => {
|
|
132
|
+
const val = e.target.value;
|
|
133
|
+
if (!isControlled) setInternalValue(val);
|
|
134
|
+
onChange?.(val);
|
|
135
|
+
};
|
|
136
|
+
const handleSubmit = () => {
|
|
137
|
+
if (!hasText || disabled) return;
|
|
138
|
+
onSubmit?.(value);
|
|
139
|
+
if (!isControlled) setInternalValue("");
|
|
140
|
+
};
|
|
141
|
+
const handleKeyDown = (e) => {
|
|
142
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
handleSubmit();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
return /* @__PURE__ */ jsxs4("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
148
|
+
/* @__PURE__ */ jsx9(
|
|
149
|
+
TextArea_default,
|
|
150
|
+
{
|
|
151
|
+
ref,
|
|
152
|
+
placeholder,
|
|
153
|
+
value,
|
|
154
|
+
disabled,
|
|
155
|
+
onChange: handleChange,
|
|
156
|
+
onKeyDown: handleKeyDown
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
/* @__PURE__ */ jsx9(
|
|
160
|
+
"button",
|
|
161
|
+
{
|
|
162
|
+
type: "button",
|
|
163
|
+
className: clsx_default("chat-input-send", `btn-${buttonType}`),
|
|
164
|
+
disabled: !hasText || disabled,
|
|
165
|
+
onClick: handleSubmit,
|
|
166
|
+
"aria-label": "\uC804\uC1A1",
|
|
167
|
+
children: /* @__PURE__ */ jsx9(SendIcon_default, {})
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
ChatInput.displayName = "ChatInput";
|
|
174
|
+
var ChatInput_default = ChatInput;
|
|
175
|
+
export {
|
|
176
|
+
ChatInput_default as ChatInput
|
|
177
|
+
};
|
|
@@ -51,6 +51,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
51
51
|
const popH = popRef.current.offsetHeight;
|
|
52
52
|
const viewportHeight = window.innerHeight;
|
|
53
53
|
const viewportWidth = window.innerWidth;
|
|
54
|
+
if (popH === 0 || popW === 0) return;
|
|
54
55
|
let direction = "bottom";
|
|
55
56
|
let top;
|
|
56
57
|
let left;
|
|
@@ -76,6 +77,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
76
77
|
const raf = requestAnimationFrame(calculatePosition);
|
|
77
78
|
return () => cancelAnimationFrame(raf);
|
|
78
79
|
}, [calculatePosition, enabled]);
|
|
80
|
+
import_react.default.useEffect(() => {
|
|
81
|
+
if (!enabled || !popRef.current) return;
|
|
82
|
+
const observer = new ResizeObserver(() => {
|
|
83
|
+
calculatePosition();
|
|
84
|
+
});
|
|
85
|
+
observer.observe(popRef.current);
|
|
86
|
+
return () => observer.disconnect();
|
|
87
|
+
}, [calculatePosition, enabled, popRef]);
|
|
79
88
|
import_react.default.useEffect(() => {
|
|
80
89
|
if (!enabled) return;
|
|
81
90
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -15,6 +15,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
15
15
|
const popH = popRef.current.offsetHeight;
|
|
16
16
|
const viewportHeight = window.innerHeight;
|
|
17
17
|
const viewportWidth = window.innerWidth;
|
|
18
|
+
if (popH === 0 || popW === 0) return;
|
|
18
19
|
let direction = "bottom";
|
|
19
20
|
let top;
|
|
20
21
|
let left;
|
|
@@ -40,6 +41,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
40
41
|
const raf = requestAnimationFrame(calculatePosition);
|
|
41
42
|
return () => cancelAnimationFrame(raf);
|
|
42
43
|
}, [calculatePosition, enabled]);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
if (!enabled || !popRef.current) return;
|
|
46
|
+
const observer = new ResizeObserver(() => {
|
|
47
|
+
calculatePosition();
|
|
48
|
+
});
|
|
49
|
+
observer.observe(popRef.current);
|
|
50
|
+
return () => observer.disconnect();
|
|
51
|
+
}, [calculatePosition, enabled, popRef]);
|
|
43
52
|
React.useEffect(() => {
|
|
44
53
|
if (!enabled) return;
|
|
45
54
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -51,6 +51,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
51
51
|
const popH = popRef.current.offsetHeight;
|
|
52
52
|
const viewportHeight = window.innerHeight;
|
|
53
53
|
const viewportWidth = window.innerWidth;
|
|
54
|
+
if (popH === 0 || popW === 0) return;
|
|
54
55
|
let direction = "bottom";
|
|
55
56
|
let top;
|
|
56
57
|
let left;
|
|
@@ -76,6 +77,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
76
77
|
const raf = requestAnimationFrame(calculatePosition);
|
|
77
78
|
return () => cancelAnimationFrame(raf);
|
|
78
79
|
}, [calculatePosition, enabled]);
|
|
80
|
+
import_react.default.useEffect(() => {
|
|
81
|
+
if (!enabled || !popRef.current) return;
|
|
82
|
+
const observer = new ResizeObserver(() => {
|
|
83
|
+
calculatePosition();
|
|
84
|
+
});
|
|
85
|
+
observer.observe(popRef.current);
|
|
86
|
+
return () => observer.disconnect();
|
|
87
|
+
}, [calculatePosition, enabled, popRef]);
|
|
79
88
|
import_react.default.useEffect(() => {
|
|
80
89
|
if (!enabled) return;
|
|
81
90
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -15,6 +15,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
15
15
|
const popH = popRef.current.offsetHeight;
|
|
16
16
|
const viewportHeight = window.innerHeight;
|
|
17
17
|
const viewportWidth = window.innerWidth;
|
|
18
|
+
if (popH === 0 || popW === 0) return;
|
|
18
19
|
let direction = "bottom";
|
|
19
20
|
let top;
|
|
20
21
|
let left;
|
|
@@ -40,6 +41,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
40
41
|
const raf = requestAnimationFrame(calculatePosition);
|
|
41
42
|
return () => cancelAnimationFrame(raf);
|
|
42
43
|
}, [calculatePosition, enabled]);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
if (!enabled || !popRef.current) return;
|
|
46
|
+
const observer = new ResizeObserver(() => {
|
|
47
|
+
calculatePosition();
|
|
48
|
+
});
|
|
49
|
+
observer.observe(popRef.current);
|
|
50
|
+
return () => observer.disconnect();
|
|
51
|
+
}, [calculatePosition, enabled, popRef]);
|
|
43
52
|
React.useEffect(() => {
|
|
44
53
|
if (!enabled) return;
|
|
45
54
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -52,6 +52,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
52
52
|
const popH = popRef.current.offsetHeight;
|
|
53
53
|
const viewportHeight = window.innerHeight;
|
|
54
54
|
const viewportWidth = window.innerWidth;
|
|
55
|
+
if (popH === 0 || popW === 0) return;
|
|
55
56
|
let direction = "bottom";
|
|
56
57
|
let top;
|
|
57
58
|
let left;
|
|
@@ -77,6 +78,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
77
78
|
const raf = requestAnimationFrame(calculatePosition);
|
|
78
79
|
return () => cancelAnimationFrame(raf);
|
|
79
80
|
}, [calculatePosition, enabled]);
|
|
81
|
+
import_react.default.useEffect(() => {
|
|
82
|
+
if (!enabled || !popRef.current) return;
|
|
83
|
+
const observer = new ResizeObserver(() => {
|
|
84
|
+
calculatePosition();
|
|
85
|
+
});
|
|
86
|
+
observer.observe(popRef.current);
|
|
87
|
+
return () => observer.disconnect();
|
|
88
|
+
}, [calculatePosition, enabled, popRef]);
|
|
80
89
|
import_react.default.useEffect(() => {
|
|
81
90
|
if (!enabled) return;
|
|
82
91
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -15,6 +15,7 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
15
15
|
const popH = popRef.current.offsetHeight;
|
|
16
16
|
const viewportHeight = window.innerHeight;
|
|
17
17
|
const viewportWidth = window.innerWidth;
|
|
18
|
+
if (popH === 0 || popW === 0) return;
|
|
18
19
|
let direction = "bottom";
|
|
19
20
|
let top;
|
|
20
21
|
let left;
|
|
@@ -40,6 +41,14 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
|
|
|
40
41
|
const raf = requestAnimationFrame(calculatePosition);
|
|
41
42
|
return () => cancelAnimationFrame(raf);
|
|
42
43
|
}, [calculatePosition, enabled]);
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
if (!enabled || !popRef.current) return;
|
|
46
|
+
const observer = new ResizeObserver(() => {
|
|
47
|
+
calculatePosition();
|
|
48
|
+
});
|
|
49
|
+
observer.observe(popRef.current);
|
|
50
|
+
return () => observer.disconnect();
|
|
51
|
+
}, [calculatePosition, enabled, popRef]);
|
|
43
52
|
React.useEffect(() => {
|
|
44
53
|
if (!enabled) return;
|
|
45
54
|
window.addEventListener("resize", calculatePosition);
|
|
@@ -53,12 +53,13 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
53
53
|
var Table = (props) => {
|
|
54
54
|
const {
|
|
55
55
|
children,
|
|
56
|
+
size = "md",
|
|
56
57
|
rowBorderUse = true,
|
|
57
58
|
colBorderUse = true,
|
|
58
59
|
headerSticky = false,
|
|
59
60
|
stickyShadow = true
|
|
60
61
|
} = props;
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className:
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
63
|
TableContext_default.Provider,
|
|
63
64
|
{
|
|
64
65
|
value: {
|
|
@@ -6,6 +6,27 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
overflow: auto;
|
|
8
8
|
}
|
|
9
|
+
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > th,
|
|
10
|
+
.lib-xplat-table-wrapper.sm > .lib-xplat-table > thead > tr > td,
|
|
11
|
+
.lib-xplat-table-wrapper.sm > .lib-xplat-table > tbody > tr > th,
|
|
12
|
+
.lib-xplat-table-wrapper.sm > .lib-xplat-table > tbody > tr > td {
|
|
13
|
+
padding: var(--spacing-space-1) var(--spacing-space-2);
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
}
|
|
16
|
+
.lib-xplat-table-wrapper.md > .lib-xplat-table > thead > tr > th,
|
|
17
|
+
.lib-xplat-table-wrapper.md > .lib-xplat-table > thead > tr > td,
|
|
18
|
+
.lib-xplat-table-wrapper.md > .lib-xplat-table > tbody > tr > th,
|
|
19
|
+
.lib-xplat-table-wrapper.md > .lib-xplat-table > tbody > tr > td {
|
|
20
|
+
padding: var(--spacing-space-2) var(--spacing-space-3);
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
}
|
|
23
|
+
.lib-xplat-table-wrapper.lg > .lib-xplat-table > thead > tr > th,
|
|
24
|
+
.lib-xplat-table-wrapper.lg > .lib-xplat-table > thead > tr > td,
|
|
25
|
+
.lib-xplat-table-wrapper.lg > .lib-xplat-table > tbody > tr > th,
|
|
26
|
+
.lib-xplat-table-wrapper.lg > .lib-xplat-table > tbody > tr > td {
|
|
27
|
+
padding: var(--spacing-space-3) var(--spacing-space-4);
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
}
|
|
9
30
|
.lib-xplat-table-wrapper > .lib-xplat-table {
|
|
10
31
|
width: 100%;
|
|
11
32
|
min-width: 600px;
|
|
@@ -66,6 +87,102 @@
|
|
|
66
87
|
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.secondary.hover:hover > th {
|
|
67
88
|
background-color: var(--semantic-surface-neutral-subtle);
|
|
68
89
|
}
|
|
90
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success,
|
|
91
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success {
|
|
92
|
+
background-color: var(--semantic-surface-success-default);
|
|
93
|
+
}
|
|
94
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success > td,
|
|
95
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success > th,
|
|
96
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success > td,
|
|
97
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success > th {
|
|
98
|
+
color: var(--semantic-text-inverse);
|
|
99
|
+
background-color: var(--semantic-surface-success-default);
|
|
100
|
+
}
|
|
101
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success > td.cell-hover:hover,
|
|
102
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success > th.cell-hover:hover,
|
|
103
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success > td.cell-hover:hover,
|
|
104
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success > th.cell-hover:hover {
|
|
105
|
+
background-color: var(--semantic-surface-success-strong);
|
|
106
|
+
}
|
|
107
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success.hover:hover > td,
|
|
108
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.success.hover:hover > th,
|
|
109
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success.hover:hover > td,
|
|
110
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.success.hover:hover > th {
|
|
111
|
+
color: var(--semantic-text-inverse);
|
|
112
|
+
background-color: var(--semantic-surface-success-strong);
|
|
113
|
+
}
|
|
114
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error,
|
|
115
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error {
|
|
116
|
+
background-color: var(--semantic-surface-error-default);
|
|
117
|
+
}
|
|
118
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error > td,
|
|
119
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error > th,
|
|
120
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error > td,
|
|
121
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error > th {
|
|
122
|
+
color: var(--semantic-text-inverse);
|
|
123
|
+
background-color: var(--semantic-surface-error-default);
|
|
124
|
+
}
|
|
125
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error > td.cell-hover:hover,
|
|
126
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error > th.cell-hover:hover,
|
|
127
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error > td.cell-hover:hover,
|
|
128
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error > th.cell-hover:hover {
|
|
129
|
+
background-color: var(--semantic-surface-error-strong);
|
|
130
|
+
}
|
|
131
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error.hover:hover > td,
|
|
132
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.error.hover:hover > th,
|
|
133
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error.hover:hover > td,
|
|
134
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.error.hover:hover > th {
|
|
135
|
+
color: var(--semantic-text-inverse);
|
|
136
|
+
background-color: var(--semantic-surface-error-strong);
|
|
137
|
+
}
|
|
138
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning,
|
|
139
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning {
|
|
140
|
+
background-color: var(--semantic-surface-warning-default);
|
|
141
|
+
}
|
|
142
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning > td,
|
|
143
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning > th,
|
|
144
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning > td,
|
|
145
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning > th {
|
|
146
|
+
color: var(--semantic-text-strong);
|
|
147
|
+
background-color: var(--semantic-surface-warning-default);
|
|
148
|
+
}
|
|
149
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning > td.cell-hover:hover,
|
|
150
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning > th.cell-hover:hover,
|
|
151
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning > td.cell-hover:hover,
|
|
152
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning > th.cell-hover:hover {
|
|
153
|
+
background-color: var(--semantic-surface-warning-strong);
|
|
154
|
+
}
|
|
155
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning.hover:hover > td,
|
|
156
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.warning.hover:hover > th,
|
|
157
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning.hover:hover > td,
|
|
158
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.warning.hover:hover > th {
|
|
159
|
+
color: var(--semantic-text-strong);
|
|
160
|
+
background-color: var(--semantic-surface-warning-strong);
|
|
161
|
+
}
|
|
162
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info,
|
|
163
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info {
|
|
164
|
+
background-color: var(--semantic-surface-info-default);
|
|
165
|
+
}
|
|
166
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info > td,
|
|
167
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info > th,
|
|
168
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info > td,
|
|
169
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info > th {
|
|
170
|
+
color: var(--semantic-text-inverse);
|
|
171
|
+
background-color: var(--semantic-surface-info-default);
|
|
172
|
+
}
|
|
173
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info > td.cell-hover:hover,
|
|
174
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info > th.cell-hover:hover,
|
|
175
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info > td.cell-hover:hover,
|
|
176
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info > th.cell-hover:hover {
|
|
177
|
+
background-color: var(--semantic-surface-info-strong);
|
|
178
|
+
}
|
|
179
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info.hover:hover > td,
|
|
180
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.info.hover:hover > th,
|
|
181
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info.hover:hover > td,
|
|
182
|
+
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.info.hover:hover > th {
|
|
183
|
+
color: var(--semantic-text-inverse);
|
|
184
|
+
background-color: var(--semantic-surface-info-strong);
|
|
185
|
+
}
|
|
69
186
|
.lib-xplat-table-wrapper > .lib-xplat-table > thead > tr.clickable,
|
|
70
187
|
.lib-xplat-table-wrapper > .lib-xplat-table > tbody > tr.clickable {
|
|
71
188
|
cursor: pointer;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
type TableSize = "sm" | "md" | "lg";
|
|
4
5
|
interface TableProps {
|
|
5
6
|
children: React.ReactNode;
|
|
7
|
+
size?: TableSize;
|
|
6
8
|
rowBorderUse?: boolean;
|
|
7
9
|
colBorderUse?: boolean;
|
|
8
10
|
headerSticky?: boolean;
|
|
@@ -42,7 +44,7 @@ declare const TableHead: {
|
|
|
42
44
|
|
|
43
45
|
interface TableRowProps {
|
|
44
46
|
children: React.ReactNode;
|
|
45
|
-
type?: "primary" | "secondary";
|
|
47
|
+
type?: "primary" | "secondary" | "success" | "error" | "warning" | "info";
|
|
46
48
|
isHover?: boolean;
|
|
47
49
|
onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
48
50
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
type TableSize = "sm" | "md" | "lg";
|
|
4
5
|
interface TableProps {
|
|
5
6
|
children: React.ReactNode;
|
|
7
|
+
size?: TableSize;
|
|
6
8
|
rowBorderUse?: boolean;
|
|
7
9
|
colBorderUse?: boolean;
|
|
8
10
|
headerSticky?: boolean;
|
|
@@ -42,7 +44,7 @@ declare const TableHead: {
|
|
|
42
44
|
|
|
43
45
|
interface TableRowProps {
|
|
44
46
|
children: React.ReactNode;
|
|
45
|
-
type?: "primary" | "secondary";
|
|
47
|
+
type?: "primary" | "secondary" | "success" | "error" | "warning" | "info";
|
|
46
48
|
isHover?: boolean;
|
|
47
49
|
onClick?: (e: React.MouseEvent<HTMLTableRowElement>) => void;
|
|
48
50
|
}
|
|
@@ -13,12 +13,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
13
13
|
var Table = (props) => {
|
|
14
14
|
const {
|
|
15
15
|
children,
|
|
16
|
+
size = "md",
|
|
16
17
|
rowBorderUse = true,
|
|
17
18
|
colBorderUse = true,
|
|
18
19
|
headerSticky = false,
|
|
19
20
|
stickyShadow = true
|
|
20
21
|
} = props;
|
|
21
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
22
|
+
return /* @__PURE__ */ jsx("div", { className: `lib-xplat-table-wrapper ${size}`, children: /* @__PURE__ */ jsx(
|
|
22
23
|
TableContext_default.Provider,
|
|
23
24
|
{
|
|
24
25
|
value: {
|