@sonic-equipment/ui 141.0.0 → 142.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.
Files changed (140) hide show
  1. package/dist/address-info-display/address-info-display.d.ts +6 -0
  2. package/dist/{address/address.js → address-info-display/address-info-display.js} +3 -3
  3. package/dist/address-info-display/address-info-display.module.css.js +3 -0
  4. package/dist/algolia/algolia-filter-panel.js +2 -2
  5. package/dist/algolia/algolia-search-provider.js +22 -11
  6. package/dist/background-overlay/background-overlay.js +4 -7
  7. package/dist/badges/badge/badge.js +4 -8
  8. package/dist/base.css +2 -0
  9. package/dist/breadcrumbs/breadcrumb.js +4 -4
  10. package/dist/buttons/add-to-cart-button/add-to-cart-button.js +27 -40
  11. package/dist/buttons/add-to-cart-button/connected-add-to-cart-button.js +19 -2
  12. package/dist/buttons/favorite/connected-favorite-button.js +12 -18
  13. package/dist/buttons/favorite/favorite-button.d.ts +1 -1
  14. package/dist/buttons/icon-button/icon-button.d.ts +4 -2
  15. package/dist/buttons/icon-button/icon-button.js +5 -2
  16. package/dist/buttons/link/link.d.ts +12 -5
  17. package/dist/buttons/link/link.js +10 -4
  18. package/dist/carousel/card-carousel/card-carousel.js +3 -2
  19. package/dist/carousel/carousel-navigation-button.js +1 -1
  20. package/dist/carousel/carousel.js +8 -8
  21. package/dist/carousel/pagination/pagination.d.ts +1 -1
  22. package/dist/carousel/usp-carousel/product-usp-carousel-slide.js +3 -1
  23. package/dist/carousel/usp-carousel/product-usp-carousel.js +1 -1
  24. package/dist/carousel/usp-carousel/usp-carousel.js +3 -1
  25. package/dist/country-select/country-select.d.ts +27 -0
  26. package/dist/{country-selector/country-select → country-select}/country-select.js +7 -4
  27. package/dist/country-select/hooks/use-countries.d.ts +12 -0
  28. package/dist/country-select/hooks/use-countries.js +51 -0
  29. package/dist/country-selector/country-selector-dialog/country-selector-dialog.js +11 -9
  30. package/dist/country-selector/country-selector-trigger/country-selector-trigger.d.ts +1 -1
  31. package/dist/country-selector/use-countries-languages.d.ts +3 -3
  32. package/dist/country-selector/use-countries-languages.js +3 -1
  33. package/dist/exports.d.ts +12 -4
  34. package/dist/filters/active-filters/active-filters.d.ts +1 -1
  35. package/dist/forms/number-field/number-field.js +5 -1
  36. package/dist/forms/select/select.js +3 -2
  37. package/dist/forms/textarea/textarea.js +1 -1
  38. package/dist/global-search/global-search-provider/global-search-provider.js +3 -2
  39. package/dist/global-search/search-highlight/highlight.js +1 -0
  40. package/dist/global-search/search-result-panel/sections/no-search.js +3 -1
  41. package/dist/header/header.d.ts +5 -1
  42. package/dist/header/header.js +5 -2
  43. package/dist/header/link-list/navigation-link-list.d.ts +6 -0
  44. package/dist/header/link-list/navigation-link-list.js +15 -0
  45. package/dist/header/link-list/navigation-link-list.module.css.js +3 -0
  46. package/dist/index.js +15 -7
  47. package/dist/info-icon-tooltip/info-icon-tooltip.d.ts +3 -1
  48. package/dist/info-icon-tooltip/info-icon-tooltip.js +5 -5
  49. package/dist/intl/intl-context.js +2 -1
  50. package/dist/intl/intl-provider.js +7 -6
  51. package/dist/intl/missing-translation-provider.js +6 -5
  52. package/dist/intl/translation-id.d.ts +1 -1
  53. package/dist/lists/feature-list/feature-list.js +3 -1
  54. package/dist/lists/orderline-list/orderline-list.d.ts +1 -1
  55. package/dist/lists/orderline-list/orderline-list.js +6 -1
  56. package/dist/lists/product-overview-grid/product-overview-grid.js +5 -1
  57. package/dist/media/image/image.d.ts +1 -1
  58. package/dist/media/image-lightbox/image-lightbox.js +6 -2
  59. package/dist/media/zoom-image/zoom-image.d.ts +1 -1
  60. package/dist/message/message.d.ts +2 -1
  61. package/dist/message/message.js +2 -2
  62. package/dist/modals/favorite/add-to-favorite-dialog.d.ts +1 -1
  63. package/dist/modals/modal/modal.js +2 -1
  64. package/dist/notifications/announcements/connected-announcement.js +1 -1
  65. package/dist/pages/checkout/components/billing-and-invoice-information.js +2 -2
  66. package/dist/pages/checkout/layouts/checkout-page-layout/checkout-page-layout.js +3 -1
  67. package/dist/pages/checkout/payment-page/components/payment.js +1 -2
  68. package/dist/pages/checkout/shipping-page/components/currency-change-dialog.d.ts +6 -0
  69. package/dist/pages/checkout/shipping-page/components/currency-change-dialog.js +13 -0
  70. package/dist/pages/checkout/shipping-page/components/edit-address-form.d.ts +12 -10
  71. package/dist/pages/checkout/shipping-page/components/edit-address-form.js +11 -4
  72. package/dist/pages/checkout/shipping-page/components/edit-address-form.module.css.js +1 -1
  73. package/dist/pages/checkout/shipping-page/components/readonly-address.d.ts +2 -2
  74. package/dist/pages/checkout/shipping-page/components/readonly-address.js +6 -4
  75. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.d.ts +4 -4
  76. package/dist/pages/checkout/shipping-page/hooks/use-patch-shipping-details.js +8 -4
  77. package/dist/pages/checkout/shipping-page/shipping-page.js +68 -17
  78. package/dist/pages/components/page-container/page-container.js +2 -1
  79. package/dist/pages/error-page/error-page.js +4 -1
  80. package/dist/pages/product/product-details-page/components/product-details-panel/product-details-panel.js +3 -1
  81. package/dist/pages/product/product-listing-page/no-results/no-results.js +3 -3
  82. package/dist/pages/product/product-listing-page/product-listing-page-category-carousel/product-listing-page-category-carousel.js +1 -1
  83. package/dist/pages/product/product-listing-page/product-listing-page-provider/product-listing-page-provider.js +3 -2
  84. package/dist/pages/product/search-result-page/search-results-page-category-carousel/search-results-page-category-carousel.js +1 -1
  85. package/dist/promos/promo-banners/promo-banners.d.ts +6 -5
  86. package/dist/promos/promo-banners/promo-banners.js +6 -5
  87. package/dist/promos/promo-card/promo-card.d.ts +1 -1
  88. package/dist/shared/api/bff/model/bff.model.d.ts +13 -0
  89. package/dist/shared/api/storefront/hooks/cart/use-delete-cart-line-by-id.d.ts +2 -2
  90. package/dist/shared/api/storefront/hooks/cart/use-delete-current-cart.d.ts +2 -2
  91. package/dist/shared/api/storefront/hooks/cart/use-save-cart-for-later.d.ts +2 -2
  92. package/dist/shared/api/storefront/hooks/customer/use-patch-bill-to-address.d.ts +1 -1
  93. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.d.ts +4 -2
  94. package/dist/shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js +3 -2
  95. package/dist/shared/api/storefront/hooks/website/{use-fetch-countries.d.ts → use-fetch-country-models.d.ts} +1 -1
  96. package/dist/shared/api/storefront/hooks/website/use-fetch-country-models.js +16 -0
  97. package/dist/shared/api/storefront/model/storefront.model.d.ts +21 -1
  98. package/dist/shared/api/storefront/services/customer-service.d.ts +3 -3
  99. package/dist/shared/api/storefront/services/customer-service.js +1 -1
  100. package/dist/shared/api/storefront/services/website-service.d.ts +1 -3
  101. package/dist/shared/api/storefront/services/website-service.js +4 -45
  102. package/dist/shared/data/cart.data.d.ts +2 -0
  103. package/dist/shared/data/cart.data.js +650 -0
  104. package/dist/shared/data/countries-languages.data.d.ts +11 -0
  105. package/dist/shared/data/countries-languages.data.js +61 -0
  106. package/dist/shared/hooks/use-breakpoint.js +2 -2
  107. package/dist/shared/hooks/use-cookie.d.ts +1 -0
  108. package/dist/shared/hooks/use-cookie.js +13 -7
  109. package/dist/shared/hooks/use-disclosure.d.ts +3 -3
  110. package/dist/shared/hooks/use-is-breakpoint.js +1 -1
  111. package/dist/shared/hooks/use-is-scrolled-beyond-element.d.ts +1 -0
  112. package/dist/shared/hooks/use-is-scrolled-beyond-element.js +26 -0
  113. package/dist/shared/hooks/use-scroll-to.d.ts +1 -1
  114. package/dist/shared/hooks/use-scroll-to.js +2 -2
  115. package/dist/shared/model/countries-languages.d.ts +3 -1
  116. package/dist/shared/model/countries-languages.js +32 -0
  117. package/dist/shared/model/defaults.d.ts +1 -0
  118. package/dist/shared/model/defaults.js +3 -0
  119. package/dist/shared/model/image.d.ts +1 -1
  120. package/dist/shared/model/link.d.ts +15 -0
  121. package/dist/shared/providers/favorite-provider.d.ts +3 -3
  122. package/dist/shared/providers/global-state-provider.js +2 -1
  123. package/dist/shared/reset.module.css.js +3 -0
  124. package/dist/shared/routing/with-routing.js +1 -0
  125. package/dist/shared/utils/local-storage.d.ts +1 -7
  126. package/dist/shared/utils/local-storage.js +4 -4
  127. package/dist/shared/utils/number.d.ts +1 -0
  128. package/dist/shared/utils/number.js +10 -0
  129. package/dist/sidebar/sidebar-provider.js +4 -1
  130. package/dist/sidebar/use-sidebar.js +4 -3
  131. package/dist/sign-in-form/sign-in-form.js +2 -1
  132. package/dist/styles.css +68 -5
  133. package/dist/tooltip/tooltip.js +6 -3
  134. package/package.json +17 -14
  135. package/dist/address/address.d.ts +0 -6
  136. package/dist/address/address.module.css.js +0 -3
  137. package/dist/country-selector/country-select/country-select.d.ts +0 -27
  138. package/dist/shared/api/storefront/hooks/website/use-fetch-countries.js +0 -15
  139. package/dist/shared/model/countries.d.ts +0 -225
  140. package/dist/shared/model/countries.js +0 -260
