import { Meta, StoryObj } from '@storybook/react'; import { Button } from 'components/shared/Button'; import { PlusIcon } from 'components/shared/CustomIcon'; import { renderButtonIcons, renderButtons, renderDisabledButtons, renderLinks, } from '../pages/components/renders/button'; const meta: Meta = { title: 'Components/Button', component: Button, tags: ['autodocs'], argTypes: { size: { control: 'select', options: ['lg', 'md', 'sm', 'xs'], }, variant: { control: 'select', options: [ 'primary', 'secondary', 'tertiary', 'ghost', 'danger', 'danger-ghost', 'link', 'link-emphasized', ], }, fullWidth: { control: 'boolean', }, iconOnly: { control: { type: 'boolean' }, }, shape: { control: 'select', options: ['default', 'rounded'], }, children: { control: 'text', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: ({ children, size, variant, iconOnly, fullWidth, shape }) => ( ), args: { children: 'Button', size: 'md', variant: 'primary', fullWidth: false, shape: 'rounded', iconOnly: false, }, }; export const WithIcons: Story = { args: { ...Default.args, leftIcon: , rightIcon: , }, }; export const FullWidth: Story = { args: { ...Default.args, fullWidth: true, }, }; export const IconOnly: Story = { render: ({ leftIcon }) => , args: { ...Default.args, leftIcon: , }, }; export const ButtonAll: Story = { render: () => (
{/* Button */}

Button

{renderButtons()} {renderButtonIcons()}
{/* Link */}

Link

{renderLinks()}
{/* Disabled button, icon only, and link */}

Disabled

Button - icon only - link

{renderDisabledButtons()}
), };