coveragebook_components 0.12.2 → 0.13.0
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/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 +1 -0
- data/app/components/coco/{shared → modals}/modal_dialog/modal_dialog.js +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 +251 -258
- 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_dialog/modal_dialog.rb +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
data/app/assets/js/app/setup.js
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import { navigateTo } from "@helpers/location";
|
2
|
-
|
3
|
-
// Global JS navigation handler.
|
4
|
-
// Optionally uses Turbo for the page navigation.
|
5
|
-
window.addEventListener("app:navigate", (event) => {
|
6
|
-
const url = event.detail.url;
|
7
|
-
if (url) {
|
8
|
-
delete event.detail.url;
|
9
|
-
navigateTo(url, event.detail);
|
10
|
-
}
|
11
|
-
});
|
12
|
-
|
13
|
-
// Uodate the value of the `--app-height` css variable
|
14
|
-
// when the viewport size changes. To help work around the
|
15
|
-
// issues when using 100vh on mobile safari (https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8)
|
16
|
-
function setAppHeightProperty() {
|
17
|
-
document.documentElement.style.setProperty(
|
18
|
-
"--app-height",
|
19
|
-
`${window.innerHeight}px`
|
20
|
-
);
|
21
|
-
}
|
22
|
-
window.addEventListener("resize", setAppHeightProperty);
|
23
|
-
setAppHeightProperty();
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class ContactCallout < Coco::Component
|
5
|
-
renders_one :avatar, ->(*args, **kwargs) do
|
6
|
-
coco_avatar(*args, **kwargs, size: :full)
|
7
|
-
end
|
8
|
-
|
9
|
-
renders_one :action, ->(*args, **kwargs, &block) do
|
10
|
-
coco_button(*args, theme: :primary, **kwargs, &block)
|
11
|
-
end
|
12
|
-
|
13
|
-
renders_many :contact_numbers, ->(region, number) do
|
14
|
-
@contact_numbers << {region:, number:}
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize(**kwargs)
|
18
|
-
@contact_numbers = []
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class Faqs < Coco::Component
|
5
|
-
renders_many :entries, ->(question, id: nil, &block) do
|
6
|
-
@entries << {question:, answer: block.call, id:}
|
7
|
-
end
|
8
|
-
|
9
|
-
def initialize(title: "Frequently asked questions", **)
|
10
|
-
@title = title
|
11
|
-
@entries = []
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class Header < Coco::Component
|
5
|
-
renders_one :primary_nav, ->(**kwargs) do
|
6
|
-
Coco::ButtonGroup.new(
|
7
|
-
theme: :text_neutral_light,
|
8
|
-
collapsible: false,
|
9
|
-
size: :xs,
|
10
|
-
**kwargs
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
renders_one :secondary_nav, ->(**kwargs) do
|
15
|
-
Coco::ButtonGroup.new(
|
16
|
-
theme: :text_neutral_light,
|
17
|
-
collapsible: false,
|
18
|
-
size: :xs,
|
19
|
-
**kwargs
|
20
|
-
)
|
21
|
-
end
|
22
|
-
|
23
|
-
renders_one :mobile_nav, ->(**kwargs) do
|
24
|
-
Coco::App::Blocks::NavDrawer.new(**kwargs)
|
25
|
-
end
|
26
|
-
|
27
|
-
attr_reader :home_path
|
28
|
-
|
29
|
-
def initialize(home_path: nil, **)
|
30
|
-
@home_path = home_path
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class NavDrawer < Coco::Component
|
5
|
-
renders_many :items, types: {
|
6
|
-
html: ->(&block) { block.call },
|
7
|
-
divider: ->(&block) { tag.div class: "nav-drawer-divider" },
|
8
|
-
heading: ->(text, **kwargs, &block) do
|
9
|
-
tag.h4(text, class: "nav-drawer-heading")
|
10
|
-
end,
|
11
|
-
button: ->(*args, **kwargs, &block) do
|
12
|
-
coco_button(*args, **kwargs, theme: nil, size: :md, fit: :full, class: "nav-drawer-button", &block)
|
13
|
-
end
|
14
|
-
}
|
15
|
-
|
16
|
-
def with_divider(...)
|
17
|
-
with_item_divider(...)
|
18
|
-
end
|
19
|
-
|
20
|
-
def with_html(...)
|
21
|
-
with_item_html(...)
|
22
|
-
end
|
23
|
-
|
24
|
-
def with_button(...)
|
25
|
-
with_item_button(...)
|
26
|
-
end
|
27
|
-
|
28
|
-
def with_heading(...)
|
29
|
-
with_item_heading(...)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class PlanPicker < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
|
7
|
-
accepts_option :slider, from: [true, false], default: false
|
8
|
-
|
9
|
-
renders_one :currency_selector, "Coco::App::Elements::OptionBar"
|
10
|
-
renders_one :interval_selector, "Coco::App::Elements::OptionBar"
|
11
|
-
renders_one :view_toggle, ->(*args, **kwargs, &block) do
|
12
|
-
coco_button(*args, icon: :award, theme: :secondary, size: :md, **kwargs, &block)
|
13
|
-
end
|
14
|
-
|
15
|
-
renders_many :plans, ->(**kwargs, &block) do
|
16
|
-
if kwargs.any?
|
17
|
-
Coco::App::Elements::PlanCard.new(**kwargs)
|
18
|
-
else
|
19
|
-
block.call
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def slider? = get_option_value(:slider) == true
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
module SidebarNav
|
5
|
-
class Item < Coco::Component
|
6
|
-
include Concerns::Extendable
|
7
|
-
include Concerns::AcceptsOptions
|
8
|
-
|
9
|
-
tag_attr :href
|
10
|
-
component_name :app_sidebar_nav_item
|
11
|
-
|
12
|
-
accepts_option :active, from: [true, false]
|
13
|
-
accepts_option :emphasise, from: [true, false]
|
14
|
-
|
15
|
-
renders_one :icon
|
16
|
-
renders_one :menu
|
17
|
-
|
18
|
-
before_render do
|
19
|
-
if @icon && !icon?
|
20
|
-
with_icon { coco_icon(@icon, size: :full) }
|
21
|
-
end
|
22
|
-
|
23
|
-
if link? && get_option_value(:active).nil?
|
24
|
-
set_option_value(:active, helpers.current_page?(tag_attr(:href)))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
attr_reader :label
|
29
|
-
|
30
|
-
def initialize(label:, icon: nil, **)
|
31
|
-
@label = label
|
32
|
-
@icon = icon
|
33
|
-
end
|
34
|
-
|
35
|
-
def link?
|
36
|
-
tag_attr?(:href) && !menu?
|
37
|
-
end
|
38
|
-
|
39
|
-
def item_tag
|
40
|
-
link? ? :a : :button
|
41
|
-
end
|
42
|
-
|
43
|
-
def menu_id
|
44
|
-
"#{tag_attr(:id)}-menu" if tag_attr?(:id)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
module SidebarNav
|
5
|
-
class Menu < Coco::Component
|
6
|
-
component_name :app_sidebar_nav_menu
|
7
|
-
|
8
|
-
renders_many :items, types: {
|
9
|
-
link: ->(label, href, qualifier: nil, **kwargs, &block) do
|
10
|
-
if items.size < max_links
|
11
|
-
coco_link(href, **kwargs, theme: nil, underline: false) do
|
12
|
-
tag.span(label, class: "menu-item-label") +
|
13
|
-
tag.span(qualifier, class: "menu-item-qualifier")
|
14
|
-
end
|
15
|
-
else
|
16
|
-
overflow_items << ["#{label}#{qualifier.present? ? " (#{qualifier})" : ""}", href]
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
end,
|
20
|
-
block_link: ->(href, **kwargs, &block) do
|
21
|
-
coco_link(href, **kwargs, theme: nil, underline: false, &block)
|
22
|
-
end
|
23
|
-
}
|
24
|
-
|
25
|
-
renders_one :action, ->(*args, **kwargs, &block) do
|
26
|
-
coco_button(*args, theme: :primary, **kwargs, size: :sm, fit: :full, &block)
|
27
|
-
end
|
28
|
-
|
29
|
-
attr_reader :max_links, :overflow_items, :prompt
|
30
|
-
|
31
|
-
def initialize(max_links: 6, prompt: "More links...", **kwargs)
|
32
|
-
@max_links = max_links
|
33
|
-
@prompt = prompt
|
34
|
-
@overflow_items = []
|
35
|
-
end
|
36
|
-
|
37
|
-
def with_link(...)
|
38
|
-
with_item_link(...)
|
39
|
-
end
|
40
|
-
|
41
|
-
def with_block_link(...)
|
42
|
-
with_item_block_link(...)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
module SidebarNav
|
5
|
-
class Navbar < Coco::Component
|
6
|
-
tag_name :nav
|
7
|
-
component_name :app_sidebar_nav
|
8
|
-
|
9
|
-
renders_many :actions, ->(label, href, icon:, **kwargs) do
|
10
|
-
actions_data << {label: label, href: href, icon: icon, **kwargs}
|
11
|
-
end
|
12
|
-
|
13
|
-
renders_many :items, types: {
|
14
|
-
link: ->(label, href, show_on_mobile: true, **kwargs, &block) do
|
15
|
-
nav_item(mobile: show_on_mobile) do
|
16
|
-
render Coco::App::Blocks::SidebarNav::Item.new(label: label, href: href, **kwargs), &block
|
17
|
-
end
|
18
|
-
end,
|
19
|
-
menu: ->(label, show_on_mobile: true, **kwargs, &block) do
|
20
|
-
nav_item(mobile: show_on_mobile) do
|
21
|
-
render Coco::App::Blocks::SidebarNav::Item.new(label: label, **kwargs) do |item|
|
22
|
-
item.with_menu(&block)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
}
|
27
|
-
|
28
|
-
attr_reader :actions_data
|
29
|
-
|
30
|
-
def initialize(**)
|
31
|
-
@actions_data = []
|
32
|
-
@menus_data = {}
|
33
|
-
end
|
34
|
-
|
35
|
-
def nav_item(mobile: true, &block)
|
36
|
-
tag.div(class: "nav-item", data: {show_on_mobile: mobile.to_s}, &block)
|
37
|
-
end
|
38
|
-
|
39
|
-
def with_link(...)
|
40
|
-
with_item_link(...)
|
41
|
-
end
|
42
|
-
|
43
|
-
def with_menu(...)
|
44
|
-
with_item_menu(...)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,116 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Blocks
|
4
|
-
class SlideEditor < Coco::Component
|
5
|
-
include Coco::AppHelper
|
6
|
-
include Coco::BookHelper
|
7
|
-
include Coco::FormatHelper
|
8
|
-
|
9
|
-
DEFAULT_LAYOUT = "one-col-title"
|
10
|
-
|
11
|
-
renders_one :title, ->(value = nil, **textarea_options) do
|
12
|
-
Coco::App::Elements::SeamlessTextarea.new(**textarea_options,
|
13
|
-
value: value,
|
14
|
-
multiline: false,
|
15
|
-
focus: true,
|
16
|
-
data: {role: "title-editor"},
|
17
|
-
x: {modelable: "value", model: "title"})
|
18
|
-
end
|
19
|
-
|
20
|
-
renders_one :text_1, ->(value = nil, **textarea_options) do
|
21
|
-
Coco::App::Elements::SeamlessTextarea.new(**textarea_options,
|
22
|
-
value: value,
|
23
|
-
multiline: true,
|
24
|
-
data: {role: "text-1-editor"},
|
25
|
-
x: {modelable: "value", model: "text1"})
|
26
|
-
end
|
27
|
-
|
28
|
-
renders_one :text_2, ->(value = nil, **textarea_options) do
|
29
|
-
Coco::App::Elements::SeamlessTextarea.new(**textarea_options,
|
30
|
-
value: value,
|
31
|
-
multiline: true,
|
32
|
-
data: {role: "text-2-editor"},
|
33
|
-
x: {modelable: "value", model: "text2"})
|
34
|
-
end
|
35
|
-
|
36
|
-
renders_one :image_1, ->(src = nil, **image_options) do
|
37
|
-
@image_1_options = {src: src, **image_options}
|
38
|
-
end
|
39
|
-
|
40
|
-
renders_one :image_2, ->(src = nil, **image_options) do
|
41
|
-
@image_2_options = {src: src, **image_options}
|
42
|
-
end
|
43
|
-
|
44
|
-
renders_one :bg_color, ->(value = nil, **input_options) do
|
45
|
-
@bg_color_options = {selected: value, **input_options}
|
46
|
-
end
|
47
|
-
|
48
|
-
renders_one :text_color, ->(value = nil, **input_options) do
|
49
|
-
@text_color_options = {selected: value, **input_options}
|
50
|
-
end
|
51
|
-
|
52
|
-
renders_one :bg_image, ->(src = nil, **input_options) do
|
53
|
-
@bg_image_options = {src: src, **input_options}
|
54
|
-
end
|
55
|
-
|
56
|
-
renders_one :layout, ->(value = DEFAULT_LAYOUT, **input_options) do
|
57
|
-
@layout_options = {selected: value&.to_s&.tr("_", "-"), **input_options}
|
58
|
-
end
|
59
|
-
|
60
|
-
def initialize(generate_thumbnail: true, **kwargs)
|
61
|
-
@generate_thumbnail = generate_thumbnail
|
62
|
-
end
|
63
|
-
|
64
|
-
def generate_thumbnail? = @generate_thumbnail
|
65
|
-
|
66
|
-
def slide_args
|
67
|
-
{
|
68
|
-
bg_image: bg_image_src,
|
69
|
-
bg_color_hex: bg_color_css,
|
70
|
-
text_color_hex: text_color_css,
|
71
|
-
layout: current_layout,
|
72
|
-
render_empty: true
|
73
|
-
}
|
74
|
-
end
|
75
|
-
|
76
|
-
def alpine_props
|
77
|
-
{
|
78
|
-
bg_color: bg_color_css,
|
79
|
-
text_color: text_color_css,
|
80
|
-
title: title&.value,
|
81
|
-
text_1: text_1&.value,
|
82
|
-
text_2: text_2&.value,
|
83
|
-
image_1: image_1_src,
|
84
|
-
image_2: image_2_src,
|
85
|
-
bg_image: bg_image_src,
|
86
|
-
layout: current_layout
|
87
|
-
}
|
88
|
-
end
|
89
|
-
|
90
|
-
def bg_color_css
|
91
|
-
@bg_color_options[:selected] if @bg_color_options
|
92
|
-
end
|
93
|
-
|
94
|
-
def text_color_css
|
95
|
-
@text_color_options[:selected] if @text_color_options
|
96
|
-
end
|
97
|
-
|
98
|
-
def bg_image_src
|
99
|
-
@bg_image_options[:src] if @bg_image_options
|
100
|
-
end
|
101
|
-
|
102
|
-
def image_1_src
|
103
|
-
@image_1_options[:src] if @image_1_options
|
104
|
-
end
|
105
|
-
|
106
|
-
def image_2_src
|
107
|
-
@image_2_options[:src] if @image_2_options
|
108
|
-
end
|
109
|
-
|
110
|
-
def current_layout
|
111
|
-
@layout_options&.fetch(:selected, DEFAULT_LAYOUT) || DEFAULT_LAYOUT
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class Alert < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Concerns::AcceptsTheme
|
7
|
-
|
8
|
-
THEMES = %W[positive warning negative info positive-vivid warning-vivid negative-vivid info-vivid]
|
9
|
-
|
10
|
-
accepts_option :dismissable, from: [true, false], default: false
|
11
|
-
accepts_option :dismiss_after_action, from: [true, false], default: true
|
12
|
-
accepts_option :banner, from: [true, false], default: false
|
13
|
-
accepts_option :theme, from: THEMES, default: "info"
|
14
|
-
accepts_option :single_line, from: [true, false]
|
15
|
-
accepts_option :cloak, from: [true, false], default: true, private: true
|
16
|
-
accepts_option :condensed, from: [true, false], default: false
|
17
|
-
|
18
|
-
renders_one :title
|
19
|
-
renders_one :message
|
20
|
-
|
21
|
-
renders_one :action, ->(*args, **kwargs, &block) do
|
22
|
-
theme = vivid? ? "neutral-dark" : get_option_value(:theme)
|
23
|
-
@action_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
|
24
|
-
end
|
25
|
-
|
26
|
-
renders_one :secondary_action, ->(*args, **kwargs, &block) do
|
27
|
-
theme = vivid? ? "neutral-light" : "text-#{get_option_value(:theme)}"
|
28
|
-
@secondary_action_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
|
29
|
-
end
|
30
|
-
|
31
|
-
renders_one :link, ->(*args, **kwargs, &block) do
|
32
|
-
theme = vivid? ? nil : unvividify(get_option_value(:theme))
|
33
|
-
@link_data = {args: args, kwargs: kwargs.merge(theme: theme), block: block}
|
34
|
-
end
|
35
|
-
|
36
|
-
before_render do
|
37
|
-
unless tag_attr?(:id)
|
38
|
-
set_tag_attr(:id, "alert-#{rand(1000)}")
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def dismissable?
|
43
|
-
get_option_value(:dismissable)
|
44
|
-
end
|
45
|
-
|
46
|
-
def single_line?
|
47
|
-
get_option_value(:single_line)
|
48
|
-
end
|
49
|
-
|
50
|
-
def cloak?
|
51
|
-
get_option_value(:cloak)
|
52
|
-
end
|
53
|
-
|
54
|
-
def vivid?
|
55
|
-
theme = get_option_value(:theme)
|
56
|
-
theme.to_s.match?(/vivid$/)
|
57
|
-
end
|
58
|
-
|
59
|
-
def unvividify(theme)
|
60
|
-
theme.to_s.match?(/vivid$/) ? theme.to_s.underscore.gsub("_vivid", "").to_sym : theme
|
61
|
-
end
|
62
|
-
|
63
|
-
def button_size
|
64
|
-
get_option_value(:condensed) ? :xs : :sm
|
65
|
-
end
|
66
|
-
|
67
|
-
def stamp
|
68
|
-
type = unvividify(get_option_value(:theme))&.to_sym
|
69
|
-
style = if get_option_value(:banner)
|
70
|
-
:compact
|
71
|
-
else
|
72
|
-
vivid? ? :inverse : :subtle
|
73
|
-
end
|
74
|
-
coco_stamp(type, style:)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class ColorPicker < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Coco::AppHelper
|
7
|
-
|
8
|
-
DEFAULT_SWATCHES = [
|
9
|
-
{color: "#111827"},
|
10
|
-
{color: "#F3F4F6"},
|
11
|
-
{color: "#FFFFFF"},
|
12
|
-
{color: "#FEC878"},
|
13
|
-
{color: "#FC5C0E"},
|
14
|
-
{color: "#D50201"},
|
15
|
-
{color: "#1A8871"},
|
16
|
-
{color: "#C1DAA9"},
|
17
|
-
{color: "#F5EEE6"},
|
18
|
-
{color: "#91C7E1"},
|
19
|
-
{color: "#0164FF"},
|
20
|
-
{color: "#3A2D86"}
|
21
|
-
]
|
22
|
-
|
23
|
-
accepts_option :size, from: [:xs, :sm, :md, nil], default: :sm
|
24
|
-
|
25
|
-
before_render do
|
26
|
-
content unless content_evaluated?
|
27
|
-
|
28
|
-
if @swatches.empty?
|
29
|
-
@swatches = DEFAULT_SWATCHES
|
30
|
-
end
|
31
|
-
|
32
|
-
args[:resize]&.each { set_tag_data_attr("size-#{_1}", _2) }
|
33
|
-
end
|
34
|
-
|
35
|
-
renders_many :swatches,
|
36
|
-
->(color, name = nil) do
|
37
|
-
@swatches << {name: name, color: color}
|
38
|
-
end
|
39
|
-
|
40
|
-
attr_reader :selected
|
41
|
-
|
42
|
-
def initialize(selected: "FFFFFF", **kwargs)
|
43
|
-
@selected = selected
|
44
|
-
@swatches = []
|
45
|
-
end
|
46
|
-
|
47
|
-
def color_swatches
|
48
|
-
@swatches
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class ColorPickerButton < 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(**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::ColorPicker)
|
17
|
-
picker
|
18
|
-
else
|
19
|
-
picker&.to_s.presence || Coco::App::Elements::ColorPicker.new(
|
20
|
-
size: @size,
|
21
|
-
resize: @resize,
|
22
|
-
selected: @selected,
|
23
|
-
**kwargs
|
24
|
-
)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
renders_one :icon, ->(&block) do
|
29
|
-
tag.span class: "picker-icon", style: "color: #{@selected}", ":style": "{color: selectedColor}", &block
|
30
|
-
end
|
31
|
-
|
32
|
-
before_render do
|
33
|
-
with_picker(selected: @selected) unless picker?
|
34
|
-
unless icon?
|
35
|
-
with_icon do
|
36
|
-
tag.span class: "picker-button-color", ":style": "{backgroundColor: selectedColor}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
attr_reader :selected
|
42
|
-
|
43
|
-
def initialize(selected: nil, **kwargs)
|
44
|
-
@selected = selected
|
45
|
-
|
46
|
-
@size = kwargs.fetch(:size, :default)&.to_sym
|
47
|
-
if @size.in?(Coco::Button::SIZE_ALIASES.keys) && !kwargs.key?(:resize)
|
48
|
-
@size, @resize = Coco::Button::SIZE_ALIASES.fetch(@size)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def button_text
|
53
|
-
text || content
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class ConfirmPanel < Coco::Component
|
5
|
-
renders_one :button, ->(**kwargs, &block) do
|
6
|
-
coco_button(theme: :negative, **kwargs, fit: :full, size: :sm, &block)
|
7
|
-
end
|
8
|
-
|
9
|
-
renders_one :cancel, ->(**kwargs, &block) do
|
10
|
-
coco_button(theme: :secondary, **kwargs, fit: :full, size: :sm, &block)
|
11
|
-
end
|
12
|
-
|
13
|
-
renders_one :text, Coco::Content
|
14
|
-
|
15
|
-
before_render do
|
16
|
-
unless button?
|
17
|
-
raise ArgumentError, "No confirmation button defined"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Coco
|
2
|
-
module App
|
3
|
-
module Elements
|
4
|
-
class ImagePicker < Coco::Component
|
5
|
-
include Concerns::AcceptsOptions
|
6
|
-
include Coco::AppHelper
|
7
|
-
|
8
|
-
accepts_option :size, from: [:sm, :md, nil], default: :sm
|
9
|
-
|
10
|
-
renders_one :blank_state_text
|
11
|
-
|
12
|
-
before_render do
|
13
|
-
args[:resize]&.each { set_tag_data_attr("size-#{_1}", _2) }
|
14
|
-
end
|
15
|
-
|
16
|
-
attr_reader :uploader_args, :src
|
17
|
-
|
18
|
-
def initialize(src: nil, accept: "image/*", **kwargs)
|
19
|
-
@src = src
|
20
|
-
@uploader_args = {accept: accept}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|