@@ -0,0 +1,27 @@
1
+ import { Country } from '../shared/model/countries-languages';
2
+ interface CountrySelectProps<T extends Country> {
3
+ countries: T[];
4
+ countryNameInLanguageOfCountry?: boolean;
5
+ 'data-test-selector'?: string;
6
+ isDisabled?: boolean;
7
+ isRequired?: boolean;
8
+ name?: string;
9
+ showLabel?: boolean;
10
+ }
11
+ interface CountrySelectPropsWithDefaultSelectedCountry<T extends Country> extends CountrySelectProps<T> {
12
+ defaultSelectedCountry: T;
13
+ onCountryChange?: (country: T) => void;
14
+ }
15
+ interface CountrySelectPropsWithSelectedCountry<T extends Country> extends CountrySelectProps<T> {
16
+ onCountryChange?: (country: T) => void;
17
+ selectedCountry: T;
18
+ }
19
+ interface CountrySelectPropsWithoutSelectedCountry<T extends Country> extends CountrySelectProps<T> {
20
+ defaultSelectedCountry?: T | undefined;
21
+ onCountryChange?: (country: T | undefined) => void;
22
+ selectedCountry?: T | undefined;
23
+ }
24
+ export declare function CountrySelect<T extends Country>(props: CountrySelectPropsWithDefaultSelectedCountry<T>): JSX.Element;
25
+ export declare function CountrySelect<T extends Country>(props: CountrySelectPropsWithSelectedCountry<T>): JSX.Element;
26
+ export declare function CountrySelect<T extends Country>(props: CountrySelectPropsWithoutSelectedCountry<T>): JSX.Element;
27
+ export {};
@@ -1,14 +1,17 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useMemo } from 'react';
3
- import { Select } from '../../forms/select/select.js';
4
- import { useFormattedMessage } from '../../intl/use-formatted-message.js';
3
+ import { Select } from '../forms/select/select.js';
4
+ import { useFormattedMessage } from '../intl/use-formatted-message.js';
5
5
 
