@sonic-equipment/ui 0.0.119 → 120.0.0
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.
- package/dist/_virtual/_commonjsHelpers.js +5 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/algolia/algolia-active-categories.js +38 -0
- package/dist/algolia/algolia-active-filters.js +33 -0
- package/dist/algolia/algolia-categories-filters.js +29 -0
- package/dist/algolia/algolia-dummy-refinement-list-consumer.js +20 -0
- package/dist/algolia/algolia-filter-panel.js +42 -0
- package/dist/algolia/algolia-filter-panel.module.css.js +3 -0
- package/dist/algolia/algolia-hit-type.js +6 -0
- package/dist/algolia/algolia-hits-provider.js +17 -0
- package/dist/algolia/algolia-index-config.js +175 -0
- package/dist/algolia/algolia-insight-instant-search-provider.js +14 -0
- package/dist/algolia/algolia-insights-provider.js +18 -0
- package/dist/algolia/algolia-instant-search-state-provider.js +16 -0
- package/dist/algolia/algolia-intialization.js +26 -0
- package/dist/algolia/algolia-multi-select-filter-section.js +27 -0
- package/dist/algolia/algolia-pagination.js +18 -0
- package/dist/algolia/algolia-provider.js +34 -0
- package/dist/algolia/algolia-query-string-routing.js +106 -0
- package/dist/algolia/algolia-results-count.js +14 -0
- package/dist/algolia/algolia-search-provider.js +139 -0
- package/dist/algolia/algolia-searchclient-offline.js +25 -0
- package/dist/algolia/algolia-sonic-searchclient.js +25 -0
- package/dist/algolia/algolia-sort-by.js +29 -0
- package/dist/algolia/filter-section.js +33 -0
- package/dist/algolia/filter-section.module.css.js +3 -0
- package/dist/algolia/use-algolia-hits.js +19 -0
- package/dist/algolia/use-algolia-insights-provider-global-state.js +9 -0
- package/dist/algolia/use-algolia-insights.js +181 -0
- package/dist/algolia/use-algolia-instant-search-state.js +25 -0
- package/dist/algolia/use-algolia-search.js +41 -0
- package/dist/background-overlay/background-overlay.js +36 -0
- package/dist/background-overlay/background-overlay.module.css.js +3 -0
- package/dist/badges/badge/badge.js +22 -0
- package/dist/badges/badge/badge.module.css.js +3 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.js +8 -0
- package/dist/badges/badge/icon-with-badge/icon-with-badge.module.css.js +3 -0
- package/dist/badges/tag/tag.js +10 -0
- package/dist/badges/tag/tag.module.css.js +3 -0
- package/dist/breadcrumbs/breadcrumb.js +35 -0
- package/dist/breadcrumbs/breadcrumb.module.css.js +3 -0
- package/dist/buttons/add-to-cart-button/add-to-cart-button.js +113 -0
- package/dist/buttons/add-to-cart-button/add-to-cart-button.module.css.js +3 -0
- package/dist/buttons/add-to-cart-button/connected-add-to-cart-button.js +92 -0
- package/dist/buttons/button/button.js +21 -0
- package/dist/buttons/button/button.module.css.js +3 -0
- package/dist/buttons/favorite/connected-favorite-button.js +64 -0
- package/dist/buttons/favorite/favorite-button.js +15 -0
- package/dist/buttons/favorite/favorite-button.module.css.js +3 -0
- package/dist/buttons/icon-button/icon-button.js +15 -0
- package/dist/buttons/icon-button/icon-button.module.css.js +3 -0
- package/dist/buttons/link/link.js +10 -0
- package/dist/buttons/link/link.module.css.js +3 -0
- package/dist/buttons/print-button/print-button.js +9 -0
- package/dist/cards/category-card/category-card.js +15 -0
- package/dist/cards/category-card/category-card.module.css.js +3 -0
- package/dist/cards/orderline-card/connected-orderline-card.js +13 -0
- package/dist/cards/orderline-card/connected-remove-button.js +19 -0
- package/dist/cards/orderline-card/orderline-card.js +17 -0
- package/dist/cards/orderline-card/orderline-card.module.css.js +3 -0
- package/dist/cards/product-card/connected-product-card.js +11 -0
- package/dist/cards/product-card/product-card.js +15 -0
- package/dist/cards/product-card/product-card.module.css.js +3 -0
- package/dist/carousel/card-carousel/card-carousel.js +23 -0
- package/dist/carousel/card-carousel/card-carousel.module.css.js +3 -0
- package/dist/carousel/carousel-navigation-button.js +13 -0
- package/dist/carousel/carousel-navigation-button.module.css.js +3 -0
- package/dist/carousel/carousel.js +69 -0
- package/dist/carousel/carousel.module.css.js +3 -0
- package/dist/carousel/category-carousel/category-carousel.js +9 -0
- package/dist/carousel/category-carousel/category-carousel.module.css.js +3 -0
- package/dist/carousel/pagination/pagination.js +40 -0
- package/dist/carousel/pagination/pagination.module.css.js +3 -0
- package/dist/carousel/pagination/transitions.js +144 -0
- package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +10 -0
- package/dist/carousel/usp-carousel/product-usp-carousel.js +9 -0
- package/dist/carousel/usp-carousel/usp-carousel.js +47 -0
- package/dist/carousel/usp-carousel/usp-carousel.module.css.js +3 -0
- package/dist/cart-totals/cart-totals-summary.js +11 -0
- package/dist/cart-totals/cart-totals-summary.module.css.js +3 -0
- package/dist/cart-totals/cart-totals.js +10 -0
- package/dist/cart-totals/cart-totals.module.css.js +3 -0
- package/dist/collapsables/accordion/accordion-item.js +18 -0
- package/dist/collapsables/accordion/accordion.js +15 -0
- package/dist/collapsables/accordion/accordion.module.css.js +3 -0
- package/dist/collapsables/show-all/show-all.js +33 -0
- package/dist/collapsables/show-all/show-all.module.css.js +3 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +82 -0
- package/dist/country-selector/connected-country-selector.js +37 -0
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +42 -0
- package/dist/country-selector/country-selector-dialog/country-selector-dialog.module.css.js +3 -0
- package/dist/country-selector/country-selector-trigger/country-selector-trigger.js +16 -0
- package/dist/country-selector/country-selector-trigger/country-selector-trigger.module.css.js +3 -0
- package/dist/country-selector/use-countries-languages.js +72 -0
- package/dist/delivery-time/delivery-time.js +18 -0
- package/dist/delivery-time/delivery-time.module.css.js +3 -0
- package/dist/display/product-price/product-price.js +19 -0
- package/dist/display/product-price/product-price.module.css.js +3 -0
- package/dist/display/product-price/product-total-price.js +16 -0
- package/dist/display/product-price/product-total-price.module.css.js +3 -0
- package/dist/display/product-sku/product-sku.js +8 -0
- package/dist/display/product-sku/product-sku.module.css.js +3 -0
- package/dist/exports.d.ts +4 -4
- package/dist/filters/active-filters/active-filters.js +20 -0
- package/dist/filters/active-filters/active-filters.module.css.js +3 -0
- package/dist/filters/multi-select/multi-select.js +20 -0
- package/dist/filters/multi-select/multi-select.module.css.js +3 -0
- package/dist/filters/pagination/pagination.js +14 -0
- package/dist/filters/pagination/pagination.module.css.js +3 -0
- package/dist/forms/checkbox/checkbox.js +11 -0
- package/dist/forms/checkbox/checkbox.module.css.js +3 -0
- package/dist/forms/color-checkbox/color-checkbox.js +13 -0
- package/dist/forms/field-error/field-error.js +10 -0
- package/dist/forms/field-error/field-error.module.css.js +3 -0
- package/dist/forms/input/input.js +31 -0
- package/dist/forms/input/input.module.css.js +3 -0
- package/dist/forms/label/label.js +12 -0
- package/dist/forms/label/label.module.css.js +3 -0
- package/dist/forms/number-field/number-field.js +29 -0
- package/dist/forms/number-field/number-field.module.css.js +3 -0
- package/dist/forms/select/select.js +31 -0
- package/dist/forms/select/select.module.css.js +3 -0
- package/dist/forms/text-field/text-field.js +22 -0
- package/dist/forms/text-field/text-field.module.css.js +3 -0
- package/dist/forms/textarea/textarea.js +54 -0
- package/dist/forms/textarea/textarea.module.css.js +3 -0
- package/dist/global-search/categories-grid/categories-grid.js +14 -0
- package/dist/global-search/categories-grid/categories-grid.module.css.js +3 -0
- package/dist/global-search/global-search-provider/global-search-provider.js +15 -0
- package/dist/global-search/global-search-provider/use-search-disclosure.js +13 -0
- package/dist/global-search/global-search.js +43 -0
- package/dist/global-search/global-search.module.css.js +3 -0
- package/dist/global-search/plugins/categories-plugin.js +35 -0
- package/dist/global-search/plugins/popular-categories-plugin.js +32 -0
- package/dist/global-search/plugins/popular-searches-plugin.js +23 -0
- package/dist/global-search/plugins/query-suggestions-plugin.js +21 -0
- package/dist/global-search/plugins/quick-access-plugin.js +34 -0
- package/dist/global-search/plugins/recent-searches-plugin.js +16 -0
- package/dist/global-search/search-highlight/highlight.js +13 -0
- package/dist/global-search/search-input/connected-search-input.js +22 -0
- package/dist/global-search/search-input/search-input.js +29 -0
- package/dist/global-search/search-input/search-input.module.css.js +3 -0
- package/dist/global-search/search-result-panel/panel-content.js +13 -0
- package/dist/global-search/search-result-panel/search-result-panel.js +17 -0
- package/dist/global-search/search-result-panel/search-result-panel.module.css.js +3 -0
- package/dist/global-search/search-result-panel/sections/no-search-results.js +30 -0
- package/dist/global-search/search-result-panel/sections/no-search.js +56 -0
- package/dist/global-search/search-result-panel/sections/search-content.module.css.js +3 -0
- package/dist/global-search/search-result-panel/sections/section-container.js +8 -0
- package/dist/global-search/search-result-panel/sections/with-results.js +101 -0
- package/dist/global-search/search-section/search-list-item.js +25 -0
- package/dist/global-search/search-section/search-list-item.module.css.js +3 -0
- package/dist/global-search/search-section/search-list.js +9 -0
- package/dist/global-search/search-section/search-list.module.css.js +3 -0
- package/dist/global-search/search-section/search-section.js +9 -0
- package/dist/global-search/search-section/search-section.module.css.js +3 -0
- package/dist/header/cart-icon/connected-cart-icon.js +14 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-left-icon.js +7 -0
- package/dist/icons/glyph/glyphs-arrow-boldcaps-right-icon.js +7 -0
- package/dist/icons/glyph/glyphs-arrow-semibold-right-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-bold-down-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-down-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-left-icon.js +7 -0
- package/dist/icons/glyph/glyphs-chevrons-slim-right-icon.js +7 -0
- package/dist/icons/solid/solid-attention-icon.js +7 -0
- package/dist/icons/solid/solid-cart-icon.js +7 -0
- package/dist/icons/solid/solid-close-icon.js +7 -0
- package/dist/icons/solid/solid-event-icon.js +7 -0
- package/dist/icons/solid/solid-favorite-icon.js +7 -0
- package/dist/icons/solid/solid-home-icon.js +7 -0
- package/dist/icons/solid/solid-information-icon.js +7 -0
- package/dist/icons/solid/solid-news-icon.js +7 -0
- package/dist/icons/solid/solid-notice-icon.js +7 -0
- package/dist/icons/solid/solid-okay-icon.js +7 -0
- package/dist/icons/solid/solid-sale-icon.js +7 -0
- package/dist/icons/solid/solid-tag-icon.js +7 -0
- package/dist/icons/stroke/stroke-categories-icon.js +7 -0
- package/dist/icons/stroke/stroke-checkmark-icon.js +7 -0
- package/dist/icons/stroke/stroke-closebox-icon.js +7 -0
- package/dist/icons/stroke/stroke-collapse-icon.js +7 -0
- package/dist/icons/stroke/stroke-download-icon.js +7 -0
- package/dist/icons/stroke/stroke-expand-icon.js +7 -0
- package/dist/icons/stroke/stroke-favorite-icon.js +7 -0
- package/dist/icons/stroke/stroke-filter-icon.js +7 -0
- package/dist/icons/stroke/stroke-recent-icon.js +7 -0
- package/dist/icons/stroke/stroke-search-icon.js +7 -0
- package/dist/icons/stroke/stroke-trash-icon.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +254 -12972
- package/dist/intl/formatted-message.js +6 -0
- package/dist/intl/intl-context.js +10 -0
- package/dist/intl/intl-provider.js +15 -0
- package/dist/intl/types.js +17 -0
- package/dist/intl/use-culture-code.js +14 -0
- package/dist/intl/use-formatted-message.js +17 -0
- package/dist/intl/use-language-code.js +11 -0
- package/dist/intl/utils.js +29 -0
- package/dist/lists/download-document-list/download-document-list.js +16 -0
- package/dist/lists/download-document-list/download-document-list.module.css.js +3 -0
- package/dist/lists/feature-list/feature-list.js +22 -0
- package/dist/lists/feature-list/feature-list.module.css.js +3 -0
- package/dist/lists/orderline-list/orderline-list.js +25 -0
- package/dist/lists/orderline-list/orderline-list.module.css.js +3 -0
- package/dist/lists/product-overview-grid/product-overview-grid.js +10 -0
- package/dist/lists/product-overview-grid/product-overview-grid.module.css.js +3 -0
- package/dist/lists/ul/list.js +11 -0
- package/dist/lists/ul/list.module.css.js +3 -0
- package/dist/loading/blank-page-spacer.js +8 -0
- package/dist/loading/blank-page-spacer.module.css.js +3 -0
- package/dist/loading/loading-overlay.js +9 -0
- package/dist/loading/loading-overlay.module.css.js +3 -0
- package/dist/loading/progress-circle.js +9 -0
- package/dist/loading/progress-circle.module.css.js +3 -0
- package/dist/media/image/image.js +46 -0
- package/dist/media/image/image.module.css.js +3 -0
- package/dist/media/image-grid/images-grid.js +32 -0
- package/dist/media/image-grid/images-grid.module.css.js +3 -0
- package/dist/media/image-lightbox/image-lightbox.js +35 -0
- package/dist/media/image-lightbox/image-lightbox.module.css.js +3 -0
- package/dist/media/zoom-image/zoom-image.js +33 -0
- package/dist/media/zoom-image/zoom-image.module.css.js +3 -0
- package/dist/modals/confirmation/confirmation-dialog.js +12 -0
- package/dist/modals/confirmation/confirmation-dialog.module.css.js +3 -0
- package/dist/modals/dialog/dialog.js +30 -0
- package/dist/modals/dialog/dialog.module.css.js +3 -0
- package/dist/modals/favorite/add-to-favorite-dialog.js +60 -0
- package/dist/modals/favorite/add-to-favorite-dialog.module.css.js +3 -0
- package/dist/modals/modal/modal.js +34 -0
- package/dist/modals/modal/modal.module.css.js +3 -0
- package/dist/modals/signin/sign-in-dialog.js +22 -0
- package/dist/modals/signin/sign-in-dialog.module.css.js +3 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/routers/history.js +341 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/stateMappings/simple.js +36 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/documentation.js +8 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/logger.js +32 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/noop.js +3 -0
- package/dist/node_modules/.pnpm/instantsearch.js@4.75.4_algoliasearch@4.24.0/node_modules/instantsearch.js/es/lib/utils/safelyRunOnBrowser.js +24 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/formats.js +33 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/index.js +25 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/parse.js +269 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/stringify.js +300 -0
- package/dist/node_modules/.pnpm/qs@6.9.7/node_modules/qs/lib/utils.js +264 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/free-mode.js +237 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/navigation.js +200 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/modules/thumbs.js +193 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/create-element-if-not-defined.js +21 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/ssr-window.esm.js +145 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/swiper-core.js +3912 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/update-on-virtual-data.js +130 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/update-swiper.js +230 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/shared/utils.js +287 -0
- package/dist/node_modules/.pnpm/swiper@11.1.14/node_modules/swiper/swiper-react.js +389 -0
- package/dist/notifications/announcements/announcement-provider.js +32 -0
- package/dist/notifications/announcements/announcement-provider.module.css.js +3 -0
- package/dist/notifications/announcements/announcement.js +30 -0
- package/dist/notifications/announcements/announcement.module.css.js +3 -0
- package/dist/notifications/announcements/connected-announcement.js +27 -0
- package/dist/observers/intersection-observer.js +18 -0
- package/dist/pages/cart-page/cart-page.js +114 -0
- package/dist/pages/error-page/error-page.js +22 -0
- package/dist/pages/layouts/checkout-page-layout/checkout-page-layout.js +30 -0
- package/dist/pages/layouts/checkout-page-layout/checkout-page-layout.module.css.js +3 -0
- package/dist/pages/layouts/product-details-page-layout/product-details-page-layout.js +8 -0
- package/dist/pages/layouts/product-details-page-layout/product-details-page-layout.module.css.js +3 -0
- package/dist/pages/loading-page/loading-page.js +9 -0
- package/dist/pages/page/page.js +18 -0
- package/dist/pages/page/page.module.css.js +3 -0
- package/dist/pages/page-container/page-container.js +9 -0
- package/dist/pages/page-container/page-container.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-images/product-detail-images.js +35 -0
- package/dist/pages/product-details-page/components/product-details-images/product-detail-images.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.d.ts +3 -2
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.js +35 -0
- package/dist/pages/product-details-page/components/product-details-panel/product-details-panel.module.css.js +3 -0
- package/dist/pages/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.d.ts +4 -0
- package/dist/pages/product-details-page/components/product-details-recently-viewed/product-details-recently-viewed.js +15 -0
- package/dist/pages/product-details-page/product-details-page.js +22 -0
- package/dist/pages/product-details-page/product-details.d.ts +6 -0
- package/dist/pages/product-details-page/product-details.js +25 -0
- package/dist/pages/product-listing-page/no-results/no-results.js +14 -0
- package/dist/pages/product-listing-page/no-results/no-results.module.css.js +3 -0
- package/dist/pages/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +22 -0
- package/dist/pages/product-listing-page/product-listing-page-provider/product-listing-page-context.js +8 -0
- package/dist/pages/product-listing-page/product-listing-page-provider/product-listing-page-provider.js +13 -0
- package/dist/pages/product-listing-page/product-listing-page.js +29 -0
- package/dist/pages/product-listing-page/product-listing-page.module.css.js +3 -0
- package/dist/pages/product-listing-page/product-listing-product-overview/product-listing-product-overview.js +36 -0
- package/dist/pages/product-listing-page/product-listing.d.ts +6 -0
- package/dist/pages/product-listing-page/product-listing.js +42 -0
- package/dist/pages/search-result-page/search-result-product-overview/search-result-product-overview.js +38 -0
- package/dist/pages/search-result-page/search-results-page-category-carousel/search-results-page-category-carousel.js +22 -0
- package/dist/pages/search-result-page/search-results-page.js +49 -0
- package/dist/pages/search-result-page/search-results-page.module.css.js +3 -0
- package/dist/promos/promo-banner/promo-banner.js +11 -0
- package/dist/promos/promo-banner/promo-banner.module.css.js +3 -0
- package/dist/promos/promo-banners/promo-banners.js +16 -0
- package/dist/promos/promo-banners/promo-banners.module.css.js +3 -0
- package/dist/promos/promo-card/promo-card.js +11 -0
- package/dist/promos/promo-card/promo-card.module.css.js +3 -0
- package/dist/shared/api/bff/hooks/use-fetch-announcements.js +15 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-details-page-data.js +14 -0
- package/dist/shared/api/bff/hooks/use-fetch-product-listing-page-data.js +14 -0
- package/dist/shared/api/bff/model/bff.model.d.ts +1 -1
- package/dist/shared/api/bff/model/bff.model.js +1 -0
- package/dist/shared/api/bff/services/bff-service.js +76 -0
- package/dist/shared/api/storefront/hooks/authentication/use-fetch-session.js +18 -0
- package/dist/shared/api/storefront/hooks/authentication/use-invalidate-session.js +9 -0
- package/dist/shared/api/storefront/hooks/authentication/use-is-authenticated.js +8 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-in.js +21 -0
- package/dist/shared/api/storefront/hooks/authentication/use-sign-out.js +25 -0
- package/dist/shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js +31 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js +23 -0
- package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.js +18 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-checkout-atp.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-count.js +8 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js +11 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js +11 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-product-atp.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-promotions.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js +26 -0
- package/dist/shared/api/storefront/hooks/cart/use-fetch-current-cart.js +17 -0
- package/dist/shared/api/storefront/hooks/cart/use-invalidate-current-cart.js +9 -0
- package/dist/shared/api/storefront/hooks/cart/use-patch-cart.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-place-order.js +15 -0
- package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.js +17 -0
- package/dist/shared/api/storefront/hooks/cart/use-update-cart-line-by-id.js +30 -0
- package/dist/shared/api/storefront/hooks/translation/use-fetch-translations.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-languages.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +15 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-countries.js +14 -0
- package/dist/shared/api/storefront/hooks/website/use-fetch-settings.js +18 -0
- package/dist/shared/api/storefront/hooks/website/use-update-locale.js +11 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js +34 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-wishlist.js +33 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-create-wishlist.js +17 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js +21 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-all-wishlists-items.js +36 -0
- package/dist/shared/api/storefront/hooks/wishlist/use-fetch-wishlists.js +14 -0
- package/dist/shared/api/storefront/model/shop.model.js +42 -0
- package/dist/shared/api/storefront/services/authentication-service.js +80 -0
- package/dist/shared/api/storefront/services/cart-service.js +128 -0
- package/dist/shared/api/storefront/services/translation-service.js +16 -0
- package/dist/shared/api/storefront/services/website-service.js +83 -0
- package/dist/shared/api/storefront/services/wishlist-service.js +72 -0
- package/dist/shared/feature-flags/use-feature-flags.js +45 -0
- package/dist/shared/fetch/request.d.ts +5 -0
- package/dist/shared/fetch/request.js +263 -0
- package/dist/shared/hooks/use-breakpoint.js +24 -0
- package/dist/shared/hooks/use-cookie.js +27 -0
- package/dist/shared/hooks/use-debounced-callback.js +18 -0
- package/dist/shared/hooks/use-disclosure.js +24 -0
- package/dist/shared/hooks/use-enable-mobile-zoom.js +36 -0
- package/dist/shared/hooks/use-intersection-observer.js +66 -0
- package/dist/shared/hooks/use-is-breakpoint.js +19 -0
- package/dist/shared/hooks/use-local-storage.js +19 -0
- package/dist/shared/hooks/use-resize-observer.d.ts +2 -2
- package/dist/shared/hooks/use-resize-observer.js +30 -0
- package/dist/shared/hooks/use-scroll-lock.js +11 -0
- package/dist/shared/hooks/use-scroll-to.js +19 -0
- package/dist/shared/hooks/use-session-storage.js +19 -0
- package/dist/shared/hooks/use-watch-css-property.d.ts +1 -0
- package/dist/shared/hooks/use-watch-css-property.js +29 -0
- package/dist/shared/model/announcement.js +18 -0
- package/dist/shared/model/category.js +25 -0
- package/dist/shared/model/currency.js +29 -0
- package/dist/shared/model/hit.js +45 -0
- package/dist/shared/model/image.js +5 -0
- package/dist/shared/providers/cart-provider.js +13 -0
- package/dist/shared/providers/favorite-provider.js +33 -0
- package/dist/shared/providers/global-state-provider.js +83 -0
- package/dist/shared/providers/react-query-container.js +20 -0
- package/dist/shared/routing/route-button.js +7 -0
- package/dist/shared/routing/route-icon-button.js +7 -0
- package/dist/shared/routing/route-link.js +7 -0
- package/dist/shared/routing/route-provider.d.ts +3 -1
- package/dist/shared/routing/route-provider.js +48 -0
- package/dist/shared/routing/with-routing.js +36 -0
- package/dist/shared/utils/array.js +5 -0
- package/dist/shared/utils/breakpoints.js +33 -0
- package/dist/shared/utils/date.js +58 -0
- package/dist/shared/utils/environment.d.ts +2 -2
- package/dist/shared/utils/environment.js +61 -0
- package/dist/shared/utils/event-emitter.js +34 -0
- package/dist/shared/utils/local-storage.js +108 -0
- package/dist/shared/utils/merge.js +70 -0
- package/dist/shared/utils/price.js +6 -0
- package/dist/shared/utils/time.js +9 -0
- package/dist/shared/utils/uuid.js +15 -0
- package/dist/shared/utils/wait.js +5 -0
- package/dist/sidebar/sidebar-provider.js +46 -0
- package/dist/sidebar/sidebar-provider.module.css.js +3 -0
- package/dist/sidebar/sidebar.js +23 -0
- package/dist/sidebar/sidebar.module.css.js +3 -0
- package/dist/sidebar/toggle-sidebar-button.js +13 -0
- package/dist/sidebar/use-sidebar.js +38 -0
- package/dist/styles.css +5 -16
- package/dist/toast/toast-provider.js +9 -0
- package/dist/toast/toast-provider.module.css.js +3 -0
- package/dist/toast/toast.js +24 -0
- package/dist/toast/toast.module.css.js +3 -0
- package/dist/toast/use-toast.js +21 -0
- package/dist/tokens/tokens.js +8 -0
- package/dist/typography/heading/heading.js +27 -0
- package/dist/typography/heading/heading.module.css.js +3 -0
- package/package.json +3 -2
- package/dist/pages/product-listing-page/product-listing-page-provider/use-subcategories.d.ts +0 -4
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import React, { forwardRef, useState, useRef, useEffect, useLayoutEffect, createContext } from 'react';
|
|
2
|
+
import { S as Swiper$1 } from './shared/swiper-core.js';
|
|
3
|
+
import { g as getParams, m as mountSwiper, a as getChangedParams, u as updateOnVirtualData } from './shared/update-on-virtual-data.js';
|
|
4
|
+
import { d as uniqueClasses, w as wrapperClass, n as needsNavigation, b as needsScrollbar, a as needsPagination, e as extend, u as updateSwiper } from './shared/update-swiper.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Swiper React 11.1.14
|
|
8
|
+
* Most modern mobile touch slider and framework with hardware accelerated transitions
|
|
9
|
+
* https://swiperjs.com
|
|
10
|
+
*
|
|
11
|
+
* Copyright 2014-2024 Vladimir Kharlampidi
|
|
12
|
+
*
|
|
13
|
+
* Released under the MIT License
|
|
14
|
+
*
|
|
15
|
+
* Released on: September 12, 2024
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
function _extends() {
|
|
20
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
21
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
22
|
+
var source = arguments[i];
|
|
23
|
+
for (var key in source) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
+
target[key] = source[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends.apply(this, arguments);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function isChildSwiperSlide(child) {
|
|
35
|
+
return child.type && child.type.displayName && child.type.displayName.includes('SwiperSlide');
|
|
36
|
+
}
|
|
37
|
+
function processChildren(c) {
|
|
38
|
+
const slides = [];
|
|
39
|
+
React.Children.toArray(c).forEach(child => {
|
|
40
|
+
if (isChildSwiperSlide(child)) {
|
|
41
|
+
slides.push(child);
|
|
42
|
+
} else if (child.props && child.props.children) {
|
|
43
|
+
processChildren(child.props.children).forEach(slide => slides.push(slide));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return slides;
|
|
47
|
+
}
|
|
48
|
+
function getChildren(c) {
|
|
49
|
+
const slides = [];
|
|
50
|
+
const slots = {
|
|
51
|
+
'container-start': [],
|
|
52
|
+
'container-end': [],
|
|
53
|
+
'wrapper-start': [],
|
|
54
|
+
'wrapper-end': []
|
|
55
|
+
};
|
|
56
|
+
React.Children.toArray(c).forEach(child => {
|
|
57
|
+
if (isChildSwiperSlide(child)) {
|
|
58
|
+
slides.push(child);
|
|
59
|
+
} else if (child.props && child.props.slot && slots[child.props.slot]) {
|
|
60
|
+
slots[child.props.slot].push(child);
|
|
61
|
+
} else if (child.props && child.props.children) {
|
|
62
|
+
const foundSlides = processChildren(child.props.children);
|
|
63
|
+
if (foundSlides.length > 0) {
|
|
64
|
+
foundSlides.forEach(slide => slides.push(slide));
|
|
65
|
+
} else {
|
|
66
|
+
slots['container-end'].push(child);
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
slots['container-end'].push(child);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
slides,
|
|
74
|
+
slots
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function renderVirtual(swiper, slides, virtualData) {
|
|
79
|
+
if (!virtualData) return null;
|
|
80
|
+
const getSlideIndex = index => {
|
|
81
|
+
let slideIndex = index;
|
|
82
|
+
if (index < 0) {
|
|
83
|
+
slideIndex = slides.length + index;
|
|
84
|
+
} else if (slideIndex >= slides.length) {
|
|
85
|
+
// eslint-disable-next-line
|
|
86
|
+
slideIndex = slideIndex - slides.length;
|
|
87
|
+
}
|
|
88
|
+
return slideIndex;
|
|
89
|
+
};
|
|
90
|
+
const style = swiper.isHorizontal() ? {
|
|
91
|
+
[swiper.rtlTranslate ? 'right' : 'left']: `${virtualData.offset}px`
|
|
92
|
+
} : {
|
|
93
|
+
top: `${virtualData.offset}px`
|
|
94
|
+
};
|
|
95
|
+
const {
|
|
96
|
+
from,
|
|
97
|
+
to
|
|
98
|
+
} = virtualData;
|
|
99
|
+
const loopFrom = swiper.params.loop ? -slides.length : 0;
|
|
100
|
+
const loopTo = swiper.params.loop ? slides.length * 2 : slides.length;
|
|
101
|
+
const slidesToRender = [];
|
|
102
|
+
for (let i = loopFrom; i < loopTo; i += 1) {
|
|
103
|
+
if (i >= from && i <= to) {
|
|
104
|
+
slidesToRender.push(slides[getSlideIndex(i)]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return slidesToRender.map((child, index) => {
|
|
108
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
109
|
+
swiper,
|
|
110
|
+
style,
|
|
111
|
+
key: child.props.virtualIndex || child.key || `slide-${index}`
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function useIsomorphicLayoutEffect(callback, deps) {
|
|
117
|
+
// eslint-disable-next-line
|
|
118
|
+
if (typeof window === 'undefined') return useEffect(callback, deps);
|
|
119
|
+
return useLayoutEffect(callback, deps);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const SwiperSlideContext = /*#__PURE__*/createContext(null);
|
|
123
|
+
const SwiperContext = /*#__PURE__*/createContext(null);
|
|
124
|
+
|
|
125
|
+
const Swiper = /*#__PURE__*/forwardRef(function (_temp, externalElRef) {
|
|
126
|
+
let {
|
|
127
|
+
className,
|
|
128
|
+
tag: Tag = 'div',
|
|
129
|
+
wrapperTag: WrapperTag = 'div',
|
|
130
|
+
children,
|
|
131
|
+
onSwiper,
|
|
132
|
+
...rest
|
|
133
|
+
} = _temp === void 0 ? {} : _temp;
|
|
134
|
+
let eventsAssigned = false;
|
|
135
|
+
const [containerClasses, setContainerClasses] = useState('swiper');
|
|
136
|
+
const [virtualData, setVirtualData] = useState(null);
|
|
137
|
+
const [breakpointChanged, setBreakpointChanged] = useState(false);
|
|
138
|
+
const initializedRef = useRef(false);
|
|
139
|
+
const swiperElRef = useRef(null);
|
|
140
|
+
const swiperRef = useRef(null);
|
|
141
|
+
const oldPassedParamsRef = useRef(null);
|
|
142
|
+
const oldSlides = useRef(null);
|
|
143
|
+
const nextElRef = useRef(null);
|
|
144
|
+
const prevElRef = useRef(null);
|
|
145
|
+
const paginationElRef = useRef(null);
|
|
146
|
+
const scrollbarElRef = useRef(null);
|
|
147
|
+
const {
|
|
148
|
+
params: swiperParams,
|
|
149
|
+
passedParams,
|
|
150
|
+
rest: restProps,
|
|
151
|
+
events
|
|
152
|
+
} = getParams(rest);
|
|
153
|
+
const {
|
|
154
|
+
slides,
|
|
155
|
+
slots
|
|
156
|
+
} = getChildren(children);
|
|
157
|
+
const onBeforeBreakpoint = () => {
|
|
158
|
+
setBreakpointChanged(!breakpointChanged);
|
|
159
|
+
};
|
|
160
|
+
Object.assign(swiperParams.on, {
|
|
161
|
+
_containerClasses(swiper, classes) {
|
|
162
|
+
setContainerClasses(classes);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const initSwiper = () => {
|
|
166
|
+
// init swiper
|
|
167
|
+
Object.assign(swiperParams.on, events);
|
|
168
|
+
eventsAssigned = true;
|
|
169
|
+
const passParams = {
|
|
170
|
+
...swiperParams
|
|
171
|
+
};
|
|
172
|
+
delete passParams.wrapperClass;
|
|
173
|
+
swiperRef.current = new Swiper$1(passParams);
|
|
174
|
+
if (swiperRef.current.virtual && swiperRef.current.params.virtual.enabled) {
|
|
175
|
+
swiperRef.current.virtual.slides = slides;
|
|
176
|
+
const extendWith = {
|
|
177
|
+
cache: false,
|
|
178
|
+
slides,
|
|
179
|
+
renderExternal: setVirtualData,
|
|
180
|
+
renderExternalUpdate: false
|
|
181
|
+
};
|
|
182
|
+
extend(swiperRef.current.params.virtual, extendWith);
|
|
183
|
+
extend(swiperRef.current.originalParams.virtual, extendWith);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
if (!swiperElRef.current) {
|
|
187
|
+
initSwiper();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Listen for breakpoints change
|
|
191
|
+
if (swiperRef.current) {
|
|
192
|
+
swiperRef.current.on('_beforeBreakpoint', onBeforeBreakpoint);
|
|
193
|
+
}
|
|
194
|
+
const attachEvents = () => {
|
|
195
|
+
if (eventsAssigned || !events || !swiperRef.current) return;
|
|
196
|
+
Object.keys(events).forEach(eventName => {
|
|
197
|
+
swiperRef.current.on(eventName, events[eventName]);
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
const detachEvents = () => {
|
|
201
|
+
if (!events || !swiperRef.current) return;
|
|
202
|
+
Object.keys(events).forEach(eventName => {
|
|
203
|
+
swiperRef.current.off(eventName, events[eventName]);
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
return () => {
|
|
208
|
+
if (swiperRef.current) swiperRef.current.off('_beforeBreakpoint', onBeforeBreakpoint);
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// set initialized flag
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
if (!initializedRef.current && swiperRef.current) {
|
|
215
|
+
swiperRef.current.emitSlidesClasses();
|
|
216
|
+
initializedRef.current = true;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// mount swiper
|
|
221
|
+
useIsomorphicLayoutEffect(() => {
|
|
222
|
+
if (externalElRef) {
|
|
223
|
+
externalElRef.current = swiperElRef.current;
|
|
224
|
+
}
|
|
225
|
+
if (!swiperElRef.current) return;
|
|
226
|
+
if (swiperRef.current.destroyed) {
|
|
227
|
+
initSwiper();
|
|
228
|
+
}
|
|
229
|
+
mountSwiper({
|
|
230
|
+
el: swiperElRef.current,
|
|
231
|
+
nextEl: nextElRef.current,
|
|
232
|
+
prevEl: prevElRef.current,
|
|
233
|
+
paginationEl: paginationElRef.current,
|
|
234
|
+
scrollbarEl: scrollbarElRef.current,
|
|
235
|
+
swiper: swiperRef.current
|
|
236
|
+
}, swiperParams);
|
|
237
|
+
if (onSwiper && !swiperRef.current.destroyed) onSwiper(swiperRef.current);
|
|
238
|
+
// eslint-disable-next-line
|
|
239
|
+
return () => {
|
|
240
|
+
if (swiperRef.current && !swiperRef.current.destroyed) {
|
|
241
|
+
swiperRef.current.destroy(true, false);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}, []);
|
|
245
|
+
|
|
246
|
+
// watch for params change
|
|
247
|
+
useIsomorphicLayoutEffect(() => {
|
|
248
|
+
attachEvents();
|
|
249
|
+
const changedParams = getChangedParams(passedParams, oldPassedParamsRef.current, slides, oldSlides.current, c => c.key);
|
|
250
|
+
oldPassedParamsRef.current = passedParams;
|
|
251
|
+
oldSlides.current = slides;
|
|
252
|
+
if (changedParams.length && swiperRef.current && !swiperRef.current.destroyed) {
|
|
253
|
+
updateSwiper({
|
|
254
|
+
swiper: swiperRef.current,
|
|
255
|
+
slides,
|
|
256
|
+
passedParams,
|
|
257
|
+
changedParams,
|
|
258
|
+
nextEl: nextElRef.current,
|
|
259
|
+
prevEl: prevElRef.current,
|
|
260
|
+
scrollbarEl: scrollbarElRef.current,
|
|
261
|
+
paginationEl: paginationElRef.current
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
return () => {
|
|
265
|
+
detachEvents();
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// update on virtual update
|
|
270
|
+
useIsomorphicLayoutEffect(() => {
|
|
271
|
+
updateOnVirtualData(swiperRef.current);
|
|
272
|
+
}, [virtualData]);
|
|
273
|
+
|
|
274
|
+
// bypass swiper instance to slides
|
|
275
|
+
function renderSlides() {
|
|
276
|
+
if (swiperParams.virtual) {
|
|
277
|
+
return renderVirtual(swiperRef.current, slides, virtualData);
|
|
278
|
+
}
|
|
279
|
+
return slides.map((child, index) => {
|
|
280
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
281
|
+
swiper: swiperRef.current,
|
|
282
|
+
swiperSlideIndex: index
|
|
283
|
+
});
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
287
|
+
ref: swiperElRef,
|
|
288
|
+
className: uniqueClasses(`${containerClasses}${className ? ` ${className}` : ''}`)
|
|
289
|
+
}, restProps), /*#__PURE__*/React.createElement(SwiperContext.Provider, {
|
|
290
|
+
value: swiperRef.current
|
|
291
|
+
}, slots['container-start'], /*#__PURE__*/React.createElement(WrapperTag, {
|
|
292
|
+
className: wrapperClass(swiperParams.wrapperClass)
|
|
293
|
+
}, slots['wrapper-start'], renderSlides(), slots['wrapper-end']), needsNavigation(swiperParams) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
294
|
+
ref: prevElRef,
|
|
295
|
+
className: "swiper-button-prev"
|
|
296
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
297
|
+
ref: nextElRef,
|
|
298
|
+
className: "swiper-button-next"
|
|
299
|
+
})), needsScrollbar(swiperParams) && /*#__PURE__*/React.createElement("div", {
|
|
300
|
+
ref: scrollbarElRef,
|
|
301
|
+
className: "swiper-scrollbar"
|
|
302
|
+
}), needsPagination(swiperParams) && /*#__PURE__*/React.createElement("div", {
|
|
303
|
+
ref: paginationElRef,
|
|
304
|
+
className: "swiper-pagination"
|
|
305
|
+
}), slots['container-end']));
|
|
306
|
+
});
|
|
307
|
+
Swiper.displayName = 'Swiper';
|
|
308
|
+
|
|
309
|
+
const SwiperSlide = /*#__PURE__*/forwardRef(function (_temp, externalRef) {
|
|
310
|
+
let {
|
|
311
|
+
tag: Tag = 'div',
|
|
312
|
+
children,
|
|
313
|
+
className = '',
|
|
314
|
+
swiper,
|
|
315
|
+
zoom,
|
|
316
|
+
lazy,
|
|
317
|
+
virtualIndex,
|
|
318
|
+
swiperSlideIndex,
|
|
319
|
+
...rest
|
|
320
|
+
} = _temp === void 0 ? {} : _temp;
|
|
321
|
+
const slideElRef = useRef(null);
|
|
322
|
+
const [slideClasses, setSlideClasses] = useState('swiper-slide');
|
|
323
|
+
const [lazyLoaded, setLazyLoaded] = useState(false);
|
|
324
|
+
function updateClasses(_s, el, classNames) {
|
|
325
|
+
if (el === slideElRef.current) {
|
|
326
|
+
setSlideClasses(classNames);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
useIsomorphicLayoutEffect(() => {
|
|
330
|
+
if (typeof swiperSlideIndex !== 'undefined') {
|
|
331
|
+
slideElRef.current.swiperSlideIndex = swiperSlideIndex;
|
|
332
|
+
}
|
|
333
|
+
if (externalRef) {
|
|
334
|
+
externalRef.current = slideElRef.current;
|
|
335
|
+
}
|
|
336
|
+
if (!slideElRef.current || !swiper) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (swiper.destroyed) {
|
|
340
|
+
if (slideClasses !== 'swiper-slide') {
|
|
341
|
+
setSlideClasses('swiper-slide');
|
|
342
|
+
}
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
swiper.on('_slideClass', updateClasses);
|
|
346
|
+
// eslint-disable-next-line
|
|
347
|
+
return () => {
|
|
348
|
+
if (!swiper) return;
|
|
349
|
+
swiper.off('_slideClass', updateClasses);
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
useIsomorphicLayoutEffect(() => {
|
|
353
|
+
if (swiper && slideElRef.current && !swiper.destroyed) {
|
|
354
|
+
setSlideClasses(swiper.getSlideClasses(slideElRef.current));
|
|
355
|
+
}
|
|
356
|
+
}, [swiper]);
|
|
357
|
+
const slideData = {
|
|
358
|
+
isActive: slideClasses.indexOf('swiper-slide-active') >= 0,
|
|
359
|
+
isVisible: slideClasses.indexOf('swiper-slide-visible') >= 0,
|
|
360
|
+
isPrev: slideClasses.indexOf('swiper-slide-prev') >= 0,
|
|
361
|
+
isNext: slideClasses.indexOf('swiper-slide-next') >= 0
|
|
362
|
+
};
|
|
363
|
+
const renderChildren = () => {
|
|
364
|
+
return typeof children === 'function' ? children(slideData) : children;
|
|
365
|
+
};
|
|
366
|
+
const onLoad = () => {
|
|
367
|
+
setLazyLoaded(true);
|
|
368
|
+
};
|
|
369
|
+
return /*#__PURE__*/React.createElement(Tag, _extends({
|
|
370
|
+
ref: slideElRef,
|
|
371
|
+
className: uniqueClasses(`${slideClasses}${className ? ` ${className}` : ''}`),
|
|
372
|
+
"data-swiper-slide-index": virtualIndex,
|
|
373
|
+
onLoad: onLoad
|
|
374
|
+
}, rest), zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {
|
|
375
|
+
value: slideData
|
|
376
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
377
|
+
className: "swiper-zoom-container",
|
|
378
|
+
"data-swiper-zoom": typeof zoom === 'number' ? zoom : undefined
|
|
379
|
+
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
380
|
+
className: "swiper-lazy-preloader"
|
|
381
|
+
}))), !zoom && /*#__PURE__*/React.createElement(SwiperSlideContext.Provider, {
|
|
382
|
+
value: slideData
|
|
383
|
+
}, renderChildren(), lazy && !lazyLoaded && /*#__PURE__*/React.createElement("div", {
|
|
384
|
+
className: "swiper-lazy-preloader"
|
|
385
|
+
})));
|
|
386
|
+
});
|
|
387
|
+
SwiperSlide.displayName = 'SwiperSlide';
|
|
388
|
+
|
|
389
|
+
export { Swiper, SwiperSlide };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useRef, useEffect } from 'react';
|
|
4
|
+
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
5
|
+
import { useCultureCode } from '../../intl/use-culture-code.js';
|
|
6
|
+
import { useFetchAnnouncements } from '../../shared/api/bff/hooks/use-fetch-announcements.js';
|
|
7
|
+
import { useLocalStorage } from '../../shared/hooks/use-local-storage.js';
|
|
8
|
+
import { ConnectedAnnouncement } from './connected-announcement.js';
|
|
9
|
+
import styles from './announcement-provider.module.css.js';
|
|
10
|
+
|
|
11
|
+
function AnnouncementProvider() {
|
|
12
|
+
const cultureCode = useCultureCode();
|
|
13
|
+
const nodeRef = useRef(null);
|
|
14
|
+
const { data: announcements, error } = useFetchAnnouncements({
|
|
15
|
+
cultureCode,
|
|
16
|
+
});
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!error)
|
|
19
|
+
return;
|
|
20
|
+
console.error(error);
|
|
21
|
+
}, [error]);
|
|
22
|
+
const [dismissedIds, setDismissedIds] = useLocalStorage('dismissedAnnouncementIds', []);
|
|
23
|
+
const filteredAnnouncements = announcements?.filter(({ id }) => !dismissedIds.includes(id));
|
|
24
|
+
return (jsx(TransitionGroup, { className: styles['announcement-provider'], children: filteredAnnouncements?.map(announcement => (jsx(CSSTransition, { classNames: {
|
|
25
|
+
enter: styles['announcement-enter'],
|
|
26
|
+
enterActive: styles['announcement-enter-active'],
|
|
27
|
+
exit: styles['announcement-exit'],
|
|
28
|
+
exitActive: styles['announcement-exit-active'],
|
|
29
|
+
}, nodeRef: nodeRef, timeout: 300, children: jsx(ConnectedAnnouncement, { announcement: announcement, onDismiss: id => setDismissedIds(dismissedIds => [...dismissedIds, id]) }) }, announcement.id))) }));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { AnnouncementProvider };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"announcement-provider":"announcement-provider-module-sVIKY","announcement-enter":"announcement-provider-module-ksjgO","announcement-enter-active":"announcement-provider-module-k0zd-","announcement-exit":"announcement-provider-module-w2N0B","announcement-exit-active":"announcement-provider-module-4lfx2"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { IconButton } from '../../buttons/icon-button/icon-button.js';
|
|
5
|
+
import { GlyphsArrowSemiBoldRightIcon } from '../../icons/glyph/glyphs-arrow-semibold-right-icon.js';
|
|
6
|
+
import { SolidAttentionIcon } from '../../icons/solid/solid-attention-icon.js';
|
|
7
|
+
import { SolidEventIcon } from '../../icons/solid/solid-event-icon.js';
|
|
8
|
+
import { SolidInformationIcon } from '../../icons/solid/solid-information-icon.js';
|
|
9
|
+
import { SolidNewsIcon } from '../../icons/solid/solid-news-icon.js';
|
|
10
|
+
import { SolidNoticeIcon } from '../../icons/solid/solid-notice-icon.js';
|
|
11
|
+
import { SolidSaleIcon } from '../../icons/solid/solid-sale-icon.js';
|
|
12
|
+
import { SolidTagIcon } from '../../icons/solid/solid-tag-icon.js';
|
|
13
|
+
import { StrokeCloseboxIcon } from '../../icons/stroke/stroke-closebox-icon.js';
|
|
14
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
15
|
+
import styles from './announcement.module.css.js';
|
|
16
|
+
|
|
17
|
+
const iconMap = {
|
|
18
|
+
critical: jsx(SolidAttentionIcon, {}),
|
|
19
|
+
event: jsx(SolidEventIcon, {}),
|
|
20
|
+
informative: jsx(SolidInformationIcon, {}),
|
|
21
|
+
new_product_introduction: jsx(SolidTagIcon, {}),
|
|
22
|
+
news: jsx(SolidNewsIcon, {}),
|
|
23
|
+
notice: jsx(SolidNoticeIcon, {}),
|
|
24
|
+
sales: jsx(SolidSaleIcon, {}),
|
|
25
|
+
};
|
|
26
|
+
function Announcement({ announcement: { href, id, subType, text, title, type }, onDismiss, }) {
|
|
27
|
+
return (jsxs(RouteLink, { className: clsx(styles.announcement, styles[type], styles[subType]), href: href, children: [jsxs("div", { className: styles.wrapper, children: [jsx("div", { className: styles.icon, children: iconMap[subType] }), jsxs("div", { className: styles.content, children: [jsx("h2", { className: styles.title, children: title }), jsxs("p", { className: styles.text, children: [text, jsx(GlyphsArrowSemiBoldRightIcon, {})] })] })] }), jsx("div", { className: styles.close, children: jsx(IconButton, { color: "current-color", onClick: () => onDismiss?.(id), children: jsx(StrokeCloseboxIcon, {}) }) })] }));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Announcement };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"announcement":"announcement-module-Xi0L5","wrapper":"announcement-module-4XVjD","icon":"announcement-module-lxmA2","content":"announcement-module-1Jn7y","title":"announcement-module-8k2rK","text":"announcement-module-yXGsN","close":"announcement-module-gZ9ae","informative":"announcement-module-0LTWL","notice":"announcement-module-Ga3lN","critical":"announcement-module-S3nSW","promo":"announcement-module-E6DqW"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { TIME } from '../../shared/utils/time.js';
|
|
5
|
+
import { Announcement } from './announcement.js';
|
|
6
|
+
|
|
7
|
+
const now = () => new Date();
|
|
8
|
+
function ConnectedAnnouncement({ announcement: { endDate, startDate, ...announcement }, onDismiss, }) {
|
|
9
|
+
const [isVisible, setIsVisible] = useState((!startDate || startDate <= now()) && (!endDate || endDate > now()));
|
|
10
|
+
const getIsVisible = useCallback(() => isVisible, [isVisible]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (endDate && now() >= endDate)
|
|
13
|
+
return;
|
|
14
|
+
const intervalId = setInterval(() => {
|
|
15
|
+
const isStillVisible = (!startDate || startDate <= now()) && (!endDate || endDate > now());
|
|
16
|
+
if (getIsVisible() && !isStillVisible)
|
|
17
|
+
clearInterval(intervalId);
|
|
18
|
+
setIsVisible(isStillVisible);
|
|
19
|
+
}, 1 * TIME.MINUTE);
|
|
20
|
+
return () => clearInterval(intervalId);
|
|
21
|
+
}, [endDate, getIsVisible, startDate]);
|
|
22
|
+
if (!isVisible)
|
|
23
|
+
return null;
|
|
24
|
+
return jsx(Announcement, { announcement: announcement, onDismiss: onDismiss });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { ConnectedAnnouncement, now };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { useIntersectionObserver } from '../shared/hooks/use-intersection-observer.js';
|
|
4
|
+
|
|
5
|
+
function IntersectionObserverComponent({ children, isDisabled, onIntersectingChange, }) {
|
|
6
|
+
const topRef = useRef(null);
|
|
7
|
+
const bottomRef = useRef(null);
|
|
8
|
+
useIntersectionObserver({
|
|
9
|
+
isDisabled,
|
|
10
|
+
observables: [{ ref: topRef }, { ref: bottomRef }],
|
|
11
|
+
onIntersectingChange,
|
|
12
|
+
});
|
|
13
|
+
if (isDisabled)
|
|
14
|
+
return children;
|
|
15
|
+
return (jsxs("div", { children: [jsx("div", { ref: topRef }), children, jsx("div", { ref: bottomRef })] }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { IntersectionObserverComponent };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ConnectedOrderLineCard } from '../../cards/orderline-card/connected-orderline-card.js';
|
|
3
|
+
import { CartTotals } from '../../cart-totals/cart-totals.js';
|
|
4
|
+
import { CartTotalsSummary } from '../../cart-totals/cart-totals-summary.js';
|
|
5
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
6
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
7
|
+
import { OrderLineList } from '../../lists/orderline-list/orderline-list.js';
|
|
8
|
+
import { ErrorPage } from '../error-page/error-page.js';
|
|
9
|
+
import { CheckoutPageLayout } from '../layouts/checkout-page-layout/checkout-page-layout.js';
|
|
10
|
+
import { LoadingPage } from '../loading-page/loading-page.js';
|
|
11
|
+
import { Page } from '../page/page.js';
|
|
12
|
+
import { NoResults } from '../product-listing-page/no-results/no-results.js';
|
|
13
|
+
import { useIsAuthenticated } from '../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
|
|
14
|
+
import { useDeleteCartLineById } from '../../shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
|
|
15
|
+
import { useDeleteCurrentCart } from '../../shared/api/storefront/hooks/cart/use-delete-current-cart.js';
|
|
16
|
+
import { useSaveCartForLater } from '../../shared/api/storefront/hooks/cart/use-save-cart-for-later.js';
|
|
17
|
+
import { RouteButton } from '../../shared/routing/route-button.js';
|
|
18
|
+
import { useToast } from '../../toast/use-toast.js';
|
|
19
|
+
import { useFetchCurrentCartLinesWithAtp } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-lines-with-atp.js';
|
|
20
|
+
import { useFetchCurrentCartWithAtp } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-with-atp.js';
|
|
21
|
+
|
|
22
|
+
function EmptyCart() {
|
|
23
|
+
const t = useFormattedMessage();
|
|
24
|
+
return (jsx(NoResults, { content: jsxs(Fragment, { children: [jsx(FormattedMessage, { id: "There are no products in your shopping cart." }), jsx("br", {}), jsx(FormattedMessage, { id: "Click the button below to continue shopping." })] }), title: t('Your shopping cart is still empty') }));
|
|
25
|
+
}
|
|
26
|
+
function CartContent({ cartLines }) {
|
|
27
|
+
const { addToast } = useToast();
|
|
28
|
+
const { data: currentCart } = useFetchCurrentCartWithAtp();
|
|
29
|
+
const saveCartForLater = useSaveCartForLater({
|
|
30
|
+
onError: () => {
|
|
31
|
+
addToast({
|
|
32
|
+
body: jsx(FormattedMessage, { id: "Unable to save cart for later." }),
|
|
33
|
+
isUserDismissable: false,
|
|
34
|
+
messageType: 'danger',
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
onSuccess: () => {
|
|
38
|
+
addToast({
|
|
39
|
+
body: jsx(FormattedMessage, { id: "Saved cart for later." }),
|
|
40
|
+
isUserDismissable: false,
|
|
41
|
+
messageType: 'success',
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const deleteCurrentCart = useDeleteCurrentCart({
|
|
46
|
+
onError: () => {
|
|
47
|
+
addToast({
|
|
48
|
+
body: jsx(FormattedMessage, { id: "Unable to empty your cart." }),
|
|
49
|
+
isUserDismissable: false,
|
|
50
|
+
messageType: 'danger',
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
onSuccess: () => {
|
|
54
|
+
addToast({
|
|
55
|
+
body: jsx(FormattedMessage, { id: "Your cart has been emptied." }),
|
|
56
|
+
isUserDismissable: false,
|
|
57
|
+
messageType: 'success',
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const deleteCartLine = useDeleteCartLineById({
|
|
62
|
+
onError: () => {
|
|
63
|
+
addToast({
|
|
64
|
+
body: (jsx(FormattedMessage, { id: "Unable to remove the product from your cart." })),
|
|
65
|
+
isUserDismissable: false,
|
|
66
|
+
messageType: 'danger',
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
onSuccess: () => {
|
|
70
|
+
addToast({
|
|
71
|
+
body: (jsx(FormattedMessage, { id: "The product has been removed from your cart." })),
|
|
72
|
+
isUserDismissable: false,
|
|
73
|
+
messageType: 'success',
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
const isAuthenticated = useIsAuthenticated();
|
|
78
|
+
if (!currentCart)
|
|
79
|
+
return null;
|
|
80
|
+
return (jsx(CheckoutPageLayout, { actions: {
|
|
81
|
+
primary: (jsx(RouteButton, { withArrow: true, href: "/CheckoutShipping", children: jsx(FormattedMessage, { id: "Continue shopping" }) })),
|
|
82
|
+
secondary: (jsx(RouteButton, { color: "secondary", href: isAuthenticated ? undefined : '/signin', onClick: () => {
|
|
83
|
+
if (!isAuthenticated)
|
|
84
|
+
return;
|
|
85
|
+
saveCartForLater.mutate({ cart: currentCart });
|
|
86
|
+
}, variant: "outline", children: jsx(FormattedMessage, { id: "Save order" }) })),
|
|
87
|
+
}, mobileSummary: jsx(CartTotalsSummary, { totalAmount: currentCart.orderGrandTotalDisplay }), overview: jsx(CartTotals, { shippingCost: currentCart.shippingAndHandlingDisplay, subtotal: currentCart.orderSubTotalDisplay, tax: currentCart.totalTaxDisplay, total: currentCart.orderGrandTotalDisplay, vatPercentage: cartLines[0]?.pricing?.vatRate || 0 }), children: jsx(OrderLineList, { onRemoveAll: () => deleteCurrentCart.mutate(), children: cartLines.map(cartLine => (jsx(ConnectedOrderLineCard, { deliveryDate: cartLine.atp?.date, href: cartLine.productUri, image: {
|
|
88
|
+
image: {
|
|
89
|
+
'1': cartLine.smallImagePath,
|
|
90
|
+
'2': cartLine.smallImagePath,
|
|
91
|
+
'3': cartLine.smallImagePath,
|
|
92
|
+
altText: cartLine.altText,
|
|
93
|
+
},
|
|
94
|
+
title: cartLine.altText,
|
|
95
|
+
}, onRemove: () => deleteCartLine.mutate({ cartLineId: cartLine.id }), orderLineId: cartLine.id, price: {
|
|
96
|
+
originalTotalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
97
|
+
pricePerUnit: cartLine.pricing?.unitNetPrice || 0,
|
|
98
|
+
totalPrice: cartLine.pricing?.extendedUnitNetPrice || 0,
|
|
99
|
+
}, productId: cartLine.productId || '', readonly: false, sku: cartLine.erpNumber || '', tags: [], title: cartLine.productName }, cartLine.id))) }) }));
|
|
100
|
+
}
|
|
101
|
+
function CartPage() {
|
|
102
|
+
const t = useFormattedMessage();
|
|
103
|
+
const { data: cartLines, error, isLoading, } = useFetchCurrentCartLinesWithAtp();
|
|
104
|
+
if (error)
|
|
105
|
+
return jsx(ErrorPage, { error: error });
|
|
106
|
+
if (isLoading)
|
|
107
|
+
return jsx(LoadingPage, {});
|
|
108
|
+
return (jsx(Page, { breadCrumb: [
|
|
109
|
+
{ href: '/', label: 'home' },
|
|
110
|
+
{ href: '/cart', label: t('Cart') },
|
|
111
|
+
], title: t('Cart'), children: cartLines?.length ? (jsx(CartContent, { cartLines: cartLines })) : (jsx(EmptyCart, {})) }));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { CartPage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { isRequestError } from '../../shared/fetch/request.js';
|
|
5
|
+
import { environment } from '../../shared/utils/environment.js';
|
|
6
|
+
import { Heading } from '../../typography/heading/heading.js';
|
|
7
|
+
import { Page } from '../page/page.js';
|
|
8
|
+
|
|
9
|
+
function ErrorPage({ error }) {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
if (!isRequestError(error))
|
|
13
|
+
throw error;
|
|
14
|
+
}, 0);
|
|
15
|
+
}, [error]);
|
|
16
|
+
return (jsx(Page, { breadCrumb: [
|
|
17
|
+
{ href: '/', label: 'Home' },
|
|
18
|
+
{ href: '/', label: 'Error' },
|
|
19
|
+
], title: "Something went wrong", children: environment !== 'production' && (jsxs(Fragment, { children: [jsx(Heading, { size: "l", children: isRequestError(error) ? (jsxs(Fragment, { children: [error.status, " - ", error.statusText || 'Unknown error'] })) : (jsx(Fragment, { children: error.message })) }), isRequestError(error) && (jsxs(Fragment, { children: [jsx(Heading, { size: "xs", children: "Error details" }), jsx(Heading, { size: "xxs", children: "Body" }), jsx("pre", { children: JSON.stringify(error.body, null, 2) }), jsx(Heading, { size: "xxs", children: "Options" }), jsx("pre", { children: JSON.stringify(error.options, null, 2) })] }))] })) }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { ErrorPage };
|