@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,39 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
|
+
import './collapsible.css';
|
|
4
|
+
export type CollapsibleSemanticPart = 'root' | 'trigger' | 'content';
|
|
5
|
+
export interface CollapsibleProps {
|
|
6
|
+
/** Controlled open state. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** Uncontrolled initial open state. Defaults to `false`. */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Disable the trigger. Falls back to TaoProvider's `disabled`. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/** Merged into the root element. */
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
classNames?: SemanticClassNames<CollapsibleSemanticPart>;
|
|
18
|
+
styles?: SemanticStyles<CollapsibleSemanticPart>;
|
|
19
|
+
}
|
|
20
|
+
export interface CollapsibleTriggerProps {
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/** Render the child element as the trigger instead of a default button. */
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: CSSProperties;
|
|
26
|
+
}
|
|
27
|
+
export interface CollapsibleContentProps {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: CSSProperties;
|
|
31
|
+
}
|
|
32
|
+
export declare function Collapsible(props: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace Collapsible {
|
|
34
|
+
var Trigger: typeof CollapsibleTrigger;
|
|
35
|
+
var Content: typeof CollapsibleContent;
|
|
36
|
+
}
|
|
37
|
+
declare function CollapsibleTrigger(props: CollapsibleTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function CollapsibleContent(props: CollapsibleContentProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { createContext, useContext, useState } from "react";
|
|
4
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { cx } from "../../utils/semantic.js";
|
|
6
|
+
import "./collapsible.css";
|
|
7
|
+
import * as __rspack_external__radix_ui_react_collapsible_4615ddd5 from "@radix-ui/react-collapsible";
|
|
8
|
+
const Ctx = /*#__PURE__*/ createContext({});
|
|
9
|
+
function Collapsible(props) {
|
|
10
|
+
const $ = c(22);
|
|
11
|
+
const { open, defaultOpen, onOpenChange, disabled, children, className, style, classNames, styles } = props;
|
|
12
|
+
const { disabled: ctxDisabled } = useTaoConfig();
|
|
13
|
+
const resolvedDisabled = disabled ?? ctxDisabled;
|
|
14
|
+
const isControlled = null != open;
|
|
15
|
+
const [openInternal, setOpenInternal] = useState(defaultOpen ?? false);
|
|
16
|
+
const realOpen = isControlled ? open : openInternal;
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] !== isControlled || $[1] !== onOpenChange) {
|
|
19
|
+
t0 = (next)=>{
|
|
20
|
+
if (!isControlled) setOpenInternal(next);
|
|
21
|
+
onOpenChange?.(next);
|
|
22
|
+
};
|
|
23
|
+
$[0] = isControlled;
|
|
24
|
+
$[1] = onOpenChange;
|
|
25
|
+
$[2] = t0;
|
|
26
|
+
} else t0 = $[2];
|
|
27
|
+
const setOpen = t0;
|
|
28
|
+
let t1;
|
|
29
|
+
if ($[3] !== classNames || $[4] !== styles) {
|
|
30
|
+
t1 = {
|
|
31
|
+
classNames,
|
|
32
|
+
styles
|
|
33
|
+
};
|
|
34
|
+
$[3] = classNames;
|
|
35
|
+
$[4] = styles;
|
|
36
|
+
$[5] = t1;
|
|
37
|
+
} else t1 = $[5];
|
|
38
|
+
const t2 = classNames?.root;
|
|
39
|
+
let t3;
|
|
40
|
+
if ($[6] !== className || $[7] !== t2) {
|
|
41
|
+
t3 = cx(t2, className);
|
|
42
|
+
$[6] = className;
|
|
43
|
+
$[7] = t2;
|
|
44
|
+
$[8] = t3;
|
|
45
|
+
} else t3 = $[8];
|
|
46
|
+
const t4 = styles?.root;
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[9] !== style || $[10] !== t4) {
|
|
49
|
+
t5 = {
|
|
50
|
+
...t4,
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
$[9] = style;
|
|
54
|
+
$[10] = t4;
|
|
55
|
+
$[11] = t5;
|
|
56
|
+
} else t5 = $[11];
|
|
57
|
+
let t6;
|
|
58
|
+
if ($[12] !== children || $[13] !== realOpen || $[14] !== resolvedDisabled || $[15] !== setOpen || $[16] !== t3 || $[17] !== t5) {
|
|
59
|
+
t6 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4615ddd5.Root, {
|
|
60
|
+
open: realOpen,
|
|
61
|
+
onOpenChange: setOpen,
|
|
62
|
+
disabled: resolvedDisabled,
|
|
63
|
+
"data-tao-collapsible": "",
|
|
64
|
+
className: t3,
|
|
65
|
+
style: t5,
|
|
66
|
+
children: children
|
|
67
|
+
});
|
|
68
|
+
$[12] = children;
|
|
69
|
+
$[13] = realOpen;
|
|
70
|
+
$[14] = resolvedDisabled;
|
|
71
|
+
$[15] = setOpen;
|
|
72
|
+
$[16] = t3;
|
|
73
|
+
$[17] = t5;
|
|
74
|
+
$[18] = t6;
|
|
75
|
+
} else t6 = $[18];
|
|
76
|
+
let t7;
|
|
77
|
+
if ($[19] !== t1 || $[20] !== t6) {
|
|
78
|
+
t7 = /*#__PURE__*/ jsx(Ctx.Provider, {
|
|
79
|
+
value: t1,
|
|
80
|
+
children: t6
|
|
81
|
+
});
|
|
82
|
+
$[19] = t1;
|
|
83
|
+
$[20] = t6;
|
|
84
|
+
$[21] = t7;
|
|
85
|
+
} else t7 = $[21];
|
|
86
|
+
return t7;
|
|
87
|
+
}
|
|
88
|
+
function CollapsibleTrigger(props) {
|
|
89
|
+
const $ = c(11);
|
|
90
|
+
const { children, asChild, className, style } = props;
|
|
91
|
+
const { classNames, styles } = useContext(Ctx);
|
|
92
|
+
const t0 = classNames?.trigger;
|
|
93
|
+
let t1;
|
|
94
|
+
if ($[0] !== className || $[1] !== t0) {
|
|
95
|
+
t1 = cx(t0, className);
|
|
96
|
+
$[0] = className;
|
|
97
|
+
$[1] = t0;
|
|
98
|
+
$[2] = t1;
|
|
99
|
+
} else t1 = $[2];
|
|
100
|
+
const t2 = styles?.trigger;
|
|
101
|
+
let t3;
|
|
102
|
+
if ($[3] !== style || $[4] !== t2) {
|
|
103
|
+
t3 = {
|
|
104
|
+
...t2,
|
|
105
|
+
...style
|
|
106
|
+
};
|
|
107
|
+
$[3] = style;
|
|
108
|
+
$[4] = t2;
|
|
109
|
+
$[5] = t3;
|
|
110
|
+
} else t3 = $[5];
|
|
111
|
+
let t4;
|
|
112
|
+
if ($[6] !== asChild || $[7] !== children || $[8] !== t1 || $[9] !== t3) {
|
|
113
|
+
t4 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4615ddd5.Trigger, {
|
|
114
|
+
asChild: asChild,
|
|
115
|
+
"data-tao-collapsible-trigger": "",
|
|
116
|
+
className: t1,
|
|
117
|
+
style: t3,
|
|
118
|
+
children: children
|
|
119
|
+
});
|
|
120
|
+
$[6] = asChild;
|
|
121
|
+
$[7] = children;
|
|
122
|
+
$[8] = t1;
|
|
123
|
+
$[9] = t3;
|
|
124
|
+
$[10] = t4;
|
|
125
|
+
} else t4 = $[10];
|
|
126
|
+
return t4;
|
|
127
|
+
}
|
|
128
|
+
function CollapsibleContent(props) {
|
|
129
|
+
const $ = c(10);
|
|
130
|
+
const { children, className, style } = props;
|
|
131
|
+
const { classNames, styles } = useContext(Ctx);
|
|
132
|
+
const t0 = classNames?.content;
|
|
133
|
+
let t1;
|
|
134
|
+
if ($[0] !== className || $[1] !== t0) {
|
|
135
|
+
t1 = cx(t0, className);
|
|
136
|
+
$[0] = className;
|
|
137
|
+
$[1] = t0;
|
|
138
|
+
$[2] = t1;
|
|
139
|
+
} else t1 = $[2];
|
|
140
|
+
const t2 = styles?.content;
|
|
141
|
+
let t3;
|
|
142
|
+
if ($[3] !== style || $[4] !== t2) {
|
|
143
|
+
t3 = {
|
|
144
|
+
...t2,
|
|
145
|
+
...style
|
|
146
|
+
};
|
|
147
|
+
$[3] = style;
|
|
148
|
+
$[4] = t2;
|
|
149
|
+
$[5] = t3;
|
|
150
|
+
} else t3 = $[5];
|
|
151
|
+
let t4;
|
|
152
|
+
if ($[6] !== children || $[7] !== t1 || $[8] !== t3) {
|
|
153
|
+
t4 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4615ddd5.Content, {
|
|
154
|
+
"data-tao-collapsible-content": "",
|
|
155
|
+
className: t1,
|
|
156
|
+
style: t3,
|
|
157
|
+
children: children
|
|
158
|
+
});
|
|
159
|
+
$[6] = children;
|
|
160
|
+
$[7] = t1;
|
|
161
|
+
$[8] = t3;
|
|
162
|
+
$[9] = t4;
|
|
163
|
+
} else t4 = $[9];
|
|
164
|
+
return t4;
|
|
165
|
+
}
|
|
166
|
+
Collapsible.Trigger = CollapsibleTrigger;
|
|
167
|
+
Collapsible.Content = CollapsibleContent;
|
|
168
|
+
export { Collapsible };
|