diff --git a/package.json b/package.json index 89252ce5..9df56e24 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-icons": "^4.11.0", - "react-spinners": "^0.13.8", "short-uuid": "^4.2.2", "sonner": "^0.7.1", "tailwindcss": "3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90fc3fe9..f7f97dd1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,7 +24,6 @@ specifiers: react: 18.2.0 react-dom: 18.2.0 react-icons: ^4.11.0 - react-spinners: ^0.13.8 short-uuid: ^4.2.2 sonner: ^0.7.1 tailwindcss: 3.3.3 @@ -55,7 +54,6 @@ dependencies: react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-icons: 4.11.0_react@18.2.0 - react-spinners: 0.13.8_biqbaboplfbrettd7655fr4n2y short-uuid: 4.2.2 sonner: 0.7.1_biqbaboplfbrettd7655fr4n2y tailwindcss: 3.3.3 @@ -2983,16 +2981,6 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false - /react-spinners/0.13.8_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-3e+k56lUkPj0vb5NDXPVFAOkPC//XyhKPJjvcGjyMNPWsBKpplfeyialP74G7H7+It7KzhtET+MvGqbKgAqpZA==} - peerDependencies: - react: ^16.0.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - dev: false - /react/18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} diff --git a/src/components/IconButton.tsx b/src/components/IconButton.tsx index c9b05959..34de2ebe 100644 --- a/src/components/IconButton.tsx +++ b/src/components/IconButton.tsx @@ -1,18 +1,22 @@ 'use client'; import { cc } from '@/utility/css'; -import Spinner from './Spinner'; +import Spinner, { SpinnerColor } from './Spinner'; export default function IconButton({ children, onClick, isLoading, className, + spinnerColor, + spinnerSize, }: { children: React.ReactNode onClick?: () => void isLoading?: boolean className?: string + spinnerColor?: SpinnerColor + spinnerSize?: number }) { return ( - + } ); diff --git a/src/components/Spinner.tsx b/src/components/Spinner.tsx index b7ba3e0c..29827dbd 100644 --- a/src/components/Spinner.tsx +++ b/src/components/Spinner.tsx @@ -1,21 +1,40 @@ -import { ClipLoader } from 'react-spinners'; -import resolveConfig from 'tailwindcss/resolveConfig'; -import myConfig from '../../tailwind.config.js'; +const SIZE_DEFAULT = 12; -const TAILWIND_COLORS = resolveConfig(myConfig).theme?.colors as any; +export type SpinnerColor = 'text' | 'light-gray'; export default function Spinner({ - size = 35, - className, + size = SIZE_DEFAULT, + color = 'light-gray', }: { size?: number - className?: string + color?: SpinnerColor }) { return ( - + + + + + ); -}; +} diff --git a/src/components/SubmitButtonWithStatus.tsx b/src/components/SubmitButtonWithStatus.tsx index d5f560bb..e14c2aca 100644 --- a/src/components/SubmitButtonWithStatus.tsx +++ b/src/components/SubmitButtonWithStatus.tsx @@ -24,7 +24,7 @@ export default function SubmitButtonWithStatus(props: Props) { return ( - + } {loadingState === 'failed' && diff --git a/src/site/SiteChecklistClient.tsx b/src/site/SiteChecklistClient.tsx index 168e2c17..3de6b91d 100644 --- a/src/site/SiteChecklistClient.tsx +++ b/src/site/SiteChecklistClient.tsx @@ -153,6 +153,7 @@ export default function SiteChecklistClient({ diff --git a/tailwind.config.js b/tailwind.config.js index 6bec7c4c..8d03412d 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -24,6 +24,17 @@ module.exports = { fontFamily: { 'mono': ['var(--font-ibm-plex-mono)', ...defaultTheme.fontFamily.mono], }, + animation: { + 'rotate-pulse': + 'rotate-pulse 0.75s linear infinite normal both running', + }, + keyframes: { + 'rotate-pulse': { + '0%': { rotate: '0deg', scale: '1' }, + '50%': { rotate: '180deg', scale: '0.8' }, + '100%': { rotate: '360deg', scale: '1' }, + }, + }, }, }, plugins: [