ruby_ui 1.0.0.pre.alpha.4 → 1.0.0.rc1

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 (227) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -0
  3. data/README.md +85 -0
  4. data/lib/generators/ruby_ui/component_generator.rb +94 -0
  5. data/lib/generators/ruby_ui/dependencies.yml +74 -0
  6. data/lib/generators/ruby_ui/install/install_generator.rb +89 -0
  7. data/lib/generators/ruby_ui/install/templates/ruby_ui.rb.erb +18 -0
  8. data/lib/generators/ruby_ui/install/templates/tailwind.css.erb +156 -0
  9. data/lib/generators/ruby_ui/javascript_utils.rb +57 -0
  10. data/lib/{rbui → ruby_ui}/accordion/accordion.rb +1 -1
  11. data/lib/{rbui → ruby_ui}/accordion/accordion_content.rb +2 -2
  12. data/lib/ruby_ui/accordion/accordion_controller.js +97 -0
  13. data/lib/{rbui → ruby_ui}/accordion/accordion_default_content.rb +1 -1
  14. data/lib/{rbui → ruby_ui}/accordion/accordion_default_trigger.rb +3 -3
  15. data/lib/{rbui → ruby_ui}/accordion/accordion_icon.rb +2 -2
  16. data/lib/{rbui → ruby_ui}/accordion/accordion_item.rb +4 -4
  17. data/lib/{rbui → ruby_ui}/accordion/accordion_trigger.rb +3 -2
  18. data/lib/{rbui → ruby_ui}/alert/alert.rb +3 -3
  19. data/lib/{rbui → ruby_ui}/alert/alert_description.rb +1 -1
  20. data/lib/{rbui → ruby_ui}/alert/alert_title.rb +1 -1
  21. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog.rb +3 -3
  22. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_action.rb +2 -2
  23. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_cancel.rb +3 -3
  24. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_content.rb +5 -5
  25. data/lib/ruby_ui/alert_dialog/alert_dialog_controller.js +31 -0
  26. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_description.rb +1 -1
  27. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_footer.rb +2 -2
  28. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_header.rb +2 -2
  29. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_title.rb +1 -1
  30. data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_trigger.rb +2 -2
  31. data/lib/{rbui → ruby_ui}/aspect_ratio/aspect_ratio.rb +1 -1
  32. data/lib/{rbui → ruby_ui}/avatar/avatar.rb +2 -2
  33. data/lib/{rbui → ruby_ui}/avatar/avatar_fallback.rb +1 -1
  34. data/lib/{rbui → ruby_ui}/avatar/avatar_image.rb +1 -1
  35. data/lib/{rbui → ruby_ui}/badge/badge.rb +2 -2
  36. data/lib/{rbui → ruby_ui}/base.rb +1 -8
  37. data/lib/ruby_ui/breadcrumb/breadcrumb.rb +17 -0
  38. data/lib/ruby_ui/breadcrumb/breadcrumb_ellipsis.rb +39 -0
  39. data/lib/{rbui/typography/typography_list_item.rb → ruby_ui/breadcrumb/breadcrumb_item.rb} +3 -3
  40. data/lib/ruby_ui/breadcrumb/breadcrumb_link.rb +22 -0
  41. data/lib/ruby_ui/breadcrumb/breadcrumb_list.rb +17 -0
  42. data/lib/ruby_ui/breadcrumb/breadcrumb_page.rb +19 -0
  43. data/lib/ruby_ui/breadcrumb/breadcrumb_separator.rb +38 -0
  44. data/lib/{rbui → ruby_ui}/button/button.rb +13 -13
  45. data/lib/ruby_ui/calendar/calendar.rb +39 -0
  46. data/lib/{rbui → ruby_ui}/calendar/calendar_body.rb +2 -2
  47. data/lib/ruby_ui/calendar/calendar_controller.js +249 -0
  48. data/lib/{rbui → ruby_ui}/calendar/calendar_days.rb +14 -14
  49. data/lib/{rbui → ruby_ui}/calendar/calendar_header.rb +1 -1
  50. data/lib/ruby_ui/calendar/calendar_input_controller.js +8 -0
  51. data/lib/{rbui → ruby_ui}/calendar/calendar_next.rb +2 -2
  52. data/lib/{rbui → ruby_ui}/calendar/calendar_prev.rb +2 -2
  53. data/lib/{rbui → ruby_ui}/calendar/calendar_title.rb +2 -2
  54. data/lib/{rbui → ruby_ui}/calendar/calendar_weekdays.rb +2 -2
  55. data/lib/{rbui → ruby_ui}/card/card.rb +1 -1
  56. data/lib/{rbui → ruby_ui}/card/card_content.rb +1 -1
  57. data/lib/{rbui → ruby_ui}/card/card_description.rb +1 -1
  58. data/lib/{rbui → ruby_ui}/card/card_footer.rb +1 -1
  59. data/lib/{rbui → ruby_ui}/card/card_header.rb +1 -1
  60. data/lib/{rbui → ruby_ui}/card/card_title.rb +1 -1
  61. data/lib/ruby_ui/carousel/carousel.rb +44 -0
  62. data/lib/ruby_ui/carousel/carousel_content.rb +23 -0
  63. data/lib/ruby_ui/carousel/carousel_controller.js +60 -0
  64. data/lib/ruby_ui/carousel/carousel_item.rb +23 -0
  65. data/lib/ruby_ui/carousel/carousel_next.rb +48 -0
  66. data/lib/ruby_ui/carousel/carousel_previous.rb +49 -0
  67. data/lib/{rbui → ruby_ui}/chart/chart.rb +3 -3
  68. data/lib/ruby_ui/chart/chart_controller.js +103 -0
  69. data/lib/{rbui → ruby_ui}/checkbox/checkbox.rb +4 -4
  70. data/lib/{rbui → ruby_ui}/checkbox/checkbox_group.rb +2 -2
  71. data/lib/ruby_ui/checkbox/checkbox_group_controller.js +21 -0
  72. data/lib/{rbui → ruby_ui}/clipboard/clipboard.rb +6 -6
  73. data/lib/ruby_ui/clipboard/clipboard_controller.js +54 -0
  74. data/lib/{rbui → ruby_ui}/clipboard/clipboard_popover.rb +2 -2
  75. data/lib/{rbui → ruby_ui}/clipboard/clipboard_source.rb +2 -2
  76. data/lib/{rbui → ruby_ui}/clipboard/clipboard_trigger.rb +3 -3
  77. data/lib/{rbui → ruby_ui}/codeblock/codeblock.rb +7 -10
  78. data/lib/{rbui → ruby_ui}/collapsible/collapsible.rb +3 -3
  79. data/lib/{rbui → ruby_ui}/collapsible/collapsible_content.rb +2 -2
  80. data/lib/ruby_ui/collapsible/collapsible_controller.js +47 -0
  81. data/lib/{rbui → ruby_ui}/collapsible/collapsible_trigger.rb +2 -2
  82. data/lib/ruby_ui/combobox/combobox.rb +26 -0
  83. data/lib/ruby_ui/combobox/combobox_checkbox.rb +25 -0
  84. data/lib/ruby_ui/combobox/combobox_controller.js +176 -0
  85. data/lib/{rbui/combobox/combobox_empty.rb → ruby_ui/combobox/combobox_empty_state.rb} +3 -3
  86. data/lib/ruby_ui/combobox/combobox_item.rb +25 -0
  87. data/lib/ruby_ui/combobox/combobox_list.rb +18 -0
  88. data/lib/ruby_ui/combobox/combobox_list_group.rb +20 -0
  89. data/lib/ruby_ui/combobox/combobox_popover.rb +30 -0
  90. data/lib/ruby_ui/combobox/combobox_radio.rb +26 -0
  91. data/lib/{rbui → ruby_ui}/combobox/combobox_search_input.rb +22 -25
  92. data/lib/ruby_ui/combobox/combobox_toggle_all_checkbox.rb +25 -0
  93. data/lib/{rbui → ruby_ui}/combobox/combobox_trigger.rb +26 -21
  94. data/lib/{rbui → ruby_ui}/command/command.rb +1 -1
  95. data/lib/ruby_ui/command/command_controller.js +136 -0
  96. data/lib/{rbui → ruby_ui}/command/command_dialog.rb +2 -2
  97. data/lib/{rbui → ruby_ui}/command/command_dialog_content.rb +6 -6
  98. data/lib/{rbui → ruby_ui}/command/command_dialog_trigger.rb +3 -3
  99. data/lib/{rbui → ruby_ui}/command/command_empty.rb +2 -2
  100. data/lib/{rbui → ruby_ui}/command/command_group.rb +2 -2
  101. data/lib/{rbui → ruby_ui}/command/command_input.rb +3 -3
  102. data/lib/{rbui → ruby_ui}/command/command_item.rb +2 -2
  103. data/lib/{rbui → ruby_ui}/command/command_list.rb +1 -1
  104. data/lib/{rbui → ruby_ui}/context_menu/context_menu.rb +2 -2
  105. data/lib/{rbui → ruby_ui}/context_menu/context_menu_content.rb +2 -2
  106. data/lib/ruby_ui/context_menu/context_menu_controller.js +144 -0
  107. data/lib/{rbui → ruby_ui}/context_menu/context_menu_item.rb +3 -3
  108. data/lib/{rbui → ruby_ui}/context_menu/context_menu_label.rb +2 -2
  109. data/lib/{rbui → ruby_ui}/context_menu/context_menu_separator.rb +1 -1
  110. data/lib/{rbui → ruby_ui}/context_menu/context_menu_trigger.rb +3 -3
  111. data/lib/{rbui → ruby_ui}/dialog/dialog.rb +3 -3
  112. data/lib/{rbui → ruby_ui}/dialog/dialog_content.rb +9 -9
  113. data/lib/ruby_ui/dialog/dialog_controller.js +32 -0
  114. data/lib/{rbui → ruby_ui}/dialog/dialog_description.rb +1 -1
  115. data/lib/{rbui → ruby_ui}/dialog/dialog_footer.rb +2 -2
  116. data/lib/{rbui → ruby_ui}/dialog/dialog_header.rb +2 -2
  117. data/lib/{rbui → ruby_ui}/dialog/dialog_middle.rb +1 -1
  118. data/lib/{rbui → ruby_ui}/dialog/dialog_title.rb +1 -1
  119. data/lib/{rbui → ruby_ui}/dialog/dialog_trigger.rb +2 -2
  120. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu.rb +4 -4
  121. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_content.rb +2 -2
  122. data/lib/ruby_ui/dropdown_menu/dropdown_menu_controller.js +120 -0
  123. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_item.rb +3 -3
  124. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_label.rb +1 -1
  125. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_separator.rb +1 -1
  126. data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_trigger.rb +2 -2
  127. data/lib/{rbui → ruby_ui}/form/form.rb +1 -1
  128. data/lib/{rbui → ruby_ui}/form/form_field.rb +2 -2
  129. data/lib/ruby_ui/form/form_field_controller.js +61 -0
  130. data/lib/{rbui → ruby_ui}/form/form_field_error.rb +2 -2
  131. data/lib/{rbui → ruby_ui}/form/form_field_hint.rb +1 -1
  132. data/lib/{rbui → ruby_ui}/form/form_field_label.rb +1 -1
  133. data/lib/{rbui → ruby_ui}/hover_card/hover_card.rb +3 -3
  134. data/lib/{rbui → ruby_ui}/hover_card/hover_card_content.rb +2 -2
  135. data/lib/ruby_ui/hover_card/hover_card_controller.js +144 -0
  136. data/lib/{rbui → ruby_ui}/hover_card/hover_card_trigger.rb +2 -2
  137. data/lib/{rbui → ruby_ui}/input/input.rb +3 -3
  138. data/lib/{rbui → ruby_ui}/link/link.rb +13 -13
  139. data/lib/ruby_ui/masked_input/masked_input.rb +15 -0
  140. data/lib/ruby_ui/masked_input/masked_input_controller.js +9 -0
  141. data/lib/{rbui → ruby_ui}/pagination/pagination.rb +1 -1
  142. data/lib/{rbui → ruby_ui}/pagination/pagination_content.rb +1 -1
  143. data/lib/{rbui → ruby_ui}/pagination/pagination_ellipsis.rb +1 -1
  144. data/lib/{rbui → ruby_ui}/pagination/pagination_item.rb +4 -4
  145. data/lib/{rbui → ruby_ui}/popover/popover.rb +4 -4
  146. data/lib/{rbui → ruby_ui}/popover/popover_content.rb +2 -2
  147. data/lib/ruby_ui/popover/popover_controller.js +107 -0
  148. data/lib/{rbui → ruby_ui}/popover/popover_trigger.rb +2 -2
  149. data/lib/ruby_ui/progress/progress.rb +37 -0
  150. data/lib/ruby_ui/radio_button/radio_button.rb +25 -0
  151. data/lib/{rbui → ruby_ui}/select/select.rb +5 -5
  152. data/lib/{rbui → ruby_ui}/select/select_content.rb +3 -3
  153. data/lib/ruby_ui/select/select_controller.js +171 -0
  154. data/lib/{rbui → ruby_ui}/select/select_group.rb +1 -1
  155. data/lib/{rbui → ruby_ui}/select/select_input.rb +4 -4
  156. data/lib/{rbui → ruby_ui}/select/select_item.rb +4 -4
  157. data/lib/ruby_ui/select/select_item_controller.js +11 -0
  158. data/lib/{rbui → ruby_ui}/select/select_label.rb +1 -1
  159. data/lib/{rbui → ruby_ui}/select/select_trigger.rb +3 -3
  160. data/lib/{rbui → ruby_ui}/select/select_value.rb +3 -3
  161. data/lib/ruby_ui/separator/separator.rb +38 -0
  162. data/lib/{rbui → ruby_ui}/sheet/sheet.rb +2 -2
  163. data/lib/{rbui → ruby_ui}/sheet/sheet_content.rb +8 -8
  164. data/lib/ruby_ui/sheet/sheet_content_controller.js +7 -0
  165. data/lib/ruby_ui/sheet/sheet_controller.js +9 -0
  166. data/lib/{rbui → ruby_ui}/sheet/sheet_description.rb +1 -1
  167. data/lib/{rbui → ruby_ui}/sheet/sheet_footer.rb +1 -1
  168. data/lib/{rbui → ruby_ui}/sheet/sheet_header.rb +1 -1
  169. data/lib/{rbui → ruby_ui}/sheet/sheet_middle.rb +1 -1
  170. data/lib/{rbui → ruby_ui}/sheet/sheet_title.rb +1 -1
  171. data/lib/{rbui → ruby_ui}/sheet/sheet_trigger.rb +2 -2
  172. data/lib/{rbui → ruby_ui}/shortcut_key/shortcut_key.rb +1 -1
  173. data/lib/ruby_ui/skeleton/skeleton.rb +17 -0
  174. data/lib/ruby_ui/switch/switch.rb +24 -0
  175. data/lib/{rbui → ruby_ui}/table/table.rb +1 -1
  176. data/lib/{rbui → ruby_ui}/table/table_body.rb +1 -1
  177. data/lib/{rbui → ruby_ui}/table/table_caption.rb +1 -1
  178. data/lib/{rbui → ruby_ui}/table/table_cell.rb +1 -1
  179. data/lib/{rbui → ruby_ui}/table/table_footer.rb +1 -1
  180. data/lib/{rbui → ruby_ui}/table/table_head.rb +1 -1
  181. data/lib/{rbui → ruby_ui}/table/table_header.rb +1 -1
  182. data/lib/{rbui → ruby_ui}/table/table_row.rb +1 -1
  183. data/lib/{rbui → ruby_ui}/tabs/tabs.rb +3 -3
  184. data/lib/{rbui → ruby_ui}/tabs/tabs_content.rb +2 -2
  185. data/lib/ruby_ui/tabs/tabs_controller.js +45 -0
  186. data/lib/{rbui → ruby_ui}/tabs/tabs_list.rb +1 -1
  187. data/lib/{rbui → ruby_ui}/tabs/tabs_trigger.rb +3 -3
  188. data/lib/{rbui → ruby_ui}/textarea/textarea.rb +3 -3
  189. data/lib/{rbui → ruby_ui}/theme_toggle/theme_toggle.rb +4 -4
  190. data/lib/ruby_ui/theme_toggle/theme_toggle_controller.js +30 -0
  191. data/lib/{rbui → ruby_ui}/tooltip/tooltip.rb +3 -3
  192. data/lib/{rbui → ruby_ui}/tooltip/tooltip_content.rb +3 -3
  193. data/lib/ruby_ui/tooltip/tooltip_controller.js +37 -0
  194. data/lib/{rbui → ruby_ui}/tooltip/tooltip_trigger.rb +2 -2
  195. data/lib/ruby_ui/typography/heading.rb +60 -0
  196. data/lib/{rbui/typography/typography_inline_code.rb → ruby_ui/typography/inline_code.rb} +2 -2
  197. data/lib/{rbui/typography/typography_inline_link.rb → ruby_ui/typography/inline_link.rb} +2 -2
  198. data/lib/ruby_ui/typography/text.rb +53 -0
  199. data/lib/{rbui → ruby_ui}/typography/typography_blockquote.rb +1 -1
  200. data/lib/ruby_ui.rb +5 -1
  201. metadata +208 -173
  202. data/lib/generators/rbui/base_generator.rb +0 -17
  203. data/lib/generators/rbui/component_generator.rb +0 -137
  204. data/lib/generators/rbui/install/install_generator.rb +0 -194
  205. data/lib/rbui/calendar/calendar.rb +0 -39
  206. data/lib/rbui/combobox/combobox.rb +0 -24
  207. data/lib/rbui/combobox/combobox_content.rb +0 -31
  208. data/lib/rbui/combobox/combobox_group.rb +0 -38
  209. data/lib/rbui/combobox/combobox_input.rb +0 -22
  210. data/lib/rbui/combobox/combobox_item.rb +0 -53
  211. data/lib/rbui/combobox/combobox_list.rb +0 -29
  212. data/lib/rbui/combobox/combobox_separator.rb +0 -15
  213. data/lib/rbui/combobox/combobox_value.rb +0 -27
  214. data/lib/rbui/radio_button/radio_button.rb +0 -22
  215. data/lib/rbui/railtie.rb +0 -52
  216. data/lib/rbui/typography/typography_h1.rb +0 -17
  217. data/lib/rbui/typography/typography_h2.rb +0 -17
  218. data/lib/rbui/typography/typography_h3.rb +0 -17
  219. data/lib/rbui/typography/typography_h4.rb +0 -17
  220. data/lib/rbui/typography/typography_large.rb +0 -17
  221. data/lib/rbui/typography/typography_lead.rb +0 -17
  222. data/lib/rbui/typography/typography_list.rb +0 -47
  223. data/lib/rbui/typography/typography_muted.rb +0 -17
  224. data/lib/rbui/typography/typography_p.rb +0 -17
  225. data/lib/rbui/typography/typography_small.rb +0 -17
  226. data/lib/rbui/version.rb +0 -5
  227. data/lib/rbui.rb +0 -57
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.alpha.4
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Kettle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-22 00:00:00.000000000 Z
11
+ date: 2025-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
20
- type: :runtime
19
+ version: 2.1.2
20
+ type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: 2.1.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rouge
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 4.2.0
34
- type: :runtime
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -45,7 +45,7 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.12'
48
- type: :runtime
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -101,170 +101,205 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - lib/generators/rbui/base_generator.rb
105
- - lib/generators/rbui/component_generator.rb
106
- - lib/generators/rbui/install/install_generator.rb
107
- - lib/rbui.rb
108
- - lib/rbui/accordion/accordion.rb
109
- - lib/rbui/accordion/accordion_content.rb
110
- - lib/rbui/accordion/accordion_default_content.rb
111
- - lib/rbui/accordion/accordion_default_trigger.rb
112
- - lib/rbui/accordion/accordion_icon.rb
113
- - lib/rbui/accordion/accordion_item.rb
114
- - lib/rbui/accordion/accordion_trigger.rb
115
- - lib/rbui/alert/alert.rb
116
- - lib/rbui/alert/alert_description.rb
117
- - lib/rbui/alert/alert_title.rb
118
- - lib/rbui/alert_dialog/alert_dialog.rb
119
- - lib/rbui/alert_dialog/alert_dialog_action.rb
120
- - lib/rbui/alert_dialog/alert_dialog_cancel.rb
121
- - lib/rbui/alert_dialog/alert_dialog_content.rb
122
- - lib/rbui/alert_dialog/alert_dialog_description.rb
123
- - lib/rbui/alert_dialog/alert_dialog_footer.rb
124
- - lib/rbui/alert_dialog/alert_dialog_header.rb
125
- - lib/rbui/alert_dialog/alert_dialog_title.rb
126
- - lib/rbui/alert_dialog/alert_dialog_trigger.rb
127
- - lib/rbui/aspect_ratio/aspect_ratio.rb
128
- - lib/rbui/avatar/avatar.rb
129
- - lib/rbui/avatar/avatar_fallback.rb
130
- - lib/rbui/avatar/avatar_image.rb
131
- - lib/rbui/badge/badge.rb
132
- - lib/rbui/base.rb
133
- - lib/rbui/button/button.rb
134
- - lib/rbui/calendar/calendar.rb
135
- - lib/rbui/calendar/calendar_body.rb
136
- - lib/rbui/calendar/calendar_days.rb
137
- - lib/rbui/calendar/calendar_header.rb
138
- - lib/rbui/calendar/calendar_next.rb
139
- - lib/rbui/calendar/calendar_prev.rb
140
- - lib/rbui/calendar/calendar_title.rb
141
- - lib/rbui/calendar/calendar_weekdays.rb
142
- - lib/rbui/card/card.rb
143
- - lib/rbui/card/card_content.rb
144
- - lib/rbui/card/card_description.rb
145
- - lib/rbui/card/card_footer.rb
146
- - lib/rbui/card/card_header.rb
147
- - lib/rbui/card/card_title.rb
148
- - lib/rbui/chart/chart.rb
149
- - lib/rbui/checkbox/checkbox.rb
150
- - lib/rbui/checkbox/checkbox_group.rb
151
- - lib/rbui/clipboard/clipboard.rb
152
- - lib/rbui/clipboard/clipboard_popover.rb
153
- - lib/rbui/clipboard/clipboard_source.rb
154
- - lib/rbui/clipboard/clipboard_trigger.rb
155
- - lib/rbui/codeblock/codeblock.rb
156
- - lib/rbui/collapsible/collapsible.rb
157
- - lib/rbui/collapsible/collapsible_content.rb
158
- - lib/rbui/collapsible/collapsible_trigger.rb
159
- - lib/rbui/combobox/combobox.rb
160
- - lib/rbui/combobox/combobox_content.rb
161
- - lib/rbui/combobox/combobox_empty.rb
162
- - lib/rbui/combobox/combobox_group.rb
163
- - lib/rbui/combobox/combobox_input.rb
164
- - lib/rbui/combobox/combobox_item.rb
165
- - lib/rbui/combobox/combobox_list.rb
166
- - lib/rbui/combobox/combobox_search_input.rb
167
- - lib/rbui/combobox/combobox_separator.rb
168
- - lib/rbui/combobox/combobox_trigger.rb
169
- - lib/rbui/combobox/combobox_value.rb
170
- - lib/rbui/command/command.rb
171
- - lib/rbui/command/command_dialog.rb
172
- - lib/rbui/command/command_dialog_content.rb
173
- - lib/rbui/command/command_dialog_trigger.rb
174
- - lib/rbui/command/command_empty.rb
175
- - lib/rbui/command/command_group.rb
176
- - lib/rbui/command/command_input.rb
177
- - lib/rbui/command/command_item.rb
178
- - lib/rbui/command/command_list.rb
179
- - lib/rbui/context_menu/context_menu.rb
180
- - lib/rbui/context_menu/context_menu_content.rb
181
- - lib/rbui/context_menu/context_menu_item.rb
182
- - lib/rbui/context_menu/context_menu_label.rb
183
- - lib/rbui/context_menu/context_menu_separator.rb
184
- - lib/rbui/context_menu/context_menu_trigger.rb
185
- - lib/rbui/dialog/dialog.rb
186
- - lib/rbui/dialog/dialog_content.rb
187
- - lib/rbui/dialog/dialog_description.rb
188
- - lib/rbui/dialog/dialog_footer.rb
189
- - lib/rbui/dialog/dialog_header.rb
190
- - lib/rbui/dialog/dialog_middle.rb
191
- - lib/rbui/dialog/dialog_title.rb
192
- - lib/rbui/dialog/dialog_trigger.rb
193
- - lib/rbui/dropdown_menu/dropdown_menu.rb
194
- - lib/rbui/dropdown_menu/dropdown_menu_content.rb
195
- - lib/rbui/dropdown_menu/dropdown_menu_item.rb
196
- - lib/rbui/dropdown_menu/dropdown_menu_label.rb
197
- - lib/rbui/dropdown_menu/dropdown_menu_separator.rb
198
- - lib/rbui/dropdown_menu/dropdown_menu_trigger.rb
199
- - lib/rbui/form/form.rb
200
- - lib/rbui/form/form_field.rb
201
- - lib/rbui/form/form_field_error.rb
202
- - lib/rbui/form/form_field_hint.rb
203
- - lib/rbui/form/form_field_label.rb
204
- - lib/rbui/hover_card/hover_card.rb
205
- - lib/rbui/hover_card/hover_card_content.rb
206
- - lib/rbui/hover_card/hover_card_trigger.rb
207
- - lib/rbui/input/input.rb
208
- - lib/rbui/link/link.rb
209
- - lib/rbui/pagination/pagination.rb
210
- - lib/rbui/pagination/pagination_content.rb
211
- - lib/rbui/pagination/pagination_ellipsis.rb
212
- - lib/rbui/pagination/pagination_item.rb
213
- - lib/rbui/popover/popover.rb
214
- - lib/rbui/popover/popover_content.rb
215
- - lib/rbui/popover/popover_trigger.rb
216
- - lib/rbui/radio_button/radio_button.rb
217
- - lib/rbui/railtie.rb
218
- - lib/rbui/select/select.rb
219
- - lib/rbui/select/select_content.rb
220
- - lib/rbui/select/select_group.rb
221
- - lib/rbui/select/select_input.rb
222
- - lib/rbui/select/select_item.rb
223
- - lib/rbui/select/select_label.rb
224
- - lib/rbui/select/select_trigger.rb
225
- - lib/rbui/select/select_value.rb
226
- - lib/rbui/sheet/sheet.rb
227
- - lib/rbui/sheet/sheet_content.rb
228
- - lib/rbui/sheet/sheet_description.rb
229
- - lib/rbui/sheet/sheet_footer.rb
230
- - lib/rbui/sheet/sheet_header.rb
231
- - lib/rbui/sheet/sheet_middle.rb
232
- - lib/rbui/sheet/sheet_title.rb
233
- - lib/rbui/sheet/sheet_trigger.rb
234
- - lib/rbui/shortcut_key/shortcut_key.rb
235
- - lib/rbui/table/table.rb
236
- - lib/rbui/table/table_body.rb
237
- - lib/rbui/table/table_caption.rb
238
- - lib/rbui/table/table_cell.rb
239
- - lib/rbui/table/table_footer.rb
240
- - lib/rbui/table/table_head.rb
241
- - lib/rbui/table/table_header.rb
242
- - lib/rbui/table/table_row.rb
243
- - lib/rbui/tabs/tabs.rb
244
- - lib/rbui/tabs/tabs_content.rb
245
- - lib/rbui/tabs/tabs_list.rb
246
- - lib/rbui/tabs/tabs_trigger.rb
247
- - lib/rbui/textarea/textarea.rb
248
- - lib/rbui/theme_toggle/theme_toggle.rb
249
- - lib/rbui/tooltip/tooltip.rb
250
- - lib/rbui/tooltip/tooltip_content.rb
251
- - lib/rbui/tooltip/tooltip_trigger.rb
252
- - lib/rbui/typography/typography_blockquote.rb
253
- - lib/rbui/typography/typography_h1.rb
254
- - lib/rbui/typography/typography_h2.rb
255
- - lib/rbui/typography/typography_h3.rb
256
- - lib/rbui/typography/typography_h4.rb
257
- - lib/rbui/typography/typography_inline_code.rb
258
- - lib/rbui/typography/typography_inline_link.rb
259
- - lib/rbui/typography/typography_large.rb
260
- - lib/rbui/typography/typography_lead.rb
261
- - lib/rbui/typography/typography_list.rb
262
- - lib/rbui/typography/typography_list_item.rb
263
- - lib/rbui/typography/typography_muted.rb
264
- - lib/rbui/typography/typography_p.rb
265
- - lib/rbui/typography/typography_small.rb
266
- - lib/rbui/version.rb
104
+ - LICENSE.txt
105
+ - README.md
106
+ - lib/generators/ruby_ui/component_generator.rb
107
+ - lib/generators/ruby_ui/dependencies.yml
108
+ - lib/generators/ruby_ui/install/install_generator.rb
109
+ - lib/generators/ruby_ui/install/templates/ruby_ui.rb.erb
110
+ - lib/generators/ruby_ui/install/templates/tailwind.css.erb
111
+ - lib/generators/ruby_ui/javascript_utils.rb
267
112
  - lib/ruby_ui.rb
