Update loading components

This commit is contained in:
2026-02-24 22:16:46 -05:00
parent a61e7ce19a
commit 637b3a0c34
43 changed files with 1363 additions and 930 deletions

View File

@@ -1,21 +1,30 @@
import type { LoadingDotsProps } from "$/types/LoadingTypes";
import { usePrefersReducedMotion } from "$/util/AccessibilityUtil";
export default function CircleRotatingDots({
size,
width,
height,
className,
animationDuration = 1.5,
animationDuration = 1500,
color,
stroke,
fill
}: LoadingDotsProps){
fill,
ariaLabel = "Loading"
}: Readonly<LoadingDotsProps>){
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/8-dots-rotate.svg
const reducedMotion = usePrefersReducedMotion();
const dur = reducedMotion ? animationDuration / 100 : animationDuration / 1000;
return (
<svg
width={width}
height={height}
width={size ?? width}
height={size ?? height}
role="status"
aria-live="polite"
aria-label={ariaLabel}
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
>
@@ -25,69 +34,69 @@ export default function CircleRotatingDots({
cy="12"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="21"
cy="12"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="12"
cy="21"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="12"
cy="3"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="5.64"
cy="5.64"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="18.36"
cy="18.36"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="5.64"
cy="18.36"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<circle
cx="18.36"
cy="5.64"
r="2"
className={className}
stroke={stroke}
fill={fill}
stroke={color ?? stroke}
fill={color ?? fill}
/>
<animateTransform
attributeName="transform"
type="rotate"
dur={animationDuration}
dur={dur}
values="0 12 12;360 12 12"
repeatCount="indefinite"
/>