@aura-react-comp/ui 0.0.0-stage → 0.1.1

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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -2
  3. package/esm/alert/index.d.ts +28 -0
  4. package/esm/alert/index.js +76 -0
  5. package/esm/alert/index.less +172 -0
  6. package/esm/avatar/index.d.ts +41 -0
  7. package/esm/avatar/index.js +117 -0
  8. package/esm/avatar/index.less +163 -0
  9. package/esm/badge/index.d.ts +29 -0
  10. package/esm/badge/index.js +84 -0
  11. package/esm/badge/index.less +215 -0
  12. package/esm/breadcrumb/index.d.ts +31 -0
  13. package/esm/breadcrumb/index.js +91 -0
  14. package/esm/breadcrumb/index.less +107 -0
  15. package/esm/button/index.d.ts +28 -0
  16. package/esm/button/index.js +59 -0
  17. package/esm/button/index.less +191 -0
  18. package/esm/card/index.d.ts +67 -0
  19. package/esm/card/index.js +156 -0
  20. package/esm/card/index.less +231 -0
  21. package/esm/checkbox/index.d.ts +35 -0
  22. package/esm/checkbox/index.js +118 -0
  23. package/esm/checkbox/index.less +175 -0
  24. package/esm/collapse/index.d.ts +45 -0
  25. package/esm/collapse/index.js +157 -0
  26. package/esm/collapse/index.less +144 -0
  27. package/esm/divider/index.d.ts +16 -0
  28. package/esm/divider/index.js +37 -0
  29. package/esm/divider/index.less +115 -0
  30. package/esm/dropdown/index.d.ts +38 -0
  31. package/esm/dropdown/index.js +108 -0
  32. package/esm/dropdown/index.less +247 -0
  33. package/esm/empty/index.d.ts +35 -0
  34. package/esm/empty/index.js +87 -0
  35. package/esm/empty/index.less +67 -0
  36. package/esm/flex/index.d.ts +24 -0
  37. package/esm/flex/index.js +64 -0
  38. package/esm/flex/index.less +9 -0
  39. package/esm/form/index.d.ts +121 -0
  40. package/esm/form/index.js +443 -0
  41. package/esm/form/index.less +258 -0
  42. package/esm/global.d.ts +6 -0
  43. package/esm/index.d.ts +78 -0
  44. package/esm/index.js +41 -0
  45. package/esm/input/index.d.ts +51 -0
  46. package/esm/input/index.js +217 -0
  47. package/esm/input/index.less +369 -0
  48. package/esm/layout/index.d.ts +46 -0
  49. package/esm/layout/index.js +135 -0
  50. package/esm/layout/index.less +132 -0
  51. package/esm/menu/index.d.ts +91 -0
  52. package/esm/menu/index.js +294 -0
  53. package/esm/menu/index.less +340 -0
  54. package/esm/message/index.d.ts +33 -0
  55. package/esm/message/index.js +199 -0
  56. package/esm/message/index.less +118 -0
  57. package/esm/notification/index.d.ts +33 -0
  58. package/esm/notification/index.js +229 -0
  59. package/esm/notification/index.less +175 -0
  60. package/esm/pagination/index.d.ts +38 -0
  61. package/esm/pagination/index.js +182 -0
  62. package/esm/pagination/index.less +230 -0
  63. package/esm/popconfirm/index.d.ts +37 -0
  64. package/esm/popconfirm/index.js +115 -0
  65. package/esm/popconfirm/index.less +229 -0
  66. package/esm/radio/index.d.ts +33 -0
  67. package/esm/radio/index.js +122 -0
  68. package/esm/radio/index.less +155 -0
  69. package/esm/rate/index.d.ts +30 -0
  70. package/esm/rate/index.js +143 -0
  71. package/esm/rate/index.less +87 -0
  72. package/esm/result/index.d.ts +19 -0
  73. package/esm/result/index.js +69 -0
  74. package/esm/result/index.less +104 -0
  75. package/esm/scrollbar/index.d.ts +18 -0
  76. package/esm/scrollbar/index.js +35 -0
  77. package/esm/scrollbar/index.less +67 -0
  78. package/esm/select/index.d.ts +63 -0
  79. package/esm/select/index.js +358 -0
  80. package/esm/select/index.less +471 -0
  81. package/esm/slider/index.d.ts +36 -0
  82. package/esm/slider/index.js +255 -0
  83. package/esm/slider/index.less +154 -0
  84. package/esm/space/index.d.ts +16 -0
  85. package/esm/space/index.js +34 -0
  86. package/esm/space/index.less +34 -0
  87. package/esm/spin/index.d.ts +44 -0
  88. package/esm/spin/index.js +152 -0
  89. package/esm/spin/index.less +179 -0
  90. package/esm/steps/index.d.ts +55 -0
  91. package/esm/steps/index.js +165 -0
  92. package/esm/steps/index.less +394 -0
  93. package/esm/switch/index.d.ts +30 -0
  94. package/esm/switch/index.js +56 -0
  95. package/esm/switch/index.less +160 -0
  96. package/esm/tabs/index.d.ts +45 -0
  97. package/esm/tabs/index.js +170 -0
  98. package/esm/tabs/index.less +228 -0
  99. package/esm/tag/index.d.ts +52 -0
  100. package/esm/tag/index.js +120 -0
  101. package/esm/tag/index.less +227 -0
  102. package/esm/textarea/index.d.ts +27 -0
  103. package/esm/textarea/index.js +84 -0
  104. package/esm/textarea/index.less +226 -0
  105. package/esm/theme/ThemeProvider.d.ts +15 -0
  106. package/esm/theme/ThemeProvider.js +32 -0
  107. package/esm/theme/index.d.ts +2 -0
  108. package/esm/theme/index.js +1 -0
  109. package/esm/theme/tokens.css +183 -0
  110. package/esm/theme/useTheme.d.ts +1 -0
  111. package/esm/theme/useTheme.js +1 -0
  112. package/esm/tooltip/index.d.ts +38 -0
  113. package/esm/tooltip/index.js +149 -0
  114. package/esm/tooltip/index.less +244 -0
  115. package/esm/typography/index.d.ts +26 -0
  116. package/esm/typography/index.js +92 -0
  117. package/esm/typography/index.less +107 -0
  118. package/esm/upload/index.d.ts +68 -0
  119. package/esm/upload/index.js +447 -0
  120. package/esm/upload/index.less +376 -0
  121. package/esm/upload/request.d.ts +26 -0
  122. package/esm/upload/request.js +38 -0
  123. package/package.json +56 -3
