import React from 'react' import { action } from '@storybook/addon-actions' import { type Meta, type StoryObj } from '@storybook/react' import { Badge } from '~components/Badge' import { EmptyState } from '~components/EmptyState' import { Icon } from '~components/Icon' import { Menu, MenuItem, MenuPopover, MenuTrigger } from '~components/Menu' import { SingleSelect } from '~components/SingleSelect' import { Tooltip, TooltipTrigger } from '~components/Tooltip' import { ReversedColors } from '~components/utils' import { Button } from '../index' const meta = { title: 'Components/Button', component: Button, args: { children: 'Label', onPress: action('Button onPress event'), }, argTypes: { icon: { options: ['delete', 'arrow', 'add'], mapping: { delete: , arrow: , add: , }, }, }, } satisfies Meta export default meta type Story = StoryObj export const Playground: Story = {} export const ButtonVariants: Story = { render: (args) => ( <> ) }, decorators: [ (Story) => (
), ], } export const DontExamplePrimaryAndSecondary: Story = { render: () => { return ( <> ) }, decorators: [ (Story) => (
), ], } export const DoExampleCta: Story = { render: () => { return ( <> ) }, } export const DoExampleDefaultToMediumSize: Story = { render: () => { return ( <> ) }, } export const DontExampleDefaultToMediumSize: Story = { render: () => { return ( <> ) }, } export const DoExampleUseIconsSparingly: Story = { args: { children: 'Add user', icon: , iconPosition: 'end', }, } export const DontExampleUseIconsSparingly: Story = { args: { children: 'Add user', icon: , iconPosition: 'end', }, } export const DoExampleUseTooltips: Story = { args: { children: 'Delete', icon: , hasHiddenLabel: true, variant: 'tertiary', }, render: (args) => ( }>Save }>Edit }>Delete ), } export const DoExampleKebabMenuButton: Story = { render: () => ( }>Save }>Edit }>Delete Manage ), } export const DoExampleMinimalPunctuation: Story = { args: { children: 'View tour', variant: 'secondary', }, } export const DontExampleMinimalPunctuation: Story = { args: { children: "What's new?", variant: 'secondary', }, } export const DoExampleSecondPerson: Story = { args: { children: 'View your reports', variant: 'secondary', }, } export const DontExampleSecondPerson: Story = { args: { children: 'View my reports', variant: 'secondary', }, } export const DoExampleFunctionalLabels: Story = { args: { children: 'Edit report', variant: 'secondary', }, } export const DontExampleFunctionalLabels: Story = { args: { children: 'Edit', variant: 'secondary', }, } export const DoExampleClearAndConciseLabels: Story = { args: { children: 'Save', variant: 'secondary', }, } export const DontExampleClearAndConciseLabels: Story = { args: { children: 'Go to next step', variant: 'secondary', }, } export const DoExampleDeclareContext: Story = { args: { children: 'Create survey', variant: 'secondary', }, } export const DontExampleDeclareContext: Story = { args: { children: 'Create', variant: 'secondary', }, } export const DoExampleTertiaryButtonWithIcons: Story = { args: { children: 'Edit cycle', variant: 'tertiary', icon: , }, } export const DontExampleTertiaryButtonWithIcons: Story = { args: { children: 'Edit cycle', variant: 'tertiary', }, } export const ButtonMenuPattern: Story = { name: 'Button + Menu Pattern', render: () => (
Survey 1 Survey 2 Survey 3 Survey 4
), }