stimulus_plumbers 0.2.2 → 0.2.8

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +38 -0
  3. data/README.md +57 -41
  4. data/app/assets/javascripts/stimulus-plumbers/stimulus-plumbers-controllers.es.js +1628 -0
  5. data/app/assets/javascripts/stimulus-plumbers/stimulus-plumbers-controllers.umd.js +1 -0
  6. data/lib/stimulus_plumbers/components/combobox/autocomplete.rb +57 -0
  7. data/lib/stimulus_plumbers/components/combobox/date.rb +52 -0
  8. data/lib/stimulus_plumbers/components/combobox/dropdown.rb +41 -0
  9. data/lib/stimulus_plumbers/components/combobox/option.rb +27 -0
  10. data/lib/stimulus_plumbers/components/combobox/option_group.rb +52 -0
  11. data/lib/stimulus_plumbers/components/combobox/renderer.rb +78 -0
  12. data/lib/stimulus_plumbers/components/combobox/time.rb +103 -0
  13. data/lib/stimulus_plumbers/components/date_picker/navigation.rb +1 -1
  14. data/lib/stimulus_plumbers/components/plumber/html_options.rb +22 -3
  15. data/lib/stimulus_plumbers/components/time_picker/renderer.rb +38 -0
  16. data/lib/stimulus_plumbers/form/builder.rb +57 -12
  17. data/lib/stimulus_plumbers/form/field_component.rb +12 -10
  18. data/lib/stimulus_plumbers/form/fields/combobox.rb +41 -0
  19. data/lib/stimulus_plumbers/form/fields/password.rb +55 -0
  20. data/lib/stimulus_plumbers/form/fields/renderer.rb +1 -2
  21. data/lib/stimulus_plumbers/form/fields/search.rb +40 -0
  22. data/lib/stimulus_plumbers/form/fields/select.rb +8 -2
  23. data/lib/stimulus_plumbers/form/fields/text.rb +12 -4
  24. data/lib/stimulus_plumbers/helpers/combobox_helper.rb +74 -0
  25. data/lib/stimulus_plumbers/helpers.rb +2 -2
  26. data/lib/stimulus_plumbers/themes/{form.rb → base/form.rb} +6 -2
  27. data/lib/stimulus_plumbers/themes/base.rb +7 -7
  28. data/lib/stimulus_plumbers/themes/tailwind/form.rb +10 -6
  29. data/lib/stimulus_plumbers/version.rb +1 -1
  30. data/lib/stimulus_plumbers.rb +18 -1
  31. metadata +25 -15
  32. data/lib/stimulus_plumbers/components/date_picker/renderer.rb +0 -82
  33. data/lib/stimulus_plumbers/helpers/date_picker_helper.rb +0 -17
  34. /data/lib/stimulus_plumbers/themes/{action_list.rb → base/action_list.rb} +0 -0
  35. /data/lib/stimulus_plumbers/themes/{avatar.rb → base/avatar.rb} +0 -0
  36. /data/lib/stimulus_plumbers/themes/{button.rb → base/button.rb} +0 -0
  37. /data/lib/stimulus_plumbers/themes/{calendar.rb → base/calendar.rb} +0 -0
  38. /data/lib/stimulus_plumbers/themes/{card.rb → base/card.rb} +0 -0
  39. /data/lib/stimulus_plumbers/themes/{layout.rb → base/layout.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1abfd2ca5a0c575652d0d6c650acbde79e656b9b806a76b8f922e682cf2f7526
4
- data.tar.gz: 621aa551f6fb7b9f3a90c3313e4dedb6c901f475cb96f6631a9fc54edccf5bac
3
+ metadata.gz: 876f74ed0fa1cd369bf07b4e9aae7ab22c8aa8b7002ef2fdf73e5d629970a989
4
+ data.tar.gz: 4e450baaa66973e5bace682594b37098951358f9fa365b96baaae236b1ce57f3
5
5
  SHA512:
6
- metadata.gz: e45e2a0ea994b0e8d22edc2098974d6f15c43bb552a92dc7c5baf2dc0700b9a8f22ef570ffa913c0cae84d6bc64ecbe6b6e09613e4b73ccaccc1613d93d898d3
7
- data.tar.gz: 1be1501a2b77cad35780730e84803bdb5506e6def24699c46cc1797196780aec94dfe7a451a0b4774b748258132a7b0eb3d6bae16c71c22bc7c733bf24c45f1c
6
+ metadata.gz: 9d1d75ed7a6e9e2a11e438e35fb58be3648b8c3f6f7641f74b6bb311ef96e7604397b6af8ce49c12fd65d90c79998b9a12c4dbab1ae5d082c066a3663b51f28a
7
+ data.tar.gz: c9f34a4dbe3ab3cb1ce08a391b34696ccb5b11a2e761d5902171e8395023949e25fdb10c423e9617505f97dc7586e15fce39d4da40de2f9d871af40dce10aba5
data/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
4
+
5
+ ---
6
+ ## [0.2.8](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-rails/v0.2.7..stimulus-plumbers-rails/v0.2.8) - 2026-05-10
7
+
8
+ ### Features
9
+
10
+ - input group ([#46](https://github.com/ryancyq/stimulus-plumbers/issues/46)) - ([a5e24f6](https://github.com/ryancyq/stimulus-plumbers/commit/a5e24f6dbc8b740822333164ceeefd7d20367f1b)) - Ryan Chang
11
+
12
+ ### Tests
13
+
14
+ - theme coverage ([#45](https://github.com/ryancyq/stimulus-plumbers/issues/45)) - ([cc86565](https://github.com/ryancyq/stimulus-plumbers/commit/cc86565fd65a5b9dc390e838d379de75576d60ba)) - Ryan Chang
15
+
16
+ ---
17
+ ## [0.2.2] - 2026-04-14
18
+
19
+ ### Dependencies
20
+
21
+ - migrate from rspec to minitest ([#16](https://github.com/ryancyq/stimulus-plumbers/issues/16)) - ([b183919](https://github.com/ryancyq/stimulus-plumbers/commit/b1839196235a7462d58bb2d3f9532388ffd916c2)) - Ryan Chang
22
+
23
+ ### Documentation
24
+
25
+ - update claude.md - ([2b36f6d](https://github.com/ryancyq/stimulus-plumbers/commit/2b36f6dcf7ce7c9154c187b011c2f8cf4cc5b9f9)) - Ryan Chang
26
+
27
+ ### Features
28
+
29
+ - stimulus plumbers rails gem ([#4](https://github.com/ryancyq/stimulus-plumbers/issues/4)) - ([e492e0f](https://github.com/ryancyq/stimulus-plumbers/commit/e492e0f910a6331328d52725f1931d9cd86c9563)) - Ryan Chang
30
+ - stimulus-rails UI components ([#15](https://github.com/ryancyq/stimulus-plumbers/issues/15)) - ([8e8b58c](https://github.com/ryancyq/stimulus-plumbers/commit/8e8b58c661a7cd8c79d7e65b729e3ea077e596b9)) - Ryan Chang
31
+ - form builder ([#21](https://github.com/ryancyq/stimulus-plumbers/issues/21)) - ([21aa9a6](https://github.com/ryancyq/stimulus-plumbers/commit/21aa9a634eca340e712f922f43ceb7383b56daee)) - Ryan Chang
32
+
33
+ ### Tests
34
+
35
+ - a11y ([#17](https://github.com/ryancyq/stimulus-plumbers/issues/17)) - ([4109a8a](https://github.com/ryancyq/stimulus-plumbers/commit/4109a8af8be8aab06ddbcff35e870556a6205852)) - Ryan Chang
36
+ - update rake test task to include system test - ([aa215b0](https://github.com/ryancyq/stimulus-plumbers/commit/aa215b0a84a36f32083327b4e7f03a646187cee9)) - Ryan Chang
37
+
38
+ <!-- generated by git-cliff -->
data/README.md CHANGED
@@ -1,75 +1,91 @@
1
- # Stimulus Plumbers
1
+ # stimulus-plumbers-rails
2
2
 
3
- A library of semantically correct, accessible UI components for Rails 8.0+ using ViewComponent and Stimulus.
3
+ [![Version][rubygems_badge]][rubygems]
4
+ [![CI][ci_badge]][ci]
4
5
 
5
- ## Installation
6
+ Rails helpers for accessible, WCAG 2.1 AA compliant UI components built on [Stimulus](https://stimulus.hotwired.dev/). Pairs with the [`@stimulus-plumbers/controllers`](../stimulus-plumbers) npm package.
7
+
8
+ ## Requirements
6
9
 
7
- Add this line to your application's Gemfile:
10
+ - Ruby >= 3.0
11
+ - Rails >= 6.1
12
+ - `@stimulus-plumbers/controllers` registered in your Stimulus app
13
+
14
+ ## Installation
8
15
 
9
16
  ```ruby
10
- gem 'stimulus_plumbers'
17
+ # Gemfile
18
+ gem "stimulus_plumbers"
11
19
  ```
12
20
 
13
- And then execute:
14
-
15
21
  ```bash
16
22
  bundle install
17
23
  ```
18
24
 
19
- ## Usage
25
+ Include the helpers in your `ApplicationHelper`:
20
26
 
21
- Stimulus Plumbers provides ready-to-use ViewComponent components that render semantically correct, accessible HTML. Each component is designed with accessibility as a core requirement, not an afterthought.
27
+ ```ruby
28
+ module ApplicationHelper
29
+ include StimulusPlumbers::Helpers::ComboboxHelper
30
+ include StimulusPlumbers::Helpers::PopoverHelper
31
+ include StimulusPlumbers::Helpers::CalendarHelper
32
+ end
33
+ ```
22
34
 
23
- ### Basic Example
35
+ Or use the form builder globally:
24
36
 
25
- ```erb
26
- <%# In your Rails view %>
27
- <%= render ButtonComponent.new(url: root_path) do %>
28
- Click me
29
- <% end %>
37
+ ```ruby
38
+ # config/application.rb
39
+ config.action_view.default_form_builder = StimulusPlumbers::Form::Builder
30
40
  ```
31
41
 
32
- ### Available Components
42
+ ## Components
33
43
 
34
- - **ActionList**: Accessible lists with items and sections
35
- - **Avatar**: User avatar component
36
- - **Button**: Semantic button with optional prefix/suffix
37
- - **Card**: Card component with sections
38
- - **Calendar**: Date calendar with navigation
39
- - **Container**: Layout container
40
- - **Divider**: Semantic divider/separator
41
- - **Dropdown**: Accessible dropdown menus
42
- - **Navigation**: Navigation bars, tabs, and lists
43
- - **Popover**: Accessible popover component
44
+ | Component | Helper(s) | Docs |
45
+ |-----------|-----------|------|
46
+ | Combobox date | `sp_combobox_date` | [docs/component/combobox.md](docs/component/combobox.md#sp_combobox_date) |
47
+ | Combobox dropdown | `sp_combobox_dropdown` | [docs/component/combobox.md](docs/component/combobox.md#sp_combobox_dropdown) |
48
+ | Combobox autocomplete | `sp_combobox_autocomplete` | [docs/component/combobox.md](docs/component/combobox.md#sp_combobox_autocomplete) |
49
+ | Combobox time | `sp_combobox_time` | [docs/component/combobox.md](docs/component/combobox.md#sp_combobox_time) |
50
+ | Calendar | `sp_calendar_month` | [docs/component/calendar.md](docs/component/calendar.md) |
51
+ | Popover | `sp_popover` | [docs/component/popover.md](docs/component/popover.md) |
52
+ | Modal | (JS only) | [docs/component/modal.md](docs/component/modal.md) |
44
53
 
45
- ## Component Philosophy
54
+ ## Form Builder
46
55
 
47
- All components in this library follow these principles:
56
+ `StimulusPlumbers::Form::Builder` wraps all components as model-aware form fields with automatic label, name/id, error, and ARIA wiring.
48
57
 
49
- 1. **Accessibility First**: WCAG 2.1 Level AA minimum
50
- 2. **Semantic HTML**: Use native elements before ARIA
51
- 3. **Keyboard Navigation**: Full keyboard support
52
- 4. **Screen Reader Friendly**: Proper announcements and labels
53
- 5. **Focus Management**: Visible focus indicators and logical tab order
58
+ [docs/component/form_builder.md](docs/component/form_builder.md)
54
59
 
55
- ## Development
60
+ ## Theming
61
+
62
+ Includes a Tailwind CSS theme out of the box. Supports custom themes by subclassing `Themes::Base`.
56
63
 
57
- After checking out the repo, run:
64
+ [docs/component/theme.md](docs/component/theme.md)
65
+
66
+ ## Development
58
67
 
59
68
  ```bash
60
69
  bundle install
70
+
71
+ bundle exec rake test:unit # unit tests
72
+ bundle exec rake test:system # accessibility system tests
73
+ bundle exec rake rubocop # lint
61
74
  ```
62
75
 
63
- Run the test suite with:
76
+ Test against a specific Rails version:
64
77
 
65
78
  ```bash
66
- bundle exec rspec
79
+ BUNDLE_GEMFILE=gemfiles/rails_8.0.gemfile bundle exec rake test:unit
67
80
  ```
68
81
 
69
- ## Contributing
70
-
71
- Bug reports and pull requests are welcome on GitHub at https://github.com/ryancyq/stimulus-plumbers.
82
+ Available appraisals: `rails_6.1`, `rails_7.0`, `rails_7.1`, `rails_7.2`, `rails_8.0`, `rails_8.1`, `rails_edge`.
72
83
 
73
84
  ## License
74
85
 
75
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
86
+ [MIT](https://opensource.org/licenses/MIT)
87
+
88
+ [rubygems_badge]: https://img.shields.io/gem/v/stimulus_plumbers.svg
89
+ [rubygems]: https://rubygems.org/gems/stimulus_plumbers
90
+ [ci_badge]: https://github.com/ryancyq/stimulus-plumbers/actions/workflows/ci-rails.yml/badge.svg
91
+ [ci]: https://github.com/ryancyq/stimulus-plumbers/actions/workflows/ci-rails.yml