keystone_ui 0.88.0 → 0.89.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: e0c8795d4dabe0c85c98474df7f1942dbdc24c762a48ec356765f867f59d2916
|
|
4
|
+
data.tar.gz: cfb958e216df85fe5f4f504573958b3ac328860187343efdb92010036edc2527
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 784b3d19b8ea3a6326c5f998edf4806669eddbc824e04fe85d865207ddaffc66a8d60b4e0aae32755173b9b8d2437311544e0a28931cacf7eba1742ce837a279
|
|
7
|
+
data.tar.gz: 2dd897dfc7f62339c3f1746e83250055d9b4b0e44a7ddaf4135aee1ee08b382d2ba35f2df4aee8ed371690de768321f78bf175afba67482abe60c5ad0ff9c08c
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<div class="<%= classes %>">
|
|
2
2
|
<% if header? %>
|
|
3
|
-
<div class="<%=
|
|
3
|
+
<div class="<%= header_classes %>">
|
|
4
4
|
<div>
|
|
5
5
|
<h2 class="<%= TITLE_CLASSES %>"><%= @title %></h2>
|
|
6
6
|
<% if @subtitle %>
|
|
7
7
|
<p class="<%= SUBTITLE_CLASSES %>"><%= @subtitle %></p>
|
|
8
8
|
<% end %>
|
|
9
9
|
</div>
|
|
10
|
+
<% if aside? %>
|
|
11
|
+
<div class="<%= ASIDE_CLASSES %>"><%= aside %></div>
|
|
12
|
+
<% end %>
|
|
10
13
|
<% if @action || @menu.any? %>
|
|
11
14
|
<div class="<%= ACTIONS_CLASSES %>">
|
|
12
15
|
<% if @action %>
|
|
@@ -5,10 +5,14 @@ module Keystone
|
|
|
5
5
|
class SectionComponent < ViewComponent::Base
|
|
6
6
|
SPACING_CLASSES = { sm: "ks-section-sm", md: "ks-section-md", lg: "ks-section-lg" }.freeze
|
|
7
7
|
HEADER_CLASSES = "ks-section-header"
|
|
8
|
+
HEADER_WITH_ASIDE_CLASSES = "ks-section-header ks-grid-gap-sm max-sm:flex-wrap"
|
|
8
9
|
TITLE_CLASSES = "ks-section-title"
|
|
9
10
|
SUBTITLE_CLASSES = "ks-section-subtitle"
|
|
10
11
|
ACTION_CLASSES = "ks-section-action"
|
|
11
12
|
ACTIONS_CLASSES = "flex items-center shrink-0 ks-grid-gap-sm"
|
|
13
|
+
ASIDE_CLASSES = "ks-heading-note ml-auto max-sm:basis-full max-sm:order-last"
|
|
14
|
+
|
|
15
|
+
renders_one :aside
|
|
12
16
|
|
|
13
17
|
def initialize(title: nil, subtitle: nil, action: nil, menu: [], spacing: :md, class: nil)
|
|
14
18
|
@title = title
|
|
@@ -31,6 +35,10 @@ module Keystone
|
|
|
31
35
|
ACTION_CLASSES
|
|
32
36
|
end
|
|
33
37
|
|
|
38
|
+
def header_classes
|
|
39
|
+
aside? ? HEADER_WITH_ASIDE_CLASSES : HEADER_CLASSES
|
|
40
|
+
end
|
|
41
|
+
|
|
34
42
|
def header?
|
|
35
43
|
!@title.nil?
|
|
36
44
|
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 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 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
|
---
|
|
@@ -29,7 +29,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
29
29
|
- `ui_show_page` — marks a screen as a detail screen and gives it its Back link and breadcrumbs.
|
|
30
30
|
- `ui_page_header` — the title of a page, with optional badges beside it and a control and action menu on its right, and the screen's main action, which can ask a question first and can move to the bottom of a phone screen.
|
|
31
31
|
- `ui_breadcrumbs` — a line of links to the pages above the current one, shown from `lg:` up.
|
|
32
|
-
- `ui_section` — a titled block of content with an optional link
|
|
32
|
+
- `ui_section` — a titled block of content with an optional link, action menu and short aside such as a badge in its header.
|
|
33
33
|
- `ui_grid` — a responsive grid with a column count per breakpoint.
|
|
34
34
|
- `ui_list_detail` — a list beside the detail of the item picked from it, with the detail above the list below `lg:`.
|
|
35
35
|
- `ui_panel` — a bordered card surface holding any content.
|
|
@@ -230,7 +230,20 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
230
230
|
keywords of `ui_action_menu_item`, and renders an action menu. The link
|
|
231
231
|
and the menu sit side by side at the right edge of the header, the link
|
|
232
232
|
first, at every width. `spacing:` is `:sm` `:md` `:lg`. The header, with its
|
|
233
|
-
`action:` and
|
|
233
|
+
`action:`, `menu:` and aside, renders only when `title:` is given.
|
|
234
|
+
- The block yields the section, and `section.with_aside { ... }` in it puts
|
|
235
|
+
short text or a `ui_badge`, such as a sort order or a step's state, in
|
|
236
|
+
small muted text at the right end of the title line, before the link and
|
|
237
|
+
the menu. Below `sm:` the aside moves to its own line under the title and
|
|
238
|
+
the actions. Use it in place of hand-written markup beside a section's
|
|
239
|
+
title, and ask the developer what the aside shows.
|
|
240
|
+
|
|
241
|
+
```erb
|
|
242
|
+
<%= ui_section(title: "Inbox") do |section| %>
|
|
243
|
+
<% section.with_aside { "sorted by expiry" } %>
|
|
244
|
+
...
|
|
245
|
+
<% end %>
|
|
246
|
+
```
|
|
234
247
|
- `ui_grid(cols: { default: 1 }, gap: :md, gap_x: nil, gap_y: nil)` —
|
|
235
248
|
`cols:` maps `:default` `:sm` `:md` `:lg` to a count from 1 to 12, such as
|
|
236
249
|
`{ default: 1, md: 3 }`. `gap:` is `:sm` `:md` `:lg` `:xl`, and passing
|
|
@@ -55,7 +55,7 @@ One decision: is keystone_ui set up in the app?
|
|
|
55
55
|
- **Containers take blocks, leaves take keywords.** Page shells, sections,
|
|
56
56
|
panels, grids, forms and tables wrap a block. A button, badge, field, stat or
|
|
57
57
|
bucket is set entirely by keyword arguments. The navigation bar takes named
|
|
58
|
-
slots.
|
|
58
|
+
slots, and a section takes one named slot for its aside.
|
|
59
59
|
- **Options are symbols.** Appearance is chosen by name, such as `variant:`,
|
|
60
60
|
`size:` or `padding:`, and each component accepts its own set. Most raise on a
|
|
61
61
|
symbol they do not know, so a wrong guess fails at render time.
|
|
@@ -104,6 +104,12 @@ One decision: is keystone_ui set up in the app?
|
|
|
104
104
|
lay its pairs in columns instead: one column on a phone and two from `sm:` up,
|
|
105
105
|
each label in small text directly above its value, a long value wrapping
|
|
106
106
|
inside its own column, and no line between pairs.
|
|
107
|
+
- **Section headers.** A section's header holds its title and optional
|
|
108
|
+
subtitle, then an optional action link and action menu. A section can also
|
|
109
|
+
carry an aside, a short piece of text or a badge drawn in the header's note
|
|
110
|
+
style at the right end of the title line, before the action and the menu.
|
|
111
|
+
Below `sm:` the aside takes a line of its own under the title and the
|
|
112
|
+
actions. A section with no title draws no header, so its aside is not shown.
|
|
107
113
|
- **Going back.** A form or show page shell needs a way back: a back link, a
|
|
108
114
|
trail of earlier pages shown as breadcrumbs, or a trail the app supplies for
|
|
109
115
|
the request. A nav tab's own page passes an empty trail and shows no back
|