ruby_ui 1.0.0.beta1 → 1.0.0.pre.alpha.4
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/lib/generators/rbui/base_generator.rb +17 -0
- data/lib/generators/rbui/component_generator.rb +137 -0
- data/lib/generators/rbui/install/install_generator.rb +194 -0
- data/lib/{ruby_ui → rbui}/accordion/accordion.rb +1 -1
- data/lib/{ruby_ui → rbui}/accordion/accordion_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/accordion/accordion_default_content.rb +1 -1
- data/lib/{ruby_ui → rbui}/accordion/accordion_default_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/accordion/accordion_icon.rb +2 -2
- data/lib/{ruby_ui → rbui}/accordion/accordion_item.rb +4 -4
- data/lib/{ruby_ui → rbui}/accordion/accordion_trigger.rb +2 -3
- data/lib/{ruby_ui → rbui}/alert/alert.rb +2 -2
- data/lib/{ruby_ui → rbui}/alert/alert_description.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert/alert_title.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog.rb +3 -3
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_action.rb +2 -2
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_cancel.rb +3 -3
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_content.rb +4 -4
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_description.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_footer.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_title.rb +1 -1
- data/lib/{ruby_ui → rbui}/alert_dialog/alert_dialog_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/aspect_ratio/aspect_ratio.rb +1 -1
- data/lib/{ruby_ui → rbui}/avatar/avatar.rb +2 -2
- data/lib/{ruby_ui → rbui}/avatar/avatar_fallback.rb +1 -1
- data/lib/{ruby_ui → rbui}/avatar/avatar_image.rb +1 -1
- data/lib/{ruby_ui → rbui}/badge/badge.rb +2 -2
- data/lib/{ruby_ui → rbui}/base.rb +8 -1
- data/lib/{ruby_ui → rbui}/button/button.rb +13 -13
- data/lib/rbui/calendar/calendar.rb +39 -0
- data/lib/{ruby_ui → rbui}/calendar/calendar_body.rb +2 -2
- data/lib/{ruby_ui → rbui}/calendar/calendar_days.rb +14 -14
- data/lib/{ruby_ui → rbui}/calendar/calendar_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/calendar/calendar_next.rb +2 -2
- data/lib/{ruby_ui → rbui}/calendar/calendar_prev.rb +2 -2
- data/lib/{ruby_ui → rbui}/calendar/calendar_title.rb +2 -2
- data/lib/{ruby_ui → rbui}/calendar/calendar_weekdays.rb +2 -2
- data/lib/{ruby_ui → rbui}/card/card.rb +1 -1
- data/lib/{ruby_ui → rbui}/card/card_content.rb +1 -1
- data/lib/{ruby_ui → rbui}/card/card_description.rb +1 -1
- data/lib/{ruby_ui → rbui}/card/card_footer.rb +1 -1
- data/lib/{ruby_ui → rbui}/card/card_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/card/card_title.rb +1 -1
- data/lib/{ruby_ui → rbui}/chart/chart.rb +3 -3
- data/lib/{ruby_ui → rbui}/checkbox/checkbox.rb +4 -4
- data/lib/{ruby_ui → rbui}/checkbox/checkbox_group.rb +2 -2
- data/lib/{ruby_ui → rbui}/clipboard/clipboard.rb +6 -6
- data/lib/{ruby_ui → rbui}/clipboard/clipboard_popover.rb +2 -2
- data/lib/{ruby_ui → rbui}/clipboard/clipboard_source.rb +2 -2
- data/lib/{ruby_ui → rbui}/clipboard/clipboard_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/codeblock/codeblock.rb +10 -7
- data/lib/{ruby_ui → rbui}/collapsible/collapsible.rb +3 -3
- data/lib/{ruby_ui → rbui}/collapsible/collapsible_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/collapsible/collapsible_trigger.rb +2 -2
- data/lib/rbui/combobox/combobox.rb +24 -0
- data/lib/rbui/combobox/combobox_content.rb +31 -0
- data/lib/{ruby_ui → rbui}/combobox/combobox_empty.rb +2 -2
- data/lib/{ruby_ui → rbui}/combobox/combobox_group.rb +2 -2
- data/lib/{ruby_ui → rbui}/combobox/combobox_input.rb +4 -4
- data/lib/{ruby_ui → rbui}/combobox/combobox_item.rb +5 -5
- data/lib/{ruby_ui → rbui}/combobox/combobox_list.rb +4 -2
- data/lib/{ruby_ui → rbui}/combobox/combobox_search_input.rb +3 -3
- data/lib/{ruby_ui → rbui}/combobox/combobox_separator.rb +1 -1
- data/lib/{ruby_ui → rbui}/combobox/combobox_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/combobox/combobox_value.rb +2 -2
- data/lib/{ruby_ui → rbui}/command/command.rb +1 -1
- data/lib/{ruby_ui → rbui}/command/command_dialog.rb +2 -2
- data/lib/{ruby_ui → rbui}/command/command_dialog_content.rb +6 -6
- data/lib/{ruby_ui → rbui}/command/command_dialog_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/command/command_empty.rb +2 -2
- data/lib/{ruby_ui → rbui}/command/command_group.rb +2 -2
- data/lib/{ruby_ui → rbui}/command/command_input.rb +3 -3
- data/lib/{ruby_ui → rbui}/command/command_item.rb +2 -2
- data/lib/{ruby_ui → rbui}/command/command_list.rb +1 -1
- data/lib/{ruby_ui → rbui}/context_menu/context_menu.rb +2 -2
- data/lib/{ruby_ui → rbui}/context_menu/context_menu_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/context_menu/context_menu_item.rb +3 -3
- data/lib/{ruby_ui → rbui}/context_menu/context_menu_label.rb +2 -2
- data/lib/{ruby_ui → rbui}/context_menu/context_menu_separator.rb +1 -1
- data/lib/{ruby_ui → rbui}/context_menu/context_menu_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/dialog/dialog.rb +3 -3
- data/lib/{ruby_ui → rbui}/dialog/dialog_content.rb +7 -7
- data/lib/{ruby_ui → rbui}/dialog/dialog_description.rb +1 -1
- data/lib/{ruby_ui → rbui}/dialog/dialog_footer.rb +1 -1
- data/lib/{ruby_ui → rbui}/dialog/dialog_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/dialog/dialog_middle.rb +1 -1
- data/lib/{ruby_ui → rbui}/dialog/dialog_title.rb +1 -1
- data/lib/{ruby_ui → rbui}/dialog/dialog_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu.rb +4 -4
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu_item.rb +3 -3
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu_label.rb +1 -1
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu_separator.rb +1 -1
- data/lib/{ruby_ui → rbui}/dropdown_menu/dropdown_menu_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/form/form.rb +1 -1
- data/lib/{ruby_ui → rbui}/form/form_field.rb +2 -2
- data/lib/{ruby_ui → rbui}/form/form_field_error.rb +2 -2
- data/lib/{ruby_ui → rbui}/form/form_field_hint.rb +1 -1
- data/lib/{ruby_ui → rbui}/form/form_field_label.rb +1 -1
- data/lib/{ruby_ui → rbui}/hover_card/hover_card.rb +3 -3
- data/lib/{ruby_ui → rbui}/hover_card/hover_card_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/hover_card/hover_card_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/input/input.rb +3 -3
- data/lib/{ruby_ui → rbui}/link/link.rb +13 -13
- data/lib/{ruby_ui → rbui}/pagination/pagination.rb +1 -1
- data/lib/{ruby_ui → rbui}/pagination/pagination_content.rb +1 -1
- data/lib/{ruby_ui → rbui}/pagination/pagination_ellipsis.rb +1 -1
- data/lib/{ruby_ui → rbui}/pagination/pagination_item.rb +4 -4
- data/lib/{ruby_ui → rbui}/popover/popover.rb +4 -4
- data/lib/{ruby_ui → rbui}/popover/popover_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/popover/popover_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/radio_button/radio_button.rb +3 -3
- data/lib/rbui/railtie.rb +52 -0
- data/lib/{ruby_ui → rbui}/select/select.rb +5 -5
- data/lib/{ruby_ui → rbui}/select/select_content.rb +3 -3
- data/lib/{ruby_ui → rbui}/select/select_group.rb +1 -1
- data/lib/{ruby_ui → rbui}/select/select_input.rb +4 -4
- data/lib/{ruby_ui → rbui}/select/select_item.rb +4 -4
- data/lib/{ruby_ui → rbui}/select/select_label.rb +1 -1
- data/lib/{ruby_ui → rbui}/select/select_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/select/select_value.rb +2 -2
- data/lib/{ruby_ui → rbui}/sheet/sheet.rb +2 -2
- data/lib/{ruby_ui → rbui}/sheet/sheet_content.rb +7 -7
- data/lib/{ruby_ui → rbui}/sheet/sheet_description.rb +1 -1
- data/lib/{ruby_ui → rbui}/sheet/sheet_footer.rb +1 -1
- data/lib/{ruby_ui → rbui}/sheet/sheet_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/sheet/sheet_middle.rb +1 -1
- data/lib/{ruby_ui → rbui}/sheet/sheet_title.rb +1 -1
- data/lib/{ruby_ui → rbui}/sheet/sheet_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/shortcut_key/shortcut_key.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_body.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_caption.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_cell.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_footer.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_head.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_header.rb +1 -1
- data/lib/{ruby_ui → rbui}/table/table_row.rb +1 -1
- data/lib/{ruby_ui → rbui}/tabs/tabs.rb +3 -3
- data/lib/{ruby_ui → rbui}/tabs/tabs_content.rb +2 -2
- data/lib/{ruby_ui → rbui}/tabs/tabs_list.rb +1 -1
- data/lib/{ruby_ui → rbui}/tabs/tabs_trigger.rb +3 -3
- data/lib/{ruby_ui → rbui}/textarea/textarea.rb +3 -3
- data/lib/{ruby_ui → rbui}/theme_toggle/theme_toggle.rb +4 -4
- data/lib/{ruby_ui → rbui}/tooltip/tooltip.rb +3 -3
- data/lib/{ruby_ui → rbui}/tooltip/tooltip_content.rb +3 -3
- data/lib/{ruby_ui → rbui}/tooltip/tooltip_trigger.rb +2 -2
- data/lib/{ruby_ui → rbui}/typography/typography_blockquote.rb +1 -1
- data/lib/rbui/typography/typography_h1.rb +17 -0
- data/lib/rbui/typography/typography_h2.rb +17 -0
- data/lib/rbui/typography/typography_h3.rb +17 -0
- data/lib/rbui/typography/typography_h4.rb +17 -0
- data/lib/{ruby_ui/typography/inline_code.rb → rbui/typography/typography_inline_code.rb} +2 -2
- data/lib/{ruby_ui/typography/inline_link.rb → rbui/typography/typography_inline_link.rb} +2 -2
- data/lib/rbui/typography/typography_large.rb +17 -0
- data/lib/rbui/typography/typography_lead.rb +17 -0
- data/lib/rbui/typography/typography_list.rb +47 -0
- data/lib/rbui/typography/typography_list_item.rb +17 -0
- data/lib/rbui/typography/typography_muted.rb +17 -0
- data/lib/rbui/typography/typography_p.rb +17 -0
- data/lib/rbui/typography/typography_small.rb +17 -0
- data/lib/rbui/version.rb +5 -0
- data/lib/rbui.rb +57 -0
- data/lib/ruby_ui.rb +1 -5
- metadata +174 -163
- data/lib/generators/ruby_ui/component_generator.rb +0 -130
- data/lib/generators/ruby_ui/install/install_generator.rb +0 -90
- data/lib/generators/ruby_ui/javascript_utils.rb +0 -36
- data/lib/ruby_ui/calendar/calendar.rb +0 -39
- data/lib/ruby_ui/combobox/combobox.rb +0 -24
- data/lib/ruby_ui/combobox/combobox_content.rb +0 -31
- data/lib/ruby_ui/masked_input/masked_input.rb +0 -15
- data/lib/ruby_ui/typography/heading.rb +0 -60
- data/lib/ruby_ui/typography/text.rb +0 -53
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.
|
4
|
+
version: 1.0.0.pre.alpha.4
|
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-
|
11
|
+
date: 2024-10-22 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:
|
20
|
-
type: :
|
19
|
+
version: '1.10'
|
20
|
+
type: :runtime
|
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:
|
26
|
+
version: '1.10'
|
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: :
|
34
|
+
type: :runtime
|
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: :
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
@@ -101,159 +101,170 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- lib/generators/
|
105
|
-
- lib/generators/
|
106
|
-
- lib/generators/
|
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
|
107
267
|
- lib/ruby_ui.rb
|
108
|
-
- lib/ruby_ui/accordion/accordion.rb
|
109
|
-
- lib/ruby_ui/accordion/accordion_content.rb
|
110
|
-
- lib/ruby_ui/accordion/accordion_default_content.rb
|
111
|
-
- lib/ruby_ui/accordion/accordion_default_trigger.rb
|
112
|
-
- lib/ruby_ui/accordion/accordion_icon.rb
|
113
|
-
- lib/ruby_ui/accordion/accordion_item.rb
|
114
|
-
- lib/ruby_ui/accordion/accordion_trigger.rb
|
115
|
-
- lib/ruby_ui/alert/alert.rb
|
116
|
-
- lib/ruby_ui/alert/alert_description.rb
|
117
|
-
- lib/ruby_ui/alert/alert_title.rb
|
118
|
-
- lib/ruby_ui/alert_dialog/alert_dialog.rb
|
119
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_action.rb
|
120
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_cancel.rb
|
121
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_content.rb
|
122
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_description.rb
|
123
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_footer.rb
|
124
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_header.rb
|
125
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_title.rb
|
126
|
-
- lib/ruby_ui/alert_dialog/alert_dialog_trigger.rb
|
127
|
-
- lib/ruby_ui/aspect_ratio/aspect_ratio.rb
|
128
|
-
- lib/ruby_ui/avatar/avatar.rb
|
129
|
-
- lib/ruby_ui/avatar/avatar_fallback.rb
|
130
|
-
- lib/ruby_ui/avatar/avatar_image.rb
|
131
|
-
- lib/ruby_ui/badge/badge.rb
|
132
|
-
- lib/ruby_ui/base.rb
|
133
|
-
- lib/ruby_ui/button/button.rb
|
134
|
-
- lib/ruby_ui/calendar/calendar.rb
|
135
|
-
- lib/ruby_ui/calendar/calendar_body.rb
|
136
|
-
- lib/ruby_ui/calendar/calendar_days.rb
|
137
|
-
- lib/ruby_ui/calendar/calendar_header.rb
|
138
|
-
- lib/ruby_ui/calendar/calendar_next.rb
|
139
|
-
- lib/ruby_ui/calendar/calendar_prev.rb
|
140
|
-
- lib/ruby_ui/calendar/calendar_title.rb
|
141
|
-
- lib/ruby_ui/calendar/calendar_weekdays.rb
|
142
|
-
- lib/ruby_ui/card/card.rb
|
143
|
-
- lib/ruby_ui/card/card_content.rb
|
144
|
-
- lib/ruby_ui/card/card_description.rb
|
145
|
-
- lib/ruby_ui/card/card_footer.rb
|
146
|
-
- lib/ruby_ui/card/card_header.rb
|
147
|
-
- lib/ruby_ui/card/card_title.rb
|
148
|
-
- lib/ruby_ui/chart/chart.rb
|
149
|
-
- lib/ruby_ui/checkbox/checkbox.rb
|
150
|
-
- lib/ruby_ui/checkbox/checkbox_group.rb
|
151
|
-
- lib/ruby_ui/clipboard/clipboard.rb
|
152
|
-
- lib/ruby_ui/clipboard/clipboard_popover.rb
|
153
|
-
- lib/ruby_ui/clipboard/clipboard_source.rb
|
154
|
-
- lib/ruby_ui/clipboard/clipboard_trigger.rb
|
155
|
-
- lib/ruby_ui/codeblock/codeblock.rb
|
156
|
-
- lib/ruby_ui/collapsible/collapsible.rb
|
157
|
-
- lib/ruby_ui/collapsible/collapsible_content.rb
|
158
|
-
- lib/ruby_ui/collapsible/collapsible_trigger.rb
|
159
|
-
- lib/ruby_ui/combobox/combobox.rb
|
160
|
-
- lib/ruby_ui/combobox/combobox_content.rb
|
161
|
-
- lib/ruby_ui/combobox/combobox_empty.rb
|
162
|
-
- lib/ruby_ui/combobox/combobox_group.rb
|
163
|
-
- lib/ruby_ui/combobox/combobox_input.rb
|
164
|
-
- lib/ruby_ui/combobox/combobox_item.rb
|
165
|
-
- lib/ruby_ui/combobox/combobox_list.rb
|
166
|
-
- lib/ruby_ui/combobox/combobox_search_input.rb
|
167
|
-
- lib/ruby_ui/combobox/combobox_separator.rb
|
168
|
-
- lib/ruby_ui/combobox/combobox_trigger.rb
|
169
|
-
- lib/ruby_ui/combobox/combobox_value.rb
|
170
|
-
- lib/ruby_ui/command/command.rb
|
171
|
-
- lib/ruby_ui/command/command_dialog.rb
|
172
|
-
- lib/ruby_ui/command/command_dialog_content.rb
|
173
|
-
- lib/ruby_ui/command/command_dialog_trigger.rb
|
174
|
-
- lib/ruby_ui/command/command_empty.rb
|
175
|
-
- lib/ruby_ui/command/command_group.rb
|
176
|
-
- lib/ruby_ui/command/command_input.rb
|
177
|
-
- lib/ruby_ui/command/command_item.rb
|
178
|
-
- lib/ruby_ui/command/command_list.rb
|
179
|
-
- lib/ruby_ui/context_menu/context_menu.rb
|
180
|
-
- lib/ruby_ui/context_menu/context_menu_content.rb
|
181
|
-
- lib/ruby_ui/context_menu/context_menu_item.rb
|
182
|
-
- lib/ruby_ui/context_menu/context_menu_label.rb
|
183
|
-
- lib/ruby_ui/context_menu/context_menu_separator.rb
|
184
|
-
- lib/ruby_ui/context_menu/context_menu_trigger.rb
|
185
|
-
- lib/ruby_ui/dialog/dialog.rb
|
186
|
-
- lib/ruby_ui/dialog/dialog_content.rb
|
187
|
-
- lib/ruby_ui/dialog/dialog_description.rb
|
188
|
-
- lib/ruby_ui/dialog/dialog_footer.rb
|
189
|
-
- lib/ruby_ui/dialog/dialog_header.rb
|
190
|
-
- lib/ruby_ui/dialog/dialog_middle.rb
|
191
|
-
- lib/ruby_ui/dialog/dialog_title.rb
|
192
|
-
- lib/ruby_ui/dialog/dialog_trigger.rb
|
193
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu.rb
|
194
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu_content.rb
|
195
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu_item.rb
|
196
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu_label.rb
|
197
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu_separator.rb
|
198
|
-
- lib/ruby_ui/dropdown_menu/dropdown_menu_trigger.rb
|
199
|
-
- lib/ruby_ui/form/form.rb
|
200
|
-
- lib/ruby_ui/form/form_field.rb
|
201
|
-
- lib/ruby_ui/form/form_field_error.rb
|
202
|
-
- lib/ruby_ui/form/form_field_hint.rb
|
203
|
-
- lib/ruby_ui/form/form_field_label.rb
|
204
|
-
- lib/ruby_ui/hover_card/hover_card.rb
|
205
|
-
- lib/ruby_ui/hover_card/hover_card_content.rb
|
206
|
-
- lib/ruby_ui/hover_card/hover_card_trigger.rb
|
207
|
-
- lib/ruby_ui/input/input.rb
|
208
|
-
- lib/ruby_ui/link/link.rb
|
209
|
-
- lib/ruby_ui/masked_input/masked_input.rb
|
210
|
-
- lib/ruby_ui/pagination/pagination.rb
|
211
|
-
- lib/ruby_ui/pagination/pagination_content.rb
|
212
|
-
- lib/ruby_ui/pagination/pagination_ellipsis.rb
|
213
|
-
- lib/ruby_ui/pagination/pagination_item.rb
|
214
|
-
- lib/ruby_ui/popover/popover.rb
|
215
|
-
- lib/ruby_ui/popover/popover_content.rb
|
216
|
-
- lib/ruby_ui/popover/popover_trigger.rb
|
217
|
-
- lib/ruby_ui/radio_button/radio_button.rb
|
218
|
-
- lib/ruby_ui/select/select.rb
|
219
|
-
- lib/ruby_ui/select/select_content.rb
|
220
|
-
- lib/ruby_ui/select/select_group.rb
|
221
|
-
- lib/ruby_ui/select/select_input.rb
|
222
|
-
- lib/ruby_ui/select/select_item.rb
|
223
|
-
- lib/ruby_ui/select/select_label.rb
|
224
|
-
- lib/ruby_ui/select/select_trigger.rb
|
225
|
-
- lib/ruby_ui/select/select_value.rb
|
226
|
-
- lib/ruby_ui/sheet/sheet.rb
|
227
|
-
- lib/ruby_ui/sheet/sheet_content.rb
|
228
|
-
- lib/ruby_ui/sheet/sheet_description.rb
|
229
|
-
- lib/ruby_ui/sheet/sheet_footer.rb
|
230
|
-
- lib/ruby_ui/sheet/sheet_header.rb
|
231
|
-
- lib/ruby_ui/sheet/sheet_middle.rb
|
232
|
-
- lib/ruby_ui/sheet/sheet_title.rb
|
233
|
-
- lib/ruby_ui/sheet/sheet_trigger.rb
|
234
|
-
- lib/ruby_ui/shortcut_key/shortcut_key.rb
|
235
|
-
- lib/ruby_ui/table/table.rb
|
236
|
-
- lib/ruby_ui/table/table_body.rb
|
237
|
-
- lib/ruby_ui/table/table_caption.rb
|
238
|
-
- lib/ruby_ui/table/table_cell.rb
|
239
|
-
- lib/ruby_ui/table/table_footer.rb
|
240
|
-
- lib/ruby_ui/table/table_head.rb
|
241
|
-
- lib/ruby_ui/table/table_header.rb
|
242
|
-
- lib/ruby_ui/table/table_row.rb
|
243
|
-
- lib/ruby_ui/tabs/tabs.rb
|
244
|
-
- lib/ruby_ui/tabs/tabs_content.rb
|
245
|
-
- lib/ruby_ui/tabs/tabs_list.rb
|
246
|
-
- lib/ruby_ui/tabs/tabs_trigger.rb
|
247
|
-
- lib/ruby_ui/textarea/textarea.rb
|
248
|
-
- lib/ruby_ui/theme_toggle/theme_toggle.rb
|
249
|
-
- lib/ruby_ui/tooltip/tooltip.rb
|
250
|
-
- lib/ruby_ui/tooltip/tooltip_content.rb
|
251
|
-
- lib/ruby_ui/tooltip/tooltip_trigger.rb
|
252
|
-
- lib/ruby_ui/typography/heading.rb
|
253
|
-
- lib/ruby_ui/typography/inline_code.rb
|
254
|
-
- lib/ruby_ui/typography/inline_link.rb
|
255
|
-
- lib/ruby_ui/typography/text.rb
|
256
|
-
- lib/ruby_ui/typography/typography_blockquote.rb
|
257
268
|
homepage: https://rubygems.org/gems/ruby_ui
|
258
269
|
licenses:
|
259
270
|
- MIT
|
@@ -266,14 +277,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
266
277
|
requirements:
|
267
278
|
- - ">="
|
268
279
|
- !ruby/object:Gem::Version
|
269
|
-
version: 3.
|
280
|
+
version: '3.2'
|
270
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
282
|
requirements:
|
272
283
|
- - ">="
|
273
284
|
- !ruby/object:Gem::Version
|
274
285
|
version: '0'
|
275
286
|
requirements: []
|
276
|
-
rubygems_version: 3.5.
|
287
|
+
rubygems_version: 3.5.11
|
277
288
|
signing_key:
|
278
289
|
specification_version: 4
|
279
290
|
summary: RubyUI is a UI Component Library for Ruby developers.
|
@@ -1,130 +0,0 @@
|
|
1
|
-
require_relative "javascript_utils"
|
2
|
-
module RubyUI
|
3
|
-
module Generators
|
4
|
-
class ComponentGenerator < Rails::Generators::Base
|
5
|
-
include RubyUI::Generators::JavascriptUtils
|
6
|
-
|
7
|
-
namespace "ruby_ui:component"
|
8
|
-
|
9
|
-
source_root File.expand_path("../../ruby_ui", __dir__)
|
10
|
-
argument :component_name, type: :string, required: true
|
11
|
-
|
12
|
-
def generate_component
|
13
|
-
if component_not_found?
|
14
|
-
say "Component not found: #{component_name}", :red
|
15
|
-
exit
|
16
|
-
end
|
17
|
-
|
18
|
-
say "Generating component files"
|
19
|
-
end
|
20
|
-
|
21
|
-
def copy_main_component_file
|
22
|
-
main_component_file_path = File.join(component_folder_path, "#{component_folder_name}.rb")
|
23
|
-
|
24
|
-
# some components dont't have a main component, eg. Typography
|
25
|
-
return unless File.exist? main_component_file_path
|
26
|
-
|
27
|
-
say "Generating main component"
|
28
|
-
|
29
|
-
copy_file main_component_file_path, Rails.root.join("app/components/ruby_ui", "#{component_folder_name}.rb")
|
30
|
-
end
|
31
|
-
|
32
|
-
def copy_related_component_files
|
33
|
-
return if related_components_file_paths.empty?
|
34
|
-
|
35
|
-
say "Generating related components"
|
36
|
-
|
37
|
-
related_components_file_paths.each do |file_path|
|
38
|
-
component_file_name = file_path.split("/").last
|
39
|
-
copy_file file_path, Rails.root.join("app/components/ruby_ui", component_folder_name, component_file_name)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def copy_js_files
|
44
|
-
return if js_controller_file_paths.empty?
|
45
|
-
|
46
|
-
say "Generating Stimulus controllers"
|
47
|
-
|
48
|
-
js_controller_file_paths.each do |file_path|
|
49
|
-
controller_file_name = file_path.split("/").last
|
50
|
-
copy_file file_path, Rails.root.join("app/javascript/controllers/ruby_ui", controller_file_name)
|
51
|
-
end
|
52
|
-
|
53
|
-
# Importmap doesn't have controller manifest, instead it uses `eagerLoadControllersFrom("controllers", application)`
|
54
|
-
if !using_importmap?
|
55
|
-
say "Updating Stimulus controllers manifest"
|
56
|
-
run "rake stimulus:manifest:update"
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def install_dependencies
|
61
|
-
return if dependencies.blank?
|
62
|
-
|
63
|
-
say "Installing dependencies"
|
64
|
-
|
65
|
-
install_components_dependencies(dependencies["components"])
|
66
|
-
install_gems_dependencies(dependencies["gems"])
|
67
|
-
install_js_packages(dependencies["js_packages"])
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
|
72
|
-
def component_not_found? = !Dir.exist?(component_folder_path)
|
73
|
-
|
74
|
-
def component_folder_name = component_name.underscore
|
75
|
-
|
76
|
-
def component_folder_path = File.join(self.class.source_root, component_folder_name)
|
77
|
-
|
78
|
-
def main_component_file_path = File.join(component_folder_path, "#{component_folder_name}.rb")
|
79
|
-
|
80
|
-
def related_components_file_paths = Dir.glob(File.join(component_folder_path, "*.rb")) - [main_component_file_path]
|
81
|
-
|
82
|
-
def js_controller_file_paths = Dir.glob(File.join(component_folder_path, "*.js"))
|
83
|
-
|
84
|
-
def install_components_dependencies(components)
|
85
|
-
components&.each do |component|
|
86
|
-
run "bin/rails generate ruby_ui:component #{component}"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def install_gems_dependencies(gems)
|
91
|
-
gems&.each do |ruby_gem|
|
92
|
-
run "bundle show #{ruby_gem} > /dev/null 2>&1 || bundle add #{ruby_gem}"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def install_js_packages(js_packages)
|
97
|
-
js_packages&.each do |js_package|
|
98
|
-
install_js_package(js_package)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
def pin_motion
|
103
|
-
say <<~TEXT
|
104
|
-
WARNING: Installing motion from CDN because `bin/importmap pin motion` doesn't download the correct file.
|
105
|
-
TEXT
|
106
|
-
|
107
|
-
inject_into_file Rails.root.join("config/importmap.rb"), <<~RUBY
|
108
|
-
pin "motion", to: "https://cdn.jsdelivr.net/npm/motion@11.11.17/+esm"\n
|
109
|
-
RUBY
|
110
|
-
end
|
111
|
-
|
112
|
-
def pin_tippy_js
|
113
|
-
say <<~TEXT
|
114
|
-
WARNING: Installing tippy.js from CDN because `bin/importmap pin tippy.js` doesn't download the correct file.
|
115
|
-
TEXT
|
116
|
-
|
117
|
-
inject_into_file Rails.root.join("config/importmap.rb"), <<~RUBY
|
118
|
-
pin "tippy.js", to: "https://cdn.jsdelivr.net/npm/tippy.js@6.3.7/+esm"
|
119
|
-
pin "@popperjs/core", to: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/+esm"\n
|
120
|
-
RUBY
|
121
|
-
end
|
122
|
-
|
123
|
-
def dependencies
|
124
|
-
@dependencies ||= YAML.load_file(File.join(__dir__, "dependencies.yml")).freeze
|
125
|
-
|
126
|
-
@dependencies[component_folder_name]
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
require "rails/generators"
|
2
|
-
require_relative "../javascript_utils"
|
3
|
-
|
4
|
-
module RubyUI
|
5
|
-
module Generators
|
6
|
-
class InstallGenerator < Rails::Generators::Base
|
7
|
-
include RubyUI::Generators::JavascriptUtils
|
8
|
-
|
9
|
-
namespace "ruby_ui:install"
|
10
|
-
|
11
|
-
source_root File.expand_path("templates", __dir__)
|
12
|
-
|
13
|
-
def install_phlex_rails
|
14
|
-
say "Checking for phlex-rails"
|
15
|
-
|
16
|
-
if gem_installed?("phlex-rails")
|
17
|
-
if Gem::Specification.find_by_name("phlex-rails").version < "2.0.0.beta2"
|
18
|
-
say "You need to upgrade to phlex-rails 2 to use RubyUI", :red
|
19
|
-
exit
|
20
|
-
else
|
21
|
-
say "phlex-rails is already installed", :green
|
22
|
-
end
|
23
|
-
else
|
24
|
-
say "Adding phlex-rails to Gemfile"
|
25
|
-
run %(bundle add phlex-rails --github="phlex-ruby/phlex-rails")
|
26
|
-
|
27
|
-
say "Running phlex-rails structure"
|
28
|
-
run "bin/rails generate phlex:install"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def install_tailwind_merge
|
33
|
-
say "Checking for tailwind_merge"
|
34
|
-
|
35
|
-
if gem_installed?("tailwind_merge")
|
36
|
-
say "tailwind_merge is already installed", :green
|
37
|
-
else
|
38
|
-
say "Adding phlex-rails to Gemfile"
|
39
|
-
run %(bundle add tailwind_merge)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def install_ruby_ui_initializer
|
44
|
-
say "Creating RubyUI initializer"
|
45
|
-
template "ruby_ui.rb.erb", Rails.root.join("config/initializers/ruby_ui.rb")
|
46
|
-
end
|
47
|
-
|
48
|
-
def add_ruby_ui_module_to_components_base
|
49
|
-
say "Adding RubyUI Kit to Components::Base"
|
50
|
-
insert_into_file Rails.root.join("app/components/base.rb"), after: "include Components" do
|
51
|
-
"\n include RubyUI"
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def add_tailwind_css
|
56
|
-
say "Adding RubyUI styles to application css"
|
57
|
-
template "application.tailwind.css.erb", Rails.root.join("app/assets/stylesheets/application.tailwind.css")
|
58
|
-
end
|
59
|
-
|
60
|
-
def add_tailwind_config
|
61
|
-
say "Adding RubyUI config to tailwind config"
|
62
|
-
|
63
|
-
if File.exist?(Rails.root.join("tailwind.config.js")) # tailwindcss js package
|
64
|
-
template "tailwind.config.js.js-package.erb", Rails.root.join("tailwind.config.js")
|
65
|
-
elsif File.exist?(Rails.root.join("config/tailwind.config.js")) # tailwindcss-rails gem
|
66
|
-
template "tailwind.config.js.tailwindcss-rails.erb", Rails.root.join("config/tailwind.config.js")
|
67
|
-
else
|
68
|
-
say "Cannot find tailwind.config.js. You will need to install tailwind config manually", :red
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def install_tailwind_animate
|
73
|
-
say "Installing tailwindcss-animate plugin"
|
74
|
-
|
75
|
-
install_js_package("tailwindcss-animate")
|
76
|
-
end
|
77
|
-
|
78
|
-
def add_ruby_ui_base
|
79
|
-
say "Adding RubyUI::Base component"
|
80
|
-
template "../../../../ruby_ui/base.rb", Rails.root.join("app/components/ruby_ui/base.rb")
|
81
|
-
end
|
82
|
-
|
83
|
-
private
|
84
|
-
|
85
|
-
def gem_installed?(name)
|
86
|
-
Gem::Specification.find_all_by_name(name).any?
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module RubyUI
|
2
|
-
module Generators
|
3
|
-
module JavascriptUtils
|
4
|
-
def install_js_package(package)
|
5
|
-
if using_importmap?
|
6
|
-
pin_with_importmap(package)
|
7
|
-
elsif using_yarn?
|
8
|
-
run "yarn add #{package}"
|
9
|
-
elsif using_npm?
|
10
|
-
run "npm install #{package}"
|
11
|
-
else
|
12
|
-
say "Could not detect the package manager, you need to install '#{package}' manually", :red
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def pin_with_importmap(package)
|
17
|
-
case package
|
18
|
-
when "motion"
|
19
|
-
pin_motion
|
20
|
-
when "tippy.js"
|
21
|
-
pin_tippy_js
|
22
|
-
else
|
23
|
-
run "bin/importmap pin #{package}"
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def using_importmap?
|
28
|
-
File.exist?(Rails.root.join("config/importmap.rb")) && File.exist?(Rails.root.join("bin/importmap"))
|
29
|
-
end
|
30
|
-
|
31
|
-
def using_npm? = File.exist?(Rails.root.join("package-lock.json"))
|
32
|
-
|
33
|
-
def using_yarn? = File.exist?(Rails.root.join("yarn.lock"))
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RubyUI
|
4
|
-
class Calendar < Base
|
5
|
-
def initialize(selected_date: nil, input_id: nil, date_format: "yyyy-MM-dd", **attrs)
|
6
|
-
@selected_date = selected_date
|
7
|
-
@input_id = input_id
|
8
|
-
@date_format = date_format
|
9
|
-
super(**attrs)
|
10
|
-
end
|
11
|
-
|
12
|
-
def view_template
|
13
|
-
div(**attrs) do
|
14
|
-
RubyUI.CalendarHeader do
|
15
|
-
RubyUI.CalendarTitle
|
16
|
-
RubyUI.CalendarPrev
|
17
|
-
RubyUI.CalendarNext
|
18
|
-
end
|
19
|
-
RubyUI.CalendarBody # Where the calendar is rendered (Weekdays and Days)
|
20
|
-
RubyUI.CalendarWeekdays # Template for the weekdays
|
21
|
-
RubyUI.CalendarDays # Template for the days
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def default_attrs
|
28
|
-
{
|
29
|
-
class: "p-3 space-y-4",
|
30
|
-
data: {
|
31
|
-
controller: "ruby-ui--calendar",
|
32
|
-
ruby_ui__calendar_selected_date_value: @selected_date&.to_s,
|
33
|
-
ruby_ui__calendar_format_value: @date_format,
|
34
|
-
ruby_ui__calendar_ruby_ui__calendar_input_outlet: @input_id
|
35
|
-
}
|
36
|
-
}
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|