keystone_ui 0.72.0 → 0.73.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: d022ceb3f34fcc5f5b576284d6e61e546adc129219760b94cc144520f135e67f
|
|
4
|
+
data.tar.gz: 187d25d879625ded62755e7ad640cfa06c9cf8bcac07d3931c6f75e6fa9b2786
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96cd19e46f7e460bb112e138df25683af5402f791be5e63923c6fb56abf89f94f78e483dcba245d74884c98692b06fd1df2ec2b3472d5c90dd8381bb2d51eb26
|
|
7
|
+
data.tar.gz: e4b2ca64098f66d7dc4d6dce92901023693265a5686d4ebbf9063dc05687e6e0ca76dc9b9d23af448cecd7d2b7806aef49817fffac51995d4de1335c359b26b1
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
<% if link_tabs? %>
|
|
2
|
+
<% tab_row = capture do %>
|
|
2
3
|
<nav class="<%= classes %>">
|
|
3
4
|
<% tabs.each do |tab| %>
|
|
4
5
|
<a href="<%= tab[:href] %>" data-turbo-action="replace" class="<%= tab[:current] ? tab_classes : TAB_BASE_CLASSES %>"<% if tab[:current] %> aria-current="page" data-active<% end %>><%= tab[:label] %></a>
|
|
5
6
|
<% end %>
|
|
6
7
|
</nav>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% if summary? %>
|
|
10
|
+
<div class="<%= LAYOUT_CLASSES %>">
|
|
11
|
+
<div class="<%= SUMMARY_CLASSES %>"><%= summary %></div>
|
|
12
|
+
<%= tab_row %>
|
|
13
|
+
<div class="<%= CONTENT_CLASSES %>"><%= content %></div>
|
|
14
|
+
</div>
|
|
15
|
+
<% else %>
|
|
16
|
+
<%= tab_row %>
|
|
7
17
|
<%= content %>
|
|
18
|
+
<% end %>
|
|
8
19
|
<% else %>
|
|
9
|
-
<div data-controller="tab-switcher"
|
|
20
|
+
<div data-controller="tab-switcher"<% if summary? %> class="<%= LAYOUT_CLASSES %>"<% end %>>
|
|
21
|
+
<% if summary? %>
|
|
22
|
+
<div class="<%= SUMMARY_CLASSES %>"><%= summary %></div>
|
|
23
|
+
<% end %>
|
|
10
24
|
<div class="<%= classes %>">
|
|
11
25
|
<% tabs.each_with_index do |tab, index| %>
|
|
12
26
|
<button
|
|
@@ -18,6 +32,10 @@
|
|
|
18
32
|
<%= "data-active" if index == 0 %>><%= tab %></button>
|
|
19
33
|
<% end %>
|
|
20
34
|
</div>
|
|
35
|
+
<% if summary? %>
|
|
36
|
+
<div class="<%= CONTENT_CLASSES %>"><%= content %></div>
|
|
37
|
+
<% else %>
|
|
21
38
|
<%= content %>
|
|
39
|
+
<% end %>
|
|
22
40
|
</div>
|
|
23
41
|
<% end %>
|
|
@@ -3,9 +3,14 @@
|
|
|
3
3
|
module Keystone
|
|
4
4
|
module Ui
|
|
5
5
|
class TabSwitcherComponent < ViewComponent::Base
|
|
6
|
-
TAB_BAR_CLASSES = "ks-tab-bar flex flex-wrap justify-center"
|
|
7
|
-
TAB_BASE_CLASSES = "ks-tab text-sm transition"
|
|
6
|
+
TAB_BAR_CLASSES = "ks-tab-bar flex flex-wrap justify-center max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:justify-start"
|
|
7
|
+
TAB_BASE_CLASSES = "ks-tab text-sm transition max-sm:shrink-0 max-sm:whitespace-nowrap"
|
|
8
8
|
PANEL_CLASSES = "hidden"
|
|
9
|
+
LAYOUT_CLASSES = "flex flex-col"
|
|
10
|
+
SUMMARY_CLASSES = "max-sm:order-1"
|
|
11
|
+
CONTENT_CLASSES = "max-sm:order-1"
|
|
12
|
+
|
|
13
|
+
renders_one :summary
|
|
9
14
|
|
|
10
15
|
attr_reader :tabs
|
|
11
16
|
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -686,6 +686,13 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
686
686
|
following a tab is a Turbo visit that replaces the history entry. The
|
|
687
687
|
app reads the chosen tab from its params and draws only that tab's
|
|
688
688
|
content in the block.
|
|
689
|
+
- `switcher.with_summary { ... }`, set inside the tab switcher's block,
|
|
690
|
+
takes content such as stat cards. From `sm` up it is drawn above the
|
|
691
|
+
tab row, and below `sm` between the tab row and the panel. It is drawn
|
|
692
|
+
once, so do not draw it twice or add width-specific classes for it.
|
|
693
|
+
- Below `sm` every tab switcher's tab row stays on one line, starts at
|
|
694
|
+
the left edge and scrolls sideways, and from `sm` up it wraps and is
|
|
695
|
+
centred.
|
|
689
696
|
- `ui_swipe_deck(items:, empty_title: "All done!", empty_subtitle: nil)`
|
|
690
697
|
takes a block yielding the deck, where `deck.item { |item| ... }` renders
|
|
691
698
|
one card's face. Accepting sends a bubbling `swipe-deck:complete` event
|