File tree 3 files changed +39
-1
lines changed
src/components/atoms/Spinner
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import path from "path";
6
6
const config : StorybookConfig = {
7
7
stories : [ "../src/**/*.mdx" , "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)" ] ,
8
8
addons : [
9
- "@storybook/addon-onboarding" ,
10
9
"@storybook/addon-links" ,
11
10
"@storybook/addon-essentials" ,
12
11
"@chromatic-com/storybook" ,
Original file line number Diff line number Diff line change
1
+ import { Meta , StoryObj } from '@storybook/react' ;
2
+ import Spinner , { SpinnerProps } from './Spinner' ;
3
+
4
+ const meta : Meta < typeof Spinner > = {
5
+ title : 'Components/Atoms/Spinner' ,
6
+ component : Spinner ,
7
+ parameters : {
8
+ layout : 'centered' ,
9
+ } ,
10
+ } ;
11
+
12
+ export default meta ;
13
+
14
+ type SpinnerStory = StoryObj < SpinnerProps > ;
15
+
16
+ export const Small : SpinnerStory = {
17
+ render : ( args ) => < Spinner { ...args } className = "w-4 h-4" />
18
+ } ;
19
+ export const Medium : SpinnerStory = {
20
+ render : ( args ) => < Spinner { ...args } className = "w-8 h-8" />
21
+ } ;
22
+ export const Large : SpinnerStory = {
23
+ render : ( args ) => < Spinner { ...args } className = "w-12 h-12" />
24
+ } ;
Original file line number Diff line number Diff line change
1
+ import { cn } from "../../../utils" ;
2
+
3
+ export type SpinnerProps = {
4
+ className ?: string ;
5
+ } ;
6
+
7
+ const Spinner = ( { className } : SpinnerProps ) => {
8
+ return (
9
+ < div
10
+ className = { cn ( 'border-4 border-solid border-blue-500 border-t-transparent rounded-full animate-spin' , className ) }
11
+ > </ div >
12
+ ) ;
13
+ } ;
14
+
15
+ export default Spinner ;
You can’t perform that action at this time.
0 commit comments