mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-08 08:39:03 +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
61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import { Meta } from '@storybook/react'
|
|
import { figmaDesignUrl } from '../../../.storybook/utils/figma-design-url'
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
|
|
type Args = React.ComponentProps<typeof OLButton>
|
|
|
|
export const NewButton = (args: Args) => {
|
|
return <OLButton {...args} />
|
|
}
|
|
|
|
export const ButtonWithLeadingIcon = (args: Args) => {
|
|
return <OLButton leadingIcon="add" {...args} />
|
|
}
|
|
|
|
export const ButtonWithTrailingIcon = (args: Args) => {
|
|
return <OLButton trailingIcon="add" {...args} />
|
|
}
|
|
|
|
export const ButtonWithIcons = (args: Args) => {
|
|
return <OLButton trailingIcon="add" leadingIcon="add" {...args} />
|
|
}
|
|
|
|
const meta: Meta<typeof OLButton> = {
|
|
title: 'Shared / Components / Button',
|
|
component: OLButton,
|
|
args: {
|
|
children: 'Button',
|
|
disabled: false,
|
|
isLoading: false,
|
|
},
|
|
argTypes: {
|
|
size: {
|
|
control: 'radio',
|
|
options: ['lg', 'md', 'sm'],
|
|
},
|
|
variant: {
|
|
control: 'radio',
|
|
options: [
|
|
'primary',
|
|
'secondary',
|
|
'ghost',
|
|
'danger',
|
|
'danger-ghost',
|
|
'premium',
|
|
'premium-secondary',
|
|
'link',
|
|
],
|
|
},
|
|
},
|
|
parameters: {
|
|
controls: {
|
|
include: ['children', 'disabled', 'isLoading', 'size', 'variant'],
|
|
},
|
|
...figmaDesignUrl(
|
|
'https://www.figma.com/design/V7Ogph1Ocs4ux2A4WMNAh7/Overleaf---Components?node-id=3458-22412&m=dev'
|
|
),
|
|
},
|
|
}
|
|
|
|
export default meta
|