keystone_ui 0.73.0 → 0.74.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: d022ceb3f34fcc5f5b576284d6e61e546adc129219760b94cc144520f135e67f
4
- data.tar.gz: 187d25d879625ded62755e7ad640cfa06c9cf8bcac07d3931c6f75e6fa9b2786
3
+ metadata.gz: fd495c0ec1a80aba3c029677f9af5167d739166c082ff3e8a8da6e1c114c4ee9
4
+ data.tar.gz: e6bc445bc552f872e7946fd05ed90c46875b92309ffa0834845f8d7231032b42
5
5
  SHA512:
6
- metadata.gz: 96cd19e46f7e460bb112e138df25683af5402f791be5e63923c6fb56abf89f94f78e483dcba245d74884c98692b06fd1df2ec2b3472d5c90dd8381bb2d51eb26
7
- data.tar.gz: e4b2ca64098f66d7dc4d6dce92901023693265a5686d4ebbf9063dc05687e6e0ca76dc9b9d23af448cecd7d2b7806aef49817fffac51995d4de1335c359b26b1
6
+ metadata.gz: 32f6d18f423f495b596a2b7ae441665d233c6cf60ac2c61398c28da5ce82454f3f1d349c54a69cd2dc60c727e97553b2c026420c7e498071d5c26eec6c6f8345
7
+ data.tar.gz: 06cbbccbd25af32dee5ddd9deb1b93e881029757a46c7c995547bada74af912ffab52e2f9457249c84b310a126c2cbc01b737db34d1e8374f0e49ac7d8d5dced
@@ -0,0 +1,10 @@
1
+ <div class="<%= classes %>">
2
+ <% if detail? %>
3
+ <div class="<%= detail_classes %>">
4
+ <%= detail %>
5
+ </div>
6
+ <% end %>
7
+ <div class="<%= list_classes %>">
8
+ <%= content %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Keystone
4
+ module Ui
5
+ class ListDetailComponent < ViewComponent::Base
6
+ WRAPPER_CLASSES = "grid grid-cols-1 ks-grid-gap-md"
7
+ SPLIT_CLASSES = "lg:grid-cols-3"
8
+ LIST_CLASSES = "min-w-0 lg:order-first"
9
+ DETAIL_CLASSES = "min-w-0 lg:col-span-2"
10
+
11
+ renders_one :detail
12
+
13
+ def classes
14
+ return WRAPPER_CLASSES unless detail?
15
+
16
+ "#{WRAPPER_CLASSES} #{SPLIT_CLASSES}"
17
+ end
18
+
19
+ def list_classes
20
+ LIST_CLASSES
21
+ end
22
+
23
+ def detail_classes
24
+ DETAIL_CLASSES
25
+ end
26
+ end
27
+ end
28
+ end
@@ -6,8 +6,8 @@ module Keystone
6
6
  TAB_BAR_CLASSES = "ks-tab-bar flex flex-wrap justify-center max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:justify-start"
7
7
  TAB_BASE_CLASSES = "ks-tab text-sm transition max-sm:shrink-0 max-sm:whitespace-nowrap"
8
8
  PANEL_CLASSES = "hidden"
9
- LAYOUT_CLASSES = "flex flex-col"
10
- SUMMARY_CLASSES = "max-sm:order-1"
9
+ LAYOUT_CLASSES = "max-sm:flex max-sm:flex-col"
10
+ SUMMARY_CLASSES = "max-sm:order-1 max-sm:[&>:first-child]:mt-0 max-sm:[&>:last-child]:mb-0"
11
11
  CONTENT_CLASSES = "max-sm:order-1"
12
12
 
13
13
  renders_one :summary
@@ -81,6 +81,10 @@ module KeystoneUiHelper
81
81
  render Keystone::Ui::GridComponent.new(**args), &block
82
82
  end
83
83
 
84
+ def ui_list_detail(**args, &block)
85
+ render Keystone::Ui::ListDetailComponent.new(**args), &block
86
+ end
87
+
84
88
  def ui_panel(**args, &block)
