@rockshin/tao-ui 0.0.24 → 0.0.26
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/README.md +17 -6
- package/component-manifest.json +534 -6
- package/dist/components/alert/alert.css +120 -0
- package/dist/components/alert/alert.d.ts +20 -0
- package/dist/components/alert/alert.js +185 -0
- package/dist/components/button/button.css +19 -18
- package/dist/components/button/button.d.ts +8 -0
- package/dist/components/date-picker/date-picker.js +1 -1
- package/dist/components/date-picker/range-picker.js +1 -1
- package/dist/components/dropdown/dropdown.css +22 -1
- package/dist/components/dropdown/dropdown.js +4 -3
- package/dist/components/form/form-context.d.ts +7 -0
- package/dist/components/form/form-context.js +8 -0
- package/dist/components/form/form-item.d.ts +55 -0
- package/dist/components/form/form-item.js +131 -0
- package/dist/components/form/form.css +22 -0
- package/dist/components/form/form.d.ts +35 -0
- package/dist/components/form/form.js +125 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +1 -0
- package/dist/components/form-field/form-field-view.d.ts +30 -0
- package/dist/components/form-field/form-field-view.js +154 -0
- package/dist/components/form-field/form-field.d.ts +2 -2
- package/dist/components/form-field/form-field.js +29 -137
- package/dist/components/form-field/form.css +17 -7
- package/dist/components/input/input.css +18 -8
- package/dist/components/modal/confirm-dialog.js +14 -111
- package/dist/components/modal/modal.d.ts +7 -1
- package/dist/components/modal/modal.js +205 -195
- package/dist/components/popconfirm/popconfirm.css +44 -0
- package/dist/components/popconfirm/popconfirm.d.ts +41 -0
- package/dist/components/popconfirm/popconfirm.js +238 -0
- package/dist/components/popover/popover.css +105 -0
- package/dist/components/popover/popover.d.ts +41 -0
- package/dist/components/popover/popover.js +412 -0
- package/dist/components/select/select.js +1 -1
- package/dist/components/status-icon/status-icon.d.ts +5 -0
- package/dist/components/status-icon/status-icon.js +77 -0
- package/dist/components/table/table-types.d.ts +7 -0
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +296 -283
- package/dist/components/tooltip/tooltip.css +93 -0
- package/dist/components/tooltip/tooltip.d.ts +33 -0
- package/dist/components/tooltip/tooltip.js +226 -0
- package/dist/docs/components/alert.doc.d.ts +29 -0
- package/dist/docs/components/alert.doc.js +93 -0
- package/dist/docs/components/form.doc.d.ts +29 -0
- package/dist/docs/components/form.doc.js +71 -0
- package/dist/docs/components/modal.doc.d.ts +6 -0
- package/dist/docs/components/modal.doc.js +9 -1
- package/dist/docs/components/popconfirm.doc.d.ts +29 -0
- package/dist/docs/components/popconfirm.doc.js +132 -0
- package/dist/docs/components/popover.doc.d.ts +29 -0
- package/dist/docs/components/popover.doc.js +121 -0
- package/dist/docs/components/stack.doc.d.ts +6 -0
- package/dist/docs/components/stack.doc.js +23 -2
- package/dist/docs/components/table.doc.js +2 -1
- package/dist/docs/components/tao-provider.doc.js +11 -1
- package/dist/docs/components/tooltip.doc.d.ts +37 -0
- package/dist/docs/components/tooltip.doc.js +76 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -1
- package/dist/layouts/stack/stack.d.ts +12 -3
- package/dist/layouts/stack/stack.js +60 -34
- package/dist/provider/tao-provider.d.ts +71 -0
- package/dist/provider/tao-provider.js +166 -120
- package/dist/theme/control.css +12 -12
- package/dist/theme/theme.css +23 -0
- package/dist/utils/breakpoint.d.ts +31 -0
- package/dist/utils/breakpoint.js +80 -0
- package/dist/utils/overlay.d.ts +19 -0
- package/dist/utils/overlay.js +41 -0
- package/llms.txt +68 -3
- package/package.json +6 -4
- package/dist/components/select/use-is-mobile.d.ts +0 -1
- package/dist/components/select/use-is-mobile.js +0 -27
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
[data-tao-tooltip-content] {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
max-width: 260px;
|
|
4
|
+
padding-block: 6px;
|
|
5
|
+
padding-inline: var(--tao-padding-xs);
|
|
6
|
+
font-family: var(--tao-font-family);
|
|
7
|
+
font-size: var(--tao-font-size-xs);
|
|
8
|
+
line-height: var(--tao-line-height-sm);
|
|
9
|
+
color: var(--tao-color-text);
|
|
10
|
+
background: var(--tao-color-bg-elevated);
|
|
11
|
+
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
12
|
+
border-radius: var(--tao-radius-sm);
|
|
13
|
+
box-shadow: var(--tao-box-shadow-secondary);
|
|
14
|
+
z-index: var(--tao-z-index-popup);
|
|
15
|
+
animation-duration: var(--tao-motion-duration-fast);
|
|
16
|
+
animation-timing-function: var(--tao-motion-ease-out-quint);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-tao-tooltip-content][data-state="delayed-open"], [data-tao-tooltip-content][data-state="instant-open"] {
|
|
20
|
+
animation-name: tao-tooltip-in;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-tao-tooltip-content][data-state="closed"] {
|
|
24
|
+
animation-name: tao-tooltip-out;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-tao-tooltip-content][data-side="top"] {
|
|
28
|
+
--tao-tooltip-from-y: 4px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-tao-tooltip-content][data-side="bottom"] {
|
|
32
|
+
--tao-tooltip-from-y: -4px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-tao-tooltip-content][data-side="left"] {
|
|
36
|
+
--tao-tooltip-from-x: 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-tao-tooltip-content][data-side="right"] {
|
|
40
|
+
--tao-tooltip-from-x: -4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes tao-tooltip-in {
|
|
44
|
+
from {
|
|
45
|
+
opacity: 0;
|
|
46
|
+
transform: translate(var(--tao-tooltip-from-x, 0),
|
|
47
|
+
var(--tao-tooltip-from-y, 0));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
to {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
transform: translate(0);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes tao-tooltip-out {
|
|
57
|
+
from {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
transform: translate(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
to {
|
|
63
|
+
opacity: 0;
|
|
64
|
+
transform: translate(var(--tao-tooltip-from-x, 0),
|
|
65
|
+
var(--tao-tooltip-from-y, 0));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-tao-tooltip-arrow] {
|
|
70
|
+
width: 10px;
|
|
71
|
+
height: 5px;
|
|
72
|
+
display: block;
|
|
73
|
+
position: relative;
|
|
74
|
+
overflow: visible;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[data-tao-tooltip-arrow]:before {
|
|
78
|
+
content: "";
|
|
79
|
+
box-sizing: border-box;
|
|
80
|
+
background: var(--tao-tooltip-arrow-bg, var(--tao-color-bg-elevated));
|
|
81
|
+
border: var(--tao-line-width) solid var(--tao-color-border);
|
|
82
|
+
width: 7px;
|
|
83
|
+
height: 7px;
|
|
84
|
+
box-shadow: 2px 2px 4px var(--tao-color-shadow-hint);
|
|
85
|
+
border-top: none;
|
|
86
|
+
border-left: none;
|
|
87
|
+
border-bottom-right-radius: 2px;
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: -4px;
|
|
90
|
+
left: 50%;
|
|
91
|
+
transform: translateX(-50%) rotate(45deg);
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
3
|
+
import './tooltip.css';
|
|
4
|
+
export type TooltipSemanticPart = 'content' | 'arrow';
|
|
5
|
+
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
export interface TooltipProps {
|
|
7
|
+
/** Tooltip content. Renders nothing (and disables the tooltip) when null/undefined/''. */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/** Popup side relative to the trigger. Defaults to 'top'. */
|
|
10
|
+
placement?: TooltipPlacement;
|
|
11
|
+
/** Show the arrow pointing at the trigger. Defaults to true. */
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
/** Hover delay in seconds before opening. Defaults to 0.1. Focus opens immediately. */
|
|
17
|
+
mouseEnterDelay?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Delay in seconds before a pointer-leave closes the tooltip. Defaults to
|
|
20
|
+
* 0.1 (antd parity) — re-entering the trigger or content before the
|
|
21
|
+
* deadline cancels the close. Esc / focus-blur closes stay immediate.
|
|
22
|
+
*/
|
|
23
|
+
mouseLeaveDelay?: number;
|
|
24
|
+
/** Custom content background color. */
|
|
25
|
+
color?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
classNames?: SemanticClassNames<TooltipSemanticPart>;
|
|
29
|
+
styles?: SemanticStyles<TooltipSemanticPart>;
|
|
30
|
+
/** Exactly one trigger element. */
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function Tooltip({ title, placement, arrow, open, defaultOpen, onOpenChange, mouseEnterDelay, mouseLeaveDelay, color, className, style, classNames, styles, children, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import { TaoPortalScope } from "../../provider/tao-provider.js";
|
|
5
|
+
import { asTriggerChild, useControlledOpen } from "../../utils/overlay.js";
|
|
6
|
+
import { cx } from "../../utils/semantic.js";
|
|
7
|
+
import "./tooltip.css";
|
|
8
|
+
import * as __rspack_external__radix_ui_react_tooltip_b301f25d from "@radix-ui/react-tooltip";
|
|
9
|
+
function Tooltip(t0) {
|
|
10
|
+
const $ = c(51);
|
|
11
|
+
const { title, placement: t1, arrow: t2, open, defaultOpen, onOpenChange, mouseEnterDelay: t3, mouseLeaveDelay: t4, color, className, style, classNames, styles, children } = t0;
|
|
12
|
+
const placement = void 0 === t1 ? "top" : t1;
|
|
13
|
+
const arrow = void 0 === t2 ? true : t2;
|
|
14
|
+
const mouseEnterDelay = void 0 === t3 ? 0.1 : t3;
|
|
15
|
+
const mouseLeaveDelay = void 0 === t4 ? 0.1 : t4;
|
|
16
|
+
let t5;
|
|
17
|
+
if ($[0] !== defaultOpen || $[1] !== onOpenChange || $[2] !== open) {
|
|
18
|
+
t5 = {
|
|
19
|
+
open,
|
|
20
|
+
defaultOpen,
|
|
21
|
+
onOpenChange
|
|
22
|
+
};
|
|
23
|
+
$[0] = defaultOpen;
|
|
24
|
+
$[1] = onOpenChange;
|
|
25
|
+
$[2] = open;
|
|
26
|
+
$[3] = t5;
|
|
27
|
+
} else t5 = $[3];
|
|
28
|
+
const [realOpen, setOpen] = useControlledOpen(t5);
|
|
29
|
+
const closeTimer = useRef(void 0);
|
|
30
|
+
const pointerDriven = useRef(false);
|
|
31
|
+
let t6;
|
|
32
|
+
let t7;
|
|
33
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t6 = ()=>()=>clearTimeout(closeTimer.current);
|
|
35
|
+
t7 = [];
|
|
36
|
+
$[4] = t6;
|
|
37
|
+
$[5] = t7;
|
|
38
|
+
} else {
|
|
39
|
+
t6 = $[4];
|
|
40
|
+
t7 = $[5];
|
|
41
|
+
}
|
|
42
|
+
useEffect(t6, t7);
|
|
43
|
+
let t8;
|
|
44
|
+
if ($[6] !== mouseLeaveDelay || $[7] !== setOpen) {
|
|
45
|
+
t8 = ()=>{
|
|
46
|
+
clearTimeout(closeTimer.current);
|
|
47
|
+
if (mouseLeaveDelay <= 0) return void setOpen(false);
|
|
48
|
+
closeTimer.current = setTimeout(()=>{
|
|
49
|
+
pointerDriven.current = false;
|
|
50
|
+
setOpen(false);
|
|
51
|
+
}, 1000 * mouseLeaveDelay);
|
|
52
|
+
};
|
|
53
|
+
$[6] = mouseLeaveDelay;
|
|
54
|
+
$[7] = setOpen;
|
|
55
|
+
$[8] = t8;
|
|
56
|
+
} else t8 = $[8];
|
|
57
|
+
const schedulePointerClose = t8;
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[9] !== schedulePointerClose || $[10] !== setOpen) {
|
|
60
|
+
t9 = (next)=>{
|
|
61
|
+
if (!next && pointerDriven.current) return void schedulePointerClose();
|
|
62
|
+
clearTimeout(closeTimer.current);
|
|
63
|
+
pointerDriven.current = false;
|
|
64
|
+
setOpen(next);
|
|
65
|
+
};
|
|
66
|
+
$[9] = schedulePointerClose;
|
|
67
|
+
$[10] = setOpen;
|
|
68
|
+
$[11] = t9;
|
|
69
|
+
} else t9 = $[11];
|
|
70
|
+
const handleOpenChange = t9;
|
|
71
|
+
let t10;
|
|
72
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
73
|
+
t10 = ()=>{
|
|
74
|
+
pointerDriven.current = false;
|
|
75
|
+
clearTimeout(closeTimer.current);
|
|
76
|
+
};
|
|
77
|
+
$[12] = t10;
|
|
78
|
+
} else t10 = $[12];
|
|
79
|
+
let t11;
|
|
80
|
+
if ($[13] !== schedulePointerClose) {
|
|
81
|
+
t11 = {
|
|
82
|
+
onPointerEnter: t10,
|
|
83
|
+
onPointerLeave: ()=>{
|
|
84
|
+
pointerDriven.current = true;
|
|
85
|
+
schedulePointerClose();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
$[13] = schedulePointerClose;
|
|
89
|
+
$[14] = t11;
|
|
90
|
+
} else t11 = $[14];
|
|
91
|
+
const hoverProps = t11;
|
|
92
|
+
if (null == title || "" === title) {
|
|
93
|
+
let t12;
|
|
94
|
+
if ($[15] !== children) {
|
|
95
|
+
t12 = /*#__PURE__*/ jsx(Fragment, {
|
|
96
|
+
children: children
|
|
97
|
+
});
|
|
98
|
+
$[15] = children;
|
|
99
|
+
$[16] = t12;
|
|
100
|
+
} else t12 = $[16];
|
|
101
|
+
return t12;
|
|
102
|
+
}
|
|
103
|
+
let t12;
|
|
104
|
+
if ($[17] !== color) {
|
|
105
|
+
t12 = color ? {
|
|
106
|
+
background: color
|
|
107
|
+
} : void 0;
|
|
108
|
+
$[17] = color;
|
|
109
|
+
$[18] = t12;
|
|
110
|
+
} else t12 = $[18];
|
|
111
|
+
const colorStyle = t12;
|
|
112
|
+
const t13 = 1000 * mouseEnterDelay;
|
|
113
|
+
let t14;
|
|
114
|
+
if ($[19] !== children) {
|
|
115
|
+
t14 = asTriggerChild(children);
|
|
116
|
+
$[19] = children;
|
|
117
|
+
$[20] = t14;
|
|
118
|
+
} else t14 = $[20];
|
|
119
|
+
let t15;
|
|
120
|
+
if ($[21] !== hoverProps || $[22] !== t14) {
|
|
121
|
+
t15 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Trigger, {
|
|
122
|
+
asChild: true,
|
|
123
|
+
...hoverProps,
|
|
124
|
+
children: t14
|
|
125
|
+
});
|
|
126
|
+
$[21] = hoverProps;
|
|
127
|
+
$[22] = t14;
|
|
128
|
+
$[23] = t15;
|
|
129
|
+
} else t15 = $[23];
|
|
130
|
+
const t16 = classNames?.content;
|
|
131
|
+
let t17;
|
|
132
|
+
if ($[24] !== className || $[25] !== t16) {
|
|
133
|
+
t17 = cx(t16, className);
|
|
134
|
+
$[24] = className;
|
|
135
|
+
$[25] = t16;
|
|
136
|
+
$[26] = t17;
|
|
137
|
+
} else t17 = $[26];
|
|
138
|
+
const t18 = styles?.content;
|
|
139
|
+
let t19;
|
|
140
|
+
if ($[27] !== colorStyle || $[28] !== style || $[29] !== t18) {
|
|
141
|
+
t19 = {
|
|
142
|
+
...colorStyle,
|
|
143
|
+
...t18,
|
|
144
|
+
...style
|
|
145
|
+
};
|
|
146
|
+
$[27] = colorStyle;
|
|
147
|
+
$[28] = style;
|
|
148
|
+
$[29] = t18;
|
|
149
|
+
$[30] = t19;
|
|
150
|
+
} else t19 = $[30];
|
|
151
|
+
let t20;
|
|
152
|
+
if ($[31] !== arrow || $[32] !== classNames?.arrow || $[33] !== color || $[34] !== styles?.arrow) {
|
|
153
|
+
t20 = arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Arrow, {
|
|
154
|
+
asChild: true,
|
|
155
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
156
|
+
"data-tao-tooltip-arrow": "",
|
|
157
|
+
className: cx(classNames?.arrow),
|
|
158
|
+
style: {
|
|
159
|
+
...color ? {
|
|
160
|
+
"--tao-tooltip-arrow-bg": color
|
|
161
|
+
} : void 0,
|
|
162
|
+
...styles?.arrow
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
$[31] = arrow;
|
|
167
|
+
$[32] = classNames?.arrow;
|
|
168
|
+
$[33] = color;
|
|
169
|
+
$[34] = styles?.arrow;
|
|
170
|
+
$[35] = t20;
|
|
171
|
+
} else t20 = $[35];
|
|
172
|
+
let t21;
|
|
173
|
+
if ($[36] !== hoverProps || $[37] !== placement || $[38] !== t17 || $[39] !== t19 || $[40] !== t20 || $[41] !== title) {
|
|
174
|
+
t21 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Portal, {
|
|
175
|
+
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
176
|
+
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Content, {
|
|
177
|
+
"data-tao-tooltip-content": "",
|
|
178
|
+
className: t17,
|
|
179
|
+
style: t19,
|
|
180
|
+
side: placement,
|
|
181
|
+
sideOffset: 4,
|
|
182
|
+
...hoverProps,
|
|
183
|
+
children: [
|
|
184
|
+
title,
|
|
185
|
+
t20
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
$[36] = hoverProps;
|
|
191
|
+
$[37] = placement;
|
|
192
|
+
$[38] = t17;
|
|
193
|
+
$[39] = t19;
|
|
194
|
+
$[40] = t20;
|
|
195
|
+
$[41] = title;
|
|
196
|
+
$[42] = t21;
|
|
197
|
+
} else t21 = $[42];
|
|
198
|
+
let t22;
|
|
199
|
+
if ($[43] !== handleOpenChange || $[44] !== realOpen || $[45] !== t15 || $[46] !== t21) {
|
|
200
|
+
t22 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_tooltip_b301f25d.Root, {
|
|
201
|
+
open: realOpen,
|
|
202
|
+
onOpenChange: handleOpenChange,
|
|
203
|
+
children: [
|
|
204
|
+
t15,
|
|
205
|
+
t21
|
|
206
|
+
]
|
|
207
|
+
});
|
|
208
|
+
$[43] = handleOpenChange;
|
|
209
|
+
$[44] = realOpen;
|
|
210
|
+
$[45] = t15;
|
|
211
|
+
$[46] = t21;
|
|
212
|
+
$[47] = t22;
|
|
213
|
+
} else t22 = $[47];
|
|
214
|
+
let t23;
|
|
215
|
+
if ($[48] !== t13 || $[49] !== t22) {
|
|
216
|
+
t23 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_tooltip_b301f25d.Provider, {
|
|
217
|
+
delayDuration: t13,
|
|
218
|
+
children: t22
|
|
219
|
+
});
|
|
220
|
+
$[48] = t13;
|
|
221
|
+
$[49] = t22;
|
|
222
|
+
$[50] = t23;
|
|
223
|
+
} else t23 = $[50];
|
|
224
|
+
return t23;
|
|
225
|
+
}
|
|
226
|
+
export { Tooltip };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const alertDoc: {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
category: "Feedback";
|
|
5
|
+
description: string;
|
|
6
|
+
exports: string[];
|
|
7
|
+
source: string;
|
|
8
|
+
story: string;
|
|
9
|
+
tests: string[];
|
|
10
|
+
semanticParts: string[];
|
|
11
|
+
keywords: string[];
|
|
12
|
+
related: string[];
|
|
13
|
+
usage: {
|
|
14
|
+
description: string;
|
|
15
|
+
bestPractices: string[];
|
|
16
|
+
avoid: string[];
|
|
17
|
+
};
|
|
18
|
+
props: ({
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
defaultValue: string;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
defaultValue?: undefined;
|
|
28
|
+
})[];
|
|
29
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const alertDoc = {
|
|
2
|
+
name: 'alert',
|
|
3
|
+
displayName: 'Alert',
|
|
4
|
+
category: 'Feedback',
|
|
5
|
+
description: 'Displays important contextual feedback messages with semantic status types.',
|
|
6
|
+
exports: [
|
|
7
|
+
'Alert'
|
|
8
|
+
],
|
|
9
|
+
source: 'src/components/alert/alert.tsx',
|
|
10
|
+
story: 'stories/alert.stories.tsx',
|
|
11
|
+
tests: [
|
|
12
|
+
'tests/alert/alert.test.tsx'
|
|
13
|
+
],
|
|
14
|
+
semanticParts: [
|
|
15
|
+
'root',
|
|
16
|
+
'icon',
|
|
17
|
+
'title',
|
|
18
|
+
"description",
|
|
19
|
+
'action',
|
|
20
|
+
'close'
|
|
21
|
+
],
|
|
22
|
+
keywords: [
|
|
23
|
+
'alert',
|
|
24
|
+
'banner',
|
|
25
|
+
'feedback',
|
|
26
|
+
'message',
|
|
27
|
+
'notification',
|
|
28
|
+
'status'
|
|
29
|
+
],
|
|
30
|
+
related: [
|
|
31
|
+
'Sonner',
|
|
32
|
+
'Modal',
|
|
33
|
+
'Tag'
|
|
34
|
+
],
|
|
35
|
+
usage: {
|
|
36
|
+
description: 'Use Alert for persistent, page-level feedback about a state or operation. Use Sonner toasts for transient notifications.',
|
|
37
|
+
bestPractices: [
|
|
38
|
+
'Pick the semantic type that matches the severity of the message.',
|
|
39
|
+
"Keep the title short; put detail in the description.",
|
|
40
|
+
'Enable showIcon when the alert needs to be scannable at a glance.'
|
|
41
|
+
],
|
|
42
|
+
avoid: [
|
|
43
|
+
'Do not stack many alerts in one view; prefer a single summary.',
|
|
44
|
+
'Do not use Alert for transient feedback; use a toast instead.'
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
props: [
|
|
48
|
+
{
|
|
49
|
+
name: 'type',
|
|
50
|
+
type: "'success' | 'info' | 'warning' | 'error'",
|
|
51
|
+
description: 'Semantic status type controlling colors and default icon.',
|
|
52
|
+
defaultValue: "'info'"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'title',
|
|
56
|
+
type: 'ReactNode',
|
|
57
|
+
description: 'Bold heading line of the alert.'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "description",
|
|
61
|
+
type: 'ReactNode',
|
|
62
|
+
description: 'Secondary text rendered below the title.'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'showIcon',
|
|
66
|
+
type: 'boolean',
|
|
67
|
+
description: 'Whether to render the per-type status icon.',
|
|
68
|
+
defaultValue: 'false'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'icon',
|
|
72
|
+
type: 'ReactNode',
|
|
73
|
+
description: 'Custom icon overriding the per-type default.'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'closable',
|
|
77
|
+
type: 'boolean',
|
|
78
|
+
description: 'Whether to show a close button that dismisses the alert.',
|
|
79
|
+
defaultValue: 'false'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'onClose',
|
|
83
|
+
type: '(e: MouseEvent<HTMLElement>) => void',
|
|
84
|
+
description: 'Called when the close button is clicked.'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'action',
|
|
88
|
+
type: 'ReactNode',
|
|
89
|
+
description: 'Right-side action slot, e.g. a button.'
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
export { alertDoc };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const formDoc: {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
category: "Data Entry";
|
|
5
|
+
description: string;
|
|
6
|
+
exports: string[];
|
|
7
|
+
source: string;
|
|
8
|
+
story: string;
|
|
9
|
+
tests: string[];
|
|
10
|
+
semanticParts: string[];
|
|
11
|
+
keywords: string[];
|
|
12
|
+
related: string[];
|
|
13
|
+
usage: {
|
|
14
|
+
description: string;
|
|
15
|
+
bestPractices: string[];
|
|
16
|
+
avoid: string[];
|
|
17
|
+
};
|
|
18
|
+
props: ({
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
defaultValue?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
defaultValue: string;
|
|
28
|
+
})[];
|
|
29
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const formDoc = {
|
|
2
|
+
name: 'form',
|
|
3
|
+
displayName: 'Form',
|
|
4
|
+
category: 'Data Entry',
|
|
5
|
+
description: 'Collects and validates field values with an antd-aligned API (rules, dependencies, Form.List) on top of the rc-form engine.',
|
|
6
|
+
exports: [
|
|
7
|
+
'Form'
|
|
8
|
+
],
|
|
9
|
+
source: 'src/components/form/form.tsx',
|
|
10
|
+
story: 'stories/form.stories.tsx',
|
|
11
|
+
tests: [
|
|
12
|
+
'tests/form/form.test.tsx'
|
|
13
|
+
],
|
|
14
|
+
semanticParts: [
|
|
15
|
+
'root'
|
|
16
|
+
],
|
|
17
|
+
keywords: [
|
|
18
|
+
'form',
|
|
19
|
+
'validation',
|
|
20
|
+
'rules',
|
|
21
|
+
'submit'
|
|
22
|
+
],
|
|
23
|
+
related: [
|
|
24
|
+
'FormField',
|
|
25
|
+
'FormSection',
|
|
26
|
+
'FormActions',
|
|
27
|
+
'Input'
|
|
28
|
+
],
|
|
29
|
+
usage: {
|
|
30
|
+
description: 'Use Form with Form.Item when fields need a value store, rule validation, or submit handling. Use the lighter FormField when you manage state yourself.',
|
|
31
|
+
bestPractices: [
|
|
32
|
+
'Declare validation as rules on Form.Item; the required mark is inferred from rules.',
|
|
33
|
+
'Use dependencies for cross-field rules such as password confirmation.',
|
|
34
|
+
'Use Form.useForm() for imperative control (setFieldsValue, resetFields, submit).',
|
|
35
|
+
'Set size or disabled on Form to cascade them to every control inside.'
|
|
36
|
+
],
|
|
37
|
+
avoid: [
|
|
38
|
+
'Do not bind the same name in two mounted Form.Items.',
|
|
39
|
+
'Do not mix manual value/onChange props with a bound Form.Item on the same control.'
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
props: [
|
|
43
|
+
{
|
|
44
|
+
name: 'initialValues',
|
|
45
|
+
type: 'Record<string, unknown>',
|
|
46
|
+
description: 'Seed values for the form store.'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'onFinish',
|
|
50
|
+
type: '(values) => void',
|
|
51
|
+
description: 'Called with collected values after a valid submit.'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'layout',
|
|
55
|
+
type: "'vertical' | 'horizontal'",
|
|
56
|
+
description: 'Label/control arrangement inherited by Form.Item.',
|
|
57
|
+
defaultValue: "'vertical'"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Form.Item rules',
|
|
61
|
+
type: 'Rule[]',
|
|
62
|
+
description: 'Validation rules (required, pattern, min/max, validator, …), same engine as antd.'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Form.Item help / extra',
|
|
66
|
+
type: 'ReactNode',
|
|
67
|
+
description: "help overrides the rule message; extra renders a description below the control."
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
};
|
|
71
|
+
export { formDoc };
|
|
@@ -38,6 +38,14 @@ const modalDoc = {
|
|
|
38
38
|
avoid: [
|
|
39
39
|
'Do not use nested modals for multi-step workflows.'
|
|
40
40
|
]
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
props: [
|
|
43
|
+
{
|
|
44
|
+
name: 'width',
|
|
45
|
+
type: 'number | string | TaoBreakpointMap<number | string>',
|
|
46
|
+
description: 'Dialog width; accepts a breakpoint map, largest matching breakpoint wins.',
|
|
47
|
+
defaultValue: '520'
|
|
48
|
+
}
|
|
49
|
+
]
|
|
42
50
|
};
|
|
43
51
|
export { modalDoc };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const popconfirmDoc: {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
category: "Feedback";
|
|
5
|
+
description: string;
|
|
6
|
+
exports: string[];
|
|
7
|
+
source: string;
|
|
8
|
+
story: string;
|
|
9
|
+
tests: string[];
|
|
10
|
+
semanticParts: string[];
|
|
11
|
+
keywords: string[];
|
|
12
|
+
related: string[];
|
|
13
|
+
usage: {
|
|
14
|
+
description: string;
|
|
15
|
+
bestPractices: string[];
|
|
16
|
+
avoid: string[];
|
|
17
|
+
};
|
|
18
|
+
props: ({
|
|
19
|
+
name: string;
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
defaultValue?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
defaultValue: string;
|
|
28
|
+
})[];
|
|
29
|
+
};
|