stimulus_plumbers 0.4.11 → 0.4.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +31 -9
  4. data/app/assets/javascripts/stimulus-plumbers/index.es.js +87 -96
  5. data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
  6. data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
  7. data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
  8. data/config/locales/en.yml +1 -0
  9. data/docs/architecture.md +1 -1
  10. data/docs/component/form.md +42 -20
  11. data/docs/component/icon.md +9 -9
  12. data/docs/guide.md +2 -1
  13. data/lib/stimulus_plumbers/components/button/icon_layout.rb +34 -0
  14. data/lib/stimulus_plumbers/components/button.rb +2 -23
  15. data/lib/stimulus_plumbers/components/card.rb +1 -1
  16. data/lib/stimulus_plumbers/components/combobox/builder.rb +52 -14
  17. data/lib/stimulus_plumbers/components/combobox/date.rb +35 -9
  18. data/lib/stimulus_plumbers/components/combobox/dropdown.rb +22 -6
  19. data/lib/stimulus_plumbers/components/combobox/time.rb +18 -5
  20. data/lib/stimulus_plumbers/components/combobox/trigger.rb +1 -1
  21. data/lib/stimulus_plumbers/components/combobox/typeahead.rb +23 -8
  22. data/lib/stimulus_plumbers/components/icon.rb +5 -3
  23. data/lib/stimulus_plumbers/components/indicator.rb +3 -1
  24. data/lib/stimulus_plumbers/components/link.rb +1 -1
  25. data/lib/stimulus_plumbers/components/list/item.rb +1 -1
  26. data/lib/stimulus_plumbers/components/ordered_list/item.rb +2 -2
  27. data/lib/stimulus_plumbers/components/popover.rb +7 -3
  28. data/lib/stimulus_plumbers/components/progress_bar.rb +3 -1
  29. data/lib/stimulus_plumbers/components/progress_meter.rb +3 -1
  30. data/lib/stimulus_plumbers/components/progress_ring.rb +4 -2
  31. data/lib/stimulus_plumbers/components/timeline/event.rb +5 -3
  32. data/lib/stimulus_plumbers/form/field.rb +4 -2
  33. data/lib/stimulus_plumbers/form/fields/inputs/code.rb +93 -32
  34. data/lib/stimulus_plumbers/form/fields/inputs/credit_card.rb +61 -33
  35. data/lib/stimulus_plumbers/form/fields/inputs/password.rb +37 -12
  36. data/lib/stimulus_plumbers/form/fields/inputs/search.rb +1 -1
  37. data/lib/stimulus_plumbers/form/fields/inputs/submit.rb +52 -7
  38. data/lib/stimulus_plumbers/generators/css_entrypoint.rb +10 -0
  39. data/lib/stimulus_plumbers/helpers/icon_helper.rb +2 -2
  40. data/lib/stimulus_plumbers/plumber/dispatcher.rb +14 -12
  41. data/lib/stimulus_plumbers/plumber/slots.rb +8 -8
  42. data/lib/stimulus_plumbers/themes/schema.rb +4 -0
  43. data/lib/stimulus_plumbers/version.rb +1 -1
  44. data/lib/stimulus_plumbers.rb +1 -0
  45. data/vendor/ARIA.md +3 -2
  46. data/vendor/component/manifest.json +8 -1
  47. data/vendor/controller/docs/input-formatter.md +18 -39
  48. data/vendor/controller/docs/input-revealable.md +65 -0
  49. data/vendor/controller/manifest.json +31 -9
  50. metadata +3 -1
@@ -27,5 +27,6 @@ en:
27
27
  form:
28
28
  password:
29
29
  show: "Show password"
30
+ hide: "Hide password"
30
31
  search:
31
32
  clear: "Clear search"
data/docs/architecture.md CHANGED
@@ -26,6 +26,6 @@ Validation ranges for theme schema params live under `lib/stimulus_plumbers/them
26
26
 
27
27
  `Button#build_button` and `Link#build_content` always wrap non-nil text/block content in `<span>`. When content is nil and no block is given (icon-only), no `<span>` is rendered.
28
28
 
