-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/layout
- Loading branch information
Showing
37 changed files
with
1,191 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { breadcrumb } from './breadcrumb.js'; | ||
import Breadcrumb from './Breadcrumb.twig'; | ||
|
||
export default { | ||
title: 'Design System/Molecules/Breadcrumb' | ||
}; | ||
|
||
export const Base = { | ||
render: (args) => Breadcrumb(args), | ||
args: { | ||
items: [ | ||
{ label: 'Page parante', href: '#' }, | ||
{ label: 'Page mère', href: '#' }, | ||
{ label: 'Page actuelle' } | ||
] | ||
} | ||
}; | ||
|
||
export const Lengthy = { | ||
render: (args) => Breadcrumb(args), | ||
play: () => { | ||
breadcrumb(); | ||
}, | ||
args: { | ||
items: [ | ||
{ label: 'Non visible', href: '#' }, | ||
{ label: 'Non visible', href: '#' }, | ||
{ label: 'Page parante', href: '#' }, | ||
{ label: 'Page mère', href: '#' }, | ||
{ label: 'Page actuelle' } | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% set classes = classes|default('') %} | ||
{% set items = items|default([]) %} | ||
|
||
<nav class="Breadcrumb{{ classes }}" aria-label="Fil d'Ariane"> | ||
<ol class="Breadcrumb-list" itemscope itemtype="https://schema.org/BreadcrumbList"> | ||
{% if items.length > 3 %} | ||
<li id="Breadcrumb-compressed" class="Breadcrumb-item Breadcrumb-item--isLink"> | ||
<button class="Breadcrumb-item-link Breadcrumb-compressed">...</button> | ||
</li> | ||
{% endif %} | ||
|
||
{% for item in items %} | ||
<li class="Breadcrumb-item paragraph-3{% if item.href %} Breadcrumb-item--isLink{% endif %}{% if loop.index <= (items.length - 3) %} hide{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> | ||
{% if item.href %} | ||
<a class="Breadcrumb-item-link" href="{{ item.href }}" itemprop="item"> | ||
<span itemprop="name">{{ item.label }}</span> | ||
</a> | ||
<meta itemprop="position" content="{{ loop.index + 1 }}"/> | ||
{% else %} | ||
<span itemprop="name" aria-current="page"> | ||
{{ item.label }} | ||
</span> | ||
<meta itemprop="position" content="{{ loop.index + 1 }}"/> | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const breadcrumb = () => { | ||
const btnCompressed = document.querySelector('.Breadcrumb-compressed'); | ||
const liCompressed = document.getElementById('Breadcrumb-compressed'); | ||
const items = document.querySelectorAll('.Breadcrumb-item'); | ||
|
||
if (btnCompressed) { | ||
btnCompressed.addEventListener('click', function () { | ||
items.forEach(function (item) { | ||
item.classList.remove('hide'); | ||
}); | ||
liCompressed.classList.add('hide'); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.Breadcrumb { | ||
&-list { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: rem-convert(8px); | ||
align-items: center; | ||
} | ||
|
||
&-item { | ||
color: var(--black); | ||
display: flex; | ||
gap: rem-convert(8px); | ||
|
||
&--isLink { | ||
&::after { | ||
content: '/'; | ||
font-size: rem-convert(10px); | ||
} | ||
} | ||
|
||
&-link { | ||
outline: none; | ||
text-decoration: underline; | ||
|
||
a&:hover { | ||
color: var(--grey); | ||
} | ||
|
||
&:focus-visible { | ||
background-color: var(--vermillon-light); | ||
} | ||
} | ||
} | ||
|
||
&-compressed { | ||
background-color: var(--grey-lightest); | ||
width: rem-convert(16px); | ||
height: rem-convert(16px); | ||
display: inline-flex; | ||
justify-content: center; | ||
line-height: rem-convert(8px); | ||
text-decoration: none; | ||
margin-top: rem-convert(2px); | ||
|
||
&:focus-visible { | ||
background-color: var(--grey-lightest); | ||
border: solid 1px var(--vermillon-medium); | ||
} | ||
|
||
&:hover { | ||
background-color: var(--vermillon-lightest); | ||
} | ||
} | ||
|
||
.hide { | ||
display: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
components/Molecules/ChoiceCards/Checkbox/CheckboxChoiceCard.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import CheckBoxChoiceCard from './CheckboxChoiceCard.twig'; | ||
|
||
export default { | ||
title: 'Design System/Molecules/ChoiceCards/CheckboxChoiceCard' | ||
}; | ||
|
||
export const base = { | ||
render: (args) => CheckBoxChoiceCard(args), | ||
args: { | ||
text: 'Label', | ||
size: 'sm', | ||
disabled: false, | ||
description: 'ici une courte description', | ||
name: 'checkbox', | ||
checked: false | ||
}, | ||
argTypes: { | ||
size: { | ||
control: { type: 'select' }, | ||
options: ['sm', 'lg'] | ||
}, | ||
text: { | ||
control: { type: 'text' } | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' } | ||
}, | ||
description: { | ||
control: { type: 'text' } | ||
} | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
components/Molecules/ChoiceCards/Checkbox/CheckboxChoiceCard.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% set choiceCardClasses = 'ChoiceCard ChoiceCard--' ~ size %} | ||
{% if checked %} | ||
{% set choiceCardClasses = choiceCardClasses ~ ' ChoiceCard--active' %} | ||
{% endif %} | ||
{% if disabled %} | ||
{% set choiceCardClasses = choiceCardClasses ~ ' ChoiceCard--disabled' %} | ||
{% endif %} | ||
|
||
<div class="{{ choiceCardClasses }}"> | ||
{% include '../../Form/Checkbox.twig' with { label: text, name: name, disabled: disabled, checked: checked, classes: "inChoiceCard" } %} | ||
|
||
{% if description and size == "lg" %} | ||
<p class="ChoiceCard-description paragraph-4">{{ description }}</p> | ||
{% endif %} | ||
</div> |
28 changes: 14 additions & 14 deletions
28
components/Molecules/ChoiceCards/IconText/IconTextChoiceCard.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<button class='IconTextChoiceCard IconTextChoiceCard--{{ variant }} {% if not iconLeft and iconRight %}justify-between{% endif %}' {% if disabled %}disabled{% endif %}> | ||
{% if iconLeft %} | ||
<span class='IconTextChoiceCard-icon'> | ||
{{ source('/icons/' ~ iconLeft ~ '.svg') }} | ||
</span> | ||
{% endif %} | ||
{% if text %} | ||
<span class='IconTextChoiceCard-text paragraph-3'>{{ text }}</span> | ||
{% endif %} | ||
{% if iconRight %} | ||
<span class='IconTextChoiceCard-icon'> | ||
{{ source('/icons/' ~ iconRight ~ '.svg') }} | ||
</span> | ||
{% endif %} | ||
<button class='IconTextChoiceCard IconTextChoiceCard--{{ variant }} {% if not iconLeft and iconRight %}justify-between{% endif %}' {% if disabled %} disabled {% endif %}> | ||
{% if iconLeft %} | ||
<span class='IconTextChoiceCard-icon IconTextChoiceCard-iconLeft'> | ||
{{ source('/icons/' ~ iconLeft ~ '.svg') }} | ||
</span> | ||
{% endif %} | ||
{% if text %} | ||
<span class='IconTextChoiceCard-text paragraph-3'>{{ text }}</span> | ||
{% endif %} | ||
{% if iconRight %} | ||
<span class='IconTextChoiceCard-icon IconTextChoiceCard-iconRight'> | ||
{{ source('/icons/' ~ iconRight ~ '.svg') }} | ||
</span> | ||
{% endif %} | ||
</button> |
32 changes: 32 additions & 0 deletions
32
components/Molecules/ChoiceCards/Radio/RadioChoiceCard.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import RadioChoiceCard from './RadioChoiceCard.twig'; | ||
|
||
export default { | ||
title: 'Design System/Molecules/ChoiceCards/RadioChoiceCard' | ||
}; | ||
|
||
export const base = { | ||
render: (args) => RadioChoiceCard(args), | ||
args: { | ||
text: 'Label', | ||
size: 'sm', | ||
disabled: false, | ||
description: 'ici une courte description', | ||
name: 'radio', | ||
checked: false | ||
}, | ||
argTypes: { | ||
size: { | ||
control: { type: 'select' }, | ||
options: ['sm', 'lg'] | ||
}, | ||
text: { | ||
control: { type: 'text' } | ||
}, | ||
disabled: { | ||
control: { type: 'boolean' } | ||
}, | ||
description: { | ||
control: { type: 'text' } | ||
} | ||
} | ||
}; |
15 changes: 15 additions & 0 deletions
15
components/Molecules/ChoiceCards/Radio/RadioChoiceCard.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% set choiceCardClasses = 'ChoiceCard ChoiceCard--' ~ size %} | ||
{% if checked %} | ||
{% set choiceCardClasses = choiceCardClasses ~ ' ChoiceCard--active' %} | ||
{% endif %} | ||
{% if disabled %} | ||
{% set choiceCardClasses = choiceCardClasses ~ ' ChoiceCard--disabled' %} | ||
{% endif %} | ||
|
||
<div class="{{ choiceCardClasses }}"> | ||
{% include '../../Form/Radio.twig' with { label: text, name: name, disabled: disabled, checked: checked, classes: "inChoiceCard" } %} | ||
|
||
{% if description and size == "lg" %} | ||
<p class="ChoiceCard-description paragraph-4">{{ description }}</p> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.