-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🎨 New design and cleanup for CircleLoader (#17582)
* New design and cleanup for CircleLoader * Adjust snapshots
- Loading branch information
Showing
5 changed files
with
49 additions
and
55 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
airbyte-webapp/src/components/StatusIcon/CircleLoader.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use "../../scss/colors"; | ||
|
||
@keyframes spinning { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
|
||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.spinner { | ||
animation: spinning 1000ms linear infinite normal forwards; | ||
} | ||
|
||
.centerDot { | ||
fill: colors.$blue; | ||
} | ||
|
||
:export { | ||
// Export colors to be used in SVG gradients | ||
gradientStart: colors.$blue; | ||
gradientStop: colors.$blue-transparent; | ||
} |
61 changes: 15 additions & 46 deletions
61
airbyte-webapp/src/components/StatusIcon/CircleLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,34 @@ | ||
import styled, { keyframes } from "styled-components"; | ||
import styles from "./CircleLoader.module.scss"; | ||
|
||
const spinAnimation = keyframes` | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
`; | ||
|
||
const SpinnerSVG = styled.svg` | ||
animation: ${spinAnimation} 1000ms linear infinite normal forwards; | ||
`; | ||
|
||
interface Props { | ||
interface CircleLoaderProps { | ||
title?: string; | ||
} | ||
|
||
const CircleLoader = ({ title }: Props): JSX.Element => ( | ||
<SpinnerSVG | ||
viewBox="0 0 16 16" | ||
width="18" | ||
height="18" | ||
shape-rendering="geometricPrecision" | ||
text-rendering="geometricPrecision" | ||
role="img" | ||
data-icon="circle-loader" | ||
> | ||
export const CircleLoader = ({ title }: CircleLoaderProps): JSX.Element => ( | ||
<svg className={styles.spinner} role="img" viewBox="0 0 16 16" width="18" height="18" data-icon="circle-loader"> | ||
<defs> | ||
<linearGradient | ||
id="eDwmAshgIQE3-fill" | ||
id="circleLoaderGradient" | ||
x1="4.25" | ||
y1="0.5" | ||
x2="4.25" | ||
y2="15.5" | ||
spreadMethod="pad" | ||
gradientUnits="userSpaceOnUse" | ||
gradientTransform="translate(0 0)" | ||
> | ||
<stop id="eDwmAshgIQE3-fill-0" offset="17.9167%" stopColor="#d1d1db" /> | ||
<stop id="eDwmAshgIQE3-fill-1" offset="100%" stopColor="rgba(209,209,219,0)" /> | ||
<stop offset="0%" stopColor={styles.gradientStart} /> | ||
<stop offset="100%" stopColor={styles.gradientStop} /> | ||
</linearGradient> | ||
</defs> | ||
{title && <title>{title}</title>} | ||
<g> | ||
<g> | ||
<path | ||
d="M8,0.5C3.85775,0.5,0.5,3.85775,0.5,8s3.35775,7.5,7.5,7.5v-2c-3.03768,0-5.5-2.4623-5.5-5.5s2.46232-5.5,5.5-5.5v-2Z" | ||
clipRule="evenodd" | ||
fill="url(#eDwmAshgIQE3-fill)" | ||
fillRule="evenodd" | ||
/> | ||
<path | ||
d="M8,15.5c4.1423,0,7.5-3.3577,7.5-7.5s-3.3577-7.5-7.5-7.5v2c3.0377,0,5.5,2.46232,5.5,5.5s-2.4623,5.5-5.5,5.5v2Z" | ||
clipRule="evenodd" | ||
fill="#d1d1db" | ||
fillRule="evenodd" | ||
/> | ||
</g> | ||
<path | ||
d="M8,0.5C3.85775,0.5,0.5,3.85775,0.5,8s3.35775,7.5,7.5,7.5v-2c-3.03768,0-5.5-2.4623-5.5-5.5s2.46232-5.5,5.5-5.5v-2Z" | ||
clipRule="evenodd" | ||
fill="url(#circleLoaderGradient)" | ||
fillRule="evenodd" | ||
/> | ||
<circle cx="8" cy="8" r="3" className={styles.centerDot} /> | ||
</g> | ||
</SpinnerSVG> | ||
</svg> | ||
); | ||
|
||
export default CircleLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.