6
- function CountrySelect({ countries, 'data-test-selector': dataTestSelector, defaultSelectedCountry, isDisabled, isRequired, name, onCountryChange, selectedCountry, showLabel = true, }) {
6
+ function CountrySelect({ countries, countryNameInLanguageOfCountry = false, 'data-test-selector': dataTestSelector, defaultSelectedCountry, isDisabled, isRequired, name, onCountryChange, selectedCountry, showLabel = true, }) {
7
7
  const t = useFormattedMessage();
8
+ const translationPrefix = countryNameInLanguageOfCountry
9
+ ? 'clSelector'
10
+ : 'country';
8
11
  const countryOptions = useMemo(() => countries
9
12
  .map((country) => [
10
13
  country.id,
11
- t(`clSelector.${country.abbreviation}`),
14
+ t(`${translationPrefix}.${country.abbreviation}`),
12
15
  ])
13
16
  .sort(([, labelA], [, labelB]) => labelA.localeCompare(labelB))
14
17
  .reduce((acc, [id, label]) => ({
@@ -0,0 +1,12 @@
1
+ import { Country } from '../../shared/model/countries-languages';
2
+ interface UseCountriesArgs {
3
+ enabled?: boolean;
4
+ }
5
+ interface UseCountriesReturnType {
6
+ countries: Country[] | undefined;
7
+ currentCountry: Country | undefined;
8
+ error: unknown;
9
+ isFetching: boolean;
10
+ }
11
+ export declare function useCountries({ enabled, }: UseCountriesArgs): UseCountriesReturnType;
12
+ export {};
@@ -0,0 +1,51 @@
1
+ import { useMemo } from 'react';
2
+ import { isCountryCode, isCultureCode, isLanguageCode } from '../../intl/types.js';
3
+ import { useFetchCountriesWithLanguages } from '../../shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js';
4
+ import { useCookie } from '../../shared/hooks/use-cookie.js';
5
+ import { useSessionStorage } from '../../shared/hooks/use-session-storage.js';
6
+
7
+ function useCountries({ enabled = true, }) {
8
+ const [sessionCountries, setSessionCountries] = useSessionStorage('countries-v1');
9
+ const [currentCountryId] = useCookie('CurrentCountryId');
10
+ const { data: apiCountries, error, isFetching, } = useFetchCountriesWithLanguages({
11
+ enabled: !sessionCountries && enabled,
12
+ });
13
+ const countries = useMemo(() => {
14
+ if (sessionCountries)
15
+ return sessionCountries;
16
+ const countries = apiCountries?.map((country) => {
17
+ if (!isCountryCode(country.abbreviation))
18
+ throw new Error(`Invalid country code: ${country.abbreviation}`);
19
+ return {
20
+ abbreviation: country.abbreviation,
21
+ currencyCode: country.currencyCode,
22
+ id: country.id,
23
+ languages: country.languages.map((language) => {
24
+ if (!isCultureCode(language.cultureCode))
25
+ throw new Error(`Invalid culture code: ${language.cultureCode}`);
26
+ if (!isLanguageCode(language.languageCode))
27
+ throw new Error(`Invalid language code: ${language.languageCode}`);
28
+ return {
29
+ cultureCode: language.cultureCode,
30
+ description: language.description,
31
+ id: language.id,
32
+ languageCode: language.languageCode,
33
+ };
34
+ }),
35
+ name: country.name,
36
+ };
37
+ });
38
+ return countries;
39
+ }, [apiCountries, sessionCountries]);
40
+ if (countries !== sessionCountries)
41
+ setSessionCountries(countries);
42
+ const currentCountry = countries?.find(country => country.id === currentCountryId);
43
+ return {
44
+ countries,
45
+ currentCountry,
46
+ error,
47
+ isFetching,
48
+ };
49
+ }
50
+
51
+ export { useCountries };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useState, useMemo, useEffect } from 'react';
3
+ import { useState, useMemo, useCallback } from 'react';
4
4
  import { Button } from '../../buttons/button/button.js';
5
+ import { CountrySelect } from '../../country-select/country-select.js';
5
6
  import { Select } from '../../forms/select/select.js';
6
7
  import { FormattedMessage } from '../../intl/formatted-message.js';
7
8
  import { useFormattedMessage } from '../../intl/use-formatted-message.js';
8
9
  import { Dialog } from '../../modals/dialog/dialog.js';
9
- import { CountrySelect } from '../country-select/country-select.js';
10
10
  import styles from './country-selector-dialog.module.css.js';
11
11
 
12
12
  function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange, onSubmit, selectedCountry, selectedLanguage, showCountry = true, }) {
@@ -14,15 +14,17 @@ function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange,
14
14
  const [currentCountry, setCurrentCountry] = useState(selectedCountry);
15
15
  const [currentLanguage, setCurrentLanguage] = useState(selectedLanguage);
16
16
  const languageOptions = useMemo(() => currentCountry.languages.reduce((acc, language) => ({ ...acc, [language.id]: language.description }), {}), [currentCountry]);
17
- useEffect(() => {
18
- if (currentCountry.languages.some(language => language.id === currentLanguage.id))
17
+ const onCountryChange = useCallback((country) => {
18
+ setCurrentCountry(country);
19
+ /* Check if the current language is available in the selected country */
20
+ if (country.languages.some(language => language.id === currentLanguage.id))
19
21
  return;
20
- const fallbackLanguage = currentCountry.languages[0];
22
+ /* When the current language is not available, select the first language of the selected country */
23
+ const fallbackLanguage = country.languages[0];
21
24
  if (!fallbackLanguage)
22
- throw new Error(`Country ${currentCountry.name} has no languages to select`);
25
+ throw new Error(`Country ${country.name} has no languages to select`);
23
26
  setCurrentLanguage(fallbackLanguage);
24
- // eslint-disable-next-line react-hooks/exhaustive-deps
25
- }, [currentCountry]);
27
+ }, [currentLanguage.id]);
26
28
  return (jsx(Dialog, { hideTitle: true, allowClose: isDismissable, className: {
27
29
  dialog: styles['country-selector-dialog'],
28
30
  modal: styles.modal,
@@ -30,7 +32,7 @@ function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange,
30
32
  onSubmit({ country: currentCountry, language: currentLanguage });
31
33
  e.preventDefault();
32
34
  e.stopPropagation();
33
- }, shouldCloseOnInteractOutside: isDismissable, title: "Country Selector", children: jsxs("div", { className: styles.content, children: [jsx("svg", { className: styles.logo, height: "32", viewBox: "0 0 134 32", width: "134", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { fill: "none", fillRule: "evenodd", children: [jsx("path", { d: "M15.83 11.533c2.42 0 4.382 1.977 4.382 4.415 0 8.794-7.1 15.95-15.83 15.95C1.963 31.897 0 29.92 0 27.481c0-2.354 1.83-4.278 4.134-4.408l.249-.007c3.797 0 6.905-3.036 7.058-6.826l.006-.293c0-2.438 1.963-4.415 4.383-4.415zM15.83 0c2.42 0 4.383 1.977 4.383 4.415 0 2.355-1.83 4.279-4.134 4.409l-.249.007c-3.8 0-6.906 3.035-7.059 6.824l-.006.293c0 2.438-1.962 4.415-4.382 4.415S0 18.386 0 15.948C0 7.154 7.101 0 15.83 0zm8.208 16.022c0 8.794 7.101 15.95 15.83 15.95s15.83-7.156 15.83-15.95S48.597.074 39.868.074s-15.83 7.154-15.83 15.948zm8.765 0c0-3.924 3.169-7.118 7.065-7.118 3.895 0 7.065 3.194 7.065 7.118 0 3.926-3.17 7.119-7.065 7.119-3.896 0-7.065-3.193-7.065-7.12zm76.888-11.276c-6.173 6.217-6.173 16.335-.002 22.553 6.173 6.217 16.215 6.217 22.388 0a4.44 4.44 0 0 0 .001-6.244 4.359 4.359 0 0 0-6.003-.184l-.194.184a7.04 7.04 0 0 1-9.994 0c-2.753-2.775-2.753-7.29.002-10.065a7.036 7.036 0 0 1 9.751-.233l.24.231a4.36 4.36 0 0 0 6.198 0 4.44 4.44 0 0 0-.001-6.245c-6.173-6.217-16.215-6.216-22.386.003zm-17.162-.174v22.863c0 2.439 1.961 4.416 4.381 4.416 2.422 0 4.384-1.977 4.384-4.416V4.572c0-2.439-1.962-4.416-4.384-4.416-2.42 0-4.38 1.977-4.38 4.416zM64.1.1c-2.42 0-4.383 1.977-4.383 4.415v23.07c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V8.93h3.933c3.895 0 7.065 3.192 7.065 7.118v11.537c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V16.048C88.244 7.254 81.143.1 72.414.1h-8.316z", fill: "#000" }), jsx("path", { d: "M47.036 16.022c0 3.99-3.209 7.222-7.168 7.222-3.96 0-7.169-3.233-7.169-7.222 0-3.989 3.21-7.222 7.169-7.222 3.96 0 7.168 3.233 7.168 7.222", fill: "#E30613" })] }) }), jsx("p", { className: styles.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles.selects, children: [showCountry && (jsx(CountrySelect, { countries: countries, "data-test-selector": "clSelector_country", onCountryChange: setCurrentCountry, selectedCountry: currentCountry })), jsx(Select, { "data-test-selector": "clSelector_language", label: t('Language'), onChange: value => setCurrentLanguage(currentCountry.languages.find(language => language.id === value) || currentLanguage), options: languageOptions, selectedOption: currentLanguage.id, showPlaceholder: false, variant: "solid" })] })] }) }));
35
+ }, shouldCloseOnInteractOutside: isDismissable, title: "Country Selector", children: jsxs("div", { className: styles.content, children: [jsx("svg", { className: styles.logo, height: "32", viewBox: "0 0 134 32", width: "134", xmlns: "http://www.w3.org/2000/svg", children: jsxs("g", { fill: "none", fillRule: "evenodd", children: [jsx("path", { d: "M15.83 11.533c2.42 0 4.382 1.977 4.382 4.415 0 8.794-7.1 15.95-15.83 15.95C1.963 31.897 0 29.92 0 27.481c0-2.354 1.83-4.278 4.134-4.408l.249-.007c3.797 0 6.905-3.036 7.058-6.826l.006-.293c0-2.438 1.963-4.415 4.383-4.415zM15.83 0c2.42 0 4.383 1.977 4.383 4.415 0 2.355-1.83 4.279-4.134 4.409l-.249.007c-3.8 0-6.906 3.035-7.059 6.824l-.006.293c0 2.438-1.962 4.415-4.382 4.415S0 18.386 0 15.948C0 7.154 7.101 0 15.83 0zm8.208 16.022c0 8.794 7.101 15.95 15.83 15.95s15.83-7.156 15.83-15.95S48.597.074 39.868.074s-15.83 7.154-15.83 15.948zm8.765 0c0-3.924 3.169-7.118 7.065-7.118 3.895 0 7.065 3.194 7.065 7.118 0 3.926-3.17 7.119-7.065 7.119-3.896 0-7.065-3.193-7.065-7.12zm76.888-11.276c-6.173 6.217-6.173 16.335-.002 22.553 6.173 6.217 16.215 6.217 22.388 0a4.44 4.44 0 0 0 .001-6.244 4.359 4.359 0 0 0-6.003-.184l-.194.184a7.04 7.04 0 0 1-9.994 0c-2.753-2.775-2.753-7.29.002-10.065a7.036 7.036 0 0 1 9.751-.233l.24.231a4.36 4.36 0 0 0 6.198 0 4.44 4.44 0 0 0-.001-6.245c-6.173-6.217-16.215-6.216-22.386.003zm-17.162-.174v22.863c0 2.439 1.961 4.416 4.381 4.416 2.422 0 4.384-1.977 4.384-4.416V4.572c0-2.439-1.962-4.416-4.384-4.416-2.42 0-4.38 1.977-4.38 4.416zM64.1.1c-2.42 0-4.383 1.977-4.383 4.415v23.07c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V8.93h3.933c3.895 0 7.065 3.192 7.065 7.118v11.537c0 2.438 1.962 4.415 4.382 4.415s4.383-1.977 4.383-4.415V16.048C88.244 7.254 81.143.1 72.414.1h-8.316z", fill: "#000" }), jsx("path", { d: "M47.036 16.022c0 3.99-3.209 7.222-7.168 7.222-3.96 0-7.169-3.233-7.169-7.222 0-3.989 3.21-7.222 7.169-7.222 3.96 0 7.168 3.233 7.168 7.222", fill: "#E30613" })] }) }), jsx("p", { className: styles.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles.selects, children: [showCountry && (jsx(CountrySelect, { countries: countries, countryNameInLanguageOfCountry: true, "data-test-selector": "clSelector_country", onCountryChange: onCountryChange, selectedCountry: currentCountry })), jsx(Select, { "data-test-selector": "clSelector_language", label: t('Language'), onChange: value => setCurrentLanguage(currentCountry.languages.find(language => language.id === value) || currentLanguage), options: languageOptions, selectedOption: currentLanguage.id, showPlaceholder: false, variant: "solid" })] })] }) }));
34
36
  }