85
89
  render Keystone::Ui::PanelComponent.new(**args), &block
86
90
  end
@@ -18,6 +18,7 @@ module Keystone
18
18
  Keystone::Ui::FigureComponent,
19
19
  Keystone::Ui::HeadingComponent,
20
20
  Keystone::Ui::HeroComponent,
21
+ Keystone::Ui::ListDetailComponent,
21
22
  Keystone::Ui::ModalComponent,
22
23
  Keystone::Ui::SelectComponent,
23
24
  Keystone::Ui::BadgeComponent,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KeystoneUi
4
- VERSION = "0.73.0"
4
+ VERSION = "0.74.0"
5
5
  end
@@ -31,6 +31,7 @@ not available in the app yet, that is `keystone_ui-install`'s job.
31
31
  - `ui_breadcrumbs` — a line of links to the pages above the current one, shown from `lg:` up.
32
32
  - `ui_section` — a titled block of content with an optional link and action menu in its header.
33
33
  - `ui_grid` — a responsive grid with a column count per breakpoint.
34
+ - `ui_list_detail` — a list beside the detail of the item picked from it, with the detail above the list below `lg:`.
34
35
  - `ui_panel` — a bordered card surface holding any content.
35
36
  - `ui_card_link` — a panel that is one link as a whole.
36
37
  - `ui_card` — a fixed card of title, summary and call-to-action link.
@@ -214,6 +215,12 @@ two exceptions: `ui_page`'s `padding:` treats any value other than `:none` as
214
215
  `cols:` maps `:default` `:sm` `:md` `:lg` to a count from 1 to 12, such as
215
216
  `{ default: 1, md: 3 }`. `gap:` is `:sm` `:md` `:lg` `:xl`, and passing
216
217
  `gap_x:` or `gap_y:` replaces `gap:` entirely.
218
+ - `ui_list_detail` takes no keywords. The block is the list, and
219
+ `layout.with_detail { ... }` is the picked item's detail, left unset when
220
+ nothing is picked. From `lg:` up the list takes the first third of the
221
+ width and the detail the other two thirds beside it. Below `lg:` the detail
222
+ is drawn above the list. With no detail the list takes the full width at
223
+ every size. Write no Tailwind classes of your own to get either order.
217
224
  - `ui_panel(padding: :md, radius: :lg, shadow: true)` — `padding:` is `:sm`
218
225
  `:md` `:lg` and `radius:` is `:md` `:lg` `:xl`.
219
226
  - `ui_card_link(href:, padding: :md, shadow: true)` — `padding:` is `:sm`
@@ -24,6 +24,7 @@ develop:
24
24
  - ui_page
25
25
  - ui_section
26
26
  - ui_grid
27
+ - ui_list_detail
27
28
  - ui_panel
28
29
  - ui_card_link
29
30
  - ui_input
@@ -138,6 +139,8 @@ sources:
138
139
  - app/components/keystone/ui/bucket_series_component.rb
139
140
  - app/components/keystone/ui/grid_component.rb
140
141
  - app/components/keystone/ui/hero_component.rb
142
+ - app/components/keystone/ui/list_detail_component.rb
143
+ - app/components/keystone/ui/list_detail_component.html.erb
141
144
  - app/components/keystone/ui/input_component.rb
142
145
  - app/components/keystone/ui/line_chart_component.rb
143
146
  - app/components/keystone/ui/mobile_actions_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.73.0
4
+ version: 0.74.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Schneider
@@ -159,6 +159,8 @@ files:
159
159
  - app/components/keystone/ui/line_chart_component.rb
160
160
  - app/components/keystone/ui/link_list_component.html.erb
161
161
  - app/components/keystone/ui/link_list_component.rb
162
+ - app/components/keystone/ui/list_detail_component.html.erb
163
+ - app/components/keystone/ui/list_detail_component.rb
162
164
  - app/components/keystone/ui/mobile_action_component.rb
163
165
  - app/components/keystone/ui/mobile_actions_component.html.erb
164
166
  - app/components/keystone/ui/mobile_actions_component.rb