keystone_ui 0.21.0 → 0.21.1
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/form_page_component.html.erb +10 -8
- data/app/components/keystone/ui/page_component.html.erb +1 -0
- data/app/components/keystone/ui/show_page_component.html.erb +2 -2
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +34 -15
- data/the_local/agents/keystone_ui-info.md +5 -3
- data/the_local/interface.yml +1 -0
- 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: 2c400b566f0760e79b2808012f91e7b4d978ec0ad7e7caa8b83dc0e18b1007ec
|
|
4
|
+
data.tar.gz: 594c632edd55b0ae49c62226ae0e8ebdcc38469827abf0f508c87f9812f79aa2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed9434328fd13e5c1a48060beba4174ebb78d72b36fbec129389571c40661a58ef5adc6e1245e19186a92a31738a80e4ba4896390b883b909d45d33ce1de93d9
|
|
7
|
+
data.tar.gz: 9ae4ec9ec70310c666b8c3bd810517099e5d03566f04763c706df9193b705d512c585f0b64427db6999acd0318f88047f24af0dcc6cea65971abbf6a8c558dd6
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
<% content_for :form_page_back_url, @back_url %>
|
|
4
4
|
|
|
5
5
|
<% if @trail %>
|
|
6
|
-
|
|
6
|
+
<% content_for :keystone_page_header, render(Keystone::Ui::BreadcrumbsComponent.new(trail: @trail, current: @title)) %>
|
|
7
7
|
<% else %>
|
|
8
|
-
|
|
8
|
+
<% content_for :keystone_page_header, render(Keystone::Ui::DesktopBackLinkComponent.new(url: @back_url)) %>
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
<% content_for :keystone_page_header do %>
|
|
12
|
+
<div class="<%= DESKTOP_WRAPPER_CLASSES %>">
|
|
13
|
+
<h1 class="<%= TITLE_CLASSES %>"><%= @title %></h1>
|
|
14
|
+
<% if subtitle? %>
|
|
15
|
+
<p class="<%= SUBTITLE_CLASSES %>"><%= @subtitle %></p>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
18
|
+
<% end %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<% content_for :show_page_subtitle, @subtitle if @subtitle.present? %>
|
|
5
5
|
|
|
6
6
|
<% if @trail %>
|
|
7
|
-
|
|
7
|
+
<% content_for :keystone_page_header, render(Keystone::Ui::BreadcrumbsComponent.new(trail: @trail, current: @title)) %>
|
|
8
8
|
<% else %>
|
|
9
|
-
|
|
9
|
+
<% content_for :keystone_page_header, render(Keystone::Ui::DesktopBackLinkComponent.new(url: @back_url)) %>
|
|
10
10
|
<% end %>
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -42,7 +42,9 @@ outer element. See Conventions before using it.
|
|
|
42
42
|
- `ui_page(max_width: :full, padding: :standard, top_offset: nil, class: nil)` —
|
|
43
43
|
takes a block. The outer wrapper for a screen. `max_width:` `:sm` `:md` `:lg`
|
|
44
44
|
`:xl` `:full`; `padding:` `:standard` or `:none`; `top_offset:` `:sm` `:md`
|
|
45
|
-
`:lg` `:xl` to clear a fixed navbar.
|
|
45
|
+
`:lg` `:xl` to clear a fixed navbar. When `ui_form_page` or `ui_show_page` was
|
|
46
|
+
called earlier on the same screen, `ui_page` renders their back link or
|
|
47
|
+
breadcrumbs, and the form page's title, at its top, above the block.
|
|
46
48
|
- `ui_section(title: nil, subtitle: nil, action: nil, spacing: :md, class: nil)`
|
|
47
49
|
— takes a block. A titled block of content with an optional right-aligned
|
|
48
50
|
link. `action:` is `{ label:, href: }`; `spacing:` `:sm` `:md` `:lg`.
|
|
@@ -63,17 +65,21 @@ outer element. See Conventions before using it.
|
|
|
63
65
|
the right; only what `action` receives is rendered. Passing `action_url:`
|
|
64
66
|
publishes that URL and label for a mobile navbar to pick up.
|
|
65
67
|
- `ui_form_page(title:, back_url:, subtitle: nil, trail: nil)` — the shell
|
|
66
|
-
marker for a form screen.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
`
|
|
71
|
-
|
|
68
|
+
marker for a form screen. It renders nothing where it is called. It publishes
|
|
69
|
+
the title and back URL so the navbar can render mobile header context, and
|
|
70
|
+
hands `ui_page` a "Back" link to `back_url` shown from `lg:` up, then the
|
|
71
|
+
title and subtitle shown from `md:` up. Call it before `ui_page`, outside
|
|
72
|
+
`ui_page`'s block, or none of that appears. Passing `trail:` replaces the
|
|
73
|
+
"Back" link with breadcrumbs: the trail's links followed by `title` unlinked,
|
|
74
|
+
as `ui_breadcrumbs` renders them. `back_url:` is still required with a trail,
|
|
75
|
+
because the mobile header still uses it.
|
|
72
76
|
- `ui_show_page(title:, back_url:, subtitle: nil, trail: nil)` — the shell marker
|
|
73
|
-
for a detail screen.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
for a detail screen. It renders nothing where it is called. It publishes the
|
|
78
|
+
title, subtitle, and back URL for the navbar, and hands `ui_page` a "Back"
|
|
79
|
+
link to `back_url` shown from `lg:` up. Call it before `ui_page`, outside
|
|
80
|
+
`ui_page`'s block. It shows no title, so put `ui_page_header` inside the
|
|
81
|
+
`ui_page` block for the desktop title. `trail:` works as it does on
|
|
82
|
+
`ui_form_page`, ending the breadcrumbs with `title` unlinked.
|
|
77
83
|
- `ui_breadcrumbs(trail:, current: nil)` — a line of links shown only from `lg:`
|
|
78
84
|
up. `trail:` is `[[label, href], ...]`, from the top level down, and each pair
|
|
79
85
|
renders as a link, separated by `›`. `current:` is the page being shown,
|
|
@@ -300,12 +306,25 @@ outer element. See Conventions before using it.
|
|
|
300
306
|
composition before inventing one; that screen is the house style.
|
|
301
307
|
|
|
302
308
|
3. Pick the page shell for what you are building:
|
|
303
|
-
- a form screen → `ui_form_page`
|
|
304
|
-
- a detail screen → `ui_show_page`
|
|
309
|
+
- a form screen → `ui_form_page`, then `ui_page` holding the form
|
|
310
|
+
- a detail screen → `ui_show_page`, then `ui_page` holding `ui_page_header`
|
|
311
|
+
and the details
|
|
305
312
|
- anything else → `ui_page`, with `ui_page_header` for the desktop title.
|
|
306
313
|
|
|
307
|
-
|
|
308
|
-
|
|
314
|
+
```erb
|
|
315
|
+
<%= ui_form_page(title: "New quote", back_url: quotes_path) %>
|
|
316
|
+
<%= ui_page(max_width: :md) do %>
|
|
317
|
+
<%= ui_form(action: quotes_path) do %>
|
|
318
|
+
...
|
|
319
|
+
<% end %>
|
|
320
|
+
<% end %>
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
The shell call always comes first and sits outside `ui_page`'s block,
|
|
324
|
+
because `ui_page` renders what the shell handed it at its own top. A form or
|
|
325
|
+
detail screen without `ui_page` shows no desktop "Back" link or form title.
|
|
326
|
+
Those shells supply the desktop "Back" link themselves, so never add a
|
|
327
|
+
second back link or button to those screens. Whether a screen
|
|
309
328
|
shows that "Back" link or breadcrumbs, and which parent screens the trail
|
|
310
329
|
names, is the developer's choice, so ask before passing `trail:`. Below `lg:` the
|
|
311
330
|
back link comes from `ui_mobile_header`, which the navbar renders from the
|
|
@@ -26,9 +26,11 @@ separate mobile and desktop treatments (a bottom tab bar and mobile header on
|
|
|
26
26
|
small screens, a full navigation bar from the `lg:` breakpoint up), because
|
|
27
27
|
these apps are often viewed in a native webview. The form and show page shells
|
|
28
28
|
follow the same split for going back: the mobile header carries the back link on
|
|
29
|
-
small screens, and the shell
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
small screens, and from `lg:` up the shell shows a "Back" link. Given a trail of
|
|
30
|
+
earlier pages instead, the shell shows breadcrumbs in place of that link, ending
|
|
31
|
+
with the page's own title. That link or those breadcrumbs, and the form page's
|
|
32
|
+
title, appear at the top of the page container, inside its width and padding, so
|
|
33
|
+
a page using either shell also uses the page container.
|
|
32
34
|
|
|
33
35
|
## Interface
|
|
34
36
|
|
data/the_local/interface.yml
CHANGED
|
@@ -114,6 +114,7 @@ sources:
|
|
|
114
114
|
- app/components/keystone/ui/navbar_component.rb
|
|
115
115
|
- app/components/keystone/ui/option_card_component.rb
|
|
116
116
|
- app/components/keystone/ui/page_component.rb
|
|
117
|
+
- app/components/keystone/ui/page_component.html.erb
|
|
117
118
|
- app/components/keystone/ui/page_header_component.rb
|
|
118
119
|
- app/components/keystone/ui/panel_component.rb
|
|
119
120
|
- app/components/keystone/ui/pipeline_component.rb
|