poetry-ui 0.1.8 → 0.1.10
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/CHANGELOG.md +19 -0
- data/app/components/poetry/ui/accordion/component.html.erb +1 -1
- data/app/components/poetry/ui/alert/component.html.erb +1 -1
- data/app/components/poetry/ui/alert_dialog/component.html.erb +2 -2
- data/app/components/poetry/ui/attachment/component.html.erb +1 -1
- data/app/components/poetry/ui/autocomplete/component.html.erb +4 -4
- data/app/components/poetry/ui/breadcrumb/component.html.erb +1 -1
- data/app/components/poetry/ui/bubble/component.html.erb +2 -2
- data/app/components/poetry/ui/button/component.html.erb +1 -1
- data/app/components/poetry/ui/calendar/component.html.erb +9 -9
- data/app/components/poetry/ui/card/component.html.erb +3 -3
- data/app/components/poetry/ui/carousel/component.html.erb +3 -3
- data/app/components/poetry/ui/checkbox/component.html.erb +5 -5
- data/app/components/poetry/ui/clipboard_text/component.html.erb +4 -4
- data/app/components/poetry/ui/code_block/component.html.erb +2 -2
- data/app/components/poetry/ui/collapsible/component.html.erb +2 -2
- data/app/components/poetry/ui/combobox/component.html.erb +6 -6
- data/app/components/poetry/ui/command/component.html.erb +3 -3
- data/app/components/poetry/ui/command/dialog_component.html.erb +2 -2
- data/app/components/poetry/ui/context_menu/component.html.erb +2 -2
- data/app/components/poetry/ui/data_table/component.html.erb +5 -5
- data/app/components/poetry/ui/date_field/component.html.erb +3 -3
- data/app/components/poetry/ui/date_picker/component.html.erb +2 -2
- data/app/components/poetry/ui/deferred/component.html.erb +3 -3
- data/app/components/poetry/ui/dialog/component.html.erb +2 -2
- data/app/components/poetry/ui/drawer/component.html.erb +2 -2
- data/app/components/poetry/ui/dropdown_menu/component.html.erb +2 -2
- data/app/components/poetry/ui/empty/component.html.erb +2 -2
- data/app/components/poetry/ui/field/component.html.erb +1 -1
- data/app/components/poetry/ui/field/component.rb +1 -1
- data/app/components/poetry/ui/file_input/component.html.erb +4 -4
- data/app/components/poetry/ui/hover_card/component.html.erb +2 -2
- data/app/components/poetry/ui/input_otp/component.html.erb +3 -3
- data/app/components/poetry/ui/item/component.html.erb +1 -1
- data/app/components/poetry/ui/marker/component.html.erb +1 -1
- data/app/components/poetry/ui/menubar/component.html.erb +1 -1
- data/app/components/poetry/ui/message/component.html.erb +1 -1
- data/app/components/poetry/ui/message_scroller/component.html.erb +1 -1
- data/app/components/poetry/ui/navigation_menu/component.html.erb +5 -5
- data/app/components/poetry/ui/number_field/component.html.erb +6 -6
- data/app/components/poetry/ui/number_field/component.rb +17 -4
- data/app/components/poetry/ui/pagination/component.html.erb +1 -1
- data/app/components/poetry/ui/popover/component.html.erb +2 -2
- data/app/components/poetry/ui/questionnaire/component.html.erb +5 -5
- data/app/components/poetry/ui/radio_group/component.html.erb +1 -1
- data/app/components/poetry/ui/resizable/component.html.erb +3 -3
- data/app/components/poetry/ui/search_field/component.html.erb +5 -5
- data/app/components/poetry/ui/select/component.html.erb +3 -3
- data/app/components/poetry/ui/sensitive_input/component.html.erb +6 -6
- data/app/components/poetry/ui/sheet/component.html.erb +2 -2
- data/app/components/poetry/ui/sidebar/component.html.erb +5 -5
- data/app/components/poetry/ui/slider/component.html.erb +5 -5
- data/app/components/poetry/ui/stat/component.html.erb +1 -1
- data/app/components/poetry/ui/switch/component.html.erb +5 -5
- data/app/components/poetry/ui/table/component.html.erb +2 -2
- data/app/components/poetry/ui/tabs/component.html.erb +4 -4
- data/app/components/poetry/ui/tag_group/component.html.erb +3 -3
- data/app/components/poetry/ui/toast/component.html.erb +1 -1
- data/app/components/poetry/ui/toaster/component.html.erb +1 -1
- data/app/components/poetry/ui/toggle_group/component.html.erb +1 -1
- data/app/components/poetry/ui/tooltip/component.html.erb +3 -3
- data/app/components/poetry/ui/tree/component.html.erb +3 -3
- data/app/helpers/poetry/ui/components_helper.rb +1 -1
- data/lib/generators/poetry/agents_section.rb +3 -1
- data/lib/generators/poetry/editor/editor_generator.rb +8 -12
- data/lib/generators/poetry/install/install_generator.rb +19 -3
- data/lib/generators/poetry/skill/templates/poetry-component/references/checklist.md +6 -0
- data/lib/poetry/ui/version.rb +1 -1
- data/lib/tasks/poetry/check.rake +21 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f60faf3ae8c314214dbe7a6052706f040c96800a4e9363fab8ee19cdf842fae6
|
|
4
|
+
data.tar.gz: c0caf8a9092a95a0147ab53b21a7c5a348fbdc13c0a28a474ad75b9329464a17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 704bd7a648f2654330edead8350e7be448cc91f4091cc4acadc6f77611bc31cba634df50ed004369382eb8e4f496c63110f7d6e009515579a3aa11b1e87d8b6d
|
|
7
|
+
data.tar.gz: e52dfa3187348ca3a446cd2da4b349c70a1519586b555c183f0c99702eb0b026612bcb45ca69220533f8dcf33c5ecad57c89aa2fc3f5493974da8b5ab5d8d16f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.10] - 2026-10-03
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Version bump with the family; no changes in this gem.
|
|
8
|
+
|
|
9
|
+
## [0.1.9] - 2026-09-30
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- `bin/rails poetry:check` compiles the templates that sit beside components, which `bin/rails herb:check` never reaches: the app's own under `app/components/`, and the ones the gems in the boot ship. A template Herb refuses is a `herb-compile` finding, an error when the app renders through Herb (Rails' 8.2 defaults, or ReActionView) and a warning until then. A finding on a template a gem ships names what fixes it: the gem, or the herb the bundle resolves. A herb older than 0.11.0 leaves the compile out and says so on stderr, and the rest of the check runs as before.
|
|
14
|
+
- `rails g poetry:install` adds no `herb` line when Action View depends on the gem, as it does from Rails 8.2, and says where the parser comes from. On an earlier Rails it adds the line as before, and a `herb` the Gemfile declares is left alone on either.
|
|
15
|
+
- `rails g poetry:editor` writes a `.herb.yml` pinned to Herb 0.11.0. The two rules it used to switch off for slot setters (`erb-no-unused-expressions`, `actionview-no-silent-helper`) are fixed in 0.11 and stay on. One rule starts off instead: `html-no-nested-forms` reports a form inside a block helper, a `form_with` inside `poetry_card do`, as a form nested in another form. An existing `.herb.yml` is kept as it is; move its `version` to 0.11.0 and drop the two entries to get the same.
|
|
16
|
+
- Every component template builds its elements through `element_tag` and hands `tag.attributes` its hash as an argument, never as a splat. A component now renders the same in a host that compiles its templates with Herb's slots (ReActionView's `config.slots`) as in one that does not; before, such a host rendered most components without their root attributes and could not compile Button, Marker or Item at all. What a component renders without slots is unchanged, byte for byte: the suite, the behaviour tier and the 455 visual baselines hold.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- NumberField with `format:` renders on Rails 8.2, and through the renderer on any Rails. Rails reads `format` off what it renders and takes the answer for the format of the template. The option's reader answered with its Hash, so the render raised `Invalid formats`. A render from a controller asked already; from Rails 8.2 a render in a view asks too, which is every `poetry_number_field(format: ...)`. The option keeps its name and the component leaves Rails with its default.
|
|
21
|
+
|
|
3
22
|
## [0.1.8] - 2026-09-22
|
|
4
23
|
|
|
5
24
|
The robosite proof: a full Jumpstart Pro application re-skinned on Poetry surfaced 28 findings; the 20 that were Poetry's to fix land here, with the form builder taking most of them.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= icon %>
|
|
3
3
|
<% if title? %><div data-slot="alert-title" class="<%= css(:title) %>"><%= title %></div><% end %>
|
|
4
4
|
<div data-slot="alert-description" class="<%= css(:description) %>"><%= content %></div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:dialog, **dialog_attributes) do %>
|
|
4
4
|
<div data-slot="alert-dialog-header" class="<%= header_classes %>">
|
|
5
5
|
<% if media? %>
|
|
6
6
|
<div data-slot="alert-dialog-media" class="<%= media_classes %>"><%= media %></div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<%=
|
|
2
|
-
<%=
|
|
3
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
|
+
<%= element_tag(:input, **input_attributes, class: Poetry::Ui::Input::Style.css) %>
|
|
3
|
+
<%= element_tag(:div, **content_attributes) do %>
|
|
4
4
|
<div data-slot="autocomplete-list" role="listbox" id="<%= list_id %>"
|
|
5
5
|
class="<%= Poetry::Ui::Command::Style.css(:list) %>"
|
|
6
6
|
<%= tag.attributes(stimulus_attributes_for(:list)) %>>
|
|
7
7
|
<% item_models.each_with_index do |item, index| %>
|
|
8
|
-
<%=
|
|
8
|
+
<%= element_tag(:div, **item_attributes(item, index)) do %>
|
|
9
9
|
<span><%= item.label %></span>
|
|
10
10
|
<% end %>
|
|
11
11
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(root_tag, **root_attributes) do %>
|
|
2
2
|
<% if loading %>
|
|
3
3
|
<span data-slot="spinner" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56" /></svg></span>
|
|
4
4
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<div data-slot="calendar-nav" class="<%= css(:nav) %>">
|
|
3
3
|
<%= render Poetry::Ui::Button::Component.new(**previous_options) do |button| %>
|
|
4
4
|
<% button.with_leading { render Poetry::Ui::Icon::Component.new(name: :"chevron-left") } %>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<% { "month" => [month_options, @month.month, t("poetry.calendar.month"), month_names_list[@month.month - 1]],
|
|
14
14
|
"year" => [year_options, @month.year, t("poetry.calendar.year"), @month.year.to_s] }.each do |unit, (options, current, label, text)| %>
|
|
15
15
|
<span data-slot="calendar-dropdown" data-calendar-unit="<%= unit %>" class="<%= css(:dropdown_root) %>"
|
|
16
|
-
<%= tag.attributes(
|
|
16
|
+
<%= tag.attributes(stimulus_attributes_for(:dropdown)) %>>
|
|
17
17
|
<span data-slot="calendar-caption-label" aria-hidden="true" class="<%= css(:dropdown_label) %>">
|
|
18
18
|
<span data-slot="calendar-dropdown-value"><%= text %></span>
|
|
19
19
|
<%= render Poetry::Ui::Icon::Component.new(name: :"chevron-down") %>
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
<% end %>
|
|
28
28
|
</div>
|
|
29
29
|
<% else %>
|
|
30
|
-
<div data-slot="calendar-caption" class="<%= css(:caption) %>" <%= tag.attributes(
|
|
30
|
+
<div data-slot="calendar-caption" class="<%= css(:caption) %>" <%= tag.attributes(stimulus_attributes_for(:caption)) %>><%= caption %></div>
|
|
31
31
|
<% end %>
|
|
32
32
|
<%= render Poetry::Ui::Button::Component.new(**next_options) do |button| %>
|
|
33
33
|
<% button.with_leading { render Poetry::Ui::Icon::Component.new(name: :"chevron-right") } %>
|
|
34
34
|
<% end %>
|
|
35
35
|
</div>
|
|
36
36
|
<div role="grid" data-slot="calendar-grid" class="<%= css(:grid) %>"
|
|
37
|
-
<%= tag.attributes(
|
|
37
|
+
<%= tag.attributes(stimulus_attributes_for(:grid)) %>>
|
|
38
38
|
<div role="row" data-slot="calendar-weekdays" class="<%= css(:weekdays) %>">
|
|
39
39
|
<% if week_numbers %>
|
|
40
40
|
<div role="columnheader" data-slot="calendar-week-number" class="<%= css(:weekday) %>"><span class="sr-only">Week</span></div>
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
<div role="rowheader" data-slot="calendar-week-number" class="<%= css(:weekday) %>"><%= iso_week(week) %></div>
|
|
50
50
|
<% end %>
|
|
51
51
|
<% week.each do |date| %>
|
|
52
|
-
<%=
|
|
53
|
-
<%=
|
|
52
|
+
<%= element_tag(:div, cell_attributes(date)) do %>
|
|
53
|
+
<%= element_tag(:button, day_attributes(date)) do %>
|
|
54
54
|
<span data-slot="calendar-day-label"><%= date.day %></span>
|
|
55
55
|
<% end %>
|
|
56
56
|
<% end %>
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
<% if name.present? %>
|
|
62
62
|
<% if range? %>
|
|
63
63
|
<input type="hidden" name="<%= name %>[start]" value="<%= range_start&.iso8601 %>"
|
|
64
|
-
<%= tag.attributes(
|
|
64
|
+
<%= tag.attributes(stimulus_attributes_for(:start_input)) %>>
|
|
65
65
|
<input type="hidden" name="<%= name %>[end]" value="<%= range_end&.iso8601 %>"
|
|
66
|
-
<%= tag.attributes(
|
|
66
|
+
<%= tag.attributes(stimulus_attributes_for(:end_input)) %>>
|
|
67
67
|
<% else %>
|
|
68
68
|
<input type="hidden" name="<%= name %>" value="<%= selected&.iso8601 %>"
|
|
69
|
-
<%= tag.attributes(
|
|
69
|
+
<%= tag.attributes(stimulus_attributes_for(:hidden_input)) %>>
|
|
70
70
|
<% end %>
|
|
71
71
|
<% end %>
|
|
72
72
|
<% end %>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<% if header? %>
|
|
3
3
|
<div data-slot="card-header" class="<%= css(:header, class: header_class) %>">
|
|
4
|
-
<% if title? %><%=
|
|
4
|
+
<% if title? %><%= element_tag(title_tag, title, "data-slot" => "card-title", class: css(:title)) %><% end %>
|
|
5
5
|
<% if description? %><div data-slot="card-description" class="<%= css(:description) %>"><%= description %></div><% end %>
|
|
6
6
|
<% if action? %><div data-slot="card-action" class="<%= css(:action) %>"><%= action %></div><% end %>
|
|
7
7
|
</div>
|
|
8
8
|
<% end %>
|
|
9
9
|
<% if content.present? %><div data-slot="card-content" class="<%= css(:content, class: content_class) %>"><%= content %></div><% end %>
|
|
10
|
-
<% if footer? %><%=
|
|
10
|
+
<% if footer? %><%= element_tag(:div, footer_attributes) do %><%= capture(&footer_block) if footer_block %><% end %><% end %>
|
|
11
11
|
<% end %>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<%=
|
|
2
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
|
+
<%= element_tag(:div, viewport_attributes) do %>
|
|
3
3
|
<div class="<%= css(:track, class: [css(vertical? ? :track_vertical : :track_horizontal), track_classes].compact) %>">
|
|
4
4
|
<% slides.each do |slide| %>
|
|
5
|
-
<%=
|
|
5
|
+
<%= element_tag(:div, capture(&slide.block), item_attributes(slide)) %>
|
|
6
6
|
<% end %>
|
|
7
7
|
</div>
|
|
8
8
|
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# Fragment - button + input(s) as SIBLINGS, no wrapper: the source's
|
|
2
2
|
`peer` class contract (labels style via peer-*) breaks if poetry wraps.
|
|
3
3
|
The controller lives on the button; the input resolves by stable id. %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= element_tag(:button, **root_attributes) do %>
|
|
5
5
|
<span data-slot="checkbox-indicator" <% if indeterminate? %>data-indeterminate=""<% elsif checked? %>data-checked=""<% else %>data-unchecked=""<% end %> aria-hidden="true" class="<%= css(:indicator) %>">
|
|
6
6
|
<%# MinusIcon on indeterminate is a POETRY ADDITION (shadcn renders a
|
|
7
7
|
check for mixed state - a real gap). %>
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
<%# Rails parity hidden FIRST (last-wins ordering, Tags::CheckBox-exact)
|
|
13
13
|
so unchecked SUBMITS unchecked_value; disabled fields submit nothing. %>
|
|
14
14
|
<% if unchecked_value %>
|
|
15
|
-
<%=
|
|
15
|
+
<%= element_tag(:input, type: "hidden", name: name, value: unchecked_value, disabled: disabled) %>
|
|
16
16
|
<% end %>
|
|
17
17
|
<%# THE form participant + the store: input.indeterminate is a JS-only
|
|
18
18
|
property - the controller derives it from the checked attributes on connect. %>
|
|
19
|
-
<%=
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<%= element_tag(:input, type: "checkbox", id: input_id, name: name, value: value, checked: checked?,
|
|
20
|
+
disabled: disabled, "data-slot": "checkbox-input", "aria-hidden": true,
|
|
21
|
+
tabindex: "-1", class: css(:input)) %>
|
|
22
22
|
<% end %>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<%# InputGroup anatomy: the readonly mono control, trailing copy
|
|
2
2
|
affordance with stacked copy/check glyphs swapping on data-copied. %>
|
|
3
|
-
<%=
|
|
4
|
-
<%=
|
|
5
|
-
<%=
|
|
6
|
-
<%=
|
|
3
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
4
|
+
<%= element_tag(:div, **group_attributes) do %>
|
|
5
|
+
<%= element_tag(:input, **input_attributes) %>
|
|
6
|
+
<%= element_tag(:div, **addon_attributes) do %>
|
|
7
7
|
<%= render copy_button do %>
|
|
8
8
|
<span class="<%= css(:icon_stack) %>">
|
|
9
9
|
<%= render Poetry::Ui::Icon::Component.new(name: :copy, class: css(:icon_copy)) %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# The pre/code nesting stays on one line - literal template whitespace
|
|
2
2
|
inside <pre> would render. %>
|
|
3
|
-
<%=
|
|
4
|
-
<%=
|
|
3
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
4
|
+
<%= element_tag(:pre, element_tag(:code, highlighted || code, **code_attributes), **pre_attributes) %>
|
|
5
5
|
<% if copy %>
|
|
6
6
|
<%= render copy_button do %>
|
|
7
7
|
<span class="<%= css(:icon_stack) %>">
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<% list_body = capture do %>
|
|
8
8
|
<% items.each do |item| %><%= item %><% end %>
|
|
9
9
|
<% end %>
|
|
10
|
-
<%=
|
|
10
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
11
11
|
<%= native_select %>
|
|
12
12
|
<% if show_clear %>
|
|
13
13
|
<%# The clear anchor shrink-wraps the trigger (the root is full-width
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
<% else %>
|
|
18
18
|
<%= multiple ? chips_frame : trigger_button %>
|
|
19
19
|
<% end %>
|
|
20
|
-
<%=
|
|
20
|
+
<%= element_tag(:div, **content_attributes) do %>
|
|
21
21
|
<% if multiple %>
|
|
22
22
|
<%# MULTIPLE: the popup holds ONLY the listbox (the input lives
|
|
23
23
|
inline in the chips frame; the command engine rides the ROOT so
|
|
24
24
|
it scopes over both - no command part in here). %>
|
|
25
|
-
<%=
|
|
25
|
+
<%= element_tag(:div, **list_attributes) do %>
|
|
26
26
|
<%= empty_part %>
|
|
27
27
|
<%= loading_part %>
|
|
28
28
|
<%= list_body %>
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
<%# The EMBEDDED Command anatomy (Command::Style + the engine
|
|
33
33
|
controller reused verbatim; chrome flattened - rounded/border ride
|
|
34
34
|
the content). %>
|
|
35
|
-
<%=
|
|
35
|
+
<%= element_tag(:div, **command_attributes) do %>
|
|
36
36
|
<div data-slot="combobox-input-wrapper" class="<%= Poetry::Ui::Command::Style.css(:input_wrapper) %>">
|
|
37
37
|
<span data-slot="combobox-search-icon"><%= render(Poetry::Ui::Icon::Component.new(name: :search, class: Poetry::Ui::Command::Style.css(:search_icon))) %></span>
|
|
38
|
-
<%=
|
|
38
|
+
<%= element_tag(:input, **input_attributes) %>
|
|
39
39
|
</div>
|
|
40
|
-
<%=
|
|
40
|
+
<%= element_tag(:div, **list_attributes) do %>
|
|
41
41
|
<%= empty_part %>
|
|
42
42
|
<%= loading_part %>
|
|
43
43
|
<%= list_body %>
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
<% list_body = capture do %>
|
|
6
6
|
<% items.each do |item| %><%= item %><% end %>
|
|
7
7
|
<% end %>
|
|
8
|
-
<%=
|
|
8
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
9
9
|
<div data-slot="command-input-wrapper" class="<%= css(:input_wrapper) %>">
|
|
10
10
|
<span data-slot="command-search-icon"><%= render(Poetry::Ui::Icon::Component.new(name: :search, class: css(:search_icon))) %></span>
|
|
11
|
-
<%=
|
|
11
|
+
<%= element_tag(:input, **input_attributes) %>
|
|
12
12
|
<%= input_trailing_html %>
|
|
13
13
|
</div>
|
|
14
|
-
<%=
|
|
14
|
+
<%= element_tag(:div, **list_attributes) do %>
|
|
15
15
|
<%= empty_part %>
|
|
16
16
|
<%= loading_part %>
|
|
17
17
|
<%= list_body %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:dialog, **dialog_attributes) do %>
|
|
4
4
|
<%# sr-only header (source-exact): the dialog stays labelled/described
|
|
5
5
|
while the palette owns the visible surface. %>
|
|
6
6
|
<div data-slot="dialog-header" class="sr-only">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:div, **content_attributes) do %>
|
|
4
4
|
<% items.each do |item| %><%= item %><% end %>
|
|
5
5
|
<% end %>
|
|
6
6
|
<% end %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<% surface = capture do %>
|
|
2
|
-
<%=
|
|
2
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
3
3
|
<% if filter %>
|
|
4
4
|
<div data-slot="data-table-toolbar" class="<%= css(:toolbar) %>">
|
|
5
5
|
<form method="get" action="<%= filter_form_action %>" role="search" aria-label="<%= filter_label %>" data-slot="data-table-filter">
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
<tr data-slot="table-row" class="<%= Poetry::Ui::Table::Style.css(:row) %>">
|
|
24
24
|
<% if selectable? %>
|
|
25
25
|
<th data-slot="table-head" class="<%= Poetry::Ui::Table::Style.css(:head) %> <%= css(:select_cell) %>">
|
|
26
|
-
<%=
|
|
26
|
+
<%= element_tag(:input, **select_all_attributes) %>
|
|
27
27
|
</th>
|
|
28
28
|
<% end %>
|
|
29
29
|
<% column_defs.each do |column| %>
|
|
30
|
-
<%=
|
|
30
|
+
<%= element_tag(:th, head_attributes(column)) do %>
|
|
31
31
|
<% if column.sortable %>
|
|
32
32
|
<%= render Poetry::Ui::Button::Component.new(**sort_link_options(column)) do |button| %>
|
|
33
33
|
<% button.with_trailing { render Poetry::Ui::Icon::Component.new(name: sort_icon(column)) } %>
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
<tr data-slot="table-row" class="<%= Poetry::Ui::Table::Style.css(:row) %>">
|
|
47
47
|
<% if selectable? %>
|
|
48
48
|
<td data-slot="table-cell" class="<%= Poetry::Ui::Table::Style.css(:cell) %> <%= css(:select_cell) %>">
|
|
49
|
-
<%=
|
|
49
|
+
<%= element_tag(:input, **select_row_attributes(row)) %>
|
|
50
50
|
</td>
|
|
51
51
|
<% end %>
|
|
52
52
|
<% column_defs.each do |column| %>
|
|
53
|
-
<%=
|
|
53
|
+
<%= element_tag(:td, column.cell.call(row), cell_attributes(column)) %>
|
|
54
54
|
<% end %>
|
|
55
55
|
</tr>
|
|
56
56
|
<% end %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%# Progressive enhancement: the native input is the visible control (and
|
|
2
2
|
the form value) until the controller builds segments into the group
|
|
3
3
|
and hides it from the tab order. %>
|
|
4
|
-
<%=
|
|
5
|
-
<%=
|
|
6
|
-
<%=
|
|
4
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
5
|
+
<%= element_tag(:span, "", **group_attributes) %>
|
|
6
|
+
<%= element_tag(:input, **input_attributes) %>
|
|
7
7
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<% if input_variant? %>
|
|
3
3
|
<%= render Poetry::Ui::InputGroup::Component.new do %>
|
|
4
4
|
<%= helpers.poetry_input_group_input(**input_attributes.symbolize_keys) %>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<%= render Poetry::Ui::Popover::Component.new(**popover_options) do |popover| %>
|
|
16
16
|
<% popover.with_trigger(**trigger_options) do %>
|
|
17
17
|
<%= render Poetry::Ui::Icon::Component.new(name: :calendar) %>
|
|
18
|
-
<span class="min-w-0 truncate" <%= tag.attributes(
|
|
18
|
+
<span class="min-w-0 truncate" <%= tag.attributes(label_target_attributes) %>><%= formatted %></span>
|
|
19
19
|
<% end %>
|
|
20
20
|
<%= render Poetry::Ui::Calendar::Component.new(**calendar_options) %>
|
|
21
21
|
<% end %>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<%=
|
|
2
|
-
<div <%= tag.attributes(
|
|
1
|
+
<%= element_tag(:"turbo-frame", **root_attributes) do %>
|
|
2
|
+
<div <%= tag.attributes(stimulus_attributes_for(:placeholder)) %>>
|
|
3
3
|
<%= content.presence || render(Poetry::Ui::Skeleton::Component.new(class: "h-24 w-full")) %>
|
|
4
4
|
</div>
|
|
5
|
-
<template <%= tag.attributes(
|
|
5
|
+
<template <%= tag.attributes(stimulus_attributes_for(:error_template)) %>>
|
|
6
6
|
<div data-slot="deferred-error" class="flex flex-col items-start gap-2">
|
|
7
7
|
<p class="text-sm text-destructive"><%= t("poetry.deferred.failed") %></p>
|
|
8
8
|
<%= render(Poetry::Ui::Button::Component.new(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:dialog, **dialog_attributes) do %>
|
|
4
4
|
<div data-slot="dialog-header" class="<%= css(:header) %>">
|
|
5
5
|
<h2 id="<%= title_id %>" data-slot="dialog-title" class="<%= css(:title) %>"><%= title %></h2>
|
|
6
6
|
<% if description? %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:dialog, **dialog_attributes) do %>
|
|
4
4
|
<% if show_swipe_handle %>
|
|
5
5
|
<div data-slot="drawer-swipe-handle" aria-hidden="true" class="<%= css(:handle) %>"></div>
|
|
6
6
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:div, **content_attributes) do %>
|
|
4
4
|
<% items.each do |item| %><%= item %><% end %>
|
|
5
5
|
<% end %>
|
|
6
6
|
<% end %>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<% if header? %>
|
|
3
3
|
<div data-slot="empty-header" class="<%= css(:header) %>">
|
|
4
4
|
<% if media? %><div data-slot="empty-icon" data-variant="<%= media_variant %>" class="<%= media_classes %>"><%= media %></div><% end %>
|
|
5
|
-
<% if title? %><%=
|
|
5
|
+
<% if title? %><%= element_tag(title_tag, title, "data-slot" => "empty-title", class: css(:title)) %><% end %>
|
|
6
6
|
<% if description? %><div data-slot="empty-description" class="<%= css(:description) %>"><%= description %></div><% end %>
|
|
7
7
|
</div>
|
|
8
8
|
<% end %>
|
|
@@ -15,7 +15,7 @@ module Poetry
|
|
|
15
15
|
# render Poetry::Ui::Field::Component.new(
|
|
16
16
|
# id: "email", label_text: "Email", hint: "We never share it."
|
|
17
17
|
# ) do |field|
|
|
18
|
-
#
|
|
18
|
+
# element_tag(:input, type: "email", name: "email", **field.control_attributes)
|
|
19
19
|
# end
|
|
20
20
|
class Component < Poetry::Core::Component
|
|
21
21
|
# The closed vocabulary for the orientation axis.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<% if variant == :input %>
|
|
2
2
|
<%= render input_variant_component %>
|
|
3
3
|
<% else %>
|
|
4
|
-
<%=
|
|
5
|
-
<%=
|
|
4
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
5
|
+
<%= element_tag(:label, dropzone_attributes) do %>
|
|
6
6
|
<%= tag(:input, control_attributes) %>
|
|
7
7
|
<%= render Poetry::Ui::Icon::Component.new(name: :upload, class: css(:icon)) %>
|
|
8
8
|
<span data-slot="file-input-prompt" class="<%= css(:prompt) %>"><%= prompt_text %></span>
|
|
9
9
|
<% if hint.present? %><span data-slot="file-input-hint" class="<%= css(:hint) %>"><%= hint %></span><% end %>
|
|
10
10
|
<% end %>
|
|
11
|
-
<%=
|
|
12
|
-
<%=
|
|
11
|
+
<%= element_tag(:ul, "", list_attributes) %>
|
|
12
|
+
<%= element_tag(:button, t("poetry.file_input.clear"), clear_attributes) %>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% end %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<%= trigger %>
|
|
3
|
-
<%=
|
|
3
|
+
<%= element_tag(:div, **content_attributes) do %>
|
|
4
4
|
<%= defer ? render(Poetry::Ui::Deferred::Component.new(src: defer)) { content } : content %>
|
|
5
5
|
<% end %>
|
|
6
6
|
<% end %>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
caret element hides server-side - it exists only for the active EMPTY
|
|
4
4
|
cell under JS. Cells count from 0 across groups (slot order == string
|
|
5
5
|
index order; the row is dir=ltr). %>
|
|
6
|
-
<%=
|
|
7
|
-
<%=
|
|
6
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
7
|
+
<%= element_tag(:input, **input_attributes) %>
|
|
8
8
|
<% cell = -1 %>
|
|
9
9
|
<% group_sizes.each_with_index do |group_size, group_index| %>
|
|
10
10
|
<div data-slot="input-otp-group" aria-hidden="true" class="<%= css(:group) %>">
|
|
11
11
|
<% group_size.times do %>
|
|
12
12
|
<% cell += 1 %>
|
|
13
|
-
<%=
|
|
13
|
+
<%= element_tag(:div, **slot_attributes(cell)) do %><%= char_at(cell) %><div data-slot="input-otp-caret" hidden class="<%= css(:caret) %>"><div class="<%= css(:caret_bar) %>"></div></div><% end %>
|
|
14
14
|
<% end %>
|
|
15
15
|
</div>
|
|
16
16
|
<% if separator && group_index < group_sizes.size - 1 %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(tag, **root_attributes) do %>
|
|
2
2
|
<% if header? %><div data-slot="item-header" class="<%= css(:header) %>"><%= header %></div><% end %>
|
|
3
3
|
<% if media? %><div data-slot="item-media" data-variant="<%= media_variant %>" class="<%= media_classes %>"><%= media %></div><% end %>
|
|
4
4
|
<% if content_column? %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(tag, **root_attributes) do %>
|
|
2
2
|
<% if icon? %><span data-slot="marker-icon" aria-hidden="true" class="<%= css(:icon) %>"><%= icon %></span><% end %>
|
|
3
3
|
<span data-slot="marker-content" class="<%= css(:content) %>"><%= content %></span>
|
|
4
4
|
<% end %>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:div, **root_attributes) do %>
|
|
2
2
|
<% if avatar? %><div data-slot="message-avatar" class="<%= css(:avatar) %>"><%= avatar %></div><% end %>
|
|
3
3
|
<div data-slot="message-content" class="<%= css(:content) %>">
|
|
4
4
|
<% if header? %><div data-slot="message-header" class="<%= css(:header) %>"><%= header %></div><% end %>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<%=
|
|
1
|
+
<%= element_tag(:nav, **root_attributes) do %>
|
|
2
2
|
<div data-slot="navigation-menu-list" class="<%= css(:list) %>">
|
|
3
3
|
<% entries.each do |entry| %>
|
|
4
|
-
<%=
|
|
4
|
+
<%= element_tag(:div, item_attributes(entry)) do %>
|
|
5
5
|
<% if entry.panel %>
|
|
6
|
-
<%=
|
|
6
|
+
<%= element_tag(:button, trigger_attributes(entry)) do %>
|
|
7
7
|
<%= entry.title %>
|
|
8
8
|
<%= render Poetry::Ui::Icon::Component.new(name: :"chevron-down",
|
|
9
9
|
class: css(:chevron), "aria-hidden": "true") %>
|
|
10
10
|
<% end %>
|
|
11
|
-
<%=
|
|
11
|
+
<%= element_tag(:div, capture(&entry.panel), panel_attributes(entry)) %>
|
|
12
12
|
<% else %>
|
|
13
13
|
<a href="<%= entry.href %>" data-slot="navigation-menu-link" class="<%= css(:trigger) %> data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted" <%= tag.attributes(active_attributes(entry)) %>><%= entry.title %></a>
|
|
14
14
|
<% end %>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
</div>
|
|
18
18
|
<% if viewport %>
|
|
19
|
-
<%=
|
|
19
|
+
<%= element_tag(:div, positioner_attributes) do %>
|
|
20
20
|
<div data-slot="navigation-menu-popup" data-closed class="<%= css(:popup) %>">
|
|
21
21
|
<div data-slot="navigation-menu-viewport" class="<%= css(:viewport_shell) %>"></div>
|
|
22
22
|
</div>
|