mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 06:39:02 +02:00
cc49eeacbd
* Rename ui to shared * Delete unused Switch component * Update stories with Figma links * Update Tag story naming for clarity * Update Toggle button story naming for clarity * Move shared components to the shared folder * Remove file as part of TS migration * Migrate jsx to tsx * Remove file as part of TS migration * Migrate jsx to tsx * Include necessary controls only * Auto SF GitOrigin-RevId: d2458eeffa7a6b67ce522c3ccb6b4f71e5e76d62
56 lines
1.1 KiB
TypeScript
56 lines
1.1 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react'
|
|
import LoadingSpinner, {
|
|
FullSizeLoadingSpinner,
|
|
} from '@/shared/components/loading-spinner'
|
|
|
|
type Story = StoryObj<typeof LoadingSpinner>
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
loadingText: 'Loading content...',
|
|
},
|
|
}
|
|
|
|
export const WithDelay: Story = {
|
|
args: {
|
|
delay: 500,
|
|
loadingText: 'This will appear after a 500ms delay...',
|
|
},
|
|
}
|
|
|
|
export const FullSize: StoryObj<typeof FullSizeLoadingSpinner> = {
|
|
render: args => <FullSizeLoadingSpinner {...args} />,
|
|
args: {
|
|
loadingText: 'Loading entire section...',
|
|
size: 'sm',
|
|
},
|
|
}
|
|
|
|
const meta: Meta<typeof LoadingSpinner> = {
|
|
title: 'Shared / Components / Loading Spinner',
|
|
component: LoadingSpinner,
|
|
parameters: {
|
|
layout: 'centered',
|
|
controls: {
|
|
include: ['loadingText', 'delay', 'size'],
|
|
},
|
|
},
|
|
argTypes: {
|
|
delay: {
|
|
control: 'select',
|
|
options: [0, 500],
|
|
},
|
|
size: {
|
|
control: 'radio',
|
|
options: ['lg', 'sm'],
|
|
},
|
|
},
|
|
args: {
|
|
size: 'sm',
|
|
delay: 0,
|
|
},
|
|
render: args => <LoadingSpinner {...args} />,
|
|
}
|
|
|
|
export default meta
|