113
+ - lib/ruby_ui/accordion/accordion.rb
114
+ - lib/ruby_ui/accordion/accordion_content.rb
115
+ - lib/ruby_ui/accordion/accordion_controller.js
116
+ - lib/ruby_ui/accordion/accordion_default_content.rb
117
+ - lib/ruby_ui/accordion/accordion_default_trigger.rb
118
+ - lib/ruby_ui/accordion/accordion_icon.rb
119
+ - lib/ruby_ui/accordion/accordion_item.rb
120
+ - lib/ruby_ui/accordion/accordion_trigger.rb
121
+ - lib/ruby_ui/alert/alert.rb
122
+ - lib/ruby_ui/alert/alert_description.rb
123
+ - lib/ruby_ui/alert/alert_title.rb
124
+ - lib/ruby_ui/alert_dialog/alert_dialog.rb
125
+ - lib/ruby_ui/alert_dialog/alert_dialog_action.rb
126
+ - lib/ruby_ui/alert_dialog/alert_dialog_cancel.rb
127
+ - lib/ruby_ui/alert_dialog/alert_dialog_content.rb
128
+ - lib/ruby_ui/alert_dialog/alert_dialog_controller.js
129
+ - lib/ruby_ui/alert_dialog/alert_dialog_description.rb
130
+ - lib/ruby_ui/alert_dialog/alert_dialog_footer.rb
131
+ - lib/ruby_ui/alert_dialog/alert_dialog_header.rb
132
+ - lib/ruby_ui/alert_dialog/alert_dialog_title.rb
133
+ - lib/ruby_ui/alert_dialog/alert_dialog_trigger.rb
134
+ - lib/ruby_ui/aspect_ratio/aspect_ratio.rb
135
+ - lib/ruby_ui/avatar/avatar.rb
136
+ - lib/ruby_ui/avatar/avatar_fallback.rb
137
+ - lib/ruby_ui/avatar/avatar_image.rb
138
+ - lib/ruby_ui/badge/badge.rb
139
+ - lib/ruby_ui/base.rb
140
+ - lib/ruby_ui/breadcrumb/breadcrumb.rb
141
+ - lib/ruby_ui/breadcrumb/breadcrumb_ellipsis.rb
142
+ - lib/ruby_ui/breadcrumb/breadcrumb_item.rb
143
+ - lib/ruby_ui/breadcrumb/breadcrumb_link.rb
144
+ - lib/ruby_ui/breadcrumb/breadcrumb_list.rb
145
+ - lib/ruby_ui/breadcrumb/breadcrumb_page.rb
146
+ - lib/ruby_ui/breadcrumb/breadcrumb_separator.rb
147
+ - lib/ruby_ui/button/button.rb
148
+ - lib/ruby_ui/calendar/calendar.rb
149
+ - lib/ruby_ui/calendar/calendar_body.rb
150
+ - lib/ruby_ui/calendar/calendar_controller.js
151
+ - lib/ruby_ui/calendar/calendar_days.rb
152
+ - lib/ruby_ui/calendar/calendar_header.rb
153
+ - lib/ruby_ui/calendar/calendar_input_controller.js
154
+ - lib/ruby_ui/calendar/calendar_next.rb
155
+ - lib/ruby_ui/calendar/calendar_prev.rb
156
+ - lib/ruby_ui/calendar/calendar_title.rb
157
+ - lib/ruby_ui/calendar/calendar_weekdays.rb
158
+ - lib/ruby_ui/card/card.rb
159
+ - lib/ruby_ui/card/card_content.rb
160
+ - lib/ruby_ui/card/card_description.rb
161
+ - lib/ruby_ui/card/card_footer.rb
162
+ - lib/ruby_ui/card/card_header.rb
163
+ - lib/ruby_ui/card/card_title.rb
164
+ - lib/ruby_ui/carousel/carousel.rb
165
+ - lib/ruby_ui/carousel/carousel_content.rb
166
+ - lib/ruby_ui/carousel/carousel_controller.js
167
+ - lib/ruby_ui/carousel/carousel_item.rb
168
+ - lib/ruby_ui/carousel/carousel_next.rb
169
+ - lib/ruby_ui/carousel/carousel_previous.rb
170
+ - lib/ruby_ui/chart/chart.rb
171
+ - lib/ruby_ui/chart/chart_controller.js
172
+ - lib/ruby_ui/checkbox/checkbox.rb
173
+ - lib/ruby_ui/checkbox/checkbox_group.rb
174
+ - lib/ruby_ui/checkbox/checkbox_group_controller.js
175
+ - lib/ruby_ui/clipboard/clipboard.rb
176
+ - lib/ruby_ui/clipboard/clipboard_controller.js
177
+ - lib/ruby_ui/clipboard/clipboard_popover.rb
178
+ - lib/ruby_ui/clipboard/clipboard_source.rb
179
+ - lib/ruby_ui/clipboard/clipboard_trigger.rb
180
+ - lib/ruby_ui/codeblock/codeblock.rb
181
+ - lib/ruby_ui/collapsible/collapsible.rb
182
+ - lib/ruby_ui/collapsible/collapsible_content.rb
183
+ - lib/ruby_ui/collapsible/collapsible_controller.js
184
+ - lib/ruby_ui/collapsible/collapsible_trigger.rb
185
+ - lib/ruby_ui/combobox/combobox.rb
186
+ - lib/ruby_ui/combobox/combobox_checkbox.rb
187
+ - lib/ruby_ui/combobox/combobox_controller.js
188
+ - lib/ruby_ui/combobox/combobox_empty_state.rb
189
+ - lib/ruby_ui/combobox/combobox_item.rb
190
+ - lib/ruby_ui/combobox/combobox_list.rb
191
+ - lib/ruby_ui/combobox/combobox_list_group.rb
192
+ - lib/ruby_ui/combobox/combobox_popover.rb
193
+ - lib/ruby_ui/combobox/combobox_radio.rb
194
+ - lib/ruby_ui/combobox/combobox_search_input.rb
195
+ - lib/ruby_ui/combobox/combobox_toggle_all_checkbox.rb
196
+ - lib/ruby_ui/combobox/combobox_trigger.rb
197
+ - lib/ruby_ui/command/command.rb
198
+ - lib/ruby_ui/command/command_controller.js
199
+ - lib/ruby_ui/command/command_dialog.rb
200
+ - lib/ruby_ui/command/command_dialog_content.rb
201
+ - lib/ruby_ui/command/command_dialog_trigger.rb
202
+ - lib/ruby_ui/command/command_empty.rb
203
+ - lib/ruby_ui/command/command_group.rb
204
+ - lib/ruby_ui/command/command_input.rb
205
+ - lib/ruby_ui/command/command_item.rb
206
+ - lib/ruby_ui/command/command_list.rb
207
+ - lib/ruby_ui/context_menu/context_menu.rb
208
+ - lib/ruby_ui/context_menu/context_menu_content.rb
209
+ - lib/ruby_ui/context_menu/context_menu_controller.js
210
+ - lib/ruby_ui/context_menu/context_menu_item.rb
211
+ - lib/ruby_ui/context_menu/context_menu_label.rb
212
+ - lib/ruby_ui/context_menu/context_menu_separator.rb
213
+ - lib/ruby_ui/context_menu/context_menu_trigger.rb
214
+ - lib/ruby_ui/dialog/dialog.rb
215
+ - lib/ruby_ui/dialog/dialog_content.rb
216
+ - lib/ruby_ui/dialog/dialog_controller.js
217
+ - lib/ruby_ui/dialog/dialog_description.rb
218
+ - lib/ruby_ui/dialog/dialog_footer.rb
219
+ - lib/ruby_ui/dialog/dialog_header.rb
220
+ - lib/ruby_ui/dialog/dialog_middle.rb
221
+ - lib/ruby_ui/dialog/dialog_title.rb
222
+ - lib/ruby_ui/dialog/dialog_trigger.rb
223
+ - lib/ruby_ui/dropdown_menu/dropdown_menu.rb
224
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_content.rb
225
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_controller.js
226
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_item.rb
227
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_label.rb
228
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_separator.rb
229
+ - lib/ruby_ui/dropdown_menu/dropdown_menu_trigger.rb
230
+ - lib/ruby_ui/form/form.rb
231
+ - lib/ruby_ui/form/form_field.rb
232
+ - lib/ruby_ui/form/form_field_controller.js
233
+ - lib/ruby_ui/form/form_field_error.rb
234
+ - lib/ruby_ui/form/form_field_hint.rb
235
+ - lib/ruby_ui/form/form_field_label.rb
236
+ - lib/ruby_ui/hover_card/hover_card.rb
237
+ - lib/ruby_ui/hover_card/hover_card_content.rb
238
+ - lib/ruby_ui/hover_card/hover_card_controller.js
239
+ - lib/ruby_ui/hover_card/hover_card_trigger.rb
240
+ - lib/ruby_ui/input/input.rb
241
+ - lib/ruby_ui/link/link.rb
242
+ - lib/ruby_ui/masked_input/masked_input.rb
243
+ - lib/ruby_ui/masked_input/masked_input_controller.js
244
+ - lib/ruby_ui/pagination/pagination.rb
245
+ - lib/ruby_ui/pagination/pagination_content.rb
246
+ - lib/ruby_ui/pagination/pagination_ellipsis.rb
247
+ - lib/ruby_ui/pagination/pagination_item.rb
248
+ - lib/ruby_ui/popover/popover.rb
249
+ - lib/ruby_ui/popover/popover_content.rb
250
+ - lib/ruby_ui/popover/popover_controller.js
251
+ - lib/ruby_ui/popover/popover_trigger.rb
252
+ - lib/ruby_ui/progress/progress.rb
253
+ - lib/ruby_ui/radio_button/radio_button.rb
254
+ - lib/ruby_ui/select/select.rb
255
+ - lib/ruby_ui/select/select_content.rb
256
+ - lib/ruby_ui/select/select_controller.js
257
+ - lib/ruby_ui/select/select_group.rb
258
+ - lib/ruby_ui/select/select_input.rb
259
+ - lib/ruby_ui/select/select_item.rb
260
+ - lib/ruby_ui/select/select_item_controller.js
261
+ - lib/ruby_ui/select/select_label.rb
262
+ - lib/ruby_ui/select/select_trigger.rb
263
+ - lib/ruby_ui/select/select_value.rb
264
+ - lib/ruby_ui/separator/separator.rb
265
+ - lib/ruby_ui/sheet/sheet.rb
266
+ - lib/ruby_ui/sheet/sheet_content.rb
267
+ - lib/ruby_ui/sheet/sheet_content_controller.js
268
+ - lib/ruby_ui/sheet/sheet_controller.js
269
+ - lib/ruby_ui/sheet/sheet_description.rb
270
+ - lib/ruby_ui/sheet/sheet_footer.rb
271
+ - lib/ruby_ui/sheet/sheet_header.rb
272
+ - lib/ruby_ui/sheet/sheet_middle.rb
273
+ - lib/ruby_ui/sheet/sheet_title.rb
274
+ - lib/ruby_ui/sheet/sheet_trigger.rb
275
+ - lib/ruby_ui/shortcut_key/shortcut_key.rb
276
+ - lib/ruby_ui/skeleton/skeleton.rb
277
+ - lib/ruby_ui/switch/switch.rb
278
+ - lib/ruby_ui/table/table.rb
279
+ - lib/ruby_ui/table/table_body.rb
280
+ - lib/ruby_ui/table/table_caption.rb
281
+ - lib/ruby_ui/table/table_cell.rb
282
+ - lib/ruby_ui/table/table_footer.rb
283
+ - lib/ruby_ui/table/table_head.rb
284
+ - lib/ruby_ui/table/table_header.rb
285
+ - lib/ruby_ui/table/table_row.rb
286
+ - lib/ruby_ui/tabs/tabs.rb
287
+ - lib/ruby_ui/tabs/tabs_content.rb
288
+ - lib/ruby_ui/tabs/tabs_controller.js
289
+ - lib/ruby_ui/tabs/tabs_list.rb
290
+ - lib/ruby_ui/tabs/tabs_trigger.rb
291
+ - lib/ruby_ui/textarea/textarea.rb
292
+ - lib/ruby_ui/theme_toggle/theme_toggle.rb
293
+ - lib/ruby_ui/theme_toggle/theme_toggle_controller.js
294
+ - lib/ruby_ui/tooltip/tooltip.rb
295
+ - lib/ruby_ui/tooltip/tooltip_content.rb
296
+ - lib/ruby_ui/tooltip/tooltip_controller.js
297
+ - lib/ruby_ui/tooltip/tooltip_trigger.rb
298
+ - lib/ruby_ui/typography/heading.rb
299
+ - lib/ruby_ui/typography/inline_code.rb
300
+ - lib/ruby_ui/typography/inline_link.rb
301
+ - lib/ruby_ui/typography/text.rb
302
+ - lib/ruby_ui/typography/typography_blockquote.rb
268
303
  homepage: https://rubygems.org/gems/ruby_ui
