@rockshin/tao-ui 0.0.1 → 0.0.2
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 +1088 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
- package/dist/components/breadcrumb/breadcrumb.js +268 -0
- package/dist/components/button/button.css +43 -21
- package/dist/components/checkbox/checkbox.css +30 -12
- package/dist/components/collapsible/collapsible.css +1023 -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 +1146 -0
- package/dist/components/context-menu/context-menu.d.ts +19 -0
- package/dist/components/context-menu/context-menu.js +104 -0
- package/dist/components/date-picker/date-picker.css +44 -16
- package/dist/components/drawer/drawer.css +123 -13
- package/dist/components/drawer/drawer.d.ts +36 -3
- package/dist/components/drawer/drawer.js +314 -121
- package/dist/components/dropdown/dropdown.css +996 -0
- package/dist/components/dropdown/dropdown.d.ts +45 -0
- package/dist/components/dropdown/dropdown.js +381 -0
- package/dist/components/form-field/form.css +30 -12
- package/dist/components/input/input.css +44 -14
- package/dist/components/menu/menu-render.d.ts +89 -0
- package/dist/components/menu/menu-render.js +376 -0
- package/dist/components/menu/menu.css +1142 -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 +1166 -0
- package/dist/components/modal/modal.d.ts +50 -0
- package/dist/components/modal/modal.js +353 -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 +30 -12
- package/dist/components/radio/radio.css +30 -12
- package/dist/components/scroll-area/scroll-area.css +30 -12
- package/dist/components/select/mobile-select.css +65 -13
- package/dist/components/select/mobile-select.js +17 -3
- package/dist/components/select/select.css +102 -15
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/select.js +204 -168
- package/dist/components/splitter/splitter.css +30 -12
- package/dist/components/switch/switch.css +30 -12
- package/dist/components/table/table.css +54 -18
- package/dist/components/table/table.d.ts +17 -2
- package/dist/components/table/table.js +214 -206
- package/dist/components/tabs/tabs.css +33 -17
- package/dist/components/tag/tag.css +30 -12
- package/dist/components/textarea/textarea.css +1204 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +181 -0
- package/dist/index.d.ts +24 -18
- package/dist/index.js +21 -15
- package/dist/layouts/stack/layout.css +30 -12
- package/dist/theme/control.css +44 -13
- package/dist/theme/theme.css +30 -12
- package/llms.txt +7 -6
- package/package.json +6 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
3
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
|
+
import './textarea.css';
|
|
5
|
+
export type TextareaSemanticPart = 'root' | 'textarea';
|
|
6
|
+
export interface AutoSizeOptions {
|
|
7
|
+
minRows?: number;
|
|
8
|
+
maxRows?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {
|
|
11
|
+
size?: TaoSize;
|
|
12
|
+
variant?: TaoVariant;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
/** Auto-grow height to fit content. `true` grows freely; pass min/max rows to clamp. */
|
|
15
|
+
autoSize?: boolean | AutoSizeOptions;
|
|
16
|
+
classNames?: SemanticClassNames<TextareaSemanticPart>;
|
|
17
|
+
styles?: SemanticStyles<TextareaSemanticPart>;
|
|
18
|
+
}
|
|
19
|
+
export declare function Textarea({ size, variant, error, disabled, autoSize, className, style, classNames, styles, onChange, ...rest }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { cx } from "../../utils/semantic.js";
|
|
6
|
+
import "./textarea.css";
|
|
7
|
+
function Textarea(t0) {
|
|
8
|
+
const $ = c(46);
|
|
9
|
+
let autoSize;
|
|
10
|
+
let className;
|
|
11
|
+
let classNames;
|
|
12
|
+
let disabled;
|
|
13
|
+
let error;
|
|
14
|
+
let onChange;
|
|
15
|
+
let rest;
|
|
16
|
+
let size;
|
|
17
|
+
let style;
|
|
18
|
+
let styles;
|
|
19
|
+
let variant;
|
|
20
|
+
if ($[0] !== t0) {
|
|
21
|
+
({ size, variant, error, disabled, autoSize, className, style, classNames, styles, onChange, ...rest } = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = autoSize;
|
|
24
|
+
$[2] = className;
|
|
25
|
+
$[3] = classNames;
|
|
26
|
+
$[4] = disabled;
|
|
27
|
+
$[5] = error;
|
|
28
|
+
$[6] = onChange;
|
|
29
|
+
$[7] = rest;
|
|
30
|
+
$[8] = size;
|
|
31
|
+
$[9] = style;
|
|
32
|
+
$[10] = styles;
|
|
33
|
+
$[11] = variant;
|
|
34
|
+
} else {
|
|
35
|
+
autoSize = $[1];
|
|
36
|
+
className = $[2];
|
|
37
|
+
classNames = $[3];
|
|
38
|
+
disabled = $[4];
|
|
39
|
+
error = $[5];
|
|
40
|
+
onChange = $[6];
|
|
41
|
+
rest = $[7];
|
|
42
|
+
size = $[8];
|
|
43
|
+
style = $[9];
|
|
44
|
+
styles = $[10];
|
|
45
|
+
variant = $[11];
|
|
46
|
+
}
|
|
47
|
+
const ctx = useTaoConfig();
|
|
48
|
+
const resolvedSize = size ?? ctx.size;
|
|
49
|
+
const resolvedVariant = variant ?? ctx.variant;
|
|
50
|
+
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
51
|
+
const ref = useRef(null);
|
|
52
|
+
let t1;
|
|
53
|
+
if ($[12] !== autoSize) {
|
|
54
|
+
t1 = ()=>{
|
|
55
|
+
const el = ref.current;
|
|
56
|
+
if (!el || !autoSize) return;
|
|
57
|
+
el.style.height = "auto";
|
|
58
|
+
const cs = getComputedStyle(el);
|
|
59
|
+
const lineHeight = Number.parseFloat(cs.lineHeight) || 0;
|
|
60
|
+
const padV = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);
|
|
61
|
+
const opts = "object" == typeof autoSize ? autoSize : {};
|
|
62
|
+
let height = el.scrollHeight;
|
|
63
|
+
if (opts.minRows) height = Math.max(height, opts.minRows * lineHeight + padV);
|
|
64
|
+
let overflowY = "hidden";
|
|
65
|
+
if (opts.maxRows) {
|
|
66
|
+
const max = opts.maxRows * lineHeight + padV;
|
|
67
|
+
if (height > max) {
|
|
68
|
+
height = max;
|
|
69
|
+
overflowY = "auto";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
el.style.height = `${height}px`;
|
|
73
|
+
el.style.overflowY = overflowY;
|
|
74
|
+
};
|
|
75
|
+
$[12] = autoSize;
|
|
76
|
+
$[13] = t1;
|
|
77
|
+
} else t1 = $[13];
|
|
78
|
+
const resize = t1;
|
|
79
|
+
let t2;
|
|
80
|
+
if ($[14] !== resize) {
|
|
81
|
+
t2 = ()=>{
|
|
82
|
+
resize();
|
|
83
|
+
};
|
|
84
|
+
$[14] = resize;
|
|
85
|
+
$[15] = t2;
|
|
86
|
+
} else t2 = $[15];
|
|
87
|
+
let t3;
|
|
88
|
+
if ($[16] !== resize || $[17] !== rest.defaultValue || $[18] !== rest.value) {
|
|
89
|
+
t3 = [
|
|
90
|
+
resize,
|
|
91
|
+
rest.value,
|
|
92
|
+
rest.defaultValue
|
|
93
|
+
];
|
|
94
|
+
$[16] = resize;
|
|
95
|
+
$[17] = rest.defaultValue;
|
|
96
|
+
$[18] = rest.value;
|
|
97
|
+
$[19] = t3;
|
|
98
|
+
} else t3 = $[19];
|
|
99
|
+
useLayoutEffect(t2, t3);
|
|
100
|
+
const t4 = classNames?.root;
|
|
101
|
+
let t5;
|
|
102
|
+
if ($[20] !== className || $[21] !== t4) {
|
|
103
|
+
t5 = cx(t4, className);
|
|
104
|
+
$[20] = className;
|
|
105
|
+
$[21] = t4;
|
|
106
|
+
$[22] = t5;
|
|
107
|
+
} else t5 = $[22];
|
|
108
|
+
const t6 = styles?.root;
|
|
109
|
+
let t7;
|
|
110
|
+
if ($[23] !== style || $[24] !== t6) {
|
|
111
|
+
t7 = {
|
|
112
|
+
...t6,
|
|
113
|
+
...style
|
|
114
|
+
};
|
|
115
|
+
$[23] = style;
|
|
116
|
+
$[24] = t6;
|
|
117
|
+
$[25] = t7;
|
|
118
|
+
} else t7 = $[25];
|
|
119
|
+
const t8 = error || void 0;
|
|
120
|
+
const t9 = resolvedDisabled || void 0;
|
|
121
|
+
const t10 = classNames?.textarea;
|
|
122
|
+
const t11 = styles?.textarea;
|
|
123
|
+
const t12 = error || void 0;
|
|
124
|
+
const t13 = autoSize ? "" : void 0;
|
|
125
|
+
let t14;
|
|
126
|
+
if ($[26] !== autoSize || $[27] !== onChange || $[28] !== resize) {
|
|
127
|
+
t14 = (e)=>{
|
|
128
|
+
if (autoSize) resize();
|
|
129
|
+
onChange?.(e);
|
|
130
|
+
};
|
|
131
|
+
$[26] = autoSize;
|
|
132
|
+
$[27] = onChange;
|
|
133
|
+
$[28] = resize;
|
|
134
|
+
$[29] = t14;
|
|
135
|
+
} else t14 = $[29];
|
|
136
|
+
let t15;
|
|
137
|
+
if ($[30] !== resolvedDisabled || $[31] !== rest || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14) {
|
|
138
|
+
t15 = /*#__PURE__*/ jsx("textarea", {
|
|
139
|
+
...rest,
|
|
140
|
+
ref: ref,
|
|
141
|
+
className: t10,
|
|
142
|
+
style: t11,
|
|
143
|
+
disabled: resolvedDisabled,
|
|
144
|
+
"aria-invalid": t12,
|
|
145
|
+
"data-tao-autosize": t13,
|
|
146
|
+
onChange: t14
|
|
147
|
+
});
|
|
148
|
+
$[30] = resolvedDisabled;
|
|
149
|
+
$[31] = rest;
|
|
150
|
+
$[32] = t10;
|
|
151
|
+
$[33] = t11;
|
|
152
|
+
$[34] = t12;
|
|
153
|
+
$[35] = t13;
|
|
154
|
+
$[36] = t14;
|
|
155
|
+
$[37] = t15;
|
|
156
|
+
} else t15 = $[37];
|
|
157
|
+
let t16;
|
|
158
|
+
if ($[38] !== resolvedSize || $[39] !== resolvedVariant || $[40] !== t15 || $[41] !== t5 || $[42] !== t7 || $[43] !== t8 || $[44] !== t9) {
|
|
159
|
+
t16 = /*#__PURE__*/ jsx("div", {
|
|
160
|
+
className: t5,
|
|
161
|
+
style: t7,
|
|
162
|
+
"data-tao-control": "",
|
|
163
|
+
"data-tao-textarea": "",
|
|
164
|
+
"data-tao-size": resolvedSize,
|
|
165
|
+
"data-tao-variant": resolvedVariant,
|
|
166
|
+
"data-tao-error": t8,
|
|
167
|
+
"data-disabled": t9,
|
|
168
|
+
children: t15
|
|
169
|
+
});
|
|
170
|
+
$[38] = resolvedSize;
|
|
171
|
+
$[39] = resolvedVariant;
|
|
172
|
+
$[40] = t15;
|
|
173
|
+
$[41] = t5;
|
|
174
|
+
$[42] = t7;
|
|
175
|
+
$[43] = t8;
|
|
176
|
+
$[44] = t9;
|
|
177
|
+
$[45] = t16;
|
|
178
|
+
} else t16 = $[45];
|
|
179
|
+
return t16;
|
|
180
|
+
}
|
|
181
|
+
export { Textarea };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { FormField, type FormFieldProps, type FormFieldSemanticPart, } from './components/form-field/form-field';
|
|
7
|
-
export { FormSection, type FormSectionProps, type FormSectionSemanticPart, } from './components/form-section/form-section';
|
|
8
|
-
export { FormActions, type FormActionsProps, type FormActionsSemanticPart, } from './components/form-actions/form-actions';
|
|
9
|
-
export { Drawer, type DrawerProps, type DrawerPlacement, type DrawerSemanticPart, } from './components/drawer/drawer';
|
|
10
|
-
export { Switch, type SwitchProps, type SwitchSemanticPart } from './components/switch/switch';
|
|
1
|
+
export { Breadcrumb, type BreadcrumbItemType, type BreadcrumbProps, type BreadcrumbSemanticPart, } from './components/breadcrumb/breadcrumb';
|
|
2
|
+
export { Button, type ButtonProps, type ButtonSemanticPart, } from './components/button/button';
|
|
3
|
+
export { Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxOptionType, type CheckboxProps, type CheckboxSemanticPart, } from './components/checkbox/checkbox';
|
|
4
|
+
export { Collapsible, type CollapsibleContentProps, type CollapsibleProps, type CollapsibleSemanticPart, type CollapsibleTriggerProps, } from './components/collapsible/collapsible';
|
|
5
|
+
export { ContextMenu, type ContextMenuProps, type ContextMenuSemanticPart, } from './components/context-menu/context-menu';
|
|
11
6
|
export { DatePicker, type DatePickerProps, } from './components/date-picker/date-picker';
|
|
12
7
|
export { RangePicker, type RangePickerProps, } from './components/date-picker/range-picker';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
8
|
+
export { Drawer, type DrawerPlacement, type DrawerProps, type DrawerResizableConfig, type DrawerSemanticPart, type DrawerSize, } from './components/drawer/drawer';
|
|
9
|
+
export { Dropdown, type DropdownButtonProps, type DropdownPlacement, type DropdownProps, type DropdownSemanticPart, type DropdownTrigger, type MenuDividerType, type MenuGroupType, type MenuItem, type MenuItemType, type MenuProps, } from './components/dropdown/dropdown';
|
|
10
|
+
export { FormActions, type FormActionsProps, type FormActionsSemanticPart, } from './components/form-actions/form-actions';
|
|
11
|
+
export { FormField, type FormFieldProps, type FormFieldSemanticPart, } from './components/form-field/form-field';
|
|
12
|
+
export { FormSection, type FormSectionProps, type FormSectionSemanticPart, } from './components/form-section/form-section';
|
|
13
|
+
export { Input, type InputProps, type InputSemanticPart, } from './components/input/input';
|
|
14
|
+
export { type AutoSizeOptions, Textarea, type TextareaProps, type TextareaSemanticPart, } from './components/textarea/textarea';
|
|
15
|
+
export { type ConfirmType, Modal, type ModalFooterRender, type ModalFuncProps, type ModalFuncReturn, type ModalHookApi, type ModalProps, type ModalSemanticPart, } from './components/modal';
|
|
16
16
|
export { Pagination, type PaginationProps, type PaginationSemanticPart, } from './components/pagination/pagination';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
17
|
+
export { Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, type RadioSemanticPart, } from './components/radio/radio';
|
|
18
|
+
export { ScrollArea, type ScrollAreaProps, type ScrollAreaSemanticPart, type ScrollAreaType, } from './components/scroll-area/scroll-area';
|
|
19
|
+
export { Select, type SelectOption, type SelectProps, } from './components/select/select';
|
|
20
|
+
export { Splitter, type SplitterPanelProps, type SplitterProps, type SplitterSemanticPart, } from './components/splitter/splitter';
|
|
21
|
+
export { Switch, type SwitchProps, type SwitchSemanticPart, } from './components/switch/switch';
|
|
22
|
+
export { type SorterResult, type SortOrder, Table, type TableColumn, type TableFilterItem, type TablePagination, type TableProps, type TableRowSelection, type TableSemanticPart, } from './components/table/table';
|
|
23
|
+
export { type TabItem, Tabs, type TabsProps, type TabsSemanticPart, } from './components/tabs/tabs';
|
|
24
|
+
export { CheckableTag, type CheckableTagProps, Tag, type TagColor, type TagProps, type TagSemanticPart, type TagVariant, } from './components/tag/tag';
|
|
25
|
+
export { FormLayout, type FormLayoutProps, } from './layouts/form-layout/form-layout';
|
|
21
26
|
export { Stack, type StackProps } from './layouts/stack/stack';
|
|
22
|
-
export { FormLayout, type FormLayoutProps } from './layouts/form-layout/form-layout';
|
|
23
27
|
export { type FormatOptions, NumberInput, type NumberInputProps, type PadDecimalsOnBlur, type UseNumberInputOptions, type UseNumberInputReturn, useNumberInput, } from './number-input';
|
|
28
|
+
export { TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoThemeConfig, type TaoVariant, useTaoConfig, } from './provider/tao-provider';
|
|
29
|
+
export { cx, type SemanticClassNames, type SemanticStyles, } from './utils/semantic';
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { cx } from "./utils/semantic.js";
|
|
1
|
+
export { Breadcrumb } from "./components/breadcrumb/breadcrumb.js";
|
|
3
2
|
export { Button } from "./components/button/button.js";
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { FormSection } from "./components/form-section/form-section.js";
|
|
8
|
-
export { FormActions } from "./components/form-actions/form-actions.js";
|
|
9
|
-
export { Drawer } from "./components/drawer/drawer.js";
|
|
10
|
-
export { Switch } from "./components/switch/switch.js";
|
|
3
|
+
export { Checkbox, CheckboxGroup } from "./components/checkbox/checkbox.js";
|
|
4
|
+
export { Collapsible } from "./components/collapsible/collapsible.js";
|
|
5
|
+
export { ContextMenu } from "./components/context-menu/context-menu.js";
|
|
11
6
|
export { DatePicker } from "./components/date-picker/date-picker.js";
|
|
12
7
|
export { RangePicker } from "./components/date-picker/range-picker.js";
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
8
|
+
export { Drawer } from "./components/drawer/drawer.js";
|
|
9
|
+
export { Dropdown } from "./components/dropdown/dropdown.js";
|
|
10
|
+
export { FormActions } from "./components/form-actions/form-actions.js";
|
|
11
|
+
export { FormField } from "./components/form-field/form-field.js";
|
|
12
|
+
export { FormSection } from "./components/form-section/form-section.js";
|
|
13
|
+
export { Input } from "./components/input/input.js";
|
|
14
|
+
export { Textarea } from "./components/textarea/textarea.js";
|
|
15
|
+
export { Modal } from "./components/modal/index.js";
|
|
16
16
|
export { Pagination } from "./components/pagination/pagination.js";
|
|
17
|
-
export {
|
|
17
|
+
export { Radio, RadioGroup } from "./components/radio/radio.js";
|
|
18
|
+
export { ScrollArea } from "./components/scroll-area/scroll-area.js";
|
|
19
|
+
export { Select } from "./components/select/select.js";
|
|
18
20
|
export { Splitter } from "./components/splitter/splitter.js";
|
|
21
|
+
export { Switch } from "./components/switch/switch.js";
|
|
22
|
+
export { Table } from "./components/table/table.js";
|
|
23
|
+
export { Tabs } from "./components/tabs/tabs.js";
|
|
19
24
|
export { CheckableTag, Tag } from "./components/tag/tag.js";
|
|
20
|
-
export { ScrollArea } from "./components/scroll-area/scroll-area.js";
|
|
21
|
-
export { Stack } from "./layouts/stack/stack.js";
|
|
22
25
|
export { FormLayout } from "./layouts/form-layout/form-layout.js";
|
|
26
|
+
export { Stack } from "./layouts/stack/stack.js";
|
|
23
27
|
export { NumberInput, useNumberInput } from "./number-input/index.js";
|
|
28
|
+
export { TaoProvider, useTaoConfig } from "./provider/tao-provider.js";
|
|
29
|
+
export { cx } from "./utils/semantic.js";
|
|
@@ -307,6 +307,8 @@
|
|
|
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;
|
|
@@ -529,8 +531,8 @@
|
|
|
529
531
|
}
|
|
530
532
|
|
|
531
533
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
534
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
535
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
536
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -541,16 +543,7 @@
|
|
|
541
543
|
}
|
|
542
544
|
|
|
543
545
|
: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] {
|
|
546
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
547
|
--tao-radius-xs: 2px;
|
|
555
548
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
549
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +626,10 @@
|
|
|
633
626
|
visibility: collapse;
|
|
634
627
|
}
|
|
635
628
|
|
|
629
|
+
.visible {
|
|
630
|
+
visibility: visible;
|
|
631
|
+
}
|
|
632
|
+
|
|
636
633
|
.absolute {
|
|
637
634
|
position: absolute;
|
|
638
635
|
}
|
|
@@ -715,6 +712,10 @@
|
|
|
715
712
|
display: inline;
|
|
716
713
|
}
|
|
717
714
|
|
|
715
|
+
.inline-flex {
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
}
|
|
718
|
+
|
|
718
719
|
.table {
|
|
719
720
|
display: table;
|
|
720
721
|
}
|
|
@@ -727,6 +728,10 @@
|
|
|
727
728
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
729
|
}
|
|
729
730
|
|
|
731
|
+
.resize {
|
|
732
|
+
resize: both;
|
|
733
|
+
}
|
|
734
|
+
|
|
730
735
|
.flex-wrap {
|
|
731
736
|
flex-wrap: wrap;
|
|
732
737
|
}
|
|
@@ -742,6 +747,14 @@
|
|
|
742
747
|
border-width: 1px;
|
|
743
748
|
}
|
|
744
749
|
|
|
750
|
+
.italic {
|
|
751
|
+
font-style: italic;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.underline {
|
|
755
|
+
text-decoration-line: underline;
|
|
756
|
+
}
|
|
757
|
+
|
|
745
758
|
.shadow {
|
|
746
759
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
760
|
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 +784,11 @@
|
|
|
771
784
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
785
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
786
|
}
|
|
787
|
+
|
|
788
|
+
.select-all {
|
|
789
|
+
-webkit-user-select: all;
|
|
790
|
+
user-select: all;
|
|
791
|
+
}
|
|
774
792
|
}
|
|
775
793
|
|
|
776
794
|
[data-tao-stack] {
|
package/dist/theme/control.css
CHANGED
|
@@ -307,6 +307,8 @@
|
|
|
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;
|
|
@@ -529,8 +531,8 @@
|
|
|
529
531
|
}
|
|
530
532
|
|
|
531
533
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
534
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
535
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
536
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -541,16 +543,7 @@
|
|
|
541
543
|
}
|
|
542
544
|
|
|
543
545
|
: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] {
|
|
546
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
547
|
--tao-radius-xs: 2px;
|
|
555
548
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
549
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +626,10 @@
|
|
|
633
626
|
visibility: collapse;
|
|
634
627
|
}
|
|
635
628
|
|
|
629
|
+
.visible {
|
|
630
|
+
visibility: visible;
|
|
631
|
+
}
|
|
632
|
+
|
|
636
633
|
.absolute {
|
|
637
634
|
position: absolute;
|
|
638
635
|
}
|
|
@@ -715,6 +712,10 @@
|
|
|
715
712
|
display: inline;
|
|
716
713
|
}
|
|
717
714
|
|
|
715
|
+
.inline-flex {
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
}
|
|
718
|
+
|
|
718
719
|
.table {
|
|
719
720
|
display: table;
|
|
720
721
|
}
|
|
@@ -727,6 +728,10 @@
|
|
|
727
728
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
729
|
}
|
|
729
730
|
|
|
731
|
+
.resize {
|
|
732
|
+
resize: both;
|
|
733
|
+
}
|
|
734
|
+
|
|
730
735
|
.flex-wrap {
|
|
731
736
|
flex-wrap: wrap;
|
|
732
737
|
}
|
|
@@ -742,6 +747,14 @@
|
|
|
742
747
|
border-width: 1px;
|
|
743
748
|
}
|
|
744
749
|
|
|
750
|
+
.italic {
|
|
751
|
+
font-style: italic;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.underline {
|
|
755
|
+
text-decoration-line: underline;
|
|
756
|
+
}
|
|
757
|
+
|
|
745
758
|
.shadow {
|
|
746
759
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
760
|
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 +784,24 @@
|
|
|
771
784
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
785
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
786
|
}
|
|
787
|
+
|
|
788
|
+
.select-all {
|
|
789
|
+
-webkit-user-select: all;
|
|
790
|
+
user-select: all;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
[data-tao-control] {
|
|
795
|
+
box-sizing: border-box;
|
|
796
|
+
width: var(--tao-control-width);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
[data-tao-control][data-tao-range-trigger] {
|
|
800
|
+
width: var(--tao-control-range-width);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
[data-tao-form-field] [data-tao-control] {
|
|
804
|
+
width: 100%;
|
|
774
805
|
}
|
|
775
806
|
|
|
776
807
|
[data-tao-control] {
|
|
@@ -778,8 +809,8 @@
|
|
|
778
809
|
}
|
|
779
810
|
|
|
780
811
|
[data-tao-control][data-tao-variant="outlined"] {
|
|
781
|
-
background: var(--tao-color-bg-container);
|
|
782
812
|
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
813
|
+
background: none;
|
|
783
814
|
}
|
|
784
815
|
|
|
785
816
|
[data-tao-control][data-tao-variant="outlined"]:hover:not([data-disabled]):not(:focus-within):not([data-state="open"]) {
|
package/dist/theme/theme.css
CHANGED
|
@@ -307,6 +307,8 @@
|
|
|
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;
|
|
@@ -529,8 +531,8 @@
|
|
|
529
531
|
}
|
|
530
532
|
|
|
531
533
|
:root, [data-tao-provider] {
|
|
532
|
-
--tao-color-bg-container:
|
|
533
|
-
--tao-color-bg-elevated:
|
|
534
|
+
--tao-color-bg-container: oklch(100% 0 0);
|
|
535
|
+
--tao-color-bg-elevated: oklch(100% 0 0);
|
|
534
536
|
--tao-color-border: var(--tao-color-text-base);
|
|
535
537
|
}
|
|
536
538
|
|
|
@@ -541,16 +543,7 @@
|
|
|
541
543
|
}
|
|
542
544
|
|
|
543
545
|
: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] {
|
|
546
|
+
--tao-color-border-secondary: #0000170b;
|
|
554
547
|
--tao-radius-xs: 2px;
|
|
555
548
|
--tao-radius-sm: calc(var(--tao-radius) - 2px);
|
|
556
549
|
--tao-radius-md: var(--tao-radius);
|
|
@@ -633,6 +626,10 @@
|
|
|
633
626
|
visibility: collapse;
|
|
634
627
|
}
|
|
635
628
|
|
|
629
|
+
.visible {
|
|
630
|
+
visibility: visible;
|
|
631
|
+
}
|
|
632
|
+
|
|
636
633
|
.absolute {
|
|
637
634
|
position: absolute;
|
|
638
635
|
}
|
|
@@ -715,6 +712,10 @@
|
|
|
715
712
|
display: inline;
|
|
716
713
|
}
|
|
717
714
|
|
|
715
|
+
.inline-flex {
|
|
716
|
+
display: inline-flex;
|
|
717
|
+
}
|
|
718
|
+
|
|
718
719
|
.table {
|
|
719
720
|
display: table;
|
|
720
721
|
}
|
|
@@ -727,6 +728,10 @@
|
|
|
727
728
|
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
728
729
|
}
|
|
729
730
|
|
|
731
|
+
.resize {
|
|
732
|
+
resize: both;
|
|
733
|
+
}
|
|
734
|
+
|
|
730
735
|
.flex-wrap {
|
|
731
736
|
flex-wrap: wrap;
|
|
732
737
|
}
|
|
@@ -742,6 +747,14 @@
|
|
|
742
747
|
border-width: 1px;
|
|
743
748
|
}
|
|
744
749
|
|
|
750
|
+
.italic {
|
|
751
|
+
font-style: italic;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.underline {
|
|
755
|
+
text-decoration-line: underline;
|
|
756
|
+
}
|
|
757
|
+
|
|
745
758
|
.shadow {
|
|
746
759
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);
|
|
747
760
|
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 +784,11 @@
|
|
|
771
784
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
772
785
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
773
786
|
}
|
|
787
|
+
|
|
788
|
+
.select-all {
|
|
789
|
+
-webkit-user-select: all;
|
|
790
|
+
user-select: all;
|
|
791
|
+
}
|
|
774
792
|
}
|
|
775
793
|
|
|
776
794
|
@property --tw-rotate-x {
|
package/llms.txt
CHANGED
|
@@ -13,7 +13,7 @@ Module format: ESM only. Types and CSS ship alongside the JS; component CSS is i
|
|
|
13
13
|
|
|
14
14
|
## Core concepts
|
|
15
15
|
|
|
16
|
-
- **TaoProvider**: wrap the app once. Provides `size` (`'small' | '
|
|
16
|
+
- **TaoProvider**: wrap the app once. Provides `size` (`'small' | 'medium' | 'large'`), `disabled`, and `variant` (`'outlined' | 'filled' | 'borderless'`) defaults to all descendants, plus theme tokens. A local prop on a component overrides the provider value. Hook: `useTaoConfig()`.
|
|
17
17
|
- **Theming**: a small seed token set (`TaoSeedToken`) is expanded into a full theme. Pure-CSS-computable values use `calc()`/`color-mix()` with OKLCH; non-linear values (radius steps, font-size log scale, control heights) are computed in JS and injected by `TaoProvider`. CSS variables are prefixed `--tao-*`; data attributes are `data-tao-*`.
|
|
18
18
|
- **Semantic DOM**: every component takes optional `classNames?: SemanticClassNames<Part>` and `styles?: SemanticStyles<Part>`, where `Part` is a component-specific union (e.g. `'root' | 'header' | 'body'`, dotted for nested parts like `'header.cell'`). The top-level `className` prop merges into the `root` part. Helper `cx` is exported.
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ import { TaoProvider, Input, Select, Switch } from '@rockshin/tao-ui';
|
|
|
24
24
|
|
|
25
25
|
function App() {
|
|
26
26
|
return (
|
|
27
|
-
<TaoProvider size="
|
|
27
|
+
<TaoProvider size="medium">
|
|
28
28
|
<Input placeholder="Search" />
|
|
29
29
|
<Select options={[{ label: 'A', value: 'a' }]} />
|
|
30
30
|
<Switch defaultChecked />
|
|
@@ -46,10 +46,10 @@ Provider & utilities:
|
|
|
46
46
|
Components (each exports `<Name>Props` and, where applicable, `<Name>SemanticPart`):
|
|
47
47
|
- General: `Button`
|
|
48
48
|
- Layout: `Stack`, `FormLayout`, `Splitter` (+ `SplitterPanelProps`)
|
|
49
|
-
- Navigation: `Tabs` (+ `TabItem`), `Pagination`
|
|
50
|
-
- Data Entry: `Input`, `Select` (+ `SelectOption`), `Checkbox` / `CheckboxGroup` (+ `CheckboxOptionType`), `Radio` / `RadioGroup` (+ `RadioOptionType`), `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions`
|
|
51
|
-
- Data Display: `Table` (+ `TableColumn`, `TableRowSelection`, `TableFilterItem`, `TablePagination`, `SortOrder`, `SorterResult`), `Tag` / `CheckableTag` (+ `TagColor`, `TagVariant`), `ScrollArea` (+ `ScrollAreaType`)
|
|
52
|
-
- Feedback: `Drawer` (+ `DrawerPlacement`)
|
|
49
|
+
- Navigation: `Tabs` (+ `TabItem`), `Pagination`, `Breadcrumb` (+ `BreadcrumbItemType`), `Dropdown` (+ `DropdownButtonProps`, `DropdownPlacement`, `DropdownTrigger`, and menu-config types `MenuProps`, `MenuItem`, `MenuItemType`, `MenuGroupType`, `MenuDividerType`), `ContextMenu`
|
|
50
|
+
- Data Entry: `Input`, `Textarea` (+ `AutoSizeOptions`), `Select` (+ `SelectOption`), `Checkbox` / `CheckboxGroup` (+ `CheckboxOptionType`), `Radio` / `RadioGroup` (+ `RadioOptionType`), `Switch`, `DatePicker`, `RangePicker`, `FormField`, `FormSection`, `FormActions`
|
|
51
|
+
- Data Display: `Table` (+ `TableColumn`, `TableRowSelection`, `TableFilterItem`, `TablePagination`, `SortOrder`, `SorterResult`), `Tag` / `CheckableTag` (+ `TagColor`, `TagVariant`), `ScrollArea` (+ `ScrollAreaType`), `Collapsible` (+ `CollapsibleTriggerProps`, `CollapsibleContentProps`)
|
|
52
|
+
- Feedback: `Drawer` (+ `DrawerPlacement`, `DrawerSize`, `DrawerResizableConfig`), `Modal` (+ `ModalSemanticPart`; static helpers `Modal.confirm/info/success/error/warning`, hook `Modal.useModal()`, `Modal.destroyAll()`; types `ModalHookApi`, `ModalFuncProps`, `ModalFuncReturn`, `ModalFooterRender`, `ConfirmType`)
|
|
53
53
|
|
|
54
54
|
Headless:
|
|
55
55
|
- `useNumberInput`, `NumberInput` (+ `NumberInputProps`, `UseNumberInputOptions`, `UseNumberInputReturn`, `FormatOptions`, `PadDecimalsOnBlur`)
|
|
@@ -59,6 +59,7 @@ Headless:
|
|
|
59
59
|
- Import everything from the package root `@rockshin/tao-ui`; there are no deep sub-path entry points.
|
|
60
60
|
- Do not hand-write internal class names; customize via `classNames`/`styles` semantic parts.
|
|
61
61
|
- Prefer setting `size`/`disabled`/`variant` on `TaoProvider` for app-wide defaults; override per-component only when needed.
|
|
62
|
+
- `Modal` follows the antd pattern: render `<Modal open onCancel ...>` for controlled dialogs, or call `Modal.confirm({ title, onOk })` / `Modal.info|success|error|warning` for one-off dialogs. Inside components prefer `const [modal, contextHolder] = Modal.useModal()` (render `contextHolder`) so dialogs read the surrounding `TaoProvider` context.
|
|
62
63
|
- Override theme by passing a partial seed to `TaoProvider`'s theme config rather than overriding `--tao-*` variables directly.
|
|
63
64
|
|
|
64
65
|
## Source
|