Skip to content

Commit

Permalink
refactor(Spinner): update default color to 'default', adjust size to …
Browse files Browse the repository at this point in the history
…'lg', and modify example button colors
  • Loading branch information
SutuSebastian committed Jan 13, 2025
1 parent aee2985 commit 23138b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions apps/web/examples/spinner/spinner.loadingButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export function Component() {
return (
<div className="flex flex-row gap-3">
<Button>
<Spinner aria-label="Spinner button example" size="sm" />
<Spinner aria-label="Spinner button example" size="sm" light />
<span className="pl-3">Loading...</span>
</Button>
<Button color="gray">
<Button color="alternative">
<Spinner aria-label="Alternate spinner button example" size="sm" />
<span className="pl-3">Loading...</span>
</Button>
Expand All @@ -24,10 +24,10 @@ export function Component() {
return (
<div className="flex flex-row gap-3">
<Button>
<Spinner aria-label="Spinner button example" size="sm" />
<Spinner aria-label="Spinner button example" size="sm" light />
<span className="pl-3">Loading...</span>
</Button>
<Button color="gray">
<Button color="alternative">
<Spinner aria-label="Alternate spinner button example" size="sm" />
<span className="pl-3">Loading...</span>
</Button>
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/components/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface SpinnerTheme {
export interface SpinnerColors
extends Pick<FlowbiteColors, "failure" | "gray" | "info" | "pink" | "purple" | "success" | "warning"> {
[key: string]: string;
default: string;
}

export interface SpinnerSizes extends Pick<FlowbiteSizes, "xs" | "sm" | "md" | "lg" | "xl"> {
Expand All @@ -42,9 +43,9 @@ export interface SpinnerProps extends Omit<ComponentProps<"span">, "color">, The

export function Spinner({
className,
color = "info",
color = "default",
light,
size = "md",
size = "lg",
theme: customTheme,
clearTheme,
applyTheme,
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/components/Spinner/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { SpinnerTheme } from "./Spinner";
export const spinnerTheme: SpinnerTheme = createTheme({
base: "inline animate-spin text-gray-200",
color: {
default: "fill-primary-600",
failure: "fill-red-600",
gray: "fill-gray-600",
info: "fill-cyan-600",
Expand All @@ -16,6 +17,7 @@ export const spinnerTheme: SpinnerTheme = createTheme({
off: {
base: "dark:text-gray-600",
color: {
default: "",
failure: "",
gray: "dark:fill-gray-300",
info: "",
Expand All @@ -28,6 +30,7 @@ export const spinnerTheme: SpinnerTheme = createTheme({
on: {
base: "",
color: {
default: "",
failure: "",
gray: "",
info: "",
Expand Down

0 comments on commit 23138b3

Please sign in to comment.