💄(frontend) adapt loading spinner to match Robin's design
Update loading spinner component to follow Robin's design specifications, ensuring visual consistency with the established design system.
This commit is contained in:
committed by
aleb_the_flash
parent
25d4ede2dd
commit
3e9992bae3
@@ -1,40 +1,33 @@
|
|||||||
import { ProgressBar } from 'react-aria-components'
|
import { ProgressBar } from 'react-aria-components'
|
||||||
import { css } from '@/styled-system/css'
|
import { css } from '@/styled-system/css'
|
||||||
|
|
||||||
// FIXME - this component will be style after the designer review
|
|
||||||
export const Spinner = () => {
|
export const Spinner = () => {
|
||||||
const center = 16
|
const center = 14
|
||||||
const strokeWidth = 4
|
const strokeWidth = 3
|
||||||
const r = 16 - strokeWidth
|
const r = 14 - strokeWidth
|
||||||
const c = 2 * r * Math.PI
|
const c = 2 * r * Math.PI
|
||||||
return (
|
return (
|
||||||
<ProgressBar aria-label="Loading…" value={75}>
|
<ProgressBar aria-label="Loading…" value={30}>
|
||||||
{({ percentage }) => (
|
{({ percentage }) => (
|
||||||
<>
|
<>
|
||||||
<svg
|
<svg
|
||||||
width={64}
|
width={56}
|
||||||
height={64}
|
height={56}
|
||||||
viewBox="0 0 32 32"
|
viewBox="0 0 28 28"
|
||||||
fill="none"
|
fill="none"
|
||||||
strokeWidth={strokeWidth}
|
strokeWidth={strokeWidth}
|
||||||
>
|
>
|
||||||
<circle
|
<circle
|
||||||
cx={center}
|
cx={center}
|
||||||
cy={center}
|
cy={center}
|
||||||
r={r - (strokeWidth / 2 - 0.25)}
|
r={r}
|
||||||
|
strokeDasharray={0}
|
||||||
|
strokeDashoffset={0}
|
||||||
|
strokeLinecap="round"
|
||||||
className={css({
|
className={css({
|
||||||
stroke: 'primary.300',
|
stroke: 'primary.100',
|
||||||
strokeWidth: 0.5,
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
<circle
|
|
||||||
cx={center}
|
|
||||||
cy={center}
|
|
||||||
r={r + (strokeWidth / 2 - 0.25)}
|
|
||||||
className={css({
|
|
||||||
stroke: 'primary.300',
|
|
||||||
strokeWidth: 0.5,
|
|
||||||
})}
|
})}
|
||||||
|
style={{}}
|
||||||
/>
|
/>
|
||||||
<circle
|
<circle
|
||||||
cx={center}
|
cx={center}
|
||||||
@@ -44,10 +37,10 @@ export const Spinner = () => {
|
|||||||
strokeDashoffset={percentage && c - (percentage / 100) * c}
|
strokeDashoffset={percentage && c - (percentage / 100) * c}
|
||||||
strokeLinecap="round"
|
strokeLinecap="round"
|
||||||
className={css({
|
className={css({
|
||||||
stroke: 'primary.900',
|
stroke: 'primary.800',
|
||||||
})}
|
})}
|
||||||
style={{
|
style={{
|
||||||
animation: `rotate 1s linear infinite`,
|
animation: `rotate 1s ease-in-out infinite`,
|
||||||
transformOrigin: 'center',
|
transformOrigin: 'center',
|
||||||
transition: 'transform 16ms linear',
|
transition: 'transform 16ms linear',
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user