app/helpers/coco/components_helper.rb in coveragebook_components-0.17.1 vs app/helpers/coco/components_helper.rb in coveragebook_components-0.17.2

- old
+ new

@@ -21,44 +21,44 @@ component = component.with_content(content) if !block && content.present? render(component, &block) end - def coco_button_group(**, &block) - render Coco::ButtonGroup.new(**), &block + def coco_button_group(**, &) + render(Coco::ButtonGroup.new(**), &) end - def coco_menu_button(**, &block) - render Coco::MenuButton.new(**), &block + def coco_menu_button(**, &) + render(Coco::MenuButton.new(**), &) end - def coco_menu_item(type, **, &block) - render coco_component("menu_items/#{type}", **), &block + def coco_menu_item(type, **, &) + render(coco_component("menu_items/#{type}", **), &) end - def coco_confirm_button(href = nil, **, &block) - render Coco::ConfirmButton.new(href: href, **), &block + def coco_confirm_button(href = nil, **, &) + render(Coco::ConfirmButton.new(href: href, **), &) end - def coco_color_picker_button(**, &block) - render Coco::ColorPickerButton.new(**), &block + def coco_color_picker_button(**, &) + render(Coco::ColorPickerButton.new(**), &) end - def coco_image_picker_button(**, &block) - render Coco::ImagePickerButton.new(**), &block + def coco_image_picker_button(**, &) + render(Coco::ImagePickerButton.new(**), &) end - def coco_layout_picker_button(**, &block) - render Coco::LayoutPickerButton.new(**), &block + def coco_layout_picker_button(**, &) + render(Coco::LayoutPickerButton.new(**), &) end - def coco_toolbar(**, &block) - render Coco::Toolbar.new(**), &block + def coco_toolbar(**, &) + render(Coco::Toolbar.new(**), &) end - def coco_option_bar(**, &block) - render Coco::OptionBar.new(**), &block + def coco_option_bar(**, &) + render(Coco::OptionBar.new(**), &) end # Embeds def coco_embed(platform, url = nil, **) @@ -70,20 +70,20 @@ end end # Forms (WIP) - def coco_form_with(**, &block) - form_with(**, builder: Coco::AppFormBuilder, &block) + def coco_form_with(**, &) + form_with(**, builder: Coco::AppFormBuilder, &) end - def coco_form_for(*, **, &block) - form_for(*, **, builder: Coco::AppFormBuilder, &block) + def coco_form_for(*, **, &) + form_for(*, **, builder: Coco::AppFormBuilder, &) end - def coco_fields(**, &block) - fields(**, builder: Coco::AppFormBuilder, &block) + def coco_fields(**, &) + fields(**, builder: Coco::AppFormBuilder, &) end # Images def coco_svg(path = nil, **) @@ -96,12 +96,12 @@ def coco_avatar(src, name = nil, **) render Coco::Avatar.new(src: src, name: name, **) end - def coco_icon(icon_name = nil, **, &block) - render Coco::Icon.new(name: icon_name, **), &block + def coco_icon(icon_name = nil, **, &) + render(Coco::Icon.new(name: icon_name, **), &) end # Indicators def coco_stamp(type = nil, **) @@ -130,44 +130,44 @@ def coco_spacer(size = Coco::Spacer::DEFAULT, **) render Coco::Spacer.new(size:, **) end alias_method :space, :coco_spacer - def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &block) - render Coco::Stack.new(spacing:, **), &block + def coco_stack(spacing: Coco::Spacer::DEFAULT, **, &) + render(Coco::Stack.new(spacing:, **), &) end - def coco_panel(**, &block) - render Coco::Panel.new(**), &block + def coco_panel(**, &) + render(Coco::Panel.new(**), &) end - def coco_page(id, **, &block) - render Coco::Page.new(id: id, **), &block + def coco_page(id, **, &) + render(Coco::Page.new(id: id, **), &) end # Messaging - def coco_notice(**, &block) - render Coco::Notice.new(**), &block + def coco_notice(**, &) + render(Coco::Notice.new(**), &) end - def coco_snackbar(**, &block) - render Coco::Snackbar.new(**), &block + def coco_snackbar(**, &) + render(Coco::Snackbar.new(**), &) end - def coco_toast(**, &block) - render Coco::Toast.new(**), &block + def coco_toast(**, &) + render(Coco::Toast.new(**), &) end - def coco_system_banner(**, &block) - render Coco::SystemBanner.new(**), &block + def coco_system_banner(**, &) + render(Coco::SystemBanner.new(**), &) end # Modals - def coco_modal(name = "default", **, &block) - render(Coco::Modal.new(name: name, **), &block) + def coco_modal(name = "default", **, &) + render(Coco::Modal.new(name: name, **), &) end def coco_modal_dialog(name = "default", **, &block) render(Coco::Modal.new(name: name, **)) do |modal| modal.with_container_dialog(&block) @@ -218,33 +218,33 @@ button = Coco::ButtonTo.new(action: options, type: :submit, **html_options) button = button.with_content(name) unless block render(button, &block) end - def coco_pager_button(direction, **, &block) - render Coco::PagerButton.new(direction:, **), &block + def coco_pager_button(direction, **, &) + render(Coco::PagerButton.new(direction:, **), &) end # Typography - def coco_prose(**, &block) - render Coco::Prose.new(**), &block + def coco_prose(**, &) + render(Coco::Prose.new(**), &) end - def coco_seamless_textarea(**, &block) - render Coco::SeamlessTextarea.new(**), &block + def coco_seamless_textarea(**, &) + render(Coco::SeamlessTextarea.new(**), &) end # Utilties (internal) - def coco_placeholder(text_content = nil, **, &block) - render Coco::Placeholder.new(text_content:, **), &block + def coco_placeholder(text_content = nil, **, &) + render(Coco::Placeholder.new(text_content:, **), &) end # General - def coco_tag(*, **, &block) - render Coco::Tag.new(*, **), &block + def coco_tag(*, **, &) + render(Coco::Tag.new(*, **), &) end def coco_component(name, *, **) resolve_component("coco/#{name}", *, **) end