poetry-ui 0.1.10 → 0.1.12

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: f60faf3ae8c314214dbe7a6052706f040c96800a4e9363fab8ee19cdf842fae6
4
- data.tar.gz: c0caf8a9092a95a0147ab53b21a7c5a348fbdc13c0a28a474ad75b9329464a17
3
+ metadata.gz: 8676875c7f97a1dd931abb718a49a3da6877873b20aafec53006b68a022a04ca
4
+ data.tar.gz: 40933fec5bc880f597fd5eec6b2eb2485087ce141280d5c05e3e30fc949a7863
5
5
  SHA512:
6
- metadata.gz: 704bd7a648f2654330edead8350e7be448cc91f4091cc4acadc6f77611bc31cba634df50ed004369382eb8e4f496c63110f7d6e009515579a3aa11b1e87d8b6d
7
- data.tar.gz: e52dfa3187348ca3a446cd2da4b349c70a1519586b555c183f0c99702eb0b026612bcb45ca69220533f8dcf33c5ecad57c89aa2fc3f5493974da8b5ab5d8d16f
6
+ metadata.gz: b1d773fc597f9d72558ffca7a6ae6f3fade21d73fe06455c6e3fa319107f7bfc741e6d4c9b758b57879fffdf43e61db0a7d88cf2c3211e10999e6486e6882360
7
+ data.tar.gz: aaa0f3b9bc18469dec3de18ef48c55f05e508a519b9e1423ce580781fbbcc008d7fd7a750553c387eb06c14d92f5f1414b0900f60e83c7a5d06086f03691ef0e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.12] - 2026-10-07
4
+
5
+ ### Fixed
6
+
7
+ - 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.
8
+
9
+ ## [0.1.11] - 2026-10-05
10
+
11
+ ### Fixed
12
+
13
+ - Drawer `show_swipe_handle: true` on an edge panel (`direction: :left`, `:right` or `:up`) raises instead of drawing the bottom sheet's horizontal pill as a bar across the panel's top. The pill is the bottom sheet's grip, as in the source, where no other direction has a handle; the option's doc and the component's rules say so.
14
+ - The Combobox and Command list parts declare `data-empty`, the state the engine now writes when the filter pass leaves no visible item, so the themes' `data-empty:p-0` rule on the list is live and the allowlist entry that banked it is gone.
15
+ - `poetry:diff` and `poetry:add` read `config/poetry_components.yml` again on a host that has declared an override: the ledger writes `created:` as a bare YAML date, which the two generators loaded without permitting it (`Psych::DisallowedClass`). The design task already permitted the date; the generators now do too.
16
+
3
17
  ## [0.1.10] - 2026-10-03
4
18
 
5
19
  ### Changed
@@ -531,7 +531,11 @@ module Poetry
531
531
  "data-popup-open" => "multiple: the popup is open (bare while open, absent while " \
532
532
  "closed - the input carries the flip; single's trigger owns it)"
533
533
  }
534
- part "combobox-list", "THE role=listbox - the aria-controls target of both combobox roles"
534
+ part "combobox-list", "THE role=listbox - the aria-controls target of both combobox roles",
535
+ states: {
536
+ "data-empty" => "the filter pass left no visible item (engine-written; the empty " \
537
+ "part shows and the theme drops the list padding)"
538
+ }
535
539
  part "combobox-empty", "Zero-matches message - rendered hidden; the engine unhides it " \
536
540
  "when the filter pass leaves no visible items"
537
541
  part "combobox-group", "role=group labelled by its heading - hidden by the engine when " \
@@ -333,7 +333,11 @@ module Poetry
333
333
  part "command-input", "The role=combobox filter input - real focus stays pinned here " \
334
334
  "for the whole session; the highlight rides aria-activedescendant"
335
335
  part "command-list", "The role=listbox holding empty/loading/items - the input's " \
336
- "aria-controls target"
336
+ "aria-controls target",
337
+ states: {
338
+ "data-empty" => "the filter pass left no visible item (controller-written; the empty " \
339
+ "part shows at the same moment)"
340
+ }
337
341
  part "command-empty", "Zero-matches message - rendered hidden; the controller unhides " \
338
342
  "it when the filter pass leaves no visible items"
339
343
  part "command-loading", "Pending affordance (role=status) - rendered hidden; the HOST " \
