dsfr-view-components 4.1 → 4.1.1

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: 1d311caf744ed3223836fc43f8e70b51666992df4c2b2f10f43ac8e302baf115
4
- data.tar.gz: 7cdd00c96f50f984230622d24a138f2a46375ba5819daefa8e400ef65fb7c93e
3
+ metadata.gz: 19d3e1841b16361d23f4bb0fad549e2da2537e0e2fbfdd3e217b38e39c543490
4
+ data.tar.gz: d2df597a2cde398651b95ce5716963c9d0a61a3e4550226b7d471c81a65adaa9
5
5
  SHA512:
6
- metadata.gz: 0ebe93f69a0cb26daf0bb4900c0c525a2e817cec21c748d8f9ddfa4bf7aa30bfe518b0a4163ae709f7af2a8888b90ea2d7961a71c4f33374f34595538878737d
7
- data.tar.gz: f8ca4ff1f611861c3f60962a02d24eab0d1461b934fbf6576eaaee1b2b9f90f8a11332836dfadfba7c6fcfbc8d8f858787fb99bcfe3c18a5e4834298471d82d1
6
+ metadata.gz: 27a7c59c51b5bf95974ad169790c21b0f69d090e1968345c6f2f223071aaf70c75a9dd4276ce90a5803a61a1bf716a4f85ff7961c826db66f79a8a098705d52d
7
+ data.tar.gz: af64ba7667e3f608563e17ceb1733ce41aff87323f862fbb6ea9fa48fe1823d5a61fa26922c78368c1cdc7159534070b04c78066df9906b1e5f4f24c91db5fe6
@@ -6,17 +6,20 @@ module DsfrComponent
6
6
 
7
7
  renders_one :action_zone
8
8
 
9
- # @param title [String] Le titre de la mise en avant
10
- # @param icon_name [String] Le nom de licône à afficher (exemple `arrow-right-line`), ou `:none` pour la désactiver (optionnel)
9
+ # @param title [String] Le titre de la mise en avant (optionnel)
10
+ # @param icon_name [String] Le nom de l'icône à afficher (exemple `arrow-right-line`), ou `:none` pour la désactiver (optionnel)
11
+ # @param accent [String] La couleur d'accent (exemple `green-tilleul-verveine`) (optionnel)
11
12
  # @param header_level [Integer] Le niveau de titre (optionnel)
12
13
  def initialize(
13
- title:,
14
+ title: nil,
14
15
  icon_name: "information-line",
16
+ accent: nil,
15
17
  header_level: nil,
16
18
  html_attributes: {}
17
19
  )
18
20
  @title = title
19
21
  @icon_name = icon_name
22
+ @accent = accent
20
23
  self.header_level = header_level
21
24
 
22
25
  super(html_attributes: html_attributes)
@@ -24,7 +27,7 @@ module DsfrComponent
24
27
 
25
28
  def call
26
29
  tag.div(**html_attributes) do
27
- concat content_tag(header_tag, @title, class: 'fr-callout__title')
30
+ concat content_tag(header_tag, @title, class: 'fr-callout__title') if @title
28
31
 
29
32
  concat content_tag(:p, content, class: 'fr-callout__text')
30
33
 
@@ -38,6 +41,7 @@ module DsfrComponent
38
41
  classes = ["fr-callout"]
39
42
 
40
43
  classes.push("fr-icon-#{@icon_name}") unless @icon_name == :none
44
+ classes.push("fr-callout--#{@accent}") if @accent
41
45
 
42
46
  { class: classes.join(" ") }
43
47
  end
@@ -1,5 +1,5 @@
1
1
  module Dsfr
2
2
  module Components
3
- VERSION = '4.1'.freeze
3
+ VERSION = '4.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dsfr-view-components
3
3
  version: !ruby/object:Gem::Version
4
- version: '4.1'
4
+ version: 4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BetaGouv developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-15 00:00:00.000000000 Z
11
+ date: 2026-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-attributes-utils