Skip to content

Commit ffbc657

Browse files
JoelPagniezlaruiss
authored andcommitted
docs: 📝 améliore la documentation de DsfrCallout
1 parent 23d4658 commit ffbc657

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

src/components/DsfrCallout/DsfrCallout.stories.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ const meta: Meta<typeof DsfrCallout> = {
3030
description:
3131
'Permet de passer l’icône désirée en chaîne de caractères (cf. remix-icon)',
3232
},
33+
accent: {
34+
control: 'text',
35+
description:
36+
'Permet de passer la couleur d‘accentuation',
37+
},
3338
button: {
3439
control: 'object',
3540
description:
@@ -163,3 +168,40 @@ MiseEnAvantSansTitre.args = {
163168
'Lorem ipsum dolor sit amet, consectetur adipiscing, incididunt, ut labore et dol',
164169
titleTag: undefined,
165170
}
171+
172+
export const MiseEnAvantAvecAccentuation = (args) => ({
173+
components: {
174+
DsfrCallout,
175+
VIcon,
176+
},
177+
178+
data () {
179+
return {
180+
...args,
181+
button: args.button && {
182+
...args.button,
183+
onClick: args.onClick,
184+
},
185+
}
186+
},
187+
188+
template: `
189+
<DsfrCallout
190+
:title
191+
:content
192+
:button
193+
:icon
194+
:title-tag
195+
:accent
196+
/>
197+
`,
198+
})
199+
MiseEnAvantAvecAccentuation.args = {
200+
title: 'Titre de la mise en avant',
201+
button: undefined,
202+
icon: '',
203+
content:
204+
'Lorem ipsum dolor sit amet, consectetur adipiscing, incididunt, ut labore et dol',
205+
titleTag: undefined,
206+
accent: 'orange-terre-battue',
207+
}

src/components/DsfrCallout/docs-demo/DsfrCalloutDemo.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const icon = 'ri:notification-3-line'
1212
const content = 'Lorem ipsum dolor sit amet, consectetur adipiscing, incididunt, ut labore et dol'
1313
const titleTag = undefined
1414
15+
const accent = 'orange-terre-battue'
16+
const accentTitle = 'Titre de la mise en avant accentué'
17+
const accentIcon = 'fr-icon-alarm-warning-line'
18+
const accentContent = 'Accentuation à partir des couleurs du Dsfr (ex orange-terre-battue)'
19+
1520
const animateTitle = 'Titre de la mise en avant stylée'
1621
const animatedIcon: VIconProps = { name: 'bi:bell', animation: 'ring' }
1722
const animatedtitleTag = 'h4'
@@ -35,6 +40,14 @@ const getRandomAnimation = () => getRandomEl<(typeof possibleAnimations)[number]
3540
:icon="icon"
3641
:title-tag="titleTag"
3742
/>
43+
<DsfrCallout
44+
:title="`${accentTitle} (${accentTitleTag ?? 'h3'})`"
45+
:content="accentContent"
46+
:button="button"
47+
:icon="accentIcon"
48+
:title-tag="titleTag"
49+
:accent="accent"
50+
/>
3851
<DsfrCallout
3952
:title="`${animateTitle} (${animatedtitleTag ?? 'h3'})`"
4053
:button="button"

0 commit comments

Comments
 (0)