Files
Verso/services/web/frontend/stories/shared/start-free-trial-button.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

87 lines
2.0 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react'
import StartFreeTrialButton from '../../js/shared/components/start-free-trial-button'
import type { ButtonProps } from '../../js/shared/components/types/button-props'
type Args = React.ComponentProps<typeof StartFreeTrialButton> & {
size?: ButtonProps['size']
}
type Story = StoryObj<Args>
export const Default: Story = {
render: args => {
const { size, ...startFreeTrialProps } = args
return (
<StartFreeTrialButton {...startFreeTrialProps} buttonProps={{ size }} />
)
},
}
export const CustomText: Story = {
render: args => {
const { size, ...startFreeTrialProps } = args
return (
<StartFreeTrialButton {...startFreeTrialProps} buttonProps={{ size }}>
Some Custom Text!
</StartFreeTrialButton>
)
},
}
export const ButtonStyle: Story = {
render: args => {
const { size: _size, ...startFreeTrialProps } = args
return (
<StartFreeTrialButton
{...startFreeTrialProps}
buttonProps={{
variant: 'secondary',
size: 'lg',
}}
/>
)
},
}
const meta: Meta<Args> = {
title: 'Shared / Components / Start Free Trial Button',
component: StartFreeTrialButton,
parameters: {
controls: {
include: ['source', 'variant', 'children', 'size'],
},
},
argTypes: {
source: { control: 'text' },
buttonProps: { control: false },
children: { control: 'text' },
size: {
control: 'radio',
options: ['lg', 'md', 'sm'],
},
variant: {
control: 'radio',
options: [
'primary',
'secondary',
'ghost',
'danger',
'danger-ghost',
'premium',
'premium-secondary',
'link',
],
},
handleClick: { control: false },
segmentation: { control: false },
extraSearchParams: { control: false },
},
args: {
source: 'storybook',
variant: 'secondary',
size: undefined,
},
}
export default meta