29
- The active theme uses `:has(> span)` / `:not(:has(> span))` CSS to distinguish icon-only from text buttons without any Ruby flag.
29
+ The active theme uses `:has(> span)` / `:not(:has(> span))` CSS to distinguish icon-only from text buttons without any Ruby flag. Submit buttons with visually hidden text additionally use `:has(> span[data-sp-label-hidden])` so they retain the icon-only square layout while keeping an accessible name.
30
30
 
31
31
  **Do not change this contract** without updating `stimulus-plumbers-tailwind`'s `Button::LAYOUT` and `Link::BUTTON` constants accordingly. See [tailwind architecture doc](../../stimulus-plumbers-tailwind/docs/architecture.md#icon-only-square-pattern).
@@ -52,9 +52,28 @@ Special options on native helpers:
52
52
 
53
53
  | Helper | Option | Effect |
54
54
  | ---------------- | ------------------ | ------------------------------------------------------------------ |
55
- | `password_field` | `revealable: true` | Wraps input in an `input-formatter` reveal controller |
55
+ | `password_field` | `revealable: true` | Wraps input in an `input-revealable` controller |
56
56
  | `search_field` | `clearable: true` | Wraps input in an `input-clearable` controller with a clear button |
57
57
 
58
+ ### f.submit
59
+
60
+ `f.submit` renders a themed `<button type="submit">` without a field wrapper.
61
+
62
+ ```erb
63
+ <%= f.submit "Save" %>
64
+ <%= f.submit "Save", icon_leading: "save" %>
65
+ <%= f.submit "Continue", icon_trailing: "arrow-right" %>
66
+ <%= f.submit "Save", icon_leading: "save", hide_label: true %>
67
+ ```
68
+
69
+ | Option | Description |
70
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
71
+ | `type:` / `variant:` | Button theme type and variant. |
72
+ | `icon_leading:` / `icon_trailing:` | Decorative icon name placed before or after the submit text. |
73
+ | `hide_label: true` | Visually hides the button's own text span while keeping it available to screen readers. This differs from `Form::Field#hide_label`, which hides an associated `<label>` element. |
74
+
75
+ Submit buttons need an accessible name: pass non-blank text, or an `aria` label such as `aria: { label: "Save changes" }`.
76
+
58
77
  ---
59
78
 
60
79
  ## Level 2 — Full-field helpers
@@ -141,31 +160,34 @@ Use `f.select` for a native `<select>`.
141
160
 
142
161
  Use `f.search_field` for a native `<input type="search">`.
143
162
 
144
- **Password** (`as: :password`) — reveal-toggle wrapper backed by `input-formatter`.
163
+ **Password** (`as: :password`) — reveal-toggle wrapper backed by `input-revealable`.
145
164
 
146
- | Option | Values | Default | Description |
147
- | ------------ | ------- | ------- | ------------------------------------------- |
148
- | `revealable` | Boolean | `false` | Adds a show/hide toggle button on the input |
165
+ | Option | Values | Default | Description |
166
+ | -------------- | ------- | -------------------- | ------------------------------------------- |
167
+ | `revealable` | Boolean | `false` | Adds a show/hide toggle button on the input |
168
+ | `autocomplete` | String | `"current-password"` | Native autocomplete value |
149
169
 
150
170
  Use `f.password_field` for a plain `<input type="password">` (also accepts `revealable:`).
151
171
 
152
172
  **Code** (`as: :code`) — character-cell entry backed by `input-formatter` and the `character-cells` plumber. The native input remains the accessible control; cells are decorative.
153
173
 
