-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(graph): add spinner on the projects page
- Loading branch information
Showing
4 changed files
with
70 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './lib/debounced-text-input'; | ||
export * from './lib/tag'; | ||
export * from './lib/dropdown'; | ||
export * from './lib/spinner'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Spinner } from './spinner'; | ||
|
||
const meta: Meta<typeof Spinner> = { | ||
component: Spinner, | ||
title: 'Shared/Spinner', | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Spinner>; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
className: '', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Spinner component from https://tailwindcss.com/docs/animation#spin | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
export type SpinnerProps = React.SVGProps<SVGSVGElement>; | ||
|
||
export function Spinner({ className, ...rest }: SpinnerProps) { | ||
return ( | ||
<svg | ||
className={`${className} animate-spin h-8 w-8`} | ||
viewBox="0 0 24 24" | ||
{...rest} | ||
> | ||
<circle | ||
className="opacity-10" | ||
cx="12" | ||
cy="12" | ||
r="10" | ||
stroke="currentColor" | ||
stroke-width="4" | ||
></circle> | ||
<path | ||
className="opacity-90" | ||
fill="currentColor" | ||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" | ||
></path> | ||
</svg> | ||
); | ||
} |