Skip to content

Commit

Permalink
Merge pull request #78 from brainstormforce/SUR-292
Browse files Browse the repository at this point in the history
SUR-292 - Added Loader Story
  • Loading branch information
vrundakansara authored Sep 25, 2024
2 parents 5c0c498 + 79cdfe8 commit 7820616
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions src/components/loader/loader.stories.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import React from 'react';
import Loader from './loader.jsx';
import { LoaderPinwheel } from 'lucide-react';

export default {
title: 'Atoms/Loader',
component: Loader,
parameters: {
layout: 'centered',
},
tags: [ 'autodocs' ],
argTypes: {
variant: {
name: 'Variant',
description: 'Defines the variant style of the loader.',
control: 'select',
options: [ 'primary', 'secondary' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'primary' },
},
},
size: {
name: 'Size',
description: 'Defines the size of the loader.',
control: 'select',
options: [ 'sm', 'md', 'lg', 'xl' ],
table: {
type: { summary: 'string' },
defaultValue: { summary: 'md' },
},
},
icon: {
name: 'Icon',
description: 'Custom icon for the loader.',
control: 'none',
table: {
type: { summary: 'ReactNode' },
},
},
},
};

// Basic
export const Basic = {
args: {
variant: 'primary',
size: 'md',
icon: null,
},
};

// Secondary Variant
export const Secondary = {
args: {
variant: 'secondary',
size: 'md',
icon: null,
},
};

// Large Size
export const Large = {
args: {
variant: 'primary',
size: 'lg',
icon: null,
},
};

// Custom Icon
export const CustomIcon = {
args: {
variant: 'primary',
size: 'md',
icon: <LoaderPinwheel className="animate-spin" />,
},
};

0 comments on commit 7820616

Please sign in to comment.