154
- | Option | Values | Default | Description |
155
- | -------------- | ---------------------------------------- | ---------------------- | ------------------------------------------- |
156
- | `length` | positive Integer | required | Number of cells and input maximum length |
157
- | `charset` | `:digits` / `:letters` / `:alphanumeric` | `:digits` | Allowed code characters |
158
- | `groups` | Array of positive Integers | `[]` | Visual cell groups; must add up to `length` |
159
- | `autocomplete` | String | `"one-time-code"` | Native autocomplete value |
160
- | `inputmode` | String | `"numeric"` for digits | Native input mode |
161
-
162
- **Credit card** (`as: :credit_card`) — grouped card-number entry backed by `input-formatter` and the `character-cells` plumber (grouped mode). Renders one cell per group with a literal dash separator between cells; their sum sets `maxlength`.
163
-
164
- | Option | Values | Default | Description |
165
- | -------------- | -------------------------- | -------------- | ---------------------------------------------------------------------------- |
166
- | `groups` | Array of positive Integers | `[4, 4, 4, 4]` | Cell groups — one cell per group, dash-separated; their sum sets `maxlength` |
167
- | `autocomplete` | String | `"cc-number"` | Native autocomplete value |
168
- | `inputmode` | String | `"numeric"` | Native input mode |
174
+ | Option | Values | Default | Description |
175
+ | -------------- | ---------------------------------------- | ---------------------- | -------------------------------------------------------- |
176
+ | `length` | positive Integer | required | Number of cells and input maximum length |
177
+ | `charset` | `:digits` / `:letters` / `:alphanumeric` | `:digits` | Allowed code characters |
178
+ | `groups` | Array of positive Integers | `[]` | Visual cell groups; must add up to `length` |
179
+ | `separator` | String / `nil` | `nil` | Character between groups; `nil` shows the break as a gap |
180
+ | `autocomplete` | String | `"one-time-code"` | Native autocomplete value |
181
+ | `inputmode` | String | `"numeric"` for digits | Native input mode |
182
+
183
+ **Credit card** (`as: :credit_card`) — grouped card-number entry backed by `input-formatter` and the `character-cells` plumber (grouped mode). Renders one cell per group; their sum sets `maxlength`.
184
+
185
+ | Option | Values | Default | Description |
186
+ | -------------- | -------------------------- | -------------- | ------------------------------------------------------------ |
187
+ | `groups` | Array of positive Integers | `[4, 4, 4, 4]` | Cell groups — one cell per group; their sum sets `maxlength` |
188
+ | `separator` | String / `nil` | `nil` | Character between cells; `nil` renders none |
189
+ | `autocomplete` | String | `"cc-number"` | Native autocomplete value |
190
+ | `inputmode` | String | `"numeric"` | Native input mode |
169
191
 
170
192
  Character-cell fields do not support `floating:` labels.
171
193
 
@@ -7,17 +7,17 @@ Rails helper for rendering a named icon from the active theme's icon registry.
7
7
  ### `sp_icon`
8
8
 
9
9
  ```erb
10
- <%= sp_icon name: "check" %>
11
- <%= sp_icon name: "spinner", aria: { label: "Loading" }, role: "img" %>
12
- <%= sp_icon name: "unknown-icon" %>
13
- <%= sp_icon name: "check", size: :sm %>
10
+ <%= sp_icon "check" %>
11
+ <%= sp_icon "spinner", aria: { label: "Loading" }, role: "img" %>
12
+ <%= sp_icon "unknown-icon" %>
13
+ <%= sp_icon "check", size: :sm %>
14
14
  ```
15
15
 
16
- | Option | Default | Description |
17
- | ---------------- | ---------- | --------------------------------------------------- |
18
- | `name` | (required) | Icon name — looked up in the theme registry |
19
- | `size` | `:lg` | `:sm` \| `:md` \| `:lg` — theme-resolved size class |
20
- | `**html_options` | — | Forwarded to the root element |
16
+ | Option | Default | Description |
17
+ | ---------------- | ---------- | ---------------------------------------------------------------------- |
18
+ | `name` | (required) | Positional (1st argument). Icon name — looked up in the theme registry |
19
+ | `size` | `:lg` | `:sm` \| `:md` \| `:lg` — theme-resolved size class |
20
+ | `**html_options` | — | Forwarded to the root element |
21
21
 
22
22
  ---
23
23
 
