keystone_ui 0.77.0 → 0.78.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/status_dot_component.rb +28 -0
- 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 +11 -2
- data/the_local/agents/keystone_ui-info.md +7 -2
- data/the_local/interface.yml +2 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1caef93fc9a8ea85b3cb62b32540c5e13331092dfaf11b954bc9bdf0ed3f4cc6
|
|
4
|
+
data.tar.gz: 22c5443af455f0aef44503f7d1b2a9203a95c879f0dfbf16a393964b215dcbf0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81b1ce2589195e37bd88d677930b3d3d94e00a6609eecd6c44ed290970605d0de4febfd25d098177d8207a08eb8f371252c9d9c7f048c23645d2ba2964f035dd
|
|
7
|
+
data.tar.gz: 3fa5d47c0b4d4da2ead387a0e8c52dc4067afbc4dcf13693f16b0fc32ac28f31654ac0af290a26d061101fb220dd8ca0904f56ec983960e4b580057e5e430912
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Keystone
|
|
4
|
+
module Ui
|
|
5
|
+
class StatusDotComponent < ViewComponent::Base
|
|
6
|
+
STATE_CLASSES = {
|
|
7
|
+
neutral: "ks-status-dot-neutral",
|
|
8
|
+
success: "ks-status-dot-success",
|
|
9
|
+
danger: "ks-status-dot-danger",
|
|
10
|
+
warning: "ks-status-dot-warning",
|
|
11
|
+
info: "ks-status-dot-info"
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
LABEL_CLASSES = "sr-only"
|
|
15
|
+
|
|
16
|
+
def initialize(state:, label:)
|
|
17
|
+
raise ArgumentError, "Unknown status dot state #{state.inspect}, expected one of #{STATE_CLASSES.keys.join(', ')}" unless STATE_CLASSES.key?(state)
|
|
18
|
+
|
|
19
|
+
@state = state
|
|
20
|
+
@label = label
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def call
|
|
24
|
+
tag.span(class: "ks-status-dot #{STATE_CLASSES[@state]}") { tag.span(@label, class: LABEL_CLASSES) }
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -205,6 +205,10 @@ module KeystoneUiHelper
|
|
|
205
205
|
render Keystone::Ui::ProgressComponent.new(**args)
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
+
def ui_status_dot(**args)
|
|
209
|
+
render Keystone::Ui::StatusDotComponent.new(**args)
|
|
210
|
+
end
|
|
211
|
+
|
|
208
212
|
def ui_settings_link(**args)
|
|
209
213
|
render Keystone::Ui::SettingsLinkComponent.new(**args)
|
|
210
214
|
end
|
data/lib/keystone_ui/safelist.rb
CHANGED
|
@@ -76,6 +76,7 @@ module Keystone
|
|
|
76
76
|
Keystone::Ui::DisclosureComponent,
|
|
77
77
|
Keystone::Ui::ThemeToggleComponent,
|
|
78
78
|
Keystone::Ui::TimelineComponent,
|
|
79
|
+
Keystone::Ui::StatusDotComponent,
|
|
79
80
|
Keystone::Ui::CalculationComponent,
|
|
80
81
|
Keystone::Ui::DesktopBackLinkComponent,
|
|
81
82
|
Keystone::Ui::BreadcrumbsComponent,
|
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, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps, amounts shown in green or red as a gain or loss, pictures held to half the screen, 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, action menus for a record's Edit and Delete, dashboards with stat cards, charts, funnels, goal buckets and timelines of timed steps, amounts shown in green or red as a gain or loss, status dots coloured by state, pictures held to half the screen, 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
|
---
|
|
@@ -67,6 +67,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
|
|
|
67
67
|
- `ui_column_picker` — a Columns menu that saves which columns are hidden and their order to an app endpoint.
|
|
68
68
|
- `ui_button` — a link or a button styled as a button, or a button sending a POST, PATCH or DELETE request.
|
|
69
69
|
- `ui_badge` — a coloured pill holding a short label.
|
|
70
|
+
- `ui_status_dot` — a small dot coloured by state, with its label read only by screen readers.
|
|
70
71
|
- `ui_figure` — one amount as inline text, coloured as a gain or a loss.
|
|
71
72
|
- `ui_picture` — an image never taller than half the screen, optionally opening its full-size file.
|
|
72
73
|
- `ui_heading` — a heading at one of three sizes, with an optional short note on its right.
|
|
@@ -602,6 +603,13 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
602
603
|
the developer which version of an uploaded image each address points at.
|
|
603
604
|
- `ui_badge(label:, variant: :neutral, class: nil)` — `variant:` is
|
|
604
605
|
`:neutral` `:success` `:danger` `:warning` `:info`.
|
|
606
|
+
- `ui_status_dot(state:, label:)` — `state:` is `:neutral` `:success`
|
|
607
|
+
`:danger` `:warning` `:info`, and any other value raises `ArgumentError`
|
|
608
|
+
naming it. `label:` is not shown on screen and is read out by screen
|
|
609
|
+
readers, so pass words that say what the state means. The dot takes the
|
|
610
|
+
colour of a `ui_badge` of the same name. Use it where a badge's words
|
|
611
|
+
would crowd the row, such as beside a name in a list, and ask the
|
|
612
|
+
developer which states a record has and what each one means.
|
|
605
613
|
- `ui_alert(message:, type: :info, title: nil, dismissible: false, class: nil)`
|
|
606
614
|
— `type:` is `:info` `:success` `:warning` `:error`, and `dismissible: true`
|
|
607
615
|
adds a close button.
|
|
@@ -782,7 +790,8 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
|
|
|
782
790
|
shows nothing, a breakdown in one run of text, a `:success` or `:danger`
|
|
783
791
|
figure in plain colour, a joined funnel with no band, a locked column the
|
|
784
792
|
others show through, a Columns menu with no greyed name for a hidden
|
|
785
|
-
column,
|
|
793
|
+
column, a table row whose caret does not open its detail, or a status dot
|
|
794
|
+
that draws nothing — the app's Stimulus controllers or keystone_ui-styles version are
|
|
786
795
|
out of date. Stop and hand that part to `keystone_ui-install`, and add no
|
|
787
796
|
classes to fix it.
|
|
788
797
|
|
|
@@ -12,8 +12,8 @@ nothing and gives no steps.
|
|
|
12
12
|
|
|
13
13
|
keystone_ui is a Rails engine gem that supplies a host app's UI as view helpers
|
|
14
14
|
built on ViewComponent. Screens are built from named pieces — page shells,
|
|
15
|
-
sections, panels, grids, forms and fields, search dropdowns, data tables, navigation, cards,
|
|
16
|
-
tiles, charts, timelines, funnels, goal buckets, pipelines, breakdowns and info buttons —
|
|
15
|
+
sections, panels, grids, forms and fields, search dropdowns, data tables, navigation, cards,
|
|
16
|
+
badges, status dots, stat tiles, charts, timelines, funnels, goal buckets, pipelines, breakdowns and info buttons —
|
|
17
17
|
instead of hand-written ERB and Tailwind. Every class the UI renders lives in the
|
|
18
18
|
gem, so two pages built from the same helpers cannot disagree about spacing,
|
|
19
19
|
colour or dark-mode treatment, and a change to a component reaches every page
|
|
@@ -104,6 +104,11 @@ One decision: is keystone_ui set up in the app?
|
|
|
104
104
|
- **Action menus.** Each action is a label, an address and an HTTP method. A
|
|
105
105
|
plain visit is a link, and any other method is a button, so an action that
|
|
106
106
|
changes data is never a bare link. A delete asks for confirmation by default.
|
|
107
|
+
- **Status states.** A badge and a status dot share five states: neutral,
|
|
108
|
+
success, danger, warning and info. A badge shows its label as text. A status
|
|
109
|
+
dot shows only its state's colour, for places with no room for text, and its label
|
|
110
|
+
is read only by screen readers. A status dot raises `ArgumentError` on any
|
|
111
|
+
other state.
|
|
107
112
|
- **Semantic colour.** The themed hue is `accent-*` and the themed neutrals are
|
|
108
113
|
`surface-*`, CSS custom properties whose defaults (blue and zinc) come from
|
|
109
114
|
the keystone_ui-styles gem. Retheming changes those values, not the
|
data/the_local/interface.yml
CHANGED
|
@@ -18,6 +18,7 @@ develop:
|
|
|
18
18
|
- ui_hero
|
|
19
19
|
- ui_modal
|
|
20
20
|
- ui_badge
|
|
21
|
+
- ui_status_dot
|
|
21
22
|
- ui_copy_button
|
|
22
23
|
- ui_card
|
|
23
24
|
- ui_button
|
|
@@ -103,6 +104,7 @@ sources:
|
|
|
103
104
|
- app/components/keystone/ui/link_list_component.rb
|
|
104
105
|
- app/components/keystone/ui/link_list_component.html.erb
|
|
105
106
|
- app/components/keystone/ui/badge_component.rb
|
|
107
|
+
- app/components/keystone/ui/status_dot_component.rb
|
|
106
108
|
- app/components/keystone/ui/bottom_nav_component.rb
|
|
107
109
|
- app/components/keystone/ui/bottom_nav_item_component.rb
|
|
108
110
|
- app/components/keystone/ui/button_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.78.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler Schneider
|
|
@@ -214,6 +214,7 @@ files:
|
|
|
214
214
|
- app/components/keystone/ui/sortable_list_component.rb
|
|
215
215
|
- app/components/keystone/ui/stat_card_component.html.erb
|
|
216
216
|
- app/components/keystone/ui/stat_card_component.rb
|
|
217
|
+
- app/components/keystone/ui/status_dot_component.rb
|
|
217
218
|
- app/components/keystone/ui/swipe_deck_component.html.erb
|
|
218
219
|
- app/components/keystone/ui/swipe_deck_component.rb
|
|
219
220
|
- app/components/keystone/ui/tab_switcher_component.html.erb
|