|
1 |
| -import React from 'react' |
2 |
| -import {Meta, StoryFn} from '@storybook/react' |
3 |
| -import {Link} from '.' |
| 1 | +import type {Meta, StoryObj} from '@storybook/react' |
4 | 2 |
|
5 |
| -const meta: Meta<typeof Link> = { |
6 |
| - title: 'Components/Link/features', |
7 |
| - component: Link, |
8 |
| -} |
| 3 | +import {type LinkProps} from '.' |
| 4 | +import baseMeta from './Link.stories' |
9 | 5 |
|
| 6 | +const meta: Meta<LinkProps> = {...baseMeta, title: 'Components/Link/Features'} |
10 | 7 | export default meta
|
11 | 8 |
|
12 |
| -const Template: StoryFn<typeof Link> = args => <Link {...args} /> |
| 9 | +type Story = StoryObj<LinkProps> |
| 10 | + |
| 11 | +export const Large: Story = { |
| 12 | + args: { |
| 13 | + size: 'large', |
| 14 | + href: '#', |
| 15 | + children: 'Large size', |
| 16 | + }, |
| 17 | +} |
13 | 18 |
|
14 |
| -export const Large = Template.bind({}) |
15 |
| -Large.args = { |
16 |
| - size: 'large', |
17 |
| - href: '#', |
18 |
| - children: 'Large size', |
| 19 | +export const ArrowStart: Story = { |
| 20 | + args: { |
| 21 | + children: 'Back to schedule', |
| 22 | + arrowDirection: 'start', |
| 23 | + }, |
19 | 24 | }
|
20 | 25 |
|
21 |
| -export const Reversed = Template.bind({}) |
22 |
| -Reversed.args = { |
23 |
| - size: 'medium', |
24 |
| - href: '#', |
25 |
| - children: 'Back to schedule', |
26 |
| - arrowDirection: 'start', |
| 26 | +export const NoArrow: Story = { |
| 27 | + args: { |
| 28 | + arrowDirection: 'none', |
| 29 | + }, |
27 | 30 | }
|
28 | 31 |
|
29 |
| -export const Accent = Template.bind({}) |
30 |
| -Accent.args = { |
31 |
| - size: 'medium', |
32 |
| - variant: 'accent', |
33 |
| - href: '#', |
34 |
| - children: 'Accent color', |
| 32 | +export const Accent: Story = { |
| 33 | + args: { |
| 34 | + variant: 'accent', |
| 35 | + children: 'Accent variant', |
| 36 | + }, |
35 | 37 | }
|
0 commit comments