data/docs/guide.md CHANGED
@@ -12,7 +12,8 @@ Use `StimulusPlumbers::Form::Builder` (set `config.action_view.default_form_buil
12
12
  - **Level 1.** Native helper overrides (`f.text_field`, `f.select`, `f.check_box`, ...) render
13
13
  only the themed input element — use when you control the surrounding markup.
14
14
 
15
- Submit with `f.submit` (themed button).
15
+ Submit with `f.submit` (themed button; supports `icon_leading:`/`icon_trailing:` and
16
+ `hide_label:` for an icon-only button — see [docs/component/form.md](component/form.md)).
16
17
 
17
18
  ## Building views
18
19
 
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module StimulusPlumbers
4
+ module Components
5
+ class Button < Plumber::Base
6
+ module IconLayout
7
+ private
8
+
9
+ def build_layout(slots, &block)
10
+ @template.safe_join(
11
+ [
12
+ render_icon_slot(slots, :icon_leading),
13
+ @template.capture(&block),
14
+ render_icon_slot(slots, :icon_trailing)
15
+ ]
16
+ )
17
+ end
18
+
19
+ def render_icon_slot(slots, name)
20
+ slots.resolve(name) do |value|
21
+ next value unless Components::Icon.icon_name?(value)
22
+
23
+ Components::Icon.new(@template).render(
24
+ value,
25
+ size: :sm,
26
+ classes: theme.resolve(:button_icon).fetch(:classes, ""),
27
+ aria: { hidden: "true" }
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -3,6 +3,8 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class Button < Plumber::Base
6
+ include IconLayout
7
+
6
8
  def render(content = nil, icon_leading: nil, icon_trailing: nil, **kwargs, &block)
7
9
  slots = Button::Slots.new(template)
8
10
  slots.with_icon_leading(icon_leading) if icon_leading
@@ -34,29 +36,6 @@ module StimulusPlumbers
34
36
  template.content_tag(:span, content)
35
37
  end
36
38
  end
37
-
38
- def build_layout(slots, &block)
39
- template.safe_join(
40
- [
41
- render_icon_slot(slots, :icon_leading),
42
- template.capture(&block),
43
- render_icon_slot(slots, :icon_trailing)
44
- ]
45
- )
46
- end
47
-
48
- def render_icon_slot(slots, name)
49
- slots.resolve(name) do |value|
50
- next value unless Components::Icon.icon_name?(value)
51
-
52
- Components::Icon.new(template).render(
53
- name: value,
54
- size: :sm,
55
- classes: theme.resolve(:button_icon).fetch(:classes, ""),
56
- aria: { hidden: "true" }
57
- )
58
- end
59
- end
60
39
  end
61
40
  end
62
41
  end
@@ -49,7 +49,7 @@ module StimulusPlumbers
49
49
  return value unless value.is_a?(Symbol) || (value.is_a?(String) && !value.html_safe?)
50
50
 
51
51
  Components::Icon.new(template).render(
52
- name: value,
52
+ value,
53
53
  classes: theme.resolve(:card_icon).fetch(:classes, ""),
54
54
  aria: { hidden: "true" }
55
55
  )
@@ -6,15 +6,37 @@ module StimulusPlumbers
6
6
  # Yielded to `Combobox#render`: selects a variant renderer, then exposes its
7
7
  # `metadata` (trigger/wrapper wiring) and renders its panel body.
8
8
  class Builder < Plumber::Slots
9
- def dropdown(**options) = select(Dropdown, options)
10
- def typeahead(**options) = select(Typeahead, options)
11
- def date(**options) = select(Date, options)
12
- def time(**options) = select(Time, options)
9
+ def dropdown(**options)
10
+ select(Dropdown, options)
11
+ end
12
+
13
+ def typeahead(**options)
14
+ select(Typeahead, options)
15
+ end
16
+
17
+ def date(**options)
18
+ select(Date, options)
19
+ end
13
20
 
14
- def selected? = @slots.key?(:variant)
15
- def renderer = selection&.fetch(:renderer)
16
- def options = selection ? selection[:options] : {}
17
- def metadata = renderer ? renderer::Metadata : DefaultMetadata
21
+ def time(**options)
22
+ select(Time, options)
23
+ end
24
+
25
+ def selected?
26
+ @slots.key?(:variant)
27
+ end
28
+
29
+ def renderer
30
+ selection&.fetch(:renderer)
31
+ end
32
+
33
+ def options
34
+ selection ? selection[:options] : {}
35
+ end
36
+
37
+ def metadata
38
+ renderer ? renderer::Metadata : DefaultMetadata
39
+ end
18
40
 
19
41
  def render_panel(template, panel_attrs:)
20
42
  renderer&.new(template)&.render(panel_attrs: panel_attrs, **options)
@@ -24,11 +46,25 @@ module StimulusPlumbers
24
46
  module DefaultMetadata
25
47
  module_function
26
48
 
27
- def haspopup = "dialog"
28
- def popup_id_for(panel_id) = panel_id
29
- def trigger_icon = nil
30
- def trigger_options = {}
31
- def stimulus_data(_panel_id, _options) = {}
49
+ def haspopup
50
+ "dialog"
51
+ end
52
+
53
+ def popup_id_for(panel_id)
54
+ panel_id
55
+ end
56
+
57
+ def trigger_icon
58
+ nil
59
+ end
60
+
61
+ def trigger_options
62
+ {}
63
+ end
64
+
65
+ def stimulus_data(_panel_id, _options)
66
+ {}
67
+ end
32
68
  end
33
69
 
34
70
  private
@@ -38,7 +74,9 @@ module StimulusPlumbers
38
74
  nil
39
75
  end
40
76
 
41
- def selection = resolve(:variant)
77
+ def selection
78
+ resolve(:variant)
79
+ end
42
80
  end
43
81
  end
44
82
  end
@@ -16,21 +16,47 @@ module StimulusPlumbers
16
16
  "#{STIMULUS_CONTROLLER}:selected->#{Components::Popover::STIMULUS_CONTROLLER}#closeOnSelect"
17
17
  ].join(" ").freeze
