Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ Mise à jour du composant Carte #593

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ module.exports = {
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
semi: ['error', 'never'],
quotes: [2, 'single'],
Expand Down
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="download",
: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="download",
: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="download",
: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="download",
: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="download",
: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
Loading