35
37
 
36
38
  export { CountrySelectorDialog };
@@ -1,6 +1,6 @@
1
1
  import { Country, Language } from '../../shared/model/countries-languages';
2
2
  export interface CountrySelectorTriggerProps {
3
- onClick: () => void;
3
+ onClick: VoidFunction;
4
4
  selectedCountry: Country | undefined;
5
5
  selectedLanguage: Language | undefined;
6
6
  showCountry?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { CountryCode, LanguageCode } from '../intl/types';
2
- import { CountriesLanguages, Country, Language } from '../shared/model/countries-languages';
2
+ import { Country, Language } from '../shared/model/countries-languages';
3
3
  interface UseCountriesLanguagesArgs {
4
4
  defaultCountryCode: CountryCode;
5
5
  defaultLanguageCode: LanguageCode;
@@ -17,7 +17,7 @@ interface UseCountriesLanguagesReturnTypeFetching {
17
17
  }): Promise<void>;
18
18
  }
19
19
  interface UseCountriesLanguagesReturnTypeSelected {
20
- countries: CountriesLanguages;
20
+ countries: Country[];
21
21
  defaultCountry: Country;
22
22
  defaultLanguage: Language;
23
23
  isFetching: false;
@@ -29,7 +29,7 @@ interface UseCountriesLanguagesReturnTypeSelected {
29
29
  }): Promise<void>;
30
30
  }