18
18
 
19
- def self.month_id_for(panel_id) = [panel_id, "calendar_month"].compact.join("_")
20
- def self.year_id_for(panel_id) = [panel_id, "calendar_year"].compact.join("_")
21
- def self.decade_id_for(panel_id) = [panel_id, "calendar_decade"].compact.join("_")
19
+ class << self
20
+ def month_id_for(panel_id)
21
+ [panel_id, "calendar_month"].compact.join("_")
22
+ end
23
+
24
+ def year_id_for(panel_id)
25
+ [panel_id, "calendar_year"].compact.join("_")
26
+ end
27
+
28
+ def decade_id_for(panel_id)
29
+ [panel_id, "calendar_decade"].compact.join("_")
30
+ end
31
+ end
22
32
 
23
33
  module Metadata
24
34
  module_function
25
35
 
26
- def haspopup = "dialog"
27
- def popup_id_for(panel_id) = panel_id
28
- def trigger_icon = "calendar"
29
- def trigger_options = {}
30
- def stimulus_data(_panel_id, _options) = { input_formatter_format_value: "date" }
36
+ def haspopup
37
+ "dialog"
38
+ end
39
+
40
+ def popup_id_for(panel_id)
41
+ panel_id
42
+ end
43
+
44
+ def trigger_icon
45
+ "calendar"
46
+ end
47
+
48
+ def trigger_options
49
+ {}
50
+ end
51
+
52
+ def stimulus_data(_panel_id, _options)
53
+ { input_formatter_format_value: "date" }
54
+ end
31
55
  end
32
56
 
33
- def render(...) = render_date(...)
57
+ def render(...)
58
+ render_date(...)
59
+ end
34
60
 
35
61
  private
36
62
 
@@ -15,14 +15,30 @@ module StimulusPlumbers
15
15
  module Metadata
16
16
  module_function
17
17
 
18
- def haspopup = "listbox"
19
- def popup_id_for(panel_id) = panel_id
20
- def trigger_icon = "chevron-down"
21
- def trigger_options = {}
22
- def stimulus_data(_panel_id, _options) = {}
18
+ def haspopup
19
+ "listbox"
20
+ end
21
+
22
+ def popup_id_for(panel_id)
23
+ panel_id
24
+ end
25
+
26
+ def trigger_icon
27
+ "chevron-down"
28
+ end
29
+
30
+ def trigger_options
31
+ {}
32
+ end
33
+
34
+ def stimulus_data(_panel_id, _options)
35
+ {}
36
+ end
23
37
  end
