dsfr-view-components 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef54774bdcf1ad2c6169da53867dc97bc45ee11759826a6892bde1f48d8d3928
|
4
|
+
data.tar.gz: 3fea1dab55f0be17c46214bd45c1cf93f9c0cd967d8b27a754a8c7dda9db46c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e82dac0aecf55ef15275bab28fc97dd345b22911292b451d5f5a390d4c99f8169708b1261a52db629cca7b1c59c420632f9b1e67ae829c75f52c6328b13eb488
|
7
|
+
data.tar.gz: ba573c5bf3ce60a132be6155047435fd32f98f0d55309269a1f37704e361154a100117746c978c80c70a8c1ab42580959d0ced78ee6a12a4e8ed2542fca47e3a
|
data/README.md
CHANGED
@@ -13,19 +13,6 @@ Cette gem fournit des composants pour le Design Système de l'État (DSFR) en s'
|
|
13
13
|
|
14
14
|
C'est un fork de [govuk-components](https://github.com/DFE-Digital/govuk-components) qui propose l'équivalent pour le GOV.UK Design System.
|
15
15
|
|
16
|
-
|
17
|
-
## Développement en cours ⚠️
|
18
|
-
|
19
|
-
Cette gem est en cours de développement et n'est pas encore
|
20
|
-
recommandée pour un usage en production.
|
21
|
-
|
22
|
-
N'hésitez pas à contribuer pour nous aider à avancer, un générateur de
|
23
|
-
composant est même fourni pour vous faciliter la tâche :
|
24
|
-
|
25
|
-
```sh
|
26
|
-
bin/rails g dsfr_component FancyButton --params title:String count:Integer
|
27
|
-
```
|
28
|
-
|
29
16
|
## Documentation
|
30
17
|
|
31
18
|
Un [guide complet est disponible](https://betagouv.github.io/dsfr-view-components/). Il contient des instructions pour l'installation et l'usage de cette gem. Les exemples présents éxecutent le code et seront donc toujours à jour.
|
@@ -42,44 +29,7 @@ require "dsfr/components"
|
|
42
29
|
|
43
30
|
Cette gem a pour but de supporter tous les composants proposés par le Design Système de l'État hormis ceux concernant les formulaires. Ceux-ci seront fournis dans une gem indépendante dans le futur.
|
44
31
|
|
45
|
-
|
46
|
-
|
47
|
-
- [x] Accordéon - Accordion
|
48
|
-
- [x] Alertes - Alert
|
49
|
-
- [x] Badge
|
50
|
-
- [ ] Bandeau d'information importante
|
51
|
-
- [ ] Barre de recherche - Search bar
|
52
|
-
- [x] Boutons - Buttons
|
53
|
-
- [ ] Groupe de bouton
|
54
|
-
- [ ] Bouton FranceConnect
|
55
|
-
- [ ] Cartes - Cards
|
56
|
-
- [ ] Citation - Quote
|
57
|
-
- [ ] Contenu médias - Responsive médias
|
58
|
-
- [x] En-tête - Header
|
59
|
-
- [ ] Fil d'Ariane - Breadcrumb
|
60
|
-
- [ ] Gestionnaire de consentement - Consent banner
|
61
|
-
- [ ] Icônes de favoris - Favicons
|
62
|
-
- [x] Indicateur d'étape - Stepper
|
63
|
-
- [ ] Interrupteur - Toggle switch
|
64
|
-
- [ ] Lettre d'information et réseaux sociaux - Newsletter & Follow us
|
65
|
-
- [x] Liens - Links
|
66
|
-
- [ ] Liens d'évitement - Skiplinks
|
67
|
-
- [ ] Menu latéral - Side menu
|
68
|
-
- [ ] Mise en avant - Call out
|
69
|
-
- [ ] Mise en exergue - Highlight
|
70
|
-
- [x] Modale - Modal
|
71
|
-
- [ ] Navigation principale - Main navigation
|
72
|
-
- [x] Onglets - Tabs
|
73
|
-
- [ ] Pagination
|
74
|
-
- [ ] Paramètres d'affichage - Display
|
75
|
-
- [ ] Partage - Share
|
76
|
-
- [ ] Pied de page - Footer
|
77
|
-
- [ ] Sélecteur de langue
|
78
|
-
- [ ] Sommaire - Summary
|
79
|
-
- [ ] Tableau - Table
|
80
|
-
- [x] Tag
|
81
|
-
- [ ] Téléchargement de fichier
|
82
|
-
- [x] Tuile - Tile
|
32
|
+
La [liste des composants implémentés ou restants est consultable grâce au label `composant`](https://github.com/betagouv/dsfr-view-components/issues?page=2&q=is%3Aissue+label%3Acomposant) sur ce même dépôt.
|
83
33
|
|
84
34
|
<!--
|
85
35
|
This library also provides helpers for creating [links](https://govuk-components.netlify.app/helpers/link),
|
@@ -108,6 +58,7 @@ bundle exec rspec spec
|
|
108
58
|
```
|
109
59
|
|
110
60
|
Pour développer avec les tests en continu :
|
61
|
+
|
111
62
|
```sh
|
112
63
|
bundle exec guard
|
113
64
|
```
|
@@ -118,6 +69,13 @@ Lancer le guide de documentation :
|
|
118
69
|
make watch-guide
|
119
70
|
```
|
120
71
|
|
72
|
+
Utilisez le générateur pour créer un nouveau composant :
|
73
|
+
|
74
|
+
```sh
|
75
|
+
bin/rails g dsfr_component FancyButton --params title:String count:Integer
|
76
|
+
```
|
77
|
+
|
78
|
+
|
121
79
|
Lancer la dummy app pour itérer sur les composants :
|
122
80
|
|
123
81
|
```sh
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= tag.nav(**html_attributes) do %>
|
2
|
+
<button
|
3
|
+
class="fr-breadcrumb__button"
|
4
|
+
aria-expanded="false"
|
5
|
+
aria-controls="breadcrumbs">
|
6
|
+
Voir le fil d’Ariane
|
7
|
+
</button>
|
8
|
+
<div class="fr-collapse" id="breadcrumbs">
|
9
|
+
<ol class="fr-breadcrumb__list">
|
10
|
+
<% breadcrumbs.each do |crumb| %>
|
11
|
+
<li>
|
12
|
+
<%= crumb %>
|
13
|
+
</li>
|
14
|
+
<% end %>
|
15
|
+
</ol>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class DsfrComponent::BreadcrumbsComponent < DsfrComponent::Base
|
2
|
+
renders_many :breadcrumbs, ->(label:, href: nil) do
|
3
|
+
attributes = if href.nil?
|
4
|
+
{ aria: { current: true } }
|
5
|
+
else
|
6
|
+
{ href: href }
|
7
|
+
end
|
8
|
+
|
9
|
+
content_tag(:a, class: 'fr-breadcrumb__link', **attributes) { label }
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(classes: [], html_attributes: {})
|
13
|
+
super(classes: classes, html_attributes: html_attributes)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def default_attributes
|
19
|
+
{
|
20
|
+
class: 'fr-breadcrumb',
|
21
|
+
aria: { label: 'vous êtes ici :' },
|
22
|
+
role: "navigation"
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
@@ -4,6 +4,7 @@ module DsfrComponentsHelper
|
|
4
4
|
dsfr_alert: 'DsfrComponent::AlertComponent',
|
5
5
|
dsfr_accordion: 'DsfrComponent::AccordionComponent',
|
6
6
|
dsfr_accordion_section: 'DsfrComponent::AccordionComponent::SectionComponent',
|
7
|
+
dsfr_breadcrumbs: 'DsfrComponent::BreadcrumbsComponent',
|
7
8
|
dsfr_tile: 'DsfrComponent::TileComponent',
|
8
9
|
dsfr_badge: 'DsfrComponent::BadgeComponent',
|
9
10
|
dsfr_tag: 'DsfrComponent::TagComponent',
|
metadata
CHANGED
@@ -1,57 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dsfr-view-components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BetaGouv developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: actionpack
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '6.1'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '6.1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activemodel
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '6.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '6.1'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: railties
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '6.1'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '6.1'
|
55
13
|
- !ruby/object:Gem::Dependency
|
56
14
|
name: html-attributes-utils
|
57
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -451,6 +409,8 @@ files:
|
|
451
409
|
- app/components/dsfr_component/alert_component.rb
|
452
410
|
- app/components/dsfr_component/badge_component.rb
|
453
411
|
- app/components/dsfr_component/base.rb
|
412
|
+
- app/components/dsfr_component/breadcrumbs_component.html.erb
|
413
|
+
- app/components/dsfr_component/breadcrumbs_component.rb
|
454
414
|
- app/components/dsfr_component/button_component.rb
|
455
415
|
- app/components/dsfr_component/header_component.html.erb
|
456
416
|
- app/components/dsfr_component/header_component.rb
|