Skip to content

Commit

Permalink
feat(link): ajoute des exemples brut et reset
Browse files Browse the repository at this point in the history
  • Loading branch information
zellerbaptiste committed Jun 6, 2023
1 parent 1c01df7 commit fc03a3b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/component/link/example/raw/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% const sample = getSample(include); %>

<%- sample('Lien brut', '../sample/link-default', {link: { classes: [`${prefix}-raw-link`] } }, true); %>

<%- sample('Lien externe brut', '../sample/link-default', {link: { label: 'Lien externe', href:'https://www.systeme-de-design.gouv.fr/', classes: [`${prefix}-raw-link`], attributes: { target: '_blank'} } }, true); %>

<%- sample('Groupe de liens bruts', '../sample/links-group', { linksGroup: { classes: [`${prefix}-raw-link`], links: [{ label: 'Lien externe', href:'https://www.systeme-de-design.gouv.fr/', attributes: { target: '_blank'} }, { label: 'Label lien', href:'../' }, { label: 'Label lien', href:'../' } ] } }, true); %>
5 changes: 5 additions & 0 deletions src/component/link/example/reset/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% const sample = getSample(include); %>

<%- sample('Lien réinitialisé', '../sample/link-default', {link: { classes: [`${prefix}-reset-link`] } }, true); %>

<%- sample('Groupe de liens réinitialisés', '../sample/links-group', { linksGroup: { groupCount: 4, classes: [`${prefix}-reset-link`] } }, true); %>
7 changes: 7 additions & 0 deletions src/component/link/i18n/fr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: Lien
description: Le lien permet la navigation entre une page et un autre contenu au sein de la même page, du même site ou externe. Pour les actions d’un autre type - comme la soumission d’un formulaire - il faut utiliser le composant bouton.
doc: https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/lien
subdir:
title: Variantes
raw: Liens bruts
reset: Liens réinitialisés
4 changes: 2 additions & 2 deletions src/component/link/template/ejs/link.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
<%
const link = locals.link || {};
let linkClasses = link.classes || [];
if (!linkClasses.includes(prefix + '-link')) linkClasses.push(prefix + '-link');
let linkAttrs = link.attributes || {};
const markup = link.markup || 'a';
linkClasses.push(prefix + '-link');
linkAttrs.id = link.id || uniqueId('link');
switch (link.size) {
Expand Down

0 comments on commit fc03a3b

Please sign in to comment.