24
38
 
25
- def render(...) = render_dropdown(...)
39
+ def render(...)
40
+ render_dropdown(...)
41
+ end
26
42
 
27
43
  private
28
44
 
@@ -13,10 +13,21 @@ module StimulusPlumbers
13
13
  module Metadata
14
14
  module_function
15
15
 
16
- def haspopup = "dialog"
17
- def popup_id_for(panel_id) = panel_id
18
- def trigger_icon = "clock"
19
- def trigger_options = {}
16
+ def haspopup
17
+ "dialog"
18
+ end
19
+
20
+ def popup_id_for(panel_id)
21
+ panel_id
22
+ end
23
+
24
+ def trigger_icon
25
+ "clock"
26
+ end
27
+
28
+ def trigger_options
29
+ {}
30
+ end
20
31
 
21
32
  def stimulus_data(_panel_id, options)
22
33
  {
@@ -26,7 +37,9 @@ module StimulusPlumbers
26
37
  end
27
38
  end
28
39
 
29
- def render(...) = render_time(...)
40
+ def render(...)
41
+ render_time(...)
42
+ end
30
43
 
31
44
  private
32
45
 
@@ -84,7 +84,7 @@ module StimulusPlumbers
84
84
 
85
85
  def render_trigger_icon(name)
86
86
  Components::Icon.new(template).render(
87
- name: name,
87
+ name,
88
88
  classes: theme.resolve(:combobox_trigger_icon).fetch(:classes, ""),
89
89
  aria: { hidden: "true" }
90
90
  )
@@ -4,17 +4,30 @@ module StimulusPlumbers
4
4
  module Components
5
5
  class Combobox
6
6
  class Typeahead < Plumber::Base
7
- def self.listbox_id_for(panel_id)
8
- [panel_id, "listbox"].compact.join("_")
7
+ class << self
8
+ def listbox_id_for(panel_id)
9
+ [panel_id, "listbox"].compact.join("_")
10
+ end
9
11
  end
10
12
 
11
13
  module Metadata
12
14
  module_function
13
15
 
14
- def haspopup = "listbox"
15
- def popup_id_for(panel_id) = Typeahead.listbox_id_for(panel_id)
16
- def trigger_icon = nil
17
- def trigger_options = { readonly: false, aria: { autocomplete: "list" } }
16
+ def haspopup
17
+ "listbox"
18
+ end
19
+
20
+ def popup_id_for(panel_id)
21
+ Typeahead.listbox_id_for(panel_id)
22
+ end
23
+
24
+ def trigger_icon
25
+ nil
26
+ end
27
+
28
+ def trigger_options
29
+ { readonly: false, aria: { autocomplete: "list" } }
30
+ end
18
31
 
19
32
  def stimulus_data(panel_id, _options)
20
33
  {
@@ -24,7 +37,9 @@ module StimulusPlumbers
24
37
  end
25
38
  end
26
39
 
27
- def render(...) = render_typeahead(...)
40
+ def render(...)
41
+ render_typeahead(...)
42
+ end
28
43
 
29
44
  private
30
45
 
@@ -74,7 +89,7 @@ module StimulusPlumbers
74
89
  )
75
90
  ) do
