import React from 'react'
import { type Meta, type StoryObj } from '@storybook/react'
import { Icon } from '~components/Icon'
import { VisuallyHidden } from '~components/VisuallyHidden'
import { LinkButton } from '../index'
const meta = {
title: 'Components/LinkButton',
component: LinkButton,
args: {
children: 'Label',
href: '#link-button-clicked',
},
argTypes: {
icon: {
options: ['delete', 'arrow', 'plus'],
mapping: {
delete: ,
arrow: ,
add: ,
},
},
},
} satisfies Meta
export default meta
type Story = StoryObj
export const Playground: Story = {}
export const LinkButtonOpensInNewTab: Story = {
args: {
children: (
<>
Label
opens a new tab
>
),
href: 'https://www.google.com',
target: '_blank',
rel: 'noopener noreferrer',
icon: ,
iconPosition: 'end',
},
}
export const LinkButtonVariants: Story = {
render: ({ children: _, ...otherArgs }) => (
<>
Primary
Secondary
Tertiary
>
),
decorators: [
(Story) => (
),
],
}
export const LinkButtonVariantsReversed: Story = {
...LinkButtonVariants,
parameters: {
reverseColors: true,
},
}
export const LinkButtonSizes: Story = {
render: (args) => (
<>
Small
Medium
Large
>
),
decorators: [
(Story) => (
),
],
}
export const LinkButtonWithIconStart: Story = {
args: {
icon: ,
},
}
export const LinkButtonWithIconEnd: Story = {
args: {
icon: ,
iconPosition: 'end',
},
}
export const IconLinkButton: Story = {
args: {
children: 'Remove highlights from: May 8, 2024',
icon: ,
hasHiddenLabel: true,
},
}
export const DownloadIconButton: Story = {
args: {
children: 'Download the kaizen design system badge',
href: './static/media/kaizen-badge.svg',
icon: ,
hasHiddenLabel: true,
download: true,
},
}
export const LinkButtonFullWidth: Story = {
args: {
isFullWidth: true,
},
}