Files
overleaf-cep/services/web/frontend/stories/shared/loading-spinner.stories.tsx
T
Rebeka Dekany cc49eeacbd Update Storybook controls for shared component stories and add Figma links for preview (#28634)
* 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
2025-09-25 08:05:53 +00:00

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