@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 { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
3
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
|
+
import './input.css';
|
|
5
|
+
export type InputSemanticPart = 'root' | 'input' | 'prefix' | 'suffix';
|
|
6
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
7
|
+
size?: TaoSize;
|
|
8
|
+
variant?: TaoVariant;
|
|
9
|
+
prefix?: ReactNode;
|
|
10
|
+
suffix?: ReactNode;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
classNames?: SemanticClassNames<InputSemanticPart>;
|
|
13
|
+
styles?: SemanticStyles<InputSemanticPart>;
|
|
14
|
+
}
|
|
15
|
+
export declare function Input({ size, variant, prefix, suffix, error, disabled, className, style, classNames, styles, ...rest }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { jsx, jsxs } 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 "./input.css";
|
|
6
|
+
function Input(t0) {
|
|
7
|
+
const $ = c(41);
|
|
8
|
+
let className;
|
|
9
|
+
let classNames;
|
|
10
|
+
let disabled;
|
|
11
|
+
let error;
|
|
12
|
+
let prefix;
|
|
13
|
+
let rest;
|
|
14
|
+
let size;
|
|
15
|
+
let style;
|
|
16
|
+
let styles;
|
|
17
|
+
let suffix;
|
|
18
|
+
let variant;
|
|
19
|
+
if ($[0] !== t0) {
|
|
20
|
+
({ size, variant, prefix, suffix, error, disabled, className, style, classNames, styles, ...rest } = t0);
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
$[1] = className;
|
|
23
|
+
$[2] = classNames;
|
|
24
|
+
$[3] = disabled;
|
|
25
|
+
$[4] = error;
|
|
26
|
+
$[5] = prefix;
|
|
27
|
+
$[6] = rest;
|
|
28
|
+
$[7] = size;
|
|
29
|
+
$[8] = style;
|
|
30
|
+
$[9] = styles;
|
|
31
|
+
$[10] = suffix;
|
|
32
|
+
$[11] = variant;
|
|
33
|
+
} else {
|
|
34
|
+
className = $[1];
|
|
35
|
+
classNames = $[2];
|
|
36
|
+
disabled = $[3];
|
|
37
|
+
error = $[4];
|
|
38
|
+
prefix = $[5];
|
|
39
|
+
rest = $[6];
|
|
40
|
+
size = $[7];
|
|
41
|
+
style = $[8];
|
|
42
|
+
styles = $[9];
|
|
43
|
+
suffix = $[10];
|
|
44
|
+
variant = $[11];
|
|
45
|
+
}
|
|
46
|
+
const ctx = useTaoConfig();
|
|
47
|
+
const resolvedSize = size ?? ctx.size;
|
|
48
|
+
const resolvedVariant = variant ?? ctx.variant;
|
|
49
|
+
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
50
|
+
const t1 = classNames?.root;
|
|
51
|
+
let t2;
|
|
52
|
+
if ($[12] !== className || $[13] !== t1) {
|
|
53
|
+
t2 = cx(t1, className);
|
|
54
|
+
$[12] = className;
|
|
55
|
+
$[13] = t1;
|
|
56
|
+
$[14] = t2;
|
|
57
|
+
} else t2 = $[14];
|
|
58
|
+
const t3 = styles?.root;
|
|
59
|
+
let t4;
|
|
60
|
+
if ($[15] !== style || $[16] !== t3) {
|
|
61
|
+
t4 = {
|
|
62
|
+
...t3,
|
|
63
|
+
...style
|
|
64
|
+
};
|
|
65
|
+
$[15] = style;
|
|
66
|
+
$[16] = t3;
|
|
67
|
+
$[17] = t4;
|
|
68
|
+
} else t4 = $[17];
|
|
69
|
+
const t5 = error || void 0;
|
|
70
|
+
let t6;
|
|
71
|
+
if ($[18] !== classNames?.prefix || $[19] !== prefix || $[20] !== styles?.prefix) {
|
|
72
|
+
t6 = null != prefix && /*#__PURE__*/ jsx("span", {
|
|
73
|
+
className: classNames?.prefix,
|
|
74
|
+
style: styles?.prefix,
|
|
75
|
+
"data-tao-prefix": "",
|
|
76
|
+
children: prefix
|
|
77
|
+
});
|
|
78
|
+
$[18] = classNames?.prefix;
|
|
79
|
+
$[19] = prefix;
|
|
80
|
+
$[20] = styles?.prefix;
|
|
81
|
+
$[21] = t6;
|
|
82
|
+
} else t6 = $[21];
|
|
83
|
+
const t7 = classNames?.input;
|
|
84
|
+
const t8 = styles?.input;
|
|
85
|
+
const t9 = error || void 0;
|
|
86
|
+
let t10;
|
|
87
|
+
if ($[22] !== resolvedDisabled || $[23] !== rest || $[24] !== t7 || $[25] !== t8 || $[26] !== t9) {
|
|
88
|
+
t10 = /*#__PURE__*/ jsx("input", {
|
|
89
|
+
...rest,
|
|
90
|
+
className: t7,
|
|
91
|
+
style: t8,
|
|
92
|
+
disabled: resolvedDisabled,
|
|
93
|
+
"aria-invalid": t9
|
|
94
|
+
});
|
|
95
|
+
$[22] = resolvedDisabled;
|
|
96
|
+
$[23] = rest;
|
|
97
|
+
$[24] = t7;
|
|
98
|
+
$[25] = t8;
|
|
99
|
+
$[26] = t9;
|
|
100
|
+
$[27] = t10;
|
|
101
|
+
} else t10 = $[27];
|
|
102
|
+
let t11;
|
|
103
|
+
if ($[28] !== classNames?.suffix || $[29] !== styles?.suffix || $[30] !== suffix) {
|
|
104
|
+
t11 = null != suffix && /*#__PURE__*/ jsx("span", {
|
|
105
|
+
className: classNames?.suffix,
|
|
106
|
+
style: styles?.suffix,
|
|
107
|
+
"data-tao-suffix": "",
|
|
108
|
+
children: suffix
|
|
109
|
+
});
|
|
110
|
+
$[28] = classNames?.suffix;
|
|
111
|
+
$[29] = styles?.suffix;
|
|
112
|
+
$[30] = suffix;
|
|
113
|
+
$[31] = t11;
|
|
114
|
+
} else t11 = $[31];
|
|
115
|
+
let t12;
|
|
116
|
+
if ($[32] !== resolvedSize || $[33] !== resolvedVariant || $[34] !== t10 || $[35] !== t11 || $[36] !== t2 || $[37] !== t4 || $[38] !== t5 || $[39] !== t6) {
|
|
117
|
+
t12 = /*#__PURE__*/ jsxs("div", {
|
|
118
|
+
className: t2,
|
|
119
|
+
style: t4,
|
|
120
|
+
"data-tao-control": "",
|
|
121
|
+
"data-tao-input": "",
|
|
122
|
+
"data-tao-size": resolvedSize,
|
|
123
|
+
"data-tao-variant": resolvedVariant,
|
|
124
|
+
"data-tao-error": t5,
|
|
125
|
+
children: [
|
|
126
|
+
t6,
|
|
127
|
+
t10,
|
|
128
|
+
t11
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
$[32] = resolvedSize;
|
|
132
|
+
$[33] = resolvedVariant;
|
|
133
|
+
$[34] = t10;
|
|
134
|
+
$[35] = t11;
|
|
135
|
+
$[36] = t2;
|
|
136
|
+
$[37] = t4;
|
|
137
|
+
$[38] = t5;
|
|
138
|
+
$[39] = t6;
|
|
139
|
+
$[40] = t12;
|
|
140
|
+
} else t12 = $[40];
|
|
141
|
+
return t12;
|
|
142
|
+
}
|
|
143
|
+
export { Input };
|