269
304
  licenses:
270
305
  - MIT
@@ -277,7 +312,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
277
312
  requirements:
278
313
  - - ">="
279
314
  - !ruby/object:Gem::Version
280
- version: '3.2'
315
+ version: 3.3.1
281
316
  required_rubygems_version: !ruby/object:Gem::Requirement
282
317
  requirements:
283
318
  - - ">="
@@ -1,17 +0,0 @@
1
- require "rails/generators"
2
-
3
- module RBUI
4
- module Generators
5
- class BaseGenerator < defined?(Rails::Generators::Base) ? Rails::Generators::Base : Object
6
- namespace "rbui:base"
7
-
8
- source_root File.join(__dir__, "templates")
9
-
10
- private
11
-
12
- def using_importmap?
13
- File.exist?(Rails.root.join("config/importmap.rb")) && File.exist?(Rails.root.join("bin/importmap"))
14
- end
15
- end
16
- end
17
- end
@@ -1,137 +0,0 @@
1
- module RBUI
2
- module Generators
3
- class ComponentGenerator < RBUI::Generators::BaseGenerator
4
- namespace "rbui:component"
5
-
6
- source_root File.expand_path("../../..", __dir__)
7
- argument :component_name, type: :string, required: true
8
-
9
- def copy_component
10
- return puts "This generator can only be run in a Rails environment." unless defined?(Rails::Generators::Base)
11
-
12
- copy_common_files
13
- copy_component_files
14
- end
15
-
16
- private
17
-
18
- def copy_common_files
19
- template "#{template_dir}/index.js", "#{destination_path}/index.js" unless File.exist?("#{destination_path}/index.js")
20
- copy_file File.join(source_path, "base.rb"), File.join(destination_path, "base.rb")
21
- end
22
-
23
- def copy_component_files
24
- puts "Component #{component} not found in rbui gem" if component_source.empty?
25
-
26
- component_files = Dir.glob("#{component_source}/*")
27
-
28
- component_files.each do |file|
29
- copy_file file, File.join(destination_path, component, File.basename(file))
30
- end
31
- update_index_file
32
- end
33
-
34
- def update_index_file
35
- index_path = File.join(destination_root, "app/components/rbui/index.js")
36
-
37
- rbui_index_content = File.read(index_path)
38
-
39
- updated_rbui_index_content = add_controller_registration(rbui_index_content)
40
-
41
- File.write(index_path, updated_rbui_index_content)
42
- end
43
-
44
- def add_controller_registration(rbui_index_content)
45
- valid_controllers = get_valid_controllers
46
-
47
- rbui_index_content = update_imports(rbui_index_content, valid_controllers)
48
- update_registrations(rbui_index_content, valid_controllers)
49
- # Uncomment the following line if you want to update exports
50
- # rbui_index_content = update_exports(rbui_index_content, valid_controllers)
51
- end
52
-
53
- def get_valid_controllers
54
- all_js_controllers = Dir.glob(File.join(destination_path, "**", "*_controller.js"))
55
-
56
- all_js_controllers.map do |controller_file|
57
- controller_info(controller_file)
58
- end
59
- end
60
-
61
- def controller_info(controller_file)
62
- # Get the relative path from the destination path to the controller file
63
- relative_path = Pathname.new(controller_file).relative_path_from(Pathname.new(destination_path))
64
-
65
- # Extract the file name without the .js extension
66
- file_name = relative_path.basename(".js").to_s
67
-
68
- # Remove '_controller' suffix to get the component name
69
- component_name = file_name.sub(/_controller$/, "")
70
-
71
- # Create the new controller name by camelizing the component name and adding 'Controller'
72
- new_controller = "#{component_name.camelize}Controller"
73
-
74
- # Build the new import path
75
- new_import_path = new_import_path("./#{relative_path.dirname}/#{file_name}")
76
-
77
- # Create the registration name by dasherizing the component name and prefixing with 'rbui--'
78
- registration_name = "rbui--#{component_name.dasherize}"
79
-
80
- # Return a hash with import, registration, and export statements
81
- {
82
- # Import statement for importmaps
83
- import: "import #{new_controller} from \"#{new_import_path}\";",
84
-
85
- # Registration statement for the Stimulus controller
86
- registration: "application.register(\"#{registration_name}\", #{new_controller});",
87
-
88
- # Export statement for the controller
89
- export: "export { default as #{new_controller} } from \"#{new_import_path}\";"
90
- }
91
- end
92
-
93
- def new_import_path(relative_path)
94
- if using_importmap?
95
- "rbui/#{relative_path.sub(/^\.\//, "")}"
96
- else
97
- relative_path
98
- end
99
- end
100
-
101
- def update_imports(content, controllers)
102
- imports = controllers.map { |c| c[:import] }.sort.join("\n")
103
- content.sub(/\/\/ Import all controller files.*?(?=\n\n)/m, "// Import all controller files\n#{imports}")
104
- end
105
-
106
- def update_registrations(content, controllers)
107
- registrations = controllers.map { |c| c[:registration] }.sort.join("\n")
108
- content.sub(/\/\/ Register all controllers.*?(?=\n\n)/m, "// Register all controllers\n#{registrations}")
109
- end
110
-
111
- def update_exports(content, controllers)
112
- exports = controllers.map { |c| c[:export] }.sort.join("\n")
113
- content.sub(/\/\/ Export all controllers.*?(?=\n\n)/m, "// Export all controllers so user of npm package can lazy load controllers\n#{exports}")
114
- end
115
-
116
- def component
117
- @component ||= component_name.downcase
118
- end
119
-
120
- def source_path
121
- @source_path ||= "lib/rbui"
122
- end
123
-
124
- def destination_path
125
- @destination_path ||= "app/components/rbui"
126
- end
127
-
128
- def component_source
129
- @component_source ||= File.join(self.class.source_root, source_path, component)
130
- end
131
-
132
- def template_dir
133
- @template_dir ||= File.join(__dir__, "templates")
134
- end
135
- end
136
- end
137
- end