|
1 | 1 | import type { Meta, StoryObj } from '@storybook/react';
|
2 | 2 | import { defaultCard, trails } from '../../fixtures/manual/highlights-trails';
|
3 | 3 | import { ScrollableHighlights } from './ScrollableHighlights.importable';
|
| 4 | +import { Section } from './Section'; |
4 | 5 |
|
5 |
| -export default { |
| 6 | +const meta: Meta<typeof ScrollableHighlights> = { |
6 | 7 | title: 'Components/Masthead/ScrollableHighlights',
|
7 | 8 | component: ScrollableHighlights,
|
8 |
| - args: { |
9 |
| - trails, |
10 |
| - }, |
11 |
| -} as Meta; |
| 9 | + render: ({ ...args }) => ( |
| 10 | + <Section |
| 11 | + shouldCenter={true} |
| 12 | + showSideBorders={false} |
| 13 | + fullWidth={true} |
| 14 | + showTopBorder={false} |
| 15 | + padSides={false} |
| 16 | + element="section" |
| 17 | + > |
| 18 | + <ScrollableHighlights {...args} /> |
| 19 | + </Section> |
| 20 | + ), |
| 21 | +}; |
12 | 22 |
|
| 23 | +export default meta; |
13 | 24 | type Story = StoryObj<typeof ScrollableHighlights>;
|
14 | 25 |
|
15 |
| -export const Default = {}; |
| 26 | +export const Default = { |
| 27 | + args: { |
| 28 | + trails: trails.slice(0, 6), |
| 29 | + }, |
| 30 | +}; |
| 31 | + |
| 32 | +export const withEightCards = { |
| 33 | + name: 'With Eight Cards', |
| 34 | + args: { |
| 35 | + trails, |
| 36 | + }, |
| 37 | +}; |
16 | 38 |
|
17 | 39 | export const withTwoLineKicker: Story = {
|
| 40 | + ...Default, |
| 41 | + name: 'With Two Line Kicker', |
18 | 42 | args: {
|
19 | 43 | trails: [
|
20 | 44 | {
|
21 | 45 | ...defaultCard,
|
22 | 46 | kickerText: 'UK Housing and Mortgages',
|
23 | 47 | },
|
24 |
| - ...trails, |
| 48 | + ...Default.args.trails, |
25 | 49 | ],
|
26 | 50 | },
|
27 |
| - name: 'With Two Line Kicker', |
28 | 51 | };
|
29 | 52 |
|
30 | 53 | export const withLiveKicker: Story = {
|
| 54 | + ...Default, |
| 55 | + name: 'With Live Kicker', |
31 | 56 | args: {
|
32 | 57 | trails: [
|
33 | 58 | {
|
34 | 59 | ...defaultCard,
|
35 | 60 | kickerText: 'Live',
|
36 | 61 | format: { display: 0, theme: 3, design: 11 },
|
37 | 62 | },
|
38 |
| - ...trails, |
| 63 | + ...Default.args.trails, |
39 | 64 | ],
|
40 | 65 | },
|
41 |
| - name: 'With Live Kicker', |
42 | 66 | };
|
43 | 67 |
|
44 | 68 | export const withFourLineHeadline: Story = {
|
| 69 | + ...Default, |
| 70 | + name: 'With Four Line Headline', |
45 | 71 | args: {
|
46 | 72 | trails: [
|
47 | 73 | {
|
48 | 74 | ...defaultCard,
|
49 | 75 | headline:
|
50 | 76 | 'Really long headline to show what happens when it is long',
|
51 | 77 | },
|
52 |
| - ...trails, |
| 78 | + ...Default.args.trails, |
53 | 79 | ],
|
54 | 80 | },
|
55 |
| - name: 'With Four Line Headline', |
56 | 81 | };
|
57 | 82 |
|
58 | 83 | export const withExcessivleyLongHeadline: Story = {
|
| 84 | + ...Default, |
| 85 | + name: 'With Excessively Long Headline', |
59 | 86 | args: {
|
60 | 87 | trails: [
|
61 | 88 | {
|
62 | 89 | ...defaultCard,
|
63 | 90 | headline:
|
64 | 91 | 'Really long headline to show what happens when there is a really long headline that we will never ever have but we should check how it looks anyway',
|
65 | 92 | },
|
66 |
| - ...trails, |
| 93 | + ...Default.args.trails, |
67 | 94 | ],
|
68 | 95 | },
|
69 |
| - name: 'With Four Line Headline', |
70 | 96 | };
|
0 commit comments