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.
- checksums.yaml +4 -4
- data/LICENSE.txt +21 -0
- data/README.md +85 -0
- data/lib/generators/ruby_ui/component_generator.rb +94 -0
- data/lib/generators/ruby_ui/dependencies.yml +74 -0
- data/lib/generators/ruby_ui/install/install_generator.rb +89 -0
- data/lib/generators/ruby_ui/install/templates/ruby_ui.rb.erb +18 -0
- data/lib/generators/ruby_ui/install/templates/tailwind.css.erb +156 -0
- data/lib/generators/ruby_ui/javascript_utils.rb +57 -0
- data/lib/{rbui → ruby_ui}/accordion/accordion.rb +1 -1
- data/lib/{rbui → ruby_ui}/accordion/accordion_content.rb +2 -2
- data/lib/ruby_ui/accordion/accordion_controller.js +97 -0
- data/lib/{rbui → ruby_ui}/accordion/accordion_default_content.rb +1 -1
- data/lib/{rbui → ruby_ui}/accordion/accordion_default_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/accordion/accordion_icon.rb +2 -2
- data/lib/{rbui → ruby_ui}/accordion/accordion_item.rb +4 -4
- data/lib/{rbui → ruby_ui}/accordion/accordion_trigger.rb +3 -2
- data/lib/{rbui → ruby_ui}/alert/alert.rb +3 -3
- data/lib/{rbui → ruby_ui}/alert/alert_description.rb +1 -1
- data/lib/{rbui → ruby_ui}/alert/alert_title.rb +1 -1
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog.rb +3 -3
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_action.rb +2 -2
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_cancel.rb +3 -3
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_content.rb +5 -5
- data/lib/ruby_ui/alert_dialog/alert_dialog_controller.js +31 -0
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_description.rb +1 -1
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_footer.rb +2 -2
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_header.rb +2 -2
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_title.rb +1 -1
- data/lib/{rbui → ruby_ui}/alert_dialog/alert_dialog_trigger.rb +2 -2
- data/lib/{rbui → ruby_ui}/aspect_ratio/aspect_ratio.rb +1 -1
- data/lib/{rbui → ruby_ui}/avatar/avatar.rb +2 -2
- data/lib/{rbui → ruby_ui}/avatar/avatar_fallback.rb +1 -1
- data/lib/{rbui → ruby_ui}/avatar/avatar_image.rb +1 -1
- data/lib/{rbui → ruby_ui}/badge/badge.rb +2 -2
- data/lib/{rbui → ruby_ui}/base.rb +1 -8
- data/lib/ruby_ui/breadcrumb/breadcrumb.rb +17 -0
- data/lib/ruby_ui/breadcrumb/breadcrumb_ellipsis.rb +39 -0
- data/lib/{rbui/typography/typography_list_item.rb → ruby_ui/breadcrumb/breadcrumb_item.rb} +3 -3
- data/lib/ruby_ui/breadcrumb/breadcrumb_link.rb +22 -0
- data/lib/ruby_ui/breadcrumb/breadcrumb_list.rb +17 -0
- data/lib/ruby_ui/breadcrumb/breadcrumb_page.rb +19 -0
- data/lib/ruby_ui/breadcrumb/breadcrumb_separator.rb +38 -0
- data/lib/{rbui → ruby_ui}/button/button.rb +13 -13
- data/lib/ruby_ui/calendar/calendar.rb +39 -0
- data/lib/{rbui → ruby_ui}/calendar/calendar_body.rb +2 -2
- data/lib/ruby_ui/calendar/calendar_controller.js +249 -0
- data/lib/{rbui → ruby_ui}/calendar/calendar_days.rb +14 -14
- data/lib/{rbui → ruby_ui}/calendar/calendar_header.rb +1 -1
- data/lib/ruby_ui/calendar/calendar_input_controller.js +8 -0
- data/lib/{rbui → ruby_ui}/calendar/calendar_next.rb +2 -2
- data/lib/{rbui → ruby_ui}/calendar/calendar_prev.rb +2 -2
- data/lib/{rbui → ruby_ui}/calendar/calendar_title.rb +2 -2
- data/lib/{rbui → ruby_ui}/calendar/calendar_weekdays.rb +2 -2
- data/lib/{rbui → ruby_ui}/card/card.rb +1 -1
- data/lib/{rbui → ruby_ui}/card/card_content.rb +1 -1
- data/lib/{rbui → ruby_ui}/card/card_description.rb +1 -1
- data/lib/{rbui → ruby_ui}/card/card_footer.rb +1 -1
- data/lib/{rbui → ruby_ui}/card/card_header.rb +1 -1
- data/lib/{rbui → ruby_ui}/card/card_title.rb +1 -1
- data/lib/ruby_ui/carousel/carousel.rb +44 -0
- data/lib/ruby_ui/carousel/carousel_content.rb +23 -0
- data/lib/ruby_ui/carousel/carousel_controller.js +60 -0
- data/lib/ruby_ui/carousel/carousel_item.rb +23 -0
- data/lib/ruby_ui/carousel/carousel_next.rb +48 -0
- data/lib/ruby_ui/carousel/carousel_previous.rb +49 -0
- data/lib/{rbui → ruby_ui}/chart/chart.rb +3 -3
- data/lib/ruby_ui/chart/chart_controller.js +103 -0
- data/lib/{rbui → ruby_ui}/checkbox/checkbox.rb +4 -4
- data/lib/{rbui → ruby_ui}/checkbox/checkbox_group.rb +2 -2
- data/lib/ruby_ui/checkbox/checkbox_group_controller.js +21 -0
- data/lib/{rbui → ruby_ui}/clipboard/clipboard.rb +6 -6
- data/lib/ruby_ui/clipboard/clipboard_controller.js +54 -0
- data/lib/{rbui → ruby_ui}/clipboard/clipboard_popover.rb +2 -2
- data/lib/{rbui → ruby_ui}/clipboard/clipboard_source.rb +2 -2
- data/lib/{rbui → ruby_ui}/clipboard/clipboard_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/codeblock/codeblock.rb +7 -10
- data/lib/{rbui → ruby_ui}/collapsible/collapsible.rb +3 -3
- data/lib/{rbui → ruby_ui}/collapsible/collapsible_content.rb +2 -2
- data/lib/ruby_ui/collapsible/collapsible_controller.js +47 -0
- data/lib/{rbui → ruby_ui}/collapsible/collapsible_trigger.rb +2 -2
- data/lib/ruby_ui/combobox/combobox.rb +26 -0
- data/lib/ruby_ui/combobox/combobox_checkbox.rb +25 -0
- data/lib/ruby_ui/combobox/combobox_controller.js +176 -0
- data/lib/{rbui/combobox/combobox_empty.rb → ruby_ui/combobox/combobox_empty_state.rb} +3 -3
- data/lib/ruby_ui/combobox/combobox_item.rb +25 -0
- data/lib/ruby_ui/combobox/combobox_list.rb +18 -0
- data/lib/ruby_ui/combobox/combobox_list_group.rb +20 -0
- data/lib/ruby_ui/combobox/combobox_popover.rb +30 -0
- data/lib/ruby_ui/combobox/combobox_radio.rb +26 -0
- data/lib/{rbui → ruby_ui}/combobox/combobox_search_input.rb +22 -25
- data/lib/ruby_ui/combobox/combobox_toggle_all_checkbox.rb +25 -0
- data/lib/{rbui → ruby_ui}/combobox/combobox_trigger.rb +26 -21
- data/lib/{rbui → ruby_ui}/command/command.rb +1 -1
- data/lib/ruby_ui/command/command_controller.js +136 -0
- data/lib/{rbui → ruby_ui}/command/command_dialog.rb +2 -2
- data/lib/{rbui → ruby_ui}/command/command_dialog_content.rb +6 -6
- data/lib/{rbui → ruby_ui}/command/command_dialog_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/command/command_empty.rb +2 -2
- data/lib/{rbui → ruby_ui}/command/command_group.rb +2 -2
- data/lib/{rbui → ruby_ui}/command/command_input.rb +3 -3
- data/lib/{rbui → ruby_ui}/command/command_item.rb +2 -2
- data/lib/{rbui → ruby_ui}/command/command_list.rb +1 -1
- data/lib/{rbui → ruby_ui}/context_menu/context_menu.rb +2 -2
- data/lib/{rbui → ruby_ui}/context_menu/context_menu_content.rb +2 -2
- data/lib/ruby_ui/context_menu/context_menu_controller.js +144 -0
- data/lib/{rbui → ruby_ui}/context_menu/context_menu_item.rb +3 -3
- data/lib/{rbui → ruby_ui}/context_menu/context_menu_label.rb +2 -2
- data/lib/{rbui → ruby_ui}/context_menu/context_menu_separator.rb +1 -1
- data/lib/{rbui → ruby_ui}/context_menu/context_menu_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/dialog/dialog.rb +3 -3
- data/lib/{rbui → ruby_ui}/dialog/dialog_content.rb +9 -9
- data/lib/ruby_ui/dialog/dialog_controller.js +32 -0
- data/lib/{rbui → ruby_ui}/dialog/dialog_description.rb +1 -1
- data/lib/{rbui → ruby_ui}/dialog/dialog_footer.rb +2 -2
- data/lib/{rbui → ruby_ui}/dialog/dialog_header.rb +2 -2
- data/lib/{rbui → ruby_ui}/dialog/dialog_middle.rb +1 -1
- data/lib/{rbui → ruby_ui}/dialog/dialog_title.rb +1 -1
- data/lib/{rbui → ruby_ui}/dialog/dialog_trigger.rb +2 -2
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu.rb +4 -4
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_content.rb +2 -2
- data/lib/ruby_ui/dropdown_menu/dropdown_menu_controller.js +120 -0
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_item.rb +3 -3
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_label.rb +1 -1
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_separator.rb +1 -1
- data/lib/{rbui → ruby_ui}/dropdown_menu/dropdown_menu_trigger.rb +2 -2
- data/lib/{rbui → ruby_ui}/form/form.rb +1 -1
- data/lib/{rbui → ruby_ui}/form/form_field.rb +2 -2
- data/lib/ruby_ui/form/form_field_controller.js +61 -0
- data/lib/{rbui → ruby_ui}/form/form_field_error.rb +2 -2
- data/lib/{rbui → ruby_ui}/form/form_field_hint.rb +1 -1
- data/lib/{rbui → ruby_ui}/form/form_field_label.rb +1 -1
- data/lib/{rbui → ruby_ui}/hover_card/hover_card.rb +3 -3
- data/lib/{rbui → ruby_ui}/hover_card/hover_card_content.rb +2 -2
- data/lib/ruby_ui/hover_card/hover_card_controller.js +144 -0
- data/lib/{rbui → ruby_ui}/hover_card/hover_card_trigger.rb +2 -2
- data/lib/{rbui → ruby_ui}/input/input.rb +3 -3
- data/lib/{rbui → ruby_ui}/link/link.rb +13 -13
- data/lib/ruby_ui/masked_input/masked_input.rb +15 -0
- data/lib/ruby_ui/masked_input/masked_input_controller.js +9 -0
- data/lib/{rbui → ruby_ui}/pagination/pagination.rb +1 -1
- data/lib/{rbui → ruby_ui}/pagination/pagination_content.rb +1 -1
- data/lib/{rbui → ruby_ui}/pagination/pagination_ellipsis.rb +1 -1
- data/lib/{rbui → ruby_ui}/pagination/pagination_item.rb +4 -4
- data/lib/{rbui → ruby_ui}/popover/popover.rb +4 -4
- data/lib/{rbui → ruby_ui}/popover/popover_content.rb +2 -2
- data/lib/ruby_ui/popover/popover_controller.js +107 -0
- data/lib/{rbui → ruby_ui}/popover/popover_trigger.rb +2 -2
- data/lib/ruby_ui/progress/progress.rb +37 -0
- data/lib/ruby_ui/radio_button/radio_button.rb +25 -0
- data/lib/{rbui → ruby_ui}/select/select.rb +5 -5
- data/lib/{rbui → ruby_ui}/select/select_content.rb +3 -3
- data/lib/ruby_ui/select/select_controller.js +171 -0
- data/lib/{rbui → ruby_ui}/select/select_group.rb +1 -1
- data/lib/{rbui → ruby_ui}/select/select_input.rb +4 -4
- data/lib/{rbui → ruby_ui}/select/select_item.rb +4 -4
- data/lib/ruby_ui/select/select_item_controller.js +11 -0
- data/lib/{rbui → ruby_ui}/select/select_label.rb +1 -1
- data/lib/{rbui → ruby_ui}/select/select_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/select/select_value.rb +3 -3
- data/lib/ruby_ui/separator/separator.rb +38 -0
- data/lib/{rbui → ruby_ui}/sheet/sheet.rb +2 -2
- data/lib/{rbui → ruby_ui}/sheet/sheet_content.rb +8 -8
- data/lib/ruby_ui/sheet/sheet_content_controller.js +7 -0
- data/lib/ruby_ui/sheet/sheet_controller.js +9 -0
- data/lib/{rbui → ruby_ui}/sheet/sheet_description.rb +1 -1
- data/lib/{rbui → ruby_ui}/sheet/sheet_footer.rb +1 -1
- data/lib/{rbui → ruby_ui}/sheet/sheet_header.rb +1 -1
- data/lib/{rbui → ruby_ui}/sheet/sheet_middle.rb +1 -1
- data/lib/{rbui → ruby_ui}/sheet/sheet_title.rb +1 -1
- data/lib/{rbui → ruby_ui}/sheet/sheet_trigger.rb +2 -2
- data/lib/{rbui → ruby_ui}/shortcut_key/shortcut_key.rb +1 -1
- data/lib/ruby_ui/skeleton/skeleton.rb +17 -0
- data/lib/ruby_ui/switch/switch.rb +24 -0
- data/lib/{rbui → ruby_ui}/table/table.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_body.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_caption.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_cell.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_footer.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_head.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_header.rb +1 -1
- data/lib/{rbui → ruby_ui}/table/table_row.rb +1 -1
- data/lib/{rbui → ruby_ui}/tabs/tabs.rb +3 -3
- data/lib/{rbui → ruby_ui}/tabs/tabs_content.rb +2 -2
- data/lib/ruby_ui/tabs/tabs_controller.js +45 -0
- data/lib/{rbui → ruby_ui}/tabs/tabs_list.rb +1 -1
- data/lib/{rbui → ruby_ui}/tabs/tabs_trigger.rb +3 -3
- data/lib/{rbui → ruby_ui}/textarea/textarea.rb +3 -3
- data/lib/{rbui → ruby_ui}/theme_toggle/theme_toggle.rb +4 -4
- data/lib/ruby_ui/theme_toggle/theme_toggle_controller.js +30 -0
- data/lib/{rbui → ruby_ui}/tooltip/tooltip.rb +3 -3
- data/lib/{rbui → ruby_ui}/tooltip/tooltip_content.rb +3 -3
- data/lib/ruby_ui/tooltip/tooltip_controller.js +37 -0
- data/lib/{rbui → ruby_ui}/tooltip/tooltip_trigger.rb +2 -2
- data/lib/ruby_ui/typography/heading.rb +60 -0
- data/lib/{rbui/typography/typography_inline_code.rb → ruby_ui/typography/inline_code.rb} +2 -2
- data/lib/{rbui/typography/typography_inline_link.rb → ruby_ui/typography/inline_link.rb} +2 -2
- data/lib/ruby_ui/typography/text.rb +53 -0
- data/lib/{rbui → ruby_ui}/typography/typography_blockquote.rb +1 -1
- data/lib/ruby_ui.rb +5 -1
- metadata +208 -173
- data/lib/generators/rbui/base_generator.rb +0 -17
- data/lib/generators/rbui/component_generator.rb +0 -137
- data/lib/generators/rbui/install/install_generator.rb +0 -194
- data/lib/rbui/calendar/calendar.rb +0 -39
- data/lib/rbui/combobox/combobox.rb +0 -24
- data/lib/rbui/combobox/combobox_content.rb +0 -31
- data/lib/rbui/combobox/combobox_group.rb +0 -38
- data/lib/rbui/combobox/combobox_input.rb +0 -22
- data/lib/rbui/combobox/combobox_item.rb +0 -53
- data/lib/rbui/combobox/combobox_list.rb +0 -29
- data/lib/rbui/combobox/combobox_separator.rb +0 -15
- data/lib/rbui/combobox/combobox_value.rb +0 -27
- data/lib/rbui/radio_button/radio_button.rb +0 -22
- data/lib/rbui/railtie.rb +0 -52
- data/lib/rbui/typography/typography_h1.rb +0 -17
- data/lib/rbui/typography/typography_h2.rb +0 -17
- data/lib/rbui/typography/typography_h3.rb +0 -17
- data/lib/rbui/typography/typography_h4.rb +0 -17
- data/lib/rbui/typography/typography_large.rb +0 -17
- data/lib/rbui/typography/typography_lead.rb +0 -17
- data/lib/rbui/typography/typography_list.rb +0 -47
- data/lib/rbui/typography/typography_muted.rb +0 -17
- data/lib/rbui/typography/typography_p.rb +0 -17
- data/lib/rbui/typography/typography_small.rb +0 -17
- data/lib/rbui/version.rb +0 -5
- data/lib/rbui.rb +0 -57
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RBUI
|
4
|
-
class TypographyList < Base
|
5
|
-
def initialize(items: [], numbered: false, **attrs)
|
6
|
-
@items = items
|
7
|
-
@numbered = numbered
|
8
|
-
super(**attrs)
|
9
|
-
end
|
10
|
-
|
11
|
-
def view_template(&)
|
12
|
-
if @items.empty?
|
13
|
-
list(**attrs, &)
|
14
|
-
else
|
15
|
-
list(**attrs) do
|
16
|
-
@items.each do |item|
|
17
|
-
TypographyListItem { item }
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def list(**attrs, &)
|
26
|
-
if numbered?
|
27
|
-
ol(**attrs, &)
|
28
|
-
else
|
29
|
-
ul(**attrs, &)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def numbered? = @numbered
|
34
|
-
|
35
|
-
def not_numbered? = !numbered?
|
36
|
-
|
37
|
-
def default_attrs
|
38
|
-
{
|
39
|
-
class: tokens(
|
40
|
-
"my-6 ml-6 [&>li]:mt-2 [&>li]:pl-2",
|
41
|
-
numbered?: "list-decimal marker:font-medium",
|
42
|
-
not_numbered?: "list-disc"
|
43
|
-
)
|
44
|
-
}
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/lib/rbui/version.rb
DELETED
data/lib/rbui.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "json"
|
4
|
-
require "phlex"
|
5
|
-
|
6
|
-
module RBUI
|
7
|
-
extend Phlex::Kit
|
8
|
-
|
9
|
-
def self.setup
|
10
|
-
yield self
|
11
|
-
create_namespace_module if namespace
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.create_namespace_module
|
15
|
-
source_module = self
|
16
|
-
mod = namespace.to_s.split("::").inject(Object) do |parent, const|
|
17
|
-
parent.const_get(const)
|
18
|
-
rescue
|
19
|
-
parent.const_set(const, Module.new)
|
20
|
-
end
|
21
|
-
|
22
|
-
mod.singleton_class.class_eval do
|
23
|
-
define_method :const_missing do |name|
|
24
|
-
source_module.const_defined?(name) ? source_module.const_get(name) : super(name)
|
25
|
-
end
|
26
|
-
|
27
|
-
define_method :method_missing do |name, *args, &block|
|
28
|
-
source_module.respond_to?(name) ? source_module.send(name, *args, &block) : super(name, *args, &block)
|
29
|
-
end
|
30
|
-
|
31
|
-
define_method :respond_to_missing? do |name, include_private = false|
|
32
|
-
source_module.respond_to?(name) || super(name, include_private)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.namespace
|
38
|
-
@namespace ||= nil
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.namespace=(value)
|
42
|
-
@namespace = value
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Require the Base class first
|
47
|
-
require_relative "rbui/base"
|
48
|
-
|
49
|
-
# Manually require all the files
|
50
|
-
Dir.glob(File.join(__dir__, "rbui", "**", "*.rb")).sort.each { |file| require file }
|
51
|
-
|
52
|
-
# If you need to require generators (assuming they're needed)
|
53
|
-
if defined?(Rails::Generators)
|
54
|
-
require_relative "generators/rbui/base_generator"
|
55
|
-
require_relative "generators/rbui/install/install_generator"
|
56
|
-
require_relative "generators/rbui/component_generator"
|
57
|
-
end
|