@rainbow-oh/yee-c 0.8.13 → 0.8.15
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/cjs/Pagination/style/index.less +4 -0
- package/dist/cjs/Progress/circle.js +1 -1
- package/dist/cjs/Progress/line.js +1 -1
- package/dist/cjs/Progress/progress.js +2 -0
- package/dist/cjs/Progress/steps.js +1 -1
- package/dist/cjs/Search/search.js +45 -16
- package/dist/cjs/Select/interface.d.ts +2 -1
- package/dist/cjs/Spin/demo/types.js +1 -1
- package/dist/cjs/Spin/indicator.d.ts +1 -1
- package/dist/cjs/Spin/indicator.js +148 -2
- package/dist/cjs/Spin/interface.d.ts +1 -1
- package/dist/cjs/Spin/style/index.less +88 -8
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Pagination/style/index.less +4 -0
- package/dist/esm/Progress/circle.js +2 -1
- package/dist/esm/Progress/line.js +2 -1
- package/dist/esm/Progress/progress.js +2 -0
- package/dist/esm/Progress/steps.js +6 -1
- package/dist/esm/Search/search.js +31 -7
- package/dist/esm/Select/interface.d.ts +2 -1
- package/dist/esm/Spin/demo/types.js +7 -1
- package/dist/esm/Spin/indicator.d.ts +1 -1
- package/dist/esm/Spin/indicator.js +141 -2
- package/dist/esm/Spin/interface.d.ts +1 -1
- package/dist/esm/Spin/style/index.less +88 -8
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +1 -1
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Pagination/style/index.less +4 -0
- package/src/Progress/circle.tsx +1 -1
- package/src/Progress/line.tsx +1 -1
- package/src/Progress/progress.tsx +2 -0
- package/src/Progress/steps.tsx +3 -1
- package/src/Search/search.tsx +33 -4
- package/src/Select/interface.ts +2 -1
- package/src/Spin/demo/types.tsx +15 -0
- package/src/Spin/index.en-US.md +7 -10
- package/src/Spin/index.zh-CN.md +7 -10
- package/src/Spin/indicator.tsx +167 -1
- package/src/Spin/interface.ts +1 -1
- package/src/Spin/style/index.less +88 -8
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/Progress/circle.tsx
CHANGED
|
@@ -111,7 +111,7 @@ const Circle = React.forwardRef<HTMLDivElement, CircleProps>((props, ref) => {
|
|
|
111
111
|
style={{ width, height: width }}
|
|
112
112
|
ref={ref}
|
|
113
113
|
>
|
|
114
|
-
<svg className={`${prefixCls}-circle`} viewBox="0 0 120 120">
|
|
114
|
+
<svg className={`${prefixCls}-circle`} viewBox="0 0 120 120" aria-hidden="true">
|
|
115
115
|
<circle
|
|
116
116
|
className={`${prefixCls}-circle-trail`}
|
|
117
117
|
cx="60"
|
package/src/Progress/line.tsx
CHANGED
|
@@ -36,7 +36,7 @@ const Line = React.forwardRef<HTMLDivElement, LineProps>((props, ref) => {
|
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<div className={`${prefixCls}-outer`} ref={ref}>
|
|
39
|
-
<div className={`${prefixCls}-inner`} style={{ height: strokeWidth }}>
|
|
39
|
+
<div className={`${prefixCls}-inner`} style={{ height: strokeWidth }} aria-hidden="true">
|
|
40
40
|
<div
|
|
41
41
|
className={`${prefixCls}-bg`}
|
|
42
42
|
style={{ width: percent + '%', ...progressColor }}
|
|
@@ -106,6 +106,8 @@ const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(
|
|
|
106
106
|
aria-valuenow={percent}
|
|
107
107
|
aria-valuemin={0}
|
|
108
108
|
aria-valuemax={100}
|
|
109
|
+
aria-valuetext={`${percent}%`}
|
|
110
|
+
aria-label={status === 'error' ? `Progress: ${percent}%, error` : `Progress: ${percent}%`}
|
|
109
111
|
ref={ref}
|
|
110
112
|
{...dataAttrs}
|
|
111
113
|
>
|
package/src/Progress/steps.tsx
CHANGED
|
@@ -56,7 +56,9 @@ const Steps = React.forwardRef<HTMLDivElement, StepsProps>((props, ref) => {
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<div className={`${prefixCls}-steps`} ref={ref}>
|
|
59
|
-
{
|
|
59
|
+
<div aria-hidden="true" style={{ display: 'contents' }}>
|
|
60
|
+
{renderSteps()}
|
|
61
|
+
</div>
|
|
60
62
|
{showInfo && <span className={`${prefixCls}-text`}>{children}</span>}
|
|
61
63
|
</div>
|
|
62
64
|
);
|
package/src/Search/search.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import React, {
|
|
|
4
4
|
startTransition,
|
|
5
5
|
useContext,
|
|
6
6
|
useEffect,
|
|
7
|
+
useId,
|
|
7
8
|
useRef,
|
|
8
9
|
useState,
|
|
9
10
|
} from 'react';
|
|
@@ -55,6 +56,7 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
|
|
|
55
56
|
const [open, setOpen] = useState(false);
|
|
56
57
|
|
|
57
58
|
const popupRef = useRef<HTMLDivElement>(undefined);
|
|
59
|
+
const listboxId = useId();
|
|
58
60
|
|
|
59
61
|
const { focusedKey, onKeyDown } = useSelectKeyboard({
|
|
60
62
|
open,
|
|
@@ -130,8 +132,17 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
|
|
|
130
132
|
className={clsx(`${prefixCls}-clear-icon`, classNames?.clear)}
|
|
131
133
|
style={styles?.clear}
|
|
132
134
|
onClick={handleClear}
|
|
135
|
+
role="button"
|
|
136
|
+
aria-label="Clear search"
|
|
137
|
+
tabIndex={0}
|
|
138
|
+
onKeyDown={(e) => {
|
|
139
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
handleClear(e as unknown as React.MouseEvent<HTMLSpanElement>);
|
|
142
|
+
}
|
|
143
|
+
}}
|
|
133
144
|
>
|
|
134
|
-
<X size={14} />
|
|
145
|
+
<X size={14} aria-hidden="true" />
|
|
135
146
|
</span>
|
|
136
147
|
)}
|
|
137
148
|
{suffix}
|
|
@@ -174,8 +185,10 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
|
|
|
174
185
|
);
|
|
175
186
|
};
|
|
176
187
|
|
|
188
|
+
const hasPopup = Array.isArray(options) || Array.isArray(suggestions);
|
|
189
|
+
|
|
177
190
|
const popup = (
|
|
178
|
-
<div className={`${prefixCls}-popup`} tabIndex={0}>
|
|
191
|
+
<div className={`${prefixCls}-popup`} tabIndex={0} id={listboxId} role="listbox">
|
|
179
192
|
{Array.isArray(options) ? (
|
|
180
193
|
<List
|
|
181
194
|
focusedKey={focusedKey}
|
|
@@ -196,7 +209,15 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
|
|
|
196
209
|
|
|
197
210
|
return (
|
|
198
211
|
<Trigger popup={popup} open={open} onOpenChange={setOpen}>
|
|
199
|
-
<div
|
|
212
|
+
<div
|
|
213
|
+
className={getRootClassName()}
|
|
214
|
+
style={style}
|
|
215
|
+
role="combobox"
|
|
216
|
+
aria-expanded={hasPopup ? open : undefined}
|
|
217
|
+
aria-haspopup={hasPopup ? 'listbox' : undefined}
|
|
218
|
+
aria-owns={hasPopup && open ? listboxId : undefined}
|
|
219
|
+
aria-disabled={disabled || undefined}
|
|
220
|
+
>
|
|
200
221
|
{renderPrefix()}
|
|
201
222
|
<input
|
|
202
223
|
{...rest}
|
|
@@ -208,8 +229,16 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
|
|
|
208
229
|
placeholder={placeholder}
|
|
209
230
|
onChange={handleChange}
|
|
210
231
|
onKeyDown={onKeyDown}
|
|
232
|
+
role="searchbox"
|
|
233
|
+
aria-autocomplete={hasPopup ? 'list' : undefined}
|
|
234
|
+
aria-controls={hasPopup && open ? listboxId : undefined}
|
|
235
|
+
aria-activedescendant={
|
|
236
|
+
hasPopup && open && focusedKey != null
|
|
237
|
+
? String(focusedKey)
|
|
238
|
+
: undefined
|
|
239
|
+
}
|
|
211
240
|
/>
|
|
212
|
-
{loading ? <Spin variant="ring" size="small" /> : renderSuffix()}
|
|
241
|
+
{loading ? <Spin variant="ring" size="small" aria-label="Loading" /> : renderSuffix()}
|
|
213
242
|
</div>
|
|
214
243
|
</Trigger>
|
|
215
244
|
);
|
package/src/Select/interface.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TriggerProps } from '../Trigger';
|
|
1
2
|
import type { SelectorProps } from '../Selector';
|
|
2
3
|
import type { DataAttributeProps } from '../utils/types';
|
|
3
4
|
|
|
@@ -25,7 +26,7 @@ export type Option = {
|
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
export interface SelectProps
|
|
28
|
-
extends DataAttributeProps, Pick<SelectorProps, 'size'> {
|
|
29
|
+
extends DataAttributeProps, Pick<SelectorProps, 'size'>, Omit<TriggerProps, 'popup' | 'children'> {
|
|
29
30
|
/**
|
|
30
31
|
* Custom class name prefix
|
|
31
32
|
* */
|
package/src/Spin/demo/types.tsx
CHANGED
|
@@ -18,6 +18,21 @@ export default () => {
|
|
|
18
18
|
<Spin variant="spokes" />
|
|
19
19
|
<span>spokes</span>
|
|
20
20
|
</Space>
|
|
21
|
+
|
|
22
|
+
<Space>
|
|
23
|
+
<Spin variant="bounce" />
|
|
24
|
+
<span>bounce</span>
|
|
25
|
+
</Space>
|
|
26
|
+
|
|
27
|
+
<Space>
|
|
28
|
+
<Spin variant="pulse" />
|
|
29
|
+
<span>pulse</span>
|
|
30
|
+
</Space>
|
|
31
|
+
|
|
32
|
+
<Space>
|
|
33
|
+
<Spin variant="wheel" />
|
|
34
|
+
<span>wheel</span>
|
|
35
|
+
</Space>
|
|
21
36
|
</Space>
|
|
22
37
|
);
|
|
23
38
|
};
|
package/src/Spin/index.en-US.md
CHANGED
|
@@ -43,7 +43,7 @@ Used for page and block loading status.
|
|
|
43
43
|
| styles | `Partial<Record<'tip' \| 'indicator', React.CSSProperties>>` | Semantic structure styles | - |
|
|
44
44
|
| tip | `React.ReactNode` | Loading tip text | - |
|
|
45
45
|
| delay | `number` | Delay in milliseconds to show loading effect | - |
|
|
46
|
-
| variant | `'dot' \| 'ring' \| 'spokes'` | Indicator variant, `ring` for rotating circle, `spokes` for radiating lines | `'dot'` |
|
|
46
|
+
| variant | `'dot' \| 'ring' \| 'spokes' \| 'bounce' \| 'pulse' \| 'wheel'` | Indicator variant, `ring` for rotating circle, `spokes` for radiating lines, `bounce` for bouncing dots, `pulse` for pulsing circles, `wheel` for spokes with hollow center | `'dot'` |
|
|
47
47
|
| indicator | `React.ReactNode` | Loading indicator | - |
|
|
48
48
|
| mask | `boolean` | Whether to show mask | - |
|
|
49
49
|
| children | `React.ReactNode` | Children elements | - |
|
|
@@ -52,12 +52,9 @@ Used for page and block loading status.
|
|
|
52
52
|
|
|
53
53
|
| Type | Description |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
| spin | Spin type |
|
|
62
|
-
| spinningBubbles | Spinning bubbles type |
|
|
63
|
-
| spokes | Spokes type |
|
|
55
|
+
| dot | dot circle |
|
|
56
|
+
| ring | rotating circle |
|
|
57
|
+
| spokes | Spokes type |
|
|
58
|
+
| bounce | Bouncing dots |
|
|
59
|
+
| pulse | Pulsing circles |
|
|
60
|
+
| wheel | Spokes with hollow center |
|
package/src/Spin/index.zh-CN.md
CHANGED
|
@@ -43,7 +43,7 @@ toc: 'content'
|
|
|
43
43
|
| styles | `Partial<Record<'tip' \| 'indicator', React.CSSProperties>>` | 语义化结构样式 | - |
|
|
44
44
|
| tip | `React.ReactNode` | 加载状态的提示词 | - |
|
|
45
45
|
| delay | `number` | 延迟显示加载效果的时间(毫秒) | - |
|
|
46
|
-
| variant | `'dot' \| 'ring' \| 'spokes'` | 加载器样式变体,`ring` 为圆环转圈,`spokes`
|
|
46
|
+
| variant | `'dot' \| 'ring' \| 'spokes' \| 'bounce' \| 'pulse' \| 'wheel'` | 加载器样式变体,`ring` 为圆环转圈,`spokes` 为辐条旋转,`bounce` 为弹跳圆点,`pulse` 为脉冲圆圈,`wheel` 为带中心空圆的辐条 | `'dot'` |
|
|
47
47
|
| indicator | `React.ReactNode` | 加载器指示符 | - |
|
|
48
48
|
| mask | `boolean` | 是否显示遮罩 | - |
|
|
49
49
|
| children | `React.ReactNode` | 子元素 | - |
|
|
@@ -52,12 +52,9 @@ toc: 'content'
|
|
|
52
52
|
|
|
53
53
|
| 类型 | 描述 |
|
|
54
54
|
| --- | --- |
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
| spin | 旋转类型 |
|
|
62
|
-
| spinningBubbles | 旋转气泡类型 |
|
|
63
|
-
| spokes | 辐条类型 |
|
|
55
|
+
| dot | 原点旋转 |
|
|
56
|
+
| ring | 圆环转圈 |
|
|
57
|
+
| spokes | 辐条类型 |
|
|
58
|
+
| bounce | 弹跳圆点 |
|
|
59
|
+
| pulse | 脉冲圆圈 |
|
|
60
|
+
| wheel | 中空辐条(辐条离中心有距离,中间形成空圆) |
|
package/src/Spin/indicator.tsx
CHANGED
|
@@ -60,6 +60,7 @@ const SpokesSpinner: React.FC<SpinProps> = (props) => {
|
|
|
60
60
|
styles,
|
|
61
61
|
width,
|
|
62
62
|
height,
|
|
63
|
+
color
|
|
63
64
|
} = props;
|
|
64
65
|
|
|
65
66
|
const containerSize = sizeMap[size];
|
|
@@ -86,6 +87,7 @@ const SpokesSpinner: React.FC<SpinProps> = (props) => {
|
|
|
86
87
|
style={{
|
|
87
88
|
transform: `rotate(${i * (360 / count)}deg)`,
|
|
88
89
|
animationDelay: `${(i * 1) / count}s`,
|
|
90
|
+
backgroundColor: color,
|
|
89
91
|
}}
|
|
90
92
|
/>
|
|
91
93
|
))}
|
|
@@ -186,8 +188,163 @@ const DotSpinner: React.FC<SpinProps> = (props) => {
|
|
|
186
188
|
);
|
|
187
189
|
};
|
|
188
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Bounce spinner - three dots that bounce up and down sequentially
|
|
193
|
+
*/
|
|
194
|
+
const BounceSpinner: React.FC<SpinProps> = (props) => {
|
|
195
|
+
const {
|
|
196
|
+
prefixCls = 'yee-spin',
|
|
197
|
+
size = 'default',
|
|
198
|
+
classNames,
|
|
199
|
+
styles,
|
|
200
|
+
width,
|
|
201
|
+
height,
|
|
202
|
+
color,
|
|
203
|
+
} = props;
|
|
204
|
+
|
|
205
|
+
const containerSize = sizeMap[size];
|
|
206
|
+
const dotSizeMap = { small: 4, default: 6, large: 10 };
|
|
207
|
+
const dotSize = dotSizeMap[size];
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<div
|
|
211
|
+
className={clsx(
|
|
212
|
+
`${prefixCls}-indicator`,
|
|
213
|
+
`${prefixCls}-indicator-bounce`,
|
|
214
|
+
classNames?.indicator,
|
|
215
|
+
)}
|
|
216
|
+
style={{
|
|
217
|
+
width: width || containerSize,
|
|
218
|
+
height: height || containerSize,
|
|
219
|
+
...styles?.indicator,
|
|
220
|
+
}}
|
|
221
|
+
>
|
|
222
|
+
<div className={`${prefixCls}-bounce`}>
|
|
223
|
+
{[0, 1, 2].map((i) => (
|
|
224
|
+
<span
|
|
225
|
+
key={i}
|
|
226
|
+
className={`${prefixCls}-bounce-dot`}
|
|
227
|
+
style={{
|
|
228
|
+
width: dotSize,
|
|
229
|
+
height: dotSize,
|
|
230
|
+
animationDelay: `${i * 0.15}s`,
|
|
231
|
+
backgroundColor: color,
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
))}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Pulse spinner - a circle that pulses (scales up and fades out) repeatedly
|
|
242
|
+
*/
|
|
243
|
+
const PulseSpinner: React.FC<SpinProps> = (props) => {
|
|
244
|
+
const {
|
|
245
|
+
prefixCls = 'yee-spin',
|
|
246
|
+
size = 'default',
|
|
247
|
+
classNames,
|
|
248
|
+
styles,
|
|
249
|
+
width,
|
|
250
|
+
height,
|
|
251
|
+
color,
|
|
252
|
+
} = props;
|
|
253
|
+
|
|
254
|
+
const containerSize = sizeMap[size];
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div
|
|
258
|
+
className={clsx(
|
|
259
|
+
`${prefixCls}-indicator`,
|
|
260
|
+
`${prefixCls}-indicator-pulse`,
|
|
261
|
+
classNames?.indicator,
|
|
262
|
+
)}
|
|
263
|
+
style={{
|
|
264
|
+
width: width || containerSize,
|
|
265
|
+
height: height || containerSize,
|
|
266
|
+
...styles?.indicator,
|
|
267
|
+
}}
|
|
268
|
+
>
|
|
269
|
+
<span
|
|
270
|
+
className={`${prefixCls}-pulse-circle`}
|
|
271
|
+
style={{ backgroundColor: color }}
|
|
272
|
+
/>
|
|
273
|
+
<span
|
|
274
|
+
className={`${prefixCls}-pulse-circle ${prefixCls}-pulse-circle-delay`}
|
|
275
|
+
style={{ backgroundColor: color }}
|
|
276
|
+
/>
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Wheel spinner - similar to spokes but each line is offset from center,
|
|
283
|
+
* creating a visible hollow circle in the middle
|
|
284
|
+
*/
|
|
285
|
+
const WheelSpinner: React.FC<SpinProps> = (props) => {
|
|
286
|
+
const {
|
|
287
|
+
prefixCls = 'yee-spin',
|
|
288
|
+
size = 'default',
|
|
289
|
+
classNames,
|
|
290
|
+
styles,
|
|
291
|
+
width,
|
|
292
|
+
height,
|
|
293
|
+
color,
|
|
294
|
+
} = props;
|
|
295
|
+
|
|
296
|
+
const containerSize = sizeMap[size];
|
|
297
|
+
const count = 10;
|
|
298
|
+
const innerRadius = 0.38; // start at 38% from center (larger hollow area)
|
|
299
|
+
const spokeLength = containerSize * 0.22;
|
|
300
|
+
|
|
301
|
+
return (
|
|
302
|
+
<div
|
|
303
|
+
className={clsx(
|
|
304
|
+
`${prefixCls}-indicator`,
|
|
305
|
+
`${prefixCls}-indicator-wheel`,
|
|
306
|
+
classNames?.indicator,
|
|
307
|
+
)}
|
|
308
|
+
style={{
|
|
309
|
+
width: width || containerSize,
|
|
310
|
+
height: height || containerSize,
|
|
311
|
+
...styles?.indicator,
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
<div className={`${prefixCls}-wheel-spokes`}>
|
|
315
|
+
{Array.from({ length: count }, (_, i) => {
|
|
316
|
+
const angle = (i * 360) / count;
|
|
317
|
+
const rad = (angle * Math.PI) / 180;
|
|
318
|
+
// Position each spoke: starts at innerRadius from center
|
|
319
|
+
const cx = containerSize / 2;
|
|
320
|
+
const cy = containerSize / 2;
|
|
321
|
+
const x = cx + innerRadius * containerSize * Math.sin(rad);
|
|
322
|
+
const y = cy - innerRadius * containerSize * Math.cos(rad);
|
|
323
|
+
|
|
324
|
+
return (
|
|
325
|
+
<div
|
|
326
|
+
key={i}
|
|
327
|
+
className={`${prefixCls}-wheel-spoke`}
|
|
328
|
+
style={{
|
|
329
|
+
top: y,
|
|
330
|
+
left: x,
|
|
331
|
+
height: spokeLength,
|
|
332
|
+
marginLeft: -1,
|
|
333
|
+
transform: `rotate(${angle}deg)`,
|
|
334
|
+
transformOrigin: 'top center',
|
|
335
|
+
animationDelay: `${(i * 1.2) / count}s`,
|
|
336
|
+
backgroundColor: color,
|
|
337
|
+
}}
|
|
338
|
+
/>
|
|
339
|
+
);
|
|
340
|
+
})}
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
);
|
|
344
|
+
};
|
|
345
|
+
|
|
189
346
|
interface IndicatorProps extends SpinProps {
|
|
190
|
-
variant?: 'dot' | 'ring' | 'spokes';
|
|
347
|
+
variant?: 'dot' | 'ring' | 'spokes' | 'bounce' | 'pulse' | 'wheel';
|
|
191
348
|
}
|
|
192
349
|
|
|
193
350
|
const Indicator: React.FC<IndicatorProps> = ({ variant = 'dot', ...props }) => {
|
|
@@ -197,6 +354,15 @@ const Indicator: React.FC<IndicatorProps> = ({ variant = 'dot', ...props }) => {
|
|
|
197
354
|
if (variant === 'spokes') {
|
|
198
355
|
return <SpokesSpinner {...props} />;
|
|
199
356
|
}
|
|
357
|
+
if (variant === 'bounce') {
|
|
358
|
+
return <BounceSpinner {...props} />;
|
|
359
|
+
}
|
|
360
|
+
if (variant === 'pulse') {
|
|
361
|
+
return <PulseSpinner {...props} />;
|
|
362
|
+
}
|
|
363
|
+
if (variant === 'wheel') {
|
|
364
|
+
return <WheelSpinner {...props} />;
|
|
365
|
+
}
|
|
200
366
|
return <DotSpinner {...props} />;
|
|
201
367
|
};
|
|
202
368
|
|
package/src/Spin/interface.ts
CHANGED
|
@@ -43,10 +43,7 @@
|
|
|
43
43
|
display: block;
|
|
44
44
|
border-style: solid;
|
|
45
45
|
border-color: var(--yee-color-bg-layout, rgba(0, 0, 0, 8%));
|
|
46
|
-
border-top-color: var(
|
|
47
|
-
--yee-spin-default-color,
|
|
48
|
-
var(--yee-color-primary, #1677ff)
|
|
49
|
-
);
|
|
46
|
+
border-top-color: var(--m-indicator-dot-bg-color);
|
|
50
47
|
border-radius: 50%;
|
|
51
48
|
animation: yee-spin-ring-rotate 0.8s linear infinite;
|
|
52
49
|
}
|
|
@@ -67,10 +64,65 @@
|
|
|
67
64
|
height: 40%;
|
|
68
65
|
margin-left: -1px;
|
|
69
66
|
transform-origin: center bottom;
|
|
70
|
-
background-color: var(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
68
|
+
border-radius: 1px;
|
|
69
|
+
animation: yee-spin-spokes-fade 1.2s linear infinite;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-bounce {
|
|
74
|
+
@{pls}-bounce {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
gap: 3px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@{pls}-bounce-dot {
|
|
84
|
+
display: inline-block;
|
|
85
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
animation: yee-spin-bounce 0.6s ease-in-out infinite alternate;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-pulse {
|
|
92
|
+
@{pls}-pulse-circle {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
100
|
+
opacity: 0.6;
|
|
101
|
+
animation: yee-spin-pulse 1.5s ease-in-out infinite;
|
|
102
|
+
|
|
103
|
+
&-delay {
|
|
104
|
+
animation-delay: 0.5s;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-wheel {
|
|
110
|
+
@{pls}-wheel-hub {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@{pls}-wheel-spokes {
|
|
115
|
+
position: relative;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@{pls}-wheel-spoke {
|
|
121
|
+
position: absolute;
|
|
122
|
+
left: 50%;
|
|
123
|
+
width: 2px;
|
|
124
|
+
margin-left: -1px;
|
|
125
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
74
126
|
border-radius: 1px;
|
|
75
127
|
animation: yee-spin-spokes-fade 1.2s linear infinite;
|
|
76
128
|
}
|
|
@@ -174,3 +226,31 @@
|
|
|
174
226
|
opacity: 0.15;
|
|
175
227
|
}
|
|
176
228
|
}
|
|
229
|
+
|
|
230
|
+
@keyframes yee-spin-bounce {
|
|
231
|
+
0% {
|
|
232
|
+
transform: translateY(25%);
|
|
233
|
+
opacity: 0.4;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
100% {
|
|
237
|
+
transform: translateY(-25%);
|
|
238
|
+
opacity: 1;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@keyframes yee-spin-pulse {
|
|
243
|
+
0% {
|
|
244
|
+
transform: scale(0);
|
|
245
|
+
opacity: 0.6;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
50% {
|
|
249
|
+
opacity: 0.3;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
100% {
|
|
253
|
+
transform: scale(1);
|
|
254
|
+
opacity: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|