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 +4 -4
- data/lib/motif/breadcrumbs/components/crumb_component.html.erb +1 -1
- data/lib/motif/breadcrumbs/components/crumb_component.rb +3 -2
- data/lib/motif/breadcrumbs/components/navigation_component.html.erb +2 -1
- data/lib/motif/breadcrumbs/components/navigation_component.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c69fafd20d00996a3d9226640433100bde308aa7397456153752ecd59166d20d
|
|
4
|
+
data.tar.gz: 0d71f64d5d6be2b330bc3f9a265986cb711e0e236514062c928278d66af38d93
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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?
|
|
@@ -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
|