@rockshin/tao-ui 0.0.1 → 0.0.3
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/breadcrumb/breadcrumb.css +1091 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +268 -0
- package/dist/components/button/button.css +46 -21
- package/dist/components/checkbox/checkbox.css +33 -12
- package/dist/components/collapsible/collapsible.css +1026 -0
- package/dist/components/collapsible/collapsible.d.ts +39 -0
- package/dist/components/collapsible/collapsible.js +168 -0
- package/dist/components/context-menu/context-menu.css +1149 -0
- package/dist/components/context-menu/context-menu.d.ts +19 -0
- package/dist/components/context-menu/context-menu.js +106 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +1 -1
- package/dist/components/date-picker/calendar/time-panel.d.ts +1 -1
- package/dist/components/date-picker/calendar/year-grid.d.ts +1 -1
- package/dist/components/date-picker/date-picker.css +87 -17
- package/dist/components/date-picker/date-picker.js +9 -7
- package/dist/components/date-picker/range-picker.js +9 -7
- package/dist/components/drawer/drawer.css +128 -15
- package/dist/components/drawer/drawer.d.ts +36 -3
- package/dist/components/drawer/drawer.js +323 -121
- package/dist/components/dropdown/dropdown.css +999 -0
- package/dist/components/dropdown/dropdown.d.ts +45 -0
- package/dist/components/dropdown/dropdown.js +383 -0
- package/dist/components/form-field/form.css +33 -12
- package/dist/components/input/input.css +86 -14
- package/dist/components/menu/menu-render.d.ts +89 -0
- package/dist/components/menu/menu-render.js +379 -0
- package/dist/components/menu/menu.css +1145 -0
- package/dist/components/modal/confirm-dialog.d.ts +37 -0
- package/dist/components/modal/confirm-dialog.js +193 -0
- package/dist/components/modal/confirm.d.ts +13 -0
- package/dist/components/modal/confirm.js +56 -0
- package/dist/components/modal/index.d.ts +21 -0
- package/dist/components/modal/index.js +18 -0
- package/dist/components/modal/modal.css +1169 -0
- package/dist/components/modal/modal.d.ts +50 -0
- package/dist/components/modal/modal.js +362 -0
- package/dist/components/modal/use-modal.d.ts +21 -0
- package/dist/components/modal/use-modal.js +83 -0
- package/dist/components/pagination/pagination.css +33 -12
- package/dist/components/pagination/pagination.js +3 -1
- package/dist/components/radio/radio.css +33 -12
- package/dist/components/scroll-area/scroll-area.css +33 -12
- package/dist/components/select/mobile-select.css +75 -13
- package/dist/components/select/mobile-select.d.ts +4 -1
- package/dist/components/select/mobile-select.js +103 -107
- package/dist/components/select/select.css +167 -26
- package/dist/components/select/select.d.ts +62 -4
- package/dist/components/select/select.js +359 -377
- package/dist/components/spinner/spinner.css +1084 -0
- package/dist/components/spinner/spinner.d.ts +26 -0
- package/dist/components/spinner/spinner.js +229 -0
- package/dist/components/splitter/splitter.css +33 -12
- package/dist/components/switch/switch.css +33 -12
- package/dist/components/table/table.css +57 -18
- package/dist/components/table/table.d.ts +17 -2
- package/dist/components/table/table.js +214 -206
- package/dist/components/tabs/tabs.css +36 -17
- package/dist/components/tag/tag.css +33 -12
- package/dist/components/textarea/textarea.css +1246 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +181 -0
- package/dist/index.d.ts +25 -18
- package/dist/index.js +22 -15
- package/dist/layouts/stack/layout.css +33 -12
- package/dist/provider/tao-provider.d.ts +17 -1
- package/dist/provider/tao-provider.js +53 -15
- package/dist/theme/control.css +86 -13
- package/dist/theme/theme.css +33 -12
- package/llms.txt +7 -6
- package/package.json +18 -13
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type TaoSize } from '../../provider/tao-provider';
|
|
3
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
|
+
import './spinner.css';
|
|
5
|
+
export type SpinnerSemanticPart = 'root' | 'indicator' | 'tip' | 'overlay';
|
|
6
|
+
export interface SpinnerProps {
|
|
7
|
+
/** Whether the spinner is visible. Defaults to true. */
|
|
8
|
+
spinning?: boolean;
|
|
9
|
+
/** Size of the indicator. Inherits from TaoProvider. */
|
|
10
|
+
size?: TaoSize;
|
|
11
|
+
/** Description text rendered under the indicator. */
|
|
12
|
+
tip?: ReactNode;
|
|
13
|
+
/** Delay (ms) before showing the spinner — prevents flicker on fast loads. */
|
|
14
|
+
delay?: number;
|
|
15
|
+
/** Custom indicator node, replaces the default spinner. */
|
|
16
|
+
indicator?: ReactNode;
|
|
17
|
+
/** Wrap content: the spinner overlays `children` while spinning. */
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/** Render a full-screen backdrop with a centered spinner. */
|
|
20
|
+
fullscreen?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
classNames?: SemanticClassNames<SpinnerSemanticPart>;
|
|
24
|
+
styles?: SemanticStyles<SpinnerSemanticPart>;
|
|
25
|
+
}
|
|
26
|
+
export declare function Spinner({ spinning, size, tip, delay, indicator, children, fullscreen, className, style, classNames, styles, }: SpinnerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { cx } from "../../utils/semantic.js";
|
|
6
|
+
import "./spinner.css";
|
|
7
|
+
function Spinner(t0) {
|
|
8
|
+
const $ = c(53);
|
|
9
|
+
const { spinning: t1, size, tip, delay, indicator, children, fullscreen: t2, className, style, classNames, styles } = t0;
|
|
10
|
+
const spinning = void 0 === t1 ? true : t1;
|
|
11
|
+
const fullscreen = void 0 === t2 ? false : t2;
|
|
12
|
+
const ctx = useTaoConfig();
|
|
13
|
+
const resolvedSize = size ?? ctx.size;
|
|
14
|
+
const [active, setActive] = useState(delay ? false : spinning);
|
|
15
|
+
let t3;
|
|
16
|
+
let t4;
|
|
17
|
+
if ($[0] !== delay || $[1] !== spinning) {
|
|
18
|
+
t3 = ()=>{
|
|
19
|
+
if (delay && spinning) {
|
|
20
|
+
const t = setTimeout(()=>setActive(true), delay);
|
|
21
|
+
return ()=>clearTimeout(t);
|
|
22
|
+
}
|
|
23
|
+
setActive(spinning);
|
|
24
|
+
};
|
|
25
|
+
t4 = [
|
|
26
|
+
spinning,
|
|
27
|
+
delay
|
|
28
|
+
];
|
|
29
|
+
$[0] = delay;
|
|
30
|
+
$[1] = spinning;
|
|
31
|
+
$[2] = t3;
|
|
32
|
+
$[3] = t4;
|
|
33
|
+
} else {
|
|
34
|
+
t3 = $[2];
|
|
35
|
+
t4 = $[3];
|
|
36
|
+
}
|
|
37
|
+
useEffect(t3, t4);
|
|
38
|
+
const t5 = classNames?.root;
|
|
39
|
+
const t6 = !children && !fullscreen && className;
|
|
40
|
+
let t7;
|
|
41
|
+
if ($[4] !== t5 || $[5] !== t6) {
|
|
42
|
+
t7 = cx(t5, t6);
|
|
43
|
+
$[4] = t5;
|
|
44
|
+
$[5] = t6;
|
|
45
|
+
$[6] = t7;
|
|
46
|
+
} else t7 = $[6];
|
|
47
|
+
let t8;
|
|
48
|
+
if ($[7] !== children || $[8] !== fullscreen || $[9] !== style || $[10] !== styles?.root) {
|
|
49
|
+
t8 = children || fullscreen ? styles?.root : {
|
|
50
|
+
...styles?.root,
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
$[7] = children;
|
|
54
|
+
$[8] = fullscreen;
|
|
55
|
+
$[9] = style;
|
|
56
|
+
$[10] = styles?.root;
|
|
57
|
+
$[11] = t8;
|
|
58
|
+
} else t8 = $[11];
|
|
59
|
+
const t9 = classNames?.indicator;
|
|
60
|
+
let t10;
|
|
61
|
+
if ($[12] !== t9) {
|
|
62
|
+
t10 = cx(t9);
|
|
63
|
+
$[12] = t9;
|
|
64
|
+
$[13] = t10;
|
|
65
|
+
} else t10 = $[13];
|
|
66
|
+
const t11 = styles?.indicator;
|
|
67
|
+
let t12;
|
|
68
|
+
if ($[14] !== indicator) {
|
|
69
|
+
t12 = indicator ?? /*#__PURE__*/ jsx(DefaultIndicator, {});
|
|
70
|
+
$[14] = indicator;
|
|
71
|
+
$[15] = t12;
|
|
72
|
+
} else t12 = $[15];
|
|
73
|
+
let t13;
|
|
74
|
+
if ($[16] !== t10 || $[17] !== t11 || $[18] !== t12) {
|
|
75
|
+
t13 = /*#__PURE__*/ jsx("span", {
|
|
76
|
+
"data-tao-spinner-indicator": "",
|
|
77
|
+
className: t10,
|
|
78
|
+
style: t11,
|
|
79
|
+
children: t12
|
|
80
|
+
});
|
|
81
|
+
$[16] = t10;
|
|
82
|
+
$[17] = t11;
|
|
83
|
+
$[18] = t12;
|
|
84
|
+
$[19] = t13;
|
|
85
|
+
} else t13 = $[19];
|
|
86
|
+
let t14;
|
|
87
|
+
if ($[20] !== classNames?.tip || $[21] !== styles?.tip || $[22] !== tip) {
|
|
88
|
+
t14 = null != tip && /*#__PURE__*/ jsx("span", {
|
|
89
|
+
"data-tao-spinner-tip": "",
|
|
90
|
+
className: cx(classNames?.tip),
|
|
91
|
+
style: styles?.tip,
|
|
92
|
+
children: tip
|
|
93
|
+
});
|
|
94
|
+
$[20] = classNames?.tip;
|
|
95
|
+
$[21] = styles?.tip;
|
|
96
|
+
$[22] = tip;
|
|
97
|
+
$[23] = t14;
|
|
98
|
+
} else t14 = $[23];
|
|
99
|
+
let t15;
|
|
100
|
+
if ($[24] !== resolvedSize || $[25] !== t13 || $[26] !== t14 || $[27] !== t7 || $[28] !== t8) {
|
|
101
|
+
t15 = /*#__PURE__*/ jsxs("span", {
|
|
102
|
+
"data-tao-spinner": "",
|
|
103
|
+
"data-tao-size": resolvedSize,
|
|
104
|
+
className: t7,
|
|
105
|
+
style: t8,
|
|
106
|
+
role: "status",
|
|
107
|
+
"aria-live": "polite",
|
|
108
|
+
children: [
|
|
109
|
+
t13,
|
|
110
|
+
t14
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
$[24] = resolvedSize;
|
|
114
|
+
$[25] = t13;
|
|
115
|
+
$[26] = t14;
|
|
116
|
+
$[27] = t7;
|
|
117
|
+
$[28] = t8;
|
|
118
|
+
$[29] = t15;
|
|
119
|
+
} else t15 = $[29];
|
|
120
|
+
const spinnerCore = t15;
|
|
121
|
+
if (fullscreen) {
|
|
122
|
+
if (!active) return null;
|
|
123
|
+
const t16 = classNames?.overlay;
|
|
124
|
+
let t17;
|
|
125
|
+
if ($[30] !== className || $[31] !== t16) {
|
|
126
|
+
t17 = cx(t16, className);
|
|
127
|
+
$[30] = className;
|
|
128
|
+
$[31] = t16;
|
|
129
|
+
$[32] = t17;
|
|
130
|
+
} else t17 = $[32];
|
|
131
|
+
const t18 = styles?.overlay;
|
|
132
|
+
let t19;
|
|
133
|
+
if ($[33] !== style || $[34] !== t18) {
|
|
134
|
+
t19 = {
|
|
135
|
+
...t18,
|
|
136
|
+
...style
|
|
137
|
+
};
|
|
138
|
+
$[33] = style;
|
|
139
|
+
$[34] = t18;
|
|
140
|
+
$[35] = t19;
|
|
141
|
+
} else t19 = $[35];
|
|
142
|
+
let t20;
|
|
143
|
+
if ($[36] !== spinnerCore || $[37] !== t17 || $[38] !== t19) {
|
|
144
|
+
t20 = /*#__PURE__*/ jsx("div", {
|
|
145
|
+
"data-tao-spinner-fullscreen": "",
|
|
146
|
+
className: t17,
|
|
147
|
+
style: t19,
|
|
148
|
+
children: spinnerCore
|
|
149
|
+
});
|
|
150
|
+
$[36] = spinnerCore;
|
|
151
|
+
$[37] = t17;
|
|
152
|
+
$[38] = t19;
|
|
153
|
+
$[39] = t20;
|
|
154
|
+
} else t20 = $[39];
|
|
155
|
+
return t20;
|
|
156
|
+
}
|
|
157
|
+
if (null != children) {
|
|
158
|
+
const t16 = active || void 0;
|
|
159
|
+
let t17;
|
|
160
|
+
if ($[40] !== children) {
|
|
161
|
+
t17 = /*#__PURE__*/ jsx("div", {
|
|
162
|
+
"data-tao-spinner-content": "",
|
|
163
|
+
children: children
|
|
164
|
+
});
|
|
165
|
+
$[40] = children;
|
|
166
|
+
$[41] = t17;
|
|
167
|
+
} else t17 = $[41];
|
|
168
|
+
let t18;
|
|
169
|
+
if ($[42] !== active || $[43] !== classNames?.overlay || $[44] !== spinnerCore || $[45] !== styles?.overlay) {
|
|
170
|
+
t18 = active && /*#__PURE__*/ jsx("div", {
|
|
171
|
+
"data-tao-spinner-overlay": "",
|
|
172
|
+
className: cx(classNames?.overlay),
|
|
173
|
+
style: styles?.overlay,
|
|
174
|
+
children: spinnerCore
|
|
175
|
+
});
|
|
176
|
+
$[42] = active;
|
|
177
|
+
$[43] = classNames?.overlay;
|
|
178
|
+
$[44] = spinnerCore;
|
|
179
|
+
$[45] = styles?.overlay;
|
|
180
|
+
$[46] = t18;
|
|
181
|
+
} else t18 = $[46];
|
|
182
|
+
let t19;
|
|
183
|
+
if ($[47] !== className || $[48] !== style || $[49] !== t16 || $[50] !== t17 || $[51] !== t18) {
|
|
184
|
+
t19 = /*#__PURE__*/ jsxs("div", {
|
|
185
|
+
"data-tao-spinner-container": "",
|
|
186
|
+
"data-tao-spinning": t16,
|
|
187
|
+
className: className,
|
|
188
|
+
style: style,
|
|
189
|
+
children: [
|
|
190
|
+
t17,
|
|
191
|
+
t18
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
$[47] = className;
|
|
195
|
+
$[48] = style;
|
|
196
|
+
$[49] = t16;
|
|
197
|
+
$[50] = t17;
|
|
198
|
+
$[51] = t18;
|
|
199
|
+
$[52] = t19;
|
|
200
|
+
} else t19 = $[52];
|
|
201
|
+
return t19;
|
|
202
|
+
}
|
|
203
|
+
if (!active) return null;
|
|
204
|
+
return spinnerCore;
|
|
205
|
+
}
|
|
206
|
+
function DefaultIndicator() {
|
|
207
|
+
const $ = c(1);
|
|
208
|
+
let t0;
|
|
209
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
210
|
+
t0 = /*#__PURE__*/ jsx("svg", {
|
|
211
|
+
"data-tao-spinner-svg": "",
|
|
212
|
+
viewBox: "0 0 50 50",
|
|
213
|
+
fill: "none",
|
|
214
|
+
"aria-hidden": true,
|
|
215
|
+
children: /*#__PURE__*/ jsx("circle", {
|
|
216
|
+
cx: "25",
|
|
217
|
+
cy: "25",
|
|
218
|
+
r: "20",
|
|
219
|
+
stroke: "currentColor",
|
|
220
|
+
strokeWidth: "5",
|
|
221
|
+
strokeLinecap: "round",
|
|
222
|
+
strokeDasharray: "90 40"
|
|
223
|
+
})
|
|
224
|
+
});
|
|
225
|
+
$[0] = t0;
|
|
226
|
+
} else t0 = $[0];
|
|
227
|
+
return t0;
|
|
228
|
+
}
|
|
229
|
+
export { Spinner };
|
|
@@ -307,11 +307,16 @@
|
|
|
307
307
|
--tao-radius: 6px;
|
|
308
308
|
--tao-font-size: 14px;
|
|
309
309
|
--tao-control-height: 36px;
|
|
310
|
+
--tao-control-width: 200px;
|
|
311
|
+
--tao-control-range-width: 360px;
|
|
310
312
|
--tao-size-unit: 4px;
|
|
311
313
|
--tao-line-width: 1px;
|
|
312
314
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
313
315
|
--tao-font-family-code: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
314
316
|
--tao-motion-unit: .1s;
|
|
317
|
+
--tao-z-index-drawer: 1000;
|
|
318
|
+
--tao-z-index-modal: 1000;
|
|
319
|
+
--tao-z-index-popup: 1100;
|
|
315
320
|
--tao-primary: var(--tao-color-primary);
|
|
316
321
|
--tao-primary-hover: var(--tao-color-primary);
|
|
317
322
|
}
|
|
@@ -529,8 +534,8 @@
|
|
|
529
534
|
}
|
|
530
535
|
|
|
531
536
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
537
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
538
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
539
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
540
|
}
|
|
536
541
|
|
|
@@ -541,16 +546,7 @@
|
|
|
541
546
|
}
|
|
542
547
|
|
|
543
548
|
:root, [data-tao-provider] {
|
|
544
|
-
--tao-color-border-secondary:
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
548
|
-
:root, [data-tao-provider] {
|
|
549
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
:root, [data-tao-provider] {
|
|
549
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
550
|
--tao-radius-xs: 2px;
|
|
555
551
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
552
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +629,10 @@
|
|
|
633
629
|
visibility: collapse;
|
|
634
630
|
}
|
|
635
631
|
|
|
632
|
+
.visible {
|
|
633
|
+
visibility: visible;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
636
|
.absolute {
|
|
637
637
|
position: absolute;
|
|
638
638
|
}
|
|
@@ -715,6 +715,10 @@
|
|
|
715
715
|
display: inline;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
.inline-flex {
|
|
719
|
+
display: inline-flex;
|
|
720
|
+
}
|
|
721
|
+
|
|
718
722
|
.table {
|
|
719
723
|
display: table;
|
|
720
724
|
}
|
|
@@ -727,6 +731,10 @@
|
|
|
727
731
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
732
|
}
|
|
729
733
|
|
|
734
|
+
.resize {
|
|
735
|
+
resize: both;
|
|
736
|
+
}
|
|
737
|
+
|
|
730
738
|
.flex-wrap {
|
|
731
739
|
flex-wrap: wrap;
|
|
732
740
|
}
|
|
@@ -742,6 +750,14 @@
|
|
|
742
750
|
border-width: 1px;
|
|
743
751
|
}
|
|
744
752
|
|
|
753
|
+
.italic {
|
|
754
|
+
font-style: italic;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.underline {
|
|
758
|
+
text-decoration-line: underline;
|
|
759
|
+
}
|
|
760
|
+
|
|
745
761
|
.shadow {
|
|
746
762
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
763
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -771,6 +787,11 @@
|
|
|
771
787
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
788
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
789
|
}
|
|
790
|
+
|
|
791
|
+
.select-all {
|
|
792
|
+
-webkit-user-select: all;
|
|
793
|
+
user-select: all;
|
|
794
|
+
}
|
|
774
795
|
}
|
|
775
796
|
|
|
776
797
|
[data-tao-splitter] {
|
|
@@ -307,11 +307,16 @@
|
|
|
307
307
|
--tao-radius: 6px;
|
|
308
308
|
--tao-font-size: 14px;
|
|
309
309
|
--tao-control-height: 36px;
|
|
310
|
+
--tao-control-width: 200px;
|
|
311
|
+
--tao-control-range-width: 360px;
|
|
310
312
|
--tao-size-unit: 4px;
|
|
311
313
|
--tao-line-width: 1px;
|
|
312
314
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
313
315
|
--tao-font-family-code: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
314
316
|
--tao-motion-unit: .1s;
|
|
317
|
+
--tao-z-index-drawer: 1000;
|
|
318
|
+
--tao-z-index-modal: 1000;
|
|
319
|
+
--tao-z-index-popup: 1100;
|
|
315
320
|
--tao-primary: var(--tao-color-primary);
|
|
316
321
|
--tao-primary-hover: var(--tao-color-primary);
|
|
317
322
|
}
|
|
@@ -529,8 +534,8 @@
|
|
|
529
534
|
}
|
|
530
535
|
|
|
531
536
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
537
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
538
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
539
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
540
|
}
|
|
536
541
|
|
|
@@ -541,16 +546,7 @@
|
|
|
541
546
|
}
|
|
542
547
|
|
|
543
548
|
:root, [data-tao-provider] {
|
|
544
|
-
--tao-color-border-secondary:
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
548
|
-
:root, [data-tao-provider] {
|
|
549
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
:root, [data-tao-provider] {
|
|
549
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
550
|
--tao-radius-xs: 2px;
|
|
555
551
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
552
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +629,10 @@
|
|
|
633
629
|
visibility: collapse;
|
|
634
630
|
}
|
|
635
631
|
|
|
632
|
+
.visible {
|
|
633
|
+
visibility: visible;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
636
|
.absolute {
|
|
637
637
|
position: absolute;
|
|
638
638
|
}
|
|
@@ -715,6 +715,10 @@
|
|
|
715
715
|
display: inline;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
.inline-flex {
|
|
719
|
+
display: inline-flex;
|
|
720
|
+
}
|
|
721
|
+
|
|
718
722
|
.table {
|
|
719
723
|
display: table;
|
|
720
724
|
}
|
|
@@ -727,6 +731,10 @@
|
|
|
727
731
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
732
|
}
|
|
729
733
|
|
|
734
|
+
.resize {
|
|
735
|
+
resize: both;
|
|
736
|
+
}
|
|
737
|
+
|
|
730
738
|
.flex-wrap {
|
|
731
739
|
flex-wrap: wrap;
|
|
732
740
|
}
|
|
@@ -742,6 +750,14 @@
|
|
|
742
750
|
border-width: 1px;
|
|
743
751
|
}
|
|
744
752
|
|
|
753
|
+
.italic {
|
|
754
|
+
font-style: italic;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.underline {
|
|
758
|
+
text-decoration-line: underline;
|
|
759
|
+
}
|
|
760
|
+
|
|
745
761
|
.shadow {
|
|
746
762
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
763
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -771,6 +787,11 @@
|
|
|
771
787
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
788
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
789
|
}
|
|
790
|
+
|
|
791
|
+
.select-all {
|
|
792
|
+
-webkit-user-select: all;
|
|
793
|
+
user-select: all;
|
|
794
|
+
}
|
|
774
795
|
}
|
|
775
796
|
|
|
776
797
|
button[data-tao-switch] {
|
|
@@ -307,11 +307,16 @@
|
|
|
307
307
|
--tao-radius: 6px;
|
|
308
308
|
--tao-font-size: 14px;
|
|
309
309
|
--tao-control-height: 36px;
|
|
310
|
+
--tao-control-width: 200px;
|
|
311
|
+
--tao-control-range-width: 360px;
|
|
310
312
|
--tao-size-unit: 4px;
|
|
311
313
|
--tao-line-width: 1px;
|
|
312
314
|
--tao-font-family: "Geist Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
|
313
315
|
--tao-font-family-code: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
314
316
|
--tao-motion-unit: .1s;
|
|
317
|
+
--tao-z-index-drawer: 1000;
|
|
318
|
+
--tao-z-index-modal: 1000;
|
|
319
|
+
--tao-z-index-popup: 1100;
|
|
315
320
|
--tao-primary: var(--tao-color-primary);
|
|
316
321
|
--tao-primary-hover: var(--tao-color-primary);
|
|
317
322
|
}
|
|
@@ -529,8 +534,8 @@
|
|
|
529
534
|
}
|
|
530
535
|
|
|
531
536
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
537
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
538
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
539
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
540
|
}
|
|
536
541
|
|
|
@@ -541,16 +546,7 @@
|
|
|
541
546
|
}
|
|
542
547
|
|
|
543
548
|
:root, [data-tao-provider] {
|
|
544
|
-
--tao-color-border-secondary:
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
548
|
-
:root, [data-tao-provider] {
|
|
549
|
-
--tao-color-border-secondary: color-mix(in oklch, var(--tao-color-text-base) 10%, var(--tao-color-bg-base));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
:root, [data-tao-provider] {
|
|
549
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
550
|
--tao-radius-xs: 2px;
|
|
555
551
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
552
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +629,10 @@
|
|
|
633
629
|
visibility: collapse;
|
|
634
630
|
}
|
|
635
631
|
|
|
632
|
+
.visible {
|
|
633
|
+
visibility: visible;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
636
|
.absolute {
|
|
637
637
|
position: absolute;
|
|
638
638
|
}
|
|
@@ -715,6 +715,10 @@
|
|
|
715
715
|
display: inline;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
.inline-flex {
|
|
719
|
+
display: inline-flex;
|
|
720
|
+
}
|
|
721
|
+
|
|
718
722
|
.table {
|
|
719
723
|
display: table;
|
|
720
724
|
}
|
|
@@ -727,6 +731,10 @@
|
|
|
727
731
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
732
|
}
|
|
729
733
|
|
|
734
|
+
.resize {
|
|
735
|
+
resize: both;
|
|
736
|
+
}
|
|
737
|
+
|
|
730
738
|
.flex-wrap {
|
|
731
739
|
flex-wrap: wrap;
|
|
732
740
|
}
|
|
@@ -742,6 +750,14 @@
|
|
|
742
750
|
border-width: 1px;
|
|
743
751
|
}
|
|
744
752
|
|
|
753
|
+
.italic {
|
|
754
|
+
font-style: italic;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.underline {
|
|
758
|
+
text-decoration-line: underline;
|
|
759
|
+
}
|
|
760
|
+
|
|
745
761
|
.shadow {
|
|
746
762
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
763
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
@@ -771,14 +787,36 @@
|
|
|
771
787
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
788
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
789
|
}
|
|
790
|
+
|
|
791
|
+
.select-all {
|
|
792
|
+
-webkit-user-select: all;
|
|
793
|
+
user-select: all;
|
|
794
|
+
}
|
|
774
795
|
}
|
|
775
796
|
|
|
776
797
|
[data-tao-table-wrapper] {
|
|
777
798
|
font-family: var(--tao-font-family);
|
|
778
799
|
color: var(--tao-color-text);
|
|
800
|
+
--tao-table-cell-bg: transparent;
|
|
801
|
+
--tao-table-header-bg: transparent;
|
|
802
|
+
--tao-table-header-color: var(--tao-color-text-secondary);
|
|
803
|
+
--tao-table-row-hover-bg: oklch(0% 0 0 / .02);
|
|
804
|
+
--tao-table-row-selected-bg: oklch(0% 0 0 / .05);
|
|
805
|
+
--tao-table-row-selected-hover-bg: oklch(0% 0 0 / .07);
|
|
779
806
|
position: relative;
|
|
780
807
|
}
|
|
781
808
|
|
|
809
|
+
[data-tao-table-wrapper][data-tao-variant="filled"], [data-tao-table-wrapper][data-tao-variant="outlined"] {
|
|
810
|
+
--tao-table-header-bg: oklch(98.5% 0 0);
|
|
811
|
+
--tao-table-row-hover-bg: oklch(98.5% 0 0);
|
|
812
|
+
--tao-table-row-selected-bg: var(--tao-primary-bg);
|
|
813
|
+
--tao-table-row-selected-hover-bg: var(--tao-primary-bg-hover);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
[data-tao-table-wrapper][data-tao-header-bg="off"] {
|
|
817
|
+
--tao-table-header-bg: transparent;
|
|
818
|
+
}
|
|
819
|
+
|
|
782
820
|
[data-tao-table-scroll] {
|
|
783
821
|
position: relative;
|
|
784
822
|
overflow-x: auto;
|
|
@@ -798,7 +836,7 @@
|
|
|
798
836
|
padding: var(--tao-padding-sm) var(--tao-padding);
|
|
799
837
|
text-align: left;
|
|
800
838
|
border-bottom: var(--tao-line-width) solid var(--tao-color-border-secondary);
|
|
801
|
-
background: var(--tao-
|
|
839
|
+
background: var(--tao-table-cell-bg);
|
|
802
840
|
transition: background-color var(--tao-motion-duration-fast) var(--tao-motion-ease-out);
|
|
803
841
|
}
|
|
804
842
|
|
|
@@ -818,8 +856,8 @@
|
|
|
818
856
|
|
|
819
857
|
[data-tao-table-thead] [data-tao-table-cell] {
|
|
820
858
|
font-weight: var(--tao-font-weight-medium);
|
|
821
|
-
color: var(--tao-
|
|
822
|
-
background: var(--tao-
|
|
859
|
+
color: var(--tao-table-header-color);
|
|
860
|
+
background: var(--tao-table-header-bg);
|
|
823
861
|
white-space: nowrap;
|
|
824
862
|
}
|
|
825
863
|
|
|
@@ -948,15 +986,15 @@
|
|
|
948
986
|
}
|
|
949
987
|
|
|
950
988
|
[data-tao-table-row]:hover [data-tao-table-cell] {
|
|
951
|
-
background: var(--tao-
|
|
989
|
+
background: var(--tao-table-row-hover-bg);
|
|
952
990
|
}
|
|
953
991
|
|
|
954
992
|
[data-tao-table-row][data-tao-selected] [data-tao-table-cell] {
|
|
955
|
-
background: var(--tao-
|
|
993
|
+
background: var(--tao-table-row-selected-bg);
|
|
956
994
|
}
|
|
957
995
|
|
|
958
996
|
[data-tao-table-row][data-tao-selected]:hover [data-tao-table-cell] {
|
|
959
|
-
background: var(--tao-
|
|
997
|
+
background: var(--tao-table-row-selected-hover-bg);
|
|
960
998
|
}
|
|
961
999
|
|
|
962
1000
|
[data-tao-table-selection-cell] {
|
|
@@ -971,6 +1009,7 @@
|
|
|
971
1009
|
|
|
972
1010
|
[data-tao-table-cell][data-tao-fixed] {
|
|
973
1011
|
z-index: 1;
|
|
1012
|
+
background: var(--tao-color-bg-container);
|
|
974
1013
|
position: sticky;
|
|
975
1014
|
}
|
|
976
1015
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type TaoSize } from '../../provider/tao-provider';
|
|
2
|
+
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
4
|
import './table.css';
|
|
5
5
|
export type TableSemanticPart = 'root' | 'header.cell' | 'body.row' | 'body.cell' | 'pagination';
|
|
@@ -64,10 +64,25 @@ export interface TableProps<T = any> {
|
|
|
64
64
|
};
|
|
65
65
|
rowSelection?: TableRowSelection<T>;
|
|
66
66
|
size?: TaoSize;
|
|
67
|
+
/**
|
|
68
|
+
* 表面风格。
|
|
69
|
+
* - `borderless`(极简):无表头底色、单元格透明、仅行底分隔线。
|
|
70
|
+
* - `filled`:表头灰底(库的默认表现)。
|
|
71
|
+
* - `outlined`:filled + 整体外框 + 列分隔线。
|
|
72
|
+
*
|
|
73
|
+
* 不传时继承 TaoProvider 的 variant;当继承到框架默认 `outlined` 时,
|
|
74
|
+
* Table 回落为 `filled` 以保持向后兼容(裸用 `<Table>` 仍是灰底表头)。
|
|
75
|
+
*/
|
|
76
|
+
variant?: TaoVariant;
|
|
77
|
+
/**
|
|
78
|
+
* 表头灰底开关,默认 `true`。设为 `false` 关掉表头底色(极简表头),
|
|
79
|
+
* 不影响外框 / 列分隔线等其它 variant 表现。
|
|
80
|
+
*/
|
|
81
|
+
headerBackground?: boolean;
|
|
67
82
|
emptyText?: ReactNode;
|
|
68
83
|
bordered?: boolean;
|
|
69
84
|
className?: string;
|
|
70
85
|
classNames?: SemanticClassNames<TableSemanticPart>;
|
|
71
86
|
styles?: SemanticStyles<TableSemanticPart>;
|
|
72
87
|
}
|
|
73
|
-
export declare function Table<T = any>({ columns, dataSource, rowKey, loading, pagination: paginationProp, onChange, scroll, rowSelection, size, emptyText, bordered, className, classNames, styles, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
88
|
+
export declare function Table<T = any>({ columns, dataSource, rowKey, loading, pagination: paginationProp, onChange, scroll, rowSelection, size, variant, headerBackground, emptyText, bordered, className, classNames, styles, }: TableProps<T>): import("react/jsx-runtime").JSX.Element;
|