@rockshin/tao-ui 0.0.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/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/components/button/button.css +1055 -0
- package/dist/components/button/button.d.ts +15 -0
- package/dist/components/button/button.js +93 -0
- package/dist/components/checkbox/checkbox.css +1035 -0
- package/dist/components/checkbox/checkbox.d.ts +33 -0
- package/dist/components/checkbox/checkbox.js +312 -0
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +18 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +173 -0
- package/dist/components/date-picker/calendar/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/calendar/calendar-header.js +336 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/month-grid.js +61 -0
- package/dist/components/date-picker/calendar/time-panel.d.ts +12 -0
- package/dist/components/date-picker/calendar/time-panel.js +233 -0
- package/dist/components/date-picker/calendar/use-calendar.d.ts +15 -0
- package/dist/components/date-picker/calendar/use-calendar.js +24 -0
- package/dist/components/date-picker/calendar/year-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/year-grid.js +60 -0
- package/dist/components/date-picker/date-picker.css +1799 -0
- package/dist/components/date-picker/date-picker.d.ts +29 -0
- package/dist/components/date-picker/date-picker.js +663 -0
- package/dist/components/date-picker/presets.d.ts +9 -0
- package/dist/components/date-picker/presets.js +36 -0
- package/dist/components/date-picker/range-picker.d.ts +30 -0
- package/dist/components/date-picker/range-picker.js +432 -0
- package/dist/components/date-picker/types.d.ts +39 -0
- package/dist/components/date-picker/types.js +7 -0
- package/dist/components/drawer/drawer.css +1112 -0
- package/dist/components/drawer/drawer.d.ts +17 -0
- package/dist/components/drawer/drawer.js +184 -0
- package/dist/components/form-actions/form-actions.d.ts +12 -0
- package/dist/components/form-actions/form-actions.js +42 -0
- package/dist/components/form-field/form-field.d.ts +17 -0
- package/dist/components/form-field/form-field.js +101 -0
- package/dist/components/form-field/form.css +1036 -0
- package/dist/components/form-section/form-section.d.ts +14 -0
- package/dist/components/form-section/form-section.js +92 -0
- package/dist/components/input/input.css +1185 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +143 -0
- package/dist/components/pagination/pagination.css +1099 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/pagination.js +310 -0
- package/dist/components/radio/radio.css +1045 -0
- package/dist/components/radio/radio.d.ts +34 -0
- package/dist/components/radio/radio.js +215 -0
- package/dist/components/scroll-area/scroll-area.css +1099 -0
- package/dist/components/scroll-area/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area/scroll-area.js +375 -0
- package/dist/components/select/mobile-select.css +1044 -0
- package/dist/components/select/mobile-select.d.ts +19 -0
- package/dist/components/select/mobile-select.js +224 -0
- package/dist/components/select/select.css +1327 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/select/select.js +532 -0
- package/dist/components/select/use-is-mobile.d.ts +1 -0
- package/dist/components/select/use-is-mobile.js +30 -0
- package/dist/components/splitter/splitter.css +1104 -0
- package/dist/components/splitter/splitter.d.ts +33 -0
- package/dist/components/splitter/splitter.js +451 -0
- package/dist/components/switch/switch.css +1170 -0
- package/dist/components/switch/switch.d.ts +19 -0
- package/dist/components/switch/switch.js +143 -0
- package/dist/components/table/table.css +1255 -0
- package/dist/components/table/table.d.ts +73 -0
- package/dist/components/table/table.js +1022 -0
- package/dist/components/tabs/tabs.css +1076 -0
- package/dist/components/tabs/tabs.d.ts +24 -0
- package/dist/components/tabs/tabs.js +256 -0
- package/dist/components/tag/tag.css +1124 -0
- package/dist/components/tag/tag.d.ts +33 -0
- package/dist/components/tag/tag.js +237 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/layouts/form-layout/form-layout.d.ts +6 -0
- package/dist/layouts/form-layout/form-layout.js +18 -0
- package/dist/layouts/stack/layout.css +1003 -0
- package/dist/layouts/stack/stack.d.ts +9 -0
- package/dist/layouts/stack/stack.js +27 -0
- package/dist/number-input/cursor.d.ts +9 -0
- package/dist/number-input/cursor.js +44 -0
- package/dist/number-input/format.d.ts +5 -0
- package/dist/number-input/format.js +50 -0
- package/dist/number-input/index.d.ts +5 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/number-input.d.ts +9 -0
- package/dist/number-input/number-input.js +101 -0
- package/dist/number-input/percentage.d.ts +3 -0
- package/dist/number-input/percentage.js +28 -0
- package/dist/number-input/types.d.ts +5 -0
- package/dist/number-input/types.js +0 -0
- package/dist/number-input/use-number-input.d.ts +30 -0
- package/dist/number-input/use-number-input.js +211 -0
- package/dist/number-input/validate.d.ts +3 -0
- package/dist/number-input/validate.js +17 -0
- package/dist/provider/tao-provider.d.ts +42 -0
- package/dist/provider/tao-provider.js +67 -0
- package/dist/theme/control.css +1061 -0
- package/dist/theme/theme.css +957 -0
- package/dist/utils/semantic.d.ts +10 -0
- package/dist/utils/semantic.js +5 -0
- package/llms.txt +67 -0
- package/package.json +97 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type TaoSize } from '../../provider/tao-provider';
|
|
3
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
|
+
import './button.css';
|
|
5
|
+
export type ButtonSemanticPart = 'root';
|
|
6
|
+
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'disabled'> {
|
|
7
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'destructive';
|
|
8
|
+
size?: TaoSize;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
classNames?: SemanticClassNames<ButtonSemanticPart>;
|
|
13
|
+
styles?: SemanticStyles<ButtonSemanticPart>;
|
|
14
|
+
}
|
|
15
|
+
export declare function Button({ variant, size, disabled, loading, children, className, style, classNames, styles, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
|
+
import { cx } from "../../utils/semantic.js";
|
|
5
|
+
import "./button.css";
|
|
6
|
+
function Button(t0) {
|
|
7
|
+
const $ = c(26);
|
|
8
|
+
let children;
|
|
9
|
+
let className;
|
|
10
|
+
let classNames;
|
|
11
|
+
let disabled;
|
|
12
|
+
let loading;
|
|
13
|
+
let rest;
|
|
14
|
+
let size;
|
|
15
|
+
let style;
|
|
16
|
+
let styles;
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({ variant: t1, size, disabled, loading, children, className, style, classNames, styles, ...rest } = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = children;
|
|
22
|
+
$[2] = className;
|
|
23
|
+
$[3] = classNames;
|
|
24
|
+
$[4] = disabled;
|
|
25
|
+
$[5] = loading;
|
|
26
|
+
$[6] = rest;
|
|
27
|
+
$[7] = size;
|
|
28
|
+
$[8] = style;
|
|
29
|
+
$[9] = styles;
|
|
30
|
+
$[10] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
children = $[1];
|
|
33
|
+
className = $[2];
|
|
34
|
+
classNames = $[3];
|
|
35
|
+
disabled = $[4];
|
|
36
|
+
loading = $[5];
|
|
37
|
+
rest = $[6];
|
|
38
|
+
size = $[7];
|
|
39
|
+
style = $[8];
|
|
40
|
+
styles = $[9];
|
|
41
|
+
t1 = $[10];
|
|
42
|
+
}
|
|
43
|
+
const variant = void 0 === t1 ? "primary" : t1;
|
|
44
|
+
const ctx = useTaoConfig();
|
|
45
|
+
const resolvedSize = size ?? ctx.size;
|
|
46
|
+
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
47
|
+
const isDisabled = resolvedDisabled || loading;
|
|
48
|
+
const t2 = classNames?.root;
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[11] !== className || $[12] !== t2) {
|
|
51
|
+
t3 = cx(t2, className);
|
|
52
|
+
$[11] = className;
|
|
53
|
+
$[12] = t2;
|
|
54
|
+
$[13] = t3;
|
|
55
|
+
} else t3 = $[13];
|
|
56
|
+
const t4 = styles?.root;
|
|
57
|
+
let t5;
|
|
58
|
+
if ($[14] !== style || $[15] !== t4) {
|
|
59
|
+
t5 = {
|
|
60
|
+
...t4,
|
|
61
|
+
...style
|
|
62
|
+
};
|
|
63
|
+
$[14] = style;
|
|
64
|
+
$[15] = t4;
|
|
65
|
+
$[16] = t5;
|
|
66
|
+
} else t5 = $[16];
|
|
67
|
+
const t6 = loading || void 0;
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[17] !== children || $[18] !== isDisabled || $[19] !== resolvedSize || $[20] !== rest || $[21] !== t3 || $[22] !== t5 || $[23] !== t6 || $[24] !== variant) {
|
|
70
|
+
t7 = /*#__PURE__*/ jsx("button", {
|
|
71
|
+
type: "button",
|
|
72
|
+
...rest,
|
|
73
|
+
className: t3,
|
|
74
|
+
style: t5,
|
|
75
|
+
disabled: isDisabled,
|
|
76
|
+
"aria-busy": t6,
|
|
77
|
+
"data-tao-variant": variant,
|
|
78
|
+
"data-tao-size": resolvedSize,
|
|
79
|
+
children: children
|
|
80
|
+
});
|
|
81
|
+
$[17] = children;
|
|
82
|
+
$[18] = isDisabled;
|
|
83
|
+
$[19] = resolvedSize;
|
|
84
|
+
$[20] = rest;
|
|
85
|
+
$[21] = t3;
|
|
86
|
+
$[22] = t5;
|
|
87
|
+
$[23] = t6;
|
|
88
|
+
$[24] = variant;
|
|
89
|
+
$[25] = t7;
|
|
90
|
+
} else t7 = $[25];
|
|
91
|
+
return t7;
|
|
92
|
+
}
|
|
93
|
+
export { Button };
|