import type { Meta, StoryObj } from '@storybook/react' import { Typography } from '../Typography' import { Copy, CopyButton, CopyIcon } from './Copy' export default { title: 'Blocks/Copy/Copy', component: Copy, argTypes: { text: { control: 'text', description: 'The text to copy to the clipboard.', }, children: { control: 'text', description: 'The content displayed next to the copy button.', }, variant: { control: { type: 'select' }, options: ['button', 'icon'], description: 'The visual variant of the copy button.', table: { type: { summary: 'button | icon' }, defaultValue: { summary: 'button' }, }, }, }, } satisfies Meta type Story = StoryObj export const Default: Story = { args: { text: 'This is the text to be copied', children: 'This is the text that is displayed', }, render: (args) => {args.children}, } export const IconVariant: Story = { args: { text: '0x123456789abcdef0123456789abcdef01234567', variant: 'icon', }, render: (args) => ( 0x123...abc ), } export const CopyAddressExample: Story = { render: (args) => , args: { text: '0x123456789abcdef0123456789abcdef01234567', children: 0x123...abc, }, } export const CopyCodeSnippetExample: Story = { render: (args) => (
), args: { text: `import { Copy } from '@chainlink/blocks' function MyComponent() { return Hello World }`, children: (
        
          {`import { Copy } from '@chainlink/blocks'

function MyComponent() {
  return Hello World
}`}
        
      
), }, } export const StandaloneCopyButton: Story = { name: 'Standalone CopyButton', render: (_args) => (
Click to copy:
), } export const StandaloneCopyIcon: Story = { name: 'Standalone CopyIcon', render: (_args) => (
Click to copy:
), }