@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,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,30 @@
|
|
|
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 ConfirmType, Modal, type ModalFooterRender, type ModalFuncProps, type ModalFuncReturn, type ModalHookApi, type ModalProps, type ModalSemanticPart, } from './components/modal';
|
|
16
15
|
export { Pagination, type PaginationProps, type PaginationSemanticPart, } from './components/pagination/pagination';
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
16
|
+
export { Radio, RadioGroup, type RadioGroupProps, type RadioOptionType, type RadioProps, type RadioSemanticPart, } from './components/radio/radio';
|
|
17
|
+
export { ScrollArea, type ScrollAreaProps, type ScrollAreaSemanticPart, type ScrollAreaType, } from './components/scroll-area/scroll-area';
|
|
18
|
+
export { ChevronsUpDownIcon, Select, type SelectOption, type SelectPlacement, type SelectProps, type SelectSemanticPart, } from './components/select/select';
|
|
19
|
+
export { Spinner, type SpinnerProps, type SpinnerSemanticPart, } from './components/spinner/spinner';
|
|
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 { type AutoSizeOptions, Textarea, type TextareaProps, type TextareaSemanticPart, } from './components/textarea/textarea';
|
|
26
|
+
export { FormLayout, type FormLayoutProps, } from './layouts/form-layout/form-layout';
|
|
21
27
|
export { Stack, type StackProps } from './layouts/stack/stack';
|
|
22
|
-
export { FormLayout, type FormLayoutProps } from './layouts/form-layout/form-layout';
|
|
23
28
|
export { type FormatOptions, NumberInput, type NumberInputProps, type PadDecimalsOnBlur, type UseNumberInputOptions, type UseNumberInputReturn, useNumberInput, } from './number-input';
|
|
29
|
+
export { TaoPortalScope, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoThemeConfig, type TaoVariant, useTaoConfig, } from './provider/tao-provider';
|
|
30
|
+
export { cx, type SemanticClassNames, type SemanticStyles, } from './utils/semantic';
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
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 { Modal } from "./components/modal/index.js";
|
|
16
15
|
export { Pagination } from "./components/pagination/pagination.js";
|
|
17
|
-
export {
|
|
16
|
+
export { Radio, RadioGroup } from "./components/radio/radio.js";
|
|
17
|
+
export { ScrollArea } from "./components/scroll-area/scroll-area.js";
|
|
18
|
+
export { ChevronsUpDownIcon, Select } from "./components/select/select.js";
|
|
19
|
+
export { Spinner } from "./components/spinner/spinner.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 {
|
|
21
|
-
export { Stack } from "./layouts/stack/stack.js";
|
|
25
|
+
export { Textarea } from "./components/textarea/textarea.js";
|
|
22
26
|
export { FormLayout } from "./layouts/form-layout/form-layout.js";
|
|
27
|
+
export { Stack } from "./layouts/stack/stack.js";
|
|
23
28
|
export { NumberInput, useNumberInput } from "./number-input/index.js";
|
|
29
|
+
export { TaoPortalScope, TaoProvider, useTaoConfig } from "./provider/tao-provider.js";
|
|
30
|
+
export { cx } from "./utils/semantic.js";
|
|
@@ -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-stack] {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
export interface TaoSeedToken {
|
|
3
3
|
colorPrimary?: string;
|
|
4
4
|
colorSuccess?: string;
|
|
@@ -29,8 +29,24 @@ interface TaoConfigContextValue {
|
|
|
29
29
|
size: TaoSize;
|
|
30
30
|
disabled: boolean;
|
|
31
31
|
variant: TaoVariant;
|
|
32
|
+
/**
|
|
33
|
+
* Merged CSS custom-property overrides from this provider and all ancestors.
|
|
34
|
+
* Carried through context so portaled layers (Modal/Drawer/Select dropdown…)
|
|
35
|
+
* — which render outside the provider's DOM subtree — can re-apply the theme.
|
|
36
|
+
*/
|
|
37
|
+
tokenStyle: CSSProperties;
|
|
32
38
|
}
|
|
33
39
|
export declare function useTaoConfig(): TaoConfigContextValue;
|
|
40
|
+
/**
|
|
41
|
+
* Re-establishes the theme token scope inside a portal. Floating components
|
|
42
|
+
* portal their popup to document.body, escaping the `[data-tao-provider]`
|
|
43
|
+
* element that carries custom token overrides; wrapping the portal content in
|
|
44
|
+
* this component re-applies those overrides so colors/sizes stay consistent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function TaoPortalScope({ children, style, }: {
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
style?: CSSProperties;
|
|
49
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
50
|
export interface TaoProviderProps {
|
|
35
51
|
children: ReactNode;
|
|
36
52
|
theme?: TaoThemeConfig;
|
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { createContext, useContext, useMemo } from "react";
|
|
3
4
|
const TaoConfigContext = /*#__PURE__*/ createContext({
|
|
4
5
|
size: 'medium',
|
|
5
6
|
disabled: false,
|
|
6
|
-
variant: 'outlined'
|
|
7
|
+
variant: 'outlined',
|
|
8
|
+
tokenStyle: {}
|
|
7
9
|
});
|
|
8
10
|
function useTaoConfig() {
|
|
9
11
|
return useContext(TaoConfigContext);
|
|
10
12
|
}
|
|
13
|
+
function TaoPortalScope(t0) {
|
|
14
|
+
const $ = c(6);
|
|
15
|
+
const { children, style } = t0;
|
|
16
|
+
const { tokenStyle } = useTaoConfig();
|
|
17
|
+
let t1;
|
|
18
|
+
if ($[0] !== style || $[1] !== tokenStyle) {
|
|
19
|
+
t1 = {
|
|
20
|
+
...tokenStyle,
|
|
21
|
+
...style
|
|
22
|
+
};
|
|
23
|
+
$[0] = style;
|
|
24
|
+
$[1] = tokenStyle;
|
|
25
|
+
$[2] = t1;
|
|
26
|
+
} else t1 = $[2];
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[3] !== children || $[4] !== t1) {
|
|
29
|
+
t2 = /*#__PURE__*/ jsx("div", {
|
|
30
|
+
"data-tao-provider": "",
|
|
31
|
+
style: t1,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
34
|
+
$[3] = children;
|
|
35
|
+
$[4] = t1;
|
|
36
|
+
$[5] = t2;
|
|
37
|
+
} else t2 = $[5];
|
|
38
|
+
return t2;
|
|
39
|
+
}
|
|
11
40
|
const TOKEN_TO_VAR = {
|
|
12
41
|
colorPrimary: '--tao-color-primary',
|
|
13
42
|
colorSuccess: '--tao-color-success',
|
|
@@ -28,18 +57,7 @@ const TOKEN_TO_VAR_PX = {
|
|
|
28
57
|
function TaoProvider({ theme, size, disabled, variant, children }) {
|
|
29
58
|
const parentConfig = useContext(TaoConfigContext);
|
|
30
59
|
const inherit = theme?.inherit ?? true;
|
|
31
|
-
const
|
|
32
|
-
size: size ?? (inherit ? parentConfig.size : 'medium'),
|
|
33
|
-
disabled: disabled ?? (inherit ? parentConfig.disabled : false),
|
|
34
|
-
variant: variant ?? (inherit ? parentConfig.variant : 'outlined')
|
|
35
|
-
}), [
|
|
36
|
-
size,
|
|
37
|
-
disabled,
|
|
38
|
-
variant,
|
|
39
|
-
parentConfig,
|
|
40
|
-
inherit
|
|
41
|
-
]);
|
|
42
|
-
const style = useMemo(()=>{
|
|
60
|
+
const ownVars = useMemo(()=>{
|
|
43
61
|
if (!theme?.token) return;
|
|
44
62
|
const vars = {};
|
|
45
63
|
const t = theme.token;
|
|
@@ -55,13 +73,33 @@ function TaoProvider({ theme, size, disabled, variant, children }) {
|
|
|
55
73
|
}, [
|
|
56
74
|
theme?.token
|
|
57
75
|
]);
|
|
76
|
+
const tokenStyle = useMemo(()=>({
|
|
77
|
+
...parentConfig.tokenStyle,
|
|
78
|
+
...ownVars
|
|
79
|
+
}), [
|
|
80
|
+
parentConfig.tokenStyle,
|
|
81
|
+
ownVars
|
|
82
|
+
]);
|
|
83
|
+
const config = useMemo(()=>({
|
|
84
|
+
size: size ?? (inherit ? parentConfig.size : 'medium'),
|
|
85
|
+
disabled: disabled ?? (inherit ? parentConfig.disabled : false),
|
|
86
|
+
variant: variant ?? (inherit ? parentConfig.variant : 'outlined'),
|
|
87
|
+
tokenStyle
|
|
88
|
+
}), [
|
|
89
|
+
size,
|
|
90
|
+
disabled,
|
|
91
|
+
variant,
|
|
92
|
+
parentConfig,
|
|
93
|
+
inherit,
|
|
94
|
+
tokenStyle
|
|
95
|
+
]);
|
|
58
96
|
return /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
|
|
59
97
|
value: config,
|
|
60
98
|
children: /*#__PURE__*/ jsx("div", {
|
|
61
|
-
style:
|
|
99
|
+
style: ownVars,
|
|
62
100
|
"data-tao-provider": "",
|
|
63
101
|
children: children
|
|
64
102
|
})
|
|
65
103
|
});
|
|
66
104
|
}
|
|
67
|
-
export { TaoProvider, useTaoConfig };
|
|
105
|
+
export { TaoPortalScope, TaoProvider, useTaoConfig };
|