spree_storefront 5.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.md +13 -0
- data/Rakefile +15 -0
- data/app/assets/config/spree_storefront_manifest.js +6 -0
- data/app/assets/stylesheets/storefront_page_builder.css +51 -0
- data/app/controllers/concerns/spree/cart_methods.rb +40 -0
- data/app/controllers/concerns/spree/locale_urls.rb +23 -0
- data/app/controllers/concerns/spree/password_protected.rb +17 -0
- data/app/controllers/concerns/spree/theme_concern.rb +29 -0
- data/app/controllers/spree/account/addresses_controller.rb +16 -0
- data/app/controllers/spree/account/base_controller.rb +20 -0
- data/app/controllers/spree/account/newsletter_controller.rb +34 -0
- data/app/controllers/spree/account/orders_controller.rb +34 -0
- data/app/controllers/spree/account/profile_controller.rb +23 -0
- data/app/controllers/spree/account/store_credits_controller.rb +23 -0
- data/app/controllers/spree/account/wished_items_controller.rb +45 -0
- data/app/controllers/spree/addresses_controller.rb +101 -0
- data/app/controllers/spree/checkout_controller.rb +365 -0
- data/app/controllers/spree/contacts_controller.rb +46 -0
- data/app/controllers/spree/digital_links_controller.rb +48 -0
- data/app/controllers/spree/home_controller.rb +5 -0
- data/app/controllers/spree/line_items_controller.rb +96 -0
- data/app/controllers/spree/newsletter_subscribers_controller.rb +43 -0
- data/app/controllers/spree/order_status_controller.rb +32 -0
- data/app/controllers/spree/orders_controller.rb +104 -0
- data/app/controllers/spree/page_sections_controller.rb +17 -0
- data/app/controllers/spree/pages_controller.rb +13 -0
- data/app/controllers/spree/password_controller.rb +21 -0
- data/app/controllers/spree/policies_controller.rb +17 -0
- data/app/controllers/spree/posts_controller.rb +76 -0
- data/app/controllers/spree/products_controller.rb +99 -0
- data/app/controllers/spree/search_controller.rb +39 -0
- data/app/controllers/spree/seo_controller.rb +25 -0
- data/app/controllers/spree/settings_controller.rb +68 -0
- data/app/controllers/spree/store_controller.rb +247 -0
- data/app/controllers/spree/taxonomies_controller.rb +30 -0
- data/app/controllers/spree/taxons_controller.rb +46 -0
- data/app/controllers/spree/wishlists_controller.rb +19 -0
- data/app/finders/spree/storefront/variant_finder.rb +80 -0
- data/app/helpers/spree/analytics_helper.rb +28 -0
- data/app/helpers/spree/cart_helper.rb +48 -0
- data/app/helpers/spree/checkout_analytics_helper.rb +77 -0
- data/app/helpers/spree/checkout_helper.rb +58 -0
- data/app/helpers/spree/filters_helper.rb +180 -0
- data/app/helpers/spree/fonts_helper.rb +58 -0
- data/app/helpers/spree/orders_helper.rb +7 -0
- data/app/helpers/spree/page_helper.rb +67 -0
- data/app/helpers/spree/posts_helper.rb +42 -0
- data/app/helpers/spree/products_helper.rb +205 -0
- data/app/helpers/spree/storefront_helper.rb +86 -0
- data/app/helpers/spree/storefront_locale_helper.rb +42 -0
- data/app/helpers/spree/theme_helper.rb +244 -0
- data/app/helpers/spree/turbo_helper.rb +13 -0
- data/app/helpers/spree/turbo_stream_actions_helper.rb +13 -0
- data/app/helpers/spree/wishlist_helper.rb +7 -0
- data/app/javascript/spree/storefront/application.js +156 -0
- data/app/javascript/spree/storefront/controllers/accordion_controller.js +25 -0
- data/app/javascript/spree/storefront/controllers/account_nav_controller.js +10 -0
- data/app/javascript/spree/storefront/controllers/card_validation_controller.js +103 -0
- data/app/javascript/spree/storefront/controllers/carousel_controller.js +44 -0
- data/app/javascript/spree/storefront/controllers/cart_controller.js +10 -0
- data/app/javascript/spree/storefront/controllers/checkout_address_book_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/checkout_delivery_controller.js +39 -0
- data/app/javascript/spree/storefront/controllers/checkout_promotions_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/checkout_summary_controller.js +46 -0
- data/app/javascript/spree/storefront/controllers/clear_input_controller.js +23 -0
- data/app/javascript/spree/storefront/controllers/copy_input_controller.js +19 -0
- data/app/javascript/spree/storefront/controllers/dropdown_controller.js +14 -0
- data/app/javascript/spree/storefront/controllers/header_controller.js +33 -0
- data/app/javascript/spree/storefront/controllers/infinite_scroll_controller.js +31 -0
- data/app/javascript/spree/storefront/controllers/lightbox_controller.js +138 -0
- data/app/javascript/spree/storefront/controllers/mobile_nav_controller.js +17 -0
- data/app/javascript/spree/storefront/controllers/modal_controller.js +15 -0
- data/app/javascript/spree/storefront/controllers/no_ui_slider_controller.js +55 -0
- data/app/javascript/spree/storefront/controllers/pdp_desktop_gallery_controller.js +28 -0
- data/app/javascript/spree/storefront/controllers/plp_variant_picker_controller.js +151 -0
- data/app/javascript/spree/storefront/controllers/product_form_controller.js +136 -0
- data/app/javascript/spree/storefront/controllers/quantity_picker_controller.js +43 -0
- data/app/javascript/spree/storefront/controllers/search_suggestions_controller.js +61 -0
- data/app/javascript/spree/storefront/controllers/searchable_list_controller.js +25 -0
- data/app/javascript/spree/storefront/controllers/slideover_controller.js +40 -0
- data/app/javascript/spree/storefront/controllers/sticky_button_controller.js +32 -0
- data/app/javascript/spree/storefront/controllers/toggle_menu_controller.js +32 -0
- data/app/javascript/spree/storefront/controllers/turbo_stream_form_controller.js +51 -0
- data/app/javascript/spree/storefront/controllers/wished_item_controller.js +69 -0
- data/app/javascript/spree/storefront/helpers/lazy_load_controllers_with_manifest.js +78 -0
- data/app/javascript/spree/storefront/helpers/show_flash_message.js +25 -0
- data/app/models/spree/color_names.rb +35 -0
- data/app/models/spree/contact.rb +24 -0
- data/app/presenters/spree/colors_preview_styles_presenter.rb +84 -0
- data/app/presenters/spree/featured_product_presenter.rb +42 -0
- data/app/presenters/spree/mega_nav_presenter.rb +55 -0
- data/app/views/devise/passwords/edit.html.erb +22 -0
- data/app/views/devise/passwords/new.html.erb +16 -0
- data/app/views/devise/registrations/_form.html.erb +21 -0
- data/app/views/devise/registrations/edit.html.erb +24 -0
- data/app/views/devise/registrations/new.html.erb +27 -0
- data/app/views/devise/sessions/new.html.erb +25 -0
- data/app/views/devise/shared/_links.html.erb +22 -0
- data/app/views/layouts/spree/checkout.html.erb +58 -0
- data/app/views/layouts/spree/password.html.erb +34 -0
- data/app/views/layouts/spree/storefront.html.erb +38 -0
- data/app/views/spree/account/wished_items/create.turbo_stream.erb +8 -0
- data/app/views/spree/account/wished_items/destroy.turbo_stream.erb +20 -0
- data/app/views/spree/addresses/destroy.turbo_stream.erb +1 -0
- data/app/views/spree/addresses/edit.html.erb +57 -0
- data/app/views/spree/addresses/new.html.erb +71 -0
- data/app/views/spree/checkout/_address.html.erb +153 -0
- data/app/views/spree/checkout/_button_processing.html.erb +7 -0
- data/app/views/spree/checkout/_coupon_code.html.erb +55 -0
- data/app/views/spree/checkout/_credit_card.html.erb +12 -0
- data/app/views/spree/checkout/_delivery.html.erb +70 -0
- data/app/views/spree/checkout/_line_item.html.erb +26 -0
- data/app/views/spree/checkout/_line_items.html.erb +7 -0
- data/app/views/spree/checkout/_missing_all_line_items.html.erb +17 -0
- data/app/views/spree/checkout/_missing_line_items.html.erb +28 -0
- data/app/views/spree/checkout/_payment.html.erb +35 -0
- data/app/views/spree/checkout/_payment_methods.html.erb +72 -0
- data/app/views/spree/checkout/_payment_sources.html.erb +24 -0
- data/app/views/spree/checkout/_quick_checkout.html.erb +1 -0
- data/app/views/spree/checkout/_sidebar.html.erb +34 -0
- data/app/views/spree/checkout/_store_credit.html.erb +21 -0
- data/app/views/spree/checkout/_summary.html.erb +116 -0
- data/app/views/spree/checkout/_user_account.html.erb +9 -0
- data/app/views/spree/checkout/apply_coupon_code.turbo_stream.erb +45 -0
- data/app/views/spree/checkout/apply_store_credit.turbo_stream.erb +19 -0
- data/app/views/spree/checkout/edit.html.erb +98 -0
- data/app/views/spree/checkout/payment/_check.html.erb +0 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +74 -0
- data/app/views/spree/checkout/payment/_store_credit.html.erb +13 -0
- data/app/views/spree/checkout/remove_coupon_code.turbo_stream.erb +34 -0
- data/app/views/spree/checkout/remove_store_credit.turbo_stream.erb +19 -0
- data/app/views/spree/checkout/update.turbo_stream.erb +25 -0
- data/app/views/spree/home/index.html.erb +1 -0
- data/app/views/spree/line_items/create.turbo_stream.erb +13 -0
- data/app/views/spree/line_items/destroy.turbo_stream.erb +11 -0
- data/app/views/spree/line_items/update.turbo_stream.erb +10 -0
- data/app/views/spree/newsletter_subscribers/create.turbo_stream.erb +7 -0
- data/app/views/spree/order_status/new.html.erb +16 -0
- data/app/views/spree/page_sections/show.html.erb +3 -0
- data/app/views/spree/pages/show.html.erb +1 -0
- data/app/views/spree/password/show.html.erb +1 -0
- data/app/views/spree/posts/index.html.erb +1 -0
- data/app/views/spree/posts/related_products.html.erb +7 -0
- data/app/views/spree/posts/show.html.erb +1 -0
- data/app/views/spree/products/index.html.erb +1 -0
- data/app/views/spree/products/index.turbo_stream.erb +1 -0
- data/app/views/spree/products/related.html.erb +3 -0
- data/app/views/spree/products/show.html.erb +1 -0
- data/app/views/spree/search/show.html.erb +6 -0
- data/app/views/spree/search/show.turbo_stream.erb +1 -0
- data/app/views/spree/search/suggestions.turbo_stream.erb +8 -0
- data/app/views/spree/seo/robots.text.erb +31 -0
- data/app/views/spree/seo/sitemap.xml.erb +25 -0
- data/app/views/spree/shared/_fonts.html.erb +14 -0
- data/app/views/spree/shared/_head.html.erb +36 -0
- data/app/views/spree/shared/_load_more_products.turbo_stream.erb +7 -0
- data/app/views/spree/shared/_product_listing_page.html.erb +11 -0
- data/app/views/spree/shared/_products.html.erb +1 -0
- data/app/views/spree/taxonomies/show.html.erb +1 -0
- data/app/views/spree/taxons/show.html.erb +1 -0
- data/app/views/spree/taxons/show.turbo_stream.erb +1 -0
- data/app/views/spree/waitlists/create.turbo_stream.erb +9 -0
- data/app/views/themes/default/kaminari/storefront/_first_page.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_gap.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_last_page.html.erb +8 -0
- data/app/views/themes/default/kaminari/storefront/_next_page.html.erb +13 -0
- data/app/views/themes/default/kaminari/storefront/_page.html.erb +10 -0
- data/app/views/themes/default/kaminari/storefront/_paginator.html.erb +27 -0
- data/app/views/themes/default/kaminari/storefront/_prev_page.html.erb +13 -0
- data/app/views/themes/default/spree/account/_account_nav.html.erb +46 -0
- data/app/views/themes/default/spree/account/_order.html.erb +39 -0
- data/app/views/themes/default/spree/account/_orders.html.erb +16 -0
- data/app/views/themes/default/spree/account/addresses/_address.html.erb +42 -0
- data/app/views/themes/default/spree/account/addresses/index.html.erb +28 -0
- data/app/views/themes/default/spree/account/newsletter/_newsletter_settings.html.erb +13 -0
- data/app/views/themes/default/spree/account/newsletter/edit.html.erb +16 -0
- data/app/views/themes/default/spree/account/newsletter/update.html.erb +1 -0
- data/app/views/themes/default/spree/account/orders/index.html.erb +24 -0
- data/app/views/themes/default/spree/account/orders/show.html.erb +22 -0
- data/app/views/themes/default/spree/account/profile/edit.html.erb +36 -0
- data/app/views/themes/default/spree/account/store_credits/_store_credit_event.html.erb +29 -0
- data/app/views/themes/default/spree/account/store_credits/index.html.erb +31 -0
- data/app/views/themes/default/spree/checkout/_footer.html.erb +10 -0
- data/app/views/themes/default/spree/checkout/complete.html.erb +84 -0
- data/app/views/themes/default/spree/contacts/new.html.erb +23 -0
- data/app/views/themes/default/spree/orders/_cart.html.erb +14 -0
- data/app/views/themes/default/spree/orders/_empty.html.erb +11 -0
- data/app/views/themes/default/spree/orders/_line_item.html.erb +47 -0
- data/app/views/themes/default/spree/orders/_line_item_quantity.html.erb +11 -0
- data/app/views/themes/default/spree/orders/_summary.html.erb +41 -0
- data/app/views/themes/default/spree/orders/edit.html.erb +18 -0
- data/app/views/themes/default/spree/orders/show.html.erb +6 -0
- data/app/views/themes/default/spree/page_sections/_announcement_bar.html.erb +10 -0
- data/app/views/themes/default/spree/page_sections/_custom_code.html.erb +5 -0
- data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +136 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +116 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +71 -0
- data/app/views/themes/default/spree/page_sections/_footer.html.erb +62 -0
- data/app/views/themes/default/spree/page_sections/_header.html.erb +166 -0
- data/app/views/themes/default/spree/page_sections/_image_banner.html.erb +57 -0
- data/app/views/themes/default/spree/page_sections/_image_with_text.html.erb +66 -0
- data/app/views/themes/default/spree/page_sections/_main_password_footer.html.erb +64 -0
- data/app/views/themes/default/spree/page_sections/_main_password_header.html.erb +54 -0
- data/app/views/themes/default/spree/page_sections/_newsletter.html.erb +47 -0
- data/app/views/themes/default/spree/page_sections/_page_title.html.erb +7 -0
- data/app/views/themes/default/spree/page_sections/_post_details.html.erb +19 -0
- data/app/views/themes/default/spree/page_sections/_post_grid.html.erb +11 -0
- data/app/views/themes/default/spree/page_sections/_product_details.html.erb +102 -0
- data/app/views/themes/default/spree/page_sections/_product_grid.html.erb +52 -0
- data/app/views/themes/default/spree/page_sections/_related_products.html.erb +15 -0
- data/app/views/themes/default/spree/page_sections/_rich_text.html.erb +18 -0
- data/app/views/themes/default/spree/page_sections/_taxon_banner.html.erb +37 -0
- data/app/views/themes/default/spree/page_sections/_taxon_grid.html.erb +103 -0
- data/app/views/themes/default/spree/page_sections/_video.html.erb +27 -0
- data/app/views/themes/default/spree/page_sections/nav/_desktop.html.erb +49 -0
- data/app/views/themes/default/spree/page_sections/nav/_mobile.html.erb +136 -0
- data/app/views/themes/default/spree/policies/show.html.erb +11 -0
- data/app/views/themes/default/spree/posts/_json_ld.html.erb +20 -0
- data/app/views/themes/default/spree/posts/_pagination.html.erb +1 -0
- data/app/views/themes/default/spree/posts/_post.html.erb +13 -0
- data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +58 -0
- data/app/views/themes/default/spree/products/_add_to_waitlist.html.erb +36 -0
- data/app/views/themes/default/spree/products/_add_to_wishlist.html.erb +33 -0
- data/app/views/themes/default/spree/products/_breadcrumbs.html.erb +23 -0
- data/app/views/themes/default/spree/products/_color_picker.html.erb +19 -0
- data/app/views/themes/default/spree/products/_color_swatches.html.erb +61 -0
- data/app/views/themes/default/spree/products/_details.html.erb +55 -0
- data/app/views/themes/default/spree/products/_featured_image.html.erb +37 -0
- data/app/views/themes/default/spree/products/_filters.html.erb +45 -0
- data/app/views/themes/default/spree/products/_json_ld.html.erb +38 -0
- data/app/views/themes/default/spree/products/_json_ld_list.html.erb +9 -0
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +10 -0
- data/app/views/themes/default/spree/products/_label.html.erb +26 -0
- data/app/views/themes/default/spree/products/_media_gallery.html.erb +94 -0
- data/app/views/themes/default/spree/products/_price.html.erb +59 -0
- data/app/views/themes/default/spree/products/_product.html.erb +62 -0
- data/app/views/themes/default/spree/products/_quantity_selector.html.erb +32 -0
- data/app/views/themes/default/spree/products/_returns_policy_modal.html.erb +22 -0
- data/app/views/themes/default/spree/products/_show_more_button.html.erb +8 -0
- data/app/views/themes/default/spree/products/_sort.html.erb +45 -0
- data/app/views/themes/default/spree/products/_swiper.html.erb +85 -0
- data/app/views/themes/default/spree/products/_tags.html.erb +0 -0
- data/app/views/themes/default/spree/products/_variant_options.html.erb +71 -0
- data/app/views/themes/default/spree/products/_variant_picker.html.erb +50 -0
- data/app/views/themes/default/spree/products/filters/_availability.html.erb +32 -0
- data/app/views/themes/default/spree/products/filters/_colors.html.erb +23 -0
- data/app/views/themes/default/spree/products/filters/_generic.html.erb +75 -0
- data/app/views/themes/default/spree/products/filters/_price.html.erb +35 -0
- data/app/views/themes/default/spree/products/filters/_taxons.erb +78 -0
- data/app/views/themes/default/spree/search/_suggestions.html.erb +92 -0
- data/app/views/themes/default/spree/settings/show.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_account_pane.html.erb +28 -0
- data/app/views/themes/default/spree/shared/_address.html.erb +35 -0
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +13 -0
- data/app/views/themes/default/spree/shared/_cart_pane.html.erb +38 -0
- data/app/views/themes/default/spree/shared/_css_variables.html.erb +54 -0
- data/app/views/themes/default/spree/shared/_custom_head.html.erb +0 -0
- data/app/views/themes/default/spree/shared/_error_messages.html.erb +9 -0
- data/app/views/themes/default/spree/shared/_error_messages_without_base_attribute.html.erb +15 -0
- data/app/views/themes/default/spree/shared/_flash.html.erb +16 -0
- data/app/views/themes/default/spree/shared/_flashes.html.erb +10 -0
- data/app/views/themes/default/spree/shared/_json_ld.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_line_item_options.html.erb +18 -0
- data/app/views/themes/default/spree/shared/_logo.html.erb +42 -0
- data/app/views/themes/default/spree/shared/_meta_tags.html.erb +45 -0
- data/app/views/themes/default/spree/shared/_order_details.html.erb +106 -0
- data/app/views/themes/default/spree/shared/_order_line_item.html.erb +65 -0
- data/app/views/themes/default/spree/shared/_order_shipment.html.erb +71 -0
- data/app/views/themes/default/spree/shared/_search.html.erb +32 -0
- data/app/views/themes/default/spree/shared/_title.html.erb +3 -0
- data/app/views/themes/default/spree/shared/_wishlist_icon.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_account.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_arrow-left.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_arrow-right.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_bell.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_cart.html.erb +10 -0
- data/app/views/themes/default/spree/shared/icons/_cart_48.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_check.html.erb +4 -0
- data/app/views/themes/default/spree/shared/icons/_chevron.html.erb +15 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_down.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_right.html.erb +15 -0
- data/app/views/themes/default/spree/shared/icons/_chevron_up.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_close.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_cross.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_delete.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_delivery.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_disabled.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_edit.html.erb +3 -0
- data/app/views/themes/default/spree/shared/icons/_facebook.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_filter.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_heart.html.erb +12 -0
- data/app/views/themes/default/spree/shared/icons/_info.html.erb +7 -0
- data/app/views/themes/default/spree/shared/icons/_instagram.html.erb +18 -0
- data/app/views/themes/default/spree/shared/icons/_lock.html.erb +13 -0
- data/app/views/themes/default/spree/shared/icons/_menu.html.erb +10 -0
- data/app/views/themes/default/spree/shared/icons/_minus.html.erb +5 -0
- data/app/views/themes/default/spree/shared/icons/_pinch.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_pinterest.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_plus.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_return.html.erb +11 -0
- data/app/views/themes/default/spree/shared/icons/_search.html.erb +17 -0
- data/app/views/themes/default/spree/shared/icons/_spinner.html.erb +1 -0
- data/app/views/themes/default/spree/shared/icons/_spotify.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_tiktok.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_twitter.html.erb +16 -0
- data/app/views/themes/default/spree/shared/icons/_youtube.html.erb +9 -0
- data/app/views/themes/default/spree/shared/icons/_zoom.html.erb +10 -0
- data/app/views/themes/default/spree/wishlists/_no_wished_items.html.erb +10 -0
- data/app/views/themes/default/spree/wishlists/_wished_item.html.erb +38 -0
- data/app/views/themes/default/spree/wishlists/show.html.erb +17 -0
- data/config/i18n-tasks.yml +176 -0
- data/config/importmap.rb +22 -0
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/heroicon.rb +10 -0
- data/config/locales/en.yml +76 -0
- data/config/routes.rb +88 -0
- data/lib/generators/spree/storefront/install/install_generator.rb +45 -0
- data/lib/generators/spree/storefront/install/templates/application.tailwind.css +1760 -0
- data/lib/generators/spree/storefront/install/templates/dev +16 -0
- data/lib/generators/spree/storefront/install/templates/tailwind.config.js +128 -0
- data/lib/generators/spree/storefront/theme/templates/model.rb.tt +12 -0
- data/lib/generators/spree/storefront/theme/theme_generator.rb +41 -0
- data/lib/spree/storefront/configuration.rb +11 -0
- data/lib/spree/storefront/engine.rb +51 -0
- data/lib/spree/storefront/testing_support/capybara_utils.rb +13 -0
- data/lib/spree/storefront.rb +16 -0
- data/lib/spree_storefront.rb +1 -0
- data/vendor/colornames.json +1 -0
- data/vendor/javascript/@kanety--stimulus-accordion.js +4 -0
- data/vendor/javascript/@stimulus-components--carousel.js +4 -0
- data/vendor/javascript/card-validator.js +4 -0
- data/vendor/javascript/credit-card-type.js +4 -0
- data/vendor/javascript/headroom.js.js +19 -0
- data/vendor/javascript/nouislider.js +4 -0
- data/vendor/javascript/photoswipe--dist--photoswipe-lightbox.esm.js.js +667 -0
- data/vendor/javascript/photoswipe.js +1675 -0
- data/vendor/javascript/stimulus-read-more.js +4 -0
- data/vendor/javascript/stimulus-scroll-to.js +4 -0
- data/vendor/javascript/swiper--bundle.js +4 -0
- metadata +567 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
<% image_height ||= nil %>
|
2
|
+
<% image_width ||= theme_setting('product_listing_image_width') %>
|
3
|
+
<% selected_variant ||= product.first_or_default_variant(current_currency) %>
|
4
|
+
|
5
|
+
<div class="swiper-slide w-full">
|
6
|
+
<div
|
7
|
+
class="product-card flex h-full flex-col w-full gap-2 relative"
|
8
|
+
data-controller="plp-variant-picker"
|
9
|
+
id="product-card-<%= product&.id %>">
|
10
|
+
<%= link_to spree.product_path(product), id: "product-#{product&.id}", class: "group w-full flex flex-col", data: { turbo_frame: "_top", "plp-variant-picker-target": "link" } do %>
|
11
|
+
<div
|
12
|
+
class="mb-3 relative w-full product-card-featured-image"
|
13
|
+
<% if image_height %>
|
14
|
+
style="min-height: <%= image_height %>px;"
|
15
|
+
<% end %>>
|
16
|
+
<div class="overflow-hidden relative">
|
17
|
+
<div data-plp-variant-picker-target="featuredImageContainer" class="h-full">
|
18
|
+
<%= render 'spree/products/featured_image',
|
19
|
+
object: product,
|
20
|
+
height: image_height,
|
21
|
+
width: image_width %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<%= render 'spree/products/label', product: product %>
|
25
|
+
</div>
|
26
|
+
<div class="product-card-inner">
|
27
|
+
<% if product.brand_name.present? %>
|
28
|
+
<h3 class="text-xs font-semibold uppercase inline-block product-card-brand">
|
29
|
+
<%= product.brand_name %>
|
30
|
+
</h3>
|
31
|
+
<% end %>
|
32
|
+
<h3 class="line-clamp-1 product-card-title">
|
33
|
+
<% if product %>
|
34
|
+
<%= product.name %>
|
35
|
+
<% else %>
|
36
|
+
<div class="grid grid-cols-3 gap-4">
|
37
|
+
<div class="h-5 bg-accent rounded col-span-2"></div>
|
38
|
+
</div>
|
39
|
+
<% end %>
|
40
|
+
</h3>
|
41
|
+
|
42
|
+
<% if product %>
|
43
|
+
<div data-plp-variant-picker-target="priceContainer">
|
44
|
+
<%= render 'spree/products/price',
|
45
|
+
product: product,
|
46
|
+
selected_variant: selected_variant,
|
47
|
+
use_variant: false,
|
48
|
+
price_class: "mt-2 font-light product-card-price" %>
|
49
|
+
</div>
|
50
|
+
<% else %>
|
51
|
+
<div class="mt-2 grid grid-cols-3 gap-4">
|
52
|
+
<div class="h-7 bg-accent rounded col-span-1"></div>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
57
|
+
<div class="absolute right-1 top-1 z-10" data-plp-variant-picker-target="addToWishlist">
|
58
|
+
<%= render 'spree/products/add_to_wishlist', variant: product.first_or_default_variant(current_currency) if product %>
|
59
|
+
</div>
|
60
|
+
<%= render 'spree/products/color_swatches', product: product if product && (defined?(show_variant_picker) ? show_variant_picker : true) %>
|
61
|
+
</div>
|
62
|
+
</div>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% selected_variant ||= nil %>
|
2
|
+
<p class="quantity-selector-label text-sm tracking-widest uppercase py-2"><%= Spree.t(:quantity) %></p>
|
3
|
+
<div class="inline-block">
|
4
|
+
<div class="quantity-picker" data-controller="quantity-picker">
|
5
|
+
<%= button_tag class: 'decrease-quantity',
|
6
|
+
type: 'button',
|
7
|
+
data: { action: 'click->quantity-picker#decrease',
|
8
|
+
'quantity-picker-target': 'decrease' } do %>
|
9
|
+
<%= render 'spree/shared/icons/minus' %>
|
10
|
+
<% end %>
|
11
|
+
<%= number_field_tag :quantity, 1,
|
12
|
+
min: 1,
|
13
|
+
max: selected_variant&.backorderable? ? nil : selected_variant&.total_on_hand,
|
14
|
+
class: 'quantity-input',
|
15
|
+
'aria-label': 'Quantity',
|
16
|
+
data: { 'quantity-picker-target': 'quantity' } %>
|
17
|
+
<%= button_tag class: 'increase-quantity',
|
18
|
+
type: 'button',
|
19
|
+
data: { action: 'click->quantity-picker#increase',
|
20
|
+
'quantity-picker-target': 'increase' } do %>
|
21
|
+
<%= render 'spree/shared/icons/plus' %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<%= hidden_field_tag :variant_id, selected_variant&.id %>
|
26
|
+
<% if selected_variant && !selected_variant.backorderable? %>
|
27
|
+
<% if selected_variant.total_on_hand.between?(1, 4) %>
|
28
|
+
<p class="text-red-500 text-center text-sm mt-1" style="width: 117px">
|
29
|
+
<%= Spree.t(:only_left, count: selected_variant.total_on_hand) %>
|
30
|
+
</p>
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div
|
2
|
+
data-modal-target="container"
|
3
|
+
data-action="click->modal#closeBackground keyup@window->modal#closeWithKeyboard"
|
4
|
+
class="hidden animate-fadeIn fixed inset-0 overflow-y-auto flex items-center justify-center z-[9999]"
|
5
|
+
style="animation-duration: 150ms;">
|
6
|
+
<div class="w-full lg:w-[800px] relative h-[100dvh] lg:h-auto lg:max-h-screen">
|
7
|
+
<div class="mx-0 bg-background">
|
8
|
+
<div class="px-8 py-6">
|
9
|
+
<div class="flex justify-between uppercase mb-4">
|
10
|
+
<%= Spree.t(:returns_policy) %>
|
11
|
+
<button data-action="click->modal#close">
|
12
|
+
<%= render 'spree/shared/icons/close' %>
|
13
|
+
<span class="sr-only"><%= Spree.t(:close) %></span>
|
14
|
+
</button>
|
15
|
+
</div>
|
16
|
+
<div class="text-sm overflow-auto">
|
17
|
+
<%= returns_policy %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% unless storefront_products.last_page? %>
|
2
|
+
<%= turbo_frame_tag "next_page", src: url_for(params.to_unsafe_h.merge(page: storefront_products.next_page, format: :turbo_stream)), class: "block relative w-full", data: { controller: "infinite-scroll", infinite_scroll_offset_value: "1350px" }, loading: "lazy" do %>
|
3
|
+
<span class="flex justify-center gap-2 items-center py-4 left-0 w-full h-full">
|
4
|
+
<%= render 'spree/shared/icons/spinner' %>
|
5
|
+
<%= Spree.t(:loading) %>...
|
6
|
+
</span>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<div data-controller="dropdown" data-action="click->dropdown#toggle click@window->dropdown#hide">
|
2
|
+
<div id="dropdown-button" class="relative inline-block">
|
3
|
+
<%= button_tag type: 'button', role: 'button', tabindex: '0', data: { dropdown_target: 'button', test_id: 'sort-button' }, class: 'flex gap-2 text-sm items-center py-3' do %>
|
4
|
+
<span class='hidden lg:inline opacity-50'><%= Spree.t(:sort_by) %>:</span>
|
5
|
+
|
6
|
+
<span class="font-semibold">
|
7
|
+
<% taxons_sort_options.each do |option| %>
|
8
|
+
<% if option[:value] == products_sort %>
|
9
|
+
<%= option[:name] %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
</span>
|
13
|
+
|
14
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
15
|
+
<% end %>
|
16
|
+
<div data-dropdown-target="menu"
|
17
|
+
data-transition-enter="transition ease-out"
|
18
|
+
data-transition-enter-from="opacity-0 translate-y-1"
|
19
|
+
data-transition-enter-to="opacity-100 translate-y-0"
|
20
|
+
data-transition-leave="transition ease-in"
|
21
|
+
data-transition-leave-from="opacity-100 translate-y-0"
|
22
|
+
data-transition-leave-to="opacity-0 translate-y-1"
|
23
|
+
class="hidden absolute top-7 right-0 z-[9999] mt-5 flex w-screen max-w-max">
|
24
|
+
<div class="bg-background border-default border overflow-hidden w-72">
|
25
|
+
<%= form_with url: canonical_path, method: :get, data: { controller: 'auto-submit' } do |f| %>
|
26
|
+
<%= f.hidden_field :q, value: params[:q] %>
|
27
|
+
<%= filter_form_fields %>
|
28
|
+
<% taxons_sort_options.each do |option| %>
|
29
|
+
<%= f.radio_button :sort_by, option[:value],
|
30
|
+
id: "sort-#{option[:value]}",
|
31
|
+
class: 'hidden',
|
32
|
+
data: { action: 'change->auto-submit#submit' },
|
33
|
+
checked: option[:value] == products_sort %>
|
34
|
+
<%= f.label "sort-#{option[:value]}", class: 'text-sm cursor-pointer flex items-center justify-between px-4 py-2.5 hover:bg-accent focus:outline-none focus:bg-accent transition ease-in-out' do %>
|
35
|
+
<%= option[:name] %>
|
36
|
+
<% if option[:value] == products_sort %>
|
37
|
+
<%= render 'spree/shared/icons/check' %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<% desktop_slides ||= 4 %>
|
2
|
+
<% slides_per_view ||= desktop_slides %>
|
3
|
+
<% arrows_on_top ||= false %>
|
4
|
+
<% pagination ||= 'bottom' %>
|
5
|
+
<% layout ||= 'swiper' %>
|
6
|
+
<% heading ||= nil %>
|
7
|
+
|
8
|
+
<% heading_size = case section.try(:preferred_heading_size)
|
9
|
+
when 'small'
|
10
|
+
'text-base font-medium'
|
11
|
+
when 'medium'
|
12
|
+
'text-lg lg:text-xl font-medium'
|
13
|
+
when 'large'
|
14
|
+
'text-xl lg:text-2xl font-medium'
|
15
|
+
else
|
16
|
+
heading_class || ''
|
17
|
+
end %>
|
18
|
+
|
19
|
+
<% heading_alignment = case section.try(:preferred_heading_alignment)
|
20
|
+
when 'left'
|
21
|
+
'text-left'
|
22
|
+
when 'center'
|
23
|
+
'text-center'
|
24
|
+
when 'right'
|
25
|
+
'text-right'
|
26
|
+
else
|
27
|
+
''
|
28
|
+
end %>
|
29
|
+
|
30
|
+
<% if heading.present? %>
|
31
|
+
<h3 class='<%= "#{heading_size} font-medium uppercase #{heading_alignment}" %> pb-8'>
|
32
|
+
<%= heading %>
|
33
|
+
</h3>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<div class='flex h-full relative'>
|
37
|
+
<div
|
38
|
+
class='swiper-container overflow-hidden flex-1 pr-8 lg:pr-0 -mx-4 lg:mx-0 flex flex-col <%= pagination == 'bottom' ? 'lg:flex-col lg:justify-between lg:h-full' : 'lg:flex-col-reverse' %>'
|
39
|
+
data-controller='carousel'
|
40
|
+
data-carousel-options-value='{
|
41
|
+
"slidesPerView": 2,
|
42
|
+
"centeredSlides": false,
|
43
|
+
"spaceBetween": 16,
|
44
|
+
"grabCursor": true,
|
45
|
+
"breakpoints": {
|
46
|
+
"768": {
|
47
|
+
"slidesPerView": <%= slides_per_view %>,
|
48
|
+
"spaceBetween": 24
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"navigation": {
|
52
|
+
"nextEl": ".swiper-custom-button-next-<%= section.id %>",
|
53
|
+
"prevEl": ".swiper-custom-button-prev-<%= section.id %>"
|
54
|
+
}
|
55
|
+
}'>
|
56
|
+
<div class='swiper-wrapper px-4 lg:px-0 h-auto'>
|
57
|
+
<%= render 'spree/shared/products', products: products %>
|
58
|
+
</div>
|
59
|
+
<div class='-mr-8 lg:mr-0 flex <%= arrows_on_top ? 'hidden' : '' %> <%= pagination == 'bottom' ? 'justify-end lg:mt-6' : 'justify-between lg:mb-8 items-end' %> <%= section.try(:heading_alignment) == 'right' && pagination != 'bottom' ? 'lg:flex-row-reverse' : '' %>'>
|
60
|
+
<div class="mt-8 mx-4 lg:m-0 lg:shrink-0 gap-2 w-full flex <%= arrows_on_top ? 'md:hidden' : '' %> items-center <%= section.try(:layout) == 'swiper' && section.try(:show_more_button) ? 'justify-between' : 'lg:w-auto justify-end' %>">
|
61
|
+
<% if section.try(:preferred_layout) == 'swiper' && section.try(:preferred_show_more_button) %>
|
62
|
+
<%= link_to section.try(:preferred_show_all_button_link), class: "#{section.try(:preferred_button_style) == 'primary' ? 'btn-primary' : 'btn-secondary'} w-full lg:w-72 block text-center", data: { turbo_frame: '_top' } do %>
|
63
|
+
<%= section.button_text %>
|
64
|
+
<% end %>
|
65
|
+
<% end %>
|
66
|
+
<% unless arrows_on_top %>
|
67
|
+
<div class='justify-center items-center gap-4 md:flex hidden'>
|
68
|
+
<%= button_tag class: "swiper-custom-button-prev-#{section.id} disabled:opacity-50" do %>
|
69
|
+
<%= render 'spree/shared/icons/chevron' %>
|
70
|
+
<% end %>
|
71
|
+
<%= button_tag class: "swiper-custom-button-next-#{section.id} disabled:opacity-50" do %>
|
72
|
+
<%= render 'spree/shared/icons/chevron_right' %>
|
73
|
+
<% end %>
|
74
|
+
</div>
|
75
|
+
<% end %>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
<%= button_tag class: "absolute p-2 bg-white rounded-full z-10 border border-accent left-0 disabled:hidden hover:border-primary ml-2 lg:ml-0 swiper-custom-button-prev-#{section.id} block #{arrows_on_top ? '' : 'md:hidden'} top-[--top] lg:top-[--desktop-top]", aria: { hidden: true }, style: "--top: calc(#{theme_setting('product_listing_image_height_mobile')}px/2); --desktop-top: calc(#{theme_setting('product_listing_image_height')}px/2); transform: translate(-50%, -50%);" do %>
|
79
|
+
<%= render 'spree/shared/icons/chevron' %>
|
80
|
+
<% end %>
|
81
|
+
<%= button_tag class: "absolute p-2 bg-white rounded-full z-10 border border-accent right-0 disabled:hidden hover:border-primary mr-2 lg:mr-0 swiper-custom-button-next-#{section.id} block #{arrows_on_top ? '' : 'md:hidden'} top-[--top] lg:top-[--desktop-top]", aria: { hidden: true }, style: "--top: calc(#{theme_setting('product_listing_image_height_mobile')}px/2); --desktop-top: calc(#{theme_setting('product_listing_image_height')}px/2); transform: translate(50%, -50%);" do %>
|
82
|
+
<%= render 'spree/shared/icons/chevron_right' %>
|
83
|
+
<% end %>
|
84
|
+
</div>
|
85
|
+
</div>
|
File without changes
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<% selected_option =
|
2
|
+
product_selected_option_for_option(
|
3
|
+
option_type,
|
4
|
+
product: product,
|
5
|
+
selected_variant: selected_variant,
|
6
|
+
options_param_name: options_param_name,
|
7
|
+
) %>
|
8
|
+
<% variants_available_arr =
|
9
|
+
product.variants.map do |v|
|
10
|
+
v.purchasable? && v.price_in(current_currency).amount.present?
|
11
|
+
end %>
|
12
|
+
<% variants_option1_arr = product.variants.map { |v| v.options.first&.dig(:value) } %>
|
13
|
+
<% variants_option2_arr =
|
14
|
+
product.variants.map { |v| v.options.second&.dig(:value) } %>
|
15
|
+
<% variants_option3_arr = product.variants.map { |v| v.options.third&.dig(:value) } %>
|
16
|
+
<% product_option_values_for_option(option_type, product: product).each_with_index do |value, index| %>
|
17
|
+
<% option_disabled = true %>
|
18
|
+
<% variants_option1_arr.each_with_index do |option1_name, index| %>
|
19
|
+
<% case position %>
|
20
|
+
<% when 0 %>
|
21
|
+
<% if option1_name == value.name && variants_available_arr[index] %>
|
22
|
+
<% option_disabled = false %>
|
23
|
+
<% end %>
|
24
|
+
<% when 1 %>
|
25
|
+
<% if product_selected_option_for_option(product.option_types[0], product: product, options_param_name: options_param_name)&.name == option1_name && variants_option2_arr[index] == value.name && variants_available_arr[index] %>
|
26
|
+
<% option_disabled = false %>
|
27
|
+
<% end %>
|
28
|
+
<% when 2 %>
|
29
|
+
<% if product_selected_option_for_option(product.option_types[0], product: product, options_param_name: options_param_name)&.name == option1_name && variants_option2_arr[index] == product_selected_option_for_option(product.option_types[1], product: product, options_param_name: options_param_name)&.name && variants_option3_arr[index] == value.name && variants_available_arr[index] %>
|
30
|
+
<% option_disabled = false %>
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
<% if option_type.color? %>
|
35
|
+
<li>
|
36
|
+
<label class="cursor-pointer">
|
37
|
+
<%= radio_button_tag option_type.presentation, value.name, selected_option == value,
|
38
|
+
name: option_type.presentation,
|
39
|
+
id: "product-option-#{product.id}-#{position}-#{index}",
|
40
|
+
class: "sr-only peer color-input",
|
41
|
+
data: {
|
42
|
+
action: 'change->product-form#updateVariant',
|
43
|
+
product_form_target: 'option',
|
44
|
+
option_id: option_type.id
|
45
|
+
}
|
46
|
+
%>
|
47
|
+
<%= render 'spree/products/color_picker', disabled: option_disabled %>
|
48
|
+
</label>
|
49
|
+
</li>
|
50
|
+
<% else %>
|
51
|
+
<%= radio_button_tag option_type.presentation, value.name, selected_option == value,
|
52
|
+
class: class_names('hidden', {'peer/unavailable' => selected_variant.nil?, 'peer/available' => selected_variant.present?}),
|
53
|
+
data: {
|
54
|
+
action: 'change->product-form#updateVariant',
|
55
|
+
product_form_target: 'option',
|
56
|
+
option_id: option_type.id
|
57
|
+
},
|
58
|
+
name: option_type.presentation,
|
59
|
+
id: "product-option-#{product.id}-#{position}-#{index}"
|
60
|
+
%>
|
61
|
+
<label
|
62
|
+
for='product-option-<%= product.id %>-<%= position %>-<%= index %>'
|
63
|
+
class='text-sm cursor-pointer flex items-center justify-between px-4 py-2.5 hover:bg-accent focus:outline-none focus:bg-accent transition duration-150 ease-in-out <%= option_disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent" %>'
|
64
|
+
>
|
65
|
+
<p><%=h value.presentation %></p>
|
66
|
+
<% if selected_option == value %>
|
67
|
+
<%= render 'spree/shared/icons/check', size: 18 %>
|
68
|
+
<% end %>
|
69
|
+
</label>
|
70
|
+
<% end %>
|
71
|
+
<% end %>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<% options_param_name ||= :options %>
|
2
|
+
<% if product.has_variants? %>
|
3
|
+
<div id='product-variant-picker' class="flex flex-col gap-y-4 mb-4 mt-2">
|
4
|
+
<% product.option_types.each_with_index do |option_type, index| %>
|
5
|
+
<% selected_option = product_selected_option_for_option(option_type, product: product, selected_variant: selected_variant, options_param_name: options_param_name) %>
|
6
|
+
<% if option_type.color? %>
|
7
|
+
<%= option_type_colors_preview_styles(option_type).html_safe %>
|
8
|
+
<fieldset data-option-id="<%= option_type.id %>" class="flex flex-col gap-y-2">
|
9
|
+
<span class="text-sm leading-4 uppercase tracking-widest"><%= option_type.presentation %>: <%= selected_option.presentation %></span>
|
10
|
+
<ul class="flex items-center flex-wrap gap-1">
|
11
|
+
<%= render 'spree/products/variant_options', product: product, option_type: option_type, position: index, selected_variant: selected_variant, options_param_name: options_param_name %>
|
12
|
+
</ul>
|
13
|
+
</fieldset>
|
14
|
+
<% else %>
|
15
|
+
<fieldset data-option-id="<%= option_type.id %>">
|
16
|
+
<div data-controller="dropdown" class="relative mb-2">
|
17
|
+
<div class="flex items-center justify-between">
|
18
|
+
<button
|
19
|
+
data-action="click->dropdown#toggle click@window->dropdown#hide"
|
20
|
+
type='button'
|
21
|
+
class='text-sm uppercase tracking-widest flex gap-2 items-center border border-default py-2 px-4 rounded-input dropdown-button'
|
22
|
+
data-dropdown-target="button">
|
23
|
+
<legend class="mr-2" id="option-<%= option_type.id %>-value">
|
24
|
+
<% if selected_option %>
|
25
|
+
<%= option_type.presentation %>: <span class="option-value-text"><%= selected_option.presentation %></span>
|
26
|
+
<% else %>
|
27
|
+
<%= Spree.t('storefront.variant_picker.please_choose', option_type: option_type.presentation) %>
|
28
|
+
<% end %>
|
29
|
+
</legend>
|
30
|
+
<% render 'spree/shared/icons/chevron_down' %>
|
31
|
+
</button>
|
32
|
+
</div>
|
33
|
+
<div data-dropdown-target="menu"
|
34
|
+
data-transition-enter="transition ease-out"
|
35
|
+
data-transition-enter-from="opacity-0 translate-y-1"
|
36
|
+
data-transition-enter-to="opacity-100 translate-y-0"
|
37
|
+
data-transition-leave="transition ease-in"
|
38
|
+
data-transition-leave-from="opacity-100 translate-y-0"
|
39
|
+
data-transition-leave-to="opacity-0 translate-y-1"
|
40
|
+
class="hidden absolute top-11 left-0 z-[9999] flex w-screen max-w-max shadow-xs">
|
41
|
+
<div class="bg-background border-default border overflow-hidden w-72">
|
42
|
+
<%= render 'spree/products/variant_options', product: product, option_type: option_type, position: index, selected_variant: selected_variant, options_param_name: options_param_name %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</fieldset>
|
47
|
+
<% end %>
|
48
|
+
<% end %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div
|
2
|
+
class="st-accordion"
|
3
|
+
data-controller='accordion'
|
4
|
+
data-accordion-close-others-value="false">
|
5
|
+
<% availability_filter_opened = permitted_products_params.dig(:filter, :purchasable).present? || permitted_products_params.dig(:filter, :out_of_stock).present? %>
|
6
|
+
<%= link_to "#availability_filter", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if availability_filter_opened}", data: { action: 'accordion#toggle:prevent' } do %>
|
7
|
+
<%= Spree.t(:availability) %>
|
8
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
9
|
+
<% end %>
|
10
|
+
<div class='st-accordion__content' data-accordion-id='availability_filter'>
|
11
|
+
<ul class="flex flex-col px-4 lg:px-10">
|
12
|
+
<li>
|
13
|
+
<label class="flex items-center gap-2 cursor-pointer group text-sm h-10">
|
14
|
+
<%= f.check_box "filter[purchasable]", { checked: permitted_products_params.dig(:filter, :purchasable).present?, class: "input-checkbox group-focus-within:outline", id: nil }, true, nil %>
|
15
|
+
<%= Spree.t(:in_stock) %>
|
16
|
+
<span class="opacity-50">
|
17
|
+
(<%= filter_stock_count[:in_stock] %>)
|
18
|
+
</span>
|
19
|
+
</label>
|
20
|
+
</li>
|
21
|
+
<li>
|
22
|
+
<label class="flex items-center gap-2 cursor-pointer group text-sm h-10">
|
23
|
+
<%= f.check_box "filter[out_of_stock]", { checked: permitted_products_params.dig(:filter, :out_of_stock).present?, class: "input-checkbox group-focus-within:outline", id: nil }, true, nil %>
|
24
|
+
<%= Spree.t(:out_of_stock) %>
|
25
|
+
<span class="opacity-50">
|
26
|
+
(<%= filter_stock_count[:out_of_stock] %>)
|
27
|
+
</span>
|
28
|
+
</label>
|
29
|
+
</li>
|
30
|
+
</ul>
|
31
|
+
</div>
|
32
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<% filter_values = filter_values_for_filter(filter) %>
|
2
|
+
|
3
|
+
<% if filter_values.any? %>
|
4
|
+
<div class="st-accordion" data-controller='accordion' data-accordion-close-others-value="false">
|
5
|
+
<%= link_to "#colors_filter", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if params.dig(:filter, :options, :color).present?}", data: { action: 'accordion#toggle:prevent' } do %>
|
6
|
+
<%= Spree.t(:colors) %>
|
7
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
8
|
+
<% end %>
|
9
|
+
<div class='st-accordion__content' data-accordion-id='colors_filter'>
|
10
|
+
<%= Spree::ColorsPreviewStylesPresenter.new(filter_values.map { |v| v.name }).to_s.html_safe %>
|
11
|
+
<ul class="flex items-center flex-wrap gap-2 px-4 lg:px-10">
|
12
|
+
<% filter_values.each do |value| %>
|
13
|
+
<li>
|
14
|
+
<label class="cursor-pointer">
|
15
|
+
<%= f.check_box 'filter[options][color][]', { class: 'sr-only peer color-input', id: nil, checked: params.dig(:filter, :options, :color)&.include?(value.name), value: value.name }, value.name, nil %>
|
16
|
+
<%= render 'spree/products/color_picker', color: value.presentation, with_name: true %>
|
17
|
+
</label>
|
18
|
+
</li>
|
19
|
+
<% end %>
|
20
|
+
</ul>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<% filter_values = filter_values_for_filter(filter) %>
|
2
|
+
|
3
|
+
<% if filter_values.any? %>
|
4
|
+
<div
|
5
|
+
class="st-accordion"
|
6
|
+
data-controller="accordion"
|
7
|
+
data-accordion-close-others-value="false">
|
8
|
+
<%= link_to "##{filter.id}", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if permitted_products_params.dig(:filter, :options, filter.name).present?}", data: { action: 'accordion#toggle:prevent' } do %>
|
9
|
+
<%= filter.presentation %>
|
10
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
11
|
+
<% end %>
|
12
|
+
<div
|
13
|
+
class='st-accordion__content'
|
14
|
+
data-accordion-id="<%= filter.id %>"
|
15
|
+
data-controller="searchable-list">
|
16
|
+
<div class="relative mt-3 mx-4 lg:mx-10">
|
17
|
+
<%= f.search_field :search,
|
18
|
+
class: "w-full bg-accent focus:ring-primary focus:border-primary pl-10 border-none",
|
19
|
+
placeholder: Spree.t(:search),
|
20
|
+
data: { searchable_list_target: "input" } %>
|
21
|
+
<span class="absolute left-0 top-0 flex items-center h-full pl-3">
|
22
|
+
<%= render 'spree/shared/icons/search' %>
|
23
|
+
</span>
|
24
|
+
</div>
|
25
|
+
<% main_options, rest_of_the_options = filter_values.partition.with_index { |_, i| i < 5 } %>
|
26
|
+
<ul class="flex flex-col mt-3 px-4 lg:px-10">
|
27
|
+
<% main_options.each do |option| %>
|
28
|
+
<li>
|
29
|
+
<%= f.label "filter_options_#{filter.name}_#{option.name}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: option.name } do %>
|
30
|
+
<%= f.check_box "filter[options][#{filter.name}][]",
|
31
|
+
{
|
32
|
+
id: "filter_options_#{filter.name}_#{option.name}",
|
33
|
+
checked: permitted_products_params.dig(:filter, :options, filter.name)&.include?(option.name),
|
34
|
+
class: "input-checkbox group-focus-within:outline"
|
35
|
+
},
|
36
|
+
option.name,
|
37
|
+
nil %>
|
38
|
+
<%= option.presentation %>
|
39
|
+
<span class="opacity-50">
|
40
|
+
(<%= products_count_for_filter(filter.name, option.id) %>)
|
41
|
+
</span>
|
42
|
+
<% end %>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
45
|
+
</ul>
|
46
|
+
<% if filter_values.size > 5 %>
|
47
|
+
<ul class='st-accordion__content flex flex-col gap-3 pt-3' data-accordion-id="more_<%= filter.name %>">
|
48
|
+
<% rest_of_the_options.each do |option| %>
|
49
|
+
<li class="px-4 lg:px-10">
|
50
|
+
<%= f.label "filter_options_#{filter.name}_#{option.name}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: option.name } do %>
|
51
|
+
<%= f.check_box "filter[options][#{filter.name}][]",
|
52
|
+
{
|
53
|
+
id: "filter_options_#{filter.name}_#{option.name}",
|
54
|
+
checked: permitted_products_params.dig(:filter, :options, filter.name)&.include?(option.name),
|
55
|
+
class: "input-checkbox group-focus-within:outline"
|
56
|
+
},
|
57
|
+
option.name,
|
58
|
+
nil %>
|
59
|
+
<%= option.presentation %>
|
60
|
+
<span class="opacity-50">
|
61
|
+
(<%= products_count_for_filter(filter.name, option.id) %>)
|
62
|
+
</span>
|
63
|
+
<% end %>
|
64
|
+
</li>
|
65
|
+
<% end %>
|
66
|
+
</ul>
|
67
|
+
<%= link_to Spree.t(:show_all), "#more_#{filter.name}",
|
68
|
+
class: "flex justify-between w-full st-accordion__icon text-sm font-semibold uppercase px-4 lg:px-10 #{'st-accordion__icon--opened' if permitted_products_params.dig(:filter, filter.name)&.present?} mt-3",
|
69
|
+
data: { action: 'accordion#toggle:prevent',
|
70
|
+
accordion_opened_text_param: Spree.t(:show_less),
|
71
|
+
accordion_closed_text_param: Spree.t(:show_all) } %>
|
72
|
+
<% end %>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
<% end %>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div
|
2
|
+
class="st-accordion"
|
3
|
+
data-controller='accordion'
|
4
|
+
data-accordion-close-others-value="false">
|
5
|
+
<%= link_to "#price_filter", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if params.dig(:filter, :min_price).present? || params.dig(:filter, :max_price).present?}", data: { action: 'accordion#toggle:prevent' } do %>
|
6
|
+
<%=Spree.t(:price) %>
|
7
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
8
|
+
<% end %>
|
9
|
+
<% min_price_value = [params.dig(:filter, :min_price).presence&.to_f, filter_price_range[:min].floor].compact.max %>
|
10
|
+
<% max_price_value = [params.dig(:filter, :max_price).presence&.to_f, filter_price_range[:max].ceil].compact.min %>
|
11
|
+
<div
|
12
|
+
class='st-accordion__content flex flex-col gap-2'
|
13
|
+
data-accordion-id='price_filter'
|
14
|
+
data-controller="no-ui-slider"
|
15
|
+
data-no-ui-slider-start-value="[<%= min_price_value %>, <%= max_price_value %>]"
|
16
|
+
data-no-ui-slider-range-value="[<%= filter_price_range[:min].floor %>,<%= filter_price_range[:max].ceil %>]">
|
17
|
+
<div class="flex justify-between gap-6 px-4 lg:px-10 lg:text-sm">
|
18
|
+
<div class="relative w-1/2">
|
19
|
+
<%= f.number_field filter_price_range[:min].floor, class: "pl-16 without-arrows w-full peer focus:border-primary focus:ring-primary", inputmode: "numeric", name: "filter[min_price]", data: { no_ui_slider_target: "minInput" }, id: "price_from", value: params.dig(:filter, :min_price).present? ? min_price_value.to_i : nil, placeholder: filter_price_range[:min].floor %>
|
20
|
+
<label class="absolute left-0 top-0 flex pl-3 items-center h-full text-input-text peer-placeholder-shown:opacity-50" for="price_from">
|
21
|
+
from <%= currency_symbol(current_currency) %>
|
22
|
+
</label>
|
23
|
+
</div>
|
24
|
+
<div class="relative w-1/2">
|
25
|
+
<%= f.number_field filter_price_range[:max].ceil, class: "pl-[2.75rem] without-arrows w-full peer focus:border-primary focus:ring-primary", placeholder: filter_price_range[:max].ceil, inputmode: "numeric", name: "filter[max_price]", data: { no_ui_slider_target: "maxInput" }, id: "price_to", value: params.dig(:filter, :max_price).present? ? max_price_value.to_i : nil %>
|
26
|
+
<label class="absolute left-0 top-0 flex pl-3 items-center h-full text-input-text peer-placeholder-shown:opacity-50" for="price_to">
|
27
|
+
to <%= currency_symbol(current_currency) %>
|
28
|
+
</label>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<div class="px-4 lg:px-10 mt-[11px] h-[10px]">
|
32
|
+
<div data-no-ui-slider-target="slider"></div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<% filter_taxons = filter_taxons_for_taxonomy(taxonomy) %>
|
2
|
+
|
3
|
+
<% if filter_taxons.any? %>
|
4
|
+
<div
|
5
|
+
class="st-accordion"
|
6
|
+
data-controller='accordion'
|
7
|
+
data-accordion-close-others-value="false">
|
8
|
+
<%= link_to "#taxonomy_filter_#{taxonomy.id}", class: "cursor-pointer uppercase flex items-center justify-between h-10 px-4 lg:px-10 text-sm tracking-widest focus:outline-none transition duration-150 ease-in-out #{'st-accordion__icon--opened' if params[:filter].nil? || current_taxon.present? || permitted_products_params.dig(:filter, :taxon_ids)&.present?}", data: { action: 'accordion#toggle:prevent' } do %>
|
9
|
+
<%= taxonomy.name.singularize %>
|
10
|
+
<%= render 'spree/shared/icons/chevron_down' %>
|
11
|
+
<% end %>
|
12
|
+
<div
|
13
|
+
class='st-accordion__content'
|
14
|
+
data-accordion-id="taxonomy_filter_<%= taxonomy.id %>"
|
15
|
+
data-controller="searchable-list">
|
16
|
+
<div class="relative mt-3 mx-4 lg:mx-10">
|
17
|
+
<%= f.search_field :search,
|
18
|
+
class: "w-full bg-accent focus:ring-primary focus:border-primary pl-10 border-none",
|
19
|
+
placeholder: Spree.t(:search),
|
20
|
+
data: { searchable_list_target: "input" } %>
|
21
|
+
<span class="absolute left-0 top-0 flex items-center h-full pl-3">
|
22
|
+
<%= render 'spree/shared/icons/search' %>
|
23
|
+
</span>
|
24
|
+
</div>
|
25
|
+
<% first_taxons, rest_of_the_taxons = filter_taxons.partition.with_index { |_, i| i < 5 } %>
|
26
|
+
<ul class="flex flex-col px-4 lg:px-10 mt-3">
|
27
|
+
<% first_taxons.each do |taxon| %>
|
28
|
+
<li>
|
29
|
+
<%= f.label "filter_taxon_#{taxon.id}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: taxon.name } do %>
|
30
|
+
<%= f.check_box "filter[taxon_ids][]",
|
31
|
+
{
|
32
|
+
id: "filter_taxon_#{taxon.id}",
|
33
|
+
checked: permitted_products_params.dig(:filter, :taxon_ids)&.include?(taxon.id.to_s),
|
34
|
+
class: "input-checkbox group-focus-within:outline"
|
35
|
+
},
|
36
|
+
taxon.id,
|
37
|
+
nil %>
|
38
|
+
<%= taxon.name %>
|
39
|
+
<span class="opacity-50">
|
40
|
+
(<%= products_count_for_taxon(taxon) %>)
|
41
|
+
</span>
|
42
|
+
<% end %>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
45
|
+
</ul>
|
46
|
+
|
47
|
+
<% if filter_taxons.size > 5 %>
|
48
|
+
<ul class='st-accordion__content flex flex-col' data-accordion-id="more_taxonomy_filter_<%= taxonomy.id %>">
|
49
|
+
<% rest_of_the_taxons.each do |taxon| %>
|
50
|
+
<li class="px-4 lg:px-10">
|
51
|
+
<%= f.label "filter_taxon_#{taxon.id}", class: "flex items-center gap-2 cursor-pointer group text-sm h-10", data: { searchable_list_target: "item", text: taxon.name } do %>
|
52
|
+
<%= f.check_box "filter[taxon_ids][]",
|
53
|
+
{
|
54
|
+
id: "filter_taxon_#{taxon.id}",
|
55
|
+
checked: permitted_products_params.dig(:filter, :taxon_ids)&.include?(taxon.id.to_s),
|
56
|
+
class: "input-checkbox group-focus-within:outline"
|
57
|
+
},
|
58
|
+
taxon.id,
|
59
|
+
nil %>
|
60
|
+
<%= taxon.name %>
|
61
|
+
<span class="opacity-50">
|
62
|
+
(<%= products_count_for_taxon(taxon) %>)
|
63
|
+
</span>
|
64
|
+
<% end %>
|
65
|
+
</li>
|
66
|
+
<% end %>
|
67
|
+
</ul>
|
68
|
+
<%= link_to Spree.t(:show_all), "#more_taxonomy_filter_#{taxonomy.id}",
|
69
|
+
class: "flex justify-between w-full st-accordion__icon text-sm font-semibold uppercase px-4 lg:px-10 #{'st-accordion__icon--opened' if permitted_products_params.dig(:filter, :taxon_ids)&.present?} mt-3",
|
70
|
+
data: {
|
71
|
+
action: 'accordion#toggle:prevent',
|
72
|
+
accordion_opened_text_param: Spree.t(:show_less),
|
73
|
+
accordion_closed_text_param: Spree.t(:show_all)
|
74
|
+
} %>
|
75
|
+
<% end %>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
<% end %>
|