31
31
  interface UseCountriesLanguagesReturnType {
32
- countries: CountriesLanguages;
32
+ countries: Country[];
33
33
  defaultCountry: Country;
34
34
  defaultLanguage: Language;
35
35
  isFetching: false;
@@ -5,6 +5,7 @@ import { useFetchCountriesWithLanguages } from '../shared/api/storefront/hooks/w
5
5
  import { updateLocale } from '../shared/api/storefront/services/website-service.js';
6
6
  import { useCookie } from '../shared/hooks/use-cookie.js';
7
7
  import { useSessionStorage } from '../shared/hooks/use-session-storage.js';
8
+ import { isCountry } from '../shared/model/countries-languages.js';
8
9
 
9
10
  const cookieOptions = {
10
11
  domain: config.COOKIE_DOMAIN,
@@ -20,6 +21,7 @@ function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
20
21
  const [contextLanguageCode] = useCookie('SetContextLanguageCode', cookieOptions);
21
22
  const { data: apiCountries, error, isFetching, } = useFetchCountriesWithLanguages({
22
23
  enabled: !sessionCountries,
24
+ select: countries => countries.filter(country => isCountry(country)),
23
25
  });
24
26
  const countries = sessionCountries ?? apiCountries;
25
27
  useEffect(() => {
@@ -44,7 +46,7 @@ function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
44
46
  updateCountryLanguage,
45
47
  };
46
48
  }
47
- if (!countries?.length)
49
+ if (!countries || countries.length === 0)
48
50
  throw new Error('No countries found');
49
51
  const defaultCountry = countries.find(country => country.abbreviation.toUpperCase() === defaultCountryCode.toUpperCase()) || countries[0];
50
52
  if (!defaultCountry)
package/dist/exports.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './address/address';
1
+ export * from './address-info-display/address-info-display';
2
2
  export * from './algolia/algolia-active-categories';
3
3
  export * from './algolia/algolia-active-filters';
4
4
  export * from './algolia/algolia-categories-filters';
@@ -60,8 +60,9 @@ export * from './collapsables/accordion/accordion';
60
60
  export * from './collapsables/accordion/accordion-item';
61
61
  export * from './collapsables/show-all/show-all';
62
62
  export * from './config';
63
+ export * from './country-select/country-select';
64
+ export * from './country-select/hooks/use-countries';
63
65
  export * from './country-selector/connected-country-selector';
64
- export * from './country-selector/country-select/country-select';
65
66
  export * from './country-selector/country-selector-dialog/country-selector-dialog';
66
67
  export * from './country-selector/country-selector-trigger/country-selector-trigger';
67
68
  export * from './country-selector/use-countries-languages';
@@ -112,6 +113,7 @@ export * from './header/cart-icon/connected-cart-icon';
112
113
  export * from './header/hamburger-button/hamburger-button';
113
114
  export * from './header/header';
114
115
  export * from './header/header-layout/header-layout';
116
+ export * from './header/link-list/navigation-link-list';
115
117
  export * from './header/sonic-logo/sonic-logo';
116
118
  export * from './info-icon-tooltip/info-icon-tooltip';
117
119
  export * from './intl/formatted-message';
@@ -168,6 +170,7 @@ export * from './pages/checkout/payment-page/hooks/use-has-returned-from-adyen';
168
170
  export * from './pages/checkout/payment-page/payment-page';
169
171
  export * from './pages/checkout/payment-page/payment-page-content';
170
172
  export * from './pages/checkout/payment-page/utils/parse-amount';
173
+ export * from './pages/checkout/shipping-page/components/currency-change-dialog';
171
174
  export * from './pages/checkout/shipping-page/components/edit-address-form';
172
175
  export * from './pages/checkout/shipping-page/components/readonly-address';
173
176
  export * from './pages/checkout/shipping-page/components/sonic-address';
@@ -239,9 +242,9 @@ export * from './shared/api/storefront/hooks/payment/use-create-adyen-session';
239
242
  export * from './shared/api/storefront/hooks/payment/use-fetch-adyen-config';
240
243
  export * from './shared/api/storefront/hooks/payment/use-invalidate-adyen';
241
244
  export * from './shared/api/storefront/hooks/translation/use-fetch-translations';
242
- export * from './shared/api/storefront/hooks/website/use-fetch-countries';
243
245
  export * from './shared/api/storefront/hooks/website/use-fetch-countries-languages';
244
246
  export * from './shared/api/storefront/hooks/website/use-fetch-countries-with-languages';
247
+ export * from './shared/api/storefront/hooks/website/use-fetch-country-models';
245
248
  export * from './shared/api/storefront/hooks/website/use-fetch-settings';
246
249
  export * from './shared/api/storefront/hooks/website/use-update-locale';
247
250
  export * from './shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist';
@@ -258,6 +261,8 @@ export * from './shared/api/storefront/services/payment-service';
258
261
  export * from './shared/api/storefront/services/translation-service';
259
262
  export * from './shared/api/storefront/services/website-service';
260
263
  export * from './shared/api/storefront/services/wishlist-service';
264
+ export * from './shared/data/cart.data';
265
+ export * from './shared/data/countries-languages.data';
261
266
  export * from './shared/feature-flags/use-feature-flags';
262
267
  export * from './shared/fetch/request';
263
268
  export * from './shared/ga/data-layer';
@@ -272,6 +277,7 @@ export * from './shared/hooks/use-disclosure';
272
277
  export * from './shared/hooks/use-enable-mobile-zoom';
273
278
  export * from './shared/hooks/use-intersection-observer';
274
279
  export * from './shared/hooks/use-is-breakpoint';
280
+ export * from './shared/hooks/use-is-scrolled-beyond-element';
275
281
  export * from './shared/hooks/use-resize-observer';
276
282
  export * from './shared/hooks/use-script';
277
283
  export * from './shared/hooks/use-scroll-lock';
@@ -281,11 +287,12 @@ export * from './shared/hooks/use-watch-css-property';
281
287
  export * from './shared/model/address';
282
288
  export * from './shared/model/announcement';
283
289
  export * from './shared/model/category';
284
- export * from './shared/model/countries';
285
290
  export * from './shared/model/countries-languages';
286
291
  export * from './shared/model/currency';
292
+ export * from './shared/model/defaults';
287
293
  export * from './shared/model/hit';
288
294
  export * from './shared/model/image';
295
+ export * from './shared/model/link';
289
296
  export * from './shared/model/price';
290
297
  export * from './shared/providers/cart-provider';
291
298
  export * from './shared/providers/favorite-provider';
@@ -307,6 +314,7 @@ export * from './shared/utils/debug';
307
314
  export * from './shared/utils/environment';
308
315
  export * from './shared/utils/event-emitter';
309
316
  export * from './shared/utils/merge';
317
+ export * from './shared/utils/number';
310
318
  export * from './shared/utils/price';
311
319
  export * from './shared/utils/promise';
312
320
  export * from './shared/utils/random';
@@ -7,7 +7,7 @@ export interface SelectedFilterCategory {
7
7
  label: string;
8
8
  }
9
9
  export interface ActiveFiltersProps {
10
- onClearAllFilters: () => void;
10
+ onClearAllFilters: VoidFunction;
11
11
  onClearFilter: (categoryLabel: string, filter: SelectedFilter) => void;
12
12
  selectedFilterCategories: SelectedFilterCategory[];
13
13
  }
@@ -11,11 +11,15 @@ import { Input } from '../input/input.js';
11
11
  import { Label } from '../label/label.js';
12
12
  import styles from './number-field.module.css.js';
13
13
 
14
+ const defaultFormatOptions = {
15
+ style: 'decimal',
16
+ useGrouping: false,
17
+ };
14
18
  /**
15
19
  * This component is used to create a number field.
16
20
  * This field can also grow when a user types in text.
17
21
  */
18
- function NumberField({ autoFocus, autoGrow, 'data-test-selector': dataTestSelector, defaultValue, formatOptions = { style: 'decimal', useGrouping: false }, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel = false, size = 'lg', validate, value, withButtons, }) {
22
+ function NumberField({ autoFocus, autoGrow, 'data-test-selector': dataTestSelector, defaultValue, formatOptions = defaultFormatOptions, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel = false, size = 'lg', validate, value, withButtons, }) {
19
23
  const inputRef = useRef(null);
20
24
  return (jsxs(NumberField$1, { "aria-label": label, autoFocus: autoFocus, className: clsx(styles.field, styles[size]), "data-test-selector": dataTestSelector, defaultValue: defaultValue, formatOptions: formatOptions, isDisabled: isDisabled, isInvalid: isInvalid, isReadOnly: isReadOnly, isRequired: isRequired, maxValue: maxValue, minValue: minValue, name: name, onChange: onChange, onInput: onInput, validate: validate, value: value, children: [showLabel && jsx(Label, { isRequired: isRequired, children: label }), jsxs("div", { className: styles['button-input-container'], children: [withButtons && (jsx(Button, { "data-test-selector": "decrement", isDisabled: isDisabled,
21
25
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useRef, useEffect } from 'react';
4
4
  import { Select as Select$1, Button, SelectValue, Popover, ListBox, Section, Header, ListBoxItem } from 'react-aria-components';
5
5
  import clsx from 'clsx';
@@ -10,7 +10,8 @@ import { FieldError } from '../field-error/field-error.js';
10
10
  import { Label } from '../label/label.js';
11
11
  import styles from './select.module.css.js';
12
12
 
13
- function Select({ 'data-test-selector': dataTestSelector, defaultSelectedOption, icon = (jsx(GlyphsChevronsSlimDownIcon, { "aria-hidden": "true", className: styles.chevron })), isDisabled = false, isLoading, isRequired = false, label, name, onChange, options, placeholder, selectedOption, showLabel = true, showPlaceholder = true, size = 'md', variant = 'outline', }) {
13
+ const defaultIcon = (jsx(GlyphsChevronsSlimDownIcon, { "aria-hidden": "true", className: styles.chevron }));
14
+ function Select({ 'data-test-selector': dataTestSelector, defaultSelectedOption, icon = defaultIcon, isDisabled = false, isLoading, isRequired = false, label, name, onChange, options, placeholder, selectedOption, showLabel = true, showPlaceholder = true, size = 'md', variant = 'outline', }) {
14
15
  const selectRef = useRef(null);
15
16
  useEffect(() => {
16
17
  const updateWidth = () => {
@@ -22,7 +22,7 @@ const TextArea = forwardRef(({ autoGrow, className, label, size, ...textAreaProp
22
22
  return void ref.current.style.removeProperty('height');
23
23
  ref.current.style.height = `${initialHeight.current}px`;
24
24
  if (ref.current.scrollHeight > (initialHeight.current || 0)) {
25
- ref.current.style.height = ref.current.scrollHeight + 'px';
25
+ ref.current.style.height = `${ref.current.scrollHeight}px`;
26
26
  }
27
27
  }, [autoGrow, ref]);
28
28
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { createContext } from 'react';
3
+ import { createContext, useMemo } from 'react';
4
4
  import { AlgoliaSearchProvider } from '../../algolia/algolia-search-provider.js';
5
5
  import { BackgroundOverlay } from '../../background-overlay/background-overlay.js';
6
6
  import { useDisclosure } from '../../shared/hooks/use-disclosure.js';
@@ -9,7 +9,8 @@ import styles from '../global-search.module.css.js';
9
9
  const GlobalSearchDisclosureContext = createContext(null);
10
10
  function GlobalSearchProvider({ children, searchClient, }) {
11
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 })] }) }));
12
+ const value = useMemo(() => ({ close, isOpen, open, toggle }), [close, isOpen, open, toggle]);
13
+ return (jsx(AlgoliaSearchProvider, { searchClient: searchClient, children: jsxs(GlobalSearchDisclosureContext.Provider, { value: value, children: [children, jsx(BackgroundOverlay, { className: styles['global-search-background-overlay-position'], isOpen: isOpen, onClose: close })] }) }));
13
14
  }
14
15
 
15
16
  export { GlobalSearchDisclosureContext, GlobalSearchProvider };
@@ -4,6 +4,7 @@ import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
4
4
  function Highlight({ attribute, hit, tagName = 'mark', }) {
5
5
  return createElement(Fragment, {}, parseAlgoliaHitHighlight({ attribute, hit }).map(({ isHighlighted, value }, index) => {
6
6
  if (isHighlighted) {
7
+ // eslint-disable-next-line @eslint-react/no-array-index-key
7
8
  return createElement(tagName, { key: index }, value);
8
9
  }
9
10
  return value;
@@ -50,7 +50,9 @@ function QuickAccessSection() {
50
50
  if (!collection)
51
51
  return;
52
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" }) }) }));
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
54
+ // eslint-disable-next-line @eslint-react/no-array-index-key
55
+ , { href: item.action.url, image: item.image, onClick: close }, `${index}-${item.action.url}`))), cardsPerView: "auto", cardWidth: "narrow" }) }) }));
54
56
  }
55
57
 
56
58
  export { NoSearch };
@@ -1 +1,5 @@
1
- export declare function Header(): import("react/jsx-runtime").JSX.Element;
1
+ import { NavigationLink } from '../shared/model/link';
2
+ export interface HeaderProps {
3
+ links: NavigationLink[];
4
+ }
5
+ export declare function Header({ links }: HeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,12 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { HeaderLayout } from './header-layout/header-layout.js';
3
+ import { NavigationLinkList } from './link-list/navigation-link-list.js';
3
4
  import { SonicLogo } from './sonic-logo/sonic-logo.js';
4
5
 
5
- function Header() {
6
- return (jsx(HeaderLayout, { hamburgerButton: null, logo: jsx(SonicLogo, { href: "/" }), mainNavigation: null, navigationActions: null, search: null }));
6
+ function Header({ links }) {
7
+ return (jsx(HeaderLayout, { hamburgerButton: null, logo: jsx(SonicLogo, { href: "/" }), mainNavigation: jsx(NavigationLinkList, { links: links,
8
+ // eslint-disable-next-line no-console
9
+ onSubmenuToggle: link => console.log('open menu', link) }), navigationActions: null, search: null }));
7
10
  }
8
11
 
9
12
  export { Header };
@@ -0,0 +1,6 @@
1
+ import { NavigationLink } from '../../shared/model/link';
2
+ export interface LinkListProps {
3
+ links: NavigationLink[];
4
+ onSubmenuToggle: (link: NavigationLink) => void;
5
+ }
6
+ export declare function NavigationLinkList({ links, onSubmenuToggle }: LinkListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { GlyphsChevronsBoldDownIcon } from '../../icons/glyph/glyphs-chevrons-bold-down-icon.js';
3
+ import { RouteLink } from '../../shared/routing/route-link.js';
4
+ import styles from './navigation-link-list.module.css.js';
5
+
6
+ function NavigationLinkList({ links, onSubmenuToggle }) {
7
+ return (jsx("ul", { className: styles['navigation-link-list'], children: links.map(link => {
8
+ if (link.links.length > 0) {
9
+ return (jsx("li", { children: jsxs(RouteLink, { className: styles.link, onClick: () => onSubmenuToggle(link), children: [link.title, jsx(GlyphsChevronsBoldDownIcon, { className: styles.chevron })] }) }, link.key));
10
+ }
11
+ return (jsx("li", { children: jsx(RouteLink, { className: styles.link, href: link.url, children: link.title }) }, link.key));
12
+ }) }));
13
+ }
14
+
15
+ export { NavigationLinkList };
@@ -0,0 +1,3 @@
1
+ var styles = {"navigation-link-list":"navigation-link-list-module-Ku9Sa","link":"navigation-link-list-module-kj0Rj","chevron":"navigation-link-list-module-QiKiA"};
2
+
3
+ export { styles as default };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import * as bff_model from './shared/api/bff/model/bff.model.js';
3
3
  export { bff_model as BffModel };
4
4
  import * as storefront_model from './shared/api/storefront/model/storefront.model.js';
5
5
  export { storefront_model as StorefrontModel };
6
- export { Address } from './address/address.js';
6
+ export { AddressInfoDisplay } from './address-info-display/address-info-display.js';
7
7
  export { AlgoliaActiveCategories } from './algolia/algolia-active-categories.js';
8
8
  export { AlgoliaActiveFilters } from './algolia/algolia-active-filters.js';
9
9
  export { AlgoliaCategoriesFilters } from './algolia/algolia-categories-filters.js';
@@ -65,8 +65,9 @@ export { Accordion } from './collapsables/accordion/accordion.js';
65
65
  export { AccordionItem } from './collapsables/accordion/accordion-item.js';
66
66
  export { ShowAll } from './collapsables/show-all/show-all.js';
67
67
  export { config, configPerEnvironment } from './config.js';
68
+ export { CountrySelect } from './country-select/country-select.js';
69
+ export { useCountries } from './country-select/hooks/use-countries.js';
68
70
  export { ConnectedCountrySelector } from './country-selector/connected-country-selector.js';
69
- export { CountrySelect } from './country-selector/country-select/country-select.js';
70
71
  export { CountrySelectorDialog } from './country-selector/country-selector-dialog/country-selector-dialog.js';
71
72
  export { CountrySelectorTrigger } from './country-selector/country-selector-trigger/country-selector-trigger.js';
72
73
  export { useCountriesLanguages } from './country-selector/use-countries-languages.js';
@@ -116,6 +117,7 @@ export { ConnectedCartIcon } from './header/cart-icon/connected-cart-icon.js';
116
117
  export { HamburgerButton } from './header/hamburger-button/hamburger-button.js';
117
118
  export { Header } from './header/header.js';
118
119
  export { HeaderLayout } from './header/header-layout/header-layout.js';
120
+ export { NavigationLinkList } from './header/link-list/navigation-link-list.js';
119
121
  export { SonicLogo } from './header/sonic-logo/sonic-logo.js';
120
122
  export { InfoIconTooltip } from './info-icon-tooltip/info-icon-tooltip.js';
121
123
  export { FormattedMessage } from './intl/formatted-message.js';
@@ -171,6 +173,7 @@ export { useHasReturnedFromAdyen } from './pages/checkout/payment-page/hooks/use
171
173
  export { PaymentPage } from './pages/checkout/payment-page/payment-page.js';
172
174
  export { PaymentPageContent } from './pages/checkout/payment-page/payment-page-content.js';
173
175
  export { parseAmount } from './pages/checkout/payment-page/utils/parse-amount.js';
176
+ export { CurrencyChangeDialog } from './pages/checkout/shipping-page/components/currency-change-dialog.js';
174
177
  export { EDIT_ADDRESS_FORM_ID, EditAddressesForm } from './pages/checkout/shipping-page/components/edit-address-form.js';
175
178
  export { ReadOnlyAddresses } from './pages/checkout/shipping-page/components/readonly-address.js';
176
179
  export { SonicAddress } from './pages/checkout/shipping-page/components/sonic-address.js';
@@ -241,9 +244,9 @@ export { useCreateAdyenSession } from './shared/api/storefront/hooks/payment/use
241
244
  export { useFetchAdyenConfig } from './shared/api/storefront/hooks/payment/use-fetch-adyen-config.js';
242
245
  export { useInvalidateAdyen } from './shared/api/storefront/hooks/payment/use-invalidate-adyen.js';
243
246
  export { useFetchTranslations } from './shared/api/storefront/hooks/translation/use-fetch-translations.js';
244
- export { useFetchCountries } from './shared/api/storefront/hooks/website/use-fetch-countries.js';
245
247
  export { useFetchCountriesLanguages } from './shared/api/storefront/hooks/website/use-fetch-countries-languages.js';
246
248
  export { useFetchCountriesWithLanguages } from './shared/api/storefront/hooks/website/use-fetch-countries-with-languages.js';
249
+ export { useFetchCountryModels } from './shared/api/storefront/hooks/website/use-fetch-country-models.js';
247
250
  export { useFetchSettings } from './shared/api/storefront/hooks/website/use-fetch-settings.js';
248
251
  export { useUpdateLocale } from './shared/api/storefront/hooks/website/use-update-locale.js';
249
252
  export { useAddWishListItemToCurrentWishList } from './shared/api/storefront/hooks/wishlist/use-add-wishlist-item-to-current-wishlist.js';
@@ -258,8 +261,10 @@ export { fetchBillToAddresses, fetchFulfillmentMethods, fetchShipToAddresses, pa
258
261
  export { validateVATNumber } from './shared/api/storefront/services/finance-service.js';
259
262
  export { createAdyenSession, fetchAdyenConfig } from './shared/api/storefront/services/payment-service.js';
260
263
  export { fetchTranslations } from './shared/api/storefront/services/translation-service.js';
261
- export { fetchCountries, fetchCountriesLanguages, fetchCountriesWithLanguages, fetchSettings, updateLocale } from './shared/api/storefront/services/website-service.js';
264
+ export { fetchCountriesLanguages, fetchCountriesWithLanguages, fetchSettings, updateLocale } from './shared/api/storefront/services/website-service.js';
262
265
  export { WishListNameAlreadyExistsError, addWishListItemToWishList, createWishList, deleteWishList, deleteWishListItemFromWishList, getWishList, getWishListItemsByWishListId, getWishLists } from './shared/api/storefront/services/wishlist-service.js';
266
+ export { cart } from './shared/data/cart.data.js';
267
+ export { countries, dutch, english, france, french, german, germany, languages, netherlands, unitedKingdom } from './shared/data/countries-languages.data.js';
263
268
  export { useFeatureFlags } from './shared/feature-flags/use-feature-flags.js';
264
269
  export { BadRequestError, ForbiddenRequestError, InternalServerErrorRequestError, NotFoundRequestError, RequestError, TimeoutRequestError, UnauthorizedRequestError, UnprocessableContentRequestError, isFormData, isJsonBody, isRequestError, request } from './shared/fetch/request.js';
265
270
  export { dataLayer } from './shared/ga/data-layer.js';
@@ -267,24 +272,26 @@ export { GoogleAnalyticsProvider, InitializeGoogleAnalyticsProvider, useGoogleAn
267
272
  export { isGAEvent } from './shared/ga/types.js';
268
273
  export { useDataLayer } from './shared/ga/use-data-layer.js';
269
274
  export { useBreakpoint } from './shared/hooks/use-breakpoint.js';
270
- export { useCookie } from './shared/hooks/use-cookie.js';
275
+ export { defaultCookieOptions, useCookie } from './shared/hooks/use-cookie.js';
271
276
  export { useCSSLink } from './shared/hooks/use-css-link.js';
272
277
  export { useDebouncedCallback } from './shared/hooks/use-debounced-callback.js';
273
278
  export { useDisclosure } from './shared/hooks/use-disclosure.js';
274
279
  export { useEnableMobileZoom } from './shared/hooks/use-enable-mobile-zoom.js';
275
280
  export { useIntersectionObserver } from './shared/hooks/use-intersection-observer.js';
276
281
  export { useIsBreakpoint } from './shared/hooks/use-is-breakpoint.js';
282
+ export { useIsScrolledBeyondElement } from './shared/hooks/use-is-scrolled-beyond-element.js';
277
283
  export { useResizeObserver } from './shared/hooks/use-resize-observer.js';
278
284
  export { useScript } from './shared/hooks/use-script.js';
279
285
  export { useScrollLock } from './shared/hooks/use-scroll-lock.js';
280
- export { scrollToTop, useScrollTo } from './shared/hooks/use-scroll-to.js';
286
+ export { scrollTo, scrollToTop } from './shared/hooks/use-scroll-to.js';
281
287
  export { useSessionStorage } from './shared/hooks/use-session-storage.js';
282
288
  export { useWatchCssProperty } from './shared/hooks/use-watch-css-property.js';
283
289
  export { validateEmail, validatePhone } from './shared/model/address.js';
284
290
  export { announcementSubTypes, announcementTypes, isAnnouncementSubtype, isAnnouncementType } from './shared/model/announcement.js';
285
291
  export { transformAlgoliaCategoryData } from './shared/model/category.js';
286
- export { countries } from './shared/model/countries.js';
292
+ export { isCountry, isLanguage } from './shared/model/countries-languages.js';
287
293
  export { currencySymbolToISO } from './shared/model/currency.js';
294
+ export { voidFunction } from './shared/model/defaults.js';
288
295
  export { isProductHit, transformAlgoliaProductHitToProductHit, transformAlgoliaPromoHitToPromoHit } from './shared/model/hit.js';
289
296
  export { isResponsiveImage } from './shared/model/image.js';
290
297
  export { CartProvider, useCartEvents } from './shared/providers/cart-provider.js';
@@ -306,6 +313,7 @@ export { trackPropertyChange } from './shared/utils/debug.js';
306
313
  export { environment, environments } from './shared/utils/environment.js';
307
314
  export { EventEmitter } from './shared/utils/event-emitter.js';
308
315
  export { clone, deepMerge, isPlainObject, default as main, merge } from './shared/utils/merge.js';
316
+ export { ensureNumber } from './shared/utils/number.js';
309
317
  export { currencies, formatPrice, getCurrencyByCountryCode } from './shared/utils/price.js';
310
318
  export { isPromise, wait } from './shared/utils/promise.js';
311
319
  export { random, randomInt } from './shared/utils/random.js';
@@ -1,7 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
+ type Variant = 'solid' | 'stroke';
2
3
  export interface InfoIconTooltipProps {
3
4
  children: string | ReactNode;
4
5
  className?: string;
5
- variant?: 'solid' | 'stroke';
6
+ variant?: Variant;
6
7
  }
7
8
  export declare function InfoIconTooltip({ children, className, variant, }: InfoIconTooltipProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -8,13 +8,13 @@ import { useFormattedMessage } from '../intl/use-formatted-message.js';
8
8
  import { Tooltip } from '../tooltip/tooltip.js';
9
9
  import styles from './info-icon-tooltip.module.css.js';
10
10
 
11
- function InfoIconTooltip({ children, className, variant = 'solid', }) {
11
+ function Icon({ variant, ...props }) {
12
12
  const t = useFormattedMessage();
13
13
  const triggerLabel = t('Information');
14
- function Icon(props) {
15
- return (jsx(IconButton, { ...props, className: clsx(styles.trigger), children: variant === 'stroke' ? (jsx(StrokeInformationIcon, { "aria-description": triggerLabel })) : (jsx(SolidInformationIcon, { "aria-description": triggerLabel })) }));
16
- }
17
- return (jsx(Tooltip, { className: clsx(className, styles['info-icon-tooltip'], styles[variant]), trigger: jsx(Icon, {}), children: children }));
14
+ return (jsx(IconButton, { ...props, className: clsx(styles.trigger), children: variant === 'stroke' ? (jsx(StrokeInformationIcon, { "aria-description": triggerLabel })) : (jsx(SolidInformationIcon, { "aria-description": triggerLabel })) }));
15
+ }
16
+ function InfoIconTooltip({ children, className, variant = 'solid', }) {
17
+ return (jsx(Tooltip, { className: clsx(className, styles['info-icon-tooltip'], styles[variant]), trigger: jsx(Icon, { variant: variant }), children: children }));
18
18
  }
19
19
 
20
20
  export { InfoIconTooltip };
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { createContext } from 'react';
3
+ import { voidFunction } from '../shared/model/defaults.js';
3
4
 
4
5
  const IntlContext = createContext({
5
6
  cultureCode: 'en-GB',
6
7
  formattedMessage: id => id,
7
- updateCultureCode: () => { },
8
+ updateCultureCode: voidFunction,
8
9
  });
9
10
 
10
11
  export { IntlContext };