keystone_ui 0.91.0 → 0.92.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: b9bf356853cd37ca641b13f160ba77d2420d3005a96972b074da68fa05fc69b0
|
|
4
|
+
data.tar.gz: a36f4eba2107811125c8271bdbfb01bc8c5fb81c11c049e359947259ab743064
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dace813fef26a5f673dc59fbd07dfd49bb5fe9e405080a60ab5825f465f3bcfef744f9c7dbe80f9ea98156ad5bf0fb3163e622b336211a02bd451cc26a244e0b
|
|
7
|
+
data.tar.gz: 7f2b8f8604d4c4bdb9be1c57ab61a0723202047158c203adddd4c13c1988b58fde6f7e866b94bf8be77520426d1429416a787bdf2ca45bdfdfdf45760f288d96
|
|
@@ -7,9 +7,15 @@
|
|
|
7
7
|
<% end %>
|
|
8
8
|
</div>
|
|
9
9
|
<span class="<%= TITLE_CLASSES %>">
|
|
10
|
+
<% if @overline.present? %>
|
|
11
|
+
<span class="<%= OVERLINE_CLASSES %>"><%= @overline %></span>
|
|
12
|
+
<% end %>
|
|
10
13
|
<%= @title %>
|
|
11
14
|
<% if @subtitle.present? %>
|
|
12
15
|
<span class="<%= SUBTITLE_CLASSES %>"><%= @subtitle %></span>
|
|
13
16
|
<% end %>
|
|
14
17
|
</span>
|
|
18
|
+
<% if @badge %>
|
|
19
|
+
<%= render Keystone::Ui::BadgeComponent.new(**@badge, class: BADGE_CLASSES) %>
|
|
20
|
+
<% end %>
|
|
15
21
|
</div>
|
|
@@ -20,6 +20,8 @@ module Keystone
|
|
|
20
20
|
BACK_LINK_CLASSES = "ks-mobile-header-back"
|
|
21
21
|
TITLE_CLASSES = "ks-mobile-header-title flex-[1_1_6rem] min-w-0 self-center lg:hidden truncate"
|
|
22
22
|
SUBTITLE_CLASSES = "ks-mobile-header-subtitle block text-xs truncate"
|
|
23
|
+
OVERLINE_CLASSES = "ks-mobile-header-subtitle block text-xs truncate"
|
|
24
|
+
BADGE_CLASSES = "ml-auto shrink-0 self-center"
|
|
23
25
|
DROPDOWN_CLASSES = "ks-action-menu hidden absolute right-0 z-50 w-48 origin-top-right"
|
|
24
26
|
|
|
25
27
|
# Renders the left-side and title of the mobile header.
|
|
@@ -29,10 +31,12 @@ module Keystone
|
|
|
29
31
|
# <% if content_for?(:form_page) %>
|
|
30
32
|
# <%= ui_mobile_header_left %>
|
|
31
33
|
# <% end %>
|
|
32
|
-
def initialize(title:, back_url:, subtitle: nil)
|
|
34
|
+
def initialize(title:, back_url:, subtitle: nil, overline: nil, badge: nil)
|
|
33
35
|
@title = title
|
|
34
36
|
@back_url = back_url
|
|
35
37
|
@subtitle = subtitle
|
|
38
|
+
@overline = overline
|
|
39
|
+
@badge = badge
|
|
36
40
|
end
|
|
37
41
|
end
|
|
38
42
|
end
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keystone_ui-develop
|
|
3
|
-
description: Use PROACTIVELY for building or editing screens in a Rails app that has keystone_ui — page shells with Back links and breadcrumbs, forms and fields, a search field that picks a record or enters a new one, data tables with saved columns, desktop navigation, sidebars and bottom tabs, a page's main action as a phone top-bar icon or a button fixed to the bottom of the screen, a question asked before a button or main action goes ahead, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps, drawn one line per step with a marked time axis if wanted, with retries and their count, queued time, failed tries, steps still running, steps waiting on approval, links to each try and the current step marked, amounts shown in green or red as a gain or loss, status dots coloured by state, pictures held to half the screen, a short note or badge at the right of a section's title, a record's details as labelled values in rows or in two columns, two versions of a text compared line by line side by side, info buttons and breakdowns, marketing sections, a light/dark theme switch — MUST BE USED instead of hand-writing ERB and Tailwind for UI.
|
|
3
|
+
description: Use PROACTIVELY for building or editing screens in a Rails app that has keystone_ui — page shells with Back links and breadcrumbs, forms and fields, a search field that picks a record or enters a new one, data tables with saved columns, desktop navigation, sidebars and bottom tabs, a phone header with a line above its title and a badge at its right end, a page's main action as a phone top-bar icon or a button fixed to the bottom of the screen, a question asked before a button or main action goes ahead, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps, drawn one line per step with a marked time axis if wanted, with retries and their count, queued time, failed tries, steps still running, steps waiting on approval, links to each try and the current step marked, amounts shown in green or red as a gain or loss, status dots coloured by state, pictures held to half the screen, a short note or badge at the right of a section's title, a record's details as labelled values in rows or in two columns, two versions of a text compared line by line side by side, info buttons and breakdowns, marketing sections, a light/dark theme switch — MUST BE USED instead of hand-writing ERB and Tailwind for UI.
|
|
4
4
|
tools: Bash, Read, Write, Edit, Grep
|
|
5
5
|
scope: UI — pages, forms, tables, navigation, dashboards
|
|
6
6
|
---
|
|
@@ -41,7 +41,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
41
41
|
- `ui_nav_dropdown` — a navbar dropdown menu.
|
|
42
42
|
- `ui_bottom_nav` — the mobile bottom tab bar.
|
|
43
43
|
- `ui_bottom_nav_item` — one tab in the bottom tab bar.
|
|
44
|
-
- `ui_mobile_header` — a mobile back arrow and a title beside it.
|
|
44
|
+
- `ui_mobile_header` — a mobile back arrow and a title beside it, with an optional line above the title and a badge at the right end.
|
|
45
45
|
- `ui_mobile_actions` — an ellipsis menu of actions shown only below `lg:`.
|
|
46
46
|
- `ui_mobile_action` — a plus icon link to the action a screen's page header publishes, for the phone top bar.
|
|
47
47
|
- `ui_bottom_action` — a full-width button for the action a screen's page header publishes, in a bar fixed to the bottom of a phone screen.
|
|
@@ -319,7 +319,7 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
319
319
|
where `icon:` is a raw SVG string and `count:` above zero shows in a badge
|
|
320
320
|
over the icon. The bar is hidden from `lg:` up and inside a
|
|
321
321
|
Hotwire Native web view.
|
|
322
|
-
- `ui_mobile_header(title:, back_url:, subtitle: nil)` is hidden from `lg:`
|
|
322
|
+
- `ui_mobile_header(title:, back_url:, subtitle: nil, overline: nil, badge: nil)` is hidden from `lg:`
|
|
323
323
|
up and goes in the navbar's `mobile_left` slot or directly in the
|
|
324
324
|
layout's `<header>`. `back_url:` must be passed, and `nil` renders the
|
|
325
325
|
title with no back arrow. Outside a top bar it draws the arrow, title and
|
|
@@ -332,7 +332,13 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
332
332
|
under it. In a hand-written top bar, give the bar the `top-nav` class,
|
|
333
333
|
make the header a direct child of the bar's flex row, and add
|
|
334
334
|
`max-lg:has-[.ks-mobile-header-title]:flex-wrap` to the bar if its
|
|
335
|
-
controls can fill its width.
|
|
335
|
+
controls can fill its width. `overline:` is a short muted line shown
|
|
336
|
+
above the title, such as `"Inbox · 7 items"`. `badge:` takes the
|
|
337
|
+
`label:` and `variant:` keywords of `ui_badge`, such as
|
|
338
|
+
`{ label: "46h left", variant: :warning }`, and draws the badge at the
|
|
339
|
+
right end of the header, before the bar's right-side controls, at its
|
|
340
|
+
full width, so a long title ends in an ellipsis instead of pushing the
|
|
341
|
+
badge off the screen.
|
|
336
342
|
- `ui_mobile_action` takes no keywords and no block, and goes in the top
|
|
337
343
|
bar's right side, such as the navbar's `mobile_right` slot. It draws a plus
|
|
338
344
|
icon linking to the `action_url:` a screen gives `ui_page_header`, named
|