@@ -0,0 +1,394 @@
1
+ /* ===== Steps 组件样式 ===== */
2
+
3
+ .aura-steps {
4
+ display: flex;
5
+ align-items: flex-start;
6
+
7
+ /* ===== Direction: horizontal ===== */
8
+ &&-horizontal {
9
+ flex-direction: row;
10
+
11
+ .aura-steps-step-container {
12
+ flex: 1;
13
+ display: flex;
14
+ flex-direction: row;
15
+ align-items: flex-start;
16
+ position: relative;
17
+ }
18
+
19
+ .aura-steps-step {
20
+ flex: 1;
21
+ display: flex;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ }
25
+
26
+ .aura-steps-step-header {
27
+ display: flex;
28
+ flex-direction: column;
29
+ align-items: center;
30
+ cursor: pointer;
31
+ text-align: center;
32
+ width: 100%;
33
+ }
34
+
35
+ .aura-steps-tail {
36
+ position: absolute;
37
+ top: 16px;
38
+ left: calc(50% + 20px);
39
+ right: calc(-50% + 20px);
40
+ height: 2px;
41
+ background: var(--aura-border);
42
+ transition: background var(--aura-duration-normal)
43
+ cubic-bezier(0.4, 0, 0.2, 1);
44
+
45
+ &-completed {
46
+ background: var(--aura-primary-600);
47
+ }
48
+
49
+ &-pending {
50
+ background: var(--aura-border);
51
+ }
52
+ }
53
+ }
54
+
55
+ /* ===== Direction: vertical ===== */
56
+ &&-vertical {
57
+ flex-direction: column;
58
+
59
+ .aura-steps-step-container {
60
+ display: flex;
61
+ flex-direction: column;
62
+ position: relative;
63
+ padding-bottom: var(--aura-spacing-4);
64
+ }
65
+
66
+ .aura-steps-step-header {
67
+ display: flex;
68
+ flex-direction: row;
69
+ align-items: flex-start;
70
+ cursor: pointer;
71
+ gap: var(--aura-spacing-3);
72
+ }
73
+
74
+ .aura-steps-tail {
75
+ position: absolute;
76
+ top: 32px;
77
+ left: 15px;
78
+ width: 2px;
79
+ bottom: var(--aura-spacing-4);
80
+ background: var(--aura-border);
81
+ transition: background var(--aura-duration-normal)
82
+ cubic-bezier(0.4, 0, 0.2, 1);
83
+
84
+ &-completed {
85
+ background: var(--aura-primary-600);
86
+ }
87
+
88
+ &-pending {
89
+ background: var(--aura-border);
90
+ }
91
+ }
92
+ }
93
+
94
+ /* ===== Size: sm ===== */
95
+ &&-sm {
96
+ .aura-steps-icon {
97
+ width: 24px;
98
+ height: 24px;
99
+ font-size: var(--aura-font-size-xs);
100
+ }
101
+
102
+ .aura-steps-step-title {
103
+ font-size: var(--aura-font-size-sm);
104
+ }
105
+
106
+ .aura-steps-step-description {
107
+ font-size: var(--aura-font-size-xs);
108
+ }
109
+
110
+ .aura-steps-dot-icon {
111
+ width: 8px;
112
+ height: 8px;
113
+ }
114
+ }
115
+ }
116
+
117
+ /* ===== Step Container ===== */
118
+ .aura-steps-step-container {
119
+ &:last-child {
120
+ .aura-steps-tail {
121
+ display: none;
122
+ }
123
+ }
124
+ }
125
+
126
+ /* ===== Step ===== */
127
+ .aura-steps-step {
128
+ transition: all var(--aura-duration-normal) cubic-bezier(0.4, 0, 0.2, 1);
129
+
130
+ &-disabled {
131
+ opacity: 0.5;
132
+ cursor: not-allowed;
133
+
134
+ .aura-steps-step-header {
135
+ cursor: not-allowed;
136
+ }
137
+ }
138
+ }
139
+
140
+ .aura-steps-step-header {
141
+ outline: none;
142
+
143
+ &:focus-visible {
144
+ .aura-steps-icon {
145
+ outline: 2px solid var(--aura-primary-500);
146
+ outline-offset: 2px;
147
+ }
148
+ }
149
+ }
150
+
151
+ .aura-steps-step-content {
152
+ margin-top: var(--aura-spacing-2);
153
+ text-align: center;
154
+ }
155
+
156
+ .aura-steps-step-title {
157
+ font-size: var(--aura-font-size-md);
158
+ font-weight: 500;
159
+ color: var(--aura-text);
160
+ line-height: 1.4;
161
+ }
162
+
163
+ .aura-steps-step-description {
164
+ font-size: var(--aura-font-size-sm);
165
+ color: var(--aura-text-secondary);
166
+ margin-top: 2px;
167
+ line-height: 1.4;
168
+ }
169
+
170
+ /* ===== Icon ===== */
171
+ .aura-steps-icon {
172
+ display: inline-flex;
173
+ align-items: center;
174
+ justify-content: center;
175
+ width: 32px;
176
+ height: 32px;
177
+ border-radius: var(--aura-radius-full);
178
+ font-size: var(--aura-font-size-sm);
179
+ font-weight: 600;
180
+ color: var(--aura-text-secondary);
181
+ background: var(--aura-bg-secondary);
182
+ border: 2px solid var(--aura-border);
183
+ transition: all var(--aura-duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
184
+
185
+ &-completed {
186
+ color: var(--aura-text-inverse);
187
+ background: var(--aura-primary-600);
188
+ border-color: var(--aura-primary-600);
189
+ }
190
+
191
+ &-active {
192
+ color: var(--aura-primary-700);
193
+ border-color: var(--aura-primary-600);
194
+ background: var(--aura-primary-50);
195
+ box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
196
+ }
197
+ }
198
+
199
+ .aura-steps-number {
200
+ line-height: 1;
201
+ }
202
+
203
+ .aura-steps-check {
204
+ display: inline-flex;
205
+ align-items: center;
206
+ justify-content: center;
207
+ line-height: 1;
208
+ }
209
+
210
+ /* ===== Variant: dot ===== */
211
+ .aura-steps-dot {
212
+ .aura-steps-icon {
213
+ width: auto;
214
+ height: auto;
215
+ background: transparent;
216
+ border: none;
217
+ }
218
+
219
+ .aura-steps-dot-icon {
220
+ display: inline-block;
221
+ width: 10px;
222
+ height: 10px;
223
+ border-radius: var(--aura-radius-full);
224
+ background: var(--aura-border);
225
+ transition: all var(--aura-duration-normal)
226
+ cubic-bezier(0.34, 1.56, 0.64, 1);
227
+ }
228
+
229
+ .aura-steps-icon-active .aura-steps-dot-icon {
230
+ background: var(--aura-primary-600);
231
+ box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
232
+ }
233
+
234
+ .aura-steps-icon-completed .aura-steps-dot-icon {
235
+ background: var(--aura-primary-600);
236
+ }
237
+ }
238
+
239
+ /* ===== Variant: navigation ===== */
240
+ .aura-steps-navigation {
241
+ .aura-steps-step-container {
242
+ position: relative;
243
+ }
244
+
245
+ .aura-steps-step-active {
246
+ .aura-steps-step-title {
247
+ color: var(--aura-primary-700);
248
+ font-weight: 600;
249
+ }
250
+ }
251
+
252
+ .aura-steps-step-completed {
253
+ .aura-steps-step-title {
254
+ color: var(--aura-text-secondary);
255
+ }
256
+ }
257
+
258
+ /* 底部横线 */
259
+ .aura-steps-tail {
260
+ height: 3px;
261
+ border-radius: 2px;
262
+ top: auto;
263
+ bottom: 0;
264
+ left: 0;
265
+ right: 0;
266
+
267
+ &-completed {
268
+ background: var(--aura-primary-600);
269
+ }
270
+ }
271
+
272
+ .aura-steps-step {
273
+ padding-bottom: var(--aura-spacing-2);
274
+ position: relative;
275
+
276
+ &::after {
277
+ content: '';
278
+ position: absolute;
279
+ bottom: 0;
280
+ left: 0;
281
+ right: 0;
282
+ height: 3px;
283
+ background: var(--aura-border);
284
+ border-radius: 2px;
285
+ transition: background var(--aura-duration-normal)
286
+ cubic-bezier(0.4, 0, 0.2, 1);
287
+ }
288
+
289
+ &-active::after {
290
+ background: var(--aura-primary-600);
291
+ }
292
+
293
+ &-completed::after {
294
+ background: var(--aura-primary-600);
295
+ }
296
+ }
297
+
298
+ .aura-steps-tail {
299
+ display: none;
300
+ }
301
+ }
302
+
303
+ /* ===== vertical 模式下 steps-step-content 对齐 ===== */
304
+ .aura-steps-vertical {
305
+ .aura-steps-step-content {
306
+ text-align: left;
307
+ margin-top: 0;
308
+ }
309
+ }
310
+
311
+ /* ===== 暗色模式 ===== */
312
+ [data-theme='dark'] {
313
+ .aura-steps-icon {
314
+ color: var(--aura-text-secondary);
315
+ background: var(--aura-bg-tertiary);
316
+ border-color: var(--aura-border);
317
+
318
+ &-completed {
319
+ color: var(--aura-text-inverse);
320
+ background: var(--aura-primary-600);
321
+ border-color: var(--aura-primary-600);
322
+ }
323
+
324
+ &-active {
325
+ color: var(--aura-primary-400);
326
+ border-color: var(--aura-primary-500);
327
+ background: rgba(124, 58, 237, 0.1);
328
+ box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
329
+ }
330
+ }
331
+
332
+ .aura-steps-step-title {
333
+ color: var(--aura-text);
334
+ }
335
+
336
+ .aura-steps-step-description {
337
+ color: var(--aura-text-tertiary);
338
+ }
339
+
340
+ .aura-steps-tail-pending {
341
+ background: var(--aura-border);
342
+ }
343
+
344
+ .aura-steps-navigation {
345
+ .aura-steps-step-active {
346
+ .aura-steps-step-title {
347
+ color: var(--aura-primary-400);
348
+ }
349
+ }
350
+
351
+ .aura-steps-step::after {
352
+ background: var(--aura-border);
353
+ }
354
+
355
+ .aura-steps-step-active::after,
356
+ .aura-steps-step-completed::after {
357
+ background: var(--aura-primary-500);
358
+ }
359
+ }
360
+
361
+ .aura-steps-dot {
362
+ .aura-steps-dot-icon {
363
+ background: var(--aura-border);
364
+ }
365
+
366
+ .aura-steps-icon-active .aura-steps-dot-icon {
367
+ background: var(--aura-primary-500);
368
+ }
369
+
370
+ .aura-steps-icon-completed .aura-steps-dot-icon {
371
+ background: var(--aura-primary-500);
372
+ }
373
+ }
374
+ }
375
+
376
+ /* ===== 出错态 ===== */
377
+ .aura-steps-step-error {
378
+ .aura-steps-icon {
379
+ border-color: var(--aura-error);
380
+ color: var(--aura-error);
381
+ }
382
+
383
+ .aura-steps-step-title {
384
+ color: var(--aura-error);
385
+ }
386
+ }
387
+
388
+ /* ===== 副标题 ===== */
389
+ .aura-steps-step-subtitle {
390
+ margin-left: var(--aura-spacing-2);
391
+ font-size: var(--aura-font-size-sm);
392
+ font-weight: 400;
393
+ color: var(--aura-text-tertiary);
394
+ }
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ /**
3
+ * Switch 的可访问性依赖调用方通过 `aria-label` / `aria-labelledby` 提供名称,
4
+ * 因此这里继承 button 的原生属性并向下转发(`onChange` 因签名不同而排除)。
5
+ */
6
+ export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
7
+ /** 开关尺寸
8
+ * @default 'md'
9
+ */
10
+ size?: 'sm' | 'md' | 'lg';
11
+ /** 是否禁用 */
12
+ disabled?: boolean;
13
+ /** 是否加载中 */
14
+ loading?: boolean;
15
+ /** 是否选中(受控) */
16
+ checked?: boolean;
17
+ /** 默认是否选中 */
18
+ defaultChecked?: boolean;
19
+ /** 选中时显示的内容 */
20
+ checkedChildren?: React.ReactNode;
21
+ /** 未选中时显示的内容 */
22
+ unCheckedChildren?: React.ReactNode;
23
+ /** 切换回调 */
24
+ onChange?: (checked: boolean) => void;
25
+ /** 自定义类名 */
26
+ className?: string;
27
+ /** 自定义样式 */
28
+ style?: React.CSSProperties;
29
+ }
30
+ export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,56 @@
1
+ import React, { forwardRef, useState, useCallback } from 'react';
2
+ import { classNames, prefixCls } from '@aura-react-comp/shared';
3
+ import "./index.less";
4
+
5
+ /**
6
+ * Switch 的可访问性依赖调用方通过 `aria-label` / `aria-labelledby` 提供名称,
7
+ * 因此这里继承 button 的原生属性并向下转发(`onChange` 因签名不同而排除)。
8
+ */
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ export const Switch = /*#__PURE__*/forwardRef(({
12
+ size = 'md',
13
+ disabled = false,
14
+ loading = false,
15
+ checked: controlledChecked,
16
+ defaultChecked = false,
17
+ checkedChildren,
18
+ unCheckedChildren,
19
+ onChange,
20
+ className,
21
+ style,
22
+ ...rest
23
+ }, ref) => {
24
+ const isControlled = controlledChecked !== undefined;
25
+ const [internalChecked, setInternalChecked] = useState(defaultChecked);
26
+ const checked = isControlled ? controlledChecked : internalChecked;
27
+ const handleClick = useCallback(() => {
28
+ if (disabled || loading) return;
29
+ if (!isControlled) {
30
+ setInternalChecked(!checked);
31
+ }
32
+ onChange?.(!checked);
33
+ }, [checked, disabled, loading, isControlled, onChange]);
34
+ const cls = classNames(prefixCls('switch'), prefixCls(`switch-${size}`), checked && prefixCls('switch-checked'), disabled && prefixCls('switch-disabled'), loading && prefixCls('switch-loading'), className);
35
+ return /*#__PURE__*/_jsxs("button", {
36
+ ref: ref,
37
+ type: "button",
38
+ ...rest,
39
+ role: "switch",
40
+ "aria-checked": checked,
41
+ className: cls,
42
+ style: style,
43
+ onClick: handleClick,
44
+ disabled: disabled,
45
+ children: [/*#__PURE__*/_jsx("span", {
46
+ className: prefixCls('switch-inner'),
47
+ children: checked ? checkedChildren : unCheckedChildren
48
+ }), /*#__PURE__*/_jsx("span", {
49
+ className: prefixCls('switch-handle'),
50
+ children: loading && /*#__PURE__*/_jsx("span", {
51
+ className: prefixCls('switch-loading-icon')
52
+ })
53
+ })]
54
+ });
55
+ });
56
+ Switch.displayName = 'Switch';
@@ -0,0 +1,160 @@
1
+ .aura-switch {
2
+ position: relative;
3
+ display: inline-flex;
4
+ align-items: center;
5
+ border: none;
6
+ background: var(--aura-gray-300);
7
+ border-radius: var(--aura-radius-full);
8
+ cursor: pointer;
9
+ transition:
10
+ background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
11
+ box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
12
+ box-sizing: border-box;
13
+ padding: 0;
14
+ vertical-align: middle;
15
+ user-select: none;
16
+
17
+ &:hover:not(.aura-switch-disabled):not(.aura-switch-loading) {
18
+ box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
19
+ }
20
+
21
+ // 内部文字区域
22
+ &-inner {
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ color: var(--aura-text-inverse);
27
+ font-size: var(--aura-font-size-xs);
28
+ line-height: 1;
29
+ overflow: hidden;
30
+ transition: opacity var(--aura-duration-normal) var(--aura-easing);
31
+ }
32
+
33
+ // 圆点手柄
34
+ &-handle {
35
+ position: absolute;
36
+ top: 2px;
37
+ left: 2px;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ border-radius: 50%;
42
+ background: var(--aura-text-inverse);
43
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
44
+ transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
45
+ }
46
+
47
+ // 选中状态
48
+ &&-checked {
49
+ background: var(--aura-primary-700);
50
+
51
+ .aura-switch-handle {
52
+ transform: translateX(calc(100% + 2px));
53
+ }
54
+
55
+ &:hover:not(.aura-switch-disabled):not(.aura-switch-loading) {
56
+ box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
57
+ }
58
+ }
59
+
60
+ // 禁用状态
61
+ &&-disabled {
62
+ opacity: 0.4;
63
+ cursor: not-allowed;
64
+ }
65
+
66
+ // 加载状态
67
+ &&-loading {
68
+ cursor: not-allowed;
69
+ }
70
+
71
+ // 尺寸:sm 28×16px
72
+ &&-sm {
73
+ width: 28px;
74
+ height: 16px;
75
+
76
+ .aura-switch-inner {
77
+ margin: 0 4px;
78
+ font-size: 10px;
79
+ }
80
+ .aura-switch-handle {
81
+ width: 12px;
82
+ height: 12px;
83
+ }
84
+
85
+ &.aura-switch-checked {
86
+ .aura-switch-handle {
87
+ transform: translateX(12px);
88
+ }
89
+ }
90
+ }
91
+
92
+ // 尺寸:md 40×22px
93
+ &&-md {
94
+ width: 40px;
95
+ height: 22px;
96
+
97
+ .aura-switch-inner {
98
+ margin: 0 8px;
99
+ }
100
+ .aura-switch-handle {
101
+ width: 18px;
102
+ height: 18px;
103
+ }
104
+
105
+ &.aura-switch-checked {
106
+ .aura-switch-handle {
107
+ transform: translateX(18px);
108
+ }
109
+ }
110
+ }
111
+
112
+ // 尺寸:lg 52×28px
113
+ &&-lg {
114
+ width: 52px;
115
+ height: 28px;
116
+
117
+ .aura-switch-inner {
118
+ margin: 0 10px;
119
+ font-size: var(--aura-font-size-sm);
120
+ }
121
+ .aura-switch-handle {
122
+ width: 24px;
123
+ height: 24px;
124
+ }
125
+
126
+ &.aura-switch-checked {
127
+ .aura-switch-handle {
128
+ transform: translateX(24px);
129
+ }
130
+ }
131
+ }
132
+
133
+ // 加载旋转图标
134
+ &-loading-icon {
135
+ display: inline-block;
136
+ width: 10px;
137
+ height: 10px;
138
+ border: 2px solid var(--aura-primary-700);
139
+ border-right-color: transparent;
140
+ border-radius: 50%;
141
+ animation: aura-spin 0.6s linear infinite;
142
+ }
143
+ }
144
+
145
+ // 暗色模式光晕效果
146
+ [data-theme='dark'] {
147
+ .aura-switch {
148
+ &:hover:not(.aura-switch-disabled):not(.aura-switch-loading) {
149
+ box-shadow: 0 0 8px rgba(124, 58, 237, 0.15);
150
+ }
151
+
152
+ &.aura-switch-checked {
153
+ box-shadow: 0 0 16px rgba(124, 58, 237, 0.35);
154
+
155
+ &:hover:not(.aura-switch-disabled):not(.aura-switch-loading) {
156
+ box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
157
+ }
158
+ }
159
+ }
160
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ export interface TabItemProps {
3
+ /** 唯一标识,用于匹配激活状态 */
4
+ tabKey: string;
5
+ /** 选项卡标题 */
6
+ title: React.ReactNode;
7
+ /** 是否禁用 */
8
+ disabled?: boolean;
9
+ /** 选项卡内容 */
10
+ children?: React.ReactNode;
11
+ }
12
+ /** 内部组件:单个选项卡面板 */
13
+ declare const TabItem: React.FC<TabItemProps>;
14
+ export interface TabsProps {
15
+ /** 默认激活的 tabKey */
16
+ defaultActiveKey?: string;
17
+ /** 受控激活的 tabKey */
18
+ activeKey?: string;
19
+ /** 变体样式
20
+ * @default 'default'
21
+ */
22
+ variant?: 'default' | 'card' | 'pill';
23
+ /** 尺寸
24
+ * @default 'md'
25
+ */
26
+ size?: 'sm' | 'md' | 'lg';
27
+ /** 切换回调 */
28
+ onChange?: (key: string) => void;
29
+ /** 切换后是否销毁非激活面板;默认保留已访问面板的挂载状态(保留表单等内部状态) */
30
+ destroyInactiveTabPane?: boolean;
31
+ /** 自定义类名 */
32
+ className?: string;
33
+ /** 自定义样式 */
34
+ style?: React.CSSProperties;
35
+ /** 子元素 */
36
+ children?: React.ReactNode;
37
+ }
38
+ export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
39
+ export interface TabsComponent extends React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> {
40
+ Tab: typeof TabItem;
41
+ }
42
+ export declare const TabsWithSub: TabsComponent;
43
+ export { TabItem };
44
+ declare const _default: TabsComponent;
45
+ export default _default;