coveragebook_components 0.12.1 → 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 +6576 -5446
- 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.css → application_layout/application_layout.css} +2 -2
- 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.css +5 -2
- 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.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.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/css/app.css
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
@import "./
|
2
|
-
@import "./base";
|
1
|
+
@import "./base/setup";
|
3
2
|
|
4
|
-
@import "
|
5
|
-
@import "./app/tippy";
|
6
|
-
|
7
|
-
@import-glob "@sharedComponents/**/*.css";
|
8
|
-
@import-glob "@appComponents/**/*.css";
|
9
|
-
@import-glob "@bookComponents/**/*.css";
|
3
|
+
@import-glob "@components/**/*.css";
|
@@ -0,0 +1 @@
|
|
1
|
+
@config "../../../../config/tailwind.config.cjs";
|
@@ -1,11 +1,14 @@
|
|
1
|
+
@import "./config";
|
2
|
+
|
1
3
|
@import "tailwindcss/base";
|
2
4
|
@import "tailwindcss/components";
|
3
5
|
@import "tailwindcss/utilities";
|
4
6
|
|
5
|
-
@import "./
|
6
|
-
@import "./
|
7
|
-
@import "./
|
8
|
-
@import "./
|
7
|
+
@import "./utils/layout";
|
8
|
+
@import "./utils/colors";
|
9
|
+
@import "./utils/icons";
|
10
|
+
@import "./utils/text";
|
11
|
+
@import "./tippy";
|
9
12
|
|
10
13
|
@layer base {
|
11
14
|
:root {
|
@@ -43,4 +43,22 @@
|
|
43
43
|
@apply fill-gray-900;
|
44
44
|
}
|
45
45
|
}
|
46
|
+
|
47
|
+
/*
|
48
|
+
* Tippy dropdown theme
|
49
|
+
*/
|
50
|
+
.tippy-box[data-theme~="coco-app-dropdown"],
|
51
|
+
.tippy-box[data-theme~="coco-menu"] {
|
52
|
+
@apply tippy-dropdown-box;
|
53
|
+
}
|
54
|
+
|
55
|
+
.tippy-box[data-theme~="coco-naked-dropdown"] {
|
56
|
+
width: min-content;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
@layer utilities {
|
61
|
+
.tippy-dropdown-box {
|
62
|
+
@apply bg-background-light-2 text-gray-900 label-sm border border-solid border-gray-blend-100 shadow-xl rounded-lg;
|
63
|
+
}
|
46
64
|
}
|
data/app/assets/css/book.css
CHANGED
data/app/assets/js/app.js
CHANGED
@@ -1,14 +1,30 @@
|
|
1
|
-
import
|
1
|
+
import { registerComponents } from "@helpers/alpine";
|
2
|
+
import { navigateTo } from "@helpers/location";
|
3
|
+
import { Alpine } from "./base/setup";
|
2
4
|
|
3
|
-
|
5
|
+
import components from "@components/**/*.js";
|
6
|
+
registerComponents(components);
|
4
7
|
|
5
|
-
|
6
|
-
|
8
|
+
// Global JS navigation handler.
|
9
|
+
// Optionally uses Turbo for the page navigation.
|
10
|
+
window.addEventListener("app:navigate", (event) => {
|
11
|
+
const url = event.detail.url;
|
12
|
+
if (url) {
|
13
|
+
delete event.detail.url;
|
14
|
+
navigateTo(url, event.detail);
|
15
|
+
}
|
16
|
+
});
|
7
17
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
18
|
+
// Uodate the value of the `--app-height` css variable
|
19
|
+
// when the viewport size changes. To help work around the
|
20
|
+
// issues when using 100vh on mobile safari (https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8)
|
21
|
+
function setAppHeightProperty() {
|
22
|
+
document.documentElement.style.setProperty(
|
23
|
+
"--app-height",
|
24
|
+
`${window.innerHeight}px`
|
25
|
+
);
|
26
|
+
}
|
27
|
+
window.addEventListener("resize", setAppHeightProperty);
|
28
|
+
setAppHeightProperty();
|
13
29
|
|
14
30
|
Alpine.start();
|
@@ -6,13 +6,13 @@ import intersect from "@alpinejs/intersect";
|
|
6
6
|
import mask from "@alpinejs/mask";
|
7
7
|
import focus from "@alpinejs/focus";
|
8
8
|
|
9
|
-
import undo from "@assets/js/
|
10
|
-
import options from "@assets/js/
|
11
|
-
import tooltip from "@assets/js/
|
12
|
-
import destroy from "@assets/js/
|
13
|
-
import dropdown from "@assets/js/
|
14
|
-
import dimensions from "@assets/js/
|
15
|
-
import notification from "@assets/js/
|
9
|
+
import undo from "@assets/js/base/alpine/directives/undo";
|
10
|
+
import options from "@assets/js/base/alpine/directives/options";
|
11
|
+
import tooltip from "@assets/js/base/alpine/directives/tooltip";
|
12
|
+
import destroy from "@assets/js/base/alpine/directives/destroy";
|
13
|
+
import dropdown from "@assets/js/base/alpine/directives/dropdown";
|
14
|
+
import dimensions from "@assets/js/base/alpine/directives/dimensions";
|
15
|
+
import notification from "@assets/js/base/alpine/directives/notification";
|
16
16
|
|
17
17
|
window.Alpine = Alpine;
|
18
18
|
|
data/app/assets/js/book.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import "
|
1
|
+
import { registerComponents } from "@helpers/alpine";
|
2
|
+
import { Alpine } from "./base/setup";
|
2
3
|
|
3
|
-
import
|
4
|
+
import components from "@components/!(app)/**/*.js";
|
4
5
|
|
5
|
-
|
6
|
-
import "./book/components";
|
6
|
+
registerComponents(components);
|
7
7
|
|
8
8
|
Alpine.start();
|
@@ -107,11 +107,11 @@
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
|
110
|
-
@media screen(sm) and screen(max-
|
110
|
+
@media screen(sm) and screen(max-xl) {
|
111
111
|
--sidebar-nav-width: theme(width.16);
|
112
112
|
}
|
113
113
|
|
114
|
-
@media screen(
|
114
|
+
@media screen(xl) {
|
115
115
|
--sidebar-nav-width: theme(width.24);
|
116
116
|
}
|
117
117
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class ApplicationLayout < Coco::Component
|
4
|
+
component_name :application_layout
|
5
|
+
|
6
|
+
renders_one :flashes
|
7
|
+
renders_one :banner
|
8
|
+
renders_one :header
|
9
|
+
renders_one :sidebar_nav
|
10
|
+
|
11
|
+
def banner_content?
|
12
|
+
banner.to_s.strip != ""
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class ContactCallout < Coco::Component
|
4
|
+
renders_one :avatar, ->(*args, **kwargs) do
|
5
|
+
coco_avatar(*args, **kwargs, size: :full)
|
6
|
+
end
|
7
|
+
|
8
|
+
renders_one :action, ->(*args, **kwargs, &block) do
|
9
|
+
coco_button(*args, theme: :primary, **kwargs, &block)
|
10
|
+
end
|
11
|
+
|
12
|
+
renders_many :contact_numbers, ->(region, number) do
|
13
|
+
@contact_numbers << {region:, number:}
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(**kwargs)
|
17
|
+
@contact_numbers = []
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class Faqs < Coco::Component
|
4
|
+
renders_many :entries, ->(question, id: nil, &block) do
|
5
|
+
@entries << {question:, answer: block.call, id:}
|
6
|
+
end
|
7
|
+
|
8
|
+
def initialize(title: "Frequently asked questions", **)
|
9
|
+
@title = title
|
10
|
+
@entries = []
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class Header < Coco::Component
|
4
|
+
renders_one :primary_nav, ->(**kwargs) do
|
5
|
+
Coco::ButtonGroup.new(
|
6
|
+
theme: :text_neutral_light,
|
7
|
+
collapsible: false,
|
8
|
+
size: :xs,
|
9
|
+
**kwargs
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
renders_one :secondary_nav, ->(**kwargs) do
|
14
|
+
Coco::ButtonGroup.new(
|
15
|
+
theme: :text_neutral_light,
|
16
|
+
collapsible: false,
|
17
|
+
size: :xs,
|
18
|
+
**kwargs
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
renders_one :mobile_nav, ->(**kwargs) do
|
23
|
+
Coco::App::NavDrawer.new(**kwargs)
|
24
|
+
end
|
25
|
+
|
26
|
+
attr_reader :home_path
|
27
|
+
|
28
|
+
def initialize(home_path: nil, **)
|
29
|
+
@home_path = home_path
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class NavDrawer < Coco::Component
|
4
|
+
renders_many :items, types: {
|
5
|
+
html: ->(&block) { block.call },
|
6
|
+
divider: ->(&block) { tag.div class: "nav-drawer-divider" },
|
7
|
+
heading: ->(text, **kwargs, &block) do
|
8
|
+
tag.h4(text, class: "nav-drawer-heading")
|
9
|
+
end,
|
10
|
+
button: ->(*args, **kwargs, &block) do
|
11
|
+
coco_button(*args, **kwargs, theme: nil, size: :md, fit: :full, class: "nav-drawer-button", &block)
|
12
|
+
end
|
13
|
+
}
|
14
|
+
|
15
|
+
def with_divider(...)
|
16
|
+
with_item_divider(...)
|
17
|
+
end
|
18
|
+
|
19
|
+
def with_html(...)
|
20
|
+
with_item_html(...)
|
21
|
+
end
|
22
|
+
|
23
|
+
def with_button(...)
|
24
|
+
with_item_button(...)
|
25
|
+
end
|
26
|
+
|
27
|
+
def with_heading(...)
|
28
|
+
with_item_heading(...)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class PlanCard < Coco::Component
|
4
|
+
include Concerns::AcceptsOptions
|
5
|
+
|
6
|
+
accepts_option :active, from: [true, false]
|
7
|
+
accepts_option :recommended, from: [true, false]
|
8
|
+
|
9
|
+
renders_one :action, ->(*args, **kwargs, &block) do
|
10
|
+
coco_button(*args, **kwargs,
|
11
|
+
size: :sm,
|
12
|
+
fit: :full,
|
13
|
+
disabled: active?,
|
14
|
+
&block)
|
15
|
+
end
|
16
|
+
|
17
|
+
renders_many :benefits, ->(benefit, &block) do
|
18
|
+
@benefits[benefit] = block&.call
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_reader :name, :price, :promo
|
22
|
+
|
23
|
+
def initialize(name:, price:, promo: nil, **kwargs)
|
24
|
+
@name = name
|
25
|
+
@price = price
|
26
|
+
@promo = promo
|
27
|
+
@benefits = {}
|
28
|
+
end
|
29
|
+
|
30
|
+
def recommended?
|
31
|
+
get_option_value(:recommended) == true
|
32
|
+
end
|
33
|
+
|
34
|
+
def active?
|
35
|
+
get_option_value(:active) == true
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
.plan-picker-controls {
|
6
6
|
@apply space-y-4;
|
7
7
|
|
8
|
-
[data-component="
|
8
|
+
[data-component="option-bar"] {
|
9
9
|
@apply mx-auto;
|
10
10
|
}
|
11
11
|
|
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
.plan-picker-currency
|
56
56
|
+ .plan-picker-interval
|
57
|
-
> [data-component="
|
57
|
+
> [data-component="option-bar"] {
|
58
58
|
@apply mr-0;
|
59
59
|
}
|
60
60
|
}
|
@@ -66,7 +66,7 @@
|
|
66
66
|
|
67
67
|
@container (min-width: 984px) {
|
68
68
|
.plan-picker-controls {
|
69
|
-
.plan-picker-interval > [data-component="
|
69
|
+
.plan-picker-interval > [data-component="option-bar"] {
|
70
70
|
@apply !mx-auto;
|
71
71
|
}
|
72
72
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
class PlanPicker < Coco::Component
|
4
|
+
include Concerns::AcceptsOptions
|
5
|
+
|
6
|
+
accepts_option :slider, from: [true, false], default: false
|
7
|
+
|
8
|
+
renders_one :currency_selector, "Coco::OptionBar"
|
9
|
+
renders_one :interval_selector, "Coco::OptionBar"
|
10
|
+
renders_one :view_toggle, ->(*args, **kwargs, &block) do
|
11
|
+
coco_button(*args, icon: :award, theme: :secondary, size: :md, **kwargs, &block)
|
12
|
+
end
|
13
|
+
|
14
|
+
renders_many :plans, ->(**kwargs, &block) do
|
15
|
+
if kwargs.any?
|
16
|
+
Coco::App::PlanCard.new(**kwargs)
|
17
|
+
else
|
18
|
+
block.call
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def slider? = get_option_value(:slider) == true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import tippy from "@assets/js/
|
2
|
-
import { CocoComponent } from "@assets/js/
|
1
|
+
import tippy from "@assets/js/base/tippy";
|
2
|
+
import { CocoComponent } from "@assets/js/base/coco";
|
3
3
|
|
4
4
|
export default CocoComponent("appSidebarNavItem", () => {
|
5
5
|
return {
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
module SidebarNav
|
4
|
+
class Item < Coco::Component
|
5
|
+
include Concerns::Extendable
|
6
|
+
include Concerns::AcceptsOptions
|
7
|
+
|
8
|
+
tag_attr :href
|
9
|
+
component_name :app_sidebar_nav_item
|
10
|
+
|
11
|
+
accepts_option :active, from: [true, false]
|
12
|
+
accepts_option :emphasise, from: [true, false]
|
13
|
+
|
14
|
+
renders_one :icon
|
15
|
+
renders_one :menu
|
16
|
+
|
17
|
+
before_render do
|
18
|
+
if @icon && !icon?
|
19
|
+
with_icon { coco_icon(@icon, size: :full) }
|
20
|
+
end
|
21
|
+
|
22
|
+
if link? && get_option_value(:active).nil?
|
23
|
+
set_option_value(:active, helpers.current_page?(tag_attr(:href)))
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_reader :label
|
28
|
+
|
29
|
+
def initialize(label:, icon: nil, **)
|
30
|
+
@label = label
|
31
|
+
@icon = icon
|
32
|
+
end
|
33
|
+
|
34
|
+
def link?
|
35
|
+
tag_attr?(:href) && !menu?
|
36
|
+
end
|
37
|
+
|
38
|
+
def item_tag
|
39
|
+
link? ? :a : :button
|
40
|
+
end
|
41
|
+
|
42
|
+
def menu_id
|
43
|
+
"#{tag_attr(:id)}-menu" if tag_attr?(:id)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
module SidebarNav
|
4
|
+
class Menu < Coco::Component
|
5
|
+
component_name :app_sidebar_nav_menu
|
6
|
+
|
7
|
+
renders_many :items, types: {
|
8
|
+
link: ->(label, href, qualifier: nil, **kwargs, &block) do
|
9
|
+
if items.size < max_links
|
10
|
+
coco_link(href, **kwargs, theme: nil, underline: false) do
|
11
|
+
tag.span(label, class: "menu-item-label") +
|
12
|
+
tag.span(qualifier, class: "menu-item-qualifier")
|
13
|
+
end
|
14
|
+
else
|
15
|
+
overflow_items << ["#{label}#{qualifier.present? ? " (#{qualifier})" : ""}", href]
|
16
|
+
nil
|
17
|
+
end
|
18
|
+
end,
|
19
|
+
block_link: ->(href, **kwargs, &block) do
|
20
|
+
coco_link(href, **kwargs, theme: nil, underline: false, &block)
|
21
|
+
end
|
22
|
+
}
|
23
|
+
|
24
|
+
renders_one :action, ->(*args, **kwargs, &block) do
|
25
|
+
coco_button(*args, theme: :primary, **kwargs, size: :sm, fit: :full, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
attr_reader :max_links, :overflow_items, :prompt
|
29
|
+
|
30
|
+
def initialize(max_links: 6, prompt: "More links...", **kwargs)
|
31
|
+
@max_links = max_links
|
32
|
+
@prompt = prompt
|
33
|
+
@overflow_items = []
|
34
|
+
end
|
35
|
+
|
36
|
+
def with_link(...)
|
37
|
+
with_item_link(...)
|
38
|
+
end
|
39
|
+
|
40
|
+
def with_block_link(...)
|
41
|
+
with_item_block_link(...)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= render component_tag(x: {data: "appSidebarNav"}) do %>
|
2
2
|
<% if actions? %>
|
3
3
|
<div class="nav-item nav-item-action">
|
4
|
-
<%= render Coco::App::
|
4
|
+
<%= render Coco::App::SidebarNav::Item.new(label: "Add") do |item| %>
|
5
5
|
<% item.with_icon do %>
|
6
6
|
<span class="nav-item-action-button">
|
7
7
|
<%= coco_icon :plus, size: :full %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import tokens from "@config/tokens.cjs";
|
2
|
-
import { CocoComponent } from "@assets/js/
|
2
|
+
import { CocoComponent } from "@assets/js/base/coco";
|
3
3
|
|
4
|
-
const mobileMaxWidth = parseInt(tokens.
|
4
|
+
const mobileMaxWidth = parseInt(tokens.screens.sm, 10);
|
5
5
|
|
6
6
|
export default CocoComponent("appSidebarNav", () => {
|
7
7
|
return {
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Coco
|
2
|
+
module App
|
3
|
+
module SidebarNav
|
4
|
+
class Navbar < Coco::Component
|
5
|
+
include Coco::AppComponentsHelper
|
6
|
+
|
7
|
+
tag_name :nav
|
8
|
+
component_name :app_sidebar_nav
|
9
|
+
|
10
|
+
renders_many :actions, ->(label, href, icon:, **kwargs) do
|
11
|
+
actions_data << {label: label, href: href, icon: icon, **kwargs}
|
12
|
+
end
|
13
|
+
|
14
|
+
renders_many :items, types: {
|
15
|
+
link: ->(label, href, show_on_mobile: true, **kwargs, &block) do
|
16
|
+
nav_item(mobile: show_on_mobile) do
|
17
|
+
render Coco::App::SidebarNav::Item.new(label: label, href: href, **kwargs), &block
|
18
|
+
end
|
19
|
+
end,
|
20
|
+
menu: ->(label, show_on_mobile: true, **kwargs, &block) do
|
21
|
+
nav_item(mobile: show_on_mobile) do
|
22
|
+
render Coco::App::SidebarNav::Item.new(label: label, **kwargs) do |item|
|
23
|
+
item.with_menu(&block)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
}
|
28
|
+
|
29
|
+
attr_reader :actions_data
|
30
|
+
|
31
|
+
def initialize(**)
|
32
|
+
@actions_data = []
|
33
|
+
@menus_data = {}
|
34
|
+
end
|
35
|
+
|
36
|
+
def nav_item(mobile: true, &block)
|
37
|
+
tag.div(class: "nav-item", data: {show_on_mobile: mobile.to_s}, &block)
|
38
|
+
end
|
39
|
+
|
40
|
+
def with_link(...)
|
41
|
+
with_item_link(...)
|
42
|
+
end
|
43
|
+
|
44
|
+
def with_menu(...)
|
45
|
+
with_item_menu(...)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CocoComponent } from "@assets/js/
|
1
|
+
import { CocoComponent } from "@assets/js/base/coco";
|
2
2
|
import { getData } from "@helpers/alpine";
|
3
3
|
import { captureElementScreenshot } from "@helpers/screenshot";
|
4
4
|
import { isDark } from "@helpers/color";
|
@@ -84,7 +84,7 @@ export default CocoComponent("appSlideEditor", (data) => {
|
|
84
84
|
|
85
85
|
updateTextareaSizes() {
|
86
86
|
const inputs = this.$root.querySelectorAll(
|
87
|
-
"[data-component='
|
87
|
+
"[data-component='seamless-textarea']"
|
88
88
|
);
|
89
89
|
Array.from(inputs).forEach((el) => getData(el).onResize());
|
90
90
|
},
|