@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,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Breadcrumbs, Breadcrumb as Breadcrumb$1 } from 'react-aria-components';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { GlyphsChevronsSlimLeftIcon } from '../icons/glyph/glyphs-chevrons-slim-left-icon.js';
|
|
6
|
+
import { SolidHomeIcon } from '../icons/solid/solid-home-icon.js';
|
|
7
|
+
import { useBreakpoint } from '../shared/hooks/use-breakpoint.js';
|
|
8
|
+
import { RouteLink } from '../shared/routing/route-link.js';
|
|
9
|
+
import styles from './breadcrumb.module.css.js';
|
|
10
|
+
|
|
11
|
+
function BreadcrumbShort({ links }) {
|
|
12
|
+
const homeLink = links[0];
|
|
13
|
+
const previousLink = links.at(-2);
|
|
14
|
+
const isHomeLink = previousLink === undefined || previousLink === homeLink;
|
|
15
|
+
const href = previousLink?.href || homeLink?.href;
|
|
16
|
+
return (jsx(Breadcrumbs, { className: styles.breadcrumbs, children: jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(RouteLink, { className: styles.link, href: href, isDisabled: false, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: styles.icon }), isHomeLink ? (jsx(SolidHomeIcon, { className: styles.icon })) : (jsx("span", { children: previousLink.label }))] }) }) }));
|
|
17
|
+
}
|
|
18
|
+
function BreadcrumbLongItem({ index, isDisabled, link, }) {
|
|
19
|
+
return (jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsxs(RouteLink, { className: styles.link, color: "secondary", href: link.href, isDisabled: isDisabled, children: [jsx(GlyphsChevronsSlimLeftIcon, { className: clsx(styles['previous-icon'], styles.icon) }), link.label] }) }, index));
|
|
20
|
+
}
|
|
21
|
+
function BreadcrumbLong({ links }) {
|
|
22
|
+
const linksWithoutFirst = links.slice(1);
|
|
23
|
+
const homeLink = links[0];
|
|
24
|
+
if (!homeLink)
|
|
25
|
+
return null;
|
|
26
|
+
return (jsxs(Breadcrumbs, { className: styles.breadcrumbs, children: [jsx(Breadcrumb$1, { className: styles.breadcrumb, children: jsx(RouteLink, { className: styles.link, href: homeLink.href, children: jsx(SolidHomeIcon, { className: clsx(styles['home-icon'], styles.icon) }) }) }), linksWithoutFirst.map((link, index) => (jsx(BreadcrumbLongItem, { index: index, isDisabled: linksWithoutFirst.length - 1 === index, link: link }, index)))] }));
|
|
27
|
+
}
|
|
28
|
+
function Breadcrumb({ links }) {
|
|
29
|
+
const { lg } = useBreakpoint();
|
|
30
|
+
if (links.length <= 1)
|
|
31
|
+
return null;
|
|
32
|
+
return lg ? BreadcrumbLong({ links }) : BreadcrumbShort({ links });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { Breadcrumb };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect, useRef } from 'react';
|
|
4
|
+
import { NumberField } from '../../forms/number-field/number-field.js';
|
|
5
|
+
import { SolidCartIcon } from '../../icons/solid/solid-cart-icon.js';
|
|
6
|
+
import { useDebouncedCallback } from '../../shared/hooks/use-debounced-callback.js';
|
|
7
|
+
import { Button } from '../button/button.js';
|
|
8
|
+
import styles from './add-to-cart-button.module.css.js';
|
|
9
|
+
|
|
10
|
+
function AddToCartButton({ initialState = 'initial', isDisabled = false, onChange, quantity, }) {
|
|
11
|
+
const [currentState, setState] = useState(initialState);
|
|
12
|
+
const [manualInputQuantity, setManualInputQuantity] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setState(currentState => {
|
|
15
|
+
if (currentState === 'initial' && quantity > 0)
|
|
16
|
+
return 'spinner';
|
|
17
|
+
if (currentState === 'spinner' && quantity === 0)
|
|
18
|
+
return 'initial';
|
|
19
|
+
if (currentState === 'manual-input' && quantity === 0)
|
|
20
|
+
return 'initial';
|
|
21
|
+
if (currentState === 'manual-input' && manualInputQuantity === null)
|
|
22
|
+
return 'initial';
|
|
23
|
+
return currentState;
|
|
24
|
+
});
|
|
25
|
+
}, [currentState, quantity, manualInputQuantity]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (currentState === 'manual-input')
|
|
28
|
+
setManualInputQuantity(null);
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
+
}, [quantity]);
|
|
31
|
+
if (currentState === 'initial')
|
|
32
|
+
return (jsx(InitialState, { isDisabled: isDisabled, onAddToCart: () => {
|
|
33
|
+
onChange(1);
|
|
34
|
+
} }));
|
|
35
|
+
if (currentState === 'spinner')
|
|
36
|
+
return (jsx(SpinnerState, { isDisabled: isDisabled, onChange: value => {
|
|
37
|
+
onChange(value);
|
|
38
|
+
}, onManualInput: value => {
|
|
39
|
+
setManualInputQuantity(value);
|
|
40
|
+
setState('manual-input');
|
|
41
|
+
}, quantity: quantity }));
|
|
42
|
+
return (jsx(ManualInputState, { isDisabled: isDisabled, onCancel: () => setState('spinner'), onConfirm: value => {
|
|
43
|
+
onChange(value);
|
|
44
|
+
}, quantity: manualInputQuantity || '' }));
|
|
45
|
+
}
|
|
46
|
+
function InitialState({ isDisabled, onAddToCart, }) {
|
|
47
|
+
return (jsx(Button, { condensed: true, icon: jsx(SolidCartIcon, {}), isDisabled: isDisabled, onClick: e => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
onAddToCart();
|
|
51
|
+
}, size: "md" }));
|
|
52
|
+
}
|
|
53
|
+
const ensureNumber = (value) => {
|
|
54
|
+
if (typeof value === 'number')
|
|
55
|
+
return value;
|
|
56
|
+
if (typeof value !== 'string')
|
|
57
|
+
return 0;
|
|
58
|
+
const numberValue = Number.parseFloat(value);
|
|
59
|
+
return Number.isNaN(numberValue) ? 0 : numberValue;
|
|
60
|
+
};
|
|
61
|
+
function SpinnerState({ isDisabled, onChange, onManualInput, quantity, }) {
|
|
62
|
+
const [internalQuantity, setInternalQuantity] = useState(quantity);
|
|
63
|
+
const mounted = useRef(false);
|
|
64
|
+
const onDebouncedChange = useDebouncedCallback(value => {
|
|
65
|
+
// Prevent calling the debounced onChange callback after the component is unmounted
|
|
66
|
+
if (!mounted.current)
|
|
67
|
+
return;
|
|
68
|
+
onChange(value);
|
|
69
|
+
}, 500);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
mounted.current = true;
|
|
72
|
+
return () => {
|
|
73
|
+
mounted.current = false;
|
|
74
|
+
};
|
|
75
|
+
}, []);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
setInternalQuantity(quantity);
|
|
78
|
+
}, [quantity]);
|
|
79
|
+
return (jsx(NumberField, { withButtons: true, autoGrow: true, formatOptions: {
|
|
80
|
+
maximumFractionDigits: 0,
|
|
81
|
+
style: 'decimal',
|
|
82
|
+
useGrouping: false,
|
|
83
|
+
}, isDisabled: isDisabled, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, onChange: quantity => {
|
|
84
|
+
setInternalQuantity(quantity);
|
|
85
|
+
if (quantity === 0) {
|
|
86
|
+
mounted.current = false;
|
|
87
|
+
return onChange(0);
|
|
88
|
+
}
|
|
89
|
+
onDebouncedChange(quantity);
|
|
90
|
+
}, onInput: e => {
|
|
91
|
+
onManualInput(e.target.value);
|
|
92
|
+
}, showLabel: false, size: "md", value: internalQuantity }));
|
|
93
|
+
}
|
|
94
|
+
function ManualInputState({ isDisabled, onCancel, onConfirm, quantity, }) {
|
|
95
|
+
const [updatedQuantity, setQuantity] = useState(quantity);
|
|
96
|
+
const onKeyUp = (e) => {
|
|
97
|
+
if (e.key === 'Enter')
|
|
98
|
+
onConfirm(ensureNumber(updatedQuantity));
|
|
99
|
+
if (e.key === 'Escape')
|
|
100
|
+
onCancel();
|
|
101
|
+
};
|
|
102
|
+
return (jsxs("div", { className: styles['manual-input-container'], children: [jsx("div", { className: styles['left-button-spacer'] }), jsx(NumberField, { autoFocus: true, autoGrow: true, defaultValue: quantity ? ensureNumber(quantity) : undefined, formatOptions: {
|
|
103
|
+
maximumFractionDigits: 0,
|
|
104
|
+
style: 'decimal',
|
|
105
|
+
useGrouping: false,
|
|
106
|
+
}, isDisabled: isDisabled, label: "Quantity", maxLength: 4, maxValue: 9999, minValue: 0, name: "quantity", onChange: value => setQuantity(String(value)), onKeyUp: onKeyUp, showLabel: false, size: "md" }), jsx(Button, { condensed: true, isDisabled: isDisabled, onClick: e => {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
e.stopPropagation();
|
|
109
|
+
onConfirm(ensureNumber(updatedQuantity));
|
|
110
|
+
}, size: "md", children: "OK" })] }));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { AddToCartButton };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
4
|
+
import { useAddProductToCurrentCart } from '../../shared/api/storefront/hooks/cart/use-add-product-to-current-cart.js';
|
|
5
|
+
import { useDeleteCartLineById } from '../../shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.js';
|
|
6
|
+
import { useFetchCurrentCartLines } from '../../shared/api/storefront/hooks/cart/use-fetch-current-cart-lines.js';
|
|
7
|
+
import { useUpdateCartLineById } from '../../shared/api/storefront/hooks/cart/use-update-cart-line-by-id.js';
|
|
8
|
+
import { useCartEvents } from '../../shared/providers/cart-provider.js';
|
|
9
|
+
import { useToast } from '../../toast/use-toast.js';
|
|
10
|
+
import { AddToCartButton } from './add-to-cart-button.js';
|
|
11
|
+
|
|
12
|
+
const ConnectedAddToCartButton = ({ onAddToCart, productId }) => {
|
|
13
|
+
const { isPending: isPendingAddToCart, mutate: addToCart } = useAddProductToCurrentCart();
|
|
14
|
+
const { data: cartLines, isLoading: isLoadingCartLines } = useFetchCurrentCartLines();
|
|
15
|
+
const { isPending: isPendingDeleteCartLine, mutate: deleteCartLine } = useDeleteCartLineById();
|
|
16
|
+
const { mutate: updateCartLine } = useUpdateCartLineById();
|
|
17
|
+
const { addToast } = useToast();
|
|
18
|
+
const { onCartLineAdded, onCartLineError, onCartLineRemoved, onCartLineUpdated, } = useCartEvents() || {};
|
|
19
|
+
const cartLine = cartLines?.find(line => line.productId === productId);
|
|
20
|
+
const quantity = cartLine?.qtyOrdered || 0;
|
|
21
|
+
const handleChange = (quantity) => {
|
|
22
|
+
if (cartLine) {
|
|
23
|
+
if (quantity === 0) {
|
|
24
|
+
deleteCartLine({ cartLineId: cartLine.id }, {
|
|
25
|
+
onError: error => {
|
|
26
|
+
onCartLineError?.(error, cartLine);
|
|
27
|
+
addToast({
|
|
28
|
+
body: (jsx(FormattedMessage, { id: "Unable to remove the product from your cart." })),
|
|
29
|
+
isUserDismissable: false,
|
|
30
|
+
messageType: 'danger',
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
onSuccess: () => {
|
|
34
|
+
onCartLineRemoved?.(cartLine);
|
|
35
|
+
addToast({
|
|
36
|
+
body: (jsx(FormattedMessage, { id: "The product has been removed from your cart." })),
|
|
37
|
+
isUserDismissable: false,
|
|
38
|
+
messageType: 'success',
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
updateCartLine({
|
|
45
|
+
cartLine: { ...cartLine, qtyOrdered: quantity },
|
|
46
|
+
cartLineId: cartLine.id,
|
|
47
|
+
}, {
|
|
48
|
+
onError: error => {
|
|
49
|
+
onCartLineError?.(error, cartLine);
|
|
50
|
+
addToast({
|
|
51
|
+
body: (jsx(FormattedMessage, { id: "Unable to update the product in your cart." })),
|
|
52
|
+
isUserDismissable: false,
|
|
53
|
+
messageType: 'danger',
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
onSuccess: () => {
|
|
57
|
+
onCartLineUpdated?.({ ...cartLine, qtyOrdered: quantity });
|
|
58
|
+
addToast({
|
|
59
|
+
body: (jsx(FormattedMessage, { id: "The product has been updated in your cart." })),
|
|
60
|
+
isUserDismissable: false,
|
|
61
|
+
messageType: 'success',
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
addToCart({ productId, qtyOrdered: quantity, unitOfMeasure: '' }, {
|
|
69
|
+
onError: error => {
|
|
70
|
+
onCartLineError?.(error, cartLine);
|
|
71
|
+
addToast({
|
|
72
|
+
body: (jsx(FormattedMessage, { id: "Unable to add the product to your cart." })),
|
|
73
|
+
isUserDismissable: false,
|
|
74
|
+
messageType: 'danger',
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
onSuccess: cartLine => {
|
|
78
|
+
onAddToCart?.({ cartLine });
|
|
79
|
+
onCartLineAdded?.(cartLine);
|
|
80
|
+
addToast({
|
|
81
|
+
body: (jsx(FormattedMessage, { id: "The product has been added to your cart." })),
|
|
82
|
+
isUserDismissable: false,
|
|
83
|
+
messageType: 'success',
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return (jsx(AddToCartButton, { isDisabled: isPendingDeleteCartLine || isLoadingCartLines || isPendingAddToCart, onChange: handleChange, quantity: quantity }));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { ConnectedAddToCartButton };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { GlyphsArrowBoldCapsRightIcon } from '../../icons/glyph/glyphs-arrow-boldcaps-right-icon.js';
|
|
5
|
+
import buttonStyles from './button.module.css.js';
|
|
6
|
+
|
|
7
|
+
function Button({ _pseudo = 'none', children, className, color = 'primary', condensed, icon, iconPosition = 'left', isDisabled, onClick: _onClick, size = 'lg', type = 'button', variant = 'solid', withArrow = false, }) {
|
|
8
|
+
const showIconOnLeft = icon && iconPosition === 'left';
|
|
9
|
+
const showIconOnRight = icon && iconPosition === 'right';
|
|
10
|
+
const onClick = (e) => {
|
|
11
|
+
if (_onClick)
|
|
12
|
+
_onClick(e);
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
if (type === 'submit')
|
|
15
|
+
return;
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
};
|
|
18
|
+
return (jsxs("button", { className: clsx({ [buttonStyles.condensed]: condensed }, { [buttonStyles.icon]: icon }, buttonStyles.button, buttonStyles[variant], buttonStyles[size], buttonStyles[color], buttonStyles[_pseudo], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: onClick, type: type, children: [jsx(Fragment, { children: showIconOnLeft && jsx("span", { className: buttonStyles.icon, children: icon }) }), children, withArrow && (jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })), showIconOnRight && jsx("span", { className: buttonStyles.icon, children: icon })] }));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Button };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var buttonStyles = {"button":"button-module-V4meK","icon":"button-module-XaNWz","sm":"button-module-Pbwz7","md":"button-module-GVTEW","condensed":"button-module-GKHQc","lg":"button-module-nyNY8","primary":"button-module-tmyk8","outline":"button-module-vq9GI","solid":"button-module-AjvlY","hover":"button-module-YzPAr","focus":"button-module--xzsY","active":"button-module-XMFzj","ghost":"button-module-f4UVe","right-arrow-icon":"button-module-ydQAo","secondary":"button-module--1bCH"};
|
|
2
|
+
|
|
3
|
+
export { buttonStyles as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { SignInDialog } from '../../modals/signin/sign-in-dialog.js';
|
|
5
|
+
import { useFetchSession } from '../../shared/api/storefront/hooks/authentication/use-fetch-session.js';
|
|
6
|
+
import { useIsAuthenticated } from '../../shared/api/storefront/hooks/authentication/use-is-authenticated.js';
|
|
7
|
+
import { useAddWishListItemToCurrentWishList } from '../../shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js';
|
|
8
|
+
import { useDeleteWishListItemFromWishList } from '../../shared/api/storefront/hooks/wishlist/use-delete-wishlist-item-from-wishlist.js';
|
|
9
|
+
import { ForbiddenRequestError, UnauthorizedRequestError } from '../../shared/fetch/request.js';
|
|
10
|
+
import { useFavoriteProduct } from '../../shared/providers/favorite-provider.js';
|
|
11
|
+
import { FavoriteButton } from './favorite-button.js';
|
|
12
|
+
|
|
13
|
+
function ConnectedFavoriteButton({ onFavorited: _onFavorited, onFavoriting: _onFavoriting, productId, }) {
|
|
14
|
+
const { refetch } = useFetchSession();
|
|
15
|
+
const isAuthenticated = useIsAuthenticated();
|
|
16
|
+
const { isFavorite: _isFavorite, isFetching, wishList, wishListItem, } = useFavoriteProduct(productId);
|
|
17
|
+
const [showSignInDialog, setShowSignInDialog] = useState(false);
|
|
18
|
+
const { error: addWishListItemToCurrentWishListError, mutate: addWishListItemToCurrentWishList, } = useAddWishListItemToCurrentWishList();
|
|
19
|
+
const { error: deleteWishListItemFromWishListError, mutate: deleteWishListItemFromWishList, } = useDeleteWishListItemFromWishList();
|
|
20
|
+
const [isFavorite, setIsFavorite] = useState(_isFavorite);
|
|
21
|
+
function onFavorite() {
|
|
22
|
+
if (!(wishList && wishListItem))
|
|
23
|
+
_onFavoriting?.();
|
|
24
|
+
if (!isAuthenticated) {
|
|
25
|
+
return setShowSignInDialog(true);
|
|
26
|
+
}
|
|
27
|
+
setIsFavorite(currentValue => !currentValue);
|
|
28
|
+
if (wishList && wishListItem) {
|
|
29
|
+
deleteWishListItemFromWishList({
|
|
30
|
+
wishListId: wishList.id,
|
|
31
|
+
wishListItemId: wishListItem.id,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
addWishListItemToCurrentWishList({ productId }, {
|
|
36
|
+
onSuccess() {
|
|
37
|
+
_onFavorited?.();
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setIsFavorite(_isFavorite);
|
|
44
|
+
}, [_isFavorite]);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
setIsFavorite(Boolean(wishList && wishListItem));
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
}, [
|
|
49
|
+
addWishListItemToCurrentWishListError,
|
|
50
|
+
deleteWishListItemFromWishListError,
|
|
51
|
+
]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (addWishListItemToCurrentWishListError instanceof ForbiddenRequestError ||
|
|
54
|
+
addWishListItemToCurrentWishListError instanceof UnauthorizedRequestError) {
|
|
55
|
+
refetch();
|
|
56
|
+
return setShowSignInDialog(true);
|
|
57
|
+
}
|
|
58
|
+
}, [addWishListItemToCurrentWishListError, refetch]);
|
|
59
|
+
if (isFetching)
|
|
60
|
+
return null;
|
|
61
|
+
return (jsxs(Fragment, { children: [jsx(FavoriteButton, { isDisabled: isFetching, isFavorite: isFavorite, onClick: onFavorite }), jsx(SignInDialog, { isOpen: showSignInDialog, onOpenChange: setShowSignInDialog })] }));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { ConnectedFavoriteButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { SolidFavoriteIcon } from '../../icons/solid/solid-favorite-icon.js';
|
|
5
|
+
import { StrokeFavoriteIcon } from '../../icons/stroke/stroke-favorite-icon.js';
|
|
6
|
+
import { IconButton } from '../icon-button/icon-button.js';
|
|
7
|
+
import styles from './favorite-button.module.css.js';
|
|
8
|
+
|
|
9
|
+
function FavoriteButton({ isDisabled, isFavorite, onClick: onClick, }) {
|
|
10
|
+
return (jsx(IconButton, { className: clsx(styles['favorite-button'], {
|
|
11
|
+
[styles['is-favorite']]: isFavorite,
|
|
12
|
+
}), color: "secondary", isDisabled: isDisabled, onClick: onClick, children: isFavorite ? jsx(SolidFavoriteIcon, {}) : jsx(StrokeFavoriteIcon, {}) }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { FavoriteButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import styles from './icon-button.module.css.js';
|
|
5
|
+
|
|
6
|
+
function IconButton({ children, className, color = 'primary', isDisabled, onClick: _onClick, size = 'md', title, type = 'button', ...rest }) {
|
|
7
|
+
const onClick = (e) => {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
e.stopPropagation();
|
|
10
|
+
_onClick?.(e);
|
|
11
|
+
};
|
|
12
|
+
return (jsx("button", { className: clsx(styles['icon-button'], styles[size], styles[color], className), "data-disabled": isDisabled ? true : undefined, disabled: isDisabled, onClick: onClick, title: title, type: type, ...rest, children: children }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { IconButton };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import styles from './link.module.css.js';
|
|
5
|
+
|
|
6
|
+
function Link({ children, className, color = 'primary', hasUnderline, isDisabled, onClick, onKeyUp, ...props }) {
|
|
7
|
+
return (jsx("a", { className: clsx({ [styles['has-underline']]: hasUnderline }, styles['link'], styles[color], className), "data-disabled": isDisabled ? true : undefined, onClick: onClick, onKeyUp: onKeyUp, role: "link", tabIndex: isDisabled ? -1 : 0, ...props, children: children }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Link };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
3
|
+
import { Button } from '../button/button.js';
|
|
4
|
+
|
|
5
|
+
function PrintButton() {
|
|
6
|
+
return (jsx(Button, { color: "secondary", onClick: () => window?.print(), variant: "outline", children: jsx(FormattedMessage, { id: "Print" }) }));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { PrintButton };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { GlyphsArrowBoldCapsRightIcon } from '../../icons/glyph/glyphs-arrow-boldcaps-right-icon.js';
|
|
5
|
+
import { Image } from '../../media/image/image.js';
|
|
6
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
7
|
+
import styles from './category-card.module.css.js';
|
|
8
|
+
|
|
9
|
+
function CategoryCard({ className, href, image, isSelected = false, onClick, title, withArrow = false, }) {
|
|
10
|
+
return (jsxs(RouteLink, { className: clsx({
|
|
11
|
+
[styles['is-selected']]: isSelected,
|
|
12
|
+
}, styles['category-card'], className), href: href, onClick: onClick, children: [jsx("div", { className: styles['image-container'], children: jsx(Image, { className: styles.image, ...image, fit: "contain" }) }), jsxs("p", { className: styles.title, children: [jsx("span", { children: title }), withArrow && jsx(GlyphsArrowBoldCapsRightIcon, { className: styles.arrow })] })] }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { CategoryCard };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"category-card":"category-card-module-4NUjH","title":"category-card-module-LEhh3","arrow":"category-card-module-hL4-A","image":"category-card-module-RxWMW","is-selected":"category-card-module-vJ7vB","image-container":"category-card-module-oNTrK"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { ConnectedAddToCartButton } from '../../buttons/add-to-cart-button/connected-add-to-cart-button.js';
|
|
4
|
+
import { ConnectedRemoveButton } from './connected-remove-button.js';
|
|
5
|
+
import { OrderLineCard } from './orderline-card.js';
|
|
6
|
+
|
|
7
|
+
function ConnectedOrderLineCard({ onRemove, orderLineId, productId, ...props }) {
|
|
8
|
+
return (jsx(OrderLineCard, { productId: productId, ...props, addToCartButton: jsx(ConnectedAddToCartButton, { productId: productId }), readonly: false, removeButton: jsx(ConnectedRemoveButton, { id: orderLineId, onRemove: orderLineId => {
|
|
9
|
+
onRemove?.(orderLineId);
|
|
10
|
+
} }) }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ConnectedOrderLineCard };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { IconButton } from '../../buttons/icon-button/icon-button.js';
|
|
4
|
+
import { StrokeTrashIcon } from '../../icons/stroke/stroke-trash-icon.js';
|
|
5
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
6
|
+
import { ConfirmationDialog } from '../../modals/confirmation/confirmation-dialog.js';
|
|
7
|
+
import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
|
|
8
|
+
|
|
9
|
+
function ConnectedRemoveButton({ id: productId, onRemove: _onRemove, }) {
|
|
10
|
+
const t = useFormattedMessage();
|
|
11
|
+
const { close, isOpen, open } = useDisclosure();
|
|
12
|
+
function onRemove() {
|
|
13
|
+
close();
|
|
14
|
+
_onRemove(productId);
|
|
15
|
+
}
|
|
16
|
+
return (jsxs(Fragment, { children: [jsx(IconButton, { color: "secondary", onClick: open, children: jsx(StrokeTrashIcon, {}) }), jsx(ConfirmationDialog, { isOpen: isOpen, onCancel: close, onConfirm: onRemove, title: t('Are you sure you want to remove this item from your cart?') })] }));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { ConnectedRemoveButton };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Tag } from '../../badges/tag/tag.js';
|
|
3
|
+
import { DeliveryTime } from '../../delivery-time/delivery-time.js';
|
|
4
|
+
import { ProductTotalPrice } from '../../display/product-price/product-total-price.js';
|
|
5
|
+
import { ProductSku } from '../../display/product-sku/product-sku.js';
|
|
6
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
7
|
+
import { Image } from '../../media/image/image.js';
|
|
8
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
9
|
+
import { Heading } from '../../typography/heading/heading.js';
|
|
10
|
+
import styles from './orderline-card.module.css.js';
|
|
11
|
+
|
|
12
|
+
function OrderLineCard(props) {
|
|
13
|
+
const { deliveryDate, href, image, price, productId, readonly, sku, tags, title, } = props;
|
|
14
|
+
return (jsxs(RouteLink, { className: styles['orderline-card'], href: href, id: productId, children: [jsx("div", { className: styles['image-container'], children: jsx(Image, { ...image }) }), jsxs("div", { className: styles.body, children: [jsxs("div", { className: styles['title-container'], children: [tags && (jsx("div", { className: styles.tag, children: tags.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { optional: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) })), jsx(Heading, { className: styles.title, size: "xxxs", tag: "h3", children: title }), jsx("div", { className: styles.sku, children: jsx(ProductSku, { sku: sku }) })] }), readonly ? (jsx("p", { className: styles.amount, children: jsx(FormattedMessage, { id: "Amount: {0}", replacementValues: { '0': props.quantity.toString() } }) })) : (jsx("div", { className: styles['add-to-cart-button'], children: props.addToCartButton })), jsx(ProductTotalPrice, { className: styles.price, originalTotalPrice: price.originalTotalPrice, pricePerUnit: price.pricePerUnit, totalPrice: price.totalPrice }), deliveryDate && (jsx(DeliveryTime, { className: styles.delivery, deliveryDate: deliveryDate })), !readonly && jsx("div", { className: styles.remove, children: props.removeButton })] })] }));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { OrderLineCard };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"orderline-card":"orderline-card-module-AMTMm","image-container":"orderline-card-module-TlhUg","body":"orderline-card-module-L0kX1","title-container":"orderline-card-module-D-6JE","tag":"orderline-card-module-uiHOY","title":"orderline-card-module-C8xE6","amount":"orderline-card-module-s-u3O","add-to-cart-button":"orderline-card-module-ZjAaX","price":"orderline-card-module-q3yjo","delivery":"orderline-card-module-N-Oe-","remove":"orderline-card-module-0CunP"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { ConnectedAddToCartButton } from '../../buttons/add-to-cart-button/connected-add-to-cart-button.js';
|
|
4
|
+
import { ConnectedFavoriteButton } from '../../buttons/favorite/connected-favorite-button.js';
|
|
5
|
+
import { ProductCard } from './product-card.js';
|
|
6
|
+
|
|
7
|
+
function ConnectedProductCard({ id, onAddToCart, onFavorited, onFavoriting, ...props }) {
|
|
8
|
+
return (jsx(ProductCard, { id: id, ...props, addToCartButton: jsx(ConnectedAddToCartButton, { onAddToCart: onAddToCart, productId: id }), favoriteButton: jsx(ConnectedFavoriteButton, { onFavorited: onFavorited, onFavoriting: onFavoriting, productId: id }) }));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { ConnectedProductCard };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Tag } from '../../badges/tag/tag.js';
|
|
4
|
+
import { ProductPrice } from '../../display/product-price/product-price.js';
|
|
5
|
+
import { ProductSku } from '../../display/product-sku/product-sku.js';
|
|
6
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
7
|
+
import { Image } from '../../media/image/image.js';
|
|
8
|
+
import { RouteLink } from '../../shared/routing/route-link.js';
|
|
9
|
+
import styles from './product-card.module.css.js';
|
|
10
|
+
|
|
11
|
+
function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }) {
|
|
12
|
+
return (jsx("div", { className: styles['product-card-container'], children: jsxs(RouteLink, { className: styles['product-card'], "data-product-id": sku, href: href, id: id, onClick: onClick, children: [jsx("div", { className: styles.image, children: jsx(Image, { ...image }) }), jsx("div", { className: styles['favorite-button'], children: FavoriteButton && FavoriteButton }), jsxs("div", { className: styles.content, children: [jsxs("div", { className: styles.top, children: [jsx("div", { className: styles.tag, children: tags?.map(tag => (jsx(Tag, { children: jsx(FormattedMessage, { optional: true, fallbackValue: tag, id: `tag.${tag.toLowerCase()}` }) }, tag))) }), jsx("h2", { className: styles.title, children: title }), jsx(ProductSku, { sku: sku })] }), jsxs("div", { className: styles.bottom, children: [jsx("div", { className: styles.price, children: jsx(ProductPrice, { isVatIncluded: price.isVatIncluded, originalPrice: price.originalPrice, price: price.price }) }), jsx("div", { className: styles['add-to-cart-button'], children: AddToCartButton })] })] })] }) }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { ProductCard };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"product-card-container":"product-card-module-LepTy","product-card":"product-card-module-pLaiB","favorite-button":"product-card-module-tvEdz","content":"product-card-module-e0kMu","top":"product-card-module-Q0VvF","tag":"product-card-module-HkWBE","title":"product-card-module-CStNi","bottom":"product-card-module-kD2tU","image":"product-card-module-p-zoi","price":"product-card-module-irW0D","add-to-cart-button":"product-card-module-SnCvX"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { Button } from '../../buttons/button/button.js';
|
|
6
|
+
import { FormattedMessage } from '../../intl/formatted-message.js';
|
|
7
|
+
import { ProductOverviewGrid } from '../../lists/product-overview-grid/product-overview-grid.js';
|
|
8
|
+
import { Carousel } from '../carousel.js';
|
|
9
|
+
import styles from './card-carousel.module.css.js';
|
|
10
|
+
|
|
11
|
+
function CardCarousel({ allowExpandToGrid = false, cards, cardsPerView = {
|
|
12
|
+
md: 2,
|
|
13
|
+
sm: 1,
|
|
14
|
+
xxl: 3,
|
|
15
|
+
}, cardWidth = 'auto', hasOverflow = false, }) {
|
|
16
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
17
|
+
if (!isExpanded) {
|
|
18
|
+
return (jsxs("div", { className: styles['carousel-container'], children: [jsx(Carousel, { hasOverflow: hasOverflow, navigationButtonsPosition: "center", slideClasses: clsx(styles.slide, styles[`width-${cardWidth}`]), slides: cards, slidesPerView: cardsPerView, spaceBetween: 16 }), allowExpandToGrid && (jsx(Button, { withArrow: true, className: styles.button, color: "secondary", onClick: () => setIsExpanded(true), variant: "outline", children: jsx(FormattedMessage, { id: "Show all" }) }))] }));
|
|
19
|
+
}
|
|
20
|
+
return (jsxs("div", { className: styles['carousel-container'], children: [jsxs(ProductOverviewGrid, { children: [...cards] }), jsx(Button, { withArrow: true, className: styles.button, color: "secondary", onClick: () => setIsExpanded(false), variant: "outline", children: jsx(FormattedMessage, { id: "Show less" }) })] }));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { CardCarousel };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"carousel-container":"card-carousel-module-JXQmk","button":"card-carousel-module-XQ2pX","slide":"card-carousel-module-DxKOG","width-auto":"card-carousel-module-RQ8gl","width-narrow":"card-carousel-module-8uKSt","width-normal":"card-carousel-module-l-ylK"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { GlyphsArrowBoldCapsLeftIcon } from '../icons/glyph/glyphs-arrow-boldcaps-left-icon.js';
|
|
6
|
+
import { GlyphsArrowBoldCapsRightIcon } from '../icons/glyph/glyphs-arrow-boldcaps-right-icon.js';
|
|
7
|
+
import styles from './carousel-navigation-button.module.css.js';
|
|
8
|
+
|
|
9
|
+
const CarouselNavigationButton = forwardRef(function NavigationButton({ className, direction, onClick }, ref) {
|
|
10
|
+
return (jsx("button", { ref: ref, className: clsx(styles['carousel-navigation-button'], className), onClick: () => onClick?.(direction), children: direction === 'previous' ? (jsx(GlyphsArrowBoldCapsLeftIcon, {})) : (jsx(GlyphsArrowBoldCapsRightIcon, {})) }));
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { CarouselNavigationButton };
|