76
91
  Components::Icon.new(template).render(
77
- name: "spinner",
92
+ "spinner",
78
93
  size: :md,
79
94
  classes: theme.resolve(:combobox_typeahead_loading_icon).fetch(:classes, ""),
80
95
  aria: { hidden: "true" }
@@ -3,11 +3,13 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class Icon < Plumber::Base
6
- def self.icon_name?(value)
7
- value.is_a?(Symbol) || (value.is_a?(String) && !value.html_safe?)
6
+ class << self
7
+ def icon_name?(value)
8
+ value.is_a?(Symbol) || (value.is_a?(String) && !value.html_safe?)
9
+ end
8
10
  end
9
11
 
10
- def render(name:, size: :lg, **kwargs)
12
+ def render(name, size: :lg, **kwargs)
11
13
  html_options = merge_html_options(
12
14
  theme.resolve(:icon, size: size),
13
15
  kwargs
@@ -3,7 +3,9 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class Indicator < Plumber::Base
6
- def render(...) = render_indicator(...)
6
+ def render(...)
7
+ render_indicator(...)
8
+ end
7
9
 
8
10
  private
9
11
 
@@ -44,7 +44,7 @@ module StimulusPlumbers
44
44
  next value unless Components::Icon.icon_name?(value)
45
45
 
46
46
  Components::Icon.new(template).render(
47
- name: value,
47
+ value,
48
48
  size: :sm,
49
49
  classes: theme.resolve(:link_icon).fetch(:classes, ""),
50
50
  aria: { hidden: "true" }
@@ -43,7 +43,7 @@ module StimulusPlumbers
43
43
  next value unless Components::Icon.icon_name?(value)
44
44
 
45
45
  Components::Icon.new(template).render(
46
- name: value,
46
+ value,
47
47
  classes: theme.resolve(:list_item_icon).fetch(:classes, ""),
48
48
  aria: { hidden: "true" }
49
49
  )
@@ -85,7 +85,7 @@ module StimulusPlumbers
85
85
  next value unless Components::Icon.icon_name?(value)
86
86
 
87
87
  Components::Icon.new(template).render(
88
- name: value,
88
+ value,
89
89
  size: :sm,
90
90
  classes: theme.resolve(:ordered_list_item_handle).fetch(:classes, ""),
91
91
  aria: { hidden: "true" }
@@ -95,7 +95,7 @@ module StimulusPlumbers
95
95
 
96
96
  def default_handle_icon
97
97
  Components::Icon.new(template).render(
98
- name: "grip-vertical",
98
+ "grip-vertical",
99
99
  size: :sm,
100
100
  classes: theme.resolve(:ordered_list_item_handle).fetch(:classes, ""),
101
101
  aria: { hidden: "true" }
@@ -5,11 +5,15 @@ module StimulusPlumbers
5
5
  class Popover < Plumber::Base
6
6
  STIMULUS_CONTROLLER = "popover"
7
7
 
8
- def self.panel_id_for(trigger_id)
9
- [trigger_id, "popover"].compact.join("_")
8
+ class << self
9
+ def panel_id_for(trigger_id)
10
+ [trigger_id, "popover"].compact.join("_")
11
+ end
10
12
  end
11
13
 
12
- def render(...) = render_popover(...)
14
+ def render(...)
15
+ render_popover(...)
16
+ end
13
17
 
14
18
  def build(panel_id: nil, &block)
15
19
  @panel_id = panel_id || self.class.panel_id_for(template.sp_dom_id)
@@ -3,7 +3,9 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class ProgressBar < Plumber::Base
6
- def render(...) = render_bar(...)
6
+ def render(...)
7
+ render_bar(...)
8
+ end
7
9
 
8
10
  private
9
11
 
@@ -3,7 +3,9 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class ProgressMeter < Plumber::Base
6
- def render(...) = render_meter(...)
6
+ def render(...)
7
+ render_meter(...)
8
+ end
7
9
 
8
10
  private
9
11
 
@@ -3,7 +3,9 @@
3
3
  module StimulusPlumbers
4
4
  module Components
5
5
  class ProgressRing < Plumber::Base
6
- def render(...) = render_ring(...)
6
+ def render(...)
7
+ render_ring(...)
8
+ end
7
9
 
8
10
  private
9
11
 
@@ -14,7 +16,7 @@ module StimulusPlumbers
14
16
  stimulus_data(value: value, min: min, max: max, indeterminate: indeterminate),
15
17
  { role: "progressbar", aria: progress_aria(value: value, min: min, max: max, indeterminate: indeterminate) }
16
18
  )
17
- Components::Icon.new(template).render(name: "progress-ring", **icon_options)
19
+ Components::Icon.new(template).render("progress-ring", **icon_options)
18
20
  end
19
21
 
20
22
  def progress_aria(value:, min:, max:, indeterminate:)