import { cssVarV2 } from '@toeverything/theme/v2'; import { assignInlineVars } from '@vanilla-extract/dynamic'; import clsx from 'clsx'; import { withUnit } from '../../utils/with-unit'; import { loading, rotateAnimation, speedVar } from './styles.css'; export interface LoadingProps { size?: number | string; speed?: number; progress?: number; strokeColor?: string; strokeWidth?: number; className?: string; } export const Loading = ({ size, speed = 1.2, progress = 0.2, strokeWidth = 4, strokeColor, className, }: LoadingProps) => { // allow `string` such as `16px` | `100%` | `1em` const sizeWithUnit = size ? withUnit(size, 'px') : '16px'; return ( ); };