poetry-ui 0.1.11 → 0.1.13

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: 424d56eb485cfb24b25adad4bd41c5ad975cfd59a55416ac56df517b54876c23
4
- data.tar.gz: 9ad5fe0d7d083dbef21f73b1e9e2eafea3e674dbaaef9825645926d989d91a11
3
+ metadata.gz: fd69e4a483a5ff3e4ab764d00853296fb1719e0ccb37d93b576412d578464dbb
4
+ data.tar.gz: 4574dd426ea32bbff47837b78ccdc4a60599f87a007252ec3850387ba1a2535a
5
5
  SHA512:
6
- metadata.gz: a622c7a5e36978fb60c91589b0b609cdf6a4bed6ddc96a31d876a1eac50d2fbcae0131837fa18fbaca9eb5efe28bc8f30329ed60c7c11d16b99b227da514d347
7
- data.tar.gz: 4586384470e5c8da21ceacb1134aca3853f3770e8b26aeae6382e78074767f35e7076c1f4f03deb36f8fc67e181c88f787fbec97ba5f900ddbd8c46eff341722
6
+ metadata.gz: 93efa9fe4b2ac3e533988fd3e499d37d2f7db28c68282723de8f6326716833ac988b3f9934fe84802c2f28203a67353eaa24cecb84384e2f148bad4abb9cd4f3
7
+ data.tar.gz: 1a94d395feea2e02280c6eb3d214b51aeddf6dea6a097e926816a8769f8c9d5d2080fdc3872f1f0a559d81a390ca129f6d74aef3f161f5fc36a65c07f8245c87
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.13] - 2026-10-13
4
+
5
+ ### Added
6
+
7
+ - `poetry:add` rewrites `config/controllers_manifest.json` when a registry item installs a Stimulus controller under `app/javascript/controllers`, as `poetry:stimulus:manifest` would. A component that names its controller by Symbol now loads after the install instead of raising until the host ran the task by hand. The generator says to commit the manifest and restart a running server.
8
+
9
+ ### Fixed
10
+
11
+ - `poetry:check` no longer warns about `poetry_native_select_option` and `poetry_native_select_optgroup` inside a loop. They render plain `<option>` and `<optgroup>` tags with no id to keep stable, and the `key:` the warning asked for would only leak into the HTML as an attribute. The registry's helpers section declares both identity-free, like the table parts.
12
+
13
+ ## [0.1.12] - 2026-10-07
14
+
15
+ ### Fixed
16
+
17
+ - A submit item in DropdownMenu, ContextMenu or Menubar (`with_item(submit:)`) fills its row like the link items. It renders a `<button>`, which sizes to its label even as a flex box, so its hover and focus highlight stopped at the text. Each family's new `item_submit` element carries `w-full text-start`, so the classes reach the host safelist with the rest of the dictionary.
18
+
3
19
  ## [0.1.11] - 2026-10-05
4
20
 
5
21
  ### Fixed
@@ -47,6 +47,11 @@ module Poetry
47
47
  # visibility.
48
48
  element :item_indicator_state, "[[data-unchecked]>&]:hidden"
49
49
 
50
+ # POETRY ADDITION (family convention): a submit item is a <button>, which
51
+ # sizes to its label even as a flex box where the link and plain items
52
+ # fill the row; it takes the full width and starts its text like them.
53
+ element :item_submit, "w-full text-start"
54
+
50
55
  # The source's inline lucide icon classes, named per part. DELTA:
51
56
  # the context sub chevron is a bare ml-auto (the item's [&_svg]
52
57
  # rules provide size-4).
@@ -50,6 +50,11 @@ module Poetry
50
50
  # flip is the whole toggle.
51
51
  element :item_indicator_state, "[[data-unchecked]>&]:hidden"
52
52
 
53
+ # POETRY ADDITION (family convention): a submit item is a <button>, which
54
+ # sizes to its label even as a flex box where the link and plain items
55
+ # fill the row; it takes the full width and starts its text like them.
56
+ element :item_submit, "w-full text-start"
57
+
53
58
  # The source's inline lucide icon classes, named per part.
54
59
  element :indicator_check, "size-4"
55
60
  element :indicator_circle, "size-2 fill-current"
@@ -60,6 +60,11 @@ module Poetry
60
60
  # visibility.
61
61
  element :item_indicator_state, "[[data-unchecked]>&]:hidden"
62
62
 
63
+ # POETRY ADDITION (family convention): a submit item is a <button>, which
64
+ # sizes to its label even as a flex box where the link and plain items
65
+ # fill the row; it takes the full width and starts its text like them.
66
+ element :item_submit, "w-full text-start"
67
+
63
68
  # The source's inline lucide icon classes, named per part. DELTA:
64
69
  # the menubar sub chevron is ml-auto h-4 w-4 (source-exact).
65
70
  element :indicator_check, "size-4"
@@ -134,10 +134,13 @@ module Poetry
134
134
  submit = options.delete(:submit)
135
135
  method = options.delete(:method)
136
136
  disabled = options[:disabled]
137
+ # A submit item is a <button>, which sizes to its label; the
138
+ # item_submit element makes it fill the row like the others.
139
+ item_class = [(family_style.css(:item_submit) if submit && !disabled), options.delete(:class)].compact
137
140
  attrs = {
138
141
  "data-slot" => "#{family_slot_prefix}-item", "role" => "menuitem", "tabindex" => "-1",
139
142
  "data-poetry-collection-item" => "", "data-variant" => variant,
140
- "class" => family_style.css(:item, class: options.delete(:class))
143
+ "class" => family_style.css(:item, class: item_class)
141
144
  }.merge(item_action_attributes)
142
145
  apply_item_flags(attrs, **options.extract!(:inset, :disabled, :text_value, :close_on_select))
143
146
  content = safe_join([capture(&), shortcut_span(shortcut)].compact)
@@ -972,9 +972,11 @@ module Poetry
972
972
  # these literals statically (the crash class: a helper-only literal
973
973
  # like align: :leading that no component contract covers, failing
974
974
  # only at render). Plain wrapper helpers need no entry here;
