Add Spinner component

Co-Authored-By: Kyuuhachi <caagr98@gmail.com>
This commit is contained in:
TheGreenPig 2024-09-18 01:49:16 +02:00
parent f20de977b3
commit 754802e212
2 changed files with 24 additions and 1 deletions

View file

@ -49,6 +49,8 @@ export let ScrollerThin: t.ScrollerThin;
export let Clickable: t.Clickable;
export let Avatar: t.Avatar;
export let FocusLock: t.FocusLock;
export let Spinner: t.Spinner;
export let SpinnerType: t.SpinnerType;
// token lagger real
/** css colour resolver stuff, no clue what exactly this does, just copied usage from Discord */
export let useToken: t.useToken;
@ -82,7 +84,9 @@ waitFor(["FormItem", "Button"], m => {
Clickable,
Avatar,
FocusLock,
Heading
Heading,
Spinner,
SpinnerType,
} = m);
Forms = m;
});

View file

@ -502,3 +502,22 @@ export type Avatar = ComponentType<PropsWithChildren<{
type FocusLock = ComponentType<PropsWithChildren<{
containerRef: RefObject<HTMLElement>;
}>>;
export declare enum SpinnerType {
WANDERING_CUBES = "wanderingCubes",
CHASING_DOTS = "chasingDots",
PULSING_ELLIPSIS = "pulsingEllipsis",
SPINNING_CIRCLE = "spinningCircle",
SPINNING_CIRCLE_SIMPLE = "spinningCircleSimple",
LOW_MOTION = "lowMotion",
}
export type Spinner = ComponentType<{
type?: SpinnerType;
animated?: boolean;
className?: string;
itemClassName?: string;
"aria-label"?: string;
}> & {
Type: typeof SpinnerType;
};