@@ -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).
@@ -34,8 +34,8 @@ module Poetry
34
34
  "with_title is REQUIRED (the accessible name) - the inherited Dialog rule.",
35
35
  "direction: is the DISMISS direction: :down is the mobile bottom sheet (the default); " \
36
36
  "left/right make an edge panel - prefer Sheet on desktop.",
37
- "show_swipe_handle: true renders the grab pill - use it on bottom sheets so the " \
38
- "gesture is discoverable.",
37
+ "show_swipe_handle: true renders the grab pill on a bottom sheet (direction: :down) so the " \
38
+ "gesture is discoverable; an edge panel has no handle and raises.",
39
39
  "Esc and the backdrop still dismiss (the platform trap) - the swipe is an addition, " \
40
40
  "never the only way out.",
41
41
  "modal: false keeps the page interactive (no scrim, no focus trap) - pair a wired " \
@@ -85,7 +85,8 @@ module Poetry
85
85
  "axis derive from it."
86
86
 
87
87
  option :show_swipe_handle, :boolean, default: false,
88
- doc: "Renders the grab pill so the swipe gesture is discoverable."
88
+ doc: "Renders the grab pill so the swipe gesture is discoverable - " \
89
+ "direction: :down only; an edge panel raises."
89
90
 
90
91
  option :modal, :boolean, default: true,
91
92
  doc: "Non-modal (false) opens with show() - no top layer, no scrim, no focus trap, " \
@@ -148,6 +149,7 @@ module Poetry
148
149
  def before_render
149
150
  super
150
151
  validate_snap_points! if snap_points.present?
152
+ validate_swipe_handle! if show_swipe_handle
151
153
  end
152
154
 
153
155
  # The parent's show_close_button does not apply: a Drawer has no
@@ -185,6 +187,17 @@ module Poetry
185
187
 
186
188
  private
187
189
 
190
+ # Raises when the grab pill is asked for on an edge panel: the pill is
191
+ # the bottom sheet's horizontal grip, and an edge panel drew it as a
192
+ # bar across its top (verified bug); a direction other than :down has
193
+ # no handle, as in the source.
194
+ def validate_swipe_handle!
195
+ return if direction == :down
196
+
197
+ raise ArgumentError, "Drawer show_swipe_handle: true is the bottom sheet's grab pill - direction: :down " \
198
+ "only (an edge panel has no handle; drop the option or use direction: :down)"
199
+ end
200
+
188
201
  # Raises unless the snap points are fractions or CSS lengths on a bottom drawer.
189
202
  def validate_snap_points!
190
203
  unless direction == :down
@@ -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)
@@ -2406,6 +2406,10 @@ components:
2406
2406
  - the input carries the flip; single''s trigger owns it)'
2407
2407
  - name: combobox-list
2408
2408
  description: THE role=listbox - the aria-controls target of both combobox roles
2409
+ states:
2410
+ - attr: data-empty
2411
+ condition: the filter pass left no visible item (engine-written; the empty
2412
+ part shows and the theme drops the list padding)
2409
2413
  - name: combobox-empty
2410
2414
  description: Zero-matches message - rendered hidden; the engine unhides it when
2411
2415
  the filter pass leaves no visible items
@@ -2740,6 +2744,10 @@ components:
2740
2744
  - name: command-list
2741
2745
  description: The role=listbox holding empty/loading/items - the input's aria-controls
2742
2746
  target
2747
+ states:
2748
+ - attr: data-empty
2749
+ condition: the filter pass left no visible item (controller-written; the empty
2750
+ part shows at the same moment)
2743
2751
  - name: command-empty
2744
2752
  description: Zero-matches message - rendered hidden; the controller unhides
2745
2753
  it when the filter pass leaves no visible items
@@ -3299,10 +3307,11 @@ components:
3299
3307
  - sub_content
3300
3308
  - item_indicator
3301
3309
  - item_indicator_state
3310
+ - item_submit
3302
3311
  - indicator_check
3303
3312
  - indicator_circle
3304
3313
  - sub_indicator
3305
- capsule: 782677850eea
3314
+ capsule: cc47e5e60e90
3306
3315
  controllers:
3307
3316
  - identifier: poetry--core--context-menu
3308
3317
  targets: []
