motif-breadcrumbs 0.4.1 → 0.5.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: 58b85b39ff42181e6eec1001c1b8121bea0a1b842c3a97a2213e0abc0365bf9d
4
- data.tar.gz: '01800f3aeae6ff1d248d1c30b74eea3ec0751ff1dc1df207a214b928be282b53'
3
+ metadata.gz: c69fafd20d00996a3d9226640433100bde308aa7397456153752ecd59166d20d
4
+ data.tar.gz: 0d71f64d5d6be2b330bc3f9a265986cb711e0e236514062c928278d66af38d93
5
5
  SHA512:
6
- metadata.gz: ce067650e5e59d0ba7eb8cf783b33905b355962e687ceeca77ff92981551135ae5b6753f5facdb294c2a7fafcdaacab49d692affde41a4bbbf059cdbd59136c0
7
- data.tar.gz: d459e96bb31f8df2f0ad42eb6a3d006cbb34ec13efbb4b932dbaef5ff939060bd27068d8ad841695b019d67eff0b122684c58bd1b3e7e1d5e19591b3521926ad
6
+ metadata.gz: a12297f8f360f85e5ed915603a14ee3651ea07e356308cf747b25b65df487abadb3a77fe5384acb201ae85467d296c8ddd18ea63a7c29000571c6135d4beaf08
7
+ data.tar.gz: d0ec2ebf4f7526bf4bf96118ecff869e629edd3e116a348e0b11dd414494ea7eab60083dce5955871d68ff856370b9db6bdd34afdcce2ca2b3bdbe9fa5125d0e
@@ -1,6 +1,6 @@
1
1
  <li<%= " aria-current=\"page\"".html_safe if @current %>>
2
2
  <% if @href.present? %>
3
- <a href="<%= @href %>">
3
+ <a href="<%= @href %>"<%= " class=\"#{@link_class}\"".html_safe if @link_class.present? %>>
4
4
  <% if icon? %><%= icon %><% elsif rendered_icon %><%= rendered_icon %><% end %>
5
5
  <%= @text %>
6
6
  </a>
@@ -6,13 +6,14 @@ module Motif
6
6
  class CrumbComponent < ViewComponent::Base
7
7
  renders_one :icon
8
8
 
9
- #: (text: String, ?href: String?, ?icon: String?, ?current: bool, ?icon_renderer: ^(String) -> String | nil) -> void
10
- def initialize(text:, href: nil, icon: nil, current: false, icon_renderer: nil)
9
+ #: (text: String, ?href: String?, ?icon: String?, ?current: bool, ?icon_renderer: ^(String) -> String | nil, ?link_class: String?) -> void
10
+ def initialize(text:, href: nil, icon: nil, current: false, icon_renderer: nil, link_class: nil)
11
11
  @text = text
12
12
  @href = href
13
13
  @icon = icon
14
14
  @current = current
15
15
  @icon_renderer = icon_renderer
16
+ @link_class = link_class
16
17
  end
17
18
 
18
19
  #: -> String?
@@ -7,7 +7,8 @@
7
7
  href: current ? nil : crumb.href,
8
8
  icon: crumb.icon,
9
9
  current: current,
10
- icon_renderer: @icon_renderer
10
+ icon_renderer: @icon_renderer,
11
+ link_class: @link_class
11
12
  ) %>
12
13
  <% end %>
13
14
  </ul>
@@ -9,14 +9,16 @@ module Motif
9
9
  #| ?html_class: String,
10
10
  #| ?aria_current_on_last: bool,
11
11
  #| ?min_crumbs: Integer,
12
- #| ?icon_renderer: ^(String) -> String | nil
12
+ #| ?icon_renderer: ^(String) -> String | nil,
13
+ #| ?link_class: String?
13
14
  #| ) -> void
14
- def initialize(trail:, html_class: "breadcrumbs text-sm", aria_current_on_last: true, min_crumbs: 2, icon_renderer: nil)
15
+ def initialize(trail:, html_class: "breadcrumbs text-sm", aria_current_on_last: true, min_crumbs: 2, icon_renderer: nil, link_class: nil)
15
16
  @trail = trail
16
17
  @html_class = html_class
17
18
  @aria_current_on_last = aria_current_on_last
18
19
  @min_crumbs = min_crumbs
19
20
  @icon_renderer = icon_renderer
21
+ @link_class = link_class
20
22
  end
21
23
 
22
24
  #: -> bool
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motif-breadcrumbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Weistroff