@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,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useRef, useCallback, useEffect } from 'react';
|
|
4
|
+
import { useContextProps, TextAreaContext, TextArea as TextArea$1 } from 'react-aria-components';
|
|
5
|
+
import styles from './textarea.module.css.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This component is used to create a textarea that can grow as the user types.
|
|
9
|
+
* It uses the scrollHeight property to calculate the height of the textarea.
|
|
10
|
+
* The initial height is calculated based on the style of the textarea.
|
|
11
|
+
* The height is updated everytime the user types.
|
|
12
|
+
*/
|
|
13
|
+
const TextArea = forwardRef(({ autoGrow, size, ...textAreaProps }, _ref) => {
|
|
14
|
+
const textAreaRef = useRef(null);
|
|
15
|
+
const [props, ref] = useContextProps(textAreaProps, textAreaRef, TextAreaContext);
|
|
16
|
+
const initialHeight = useRef(null);
|
|
17
|
+
const updateHeight = useCallback(() => {
|
|
18
|
+
if (!ref.current)
|
|
19
|
+
return;
|
|
20
|
+
if (!autoGrow)
|
|
21
|
+
return ref.current.style.removeProperty('height');
|
|
22
|
+
ref.current.style.height = `${initialHeight.current}px`;
|
|
23
|
+
if (ref.current.scrollHeight > (initialHeight.current || 0)) {
|
|
24
|
+
ref.current.style.height = ref.current.scrollHeight + 'px';
|
|
25
|
+
}
|
|
26
|
+
}, [autoGrow, ref]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
initialHeight.current = null;
|
|
29
|
+
ref.current?.style.removeProperty('height');
|
|
30
|
+
}, [ref, size]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!ref.current)
|
|
33
|
+
return;
|
|
34
|
+
if (initialHeight.current === null &&
|
|
35
|
+
typeof getComputedStyle !== 'undefined') {
|
|
36
|
+
const styleHeight = getComputedStyle(ref.current).height.match(/\d+/)?.[0];
|
|
37
|
+
initialHeight.current = styleHeight
|
|
38
|
+
? Number.parseFloat(styleHeight)
|
|
39
|
+
: null;
|
|
40
|
+
}
|
|
41
|
+
updateHeight();
|
|
42
|
+
}, [ref, autoGrow, updateHeight, size]);
|
|
43
|
+
return (jsx("div", { className: styles['input-container'], children: jsx(TextArea$1, { ...textAreaProps, ref: node => {
|
|
44
|
+
ref.current =
|
|
45
|
+
node;
|
|
46
|
+
textAreaRef.current = node;
|
|
47
|
+
}, onInput: e => {
|
|
48
|
+
updateHeight();
|
|
49
|
+
props.onInput?.(e);
|
|
50
|
+
} }) }));
|
|
51
|
+
});
|
|
52
|
+
TextArea.displayName = 'TextArea';
|
|
53
|
+
|
|
54
|
+
export { TextArea };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { CategoryCard } from '../../cards/category-card/category-card.js';
|
|
4
|
+
import styles from './categories-grid.module.css.js';
|
|
5
|
+
|
|
6
|
+
function CategoriesGrid({ categories, onItemClick, }) {
|
|
7
|
+
return (jsx("div", { className: styles['categories-grid'], children: categories.map(category => (jsx("div", { className: styles['category'], children: jsx(CategoryCard, { className: styles['category-grid-card'], href: category.href, image: {
|
|
8
|
+
fit: 'contain',
|
|
9
|
+
image: category.image,
|
|
10
|
+
title: category.title,
|
|
11
|
+
}, onClick: onItemClick, title: category.title }, category.title) }, category.title))) }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { CategoriesGrid };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { createContext } from 'react';
|
|
4
|
+
import { AlgoliaSearchProvider } from '../../algolia/algolia-search-provider.js';
|
|
5
|
+
import { BackgroundOverlay } from '../../background-overlay/background-overlay.js';
|
|
6
|
+
import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
|
|
7
|
+
import styles from '../global-search.module.css.js';
|
|
8
|
+
|
|
9
|
+
const GlobalSearchDisclosureContext = createContext(null);
|
|
10
|
+
function GlobalSearchProvider({ children, searchClient, }) {
|
|
11
|
+
const { close, isOpen, open, toggle } = useDisclosure(false);
|
|
12
|
+
return (jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs(GlobalSearchDisclosureContext.Provider, { value: { close, isOpen, open, toggle }, children: [children, jsx(BackgroundOverlay, { className: styles['global-search-background-overlay-position'], isOpen: isOpen, onClose: close })] }) }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { GlobalSearchDisclosureContext, GlobalSearchProvider };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { GlobalSearchDisclosureContext } from './global-search-provider.js';
|
|
4
|
+
|
|
5
|
+
const useGlobalSearchDisclosure = () => {
|
|
6
|
+
const context = useContext(GlobalSearchDisclosureContext);
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw new Error('useGlobalSearchDisclosure must be used within a GlobalSearchDisclosureProvider');
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { useGlobalSearchDisclosure };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { Transition, TransitionGroup } from 'react-transition-group';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { useAlgoliaSearch } from '../algolia/use-algolia-search.js';
|
|
7
|
+
import { useOnNavigate } from '../shared/routing/route-provider.js';
|
|
8
|
+
import { useGlobalSearchDisclosure } from './global-search-provider/use-search-disclosure.js';
|
|
9
|
+
import { ConnectedSearchInput } from './search-input/connected-search-input.js';
|
|
10
|
+
import { SearchResultPanel } from './search-result-panel/search-result-panel.js';
|
|
11
|
+
import styles from './global-search.module.css.js';
|
|
12
|
+
|
|
13
|
+
function SearchRoot() {
|
|
14
|
+
const { autocomplete, inputRef } = useAlgoliaSearch();
|
|
15
|
+
const { isOpen } = useGlobalSearchDisclosure();
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (inputRef.current === null)
|
|
18
|
+
return;
|
|
19
|
+
if (isOpen) {
|
|
20
|
+
inputRef.current.focus();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
inputRef.current.blur();
|
|
24
|
+
}
|
|
25
|
+
}, [inputRef, isOpen]);
|
|
26
|
+
return (jsx("div", { className: styles['search-root'], children: jsx(Transition, { in: isOpen, nodeRef: inputRef, timeout: 300, children: transitionState => (jsxs("div", { className: clsx(styles['search-container'], styles[transitionState]), ...autocomplete.getRootProps({}), children: [jsx("div", { className: styles.input, children: jsx(ConnectedSearchInput, {}) }), jsx(SearchResultPanel, {})] })) }) }));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Global search using algolia autocomplete with a custom renderer
|
|
30
|
+
* https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer/
|
|
31
|
+
*
|
|
32
|
+
* Highly influenced by the two column layout sandbox which
|
|
33
|
+
* uses the autocomplete widgets
|
|
34
|
+
* https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/two-column-layout
|
|
35
|
+
*/
|
|
36
|
+
function GlobalSearch() {
|
|
37
|
+
const panelRef = useRef(null);
|
|
38
|
+
const { close, isOpen } = useGlobalSearchDisclosure();
|
|
39
|
+
useOnNavigate(close);
|
|
40
|
+
return (jsx(TransitionGroup, { children: jsx(Transition, { in: isOpen, nodeRef: panelRef, timeout: 300, children: state => (jsx("div", { ref: panelRef, className: state, children: jsx("div", { className: styles['search-wrapper'], children: jsx(SearchRoot, {}) }) })) }) }));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { GlobalSearch, SearchRoot };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"global-search-background-overlay-position":"global-search-module-T0bEf","search-wrapper":"global-search-module-d2g2F","search-root":"global-search-module-Sx8Lx","search-container":"global-search-module--orCF","input":"global-search-module-vXnL6","entering":"global-search-module-MYwlp","entered":"global-search-module-Jmt3c","exiting":"global-search-module-gQQfY","exited":"global-search-module-AABcw"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
|
|
3
|
+
const categoriesPlugin = ({ productsIndexName, searchClient, }) => {
|
|
4
|
+
return {
|
|
5
|
+
getSources() {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
getItemInputValue({ item }) {
|
|
9
|
+
return item.listCategories.at(-1) || '';
|
|
10
|
+
},
|
|
11
|
+
getItems({ query }) {
|
|
12
|
+
return getAlgoliaResults({
|
|
13
|
+
queries: [
|
|
14
|
+
{
|
|
15
|
+
indexName: productsIndexName,
|
|
16
|
+
params: {
|
|
17
|
+
hitsPerPage: 1,
|
|
18
|
+
},
|
|
19
|
+
query,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
searchClient,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
onSelect({ setIsOpen }) {
|
|
26
|
+
setIsOpen(true);
|
|
27
|
+
},
|
|
28
|
+
sourceId: 'categoriesPlugin',
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { categoriesPlugin };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
|
|
3
|
+
const popularCategoriesPlugin = ({ productsIndexName, searchClient, }) => {
|
|
4
|
+
return {
|
|
5
|
+
getSources() {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
getItems() {
|
|
9
|
+
return getAlgoliaResults({
|
|
10
|
+
queries: [
|
|
11
|
+
{
|
|
12
|
+
indexName: productsIndexName,
|
|
13
|
+
params: {
|
|
14
|
+
ruleContexts: ['no-results'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
searchClient,
|
|
19
|
+
transformResponse({ results }) {
|
|
20
|
+
return (results[0]?.userData?.[0]
|
|
21
|
+
?.noResultsCategories || []);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
sourceId: 'popularCategoriesPlugin',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { popularCategoriesPlugin };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
|
+
|
|
3
|
+
const popularSearchesPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
4
|
+
getSearchParams() {
|
|
5
|
+
return {
|
|
6
|
+
hitsPerPage: 4,
|
|
7
|
+
query: '',
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
indexName: suggestionsIndexName,
|
|
11
|
+
searchClient,
|
|
12
|
+
transformSource({ source }) {
|
|
13
|
+
return {
|
|
14
|
+
...source,
|
|
15
|
+
onSelect({ setIsOpen }) {
|
|
16
|
+
setIsOpen(true);
|
|
17
|
+
},
|
|
18
|
+
sourceId: 'popularSearchesPlugin',
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { popularSearchesPlugin };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
|
+
|
|
3
|
+
const querySuggestionsPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
4
|
+
getSearchParams({ state }) {
|
|
5
|
+
return {
|
|
6
|
+
hitsPerPage: state.query ? 10 : 0,
|
|
7
|
+
};
|
|
8
|
+
},
|
|
9
|
+
indexName: suggestionsIndexName,
|
|
10
|
+
searchClient,
|
|
11
|
+
transformSource({ source }) {
|
|
12
|
+
return {
|
|
13
|
+
...source,
|
|
14
|
+
onSelect({ setIsOpen }) {
|
|
15
|
+
setIsOpen(true);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { querySuggestionsPlugin };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
2
|
+
|
|
3
|
+
const quickAccessPlugin = ({ productsIndexName, searchClient, }) => {
|
|
4
|
+
return {
|
|
5
|
+
getSources({ query }) {
|
|
6
|
+
return [
|
|
7
|
+
{
|
|
8
|
+
getItems() {
|
|
9
|
+
return getAlgoliaResults({
|
|
10
|
+
queries: [
|
|
11
|
+
{
|
|
12
|
+
indexName: productsIndexName,
|
|
13
|
+
params: {
|
|
14
|
+
hitsPerPage: 0,
|
|
15
|
+
ruleContexts: ['quick-access'],
|
|
16
|
+
},
|
|
17
|
+
query,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
searchClient,
|
|
21
|
+
transformResponse({ results }) {
|
|
22
|
+
return (results[0]?.userData?.[0]
|
|
23
|
+
?.quickAccess || []);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
sourceId: 'quickAccessPlugin',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { quickAccessPlugin };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createLocalStorageRecentSearchesPlugin, search } from '@algolia/autocomplete-plugin-recent-searches';
|
|
2
|
+
|
|
3
|
+
const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({
|
|
4
|
+
key: 'recent-algolia-searches',
|
|
5
|
+
search(params) {
|
|
6
|
+
return search({ ...params, limit: params.query ? 1 : 4 });
|
|
7
|
+
},
|
|
8
|
+
transformSource({ onRemove, source }) {
|
|
9
|
+
return {
|
|
10
|
+
...source,
|
|
11
|
+
onRemove,
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { recentSearchesPlugin };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createElement, Fragment } from 'react';
|
|
2
|
+
import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
|
|
3
|
+
|
|
4
|
+
function Highlight({ attribute, hit, tagName = 'mark', }) {
|
|
5
|
+
return createElement(Fragment, {}, parseAlgoliaHitHighlight({ attribute, hit }).map(({ isHighlighted, value }, index) => {
|
|
6
|
+
if (isHighlighted) {
|
|
7
|
+
return createElement(tagName, { key: index }, value);
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Highlight };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useAlgoliaSearch } from '../../algolia/use-algolia-search.js';
|
|
4
|
+
import { useFormattedMessage } from '../../intl/use-formatted-message.js';
|
|
5
|
+
import { useNavigate } from '../../shared/routing/route-provider.js';
|
|
6
|
+
import { useGlobalSearchDisclosure } from '../global-search-provider/use-search-disclosure.js';
|
|
7
|
+
import { SearchInput } from './search-input.js';
|
|
8
|
+
|
|
9
|
+
function ConnectedSearchInput() {
|
|
10
|
+
const { autocomplete, formRef, inputRef } = useAlgoliaSearch();
|
|
11
|
+
const { close } = useGlobalSearchDisclosure();
|
|
12
|
+
const t = useFormattedMessage();
|
|
13
|
+
const navigate = useNavigate();
|
|
14
|
+
return (jsx(SearchInput, { autocomplete: autocomplete, formRef: formRef, inputRef: inputRef, onCancel: close, onSubmit: () => {
|
|
15
|
+
if (!inputRef.current?.value)
|
|
16
|
+
return;
|
|
17
|
+
navigate(`/search?keyword=${encodeURIComponent(inputRef.current.value)}`);
|
|
18
|
+
return close();
|
|
19
|
+
}, placeholder: t('What are you searching for?') }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { ConnectedSearchInput };
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { SolidCloseIcon } from '../../icons/solid/solid-close-icon.js';
|
|
6
|
+
import { StrokeSearchIcon } from '../../icons/stroke/stroke-search-icon.js';
|
|
7
|
+
import styles from './search-input.module.css.js';
|
|
8
|
+
|
|
9
|
+
function SearchInput({ autocomplete, formRef, inputRef, onCancel, onSubmit, placeholder, }) {
|
|
10
|
+
const formProps = autocomplete?.getFormProps({
|
|
11
|
+
inputElement: inputRef.current,
|
|
12
|
+
});
|
|
13
|
+
const inputProps = autocomplete?.getInputProps({
|
|
14
|
+
inputElement: inputRef.current,
|
|
15
|
+
});
|
|
16
|
+
const labelProps = autocomplete?.getLabelProps({});
|
|
17
|
+
function handleSubmit(e) {
|
|
18
|
+
if (!inputProps?.value)
|
|
19
|
+
return;
|
|
20
|
+
formProps?.onSubmit(e);
|
|
21
|
+
onSubmit?.();
|
|
22
|
+
}
|
|
23
|
+
return (jsx("form", { ref: formRef, className: styles.form, ...formProps, onSubmit: handleSubmit, children: jsxs("div", { className: styles['input-container'], children: [jsx("label", { className: styles.label, htmlFor: "search", ...labelProps, children: jsx(StrokeSearchIcon, { className: clsx(styles['icon-search'], styles.icon) }) }), jsx("input", { ref: inputRef, name: "search", onKeyUp: e => {
|
|
24
|
+
if (e.key === 'Escape')
|
|
25
|
+
onCancel?.();
|
|
26
|
+
}, ...inputProps, className: styles.input, placeholder: placeholder }), inputProps?.value && (jsx(IconButton, { className: styles['reset-btn'], color: "secondary", onClick: () => formRef.current?.reset(), type: "reset", children: jsx(SolidCloseIcon, {}) }))] }) }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { SearchInput };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"form":"search-input-module-xCCzd","input-container":"search-input-module-okP8k","icon":"search-input-module-GZbhK","label":"search-input-module-vKCm4","reset-btn":"search-input-module-lYseZ","input":"search-input-module-bELFK"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useAlgoliaSearch } from '../../algolia/use-algolia-search.js';
|
|
4
|
+
import { NoSearch } from './sections/no-search.js';
|
|
5
|
+
import { NoSearchResults } from './sections/no-search-results.js';
|
|
6
|
+
import { WithResults } from './sections/with-results.js';
|
|
7
|
+
|
|
8
|
+
function PanelContent() {
|
|
9
|
+
const { hasResults, state } = useAlgoliaSearch();
|
|
10
|
+
return (jsx(Fragment, { children: state.query.length === 0 ? (jsx(NoSearch, {})) : hasResults ? (jsx(WithResults, {})) : (jsx(NoSearchResults, {})) }));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { PanelContent };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Transition } from 'react-transition-group';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useAlgoliaSearch } from '../../algolia/use-algolia-search.js';
|
|
6
|
+
import { useGlobalSearchDisclosure } from '../global-search-provider/use-search-disclosure.js';
|
|
7
|
+
import { PanelContent } from './panel-content.js';
|
|
8
|
+
import styles from './search-result-panel.module.css.js';
|
|
9
|
+
|
|
10
|
+
function SearchResultPanel() {
|
|
11
|
+
const { autocomplete, panelRef } = useAlgoliaSearch();
|
|
12
|
+
const { isOpen } = useGlobalSearchDisclosure();
|
|
13
|
+
// https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer/#check-network-status
|
|
14
|
+
return (jsx(Transition, { in: isOpen, nodeRef: panelRef, timeout: 300, children: transitionState => (jsx("div", { ref: panelRef, className: clsx(styles['search-result-panel'], styles[transitionState]), ...autocomplete.getPanelProps({}), children: jsx(PanelContent, {}) })) }));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { SearchResultPanel };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"search-result-panel":"search-result-panel-module-KBrc9","entering":"search-result-panel-module-Us8rb","entered":"search-result-panel-module-7UxfH","exiting":"search-result-panel-module-3xEiy","exited":"search-result-panel-module-xSeC-"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useAlgoliaSearch } from '../../../algolia/use-algolia-search.js';
|
|
4
|
+
import { FormattedMessage } from '../../../intl/formatted-message.js';
|
|
5
|
+
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
6
|
+
import { CategoriesGrid } from '../../categories-grid/categories-grid.js';
|
|
7
|
+
import { useGlobalSearchDisclosure } from '../../global-search-provider/use-search-disclosure.js';
|
|
8
|
+
import { SearchSection } from '../../search-section/search-section.js';
|
|
9
|
+
import { SectionContainer } from './section-container.js';
|
|
10
|
+
import styles from './search-content.module.css.js';
|
|
11
|
+
|
|
12
|
+
function NoSearchResults() {
|
|
13
|
+
return (jsx(Fragment, { children: jsx(SectionContainer, { leftContent: jsx(NotFound, {}), rightContent: jsx(PopularCategoriesSection, {}) }) }));
|
|
14
|
+
}
|
|
15
|
+
function NotFound() {
|
|
16
|
+
const { state } = useAlgoliaSearch();
|
|
17
|
+
const t = useFormattedMessage();
|
|
18
|
+
return (jsx(SearchSection, { title: t('Sorry, we could not find matches for'), children: jsx("div", { className: styles['no-results-text'], children: jsxs("div", { className: styles.section, children: [jsxs("p", { className: styles.query, children: ["'", state.query, "'"] }), jsxs("div", { className: styles.suggestions, children: [jsx("p", { children: jsx(FormattedMessage, { id: "You could try" }) }), jsxs("ul", { className: styles.list, children: [jsx("li", { children: jsx(FormattedMessage, { id: "Searching again using more general terms" }) }), jsx("li", { children: jsx(FormattedMessage, { id: "Double check your spelling" }) }), jsx("li", { children: jsx(FormattedMessage, { id: "Use fewer keywords" }) }), jsx("li", { children: jsx(FormattedMessage, { id: "Exploring our products by category" }) })] })] })] }) }) }));
|
|
19
|
+
}
|
|
20
|
+
function PopularCategoriesSection() {
|
|
21
|
+
const { popularCategories: collection } = useAlgoliaSearch();
|
|
22
|
+
const t = useFormattedMessage();
|
|
23
|
+
const { close } = useGlobalSearchDisclosure();
|
|
24
|
+
if (!collection)
|
|
25
|
+
return null;
|
|
26
|
+
const { items } = collection;
|
|
27
|
+
return (jsx(SearchSection, { title: t('Explore by categories'), children: jsx("div", { className: styles['categories-grid-container'], children: jsx(CategoriesGrid, { categories: items, onItemClick: close }) }) }));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { NoSearchResults };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useAlgoliaSearch } from '../../../algolia/use-algolia-search.js';
|
|
4
|
+
import { CardCarousel } from '../../../carousel/card-carousel/card-carousel.js';
|
|
5
|
+
import { StrokeSearchIcon } from '../../../icons/stroke/stroke-search-icon.js';
|
|
6
|
+
import { FormattedMessage } from '../../../intl/formatted-message.js';
|
|
7
|
+
import { useFormattedMessage } from '../../../intl/use-formatted-message.js';
|
|
8
|
+
import { PromoCard } from '../../../promos/promo-card/promo-card.js';
|
|
9
|
+
import { RouteLink } from '../../../shared/routing/route-link.js';
|
|
10
|
+
import { useGlobalSearchDisclosure } from '../../global-search-provider/use-search-disclosure.js';
|
|
11
|
+
import { Highlight } from '../../search-highlight/highlight.js';
|
|
12
|
+
import { SearchList } from '../../search-section/search-list.js';
|
|
13
|
+
import { SearchListItem } from '../../search-section/search-list-item.js';
|
|
14
|
+
import { SearchSection } from '../../search-section/search-section.js';
|
|
15
|
+
import { SectionContainer } from './section-container.js';
|
|
16
|
+
import styles from './search-content.module.css.js';
|
|
17
|
+
|
|
18
|
+
function NoSearch() {
|
|
19
|
+
return (jsx(SectionContainer, { leftContent: jsxs("div", { children: [jsx(RecentSearchesSection, {}), jsx(PopularSearchesSection, {})] }), rightContent: jsx(QuickAccessSection, {}) }));
|
|
20
|
+
}
|
|
21
|
+
function PopularSearchesSection() {
|
|
22
|
+
const { autocomplete, popularSearches: collection } = useAlgoliaSearch();
|
|
23
|
+
const t = useFormattedMessage();
|
|
24
|
+
if (!collection)
|
|
25
|
+
return null;
|
|
26
|
+
const { items, source } = collection;
|
|
27
|
+
return (jsx(SearchSection, { title: t('Popular searches'), children: jsx(SearchList, { ...autocomplete.getListProps({
|
|
28
|
+
source,
|
|
29
|
+
}), children: items.slice(0, 4).map(item => (jsx(SearchListItem, { ...autocomplete.getItemProps({
|
|
30
|
+
item,
|
|
31
|
+
source: source,
|
|
32
|
+
}), icon: jsx(StrokeSearchIcon, {}), text: jsx(Highlight, { attribute: "query", hit: item }) }, item.objectID))) }) }));
|
|
33
|
+
}
|
|
34
|
+
function RecentSearchesSection() {
|
|
35
|
+
const { autocomplete, recentSearches: collection } = useAlgoliaSearch();
|
|
36
|
+
const t = useFormattedMessage();
|
|
37
|
+
if (!collection) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const { items, source } = collection;
|
|
41
|
+
return (jsx(SearchSection, { button: jsx(RouteLink, { hasUnderline: true, onClick: () => items.forEach(item => source.onRemove(item.id)), children: jsx(FormattedMessage, { id: "Clear" }) }), title: t('Recent searches'), children: jsx(SearchList, { ...autocomplete.getListProps({ source }), children: items.map(item => (jsx(SearchListItem, { ...autocomplete.getItemProps({
|
|
42
|
+
item,
|
|
43
|
+
source: source,
|
|
44
|
+
}), icon: jsx(StrokeSearchIcon, {}), isRemovable: true, onRemove: () => source.onRemove(item.id), text: jsx(Highlight, { attribute: "label", hit: item }) }, item.id))) }) }));
|
|
45
|
+
}
|
|
46
|
+
function QuickAccessSection() {
|
|
47
|
+
const { quickAccess: collection } = useAlgoliaSearch();
|
|
48
|
+
const { close } = useGlobalSearchDisclosure();
|
|
49
|
+
const t = useFormattedMessage();
|
|
50
|
+
if (!collection)
|
|
51
|
+
return;
|
|
52
|
+
const { items } = collection;
|
|
53
|
+
return (jsx(SearchSection, { headerClassName: styles['quick-access-section-header'], title: t('Quick access'), children: jsx("div", { className: styles['product-results'], children: jsx(CardCarousel, { cards: items.map((item, index) => (jsx(PromoCard, { href: item.action.url, image: item.image, onClick: close }, `${index}-${item.action.url}`))), cardsPerView: "auto", cardWidth: "narrow" }) }) }));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { NoSearch };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var styles = {"section-container":"search-content-module-ZMwlB","content":"search-content-module-KIok6","left":"search-content-module-YRLIf","right":"search-content-module-qK5sg","button-container":"search-content-module-w-ORq","show-all-button":"search-content-module-bO1Q0","product-results":"search-content-module-bcFCH","quick-access-section-header":"search-content-module-HrHCE","product-results-section-header":"search-content-module-9bgxF","no-results-text":"search-content-module-H-FX2","query":"search-content-module-LbQnK","suggestions":"search-content-module-mhiBZ","list":"search-content-module-coPAt"};
|
|
2
|
+
|
|
3
|
+
export { styles as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './search-content.module.css.js';
|
|
3
|
+
|
|
4
|
+
function SectionContainer({ buttons, leftContent, rightContent, }) {
|
|
5
|
+
return (jsx("div", { className: styles['section-container'], children: jsxs("div", { className: styles['content'], children: [jsx("div", { className: styles['left'], children: leftContent }), jsxs("div", { className: styles['right'], children: [rightContent, jsx("div", { className: styles['button-container'], children: buttons })] })] }) }));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { SectionContainer };
|