keystone_ui 0.63.0 → 0.65.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/app/components/keystone/ui/bottom_nav_item_component.html.erb +6 -1
- data/app/components/keystone/ui/bottom_nav_item_component.rb +12 -1
- data/app/components/keystone/ui/form_page_component.html.erb +1 -0
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +3 -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: 1b6aa8d9a69506d5756e9c9dcd36da98466f4c6a2bcbb9dd6b978fbf8c0bf8c3
|
|
4
|
+
data.tar.gz: 771d2441ab01b1ebfa9cc42c757bc9512aaa20a92e1c618361ff445c5b83d0c3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: deb285b833d1035d6657ec2ad10e506162cc8d67f4047969f21ccd1a19a32f6ad10a5627a974d485969fb7ec1fb901adcecac56e366c74b06732540710dd6c44
|
|
7
|
+
data.tar.gz: 10f7e10e713bd6d4bd6ab5032283d7040d11beaf6fa5f52c7928abd67ecb6f74847ca5c9d7e63ffbdbd5c5bb909ec0e25f382397e952f15a2932a82cd2ead35e
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<a href="<%= @href %>" class="<%= item_classes %>">
|
|
2
|
-
<%=
|
|
2
|
+
<span class="<%= ICON_CLASSES %>">
|
|
3
|
+
<%= @icon.html_safe %>
|
|
4
|
+
<% if counted? %>
|
|
5
|
+
<span class="<%= COUNT_CLASSES %>"><%= render count_badge %></span>
|
|
6
|
+
<% end %>
|
|
7
|
+
</span>
|
|
3
8
|
<span class="<%= LABEL_CLASSES %>"><%= @label %></span>
|
|
4
9
|
</a>
|
|
@@ -5,20 +5,31 @@ module Keystone
|
|
|
5
5
|
class BottomNavItemComponent < ViewComponent::Base
|
|
6
6
|
attr_reader :label, :href, :icon
|
|
7
7
|
|
|
8
|
-
def initialize(label:, href:, icon:, active: false)
|
|
8
|
+
def initialize(label:, href:, icon:, active: false, count: nil)
|
|
9
9
|
@label = label
|
|
10
10
|
@href = href
|
|
11
11
|
@icon = icon
|
|
12
12
|
@active = active
|
|
13
|
+
@count = count
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
ITEM_BASE = "ks-bottom-nav-item"
|
|
16
17
|
ACTIVE_CLASS = "active"
|
|
17
18
|
LABEL_CLASSES = "ks-bottom-nav-label"
|
|
19
|
+
ICON_CLASSES = "relative"
|
|
20
|
+
COUNT_CLASSES = "absolute -top-2 -right-3"
|
|
18
21
|
|
|
19
22
|
def item_classes
|
|
20
23
|
@active ? "#{ITEM_BASE} #{ACTIVE_CLASS}" : ITEM_BASE
|
|
21
24
|
end
|
|
25
|
+
|
|
26
|
+
def counted?
|
|
27
|
+
@count.to_i.positive?
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def count_badge
|
|
31
|
+
BadgeComponent.new(label: @count.to_s, variant: :info)
|
|
32
|
+
end
|
|
22
33
|
end
|
|
23
34
|
end
|
|
24
35
|
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<% content_for :form_page, true %>
|
|
2
2
|
<% content_for :form_page_title, @title %>
|
|
3
3
|
<% content_for :form_page_back_url, @back_url %>
|
|
4
|
+
<% content_for :form_page_subtitle, @subtitle if @subtitle.present? %>
|
|
4
5
|
|
|
5
6
|
<% unless top_level? %>
|
|
6
7
|
<% content_for :keystone_page_header, render(Keystone::Ui::DesktopBackLinkComponent.new(url: @back_url)) %>
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -256,8 +256,9 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
256
256
|
`ui_nav_dropdown(title:, area:, active: false)` takes a block holding the
|
|
257
257
|
menu links.
|
|
258
258
|
- `ui_bottom_nav` takes no keywords and a block of
|
|
259
|
-
`ui_bottom_nav_item(label:, href:, icon:, active: false)` calls,
|
|
260
|
-
`icon:` is a raw SVG string
|
|
259
|
+
`ui_bottom_nav_item(label:, href:, icon:, active: false, count: nil)` calls,
|
|
260
|
+
where `icon:` is a raw SVG string and `count:` above zero shows in a badge
|
|
261
|
+
over the icon. The bar is hidden from `lg:` up and inside a
|
|
261
262
|
Hotwire Native web view.
|
|
262
263
|
- `ui_mobile_header(title:, back_url:, subtitle: nil)` is hidden from `lg:`
|
|
263
264
|
up and goes in the navbar's `mobile_left` slot. `back_url:` must be
|