975
- # registry generation lists them name-only. The table parts declare
976
- # identity false: they mint no id, so the stable-identity rules have
977
- # nothing to ask of them (a keyed row derives its id).
975
+ # registry generation lists them name-only. The table parts and the
976
+ # native select's option and optgroup declare identity false: they
977
+ # mint no id, so the stable-identity rules have nothing to ask of
978
+ # them (a keyed row derives its id; key: on an option would only
979
+ # leak as an HTML attribute).
978
980
  HELPER_CONTRACTS = {
979
981
  "poetry_table_header" => { "identity" => false },
980
982
  "poetry_table_body" => { "identity" => false },
@@ -983,6 +985,8 @@ module Poetry
983
985
  "poetry_table_head" => { "identity" => false },
984
986
  "poetry_table_cell" => { "identity" => false },
985
987
  "poetry_table_caption" => { "identity" => false },
988
+ "poetry_native_select_option" => { "identity" => false },
989
+ "poetry_native_select_optgroup" => { "identity" => false },
986
990
  "poetry_toast_trigger" => {
987
991
  "options" => [
988
992
  { "name" => "template", "type" => "string",
@@ -3307,10 +3307,11 @@ components:
3307
3307
  - sub_content
3308
3308
  - item_indicator
3309
3309
  - item_indicator_state
3310
+ - item_submit
3310
3311
  - indicator_check
3311
3312
  - indicator_circle
3312
3313
  - sub_indicator
3313
- capsule: 782677850eea
3314
+ capsule: cc47e5e60e90
3314
3315
  controllers:
3315
3316
  - identifier: poetry--core--context-menu
3316
3317
  targets: []
@@ -4914,10 +4915,11 @@ components:
4914
4915
  - sub_content
4915
4916
  - item_indicator
4916
4917
  - item_indicator_state
4918
+ - item_submit
4917
4919
  - indicator_check
4918
4920
  - indicator_circle
4919
4921
  - sub_indicator
4920
- capsule: 7e706784fb17
4922
+ capsule: 7303732042e7
4921
4923
  controllers:
4922
4924
  - identifier: poetry--core--menu
4923
4925
  targets: []
@@ -6744,10 +6746,11 @@ components:
6744
6746
  - sub_content
6745
6747
  - item_indicator
6746
6748
  - item_indicator_state
6749
+ - item_submit
6747
6750
  - indicator_check
6748
6751
  - indicator_circle
6749
6752
  - sub_indicator
6750
- capsule: '041619b53311'
6753
+ capsule: 937cafa689af
6751
6754
  controllers:
6752
6755
  - identifier: poetry--core--menu
6753
6756
  targets: []
@@ -12157,8 +12160,10 @@ helpers:
12157
12160
  poetry_kbd_group: {}
12158
12161
  poetry_message_group: {}
12159
12162
  poetry_message_scroller_item: {}
12160
- poetry_native_select_optgroup: {}
12161
- poetry_native_select_option: {}
12163
+ poetry_native_select_optgroup:
12164
+ identity: false
12165
+ poetry_native_select_option:
12166
+ identity: false
12162
12167
  poetry_navigation_menu_link: {}
12163
12168
  poetry_optimistic_form:
12164
12169
  yields: the form builder - form.optimistic_template authors the predicted turbo-stream(s);
@@ -35,6 +35,9 @@ module Poetry
35
35
  MANIFEST = "config/poetry_components.yml"
36
36
  # The host's Tailwind entry stylesheet (for @source injection).
37
37
  TAILWIND_ENTRY = "app/assets/tailwind/application.css"
38
+ # Where an item's Stimulus controllers land; a write here refreshes the
39
+ # app's controllers manifest.
40
+ CONTROLLERS_DIR = "app/javascript/controllers/"
38
41
 
39
42
  desc "Copy poetry components/blocks (plus dependencies) into the app, from the gems or any registry address"
40
43
 
@@ -116,10 +119,29 @@ module Poetry
116
119
  plan.writes.each { |write| create_file write.target, write.content, skip: true }
117
120
  plan.block_installs.each { |name| install_block(name) }
118
121
  apply_css(plan)
122
+ refresh_controllers_manifest(plan)
119
123
  report(plan)
120
124
  record_in_manifest(plan.manifest)
121
125
  end
122
126
 
127
+ # An item that brings a Stimulus controller joins the app's controllers
128
+ # manifest straight away (as `bin/rails poetry:stimulus:manifest` would),
129
+ # so the component that names it by Symbol loads, and check validates
130
+ # its wiring. The manifest is read at boot: a running server restarts.
131
+ def refresh_controllers_manifest(plan)
132
+ return if options[:pretend] || behavior == :revoke
133
+ return unless plan.writes.any? { |write| write.target.to_s.start_with?(CONTROLLERS_DIR) }
134
+
135
+ result = Poetry::Core::Stimulus::HostManifest.generate!(root: Pathname(destination_root))
136
+ count = result.definitions.size
137
+ say_status :stimulus, "wrote config/controllers_manifest.json (#{count} controller#{"s" unless count == 1}) - " \
138
+ "commit it, and restart a running server so components that name them load", :green
139
+ result.skipped.each do |skip|
140
+ say_status :stimulus,
141
+ "skipped #{skip.identifier}: #{skip.reason} (unvalidated until written by hand)", :yellow
142
+ end
143
+ end
144
+
123
145
  # The install plan for remote addresses through the registry client.
124
146
  def build_plan(remote)
125
147
  config = manifest_config
@@ -3,6 +3,6 @@
3
3
  module Poetry
4
4
  module Ui
5
5
  # The gem version.
6
- VERSION = "0.1.11"
6
+ VERSION = "0.1.13"
7
7
  end
8
8
  end
@@ -271,6 +271,10 @@ def poetry_design_report(plan, written)
271
271
  out << " contrast (merged set, AA floor):"
272
272
  plan.contrast.each { |result| out << " #{result}" }
273
273
  end
274
+ if plan.edges.any?
275
+ out << " faint edges (shipped; border and input vanish on these surfaces):"
276
+ plan.edges.each { |edge| out << " #{edge}" }
277
+ end
274
278
  if plan.dropped.any?
275
279
  out << " dropped (never guessed):"
276
280
  plan.dropped.each { |drop| out << " #{drop.name}: #{drop.reason}" }
@@ -295,6 +299,10 @@ def poetry_design_report_json(plan, written)
295
299
  { "mode" => r.mode, "pair" => r.label, "ratio" => r.ratio.round(2), "pass" => r.pass,
296
300
  "suggestion" => r.suggestion, "shipped_failing" => r.shipped }.compact
297
301
  end,
302
+ "edges" => plan.edges.map do |e|
303
+ { "mode" => e.mode, "edge" => e.edge, "surface" => e.surface, "ratio" => e.ratio.round(2),
304
+ "suggestion" => e.suggestion }.compact
305
+ end,
298
306
  "dropped" => plan.dropped.map do |d|
299
307
  { "name" => d.name, "value" => d.value, "mode" => d.mode, "reason" => d.reason }.compact
300
308
  end,
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poetry-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Solt
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-10-05 00:00:00.000000000 Z
10
+ date: 2026-10-13 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: poetry-core
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.1.11
18
+ version: 0.1.13
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.1.11
25
+ version: 0.1.13
26
26
  description: 'The component library of Poetry, the AI-native frontend framework for
27
27
  Rails: accessible, themeable, agent-legible ViewComponents built entirely on poetry-core''s
28
28
  public DSL.'