|
| 1 | +import type { Meta, StoryObj } from '@storybook/vue3' |
| 2 | + |
1 | 3 | import DsfrQuote from './DsfrQuote.vue' |
2 | 4 |
|
3 | 5 | /** |
4 | 6 | * [Voir quand l’utiliser sur la documentation du DSFR](https://www.systeme-de-design.gouv.fr/version-courante/fr/composants/citation) |
5 | 7 | */ |
6 | | -export default { |
| 8 | +const meta = { |
7 | 9 | component: DsfrQuote, |
8 | 10 | title: 'Composants/DsfrQuote', |
9 | 11 | tags: ['message'], |
@@ -33,72 +35,45 @@ export default { |
33 | 35 | description: '**URL** de l\'image', |
34 | 36 | }, |
35 | 37 | }, |
36 | | -} |
| 38 | +} satisfies Meta<typeof DsfrQuote> |
| 39 | + |
| 40 | +export default meta |
| 41 | +type Story = StoryObj<typeof meta> |
37 | 42 |
|
38 | | -export const Citation = (args) => ({ |
39 | | - components: { DsfrQuote }, |
40 | | - data () { |
41 | | - return { |
42 | | - ...args, |
43 | | - } |
| 43 | +export const Citation: Story = { |
| 44 | + args: { |
| 45 | + quote: 'LA citation', |
| 46 | + author: 'Pierre-Louis EGAUD', |
| 47 | + details: [ |
| 48 | + 'Détail 1', |
| 49 | + 'Détail 2', |
| 50 | + 'Détail 3', |
| 51 | + { |
| 52 | + url: 'https://www.wikipedia.fr', |
| 53 | + label: 'wikipedia', |
| 54 | + }, |
| 55 | + ], |
| 56 | + source: 'Duckduckgo', |
| 57 | + sourceUrl: 'https://www.duckduckgo.com', |
| 58 | + quoteImage: 'https://loremflickr.com/g/150/150/cat?random=1', |
44 | 59 | }, |
45 | | - template: ` |
46 | | - <DsfrQuote |
47 | | - :quote="quote" |
48 | | - :author="author" |
49 | | - :details="details" |
50 | | - :source="source" |
51 | | - :sourceUrl="sourceUrl" |
52 | | - :quoteImage="quoteImage" |
53 | | - /> |
54 | | - `, |
55 | | -}) |
56 | | -Citation.args = { |
57 | | - quote: 'LA citation', |
58 | | - author: 'Pierre-Louis EGAUD', |
59 | | - details: [ |
60 | | - 'Détail 1', |
61 | | - 'Détail 2', |
62 | | - 'Détail 3', |
63 | | - { |
64 | | - url: 'https://www.wikipedia.fr', |
65 | | - label: 'wikipedia', |
66 | | - }, |
67 | | - ], |
68 | | - source: 'Duckduckgo', |
69 | | - sourceUrl: 'https://www.duckduckgo.com', |
70 | | - quoteImage: 'https://loremflickr.com/g/150/150/cat?random=1', |
71 | 60 | } |
72 | 61 |
|
73 | | -export const CitationSansImage = (args) => ({ |
74 | | - components: { DsfrQuote }, |
75 | | - data () { |
76 | | - return { |
77 | | - ...args, |
78 | | - } |
| 62 | +export const CitationSansImage: Story = { |
| 63 | + name: 'Citation sans image', |
| 64 | + args: { |
| 65 | + quote: 'LA citation', |
| 66 | + author: 'Pierre-Louis EGAUD', |
| 67 | + details: [ |
| 68 | + 'Détail 1', |
| 69 | + 'Détail 2', |
| 70 | + 'Détail 3', |
| 71 | + { |
| 72 | + url: 'https://www.wikipedia.fr', |
| 73 | + label: 'wikipedia', |
| 74 | + }, |
| 75 | + ], |
| 76 | + source: 'Duckduckgo', |
| 77 | + sourceUrl: 'https://www.duckduckgo.com', |
79 | 78 | }, |
80 | | - template: ` |
81 | | - <DsfrQuote |
82 | | - :quote="quote" |
83 | | - :author="author" |
84 | | - :details="details" |
85 | | - :source="source" |
86 | | - :sourceUrl="sourceUrl" |
87 | | - /> |
88 | | - `, |
89 | | -}) |
90 | | -CitationSansImage.args = { |
91 | | - quote: 'LA citation', |
92 | | - author: 'Pierre-Louis EGAUD', |
93 | | - details: [ |
94 | | - 'Détail 1', |
95 | | - 'Détail 2', |
96 | | - 'Détail 3', |
97 | | - { |
98 | | - url: 'https://www.wikipedia.fr', |
99 | | - label: 'wikipedia', |
100 | | - }, |
101 | | - ], |
102 | | - source: 'Duckduckgo', |
103 | | - sourceUrl: 'https://www.duckduckgo.com', |
104 | 79 | } |
0 commit comments