@@ -4374,7 +4383,8 @@ components:
4374
4383
  - name: show_swipe_handle
4375
4384
  type: boolean
4376
4385
  default: false
4377
- description: Renders the grab pill so the swipe gesture is discoverable.
4386
+ description: 'Renders the grab pill so the swipe gesture is discoverable - direction:
4387
+ :down only; an edge panel raises.'
4378
4388
  - name: snap_points
4379
4389
  type:
4380
4390
  description: 'Preset resting heights for a bottom sheet, ascending: fractions
@@ -4440,8 +4450,8 @@ components:
4440
4450
  - with_title is REQUIRED (the accessible name) - the inherited Dialog rule.
4441
4451
  - 'direction: is the DISMISS direction: :down is the mobile bottom sheet (the
4442
4452
  default); left/right make an edge panel - prefer Sheet on desktop.'
4443
- - 'show_swipe_handle: true renders the grab pill - use it on bottom sheets so
4444
- the gesture is discoverable.'
4453
+ - 'show_swipe_handle: true renders the grab pill on a bottom sheet (direction:
4454
+ :down) so the gesture is discoverable; an edge panel has no handle and raises.'
4445
4455
  - Esc and the backdrop still dismiss (the platform trap) - the swipe is an addition,
4446
4456
  never the only way out.
4447
4457
  - 'modal: false keeps the page interactive (no scrim, no focus trap) - pair a
@@ -4905,10 +4915,11 @@ components:
4905
4915
  - sub_content
4906
4916
  - item_indicator
4907
4917
  - item_indicator_state
4918
+ - item_submit
4908
4919
  - indicator_check
4909
4920
  - indicator_circle
4910
4921
  - sub_indicator
4911
- capsule: 7e706784fb17
4922
+ capsule: 7303732042e7
4912
4923
  controllers:
4913
4924
  - identifier: poetry--core--menu
4914
4925
  targets: []
@@ -6735,10 +6746,11 @@ components:
6735
6746
  - sub_content
6736
6747
  - item_indicator
6737
6748
  - item_indicator_state
6749
+ - item_submit
6738
6750
  - indicator_check
6739
6751
  - indicator_circle
6740
6752
  - sub_indicator
6741
- capsule: '041619b53311'
6753
+ capsule: 937cafa689af
6742
6754
  controllers:
6743
6755
  - identifier: poetry--core--menu
6744
6756
  targets: []
@@ -205,10 +205,12 @@ module Poetry
205
205
  sources
206
206
  end
207
207
 
208
- # The manifest as a hash, empty when absent.
208
+ # The manifest as a hash, empty when absent. The overrides ledger
209
+ # writes `created:` as a bare YAML date, so the load permits Date
210
+ # (the design task does the same).
209
211
  def manifest_config
210
212
  path = File.join(destination_root, MANIFEST)
211
- config = File.exist?(path) ? YAML.safe_load_file(path) : nil
213
+ config = File.exist?(path) ? YAML.safe_load_file(path, permitted_classes: [Date]) : nil
212
214
  config.is_a?(Hash) ? config : {}
213
215
  end
214
216
 
@@ -123,10 +123,12 @@ module Poetry
123
123
  end
124
124
  end
125
125
 
126
- # The components section of the manifest, empty when absent.
126
+ # The components section of the manifest, empty when absent. The
127
+ # overrides ledger beside it writes `created:` as a bare YAML date,
128
+ # so the load permits Date (the design task does the same).
127
129
  def manifest_components
128
130
  path = File.join(destination_root, MANIFEST)
129
- config = File.exist?(path) ? YAML.safe_load_file(path) : nil
131
+ config = File.exist?(path) ? YAML.safe_load_file(path, permitted_classes: [Date]) : nil
130
132
  config.is_a?(Hash) && config["components"].is_a?(Hash) ? config["components"] : {}
131
133
  end
132
134
 
@@ -3,6 +3,6 @@
3
3
  module Poetry
4
4
  module Ui
5
5
  # The gem version.
6
- VERSION = "0.1.10"
6
+ VERSION = "0.1.12"
7
7
  end
8
8
  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.10
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Solt
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-10-04 00:00:00.000000000 Z
10
+ date: 2026-10-07 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.10
18
+ version: 0.1.12
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.10
25
+ version: 0.1.12
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.'