keystone_ui 0.100.0 → 0.101.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/bar_chart_component.rb +5 -0
- data/app/components/keystone/ui/button_component.rb +3 -1
- data/app/components/keystone/ui/decision_bar_component.rb +24 -2
- data/app/components/keystone/ui/mobile_action_component.rb +5 -1
- data/app/components/keystone/ui/mobile_header_component.rb +0 -14
- data/app/components/keystone/ui/review_card_component.rb +1 -1
- data/app/components/keystone/ui/section_component.rb +4 -0
- data/app/components/keystone/ui/stat_card_component.rb +1 -7
- data/app/components/keystone/ui/tab_switcher_component.rb +0 -9
- data/app/components/keystone/ui/text_diff_component.rb +52 -25
- data/app/components/keystone/ui/timeline_component.rb +1 -0
- data/lib/keystone_ui/version.rb +1 -1
- data/the_local/agents/keystone_ui-develop.md +18 -10
- data/the_local/agents/keystone_ui-info.md +10 -4
- 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: 327d7289d20de1a267d20e87c47df21d3dd8069db8c4c39b488a8ceb1cd0bb28
|
|
4
|
+
data.tar.gz: 4a63e3aec691f256b2c2fec24694090581be4184749a39b14a529d19171c006a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 283b5ecde2e04ab9d9ef7af31bc036f29d29c0a899674946a13816234512fe224c237f22d3f706c7f3df5667607022949806df2728413c658ac52a08f0716619
|
|
7
|
+
data.tar.gz: 2a659f0c17e30f956d683f2035d60acd9326ba53cb0374b6eef07edadb7990675fec2448b8ad4ddf32014795ecaafafd191f57552c14e55aaeaa785374f63ed8
|
|
@@ -23,6 +23,7 @@ module Keystone
|
|
|
23
23
|
attr_reader :bars
|
|
24
24
|
|
|
25
25
|
def initialize(bars:, show_values: false, strip: false)
|
|
26
|
+
bars.each { |bar| check_value(bar) }
|
|
26
27
|
@bars = bars
|
|
27
28
|
@show_values = show_values
|
|
28
29
|
@strip = strip
|
|
@@ -72,6 +73,10 @@ module Keystone
|
|
|
72
73
|
|
|
73
74
|
private
|
|
74
75
|
|
|
76
|
+
def check_value(bar)
|
|
77
|
+
raise ArgumentError, "Bar chart bar #{bar[:label].inspect} has the negative value #{bar[:value]}, and a bar chart draws no bar below zero" if bar[:value].to_f.negative?
|
|
78
|
+
end
|
|
79
|
+
|
|
75
80
|
def bar_share
|
|
76
81
|
strip? ? STRIP_BAR_SHARE : BAR_SHARE
|
|
77
82
|
end
|
|
@@ -20,7 +20,7 @@ module Keystone
|
|
|
20
20
|
|
|
21
21
|
TEXT_CLASSES = "ks-text-button"
|
|
22
22
|
|
|
23
|
-
def initialize(label:, href: nil, method: :get, variant: :primary, size: :md, full_width: false, type: :submit, data: nil, name: nil, value: nil, hidden: false, confirm: nil, disabled: false)
|
|
23
|
+
def initialize(label:, href: nil, method: :get, variant: :primary, size: :md, full_width: false, type: :submit, data: nil, name: nil, value: nil, hidden: false, confirm: nil, disabled: false, formaction: nil)
|
|
24
24
|
@label = label
|
|
25
25
|
@href = href
|
|
26
26
|
@method = method.to_sym
|
|
@@ -34,6 +34,7 @@ module Keystone
|
|
|
34
34
|
@hidden = hidden
|
|
35
35
|
@confirm = confirm
|
|
36
36
|
@disabled = disabled
|
|
37
|
+
@formaction = formaction
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
def classes
|
|
@@ -57,6 +58,7 @@ module Keystone
|
|
|
57
58
|
options[:type] = @type
|
|
58
59
|
options[:name] = @name if @name
|
|
59
60
|
options[:value] = @value if @value
|
|
61
|
+
options[:formaction] = @formaction if @formaction
|
|
60
62
|
else
|
|
61
63
|
options[:href] = @href
|
|
62
64
|
end
|
|
@@ -68,6 +68,7 @@ module Keystone
|
|
|
68
68
|
@url = url
|
|
69
69
|
@primary = primary
|
|
70
70
|
@actions = actions
|
|
71
|
+
actions.each { |action| check_action(action) }
|
|
71
72
|
@note = note
|
|
72
73
|
@hint = hint
|
|
73
74
|
@method = method
|
|
@@ -106,11 +107,32 @@ module Keystone
|
|
|
106
107
|
end
|
|
107
108
|
|
|
108
109
|
def secondary_button(action)
|
|
109
|
-
tag.div(class: [ ACTION_CLASSES, (PHONE_ONLY_CLASSES.fetch(@breakpoint) if action[:phone_only]),
|
|
110
|
-
render ButtonComponent.new(variant: :secondary, **action
|
|
110
|
+
tag.div(class: [ ACTION_CLASSES, (PHONE_ONLY_CLASSES.fetch(@breakpoint) if action[:phone_only]), phone_order_classes(action) ].compact.join(" ")) do
|
|
111
|
+
render ButtonComponent.new(variant: :secondary, **button_options(action), label: action_label(action))
|
|
111
112
|
end
|
|
112
113
|
end
|
|
113
114
|
|
|
115
|
+
def phone_order_classes(action)
|
|
116
|
+
PHONE_ORDER_CLASSES.fetch(@breakpoint).fetch(action[:phone_order]) if action.key?(:phone_order)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def button_options(action)
|
|
120
|
+
options = action.except(:phone_only, :phone_order, :phone_label)
|
|
121
|
+
return options unless sends_request?(action)
|
|
122
|
+
|
|
123
|
+
options.except(:href, :method).merge(formaction: action[:href], name: "_method", value: action[:method].to_s)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def check_action(action)
|
|
127
|
+
return unless sends_request?(action) && (action.key?(:name) || action.key?(:value))
|
|
128
|
+
|
|
129
|
+
raise ArgumentError, "Decision bar action #{action[:label].inspect} sends a #{action[:method]} to its own link, so it cannot send a name or value of its own"
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def sends_request?(action)
|
|
133
|
+
action[:href] && action.fetch(:method, :get).to_sym != :get
|
|
134
|
+
end
|
|
135
|
+
|
|
114
136
|
def action_label(action)
|
|
115
137
|
return action[:label] unless action[:phone_label]
|
|
116
138
|
|
|
@@ -18,7 +18,7 @@ module Keystone
|
|
|
18
18
|
def call
|
|
19
19
|
return link_to(PLUS_ICON.html_safe, url, **options) unless content_for?(:mobile_action_method)
|
|
20
20
|
|
|
21
|
-
button_to(url, method: content_for(:mobile_action_method), **options) { PLUS_ICON.html_safe }
|
|
21
|
+
button_to(url, method: content_for(:mobile_action_method), form: form_options, **options) { PLUS_ICON.html_safe }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
private
|
|
@@ -27,6 +27,10 @@ module Keystone
|
|
|
27
27
|
content_for(:mobile_action_url)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
def form_options
|
|
31
|
+
content_for?(:mobile_action_confirm) ? { data: { turbo_confirm: content_for(:mobile_action_confirm) } } : {}
|
|
32
|
+
end
|
|
33
|
+
|
|
30
34
|
def options
|
|
31
35
|
{ class: LINK_CLASSES, aria: { label: content_for(:mobile_action_label) } }
|
|
32
36
|
end
|
|
@@ -9,12 +9,6 @@ module Keystone
|
|
|
9
9
|
</svg>
|
|
10
10
|
SVG
|
|
11
11
|
|
|
12
|
-
ELLIPSIS_ICON = <<~SVG.freeze
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
|
14
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z" />
|
|
15
|
-
</svg>
|
|
16
|
-
SVG
|
|
17
|
-
|
|
18
12
|
ROW_CLASSES = "ks-page flex items-center ks-grid-gap-sm lg:hidden print:hidden max-lg:in-[.top-nav]:contents"
|
|
19
13
|
WRAPPER_CLASSES = "flex items-center lg:hidden print:hidden"
|
|
20
14
|
BACK_LINK_CLASSES = "ks-mobile-header-back"
|
|
@@ -22,15 +16,7 @@ module Keystone
|
|
|
22
16
|
SUBTITLE_CLASSES = "ks-mobile-header-subtitle block text-xs truncate"
|
|
23
17
|
OVERLINE_CLASSES = "ks-mobile-header-subtitle block text-xs truncate"
|
|
24
18
|
BADGE_CLASSES = "ml-auto shrink-0 self-center"
|
|
25
|
-
DROPDOWN_CLASSES = "ks-action-menu hidden absolute right-0 z-50 w-48 origin-top-right"
|
|
26
19
|
|
|
27
|
-
# Renders the left-side and title of the mobile header.
|
|
28
|
-
# Call from the left side of your navbar.
|
|
29
|
-
#
|
|
30
|
-
# Usage in navbar:
|
|
31
|
-
# <% if content_for?(:form_page) %>
|
|
32
|
-
# <%= ui_mobile_header_left %>
|
|
33
|
-
# <% end %>
|
|
34
20
|
def initialize(title:, back_url:, subtitle: nil, overline: nil, badge: nil)
|
|
35
21
|
@title = title
|
|
36
22
|
@back_url = back_url
|
|
@@ -13,7 +13,7 @@ module Keystone
|
|
|
13
13
|
CTA_CLASSES = "ks-card-link text-xs"
|
|
14
14
|
META_CLASSES = "ks-card-meta font-mono text-xs ks-tone-muted"
|
|
15
15
|
FINDING_CLASSES = "ks-alert ks-alert-warning text-xs"
|
|
16
|
-
TONE_CLASSES =
|
|
16
|
+
TONE_CLASSES = [ :muted, *States::NAMES ].to_h { |tone| [ tone, "ks-tone-#{tone}" ] }.freeze
|
|
17
17
|
|
|
18
18
|
def initialize(id:, title:, score: nil, score_tone: :muted, body: nil, cta: nil, meta: nil, finding: nil, actions: [], compact: false)
|
|
19
19
|
@id = id
|
|
@@ -26,13 +26,7 @@ module Keystone
|
|
|
26
26
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
|
|
27
27
|
SVG
|
|
28
28
|
|
|
29
|
-
VARIANT_CLASSES = {
|
|
30
|
-
neutral: "ks-tone-neutral",
|
|
31
|
-
success: "ks-tone-success",
|
|
32
|
-
danger: "ks-tone-danger",
|
|
33
|
-
warning: "ks-tone-warning",
|
|
34
|
-
info: "ks-tone-info"
|
|
35
|
-
}.freeze
|
|
29
|
+
VARIANT_CLASSES = States::NAMES.to_h { |state| [ state, "ks-tone-#{state}" ] }.freeze
|
|
36
30
|
|
|
37
31
|
attr_reader :label, :value, :suffix, :definition, :calculation, :change, :href, :note
|
|
38
32
|
|
|
@@ -9,7 +9,6 @@ module Keystone
|
|
|
9
9
|
SHAPE_CLASSES = { pills: "ks-tab-bar-pills", underline: "ks-tab-bar-underline" }.freeze
|
|
10
10
|
TAB_BASE_CLASSES = "ks-tab text-sm transition max-sm:shrink-0 max-sm:whitespace-nowrap"
|
|
11
11
|
SHAPED_TAB_BASE_CLASSES = "ks-tab transition max-sm:shrink-0 max-sm:whitespace-nowrap"
|
|
12
|
-
PANEL_CLASSES = "hidden"
|
|
13
12
|
LAYOUT_CLASSES = "max-sm:flex max-sm:flex-col"
|
|
14
13
|
SUMMARY_CLASSES = "max-sm:order-1 max-sm:[&>:first-child]:mt-0 max-sm:[&>:last-child]:mb-0"
|
|
15
14
|
CONTENT_CLASSES = "max-sm:order-1"
|
|
@@ -50,14 +49,6 @@ module Keystone
|
|
|
50
49
|
|
|
51
50
|
content_tag(:span, count, class: "ks-tab-count")
|
|
52
51
|
end
|
|
53
|
-
|
|
54
|
-
def panel_classes
|
|
55
|
-
PANEL_CLASSES
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def wrapper_data
|
|
59
|
-
{ controller: "tab-switcher" }
|
|
60
|
-
end
|
|
61
52
|
end
|
|
62
53
|
end
|
|
63
54
|
end
|
|
@@ -19,8 +19,11 @@ module Keystone
|
|
|
19
19
|
@before = before.to_s.lines(chomp: true)
|
|
20
20
|
@after = after.to_s.lines(chomp: true)
|
|
21
21
|
@one_column = one_column
|
|
22
|
+
@comparisons = 0
|
|
22
23
|
end
|
|
23
24
|
|
|
25
|
+
attr_reader :comparisons
|
|
26
|
+
|
|
24
27
|
def one_column?
|
|
25
28
|
@one_column
|
|
26
29
|
end
|
|
@@ -60,39 +63,63 @@ module Keystone
|
|
|
60
63
|
end
|
|
61
64
|
|
|
62
65
|
def compare
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
edits.map do |step, before_index, after_index|
|
|
67
|
+
case step
|
|
68
|
+
when :same then [ { text: @before[before_index], number: before_index + 1 }, { text: @after[after_index], number: after_index + 1 } ]
|
|
69
|
+
when :remove then [ { text: @before[before_index], number: before_index + 1, mark: "ks-diff-removed", sign: "-" }, nil ]
|
|
70
|
+
else [ nil, { text: @after[after_index], number: after_index + 1, mark: "ks-diff-added", sign: "+" } ]
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def edits
|
|
76
|
+
before_index = @before.size
|
|
77
|
+
after_index = @after.size
|
|
78
|
+
steps = []
|
|
79
|
+
furthest_reaches.each_with_index.reverse_each do |reach, changes|
|
|
80
|
+
diagonal = before_index - after_index
|
|
81
|
+
previous_diagonal = added_on?(reach, diagonal, changes) ? diagonal + 1 : diagonal - 1
|
|
82
|
+
previous_before = reach[previous_diagonal]
|
|
83
|
+
previous_after = previous_before - previous_diagonal
|
|
84
|
+
while before_index > previous_before && after_index > previous_after
|
|
85
|
+
before_index -= 1
|
|
86
|
+
after_index -= 1
|
|
87
|
+
steps << [ :same, before_index, after_index ]
|
|
76
88
|
end
|
|
89
|
+
next if changes.zero?
|
|
90
|
+
|
|
91
|
+
steps << (before_index == previous_before ? [ :add, nil, after_index - 1 ] : [ :remove, before_index - 1, nil ])
|
|
92
|
+
before_index = previous_before
|
|
93
|
+
after_index = previous_after
|
|
77
94
|
end
|
|
78
|
-
|
|
95
|
+
steps.reverse
|
|
79
96
|
end
|
|
80
97
|
|
|
81
|
-
def
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
def furthest_reaches
|
|
99
|
+
reach = { 1 => 0 }
|
|
100
|
+
(0..(@before.size + @after.size)).each_with_object([]) do |changes, reaches|
|
|
101
|
+
reaches << reach.dup
|
|
102
|
+
(-changes).step(changes, 2) do |diagonal|
|
|
103
|
+
before_index = added_on?(reach, diagonal, changes) ? reach[diagonal + 1] : reach[diagonal - 1] + 1
|
|
104
|
+
after_index = before_index - diagonal
|
|
105
|
+
while before_index < @before.size && after_index < @after.size && same_line?(before_index, after_index)
|
|
106
|
+
before_index += 1
|
|
107
|
+
after_index += 1
|
|
91
108
|
end
|
|
109
|
+
reach[diagonal] = before_index
|
|
110
|
+
return reaches if before_index >= @before.size && after_index >= @after.size
|
|
92
111
|
end
|
|
93
|
-
table
|
|
94
112
|
end
|
|
95
113
|
end
|
|
114
|
+
|
|
115
|
+
def same_line?(before_index, after_index)
|
|
116
|
+
@comparisons += 1
|
|
117
|
+
@before[before_index] == @after[after_index]
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def added_on?(reach, diagonal, changes)
|
|
121
|
+
diagonal == -changes || (diagonal != changes && reach[diagonal - 1] < reach[diagonal + 1])
|
|
122
|
+
end
|
|
96
123
|
end
|
|
97
124
|
end
|
|
98
125
|
end
|
|
@@ -132,6 +132,7 @@ module Keystone
|
|
|
132
132
|
def check_times(entry)
|
|
133
133
|
raise ArgumentError, "Timeline entry #{entry[:label].inspect} has no started_at" unless entry[:started_at]
|
|
134
134
|
raise ArgumentError, "Timeline entry #{entry[:label].inspect} ends before it starts" if entry[:ended_at] && entry[:ended_at] < entry[:started_at]
|
|
135
|
+
raise ArgumentError, "Timeline entry #{entry[:label].inspect} is queued after it starts" if entry[:queued_at] && entry[:queued_at] > entry[:started_at]
|
|
135
136
|
end
|
|
136
137
|
|
|
137
138
|
def written_duration(seconds)
|
data/lib/keystone_ui/version.rb
CHANGED
|
@@ -189,10 +189,10 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
189
189
|
the main action send that method: the header's button and
|
|
190
190
|
`ui_mobile_action`'s icon become forms posting to `action_url:`.
|
|
191
191
|
- `action_confirm:` is a question Turbo asks before the main action goes
|
|
192
|
-
ahead, on the header's button
|
|
193
|
-
`
|
|
194
|
-
|
|
195
|
-
a
|
|
192
|
+
ahead, on the header's button, on `ui_bottom_action`'s button and on
|
|
193
|
+
`ui_mobile_action`'s plus icon when `action_method:` is given, as
|
|
194
|
+
`ui_button`'s `confirm:` does. The plus icon of an action with no
|
|
195
|
+
`action_method:` is a link and does not ask it. It applies only with `action_url:` and is
|
|
196
196
|
ignored when an `action` block is given. Ask the developer whether a
|
|
197
197
|
screen's main action needs a question and how it is worded.
|
|
198
198
|
- `subtitle_mono: true` draws the subtitle in a fixed-width font, such as
|
|
@@ -236,7 +236,8 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
236
236
|
keywords of `ui_action_menu_item`, and renders an action menu. The link
|
|
237
237
|
and the menu sit side by side at the right edge of the header, the link
|
|
238
238
|
first, at every width. `spacing:` is `:sm` `:md` `:lg`. The header, with its
|
|
239
|
-
`action:`, `menu:` and aside, renders only when `title:` is given
|
|
239
|
+
`action:`, `menu:` and aside, renders only when `title:` is given, and an
|
|
240
|
+
aside given with no `title:` raises `ArgumentError`.
|
|
240
241
|
- The block yields the section, and `section.with_aside { ... }` in it puts
|
|
241
242
|
short text or a `ui_badge`, such as a sort order or a step's state, in
|
|
242
243
|
small muted text at the right end of the title line, before the link and
|
|
@@ -403,8 +404,11 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
403
404
|
`sm:` in its place, `phone_only: true`, which shows the action below
|
|
404
405
|
`sm:` only, and `phone_order:` 1, 2 or 3, its place in the phone row, so
|
|
405
406
|
one call can give a desktop row and a phone row that differ in labels,
|
|
406
|
-
buttons and order.
|
|
407
|
-
|
|
407
|
+
buttons and order. Any other `phone_order:` raises `KeyError`. An action
|
|
408
|
+
with `href:` and a `method:` such as `:delete` sends the bar's form, note
|
|
409
|
+
included, to its own `href:` with that method, while every other button
|
|
410
|
+
still sends it to `url:` with the bar's `method:`. Such an action cannot
|
|
411
|
+
also take `name:` or `value:`, and giving either raises `ArgumentError`. `note:` takes `name:`,
|
|
408
412
|
`label:` and `placeholder:` and draws a text field inside its label, sent
|
|
409
413
|
with the form. `hint:` is a short line of muted text, such as keyboard
|
|
410
414
|
keys. From `sm:` up it draws a panel holding the note field, the
|
|
@@ -679,7 +683,7 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
679
683
|
|
|
680
684
|
9. Show content and status.
|
|
681
685
|
|
|
682
|
-
- `ui_button(label:, href: nil, method: :get, variant: :primary, size: :md, full_width: false, type: :submit, data: nil, name: nil, value: nil, hidden: false, confirm: nil, disabled: false)`
|
|
686
|
+
- `ui_button(label:, href: nil, method: :get, variant: :primary, size: :md, full_width: false, type: :submit, data: nil, name: nil, value: nil, hidden: false, confirm: nil, disabled: false, formaction: nil)`
|
|
683
687
|
renders a link with `href:` and a button without it. `variant:` is
|
|
684
688
|
`:primary` `:secondary` `:danger` `:text`, `size:` is `:sm` `:md` `:lg`,
|
|
685
689
|
and `type:`, `name:` and `value:` apply only to the button.
|
|
@@ -687,6 +691,8 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
687
691
|
as a Back or Previous control under a form. A button given `name:` and
|
|
688
692
|
`value:` submits them with its form when pressed. `hidden: true` draws it
|
|
689
693
|
with the `hidden` attribute, for the app's own script to show.
|
|
694
|
+
`formaction:` makes a button without `href:` send its form to that
|
|
695
|
+
address in place of the form's own when pressed.
|
|
690
696
|
- `disabled: true` draws a button without `href:` with the `disabled`
|
|
691
697
|
attribute, so it cannot be pressed and does not submit its form. It is
|
|
692
698
|
for a button without `href:`: a link ignores the attribute and stays
|
|
@@ -876,7 +882,8 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
876
882
|
`height:` `:sm` `:md` `:lg`.
|
|
877
883
|
- `ui_bar_chart(bars:, show_values: false, strip: false)` — `bars:` is
|
|
878
884
|
`[{ label:, value:, shaded:, group: }, ...]`, where `shaded: true` draws
|
|
879
|
-
a bar faded.
|
|
885
|
+
a bar faded. A negative `value:` raises `ArgumentError` naming it. It
|
|
886
|
+
is drawn on the server as an SVG, so use it, not
|
|
880
887
|
`ui_line_chart`, for a chart that must print or show without JavaScript.
|
|
881
888
|
- Give bars `group:`, such as the version that produced each one, to show
|
|
882
889
|
groups of bars. Groups count from oldest to newest in the order their
|
|
@@ -997,7 +1004,8 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
997
1004
|
`1m 30s` or `1h 5s`.
|
|
998
1005
|
- Ask the developer which layout a screen uses.
|
|
999
1006
|
- An entry with no `started_at:` raises `ArgumentError` naming its label,
|
|
1000
|
-
and so does an entry whose `ended_at:` is before its `started_at
|
|
1007
|
+
and so does an entry whose `ended_at:` is before its `started_at:` or
|
|
1008
|
+
whose `queued_at:` is after it. Check
|
|
1001
1009
|
the times before rendering rather than rescuing the error.
|
|
1002
1010
|
- An empty `entries:` draws a centred "No steps" message in place of the
|
|
1003
1011
|
timeline, so it can be rendered for a list that may be empty. The
|
|
@@ -135,7 +135,7 @@ One decision: is keystone_ui set up in the app?
|
|
|
135
135
|
style at the right end of the title line, before the action and the menu.
|
|
136
136
|
The aside never breaks in the middle of a word, and on wider screens a long
|
|
137
137
|
title wraps beside it while it keeps its full width. Below `sm:` the aside
|
|
138
|
-
takes a line of its own under the title and the actions. A section
|
|
138
|
+
takes a line of its own under the title and the actions. A section given an aside and no title raises an error, since the header that shows the aside needs a title.
|
|
139
139
|
- **Going back.** A form or show page shell needs a way back: a back link, a
|
|
140
140
|
trail of earlier pages shown as breadcrumbs, or a trail the app supplies for
|
|
141
141
|
the request. A nav tab's own page passes an empty trail and shows no back
|
|
@@ -201,7 +201,8 @@ One decision: is keystone_ui set up in the app?
|
|
|
201
201
|
layout. Below `sm:` the layout can show it again as a plus icon in the top
|
|
202
202
|
bar, or as a full-width button in a bar fixed to the bottom of the screen,
|
|
203
203
|
above the bottom tab bar when the page has one. The bottom bar asks the
|
|
204
|
-
header's confirmation question before sending, and the plus icon
|
|
204
|
+
header's confirmation question before sending, and so does the plus icon
|
|
205
|
+
when the action sends a method other than a plain visit.
|
|
205
206
|
The page leaves room under its last content so the bar does not cover it.
|
|
206
207
|
A header can mark its action as belonging at the bottom, and then hides its
|
|
207
208
|
own button below `sm:` so the action is not shown twice. Both forms show
|
|
@@ -225,7 +226,10 @@ One decision: is keystone_ui set up in the app?
|
|
|
225
226
|
width above a row of the secondary buttons in equal shares, a long label
|
|
226
227
|
wrapping inside its button, and with no note field or hint. The width at
|
|
227
228
|
which it switches between the two can be moved from `sm:` to `md:` or `lg:`. Each secondary button can have a shorter label on a phone, be
|
|
228
|
-
shown on a phone only, and take another place in the phone row.
|
|
229
|
+
shown on a phone only, and take another place in the phone row. A
|
|
230
|
+
secondary button can also send its own request, such as a delete, to its
|
|
231
|
+
own address, while the other buttons still send the bar's form to the
|
|
232
|
+
bar's address. The page leaves room under its last content so the bar does
|
|
229
233
|
not cover it. Unlike the main action's bottom bar, it stays shown inside a
|
|
230
234
|
Hotwire Native web view.
|
|
231
235
|
- **Action menus.** Each action is a label, an address and an HTTP method. A
|
|
@@ -233,7 +237,9 @@ One decision: is keystone_ui set up in the app?
|
|
|
233
237
|
changes data is never a bare link. A delete asks for confirmation by default.
|
|
234
238
|
- **Status states.** A badge and a status dot read one list of five states:
|
|
235
239
|
neutral, success, danger, warning and info. A state added to that list is
|
|
236
|
-
accepted by both, so the two never disagree about which states exist. A
|
|
240
|
+
accepted by both, so the two never disagree about which states exist. A stat
|
|
241
|
+
card's tones and a review card's score tones, which add a muted tone, read
|
|
242
|
+
the same list. A badge
|
|
237
243
|
shows its label as text. A status dot shows only its state's colour, for
|
|
238
244
|
places with no room for text, and its label is read only by screen readers.
|
|
239
245
|
Neither accepts a state outside the list: a status dot raises `ArgumentError`
|