Skip to content

Commit 4fc1364

Browse files
committed
feat(platform): status-dot support wave animation
1 parent 3ccc7b1 commit 4fc1364

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

packages/platform/src/app/components/status-dot/StatusDot.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getClassName } from '@react-devui/utils';
33
export interface AppStatusDotProps extends React.HTMLAttributes<HTMLDivElement> {
44
aTheme?: 'primary' | 'success' | 'warning' | 'danger';
55
aColor?: string;
6+
aWave?: boolean;
67
aSize?: string | number;
78
}
89

@@ -11,6 +12,7 @@ export function AppStatusDot(props: AppStatusDotProps): JSX.Element | null {
1112
children,
1213
aTheme,
1314
aColor,
15+
aWave = false,
1416
aSize,
1517

1618
...restProps
@@ -21,6 +23,7 @@ export function AppStatusDot(props: AppStatusDotProps): JSX.Element | null {
2123
{...restProps}
2224
className={getClassName(restProps.className, 'app-status-dot', {
2325
[`t-${aTheme}`]: aTheme,
26+
'app-status-dot--wave': aWave,
2427
})}
2528
style={{
2629
...restProps.style,

packages/platform/src/app/routes/list/standard-table/StandardTable.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ export default function StandardTable(): JSX.Element | null {
311311
<DTable.Td>{data.model}</DTable.Td>
312312
<DTable.Td>{data.price}</DTable.Td>
313313
<DTable.Td dNowrap>
314-
<AppStatusDot aTheme={data.status === 0 ? 'success' : data.status === 1 ? 'warning' : 'danger'}>
314+
<AppStatusDot
315+
aTheme={data.status === 0 ? 'success' : data.status === 1 ? 'warning' : 'danger'}
316+
aWave={data.status === 2}
317+
>
315318
{data.status === 0 ? 'Normal' : data.status === 1 ? 'Failure' : 'Alarm'}
316319
</AppStatusDot>
317320
</DTable.Td>

packages/platform/src/styles/components/status-dot.scss

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1+
@keyframes status-dot-wave {
2+
0% {
3+
opacity: 0.5;
4+
transform: scale(0.8);
5+
}
6+
7+
100% {
8+
opacity: 0;
9+
transform: scale(2.4);
10+
}
11+
}
12+
113
@include b(status-dot) {
14+
--app-status-dot-color: var(--#{$rd-prefix}tag-background-color-fill);
15+
216
display: inline-flex;
317
gap: 0 8px;
418
align-items: center;
@@ -10,10 +24,24 @@
1024
}
1125
}
1226

27+
@include m(wave) {
28+
@include e(dot) {
29+
&::after {
30+
position: absolute;
31+
inset: 0;
32+
content: '';
33+
border: 1px solid var(--app-status-dot-color);
34+
border-radius: 50%;
35+
animation: status-dot-wave 1.2s ease-in-out infinite;
36+
}
37+
}
38+
}
39+
1340
@include e(dot) {
41+
position: relative;
1442
width: 6px;
1543
height: 6px;
16-
background-color: var(--app-status-dot-color, var(--#{$rd-prefix}tag-background-color-fill));
44+
background-color: var(--app-status-dot-color);
1745
border-radius: 50%;
1846
}
1947
}

0 commit comments

Comments
 (0)