@aura-react-comp/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +67 -2
- package/esm/alert/index.d.ts +28 -0
- package/esm/alert/index.js +76 -0
- package/esm/alert/index.less +172 -0
- package/esm/avatar/index.d.ts +41 -0
- package/esm/avatar/index.js +117 -0
- package/esm/avatar/index.less +162 -0
- package/esm/badge/index.d.ts +29 -0
- package/esm/badge/index.js +84 -0
- package/esm/badge/index.less +215 -0
- package/esm/breadcrumb/index.d.ts +31 -0
- package/esm/breadcrumb/index.js +91 -0
- package/esm/breadcrumb/index.less +108 -0
- package/esm/button/index.d.ts +28 -0
- package/esm/button/index.js +59 -0
- package/esm/button/index.less +191 -0
- package/esm/card/index.d.ts +67 -0
- package/esm/card/index.js +156 -0
- package/esm/card/index.less +231 -0
- package/esm/checkbox/index.d.ts +35 -0
- package/esm/checkbox/index.js +118 -0
- package/esm/checkbox/index.less +141 -0
- package/esm/collapse/index.d.ts +45 -0
- package/esm/collapse/index.js +157 -0
- package/esm/collapse/index.less +144 -0
- package/esm/divider/index.d.ts +16 -0
- package/esm/divider/index.js +37 -0
- package/esm/divider/index.less +115 -0
- package/esm/dropdown/index.d.ts +38 -0
- package/esm/dropdown/index.js +108 -0
- package/esm/dropdown/index.less +245 -0
- package/esm/empty/index.d.ts +35 -0
- package/esm/empty/index.js +87 -0
- package/esm/empty/index.less +67 -0
- package/esm/flex/index.d.ts +24 -0
- package/esm/flex/index.js +64 -0
- package/esm/flex/index.less +9 -0
- package/esm/form/index.d.ts +121 -0
- package/esm/form/index.js +443 -0
- package/esm/form/index.less +257 -0
- package/esm/global.d.ts +6 -0
- package/esm/index.d.ts +78 -0
- package/esm/index.js +41 -0
- package/esm/input/index.d.ts +51 -0
- package/esm/input/index.js +217 -0
- package/esm/input/index.less +369 -0
- package/esm/layout/index.d.ts +46 -0
- package/esm/layout/index.js +135 -0
- package/esm/layout/index.less +132 -0
- package/esm/menu/index.d.ts +91 -0
- package/esm/menu/index.js +294 -0
- package/esm/menu/index.less +340 -0
- package/esm/message/index.d.ts +33 -0
- package/esm/message/index.js +199 -0
- package/esm/message/index.less +113 -0
- package/esm/notification/index.d.ts +33 -0
- package/esm/notification/index.js +229 -0
- package/esm/notification/index.less +175 -0
- package/esm/pagination/index.d.ts +38 -0
- package/esm/pagination/index.js +180 -0
- package/esm/pagination/index.less +238 -0
- package/esm/popconfirm/index.d.ts +37 -0
- package/esm/popconfirm/index.js +115 -0
- package/esm/popconfirm/index.less +229 -0
- package/esm/radio/index.d.ts +33 -0
- package/esm/radio/index.js +122 -0
- package/esm/radio/index.less +119 -0
- package/esm/rate/index.d.ts +30 -0
- package/esm/rate/index.js +143 -0
- package/esm/rate/index.less +87 -0
- package/esm/result/index.d.ts +19 -0
- package/esm/result/index.js +69 -0
- package/esm/result/index.less +103 -0
- package/esm/scrollbar/index.d.ts +18 -0
- package/esm/scrollbar/index.js +35 -0
- package/esm/scrollbar/index.less +67 -0
- package/esm/select/index.d.ts +63 -0
- package/esm/select/index.js +358 -0
- package/esm/select/index.less +427 -0
- package/esm/slider/index.d.ts +36 -0
- package/esm/slider/index.js +255 -0
- package/esm/slider/index.less +154 -0
- package/esm/space/index.d.ts +16 -0
- package/esm/space/index.js +34 -0
- package/esm/space/index.less +34 -0
- package/esm/spin/index.d.ts +44 -0
- package/esm/spin/index.js +152 -0
- package/esm/spin/index.less +170 -0
- package/esm/steps/index.d.ts +55 -0
- package/esm/steps/index.js +165 -0
- package/esm/steps/index.less +394 -0
- package/esm/switch/index.d.ts +30 -0
- package/esm/switch/index.js +56 -0
- package/esm/switch/index.less +135 -0
- package/esm/tabs/index.d.ts +45 -0
- package/esm/tabs/index.js +170 -0
- package/esm/tabs/index.less +226 -0
- package/esm/tag/index.d.ts +52 -0
- package/esm/tag/index.js +120 -0
- package/esm/tag/index.less +227 -0
- package/esm/textarea/index.d.ts +27 -0
- package/esm/textarea/index.js +84 -0
- package/esm/textarea/index.less +224 -0
- package/esm/theme/ThemeProvider.d.ts +15 -0
- package/esm/theme/ThemeProvider.js +32 -0
- package/esm/theme/index.d.ts +2 -0
- package/esm/theme/index.js +1 -0
- package/esm/theme/tokens.css +183 -0
- package/esm/theme/useTheme.d.ts +1 -0
- package/esm/theme/useTheme.js +1 -0
- package/esm/tooltip/index.d.ts +38 -0
- package/esm/tooltip/index.js +149 -0
- package/esm/tooltip/index.less +244 -0
- package/esm/typography/index.d.ts +26 -0
- package/esm/typography/index.js +92 -0
- package/esm/typography/index.less +106 -0
- package/esm/upload/index.d.ts +68 -0
- package/esm/upload/index.js +447 -0
- package/esm/upload/index.less +371 -0
- package/esm/upload/request.d.ts +26 -0
- package/esm/upload/request.js +38 -0
- package/package.json +56 -3
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/* ===== Pagination 组件样式 ===== */
|
|
2
|
+
|
|
3
|
+
.aura-pagination {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: var(--aura-spacing-1);
|
|
7
|
+
user-select: none;
|
|
8
|
+
font-size: var(--aura-font-size-md);
|
|
9
|
+
|
|
10
|
+
// 总条数展示
|
|
11
|
+
&-total {
|
|
12
|
+
margin-right: var(--aura-spacing-2);
|
|
13
|
+
color: var(--aura-text-secondary);
|
|
14
|
+
font-size: var(--aura-font-size-sm);
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ===== 页码容器 ===== */
|
|
19
|
+
&-pages {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: var(--aura-spacing-1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ===== 按钮(页码 & 前后翻页) ===== */
|
|
27
|
+
.aura-pagination-btn {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
min-width: 32px;
|
|
32
|
+
height: 32px;
|
|
33
|
+
padding: 0 6px;
|
|
34
|
+
font-size: var(--aura-font-size-sm);
|
|
35
|
+
font-family: inherit;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
color: var(--aura-text);
|
|
38
|
+
background: var(--aura-bg);
|
|
39
|
+
border: 1px solid var(--aura-border);
|
|
40
|
+
border-radius: var(--aura-radius-sm);
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
transition: all var(--aura-duration-normal) cubic-bezier(0.4, 0, 0.2, 1);
|
|
43
|
+
|
|
44
|
+
&:hover:not(:disabled) {
|
|
45
|
+
color: var(--aura-primary-700);
|
|
46
|
+
border-color: var(--aura-primary-300);
|
|
47
|
+
background: var(--aura-primary-50);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:active:not(:disabled) {
|
|
51
|
+
transform: scale(0.95);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:focus-visible {
|
|
55
|
+
outline: 2px solid var(--aura-primary-500);
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* 当前页激活 */
|
|
60
|
+
&-active {
|
|
61
|
+
color: var(--aura-text-inverse);
|
|
62
|
+
background: var(--aura-primary-600);
|
|
63
|
+
border-color: var(--aura-primary-600);
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
color: var(--aura-text-inverse);
|
|
68
|
+
background: var(--aura-primary-700);
|
|
69
|
+
border-color: var(--aura-primary-700);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 禁用 */
|
|
74
|
+
&-disabled {
|
|
75
|
+
color: var(--aura-text-tertiary);
|
|
76
|
+
background: var(--aura-bg-secondary);
|
|
77
|
+
border-color: var(--aura-border);
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
opacity: 0.6;
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
color: var(--aura-text-tertiary);
|
|
83
|
+
background: var(--aura-bg-secondary);
|
|
84
|
+
border-color: var(--aura-border);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:active {
|
|
88
|
+
transform: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ===== 省略号 ===== */
|
|
94
|
+
.aura-pagination-ellipsis {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
min-width: 32px;
|
|
99
|
+
height: 32px;
|
|
100
|
+
color: var(--aura-text-tertiary);
|
|
101
|
+
font-size: var(--aura-font-size-md);
|
|
102
|
+
letter-spacing: 2px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* ===== 每页条数选择器 ===== */
|
|
106
|
+
.aura-pagination-size-changer {
|
|
107
|
+
height: 32px;
|
|
108
|
+
padding: 0 var(--aura-spacing-3);
|
|
109
|
+
margin-left: var(--aura-spacing-2);
|
|
110
|
+
font-size: var(--aura-font-size-sm);
|
|
111
|
+
font-family: inherit;
|
|
112
|
+
color: var(--aura-text);
|
|
113
|
+
background: var(--aura-bg);
|
|
114
|
+
border: 1px solid var(--aura-border);
|
|
115
|
+
border-radius: var(--aura-radius-sm);
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
transition: border-color var(--aura-duration-normal)
|
|
118
|
+
cubic-bezier(0.4, 0, 0.2, 1);
|
|
119
|
+
|
|
120
|
+
&:hover {
|
|
121
|
+
border-color: var(--aura-primary-300);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:focus {
|
|
125
|
+
outline: 2px solid var(--aura-primary-500);
|
|
126
|
+
outline-offset: 2px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* ===== 快速跳转 ===== */
|
|
131
|
+
.aura-pagination-jumper {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: var(--aura-spacing-2);
|
|
135
|
+
margin-left: var(--aura-spacing-2);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.aura-pagination-jumper-text {
|
|
139
|
+
font-size: var(--aura-font-size-sm);
|
|
140
|
+
color: var(--aura-text-secondary);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.aura-pagination-jumper-input {
|
|
144
|
+
width: 50px;
|
|
145
|
+
height: 32px;
|
|
146
|
+
padding: 0 var(--aura-spacing-2);
|
|
147
|
+
font-size: var(--aura-font-size-sm);
|
|
148
|
+
font-family: inherit;
|
|
149
|
+
color: var(--aura-text);
|
|
150
|
+
background: var(--aura-bg);
|
|
151
|
+
border: 1px solid var(--aura-border);
|
|
152
|
+
border-radius: var(--aura-radius-sm);
|
|
153
|
+
text-align: center;
|
|
154
|
+
transition: border-color var(--aura-duration-normal)
|
|
155
|
+
cubic-bezier(0.4, 0, 0.2, 1);
|
|
156
|
+
|
|
157
|
+
&:hover {
|
|
158
|
+
border-color: var(--aura-primary-300);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:focus {
|
|
162
|
+
outline: 2px solid var(--aura-primary-500);
|
|
163
|
+
outline-offset: 2px;
|
|
164
|
+
border-color: var(--aura-primary-500);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* ===== Size 变体 ===== */
|
|
169
|
+
.aura-pagination-sm {
|
|
170
|
+
.aura-pagination-btn {
|
|
171
|
+
min-width: 28px;
|
|
172
|
+
height: 28px;
|
|
173
|
+
font-size: var(--aura-font-size-xs);
|
|
174
|
+
padding: 0 4px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.aura-pagination-ellipsis {
|
|
178
|
+
min-width: 28px;
|
|
179
|
+
height: 28px;
|
|
180
|
+
font-size: var(--aura-font-size-xs);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.aura-pagination-size-changer {
|
|
184
|
+
height: 28px;
|
|
185
|
+
font-size: var(--aura-font-size-xs);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.aura-pagination-jumper-input {
|
|
189
|
+
width: 44px;
|
|
190
|
+
height: 28px;
|
|
191
|
+
font-size: var(--aura-font-size-xs);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* ===== 暗色模式 ===== */
|
|
196
|
+
[data-theme='dark'] {
|
|
197
|
+
.aura-pagination-btn {
|
|
198
|
+
color: var(--aura-text);
|
|
199
|
+
background: var(--aura-bg-secondary);
|
|
200
|
+
border-color: var(--aura-border);
|
|
201
|
+
|
|
202
|
+
&:hover:not(:disabled) {
|
|
203
|
+
color: var(--aura-primary-400);
|
|
204
|
+
border-color: var(--aura-primary-600);
|
|
205
|
+
background: rgba(124, 58, 237, 0.1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&-active {
|
|
209
|
+
color: var(--aura-text-inverse);
|
|
210
|
+
background: var(--aura-primary-600);
|
|
211
|
+
border-color: var(--aura-primary-600);
|
|
212
|
+
|
|
213
|
+
&:hover {
|
|
214
|
+
color: var(--aura-text-inverse);
|
|
215
|
+
background: var(--aura-primary-500);
|
|
216
|
+
border-color: var(--aura-primary-500);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&-disabled {
|
|
221
|
+
color: var(--aura-text-tertiary);
|
|
222
|
+
background: var(--aura-bg-tertiary);
|
|
223
|
+
border-color: var(--aura-border);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.aura-pagination-size-changer {
|
|
228
|
+
color: var(--aura-text);
|
|
229
|
+
background: var(--aura-bg-secondary);
|
|
230
|
+
border-color: var(--aura-border);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.aura-pagination-jumper-input {
|
|
234
|
+
color: var(--aura-text);
|
|
235
|
+
background: var(--aura-bg-secondary);
|
|
236
|
+
border-color: var(--aura-border);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PopconfirmProps {
|
|
3
|
+
/** 确认标题 */
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
/** 确认描述 */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
/** 确认回调 */
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
/** 取消回调 */
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
/** 确认按钮文字
|
|
12
|
+
* @default '确定'
|
|
13
|
+
*/
|
|
14
|
+
okText?: string;
|
|
15
|
+
/** 取消按钮文字
|
|
16
|
+
* @default '取消'
|
|
17
|
+
*/
|
|
18
|
+
cancelText?: string;
|
|
19
|
+
/** 变体样式
|
|
20
|
+
* @default 'default'
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'default' | 'warning' | 'error';
|
|
23
|
+
/** 弹出方位
|
|
24
|
+
* @default 'top'
|
|
25
|
+
*/
|
|
26
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
27
|
+
/** 是否禁用 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** 自定义类名 */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** 自定义样式 */
|
|
32
|
+
style?: React.CSSProperties;
|
|
33
|
+
/** 目标元素(仅接受单个 ReactElement) */
|
|
34
|
+
children: React.ReactElement;
|
|
35
|
+
}
|
|
36
|
+
export declare const PopconfirmBase: React.ForwardRefExoticComponent<PopconfirmProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export declare const Popconfirm: React.ForwardRefExoticComponent<PopconfirmProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React, { forwardRef, useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { classNames, prefixCls } from '@aura-react-comp/shared';
|
|
3
|
+
import "./index.less";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const PopconfirmBase = /*#__PURE__*/forwardRef(({
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
onConfirm,
|
|
10
|
+
onCancel,
|
|
11
|
+
okText = '确定',
|
|
12
|
+
cancelText = '取消',
|
|
13
|
+
variant = 'default',
|
|
14
|
+
placement = 'top',
|
|
15
|
+
disabled = false,
|
|
16
|
+
className,
|
|
17
|
+
style,
|
|
18
|
+
children
|
|
19
|
+
}, ref) => {
|
|
20
|
+
const [visible, setVisible] = useState(false);
|
|
21
|
+
const [animating, setAnimating] = useState(false);
|
|
22
|
+
const wrapperRef = useRef(null);
|
|
23
|
+
const onCancelRef = useRef(onCancel);
|
|
24
|
+
onCancelRef.current = onCancel;
|
|
25
|
+
|
|
26
|
+
// 隐藏气泡
|
|
27
|
+
const hide = () => {
|
|
28
|
+
setAnimating(false);
|
|
29
|
+
setTimeout(() => setVisible(false), 200);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// 点击外部关闭
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!visible) return;
|
|
35
|
+
const handleClickOutside = e => {
|
|
36
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
37
|
+
onCancelRef.current?.();
|
|
38
|
+
hide();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
42
|
+
return () => {
|
|
43
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
44
|
+
};
|
|
45
|
+
}, [visible]);
|
|
46
|
+
|
|
47
|
+
// 显示气泡
|
|
48
|
+
const show = () => {
|
|
49
|
+
if (disabled) return;
|
|
50
|
+
setAnimating(true);
|
|
51
|
+
setVisible(true);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// 确认操作
|
|
55
|
+
const handleConfirm = () => {
|
|
56
|
+
onConfirm?.();
|
|
57
|
+
hide();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 取消操作
|
|
61
|
+
const handleCancel = () => {
|
|
62
|
+
onCancel?.();
|
|
63
|
+
hide();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// 构建子元素的 props
|
|
67
|
+
const childProps = {};
|
|
68
|
+
const childOwnProps = children.props;
|
|
69
|
+
childProps.onClick = e => {
|
|
70
|
+
if (!disabled) {
|
|
71
|
+
show();
|
|
72
|
+
}
|
|
73
|
+
childOwnProps.onClick?.(e);
|
|
74
|
+
};
|
|
75
|
+
const wrapperCls = classNames(prefixCls('popconfirm-wrapper'), className);
|
|
76
|
+
const popCls = classNames(prefixCls('popconfirm'), prefixCls(`popconfirm-${placement}`), variant !== 'default' && prefixCls(`popconfirm-${variant}`), animating && prefixCls('popconfirm-visible'));
|
|
77
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
78
|
+
ref: node => {
|
|
79
|
+
wrapperRef.current = node;
|
|
80
|
+
if (typeof ref === 'function') ref(node);else if (ref) ref.current = node;
|
|
81
|
+
},
|
|
82
|
+
className: wrapperCls,
|
|
83
|
+
style: style,
|
|
84
|
+
children: [/*#__PURE__*/React.cloneElement(children, childProps), visible && /*#__PURE__*/_jsxs("div", {
|
|
85
|
+
className: popCls,
|
|
86
|
+
role: "dialog",
|
|
87
|
+
"aria-label": typeof title === 'string' ? title : undefined,
|
|
88
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
89
|
+
className: prefixCls('popconfirm-content'),
|
|
90
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
91
|
+
className: prefixCls('popconfirm-title'),
|
|
92
|
+
children: title
|
|
93
|
+
}), description && /*#__PURE__*/_jsx("div", {
|
|
94
|
+
className: prefixCls('popconfirm-description'),
|
|
95
|
+
children: description
|
|
96
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
97
|
+
className: prefixCls('popconfirm-buttons'),
|
|
98
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
99
|
+
className: classNames(prefixCls('popconfirm-btn'), prefixCls('popconfirm-btn-cancel')),
|
|
100
|
+
onClick: handleCancel,
|
|
101
|
+
children: cancelText
|
|
102
|
+
}), /*#__PURE__*/_jsx("button", {
|
|
103
|
+
className: classNames(prefixCls('popconfirm-btn'), prefixCls(`popconfirm-btn-${variant === 'default' ? 'primary' : variant}`)),
|
|
104
|
+
onClick: handleConfirm,
|
|
105
|
+
children: okText
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
109
|
+
className: prefixCls('popconfirm-arrow')
|
|
110
|
+
})]
|
|
111
|
+
})]
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
PopconfirmBase.displayName = 'Popconfirm';
|
|
115
|
+
export const Popconfirm = PopconfirmBase;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/* ===== Popconfirm 组件样式 ===== */
|
|
2
|
+
|
|
3
|
+
.aura-popconfirm-wrapper {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.aura-popconfirm {
|
|
9
|
+
position: absolute;
|
|
10
|
+
z-index: 1070;
|
|
11
|
+
pointer-events: auto;
|
|
12
|
+
opacity: 0;
|
|
13
|
+
width: max-content;
|
|
14
|
+
transform: scale(0.9);
|
|
15
|
+
transition:
|
|
16
|
+
opacity var(--aura-duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
17
|
+
transform var(--aura-duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
18
|
+
|
|
19
|
+
// ===== 出现状态 =====
|
|
20
|
+
&&-visible {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
transform: scale(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ===== 方位定位 =====
|
|
26
|
+
&&-top {
|
|
27
|
+
bottom: calc(100% + 8px);
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform-origin: center bottom;
|
|
30
|
+
transform: translateX(-50%) scale(0.9);
|
|
31
|
+
|
|
32
|
+
&.aura-popconfirm-visible {
|
|
33
|
+
transform: translateX(-50%) scale(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&&-bottom {
|
|
38
|
+
top: calc(100% + 8px);
|
|
39
|
+
left: 50%;
|
|
40
|
+
transform-origin: center top;
|
|
41
|
+
transform: translateX(-50%) scale(0.9);
|
|
42
|
+
|
|
43
|
+
&.aura-popconfirm-visible {
|
|
44
|
+
transform: translateX(-50%) scale(1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&&-left {
|
|
49
|
+
right: calc(100% + 8px);
|
|
50
|
+
top: 50%;
|
|
51
|
+
transform-origin: right center;
|
|
52
|
+
transform: translateY(-50%) scale(0.9);
|
|
53
|
+
|
|
54
|
+
&.aura-popconfirm-visible {
|
|
55
|
+
transform: translateY(-50%) scale(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&&-right {
|
|
60
|
+
left: calc(100% + 8px);
|
|
61
|
+
top: 50%;
|
|
62
|
+
transform-origin: left center;
|
|
63
|
+
transform: translateY(-50%) scale(0.9);
|
|
64
|
+
|
|
65
|
+
&.aura-popconfirm-visible {
|
|
66
|
+
transform: translateY(-50%) scale(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ===== 气泡内容 =====
|
|
72
|
+
.aura-popconfirm-content {
|
|
73
|
+
padding: var(--aura-spacing-4);
|
|
74
|
+
border-radius: var(--aura-radius-md);
|
|
75
|
+
background: var(--aura-bg);
|
|
76
|
+
border: 1px solid var(--aura-border);
|
|
77
|
+
box-shadow: var(--aura-shadow-lg);
|
|
78
|
+
min-width: 240px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.aura-popconfirm-title {
|
|
82
|
+
font-size: var(--aura-font-size-md);
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
color: var(--aura-text);
|
|
85
|
+
line-height: 1.5;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.aura-popconfirm-description {
|
|
89
|
+
margin-top: var(--aura-spacing-2);
|
|
90
|
+
font-size: var(--aura-font-size-sm);
|
|
91
|
+
color: var(--aura-text-secondary);
|
|
92
|
+
line-height: 1.5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ===== 按钮行 =====
|
|
96
|
+
.aura-popconfirm-buttons {
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: flex-end;
|
|
99
|
+
gap: var(--aura-spacing-2);
|
|
100
|
+
margin-top: var(--aura-spacing-3);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.aura-popconfirm-btn {
|
|
104
|
+
padding: 4px 12px;
|
|
105
|
+
font-size: var(--aura-font-size-sm);
|
|
106
|
+
font-family: inherit;
|
|
107
|
+
line-height: 1.5;
|
|
108
|
+
border-radius: var(--aura-radius-sm);
|
|
109
|
+
border: 1px solid var(--aura-border);
|
|
110
|
+
background: var(--aura-bg);
|
|
111
|
+
color: var(--aura-text);
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
transition: all var(--aura-duration-normal) var(--aura-easing);
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
border-color: var(--aura-border-hover);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// 确认按钮 - primary
|
|
120
|
+
&&-primary {
|
|
121
|
+
background: var(--aura-primary-700);
|
|
122
|
+
border-color: var(--aura-primary-700);
|
|
123
|
+
color: var(--aura-text-inverse);
|
|
124
|
+
|
|
125
|
+
&:hover {
|
|
126
|
+
background: var(--aura-primary-600);
|
|
127
|
+
border-color: var(--aura-primary-600);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// 确认按钮 - warning
|
|
132
|
+
&&-warning {
|
|
133
|
+
background: var(--aura-warning);
|
|
134
|
+
border-color: var(--aura-warning);
|
|
135
|
+
color: var(--aura-text-inverse);
|
|
136
|
+
|
|
137
|
+
&:hover {
|
|
138
|
+
opacity: 0.85;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 确认按钮 - error
|
|
143
|
+
&&-error {
|
|
144
|
+
background: var(--aura-error);
|
|
145
|
+
border-color: var(--aura-error);
|
|
146
|
+
color: var(--aura-text-inverse);
|
|
147
|
+
|
|
148
|
+
&:hover {
|
|
149
|
+
opacity: 0.85;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ===== 箭头 =====
|
|
155
|
+
.aura-popconfirm-arrow {
|
|
156
|
+
position: absolute;
|
|
157
|
+
width: 8px;
|
|
158
|
+
height: 8px;
|
|
159
|
+
background: var(--aura-bg);
|
|
160
|
+
border: 1px solid var(--aura-border);
|
|
161
|
+
transform: rotate(45deg);
|
|
162
|
+
|
|
163
|
+
.aura-popconfirm-top & {
|
|
164
|
+
bottom: -5px;
|
|
165
|
+
left: 50%;
|
|
166
|
+
margin-left: -4px;
|
|
167
|
+
border-top: none;
|
|
168
|
+
border-left: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.aura-popconfirm-bottom & {
|
|
172
|
+
top: -5px;
|
|
173
|
+
left: 50%;
|
|
174
|
+
margin-left: -4px;
|
|
175
|
+
border-bottom: none;
|
|
176
|
+
border-right: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.aura-popconfirm-left & {
|
|
180
|
+
right: -5px;
|
|
181
|
+
top: 50%;
|
|
182
|
+
margin-top: -4px;
|
|
183
|
+
border-bottom: none;
|
|
184
|
+
border-left: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.aura-popconfirm-right & {
|
|
188
|
+
left: -5px;
|
|
189
|
+
top: 50%;
|
|
190
|
+
margin-top: -4px;
|
|
191
|
+
border-top: none;
|
|
192
|
+
border-right: none;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// ===== 暗色模式 =====
|
|
197
|
+
[data-theme="dark"] {
|
|
198
|
+
.aura-popconfirm-content {
|
|
199
|
+
background: var(--aura-gray-800);
|
|
200
|
+
border-color: var(--aura-gray-700);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.aura-popconfirm-title {
|
|
204
|
+
color: var(--aura-gray-100);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.aura-popconfirm-description {
|
|
208
|
+
color: var(--aura-gray-400);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.aura-popconfirm-arrow {
|
|
212
|
+
background: var(--aura-gray-800);
|
|
213
|
+
border-color: var(--aura-gray-700);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.aura-popconfirm-btn {
|
|
217
|
+
background: var(--aura-gray-700);
|
|
218
|
+
border-color: var(--aura-gray-600);
|
|
219
|
+
color: var(--aura-gray-100);
|
|
220
|
+
|
|
221
|
+
&:hover {
|
|
222
|
+
border-color: var(--aura-gray-500);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&-cancel {
|
|
226
|
+
background: var(--aura-gray-700);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
/** 尺寸
|
|
4
|
+
* @default 'md'
|
|
5
|
+
*/
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
}
|
|
8
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export interface RadioGroupProps {
|
|
10
|
+
/** 当前值(受控) */
|
|
11
|
+
value?: string | number;
|
|
12
|
+
/** 默认值(非受控) */
|
|
13
|
+
defaultValue?: string | number;
|
|
14
|
+
/** 选项列表 */
|
|
15
|
+
options: Array<{
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
value: string | number;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
/** 值变化回调 */
|
|
21
|
+
onChange?: (value: string | number) => void;
|
|
22
|
+
/** 排列方向
|
|
23
|
+
* @default 'horizontal'
|
|
24
|
+
*/
|
|
25
|
+
direction?: 'horizontal' | 'vertical';
|
|
26
|
+
/** 是否禁用整组 */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** 尺寸 */
|
|
29
|
+
size?: 'sm' | 'md' | 'lg';
|
|
30
|
+
/** 自定义类名 */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const RadioGroup: React.FC<RadioGroupProps>;
|