coveragebook_components 0.12.2 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +6615 -5488
- data/app/assets/build/coco/app.js +3142 -3169
- data/app/assets/build/coco/book.css +5169 -2130
- data/app/assets/build/coco/book.js +3986 -1565
- data/app/assets/css/app.css +2 -8
- data/app/assets/css/base/config.css +1 -0
- data/app/assets/css/{base.css → base/setup.css} +7 -4
- data/app/assets/css/{shared → base}/tippy.css +18 -0
- data/app/assets/css/book.css +2 -4
- data/app/assets/js/app.js +25 -9
- data/app/assets/js/{libs → base}/alpine/directives/dropdown.js +1 -1
- data/app/assets/js/{libs → base}/alpine/directives/tooltip.js +1 -1
- data/app/assets/js/{libs → base}/alpine/index.js +7 -7
- data/app/assets/js/{libs → base}/alpine/utils/tippy_modifiers.js +1 -1
- data/app/assets/js/base/setup.js +8 -0
- data/app/assets/js/book.js +4 -4
- data/app/components/coco/app/{layouts/application/application.js → application_layout/application_layout.js} +1 -1
- data/app/components/coco/app/application_layout/application_layout.rb +16 -0
- data/app/components/coco/app/contact_callout/contact_callout.rb +21 -0
- data/app/components/coco/app/faqs/faqs.rb +14 -0
- data/app/components/coco/app/{blocks/header → header}/header.js +1 -1
- data/app/components/coco/app/header/header.rb +33 -0
- data/app/components/coco/app/{blocks/nav_drawer → nav_drawer}/nav_drawer.css +1 -1
- data/app/components/coco/app/{blocks/nav_drawer → nav_drawer}/nav_drawer.js +1 -1
- data/app/components/coco/app/nav_drawer/nav_drawer.rb +32 -0
- data/app/components/coco/app/plan_card/plan_card.rb +39 -0
- data/app/components/coco/app/{blocks/plan_picker → plan_picker}/plan_picker.css +3 -3
- data/app/components/coco/app/{blocks/plan_picker → plan_picker}/plan_picker.js +1 -1
- data/app/components/coco/app/plan_picker/plan_picker.rb +25 -0
- data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/item/item.js +2 -2
- data/app/components/coco/app/sidebar_nav/item/item.rb +48 -0
- data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/menu/menu.js +1 -1
- data/app/components/coco/app/sidebar_nav/menu/menu.rb +46 -0
- data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/navbar/navbar.html.erb +1 -1
- data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/navbar/navbar.js +2 -2
- data/app/components/coco/app/sidebar_nav/navbar/navbar.rb +50 -0
- data/app/components/coco/app/{blocks/slide_editor → slide_editor}/slide_editor.js +2 -2
- data/app/components/coco/app/slide_editor/slide_editor.rb +114 -0
- data/app/components/coco/book/editable_slide/editable_slide.rb +72 -0
- data/app/components/coco/book/media_slide/media_slide.rb +12 -0
- data/app/components/coco/{shared → buttons}/button/button.js +1 -1
- data/app/components/coco/{shared → buttons}/button/button.rb +2 -2
- data/app/components/coco/{shared → buttons}/button/button_dropdown.js +1 -1
- data/app/components/coco/{shared → buttons}/button_group/button_group.js +2 -2
- data/app/components/coco/{shared → buttons}/button_to/button_to.rb +1 -1
- data/app/components/coco/{app/elements → buttons}/color_picker_button/color_picker_button.css +2 -2
- data/app/components/coco/{app/elements → buttons}/color_picker_button/color_picker_button.html.erb +1 -1
- data/app/components/coco/{app/elements → buttons}/color_picker_button/color_picker_button.js +2 -2
- data/app/components/coco/buttons/color_picker_button/color_picker_button.rb +53 -0
- data/app/components/coco/{app/elements → buttons}/confirm_panel/confirm_panel.css +1 -1
- data/app/components/coco/{app/elements → buttons}/confirm_panel/confirm_panel.html.erb +1 -1
- data/app/components/coco/{app/elements → buttons}/confirm_panel/confirm_panel.js +2 -2
- data/app/components/coco/buttons/confirm_panel/confirm_panel.rb +19 -0
- data/app/components/coco/{app/elements → buttons}/image_picker_button/image_picker_button.css +2 -2
- data/app/components/coco/{app/elements → buttons}/image_picker_button/image_picker_button.html.erb +1 -1
- data/app/components/coco/{app/elements → buttons}/image_picker_button/image_picker_button.js +2 -2
- data/app/components/coco/buttons/image_picker_button/image_picker_button.rb +44 -0
- data/app/components/coco/{app/elements → buttons}/layout_picker_button/layout_picker_button.css +11 -11
- data/app/components/coco/{app/elements → buttons}/layout_picker_button/layout_picker_button.html.erb +1 -1
- data/app/components/coco/{app/elements → buttons}/layout_picker_button/layout_picker_button.js +2 -2
- data/app/components/coco/buttons/layout_picker_button/layout_picker_button.rb +33 -0
- data/app/components/coco/{app/elements → buttons}/menu/menu.css +2 -4
- data/app/components/coco/buttons/menu/menu.rb +37 -0
- data/app/components/coco/{app/elements → buttons}/menu_button/menu_button.css +1 -1
- data/app/components/coco/{app/elements → buttons}/menu_button/menu_button.html.erb +1 -1
- data/app/components/coco/buttons/menu_button/menu_button.js +6 -0
- data/app/components/coco/buttons/menu_button/menu_button.rb +30 -0
- data/app/components/coco/{app/elements → buttons}/menu_items/user_profile/user_profile.css +1 -1
- data/app/components/coco/buttons/menu_items/user_profile/user_profile.rb +18 -0
- data/app/components/coco/{app/elements → buttons}/option_bar/option_bar.css +1 -1
- data/app/components/coco/buttons/option_bar/option_bar.rb +13 -0
- data/app/components/coco/{app/elements → buttons}/toolbar/toolbar.css +1 -1
- data/app/components/coco/{app/elements → buttons}/toolbar/toolbar.js +1 -1
- data/app/components/coco/buttons/toolbar/toolbar.rb +35 -0
- data/app/components/coco/component.rb +1 -1
- data/app/components/coco/concerns/acts_as_button_group.rb +4 -11
- data/app/components/coco/concerns/acts_as_field_with_html_options.rb +1 -1
- data/app/components/coco/concerns/acts_as_field_with_options.rb +2 -2
- data/app/components/coco/concerns/with_icon.rb +1 -1
- data/app/components/coco/embeds/youtube_embed/youtube_embed.rb +16 -0
- data/app/components/coco/fields/button_component.rb +14 -0
- data/app/components/coco/fields/check_box_component.rb +7 -0
- data/app/components/coco/fields/collection_check_boxes_component.rb +7 -0
- data/app/components/coco/fields/collection_radio_buttons_component.rb +7 -0
- data/app/components/coco/fields/collection_select_component.rb +7 -0
- data/app/components/coco/fields/color_field_component.rb +7 -0
- data/app/components/coco/fields/date_field_component.rb +7 -0
- data/app/components/coco/fields/date_select_component.rb +7 -0
- data/app/components/coco/fields/datetime_local_field_component.rb +7 -0
- data/app/components/coco/fields/datetime_select_component.rb +7 -0
- data/app/components/coco/fields/email_field_component.rb +7 -0
- data/app/components/coco/fields/error_message_component.rb +7 -0
- data/app/components/coco/fields/file_field_component.rb +7 -0
- data/app/components/coco/fields/grouped_collection_select_component.rb +7 -0
- data/app/components/coco/fields/hint_component.rb +7 -0
- data/app/components/coco/fields/label_component.rb +7 -0
- data/app/components/coco/fields/month_field_component.rb +7 -0
- data/app/components/coco/fields/number_field_component.rb +7 -0
- data/app/components/coco/fields/password_field_component.rb +7 -0
- data/app/components/coco/fields/radio_button_component.rb +7 -0
- data/app/components/coco/fields/range_field_component.rb +7 -0
- data/app/components/coco/fields/search_field_component.rb +7 -0
- data/app/components/coco/fields/select_component.rb +7 -0
- data/app/components/coco/fields/submit_component.rb +14 -0
- data/app/components/coco/fields/telephone_field_component.rb +7 -0
- data/app/components/coco/fields/text_area_component.rb +7 -0
- data/app/components/coco/fields/text_field_component.rb +7 -0
- data/app/components/coco/fields/time_field_component.rb +7 -0
- data/app/components/coco/fields/time_select_component.rb +7 -0
- data/app/components/coco/fields/time_zone_select_component.rb +7 -0
- data/app/components/coco/fields/url_field_component.rb +7 -0
- data/app/components/coco/fields/week_field_component.rb +7 -0
- data/app/components/coco/fields/weekday_select_component.rb +7 -0
- data/app/components/coco/{shared → images}/icon/icon.js +1 -1
- data/app/components/coco/{shared → images}/image_uploader/image_uploader.js +1 -1
- data/app/components/coco/{app/elements → indicators}/stamp/stamp.css +1 -1
- data/app/components/coco/indicators/stamp/stamp.rb +25 -0
- data/app/components/coco/{app/layouts → layout}/page/page.js +1 -1
- data/app/components/coco/layout/page/page.rb +55 -0
- data/app/components/coco/{app/elements → messaging}/alert/alert.css +7 -7
- data/app/components/coco/{app/elements → messaging}/alert/alert.html.erb +1 -1
- data/app/components/coco/{app/elements → messaging}/alert/alert.js +2 -2
- data/app/components/coco/messaging/alert/alert.rb +75 -0
- data/app/components/coco/{app/elements → messaging}/notice/notice.css +1 -1
- data/app/components/coco/messaging/notice/notice.html.erb +5 -0
- data/app/components/coco/messaging/notice/notice.js +5 -0
- data/app/components/coco/messaging/notice/notice.rb +18 -0
- data/app/components/coco/{app/elements → messaging}/snackbar/snackbar.css +1 -1
- data/app/components/coco/{app/elements → messaging}/snackbar/snackbar.html.erb +1 -1
- data/app/components/coco/{app/elements → messaging}/snackbar/snackbar.js +2 -2
- data/app/components/coco/messaging/snackbar/snackbar.rb +34 -0
- data/app/components/coco/messaging/system_banner/system_banner.css +4 -0
- data/app/components/coco/messaging/system_banner/system_banner.html.erb +5 -0
- data/app/components/coco/{app/elements → messaging}/system_banner/system_banner.js +2 -2
- data/app/components/coco/messaging/system_banner/system_banner.rb +78 -0
- data/app/components/coco/{app/elements → messaging}/toast/toast.css +1 -1
- data/app/components/coco/{app/elements → messaging}/toast/toast.html.erb +1 -1
- data/app/components/coco/{app/elements → messaging}/toast/toast.js +2 -2
- data/app/components/coco/messaging/toast/toast.rb +19 -0
- data/app/components/coco/{shared → modals}/modal/modal.js +2 -2
- data/app/components/coco/{shared → modals}/modal/modal.rb +2 -1
- data/app/components/coco/{shared → modals}/modal_dialog/modal_dialog.js +1 -1
- data/app/components/coco/{shared → modals}/modal_dialog/modal_dialog.rb +1 -1
- data/app/components/coco/{shared → modals}/modal_lightbox/modal_lightbox.js +1 -1
- data/app/components/coco/{shared → navigation}/link/link.rb +1 -1
- data/app/components/coco/{shared/pager_link/pager_link.css → navigation/pager_button/pager_button.css} +1 -1
- data/app/components/coco/{shared/pager_link/pager_link.rb → navigation/pager_button/pager_button.rb} +1 -1
- data/app/components/coco/{app/elements → pickers}/color_picker/color_picker.css +11 -11
- data/app/components/coco/{app/elements → pickers}/color_picker/color_picker.html.erb +1 -1
- data/app/components/coco/{app/elements → pickers}/color_picker/color_picker.js +2 -2
- data/app/components/coco/pickers/color_picker/color_picker.rb +48 -0
- data/app/components/coco/{app/elements → pickers}/image_picker/image_picker.css +11 -11
- data/app/components/coco/{app/elements → pickers}/image_picker/image_picker.html.erb +1 -1
- data/app/components/coco/{app/elements → pickers}/image_picker/image_picker.js +2 -2
- data/app/components/coco/pickers/image_picker/image_picker.rb +20 -0
- data/app/components/coco/presented_component.rb +1 -1
- data/app/components/coco/{shared → utilities}/dropdown/dropdown.js +1 -1
- data/app/components/coco/{shared → utilities}/poll_controller/poll_controller.js +1 -1
- data/app/components/coco/{app/elements → utilities}/seamless_textarea/seamless_textarea.css +1 -1
- data/app/components/coco/{app/elements → utilities}/seamless_textarea/seamless_textarea.html.erb +1 -1
- data/app/components/coco/{app/elements → utilities}/seamless_textarea/seamless_textarea.js +2 -2
- data/app/components/coco/utilities/seamless_textarea/seamless_textarea.rb +25 -0
- data/app/helpers/coco/app_components_helper.rb +35 -0
- data/app/helpers/coco/book_components_helper.rb +11 -0
- data/app/helpers/coco/components_helper.rb +7 -0
- data/app/helpers/coco/core_components_helper.rb +257 -0
- data/app/helpers/coco/helpers.rb +2 -2
- data/app/helpers/coco/modal_helper.rb +22 -0
- data/config/locales/coco.en.yml +17 -18
- data/config/{tailwind.base.config.cjs → tailwind.config.cjs} +10 -0
- data/config/tokens.cjs +9 -23
- data/lib/coco/app_form_builder.rb +1 -1
- data/lib/coco/engine.rb +3 -3
- data/lib/coco.rb +1 -1
- metadata +253 -274
- data/app/assets/css/app/config.css +0 -1
- data/app/assets/css/app/tippy.css +0 -19
- data/app/assets/css/book/config.css +0 -1
- data/app/assets/js/app/components.js +0 -4
- data/app/assets/js/app/setup.js +0 -23
- data/app/assets/js/book/components.js +0 -4
- data/app/assets/js/shared/components.js +0 -4
- data/app/components/coco/app/blocks/contact_callout/contact_callout.rb +0 -23
- data/app/components/coco/app/blocks/faqs/faqs.rb +0 -16
- data/app/components/coco/app/blocks/header/header.rb +0 -35
- data/app/components/coco/app/blocks/nav_drawer/nav_drawer.rb +0 -34
- data/app/components/coco/app/blocks/plan_picker/plan_picker.rb +0 -27
- data/app/components/coco/app/blocks/sidebar_nav/item/item.rb +0 -50
- data/app/components/coco/app/blocks/sidebar_nav/menu/menu.rb +0 -48
- data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.rb +0 -50
- data/app/components/coco/app/blocks/slide_editor/slide_editor.rb +0 -116
- data/app/components/coco/app/elements/alert/alert.rb +0 -79
- data/app/components/coco/app/elements/color_picker/color_picker.rb +0 -53
- data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +0 -58
- data/app/components/coco/app/elements/confirm_panel/confirm_panel.rb +0 -23
- data/app/components/coco/app/elements/image_picker/image_picker.rb +0 -25
- data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +0 -49
- data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +0 -38
- data/app/components/coco/app/elements/menu/menu.rb +0 -41
- data/app/components/coco/app/elements/menu_button/menu_button.js +0 -6
- data/app/components/coco/app/elements/menu_button/menu_button.rb +0 -35
- data/app/components/coco/app/elements/menu_items/user_profile/user_profile.rb +0 -20
- data/app/components/coco/app/elements/notice/notice.html.erb +0 -5
- data/app/components/coco/app/elements/notice/notice.js +0 -5
- data/app/components/coco/app/elements/notice/notice.rb +0 -22
- data/app/components/coco/app/elements/option_bar/option_bar.rb +0 -17
- data/app/components/coco/app/elements/plan_card/plan_card.rb +0 -41
- data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.rb +0 -29
- data/app/components/coco/app/elements/snackbar/snackbar.rb +0 -38
- data/app/components/coco/app/elements/stamp/stamp.rb +0 -29
- data/app/components/coco/app/elements/system_banner/system_banner.css +0 -4
- data/app/components/coco/app/elements/system_banner/system_banner.html.erb +0 -5
- data/app/components/coco/app/elements/system_banner/system_banner.rb +0 -82
- data/app/components/coco/app/elements/toast/toast.rb +0 -23
- data/app/components/coco/app/elements/toolbar/toolbar.rb +0 -41
- data/app/components/coco/app/fields/button_component.rb +0 -16
- data/app/components/coco/app/fields/check_box_component.rb +0 -9
- data/app/components/coco/app/fields/collection_check_boxes_component.rb +0 -9
- data/app/components/coco/app/fields/collection_radio_buttons_component.rb +0 -9
- data/app/components/coco/app/fields/collection_select_component.rb +0 -9
- data/app/components/coco/app/fields/color_field_component.rb +0 -9
- data/app/components/coco/app/fields/date_field_component.rb +0 -9
- data/app/components/coco/app/fields/date_select_component.rb +0 -9
- data/app/components/coco/app/fields/datetime_local_field_component.rb +0 -9
- data/app/components/coco/app/fields/datetime_select_component.rb +0 -9
- data/app/components/coco/app/fields/email_field_component.rb +0 -9
- data/app/components/coco/app/fields/error_message_component.rb +0 -9
- data/app/components/coco/app/fields/file_field_component.rb +0 -9
- data/app/components/coco/app/fields/grouped_collection_select_component.rb +0 -9
- data/app/components/coco/app/fields/hint_component.rb +0 -9
- data/app/components/coco/app/fields/label_component.rb +0 -9
- data/app/components/coco/app/fields/month_field_component.rb +0 -9
- data/app/components/coco/app/fields/number_field_component.rb +0 -9
- data/app/components/coco/app/fields/password_field_component.rb +0 -9
- data/app/components/coco/app/fields/radio_button_component.rb +0 -9
- data/app/components/coco/app/fields/range_field_component.rb +0 -9
- data/app/components/coco/app/fields/search_field_component.rb +0 -9
- data/app/components/coco/app/fields/select_component.rb +0 -9
- data/app/components/coco/app/fields/submit_component.rb +0 -16
- data/app/components/coco/app/fields/telephone_field_component.rb +0 -9
- data/app/components/coco/app/fields/text_area_component.rb +0 -9
- data/app/components/coco/app/fields/text_field_component.rb +0 -9
- data/app/components/coco/app/fields/time_field_component.rb +0 -9
- data/app/components/coco/app/fields/time_select_component.rb +0 -9
- data/app/components/coco/app/fields/time_zone_select_component.rb +0 -9
- data/app/components/coco/app/fields/url_field_component.rb +0 -9
- data/app/components/coco/app/fields/week_field_component.rb +0 -9
- data/app/components/coco/app/fields/weekday_select_component.rb +0 -9
- data/app/components/coco/app/layouts/application/application.rb +0 -18
- data/app/components/coco/app/layouts/page/page.rb +0 -59
- data/app/components/coco/book/blocks/slides/editable_slide/editable_slide.rb +0 -76
- data/app/components/coco/book/blocks/slides/media_slide/media_slide.rb +0 -16
- data/app/components/coco/shared/embeds/youtube/youtube.rb +0 -20
- data/app/helpers/coco/app_helper.rb +0 -141
- data/app/helpers/coco/book_helper.rb +0 -11
- data/app/helpers/coco/component_helper.rb +0 -15
- data/app/helpers/coco/shared_helper.rb +0 -111
- data/app/helpers/coco/url_helper.rb +0 -30
- data/config/tailwind.app.config.cjs +0 -21
- data/config/tailwind.book.config.cjs +0 -21
- /data/app/assets/css/{shared → base}/utils/colors.css +0 -0
- /data/app/assets/css/{shared → base}/utils/icons.css +0 -0
- /data/app/assets/css/{app/utils.css → base/utils/layout.css} +0 -0
- /data/app/assets/css/{shared → base}/utils/text.css +0 -0
- /data/app/assets/js/{libs → base}/alpine/directives/destroy.js +0 -0
- /data/app/assets/js/{libs → base}/alpine/directives/dimensions.js +0 -0
- /data/app/assets/js/{libs → base}/alpine/directives/notification.js +0 -0
- /data/app/assets/js/{libs → base}/alpine/directives/options.js +0 -0
- /data/app/assets/js/{libs → base}/alpine/directives/undo.js +0 -0
- /data/app/assets/js/{shared → base}/coco.js +0 -0
- /data/app/assets/js/{libs → base}/tippy/index.js +0 -0
- /data/app/assets/js/{libs → base}/tippy/plugins/hide_on_esc.js +0 -0
- /data/app/components/coco/app/{layouts/application/application.css → application_layout/application_layout.css} +0 -0
- /data/app/components/coco/app/{layouts/application/application.html.erb → application_layout/application_layout.html.erb} +0 -0
- /data/app/components/coco/app/{blocks/contact_callout → contact_callout}/contact_callout.css +0 -0
- /data/app/components/coco/app/{blocks/contact_callout → contact_callout}/contact_callout.html.erb +0 -0
- /data/app/components/coco/app/{blocks/faqs → faqs}/faqs.css +0 -0
- /data/app/components/coco/app/{blocks/faqs → faqs}/faqs.html.erb +0 -0
- /data/app/components/coco/app/{blocks/header → header}/header.css +0 -0
- /data/app/components/coco/app/{blocks/header → header}/header.html.erb +0 -0
- /data/app/components/coco/app/{blocks/nav_drawer → nav_drawer}/nav_drawer.html.erb +0 -0
- /data/app/components/coco/app/{elements/plan_card → plan_card}/plan_card.css +0 -0
- /data/app/components/coco/app/{elements/plan_card → plan_card}/plan_card.html.erb +0 -0
- /data/app/components/coco/app/{blocks/plan_picker → plan_picker}/plan_picker.html.erb +0 -0
- /data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/item/item.css +0 -0
- /data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/item/item.html.erb +0 -0
- /data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/menu/menu.css +0 -0
- /data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/menu/menu.html.erb +0 -0
- /data/app/components/coco/app/{blocks/sidebar_nav → sidebar_nav}/navbar/navbar.css +0 -0
- /data/app/components/coco/app/{blocks/slide_editor → slide_editor}/slide_editor.css +0 -0
- /data/app/components/coco/app/{blocks/slide_editor → slide_editor}/slide_editor.html.erb +0 -0
- /data/app/components/coco/book/{blocks/slides/editable_slide → editable_slide}/editable_slide.css +0 -0
- /data/app/components/coco/book/{blocks/slides/editable_slide → editable_slide}/editable_slide.html.erb +0 -0
- /data/app/components/coco/book/{blocks/slides/media_slide → media_slide}/media_slide.css +0 -0
- /data/app/components/coco/book/{blocks/slides/media_slide → media_slide}/media_slide.html.erb +0 -0
- /data/app/components/coco/{shared → buttons}/button/button.css +0 -0
- /data/app/components/coco/{shared → buttons}/button/button.html.erb +0 -0
- /data/app/components/coco/{shared → buttons}/button_group/button_group.css +0 -0
- /data/app/components/coco/{shared → buttons}/button_group/button_group.html.erb +0 -0
- /data/app/components/coco/{shared → buttons}/button_group/button_group.rb +0 -0
- /data/app/components/coco/{shared → buttons}/button_to/button_to.css +0 -0
- /data/app/components/coco/{shared → buttons}/button_to/button_to.html.erb +0 -0
- /data/app/components/coco/{app/elements → buttons}/menu/menu.html.erb +0 -0
- /data/app/components/coco/{app/elements → buttons}/menu_items/user_profile/user_profile.html.erb +0 -0
- /data/app/components/coco/{app/elements → buttons}/option_bar/option_bar.html.erb +0 -0
- /data/app/components/coco/{app/elements → buttons}/toolbar/toolbar.html.erb +0 -0
- /data/app/components/coco/{shared/embeds/youtube/youtube.css → embeds/youtube_embed/youtube_embed.css} +0 -0
- /data/app/components/coco/{shared/embeds/youtube/youtube.html.erb → embeds/youtube_embed/youtube_embed.html.erb} +0 -0
- /data/app/components/coco/{shared → images}/avatar/avatar.css +0 -0
- /data/app/components/coco/{shared → images}/avatar/avatar.rb +0 -0
- /data/app/components/coco/{shared → images}/icon/icon.css +0 -0
- /data/app/components/coco/{shared → images}/icon/icon.html.erb +0 -0
- /data/app/components/coco/{shared → images}/icon/icon.rb +0 -0
- /data/app/components/coco/{shared → images}/image/image.css +0 -0
- /data/app/components/coco/{shared → images}/image/image.rb +0 -0
- /data/app/components/coco/{shared → images}/image_uploader/image_uploader.css +0 -0
- /data/app/components/coco/{shared → images}/image_uploader/image_uploader.html.erb +0 -0
- /data/app/components/coco/{shared → images}/image_uploader/image_uploader.rb +0 -0
- /data/app/components/coco/{shared → images}/svg/svg.html.erb +0 -0
- /data/app/components/coco/{shared → images}/svg/svg.rb +0 -0
- /data/app/components/coco/{shared → indicators}/badge/badge.css +0 -0
- /data/app/components/coco/{shared → indicators}/badge/badge.html.erb +0 -0
- /data/app/components/coco/{shared → indicators}/badge/badge.rb +0 -0
- /data/app/components/coco/{app/elements → indicators}/stamp/stamp.html.erb +0 -0
- /data/app/components/coco/{app/layouts → layout}/page/page.css +0 -0
- /data/app/components/coco/{app/layouts → layout}/page/page.html.erb +0 -0
- /data/app/components/coco/{shared → layout}/panel/panel.css +0 -0
- /data/app/components/coco/{shared → layout}/panel/panel.html.erb +0 -0
- /data/app/components/coco/{shared → layout}/panel/panel.rb +0 -0
- /data/app/components/coco/{shared → layout}/spacer/spacer.css +0 -0
- /data/app/components/coco/{shared → layout}/spacer/spacer.rb +0 -0
- /data/app/components/coco/{shared → layout}/stack/stack.css +0 -0
- /data/app/components/coco/{shared → layout}/stack/stack.html.erb +0 -0
- /data/app/components/coco/{shared → layout}/stack/stack.rb +0 -0
- /data/app/components/coco/{shared → modals}/modal/modal.css +0 -0
- /data/app/components/coco/{shared → modals}/modal/modal.html.erb +0 -0
- /data/app/components/coco/{shared → modals}/modal_dialog/modal_dialog.css +0 -0
- /data/app/components/coco/{shared → modals}/modal_dialog/modal_dialog.html.erb +0 -0
- /data/app/components/coco/{shared → modals}/modal_lightbox/modal_lightbox.css +0 -0
- /data/app/components/coco/{shared → modals}/modal_lightbox/modal_lightbox.html.erb +0 -0
- /data/app/components/coco/{shared → modals}/modal_lightbox/modal_lightbox.rb +0 -0
- /data/app/components/coco/{shared → navigation}/link/link.css +0 -0
- /data/app/components/coco/{shared/pager_link/pager_link.html.erb → navigation/pager_button/pager_button.html.erb} +0 -0
- /data/app/components/coco/{shared → typography}/prose/prose.css +0 -0
- /data/app/components/coco/{shared → typography}/prose/prose.rb +0 -0
- /data/app/components/coco/{shared → utilities}/content/content.rb +0 -0
- /data/app/components/coco/{shared → utilities}/dropdown/dropdown.css +0 -0
- /data/app/components/coco/{shared → utilities}/dropdown/dropdown.html.erb +0 -0
- /data/app/components/coco/{shared → utilities}/dropdown/dropdown.rb +0 -0
- /data/app/components/coco/{shared → utilities}/placeholder/placeholder.css +0 -0
- /data/app/components/coco/{shared → utilities}/placeholder/placeholder.html.erb +0 -0
- /data/app/components/coco/{shared → utilities}/placeholder/placeholder.rb +0 -0
- /data/app/components/coco/{shared → utilities}/poll_controller/poll_controller.css +0 -0
- /data/app/components/coco/{shared → utilities}/poll_controller/poll_controller.html.erb +0 -0
- /data/app/components/coco/{shared → utilities}/poll_controller/poll_controller.rb +0 -0
@@ -1,49 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class ImagePickerButton < Coco::Component
|
5
|
-
include Concerns::WithDropdownOptions
|
6
|
-
include Concerns::WrapsComponent
|
7
|
-
include Coco::AppHelper
|
8
|
-
|
9
|
-
wraps_component :button do |args|
|
10
|
-
Coco::Button.new(icon: :image_plus, **args)
|
11
|
-
end
|
12
|
-
|
13
|
-
renders_one :text, Coco::Content
|
14
|
-
|
15
|
-
renders_one :picker, ->(picker = nil, **kwargs, &block) do
|
16
|
-
if picker.is_a?(Coco::App::Elements::ImagePicker)
|
17
|
-
picker
|
18
|
-
else
|
19
|
-
picker&.to_s.presence || Coco::App::Elements::ImagePicker.new(
|
20
|
-
size: @size,
|
21
|
-
resize: @resize,
|
22
|
-
src: @src,
|
23
|
-
**kwargs
|
24
|
-
)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
before_render do
|
29
|
-
with_picker(src: @src) unless picker?
|
30
|
-
end
|
31
|
-
|
32
|
-
attr_reader :src
|
33
|
-
|
34
|
-
def initialize(src: nil, **kwargs)
|
35
|
-
@src = src
|
36
|
-
|
37
|
-
@size = kwargs.fetch(:size, :default)&.to_sym
|
38
|
-
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
39
|
-
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def button_text
|
44
|
-
text || content
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class LayoutPickerButton < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::WithDropdownOptions
|
7
|
-
include Concerns::WrapsComponent
|
8
|
-
include Coco::AppHelper
|
9
|
-
|
10
|
-
wraps_component :button do |args|
|
11
|
-
args[:class] = [args[:class], "layout-picker-trigger"]
|
12
|
-
Coco::Button.new(**args)
|
13
|
-
end
|
14
|
-
|
15
|
-
renders_many :layouts, ->(name:, thumbnail:, **layout_options) do
|
16
|
-
@layout_options << {name: name, thumbnail: thumbnail, **layout_options}
|
17
|
-
end
|
18
|
-
|
19
|
-
attr_reader :layout_options, :size, :resize
|
20
|
-
|
21
|
-
def initialize(selected: nil, **kwargs)
|
22
|
-
@selected = selected
|
23
|
-
@layout_options = []
|
24
|
-
@resize = {}
|
25
|
-
|
26
|
-
@size = kwargs.fetch(:size, :default)&.to_sym
|
27
|
-
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
28
|
-
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def selected
|
33
|
-
@selected || @layout_options.first[:name]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Menu < Coco::Component
|
5
|
-
include Concerns::ActsAsButtonGroup
|
6
|
-
include Concerns::AcceptsOptions
|
7
|
-
|
8
|
-
accepts_option :size, from: [:xs, :sm, :md, nil], default: :sm
|
9
|
-
|
10
|
-
renders_many :htmls, ->(*args, **kwargs, &block) do
|
11
|
-
init_button_group
|
12
|
-
items << block.call
|
13
|
-
end
|
14
|
-
|
15
|
-
before_render do
|
16
|
-
args[:resize]&.each { set_tag_data_attr("size-#{_1}", _2) }
|
17
|
-
end
|
18
|
-
|
19
|
-
def button_kwargs(kwargs, type = nil)
|
20
|
-
btn_kwargs = {
|
21
|
-
theme: nil,
|
22
|
-
size: get_option_value(:size),
|
23
|
-
resize: args[:resize],
|
24
|
-
**kwargs,
|
25
|
-
fit: :full,
|
26
|
-
collapsible: false
|
27
|
-
}
|
28
|
-
|
29
|
-
if type == :menu
|
30
|
-
btn_kwargs[:toggle] = :horizontal
|
31
|
-
btn_kwargs[:dropdown] ||= {
|
32
|
-
placement: "right-start"
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
btn_kwargs
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class MenuButton < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::WithIcon
|
7
|
-
include Concerns::WrapsComponent
|
8
|
-
include Coco::AppHelper
|
9
|
-
|
10
|
-
wraps_component :button do |kwargs|
|
11
|
-
@size = kwargs.fetch(:size, :default)&.to_sym
|
12
|
-
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
13
|
-
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
14
|
-
end
|
15
|
-
|
16
|
-
Coco::Button.new(toggle: :vertical, fit: get_option_value(:fit) || :auto, **kwargs)
|
17
|
-
end
|
18
|
-
|
19
|
-
accepts_option :fit, from: [:auto, :full]
|
20
|
-
|
21
|
-
renders_one :text, Coco::Content
|
22
|
-
|
23
|
-
renders_one :menu, ->(**kwargs) do
|
24
|
-
Coco::App::Elements::Menu.new(size: @size, resize: @resize, **kwargs)
|
25
|
-
end
|
26
|
-
|
27
|
-
attr_reader :size, :resize
|
28
|
-
|
29
|
-
def button_text
|
30
|
-
text || content
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
module MenuItems
|
5
|
-
class UserProfile < Coco::Component
|
6
|
-
renders_one :avatar, ->(**kwargs) do
|
7
|
-
Coco::Avatar.new(name: name, **kwargs, size: :lg)
|
8
|
-
end
|
9
|
-
|
10
|
-
attr_reader :name, :email
|
11
|
-
|
12
|
-
def initialize(name:, email:, **)
|
13
|
-
@name = name
|
14
|
-
@email = email
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Notice < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::WrapsComponent
|
7
|
-
|
8
|
-
accepts_option :dismissable, from: [true, false], default: true
|
9
|
-
|
10
|
-
wraps_component :alert do |args|
|
11
|
-
Coco::App::Elements::Alert.new(**args, dismissable: get_option_value(:dismissable))
|
12
|
-
end
|
13
|
-
|
14
|
-
%i[title action secondary_action link].each do |slot_name|
|
15
|
-
renders_one slot_name, ->(*args, **kwargs, &block) do
|
16
|
-
alert.send("with_#{slot_name}".to_sym, *args, **kwargs, &block)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class OptionBar < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
|
7
|
-
accepts_option :size, from: [:sm, :md], default: :sm
|
8
|
-
|
9
|
-
renders_many :options, ->(*args, selected: false, **kwargs, &block) do
|
10
|
-
theme = selected ? :neutral_light : :blank
|
11
|
-
size = get_option_value(:size)
|
12
|
-
coco_button(*args, **kwargs, theme:, size:, class: ("selected" if selected), &block)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class PlanCard < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
|
7
|
-
accepts_option :active, from: [true, false]
|
8
|
-
accepts_option :recommended, from: [true, false]
|
9
|
-
|
10
|
-
renders_one :action, ->(*args, **kwargs, &block) do
|
11
|
-
coco_button(*args, **kwargs,
|
12
|
-
size: :sm,
|
13
|
-
fit: :full,
|
14
|
-
disabled: active?,
|
15
|
-
&block)
|
16
|
-
end
|
17
|
-
|
18
|
-
renders_many :benefits, ->(benefit, &block) do
|
19
|
-
@benefits[benefit] = block&.call
|
20
|
-
end
|
21
|
-
|
22
|
-
attr_reader :name, :price, :promo
|
23
|
-
|
24
|
-
def initialize(name:, price:, promo: nil, **kwargs)
|
25
|
-
@name = name
|
26
|
-
@price = price
|
27
|
-
@promo = promo
|
28
|
-
@benefits = {}
|
29
|
-
end
|
30
|
-
|
31
|
-
def recommended?
|
32
|
-
get_option_value(:recommended) == true
|
33
|
-
end
|
34
|
-
|
35
|
-
def active?
|
36
|
-
get_option_value(:active) == true
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class SeamlessTextarea < Coco::Component
|
5
|
-
include TagHelper
|
6
|
-
include Concerns::AcceptsOptions
|
7
|
-
|
8
|
-
accepts_option :multiline, from: [true, false]
|
9
|
-
accepts_option :focus, from: [true, false]
|
10
|
-
|
11
|
-
attr_reader :placeholder
|
12
|
-
|
13
|
-
def initialize(textarea: nil, value: nil, placeholder: nil, **kwargs)
|
14
|
-
@textarea_args = textarea.to_h
|
15
|
-
@value = value
|
16
|
-
@placeholder = placeholder
|
17
|
-
end
|
18
|
-
|
19
|
-
def multiline?
|
20
|
-
get_option_value(:multiline)
|
21
|
-
end
|
22
|
-
|
23
|
-
def value
|
24
|
-
(@value.presence || content.presence || "").strip_heredoc.strip
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Snackbar < Coco::Component
|
5
|
-
include Concerns::WithIcon
|
6
|
-
include Concerns::ActsAsNotification
|
7
|
-
|
8
|
-
THEME_ICONS = {
|
9
|
-
positive: :check,
|
10
|
-
warning: :alert_triangle,
|
11
|
-
negative: :alert_circle,
|
12
|
-
pending: :loader_2
|
13
|
-
}.freeze
|
14
|
-
|
15
|
-
accepts_option :theme, from: [:positive, :warning, :negative, :pending]
|
16
|
-
|
17
|
-
renders_one :action, ->(*args, **kwargs, &block) do
|
18
|
-
coco_button(*args, **kwargs, theme: :blank, size: :sm, icon: nil, &block)
|
19
|
-
end
|
20
|
-
|
21
|
-
before_render do
|
22
|
-
theme = get_option_value(:theme)
|
23
|
-
|
24
|
-
unless tag_attr?(:id)
|
25
|
-
set_tag_attr(:id, "snackbar-#{rand(1000)}")
|
26
|
-
end
|
27
|
-
|
28
|
-
if !icon? && theme.present?
|
29
|
-
icon_opts = get_option_group(:icon).values
|
30
|
-
icon_name = THEME_ICONS[theme]
|
31
|
-
spin = theme == :pending
|
32
|
-
icon(**icon_opts, name: icon_name, spin: spin)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Stamp < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::AcceptsTheme
|
7
|
-
|
8
|
-
THEMES = [
|
9
|
-
"positive",
|
10
|
-
"negative",
|
11
|
-
"warning",
|
12
|
-
"info"
|
13
|
-
]
|
14
|
-
|
15
|
-
DEFAULT_THEME = "info"
|
16
|
-
|
17
|
-
accepts_option :size, from: %i[xs sm md lg], default: :md
|
18
|
-
accepts_option :style, from: %i[subtle vivid inverse compact], default: :subtle
|
19
|
-
accepts_option :theme, from: THEMES, default: DEFAULT_THEME
|
20
|
-
|
21
|
-
attr_reader :icon_name
|
22
|
-
|
23
|
-
def initialize(icon:, **kwargs)
|
24
|
-
@icon_name = icon
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class SystemBanner < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::WrapsComponent
|
7
|
-
|
8
|
-
accepts_option :dismissable, from: [true, false], default: false
|
9
|
-
|
10
|
-
wraps_component :alert do |args|
|
11
|
-
theme = vivid_theme_name(args.fetch(:theme, nil)) || :info_vivid
|
12
|
-
Coco::App::Elements::Alert.new(
|
13
|
-
**args,
|
14
|
-
theme: theme,
|
15
|
-
banner: true,
|
16
|
-
cloak: false,
|
17
|
-
single_line: true,
|
18
|
-
dismissable: dismissable?,
|
19
|
-
dismiss_after_action: false,
|
20
|
-
condensed: true
|
21
|
-
)
|
22
|
-
end
|
23
|
-
|
24
|
-
%i[action secondary_action link].each do |slot_name|
|
25
|
-
renders_one slot_name, ->(*args, **kwargs, &block) do
|
26
|
-
alert.send("with_#{slot_name}".to_sym, *args, **kwargs, &block)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
renders_one :title, ->(text = nil, **kwargs, &block) do
|
31
|
-
alert.public_send(:with_title, **kwargs) { text.presence || block.call }
|
32
|
-
end
|
33
|
-
|
34
|
-
renders_one :message, ->(text = nil, **kwargs, &block) do
|
35
|
-
alert.public_send(:with_message, **kwargs) { text.presence || block.call }
|
36
|
-
end
|
37
|
-
|
38
|
-
before_render do
|
39
|
-
if dismissable? && id.blank?
|
40
|
-
raise ArgumentError, "Dismissable banners must be given an ID"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
attr_reader :dismiss_for, :id
|
45
|
-
|
46
|
-
def initialize(id: nil, dismiss_for: nil, **)
|
47
|
-
@id = id
|
48
|
-
@dismiss_for = dismiss_for
|
49
|
-
set_tag_attr(:id, id)
|
50
|
-
end
|
51
|
-
|
52
|
-
def dismissable?
|
53
|
-
get_option_value(:dismissable) == true
|
54
|
-
end
|
55
|
-
|
56
|
-
def render?
|
57
|
-
helpers.cookies[dismiss_cookie_name] != "true"
|
58
|
-
end
|
59
|
-
|
60
|
-
def dismiss_cookie_name
|
61
|
-
"cb_system_banner_#{tag_attr(:id)&.underscore}_dismissed".to_sym
|
62
|
-
end
|
63
|
-
|
64
|
-
def alpine_data
|
65
|
-
dismissable? ? {
|
66
|
-
cookie_name: dismiss_cookie_name,
|
67
|
-
cookie_expiry: dismiss_for&.in_days&.to_i,
|
68
|
-
cookie_value: "true"
|
69
|
-
} : {}
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
def vivid_theme_name(theme)
|
75
|
-
if theme.present?
|
76
|
-
"#{theme.to_s.underscore.gsub("_vivid", "")}_vivid".to_sym
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Toast < Coco::Component
|
5
|
-
include Concerns::WrapsComponent
|
6
|
-
include Concerns::ActsAsNotification
|
7
|
-
|
8
|
-
accepts_option :dismissable, from: [true, false], default: true
|
9
|
-
accepts_option :dismiss, from: [true, false], default: false
|
10
|
-
|
11
|
-
wraps_component :alert do |args|
|
12
|
-
Coco::App::Elements::Alert.new(**args, dismissable: get_option_value(:dismissable))
|
13
|
-
end
|
14
|
-
|
15
|
-
%i[title action secondary_action link].each do |slot_name|
|
16
|
-
renders_one slot_name, ->(**kwargs, &block) do
|
17
|
-
alert.send("with_#{slot_name}".to_sym, **kwargs, &block)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Toolbar < Coco::Component
|
5
|
-
include Coco::AppHelper
|
6
|
-
|
7
|
-
renders_many :sections,
|
8
|
-
->(*args, align: nil, **kwargs, &block) do
|
9
|
-
alignment = if align.nil?
|
10
|
-
@sections[:start].nil? ? :start : :end
|
11
|
-
else
|
12
|
-
align
|
13
|
-
end.to_sym
|
14
|
-
|
15
|
-
unless @sections[alignment].nil?
|
16
|
-
raise "Toolbar already has a `#{alignment}` section defined"
|
17
|
-
end
|
18
|
-
|
19
|
-
component = Coco::ButtonGroup.new(**kwargs, theme: :toolbar, collapsible: true)
|
20
|
-
@sections[alignment] = view_context.render(component, &block)
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(**kwargs)
|
24
|
-
@sections = {
|
25
|
-
start: nil,
|
26
|
-
end: nil
|
27
|
-
}
|
28
|
-
super(**kwargs)
|
29
|
-
end
|
30
|
-
|
31
|
-
def start_section
|
32
|
-
@sections[:start]
|
33
|
-
end
|
34
|
-
|
35
|
-
def end_section
|
36
|
-
@sections[:end]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Fields
|
4
|
-
class ButtonComponent < ViewComponent::Form::ButtonComponent
|
5
|
-
include Concerns::ActsAsFieldWithOptions
|
6
|
-
include Coco::SharedHelper
|
7
|
-
|
8
|
-
def call
|
9
|
-
coco_button(**options) do
|
10
|
-
content || value
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|