keystone_ui 0.92.0 → 0.94.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/button_row_component.rb +10 -1
- data/app/components/keystone/ui/decision_bar_component.html.erb +15 -0
- data/app/components/keystone/ui/decision_bar_component.rb +59 -0
- data/app/components/keystone/ui/text_diff_component.html.erb +17 -9
- data/app/components/keystone/ui/text_diff_component.rb +14 -1
- data/app/helpers/keystone_ui_helper.rb +4 -0
- data/lib/keystone_ui/safelist.rb +1 -0
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +43 -5
- data/the_local/agents/keystone_ui-info.md +18 -1
- data/the_local/interface.yml +3 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4947e9dd58a43eddd271d963c9398e29fa2f75f1e3087eb08595bb435d1ac6ca
|
|
4
|
+
data.tar.gz: 0e4cb6faa7d3032195f15650dfbd234c04e88f791bb9c5f118d9f7b175d07c4b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: baa3227236068d2825147f507a553fd00461ae879c29cc73d5a1df10d7692b1da6aa23cda4273f46282cdc41a23a1f17562a0dbf2aaa47f8b17824e4cfc7ed2c
|
|
7
|
+
data.tar.gz: 004fe496f216548caa10e552304c39ae4b2ef8c75596e8c14dcf61895f7ade0d3a0c106aacf3915c0c37d08fa10006590ed8a7d38b79727bdc4e1e934a884cb4
|
|
@@ -5,13 +5,22 @@ module Keystone
|
|
|
5
5
|
class ButtonRowComponent < ViewComponent::Base
|
|
6
6
|
ROW_CLASSES = "flex flex-wrap ks-grid-gap-sm max-sm:*:min-h-11 [&>form]:flex [&>form>*]:flex-1"
|
|
7
7
|
EQUAL_WIDTH_CLASSES = "*:flex-1 *:whitespace-nowrap"
|
|
8
|
+
PHONE_EQUAL_WIDTH_CLASSES = "max-sm:*:flex-1 max-sm:*:whitespace-nowrap"
|
|
8
9
|
|
|
9
10
|
def initialize(equal_width: false)
|
|
10
11
|
@equal_width = equal_width
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
def row_classes
|
|
14
|
-
[ ROW_CLASSES,
|
|
15
|
+
[ ROW_CLASSES, equal_width_classes ].compact.join(" ")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def equal_width_classes
|
|
21
|
+
return PHONE_EQUAL_WIDTH_CLASSES if @equal_width == :phone
|
|
22
|
+
|
|
23
|
+
EQUAL_WIDTH_CLASSES if @equal_width
|
|
15
24
|
end
|
|
16
25
|
end
|
|
17
26
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<%= form_with url: @url, method: @method, class: FORM_CLASSES do %>
|
|
2
|
+
<div class="<%= BAR_CLASSES %>">
|
|
3
|
+
<% if @note %>
|
|
4
|
+
<label class="<%= NOTE_CLASSES %>"><span class="<%= NOTE_LABEL_CLASSES %>"><%= @note[:label] %></span><%= render Keystone::Ui::InputComponent.new(name: @note[:name], placeholder: @note[:placeholder]) %></label>
|
|
5
|
+
<% end %>
|
|
6
|
+
<%= buttons %>
|
|
7
|
+
</div>
|
|
8
|
+
<% if @hint %>
|
|
9
|
+
<p class="<%= HINT_CLASSES %>"><%= @hint %></p>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<div class="<%= SPACER_CLASSES %>" data-decision-bar-spacer inert>
|
|
13
|
+
<div class="<%= BAR_CLASSES %> <%= BAR_COPY_CLASSES %>"><%= buttons %></div>
|
|
14
|
+
<div class="<%= TAB_BAR_ROOM_CLASSES %>"></div>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Keystone
|
|
4
|
+
module Ui
|
|
5
|
+
class DecisionBarComponent < ViewComponent::Base
|
|
6
|
+
FORM_CLASSES = "ks-panel ks-panel-radius-md ks-panel-padding-sm flex flex-wrap items-center ks-grid-gap-sm max-sm:contents"
|
|
7
|
+
BAR_CLASSES = "ks-bottom-action max-sm:flex-col ks-grid-gap-sm sm:contents hotwire-native:bottom-0"
|
|
8
|
+
PRIMARY_CLASSES = "max-sm:order-first max-sm:*:w-full max-sm:*:min-h-12"
|
|
9
|
+
ACTION_CLASSES = "flex *:flex-1"
|
|
10
|
+
PHONE_ONLY_CLASSES = "sm:hidden"
|
|
11
|
+
PHONE_ORDER_CLASSES = { 1 => "max-sm:order-1", 2 => "max-sm:order-2", 3 => "max-sm:order-3" }.freeze
|
|
12
|
+
PHONE_LABEL_CLASSES = "sm:hidden"
|
|
13
|
+
FULL_LABEL_CLASSES = "max-sm:hidden"
|
|
14
|
+
HINT_CLASSES = "ks-hint basis-full max-sm:hidden"
|
|
15
|
+
BAR_COPY_CLASSES = "!static invisible"
|
|
16
|
+
SPACER_CLASSES = "sm:hidden"
|
|
17
|
+
TAB_BAR_ROOM_CLASSES = "hidden h-(--ks-bottom-nav-height) [html:not(.hotwire-native)_body:has(.ks-bottom-nav)_&]:block"
|
|
18
|
+
NOTE_LABEL_CLASSES = "ks-label shrink-0"
|
|
19
|
+
NOTE_CLASSES = "flex flex-1 basis-60 items-center ks-grid-gap-sm max-sm:hidden"
|
|
20
|
+
|
|
21
|
+
def initialize(url:, primary:, actions: [], note: nil, hint: nil, method: :post)
|
|
22
|
+
@url = url
|
|
23
|
+
@primary = primary
|
|
24
|
+
@actions = actions
|
|
25
|
+
@note = note
|
|
26
|
+
@hint = hint
|
|
27
|
+
@method = method
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def buttons
|
|
31
|
+
safe_join([ secondary_row, primary_button ])
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
def secondary_row
|
|
37
|
+
render(ButtonRowComponent.new(equal_width: :phone)) do
|
|
38
|
+
safe_join(@actions.map { |action| secondary_button(action) })
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def secondary_button(action)
|
|
43
|
+
tag.div(class: [ ACTION_CLASSES, (PHONE_ONLY_CLASSES if action[:phone_only]), PHONE_ORDER_CLASSES[action[:phone_order]] ].compact.join(" ")) do
|
|
44
|
+
render ButtonComponent.new(variant: :secondary, **action.except(:phone_only, :phone_order, :phone_label), label: action_label(action))
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def action_label(action)
|
|
49
|
+
return action[:label] unless action[:phone_label]
|
|
50
|
+
|
|
51
|
+
safe_join([ tag.span(action[:label], class: FULL_LABEL_CLASSES), tag.span(action[:phone_label], class: PHONE_LABEL_CLASSES) ])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def primary_button
|
|
55
|
+
tag.div(class: PRIMARY_CLASSES) { render ButtonComponent.new(**@primary) }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
<% if notice %>
|
|
3
3
|
<div class="<%= Keystone::Ui::TextDiffComponent::NOTICE_CLASSES %>" data-diff-notice><%= notice %></div>
|
|
4
4
|
<% end %>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
<% if one_column? %>
|
|
6
|
+
<div class="<%= Keystone::Ui::TextDiffComponent::SIDE_CLASSES %>" data-diff-column>
|
|
7
|
+
<% lines.each do |line| %>
|
|
8
|
+
<div class="<%= Keystone::Ui::TextDiffComponent::LINE_CLASSES %>" data-diff-row><span class="<%= line[:mark] %>"><span class="<%= Keystone::Ui::TextDiffComponent::LINE_SIGN_CLASSES %>" data-diff-sign><%= line[:sign] %></span><span data-diff-text><%= line[:text] %></span></span></div>
|
|
9
|
+
<% end %>
|
|
10
|
+
</div>
|
|
11
|
+
<% else %>
|
|
12
|
+
<div class="<%= Keystone::Ui::TextDiffComponent::COLUMNS_CLASSES %>">
|
|
13
|
+
<% Keystone::Ui::TextDiffComponent::SIDES.each do |side| %>
|
|
14
|
+
<div class="<%= Keystone::Ui::TextDiffComponent::SIDE_CLASSES %>" data-diff-side="<%= side %>">
|
|
15
|
+
<% cells(side).each do |cell| %>
|
|
16
|
+
<div class="<%= [ Keystone::Ui::TextDiffComponent::ROW_CLASSES, cell&.dig(:mark) ].compact.join(" ") %>" data-diff-row><span class="<%= Keystone::Ui::TextDiffComponent::NUMBER_CLASSES %>" data-diff-number><%= cell&.dig(:number) %></span><span class="<%= Keystone::Ui::TextDiffComponent::SIGN_CLASSES %>" data-diff-sign><%= cell&.dig(:sign) %></span><span class="<%= Keystone::Ui::TextDiffComponent::TEXT_CLASSES %>" data-diff-text><%= cell&.dig(:text) %></span></div>
|
|
17
|
+
<% end %>
|
|
18
|
+
</div>
|
|
19
|
+
<% end %>
|
|
20
|
+
</div>
|
|
21
|
+
<% end %>
|
|
14
22
|
</div>
|
|
@@ -11,11 +11,18 @@ module Keystone
|
|
|
11
11
|
NUMBER_CLASSES = "w-8 shrink-0 select-none text-right"
|
|
12
12
|
SIGN_CLASSES = "w-6 shrink-0 select-none text-center"
|
|
13
13
|
TEXT_CLASSES = "whitespace-pre"
|
|
14
|
+
LINE_CLASSES = "h-[1lh] whitespace-pre"
|
|
15
|
+
LINE_SIGN_CLASSES = "inline-block w-[2ch] select-none"
|
|
14
16
|
NOTICE_CLASSES = "ks-code-caption text-xs"
|
|
15
17
|
|
|
16
|
-
def initialize(before:, after:)
|
|
18
|
+
def initialize(before:, after:, one_column: false)
|
|
17
19
|
@before = before.to_s.lines(chomp: true)
|
|
18
20
|
@after = after.to_s.lines(chomp: true)
|
|
21
|
+
@one_column = one_column
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def one_column?
|
|
25
|
+
@one_column
|
|
19
26
|
end
|
|
20
27
|
|
|
21
28
|
def notice
|
|
@@ -34,6 +41,12 @@ module Keystone
|
|
|
34
41
|
rows.map { |row| row[SIDES.index(side)] }
|
|
35
42
|
end
|
|
36
43
|
|
|
44
|
+
def lines
|
|
45
|
+
return (@before + @after).map { |text| { text: text } } if too_long?
|
|
46
|
+
|
|
47
|
+
rows.map { |row| row.compact.first }
|
|
48
|
+
end
|
|
49
|
+
|
|
37
50
|
private
|
|
38
51
|
|
|
39
52
|
def rows
|
|
@@ -169,6 +169,10 @@ module KeystoneUiHelper
|
|
|
169
169
|
render Keystone::Ui::BottomActionComponent.new
|
|
170
170
|
end
|
|
171
171
|
|
|
172
|
+
def ui_decision_bar(**args)
|
|
173
|
+
render Keystone::Ui::DecisionBarComponent.new(**args)
|
|
174
|
+
end
|
|
175
|
+
|
|
172
176
|
def ui_navbar(**args, &block)
|
|
173
177
|
render Keystone::Ui::NavbarComponent.new(**args), &block
|
|
174
178
|
end
|
data/lib/keystone_ui/safelist.rb
CHANGED
|
@@ -53,6 +53,7 @@ module Keystone
|
|
|
53
53
|
Keystone::Ui::MobileActionsComponent,
|
|
54
54
|
Keystone::Ui::MobileActionComponent,
|
|
55
55
|
Keystone::Ui::BottomActionComponent,
|
|
56
|
+
Keystone::Ui::DecisionBarComponent,
|
|
56
57
|
Keystone::Ui::MobileHeaderComponent,
|
|
57
58
|
Keystone::Ui::ShowPageComponent,
|
|
58
59
|
Keystone::Ui::OptionCardComponent,
|
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 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.
|
|
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 decision bar of a note field and several buttons sent as one form and fixed to the bottom of a phone 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 or in one column, 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
|
---
|
|
@@ -45,6 +45,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
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.
|
|
48
|
+
- `ui_decision_bar` — one form of a note field, secondary buttons and a primary button on one wrapping line, fixed to the bottom of a phone screen with the primary button above the others.
|
|
48
49
|
- `ui_action_menu` — an ellipsis menu of actions shown at every screen size.
|
|
49
50
|
- `ui_action_menu_item` — one action in an action menu, as a link or a button sending a method.
|
|
50
51
|
- `ui_settings_link` — a full-width settings row with a chevron.
|
|
@@ -66,7 +67,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
66
67
|
- `Keystone::Ui::Column` — a table column with options a `{ key: "Label" }` hash cannot carry.
|
|
67
68
|
- `ui_column_picker` — a Columns menu that saves which columns are hidden and their order to an app endpoint.
|
|
68
69
|
- `ui_button` — a link or a button styled as a button, or a button sending a POST, PATCH or DELETE request, optionally asking a question before it goes ahead.
|
|
69
|
-
- `ui_button_row` — a row of buttons that wraps onto further lines, optionally giving each button an equal share of its width.
|
|
70
|
+
- `ui_button_row` — a row of buttons that wraps onto further lines, optionally giving each button an equal share of its width at every width or on a phone only.
|
|
70
71
|
- `ui_badge` — a coloured pill holding a short label.
|
|
71
72
|
- `ui_status_dot` — a small dot coloured by state, with its label read only by screen readers.
|
|
72
73
|
- `ui_figure` — one amount as inline text, coloured as a gain or a loss.
|
|
@@ -84,7 +85,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
84
85
|
- `ui_stat_card` — a single metric tile with optional change, link and info button.
|
|
85
86
|
- `ui_copy_button` — a button that copies text to the clipboard.
|
|
86
87
|
- `ui_code` — a block of code with an optional caption.
|
|
87
|
-
- `ui_text_diff` — two versions of a text side by side, with removed and added lines marked.
|
|
88
|
+
- `ui_text_diff` — two versions of a text side by side, or in one column, with removed and added lines marked.
|
|
88
89
|
- `ui_disclosure` — a native expandable section with a clickable summary.
|
|
89
90
|
- `ui_calculation` — the steps behind a figure, closed under a summary row.
|
|
90
91
|
- `ui_info` — an inline info button showing a summary, and optional detail, in floating panels.
|
|
@@ -364,6 +365,32 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
364
365
|
both. Add no padding of your own for them. It and `ui_mobile_action`
|
|
365
366
|
draw the same action, so ask the developer which one a screen shows on a
|
|
366
367
|
phone.
|
|
368
|
+
- `ui_decision_bar(url:, primary:, actions: [], note: nil, hint: nil, method: :post)`
|
|
369
|
+
draws one form sending to `url:` with `method:`. `primary:` and each hash
|
|
370
|
+
in `actions:` are `ui_button` keywords, usually `label:`, `name:` and
|
|
371
|
+
`value:`, so the button pressed tells the controller which decision was
|
|
372
|
+
made. An action with `href:` is a link, such as a `Next ›` to the next
|
|
373
|
+
item. Each action also takes `phone_label:`, a shorter label shown below
|
|
374
|
+
`sm:` in its place, `phone_only: true`, which shows the action below
|
|
375
|
+
`sm:` only, and `phone_order:` 1, 2 or 3, its place in the phone row, so
|
|
376
|
+
one call can give a desktop row and a phone row that differ in labels,
|
|
377
|
+
buttons and order. Do not give an action `href:` with a `method:` other than `:get`,
|
|
378
|
+
since that draws a form inside the bar's form. `note:` takes `name:`,
|
|
379
|
+
`label:` and `placeholder:` and draws a text field inside its label, sent
|
|
380
|
+
with the form. `hint:` is a short line of muted text, such as keyboard
|
|
381
|
+
keys. From `sm:` up it draws a panel holding the note field, the
|
|
382
|
+
`actions:` as secondary buttons and the `primary:` button on one line
|
|
383
|
+
that wraps, with the hint on its own line under them. Below `sm:` it is a
|
|
384
|
+
bar fixed to the bottom of the screen, above `ui_bottom_nav` on a page
|
|
385
|
+
that has one, with the primary button at full width and 48 pixels tall
|
|
386
|
+
above a row of the secondary buttons, each an equal share of the row and
|
|
387
|
+
44 pixels tall. The note field and hint are not shown below `sm:`. Give
|
|
388
|
+
it three secondary actions at most on a phone so the phone row fits. It stays shown
|
|
389
|
+
inside a Hotwire Native web view, at the bottom of the web view. It draws
|
|
390
|
+
an invisible copy of its phone bar in the page's flow, plus the bottom
|
|
391
|
+
nav's height when the page has a `ui_bottom_nav`, so the page's last
|
|
392
|
+
content scrolls clear of both. Add no padding of your own for them, and
|
|
393
|
+
do not show `ui_bottom_action` on the same screen.
|
|
367
394
|
- `ui_settings_link(label:, href:)` renders one settings row.
|
|
368
395
|
- `ui_theme_toggle` takes no keywords and no block. Its buttons switch the
|
|
369
396
|
theme at once and store the choice in the `keystone_theme` cookie for a
|
|
@@ -636,8 +663,10 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
636
663
|
what sits in the row, fills that form, so it takes the same share and
|
|
637
664
|
height as a link or plain button beside it. `equal_width: true` gives each
|
|
638
665
|
item an equal share of the row's width and keeps each label on one line,
|
|
639
|
-
so the row wraps only when a label no longer fits in its share.
|
|
640
|
-
|
|
666
|
+
so the row wraps only when a label no longer fits in its share.
|
|
667
|
+
`equal_width: :phone` does that below `sm:` only, and from `sm:` up each
|
|
668
|
+
button keeps the width of its label. Use it in place of a hand-written
|
|
669
|
+
flex `div` around a set of buttons.
|
|
641
670
|
- `ui_link(label:, href:)` draws a text link in the link colour. Use it in
|
|
642
671
|
place of a hand-written `link_to` with colour classes.
|
|
643
672
|
- With `href:` and `method:` `:post` `:patch` `:put` or `:delete`, it
|
|
@@ -711,6 +740,15 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
711
740
|
developer whether a screen can be given texts that long, and hand changing
|
|
712
741
|
the limit to `keystone_ui-install`, since the comparison's work grows with
|
|
713
742
|
the line count of one text times the other's.
|
|
743
|
+
- `one_column: true` shows both texts in one column in place of side by
|
|
744
|
+
side, the same at every screen width. A shared line appears once with no
|
|
745
|
+
sign, a removed line appears at its place in `before:` with a `-`, and an
|
|
746
|
+
added line appears at its place in `after:` with a `+`, so a changed line
|
|
747
|
+
shows as the removed line followed by the added one. The removed and added
|
|
748
|
+
colour covers the sign and text of the line, the column numbers no lines,
|
|
749
|
+
and a long line scrolls sideways inside the column. Both notices still
|
|
750
|
+
show. When the texts are too long to compare, the column lists every line
|
|
751
|
+
of `before:` and then every line of `after:`, with none marked.
|
|
714
752
|
- Ask the developer which two versions a screen compares and which is the
|
|
715
753
|
earlier one.
|
|
716
754
|
- `ui_disclosure(open: false)` takes a block yielding the component. Fill
|
|
@@ -153,7 +153,8 @@ One decision: is keystone_ui set up in the app?
|
|
|
153
153
|
is at least a phone's tap height, and a button that sends a request fills its
|
|
154
154
|
share of the row like a link does. A row can give each button an equal share
|
|
155
155
|
of its width, keeping each label on one line, so the row wraps only when a
|
|
156
|
-
label no longer fits.
|
|
156
|
+
label no longer fits. It can do that on a phone only, leaving each button
|
|
157
|
+
the width of its label on a wider screen.
|
|
157
158
|
- **Confirmation.** A button can carry a confirmation question, and the
|
|
158
159
|
browser asks it before following the link or sending the form. Nothing is
|
|
159
160
|
sent when the user cancels.
|
|
@@ -169,6 +170,17 @@ One decision: is keystone_ui set up in the app?
|
|
|
169
170
|
own button below `sm:` so the action is not shown twice. Both forms show
|
|
170
171
|
nothing when the header names no action, and both are hidden inside a
|
|
171
172
|
Hotwire Native web view and in print.
|
|
173
|
+
- **A decision bar.** A decision bar is one form holding an optional note
|
|
174
|
+
field, several secondary buttons and one primary button, and the button
|
|
175
|
+
pressed tells the app which decision was made. On a wider screen it is a
|
|
176
|
+
panel with all of them on one line that wraps, and an optional hint line
|
|
177
|
+
under them. On a phone it is a bar fixed to the bottom of the screen, above
|
|
178
|
+
the bottom tab bar when the page has one, with the primary button at full
|
|
179
|
+
width above a row of the secondary buttons in equal shares, and with no note
|
|
180
|
+
field or hint. Each secondary button can have a shorter label on a phone, be
|
|
181
|
+
shown on a phone only, and take another place in the phone row. The page leaves room under its last content so the bar does
|
|
182
|
+
not cover it. Unlike the main action's bottom bar, it stays shown inside a
|
|
183
|
+
Hotwire Native web view.
|
|
172
184
|
- **Action menus.** Each action is a label, an address and an HTTP method. A
|
|
173
185
|
plain visit is a link, and any other method is a button, so an action that
|
|
174
186
|
changes data is never a bare link. A delete asks for confirmation by default.
|
|
@@ -191,6 +203,11 @@ One decision: is keystone_ui set up in the app?
|
|
|
191
203
|
When the two texts together hold more lines than the host's line limit, 2,000
|
|
192
204
|
by default, it does not compare them: it lines them up by position with no
|
|
193
205
|
marks or signs, and the notice says they are too long to compare.
|
|
206
|
+
With its one-column option it shows both texts in one column instead, the
|
|
207
|
+
same at every screen width: a shared line once, a removed line at its place
|
|
208
|
+
in the first text and an added line at its place in the second, each marked
|
|
209
|
+
and signed, with no line numbers. Too long to compare, that column lists the
|
|
210
|
+
first text and then the second, unmarked.
|
|
194
211
|
- **Semantic colour.** The themed hue is `accent-*` and the themed neutrals are
|
|
195
212
|
`surface-*`, CSS custom properties whose defaults (blue and zinc) come from
|
|
196
213
|
the keystone_ui-styles gem. Retheming changes those values, not the
|
data/the_local/interface.yml
CHANGED
|
@@ -45,6 +45,7 @@ develop:
|
|
|
45
45
|
- ui_mobile_actions
|
|
46
46
|
- ui_mobile_action
|
|
47
47
|
- ui_bottom_action
|
|
48
|
+
- ui_decision_bar
|
|
48
49
|
- ui_action_menu
|
|
49
50
|
- ui_action_menu_item
|
|
50
51
|
- ui_navbar
|
|
@@ -158,6 +159,8 @@ sources:
|
|
|
158
159
|
- app/components/keystone/ui/mobile_actions_component.rb
|
|
159
160
|
- app/components/keystone/ui/mobile_action_component.rb
|
|
160
161
|
- app/components/keystone/ui/bottom_action_component.rb
|
|
162
|
+
- app/components/keystone/ui/decision_bar_component.rb
|
|
163
|
+
- app/components/keystone/ui/decision_bar_component.html.erb
|
|
161
164
|
- app/components/keystone/ui/action_menu_component.rb
|
|
162
165
|
- app/components/keystone/ui/action_menu_item_component.rb
|
|
163
166
|
- app/components/keystone/ui/mobile_header_component.rb
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: keystone_ui
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.94.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
@@ -128,6 +128,8 @@ files:
|
|
|
128
128
|
- app/components/keystone/ui/cta_banner_component.rb
|
|
129
129
|
- app/components/keystone/ui/data_table_component.html.erb
|
|
130
130
|
- app/components/keystone/ui/data_table_component.rb
|
|
131
|
+
- app/components/keystone/ui/decision_bar_component.html.erb
|
|
132
|
+
- app/components/keystone/ui/decision_bar_component.rb
|
|
131
133
|
- app/components/keystone/ui/desktop_back_link_component.html.erb
|
|
132
134
|
- app/components/keystone/ui/desktop_back_link_component.rb
|
|
133
135
|
- app/components/keystone/ui/disclosure_component.html.erb
|