|
| 1 | +import type { Meta, StoryObj } from '@storybook-vue/nuxt' |
| 2 | +import LinkBase from './Base.vue' |
| 3 | + |
| 4 | +const meta = { |
| 5 | + component: LinkBase, |
| 6 | + args: { |
| 7 | + to: '/', |
| 8 | + default: 'Click me', |
| 9 | + }, |
| 10 | +} satisfies Meta<typeof LinkBase> |
| 11 | + |
| 12 | +export default meta |
| 13 | +type Story = StoryObj<typeof meta> |
| 14 | + |
| 15 | +export const Default: Story = {} |
| 16 | + |
| 17 | +export const ExternalLink: Story = { |
| 18 | + args: { |
| 19 | + to: 'https://example.com', |
| 20 | + default: 'External Link', |
| 21 | + }, |
| 22 | +} |
| 23 | + |
| 24 | +export const AnchorLink: Story = { |
| 25 | + args: { |
| 26 | + to: '#section', |
| 27 | + default: 'Anchor Link', |
| 28 | + }, |
| 29 | +} |
| 30 | + |
| 31 | +export const WithIcon: Story = { |
| 32 | + args: { |
| 33 | + classicon: 'i-lucide:check', |
| 34 | + default: 'Verified', |
| 35 | + }, |
| 36 | +} |
| 37 | + |
| 38 | +export const NoUnderline: Story = { |
| 39 | + args: { |
| 40 | + noUnderline: true, |
| 41 | + default: 'Link without underline', |
| 42 | + }, |
| 43 | +} |
| 44 | + |
| 45 | +export const Disabled: Story = { |
| 46 | + args: { |
| 47 | + disabled: true, |
| 48 | + default: 'Disabled Link', |
| 49 | + }, |
| 50 | +} |
| 51 | + |
| 52 | +export const ButtonPrimary: Story = { |
| 53 | + args: { |
| 54 | + variant: 'button-primary', |
| 55 | + default: 'Primary Button', |
| 56 | + }, |
| 57 | +} |
| 58 | + |
| 59 | +export const ButtonSecondary: Story = { |
| 60 | + args: { |
| 61 | + variant: 'button-secondary', |
| 62 | + default: 'Secondary Button', |
| 63 | + }, |
| 64 | +} |
| 65 | + |
| 66 | +export const SmallButton: Story = { |
| 67 | + args: { |
| 68 | + variant: 'button-primary', |
| 69 | + size: 'small', |
| 70 | + default: 'Small Button', |
| 71 | + }, |
| 72 | +} |
| 73 | + |
| 74 | +export const WithIconButton: Story = { |
| 75 | + args: { |
| 76 | + variant: 'button-primary', |
| 77 | + classicon: 'i-lucide:copy', |
| 78 | + default: 'Copy', |
| 79 | + }, |
| 80 | +} |
| 81 | + |
| 82 | +export const WithKeyboardShortcut: Story = { |
| 83 | + args: { |
| 84 | + variant: 'button-secondary', |
| 85 | + ariaKeyshortcuts: 's', |
| 86 | + default: 'Search', |
| 87 | + }, |
| 88 | +} |
| 89 | + |
| 90 | +export const BlockLink: Story = { |
| 91 | + args: { |
| 92 | + variant: 'button-primary', |
| 93 | + block: true, |
| 94 | + default: 'Full Width Button', |
| 95 | + }, |
| 96 | +} |
| 97 | + |
| 98 | +export const DisabledButton: Story = { |
| 99 | + args: { |
| 100 | + variant: 'button-primary', |
| 101 | + disabled: true, |
| 102 | + default: 'Disabled Button', |
| 103 | + }, |
| 104 | +} |
| 105 | + |
| 106 | +export const Snapshot: Story = { |
| 107 | + render: () => ({ |
| 108 | + template: ` |
| 109 | + <div style="display: flex; flex-direction: column; gap: 1rem; padding: 1rem;"> |
| 110 | + <LinkBase to="/">Default Link</LinkBase> |
| 111 | + <LinkBase to="https://example.com">External Link</LinkBase> |
| 112 | + <LinkBase to="#section">Anchor Link</LinkBase> |
| 113 | + <LinkBase to="/" classicon="i-lucide:check">Link with icon</LinkBase> |
| 114 | + <LinkBase to="/" no-underline>Link without underline</LinkBase> |
| 115 | + <LinkBase to="/" disabled>Disabled Link</LinkBase> |
| 116 | + |
| 117 | + <div style="display: flex; gap: 1rem; flex-wrap: wrap;"> |
| 118 | + <LinkBase to="/" variant="button-primary">Primary</LinkBase> |
| 119 | + <LinkBase to="/" variant="button-secondary">Secondary</LinkBase> |
| 120 | + <LinkBase to="/" variant="button-primary" disabled>Disabled</LinkBase> |
| 121 | + <LinkBase to="/" variant="button-primary" classicon="i-lucide:copy">With Icon</LinkBase> |
| 122 | + </div> |
| 123 | + |
| 124 | + <div style="display: flex; gap: 1rem;"> |
| 125 | + <LinkBase to="/" variant="button-primary" size="small">Small Button</LinkBase> |
| 126 | + </div> |
| 127 | + <LinkBase to="/" variant="button-primary" block>Full Width Button</LinkBase> |
| 128 | + </div> |
| 129 | + `, |
| 130 | + components: { LinkBase }, |
| 131 | + }), |
| 132 | +} |
0 commit comments