-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpinner.stories.tsx
More file actions
50 lines (41 loc) · 1.05 KB
/
Spinner.stories.tsx
File metadata and controls
50 lines (41 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import type { Meta, StoryObj } from '@storybook/react';
import Spinner from '../Spinner';
const meta = {
title: 'Common/Loader/Spinner',
component: Spinner,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
children: { description: 'Optional. The content, e.g. "Spinner.Text".' },
className: { description: 'Additional CSS classes.' },
icon: { description: 'Optional. A "FAIconProps" object containing properties for the icon.' },
testId: { description: 'The test identifier.' },
},
} satisfies Meta<typeof Spinner>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Simple: Story = {
args: {},
};
export const Larger: Story = {
args: {
icon: { size: '2x' },
},
};
export const Colored: Story = {
args: {
icon: { className: 'text-blue-600' },
},
};
export const WithText: Story = {
args: {
children: <Spinner.Text>Engaging warp engines Captain...</Spinner.Text>,
},
};
export const WithAlternativeIcon: Story = {
args: {
icon: { icon: 'circleXmark' },
},
};