Skip to content

Commit

Permalink
feat: ✨ Le DSFR a apporté une nouvelle propriété au composant Card, c…
Browse files Browse the repository at this point in the history
…ette PR a pour but de s'aligner sur leur dernière version
  • Loading branch information
DaBadBunny committed Aug 29, 2023
1 parent 9fa8f99 commit 97e688b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/DsfrCard/DsfrCard.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default {
control: 'text',
description: 'Permet de choisir la balise contenant le titre de la carte (h3 par défaut',
},
download: {
control: 'boolean',
description: 'Variante de carte indiquant que l’évènement de clic lancera un téléchargement',
},
},
}

Expand All @@ -77,6 +81,7 @@ export const Card = (args) => ({
:title="title"
:horizontal="horizontal"
:no-arrow="noArrow"
:download="download"
:title-tag="titleTag"
/>
`,
Expand All @@ -92,6 +97,7 @@ Card.args = {
titleTag: undefined,
noArrow: false,
horizontal: false,
download: false,
size: 'medium',
buttons: [],
linksGroup: [],
Expand All @@ -114,6 +120,7 @@ export const CardSansFleche = (args) => ({
:size="size"
:title="title"
:horizontal="horizontal"
:download: false,
:no-arrow="noArrow"
/>
`,
Expand All @@ -128,6 +135,7 @@ CardSansFleche.args = {
title: 'Qu’est-ce que le Pass Culture et comment l’obtenir ?',
noArrow: true,
horizontal: false,
download: false,
size: 'medium',
buttons: [],
linksGroup: [],
Expand All @@ -150,6 +158,7 @@ export const CardAvecBoutons = (args) => ({
:size="size"
:title="title"
:horizontal="horizontal"
:download: false,
:no-arrow="noArrow"
/>
`,
Expand All @@ -164,6 +173,7 @@ CardAvecBoutons.args = {
title: 'Qu’est-ce que le Pass Culture et comment l’obtenir ?',
noArrow: true,
horizontal: false,
download: false,
buttons: [
{
label: 'Télécharger',
Expand Down Expand Up @@ -194,6 +204,7 @@ export const CardAvecLiens = (args) => ({
:size="size"
:title="title"
:horizontal="horizontal"
:download: false,
:no-arrow="noArrow"
/>
`,
Expand All @@ -208,6 +219,7 @@ CardAvecLiens.args = {
title: 'Qu’est-ce que le Pass Culture et comment l’obtenir ?',
noArrow: true,
horizontal: false,
download: false,
linksGroup: [
{
label: 'Télécharger',
Expand Down Expand Up @@ -237,6 +249,7 @@ export const CardHorizontaleAvecBoutons = (args) => ({
:size="size"
:title="title"
:horizontal="horizontal"
:download: false,
:no-arrow="noArrow"
/>
`,
Expand All @@ -251,6 +264,7 @@ CardHorizontaleAvecBoutons.args = {
title: 'Qu’est-ce que le Pass Culture et comment l’obtenir ?',
noArrow: true,
horizontal: true,
download: false,
buttons: [
{
label: 'Télécharger',
Expand Down Expand Up @@ -281,6 +295,7 @@ export const CardHorizontaleEtSmallAvecLiens = (args) => ({
:size="size"
:title="title"
:horizontal="horizontal"
:download: false,
:no-arrow="noArrow"
/>
`,
Expand All @@ -295,6 +310,7 @@ CardHorizontaleEtSmallAvecLiens.args = {
title: 'Qu’est-ce que le Pass Culture et comment l’obtenir ?',
noArrow: true,
horizontal: true,
download: false,
size: 'small',
linksGroup: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/components/DsfrCard/DsfrCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const props = withDefaults(defineProps<{
linksGroup?:({ label: string, to?: RouteLocationRaw, link?: string, href?: string })[]
noArrow?: boolean
horizontal?: boolean
download?: boolean
}>(), {
imgSrc: undefined,
link: undefined,
Expand Down Expand Up @@ -54,6 +55,7 @@ defineExpose({ goToTargetLink })
'fr-enlarge-link': !noArrow,
'fr-card--sm': sm,
'fr-card--lg': lg,
'fr-card--download': download,
}"
data-testid="fr-card"
>
Expand Down

0 comments on commit 97e688b

Please sign in to comment.