@sonic-equipment/ui 0.0.111 → 0.0.112
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/index.d.ts +9 -2
- package/dist/index.js +111 -44
- package/dist/src/buttons/print-button/print-button.d.ts +1 -0
- package/dist/src/buttons/print-button/print-button.stories.d.ts +13 -0
- package/dist/src/cart-totals/cart-totals.d.ts +12 -0
- package/dist/src/cart-totals/cart-totals.stories.d.ts +16 -0
- package/dist/src/country-selector/country-selector-dialog/country-selector-dialog.d.ts +3 -1
- package/dist/src/icons/solid/solid-event-icon.d.ts +1 -0
- package/dist/src/icons/solid/solid-news-icon.d.ts +1 -0
- package/dist/src/icons/solid/solid-sale-icon.d.ts +1 -0
- package/dist/src/intl/translation-id.d.ts +1 -1
- package/dist/src/modals/modal/modal.d.ts +1 -1
- package/dist/src/notifications/announcements/announcement.d.ts +1 -1
- package/dist/src/notifications/announcements/announcement.stories.d.ts +10 -6
- package/dist/src/shared/api/bff/hooks/use-fetch-announcements.d.ts +1 -4
- package/dist/src/shared/api/bff/model/announcement.model.d.ts +1 -0
- package/dist/src/shared/api/bff/services/bff-service.d.ts +10 -0
- package/dist/src/shared/feature-flags/use-feature-flags.d.ts +0 -1
- package/dist/src/shared/model/announcement.d.ts +6 -3
- package/dist/src/shared/utils/price.d.ts +1 -0
- package/dist/src/typography/heading/heading.d.ts +1 -1
- package/dist/src/typography/heading/heading.stories.d.ts +1 -1
- package/dist/styles.css +14 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -128,7 +128,6 @@ declare const request: Request;
|
|
|
128
128
|
|
|
129
129
|
declare const features: {
|
|
130
130
|
readonly language: "language";
|
|
131
|
-
readonly pdp: "pdpV2";
|
|
132
131
|
readonly pdpv1: "pdpV1";
|
|
133
132
|
readonly plpv1: "plpV1";
|
|
134
133
|
readonly searchv1: "searchV1";
|
|
@@ -3835,6 +3834,7 @@ type TranslationId$1 =
|
|
|
3835
3834
|
| 'Clear filters'
|
|
3836
3835
|
| 'Clear'
|
|
3837
3836
|
| 'Continue shopping'
|
|
3837
|
+
| 'Cost overview'
|
|
3838
3838
|
| 'Country'
|
|
3839
3839
|
| 'Create new list'
|
|
3840
3840
|
| 'create account'
|
|
@@ -3844,14 +3844,17 @@ type TranslationId$1 =
|
|
|
3844
3844
|
| 'Explore by categories'
|
|
3845
3845
|
| 'Exploring our products by category'
|
|
3846
3846
|
| 'Features'
|
|
3847
|
+
| 'Fulfillment method'
|
|
3847
3848
|
| 'Hide filters'
|
|
3848
3849
|
| 'Incl. VAT'
|
|
3849
3850
|
| 'Includes'
|
|
3850
3851
|
| 'Language'
|
|
3851
3852
|
| 'List name already exists'
|
|
3852
3853
|
| 'New list name'
|
|
3854
|
+
| 'Order number'
|
|
3853
3855
|
| 'Please Sign In'
|
|
3854
3856
|
| 'Popular searches'
|
|
3857
|
+
| 'Print'
|
|
3855
3858
|
| 'Product Features'
|
|
3856
3859
|
| 'Products'
|
|
3857
3860
|
| 'Quick access'
|
|
@@ -3865,6 +3868,7 @@ type TranslationId$1 =
|
|
|
3865
3868
|
| 'Your favorites are available on multiple devices'
|
|
3866
3869
|
| 'Save'
|
|
3867
3870
|
| 'Share your favorite list with others'
|
|
3871
|
+
| 'Shipping and handling'
|
|
3868
3872
|
| 'Show all'
|
|
3869
3873
|
| 'Show filters'
|
|
3870
3874
|
| 'Show less'
|
|
@@ -3874,6 +3878,7 @@ type TranslationId$1 =
|
|
|
3874
3878
|
| 'Sort by'
|
|
3875
3879
|
| 'Specifications'
|
|
3876
3880
|
| 'Submit'
|
|
3881
|
+
| 'Subtotal'
|
|
3877
3882
|
| 'Suggestions'
|
|
3878
3883
|
| 'The product has been added to your cart.'
|
|
3879
3884
|
| 'The product has been updated in your cart.'
|
|
@@ -3882,7 +3887,9 @@ type TranslationId$1 =
|
|
|
3882
3887
|
| 'Unable to update the product in your cart.'
|
|
3883
3888
|
| 'Unable to remove the product from your cart.'
|
|
3884
3889
|
| 'Try another search'
|
|
3890
|
+
| 'Total'
|
|
3885
3891
|
| 'Use fewer keywords'
|
|
3892
|
+
| 'VAT'
|
|
3886
3893
|
| 'Welcome to Sonic Equipment. Please choose your country and language below.'
|
|
3887
3894
|
| 'What are you searching for?'
|
|
3888
3895
|
| 'You could try checking the spelling of your search query'
|
|
@@ -3972,7 +3979,7 @@ interface UpdateCartLineParams {
|
|
|
3972
3979
|
}
|
|
3973
3980
|
declare function useUpdateCartLineById(): _tanstack_react_query.UseMutationResult<void, Error, UpdateCartLineParams, unknown>;
|
|
3974
3981
|
|
|
3975
|
-
type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Cancel' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Continue shopping' | 'Country' | 'Create new list' | 'create account' | 'Double check your spelling' | 'Downloads' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'Hide filters' | 'Incl. VAT' | 'Includes' | 'Language' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Product Features' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Shop more efficiently and quicker with a favorites list' | 'Easily add your favorite products' | 'Your favorites are available on multiple devices' | 'Save' | 'Share your favorite list with others' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Suggestions' | 'The product has been added to your cart.' | 'The product has been updated in your cart.' | 'The product has been removed from your cart.' | 'Unable to add the product to your cart.' | 'Unable to update the product in your cart.' | 'Unable to remove the product from your cart.' | 'Try another search' | 'Use fewer keywords' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
3982
|
+
type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Cancel' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Continue shopping' | 'Cost overview' | 'Country' | 'Create new list' | 'create account' | 'Double check your spelling' | 'Downloads' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'Fulfillment method' | 'Hide filters' | 'Incl. VAT' | 'Includes' | 'Language' | 'List name already exists' | 'New list name' | 'Order number' | 'Please Sign In' | 'Popular searches' | 'Print' | 'Product Features' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Shop more efficiently and quicker with a favorites list' | 'Easily add your favorite products' | 'Your favorites are available on multiple devices' | 'Save' | 'Share your favorite list with others' | 'Shipping and handling' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'The product has been added to your cart.' | 'The product has been updated in your cart.' | 'The product has been removed from your cart.' | 'Unable to add the product to your cart.' | 'Unable to update the product in your cart.' | 'Unable to remove the product from your cart.' | 'Try another search' | 'Total' | 'Use fewer keywords' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
3976
3983
|
|
|
3977
3984
|
type Translations = Record<TranslationId, string>;
|
|
3978
3985
|
type FormatMessageFunction = (id: string, ...replacementValues: readonly string[]) => string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -214,7 +214,7 @@ const configPerEnvironment = {
|
|
|
214
214
|
ALGOLIA_API_KEY: 'e0edf30798a6b2e4e44fd25f0f2f9646',
|
|
215
215
|
ALGOLIA_APP_ID: 'testing9VXJ0U4GSV',
|
|
216
216
|
ALGOLIA_HOST: 'sonicequipment.commerce.insitesandbox.com',
|
|
217
|
-
BFF_API_URL: 'https://
|
|
217
|
+
BFF_API_URL: 'https://localhost:8000/api/v1/bff',
|
|
218
218
|
COOKIE_DOMAIN: '.insitesandbox.com',
|
|
219
219
|
SHOP_API_URL:
|
|
220
220
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -483,7 +483,6 @@ const request = (function createRequestFunction() {
|
|
|
483
483
|
|
|
484
484
|
const features = {
|
|
485
485
|
language: 'language',
|
|
486
|
-
pdp: 'pdpV2',
|
|
487
486
|
pdpv1: 'pdpV1',
|
|
488
487
|
plpv1: 'plpV1',
|
|
489
488
|
searchv1: 'searchV1',
|
|
@@ -1845,12 +1844,13 @@ function Tag({ children }) {
|
|
|
1845
1844
|
return (jsxs("div", { className: styles$Z.tag, children: [jsx("div", { className: styles$Z.body, children: children }), jsx("svg", { className: styles$Z.shape, height: "16", viewBox: "0 0 9 16", width: "9", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M1.92461763,0 L0,0 L0,16 L1.92461763,16 L6.4117887,16 L8.87489381,7.57121588 C9.23711515,6.3325062 8.79482383,4.99454094 7.78060408,4.2560794 L1.92461763,0 Z", fill: "currentColor" }) })] }));
|
|
1846
1845
|
}
|
|
1847
1846
|
|
|
1848
|
-
var styles$Y = {"product-price":"product-price-module-oIU1K","original-price":"product-price-module-til0s","is-hidden":"product-price-module-V1NCf","current-price-wrapper":"product-price-module-FfVhl","current-price":"product-price-module-pvy2w","wholes":"product-price-module-GCw07","dot":"product-price-module-N56iV","decimals":"product-price-module-eWOOF","vat":"product-price-module-96DoG"};
|
|
1849
|
-
|
|
1850
1847
|
const formatPrice = (price) => new Intl.NumberFormat('en-US', {
|
|
1851
1848
|
maximumFractionDigits: 2,
|
|
1852
1849
|
minimumFractionDigits: 2,
|
|
1853
1850
|
}).format(price);
|
|
1851
|
+
|
|
1852
|
+
var styles$Y = {"product-price":"product-price-module-oIU1K","original-price":"product-price-module-til0s","is-hidden":"product-price-module-V1NCf","current-price-wrapper":"product-price-module-FfVhl","current-price":"product-price-module-pvy2w","wholes":"product-price-module-GCw07","dot":"product-price-module-N56iV","decimals":"product-price-module-eWOOF","vat":"product-price-module-96DoG"};
|
|
1853
|
+
|
|
1854
1854
|
function ProductPrice({ className, isVatIncluded, originalPrice, price, }) {
|
|
1855
1855
|
if (isNaN(price))
|
|
1856
1856
|
return;
|
|
@@ -7874,10 +7874,10 @@ function Modal({ children, className, hasCloseButton, isDismissable, isFullScree
|
|
|
7874
7874
|
});
|
|
7875
7875
|
}, className: clsx(styles$O['modal-overlay'], className), isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled, isOpen: isOpen, onOpenChange: onOpenChange, shouldCloseOnInteractOutside: () => shouldCloseOnInteractOutside, children: jsxs(Modal$1, { className: clsx(styles$O.modal, {
|
|
7876
7876
|
[styles$O['is-full-screen']]: isFullScreen,
|
|
7877
|
-
}), children: [hasCloseButton && (jsx("div", { className: styles$O.close, children: jsx(IconButton, { color: "secondary", isDisabled: !isDismissable, onClick: () => onOpenChange(false), children: jsx(StrokeCloseboxIcon, {}) }) })), jsx("div", { className: styles$O.content, children: children })] }) }));
|
|
7877
|
+
}), children: [hasCloseButton && (jsx("div", { className: styles$O.close, children: jsx(IconButton, { color: "secondary", isDisabled: !isDismissable, onClick: () => onOpenChange?.(false), children: jsx(StrokeCloseboxIcon, {}) }) })), jsx("div", { className: styles$O.content, children: children })] }) }));
|
|
7878
7878
|
}
|
|
7879
7879
|
|
|
7880
|
-
var styles$N = {"heading":"heading-module-pMC65","uppercase":"heading-module-6spgX","italic":"heading-module-XXMDM","bold":"heading-module-xvrxo","xxl":"heading-module-Kn3ZN","xl":"heading-module--hZs-","l":"heading-module-WrJRY","m":"heading-module-hTexc","s":"heading-module-7W29m","xs":"heading-module-SgaLB","xxs":"heading-module-33en7"};
|
|
7880
|
+
var styles$N = {"heading":"heading-module-pMC65","uppercase":"heading-module-6spgX","italic":"heading-module-XXMDM","bold":"heading-module-xvrxo","xxl":"heading-module-Kn3ZN","xl":"heading-module--hZs-","l":"heading-module-WrJRY","m":"heading-module-hTexc","s":"heading-module-7W29m","xs":"heading-module-SgaLB","xxs":"heading-module-33en7","xxxs":"heading-module-qvrEk"};
|
|
7881
7881
|
|
|
7882
7882
|
const sizeToTag = {
|
|
7883
7883
|
l: 'h3',
|
|
@@ -7887,6 +7887,7 @@ const sizeToTag = {
|
|
|
7887
7887
|
xs: 'h6',
|
|
7888
7888
|
xxl: 'h1',
|
|
7889
7889
|
xxs: 'h6',
|
|
7890
|
+
xxxs: 'h6',
|
|
7890
7891
|
};
|
|
7891
7892
|
function Heading({ bold = true, children, className, italic, size = 'xxl', tag, uppercase, }) {
|
|
7892
7893
|
return createElement$1(tag || sizeToTag[size], {
|
|
@@ -7909,13 +7910,13 @@ function Dialog({ allowClose = true, children, className, dialogClassName, foote
|
|
|
7909
7910
|
|
|
7910
7911
|
var styles$L = {"country-selector-dialog":"country-selector-dialog-module-mMJS0","content":"country-selector-dialog-module-z-ZqY","logo":"country-selector-dialog-module-7VjsF","intro":"country-selector-dialog-module-IdVDt","selects":"country-selector-dialog-module-Nvikf"};
|
|
7911
7912
|
|
|
7912
|
-
function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, selectedLanguage, showCountry = true, }) {
|
|
7913
|
+
function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange, onSubmit, selectedCountry, selectedLanguage, showCountry = true, }) {
|
|
7913
7914
|
const t = useFormattedMessage();
|
|
7914
7915
|
const [currentCountry, setCurrentCountry] = useState(selectedCountry);
|
|
7915
7916
|
const [currentLanguage, setCurrentLanguage] = useState(selectedLanguage);
|
|
7916
7917
|
const countryOptions = useMemo(() => countries.reduce((acc, country) => ({
|
|
7917
7918
|
...acc,
|
|
7918
|
-
[country.id]: t(`clSelector.${country.
|
|
7919
|
+
[country.id]: t(`clSelector.${country.abbreviation}`),
|
|
7919
7920
|
}), {}),
|
|
7920
7921
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7921
7922
|
[countries]);
|
|
@@ -7929,11 +7930,11 @@ function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, s
|
|
|
7929
7930
|
setCurrentLanguage(fallbackLanguage);
|
|
7930
7931
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7931
7932
|
}, [currentCountry]);
|
|
7932
|
-
return (jsx(Dialog, { hideTitle: true, allowClose:
|
|
7933
|
+
return (jsx(Dialog, { hideTitle: true, allowClose: isDismissable, className: styles$L.modal, dialogClassName: styles$L['country-selector-dialog'], footer: jsx(Button, { withArrow: true, type: "submit", children: jsx(FormattedMessage, { id: "Save" }) }), hasCloseButton: isDismissable, isDismissable: isDismissable, isOpen: isOpen, onOpenChange: onOpenChange, onSubmit: e => {
|
|
7933
7934
|
onSubmit({ country: currentCountry, language: currentLanguage });
|
|
7934
7935
|
e.preventDefault();
|
|
7935
7936
|
e.stopPropagation();
|
|
7936
|
-
}, title: "Country Selector", children: jsxs("div", { className: styles$L.content, children: [jsx("svg", { className: styles$L.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$L.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles$L.selects, children: [showCountry && (jsx(Select, { label: t('Country'), onChange: value => setCurrentCountry(countries.find(country => country.id === value) ||
|
|
7937
|
+
}, shouldCloseOnInteractOutside: isDismissable, title: "Country Selector", children: jsxs("div", { className: styles$L.content, children: [jsx("svg", { className: styles$L.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$L.intro, children: jsx(FormattedMessage, { id: "Welcome to Sonic Equipment. Please choose your country and language below." }) }), jsxs("div", { className: styles$L.selects, children: [showCountry && (jsx(Select, { label: t('Country'), onChange: value => setCurrentCountry(countries.find(country => country.id === value) ||
|
|
7937
7938
|
currentCountry), options: countryOptions, selectedOption: currentCountry.id, showPlaceholder: false, variant: "solid" })), jsx(Select, { label: t('Language'), onChange: value => setCurrentLanguage(currentCountry.languages.find(language => language.id === value) || currentLanguage), options: languageOptions, selectedOption: currentLanguage.id, showPlaceholder: false, variant: "solid" })] })] }) }));
|
|
7938
7939
|
}
|
|
7939
7940
|
|
|
@@ -7945,7 +7946,7 @@ function CountrySelectorTrigger({ onClick, selectedCountry, selectedLanguage, sh
|
|
|
7945
7946
|
return;
|
|
7946
7947
|
const abbreviation = selectedCountry.abbreviation.toLowerCase();
|
|
7947
7948
|
const flagSrc = `https://res.cloudinary.com/dkz9eknwh/image/upload/v1729678637/images/flags/${abbreviation}.svg`;
|
|
7948
|
-
return (jsxs("button", { "aria-label": "Open country selector dialog", className: styles$K['country-selector-trigger'], onClick: onClick, type: "button", children: [jsx(Image, { className: styles$K.flag, height: 24, image: { 1: flagSrc, 2: flagSrc, 3: flagSrc, altText: abbreviation }, title: abbreviation, width: 24 }), jsxs("div", { className: styles$K.text, children: [showCountry && (jsxs(Fragment, { children: [jsx("span", { children: t(`clSelector.${selectedCountry.
|
|
7949
|
+
return (jsxs("button", { "aria-label": "Open country selector dialog", className: styles$K['country-selector-trigger'], onClick: onClick, type: "button", children: [jsx(Image, { className: styles$K.flag, height: 24, image: { 1: flagSrc, 2: flagSrc, 3: flagSrc, altText: abbreviation }, title: abbreviation, width: 24 }), jsxs("div", { className: styles$K.text, children: [showCountry && (jsxs(Fragment, { children: [jsx("span", { children: t(`clSelector.${selectedCountry.abbreviation}`) }), jsx("span", { className: styles$K.divider, children: "-" })] })), jsx("span", { children: selectedLanguage.description })] })] }));
|
|
7949
7950
|
}
|
|
7950
7951
|
|
|
7951
7952
|
async function fetchCountriesLanguages() {
|
|
@@ -8010,9 +8011,21 @@ function useFetchCountriesLanguages({ enabled = true, } = { enabled: true }) {
|
|
|
8010
8011
|
});
|
|
8011
8012
|
}
|
|
8012
8013
|
|
|
8014
|
+
function useUpdateLocale() {
|
|
8015
|
+
return useMutation({
|
|
8016
|
+
mutationFn: updateLocale,
|
|
8017
|
+
throwOnError: true,
|
|
8018
|
+
});
|
|
8019
|
+
}
|
|
8020
|
+
|
|
8013
8021
|
function useCookie(name, options) {
|
|
8014
8022
|
const cookieValue = Cookies.get()[name];
|
|
8015
8023
|
const [stateValue, setStateValue] = useState(cookieValue);
|
|
8024
|
+
useEffect(() => {
|
|
8025
|
+
if (cookieValue === stateValue)
|
|
8026
|
+
return;
|
|
8027
|
+
setStateValue(cookieValue);
|
|
8028
|
+
}, [cookieValue, stateValue]);
|
|
8016
8029
|
function setValue(valueOrFn) {
|
|
8017
8030
|
setStateValue(oldValue => {
|
|
8018
8031
|
const newValue = typeof valueOrFn === 'function' ? valueOrFn(oldValue) : valueOrFn;
|
|
@@ -8053,6 +8066,7 @@ const cookieOptions = {
|
|
|
8053
8066
|
};
|
|
8054
8067
|
function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
|
|
8055
8068
|
const [sessionCountries, setSessionCountries] = useSessionStorage('countries-v1');
|
|
8069
|
+
const { mutate: updateLocale } = useUpdateLocale();
|
|
8056
8070
|
const [currentCountryId] = useCookie('CurrentCountryId', cookieOptions);
|
|
8057
8071
|
const [currentLanguageId] = useCookie('CurrentLanguageId', cookieOptions);
|
|
8058
8072
|
const [contextLanguageCode] = useCookie('SetContextLanguageCode', cookieOptions);
|
|
@@ -8067,7 +8081,7 @@ function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }) {
|
|
|
8067
8081
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8068
8082
|
}, [apiCountries]);
|
|
8069
8083
|
async function updateCountryLanguage({ country, language, }) {
|
|
8070
|
-
|
|
8084
|
+
updateLocale({ countryId: country.id, languageId: language.id });
|
|
8071
8085
|
}
|
|
8072
8086
|
if (error)
|
|
8073
8087
|
throw error;
|
|
@@ -8113,16 +8127,25 @@ function CountrySelector({ defaultCountryCode, defaultLanguageCode, onChange, sh
|
|
|
8113
8127
|
defaultCountryCode,
|
|
8114
8128
|
defaultLanguageCode,
|
|
8115
8129
|
});
|
|
8130
|
+
const isCountryLanguageSelected = useMemo(() => selectedCountry !== undefined && selectedLanguage !== undefined, [selectedCountry, selectedLanguage]);
|
|
8131
|
+
const isDismissable = isCountryLanguageSelected;
|
|
8116
8132
|
useEffect(() => {
|
|
8117
|
-
setIsOpen(
|
|
8133
|
+
setIsOpen(!isCountryLanguageSelected);
|
|
8118
8134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8119
|
-
}, [
|
|
8135
|
+
}, [isCountryLanguageSelected]);
|
|
8120
8136
|
if (isFetching)
|
|
8121
8137
|
return null;
|
|
8122
|
-
return (jsxs(Fragment, { children: [jsx(CountrySelectorTrigger, { onClick: open, selectedCountry: selectedCountry, selectedLanguage: selectedLanguage, showCountry: showCountry }), jsx(CountrySelectorDialog, { countries: countries, isOpen: isOpen,
|
|
8123
|
-
|
|
8138
|
+
return (jsxs(Fragment, { children: [jsx(CountrySelectorTrigger, { onClick: open, selectedCountry: selectedCountry, selectedLanguage: selectedLanguage, showCountry: showCountry }), jsx(CountrySelectorDialog, { countries: countries, isDismissable: isDismissable, isOpen: isOpen, onOpenChange: open => {
|
|
8139
|
+
if (!isDismissable)
|
|
8140
|
+
return;
|
|
8141
|
+
setIsOpen(open);
|
|
8142
|
+
}, onSubmit: async ({ country, language }) => {
|
|
8143
|
+
if (selectedCountry?.id === country.id &&
|
|
8144
|
+
selectedLanguage?.id === language.id)
|
|
8145
|
+
return close();
|
|
8146
|
+
await updateCountryLanguage({ country, language });
|
|
8124
8147
|
close();
|
|
8125
|
-
onChange?.(
|
|
8148
|
+
onChange?.({ country, language });
|
|
8126
8149
|
}, selectedCountry: selectedCountry || defaultCountry, selectedLanguage: selectedLanguage || defaultLanguage, showCountry: showCountry })] }));
|
|
8127
8150
|
}
|
|
8128
8151
|
|
|
@@ -8251,39 +8274,57 @@ function useLanguageCode() {
|
|
|
8251
8274
|
return languageCode;
|
|
8252
8275
|
}
|
|
8253
8276
|
|
|
8254
|
-
|
|
8255
|
-
|
|
8277
|
+
async function fetchAnnouncements({ languageCode, }) {
|
|
8278
|
+
return await request({
|
|
8279
|
+
headers: { 'Current-Language-Id': languageCode },
|
|
8280
|
+
url: `${config.BFF_API_URL}/notification/announcement`,
|
|
8281
|
+
});
|
|
8282
|
+
}
|
|
8283
|
+
|
|
8284
|
+
const announcementTypes = ['promo', 'service'];
|
|
8285
|
+
const announcementSubTypes = [
|
|
8286
|
+
'sales',
|
|
8287
|
+
'news',
|
|
8288
|
+
'critical',
|
|
8256
8289
|
'informative',
|
|
8257
8290
|
'notice',
|
|
8258
|
-
'
|
|
8291
|
+
'event',
|
|
8292
|
+
'new_product_introduction',
|
|
8259
8293
|
];
|
|
8260
8294
|
function isAnnouncementType(type) {
|
|
8261
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8262
8295
|
return announcementTypes.includes(type);
|
|
8263
8296
|
}
|
|
8297
|
+
function isAnnouncementSubtype(subtype) {
|
|
8298
|
+
return announcementSubTypes.includes(subtype);
|
|
8299
|
+
}
|
|
8264
8300
|
|
|
8265
8301
|
function useFetchAnnouncements({ languageCode, }) {
|
|
8266
8302
|
return useQuery({
|
|
8267
8303
|
gcTime: 1 * TIME.DAY,
|
|
8268
|
-
queryFn:
|
|
8269
|
-
headers: { 'Current-Language-Id': languageCode },
|
|
8270
|
-
url: `${config.BFF_API_URL}/notification/announcement`,
|
|
8271
|
-
}),
|
|
8304
|
+
queryFn: () => fetchAnnouncements({ languageCode }),
|
|
8272
8305
|
queryKey: ['announcements', languageCode],
|
|
8273
8306
|
refetchInterval: 5 * TIME.MINUTE,
|
|
8274
|
-
select: ({ body }) =>
|
|
8275
|
-
if (
|
|
8276
|
-
|
|
8277
|
-
return {
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8307
|
+
select: ({ body }) => {
|
|
8308
|
+
if (typeof body === 'string')
|
|
8309
|
+
return [];
|
|
8310
|
+
return body.map(({ endDate, href, id, startDate, subType, text, title, type }) => {
|
|
8311
|
+
if (!isAnnouncementType(type))
|
|
8312
|
+
throw new Error(`Invalid announcement type: ${type}`);
|
|
8313
|
+
if (!isAnnouncementSubtype(subType)) {
|
|
8314
|
+
throw new Error(`Invalid announcement subType: ${subType}`);
|
|
8315
|
+
}
|
|
8316
|
+
return {
|
|
8317
|
+
endDate: endDate ? new Date(endDate) : undefined,
|
|
8318
|
+
href,
|
|
8319
|
+
id,
|
|
8320
|
+
startDate: startDate ? new Date(startDate) : undefined,
|
|
8321
|
+
subType,
|
|
8322
|
+
text,
|
|
8323
|
+
title,
|
|
8324
|
+
type,
|
|
8325
|
+
};
|
|
8326
|
+
});
|
|
8327
|
+
},
|
|
8287
8328
|
staleTime: 1 * TIME.DAY,
|
|
8288
8329
|
});
|
|
8289
8330
|
}
|
|
@@ -8308,16 +8349,35 @@ function GlyphsArrowSemiBoldRightIcon(props) {
|
|
|
8308
8349
|
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "11", viewBox: "0 0 11 11", width: "11", children: jsx("path", { d: "M4.27243829,10 C4.05910402,10.0007527 3.92860879,9.73966348 4.04161427,9.53832073 L6.25359309,5.59919963 C6.37846177,5.37673437 6.36029412,5.09278754 6.20830955,4.89272723 L4.38978231,2.4963789 C4.24091607,2.30024134 4.36625928,2 4.59701551,2 L6.06357848,2 C6.14343478,2 6.2192237,2.03915207 6.27074389,2.10704584 L7.47868905,3.69877757 C8.09849054,4.51523787 8.1726525,5.67297753 7.66341606,6.57973654 L5.82495864,9.85357414 C5.77553993,9.94153429 5.68904024,9.99509493 5.59582936,9.99539668 L4.27243829,10 Z", fillRule: "evenodd" }) }));
|
|
8309
8350
|
}
|
|
8310
8351
|
|
|
8352
|
+
function SolidEventIcon(props) {
|
|
8353
|
+
return (jsx("svg", { height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M5.151 21h13.708C20.956 21 22 19.983 22 17.969V6.031C22 4.017 20.956 3 18.859 3H5.151C3.054 3 2 4.007 2 6.031v11.938C2 19.993 3.054 21 5.151 21zm-.15-1.574c-.894 0-1.385-.46-1.385-1.369v-9.22c0-.9.491-1.369 1.385-1.369h13.988c.894 0 1.395.47 1.395 1.369v9.22c0 .91-.501 1.369-1.395 1.369H5.001zm5.047-8.448h.592c.351 0 .462-.098.462-.44v-.577c0-.342-.11-.45-.462-.45h-.592c-.351 0-.471.108-.471.45v.577c0 .342.12.44.471.44zm3.332 0h.592c.351 0 .472-.098.472-.44v-.577c0-.342-.12-.45-.472-.45h-.592c-.351 0-.472.108-.472.45v.577c0 .342.12.44.472.44zm3.331 0h.593c.35 0 .471-.098.471-.44v-.577c0-.342-.12-.45-.471-.45h-.593c-.35 0-.461.108-.461.45v.577c0 .342.11.44.461.44zm-9.994 3.197h.582c.36 0 .471-.097.471-.44v-.576c0-.343-.11-.44-.471-.44h-.582c-.362 0-.472.097-.472.44v.576c0 .343.11.44.472.44zm3.331 0h.592c.351 0 .462-.097.462-.44v-.576c0-.343-.11-.44-.462-.44h-.592c-.351 0-.471.097-.471.44v.576c0 .343.12.44.471.44zm3.332 0h.592c.351 0 .472-.097.472-.44v-.576c0-.343-.12-.44-.472-.44h-.592c-.351 0-.472.097-.472.44v.576c0 .343.12.44.472.44zm3.331 0h.593c.35 0 .471-.097.471-.44v-.576c0-.343-.12-.44-.471-.44h-.593c-.35 0-.461.097-.461.44v.576c0 .343.11.44.461.44zm-9.994 3.207h.582c.36 0 .471-.107.471-.45v-.576c0-.342-.11-.44-.471-.44h-.582c-.362 0-.472.098-.472.44v.577c0 .342.11.45.472.45zm3.331 0h.592c.351 0 .462-.107.462-.45v-.576c0-.342-.11-.44-.462-.44h-.592c-.351 0-.471.098-.471.44v.577c0 .342.12.45.471.45zm3.332 0h.592c.351 0 .472-.107.472-.45v-.576c0-.342-.12-.44-.472-.44h-.592c-.351 0-.472.098-.472.44v.577c0 .342.12.45.472.45z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
8354
|
+
}
|
|
8355
|
+
|
|
8356
|
+
function SolidNewsIcon(props) {
|
|
8357
|
+
return (jsx("svg", { height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M17.992 3.784c1.64 0 2.453.813 2.453 2.422V18.12c0 1.61-.812 2.414-2.453 2.414H5.632c.61-.336.806-.804.806-1.64V6.206c0-1.61.82-2.422 2.453-2.422zm-5.984 9.132h-2a1 1 0 0 0-1 1v2.5a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2.5a1 1 0 0 0-1-1zm5.271 2.908h-2.558a.72.72 0 1 0 0 1.442h2.558a.72.72 0 0 0 0-1.442zm0-2.941h-2.558a.72.72 0 0 0 0 1.441h2.558a.72.72 0 0 0 0-1.441zm0-2.942H9.721a.72.72 0 1 0 0 1.442h7.558a.72.72 0 0 0 0-1.442zm0-2.941H9.721a.72.72 0 0 0 0 1.441h7.558a.72.72 0 0 0 0-1.441zM2.992 11.402v6.976c0 .57.414.938.961.938.547-.008.961-.368.961-.938V9.933h-.383c-.953 0-1.539.539-1.539 1.469z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
8358
|
+
}
|
|
8359
|
+
|
|
8360
|
+
function SolidSaleIcon(props) {
|
|
8361
|
+
return (jsx("svg", { height: "24", viewBox: "0 0 24 24", width: "24", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm3.45 5.318c-.638 0-1.26.128-1.26.128l-6.582 9.426.04.008c.143.028.648.12 1.188.12a7.52 7.52 0 0 0 1.216-.12l.044-.008 6.582-9.426s-.622-.128-1.228-.128zm.093 5.465c-1.61 0-2.36.754-2.536 1.86l-.08.465c-.19 1.122.351 1.876 1.962 1.876 1.61 0 2.36-.754 2.535-1.876l.08-.465c.175-1.106-.351-1.86-1.961-1.86zm-.24 1.54c.383 0 .51.095.463.32l-.08.465c-.032.224-.175.337-.558.337-.383 0-.494-.113-.462-.337l.08-.465c.047-.225.19-.32.557-.32zM9.646 7c-1.594 0-2.375.754-2.55 1.876l-.064.465c-.176 1.106.366 1.86 1.96 1.86 1.611 0 2.376-.754 2.552-1.86l.064-.465C11.783 7.754 11.257 7 9.646 7zm-.255 1.555c.383 0 .51.097.463.321l-.064.465c-.048.224-.191.337-.574.337-.383 0-.494-.113-.446-.337l.063-.465c.048-.224.192-.32.558-.32z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
8362
|
+
}
|
|
8363
|
+
|
|
8364
|
+
function SolidTagIcon(props) {
|
|
8365
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, fill: "currentColor", height: "24", viewBox: "0 0 24 24", width: "24", children: jsx("path", { d: "M12.3939152,3.13425293 L21.8214774,12.5616776 C22.0595075,12.7995703 22.0595075,13.1851489 21.8214774,13.4230416 L13.4230416,21.8214774 C13.3042327,21.9404237 13.1482962,21.9999656 12.9923596,21.9999656 C12.836423,21.9999656 12.6804864,21.9404237 12.5616776,21.8214774 L3.13425293,12.3940527 C1.62191569,10.8815779 1.62191569,8.42069529 3.13425293,6.90835804 L6.90835804,3.13425293 C8.42069529,1.62191569 10.8815779,1.62191569 12.3939152,3.13425293 Z M8.83153453,7.43397705 C8.44568089,7.04812342 7.82028447,7.04812342 7.43443084,7.43397705 C7.04871471,7.81983069 7.04871471,8.44522711 7.43443084,8.83108074 C7.82028447,9.21679687 8.44568089,9.21679687 8.83153453,8.83108074 C9.21738817,8.44522711 9.21738817,7.81983069 8.83153453,7.43397705 Z", fillRule: "evenodd" }) }));
|
|
8366
|
+
}
|
|
8367
|
+
|
|
8311
8368
|
var styles$C = {"announcement":"announcement-module-Xi0L5","wrapper":"announcement-module-4XVjD","icon":"announcement-module-lxmA2","content":"announcement-module-1Jn7y","title":"announcement-module-8k2rK","text":"announcement-module-yXGsN","close":"announcement-module-gZ9ae","informative":"announcement-module-0LTWL","notice":"announcement-module-Ga3lN","critical":"announcement-module-S3nSW","promo":"announcement-module-E6DqW"};
|
|
8312
8369
|
|
|
8313
8370
|
const iconMap = {
|
|
8314
8371
|
critical: jsx(SolidAttentionIcon, {}),
|
|
8372
|
+
event: jsx(SolidEventIcon, {}),
|
|
8315
8373
|
informative: jsx(SolidInformationIcon, {}),
|
|
8374
|
+
new_product_introduction: jsx(SolidTagIcon, {}),
|
|
8375
|
+
news: jsx(SolidNewsIcon, {}),
|
|
8316
8376
|
notice: jsx(SolidNoticeIcon, {}),
|
|
8317
|
-
|
|
8377
|
+
sales: jsx(SolidSaleIcon, {}),
|
|
8318
8378
|
};
|
|
8319
|
-
function Announcement({ announcement: { href, id, text, title, type }, onDismiss, }) {
|
|
8320
|
-
return (jsxs(RouteLink, { className: clsx(styles$C.announcement, styles$C[type]), href: href, children: [jsxs("div", { className: styles$C.wrapper, children: [jsx("div", { className: styles$C.icon, children: iconMap[
|
|
8379
|
+
function Announcement({ announcement: { href, id, subType, text, title, type }, onDismiss, }) {
|
|
8380
|
+
return (jsxs(RouteLink, { className: clsx(styles$C.announcement, styles$C[type], styles$C[subType]), href: href, children: [jsxs("div", { className: styles$C.wrapper, children: [jsx("div", { className: styles$C.icon, children: iconMap[subType] }), jsxs("div", { className: styles$C.content, children: [jsx("h2", { className: styles$C.title, children: title }), jsxs("p", { className: styles$C.text, children: [text, jsx(GlyphsArrowSemiBoldRightIcon, {})] })] })] }), jsx("div", { className: styles$C.close, children: jsx(IconButton, { color: "current-color", onClick: () => onDismiss?.(id), children: jsx(StrokeCloseboxIcon, {}) }) })] }));
|
|
8321
8381
|
}
|
|
8322
8382
|
|
|
8323
8383
|
const now = () => new Date();
|
|
@@ -8345,9 +8405,14 @@ var styles$B = {"announcement-provider":"announcement-provider-module-sVIKY","an
|
|
|
8345
8405
|
function AnnouncementProvider() {
|
|
8346
8406
|
const languageCode = useLanguageCode();
|
|
8347
8407
|
const nodeRef = useRef(null);
|
|
8348
|
-
const { data: announcements } = useFetchAnnouncements({
|
|
8408
|
+
const { data: announcements, error } = useFetchAnnouncements({
|
|
8349
8409
|
languageCode,
|
|
8350
8410
|
});
|
|
8411
|
+
useEffect(() => {
|
|
8412
|
+
if (!error)
|
|
8413
|
+
return;
|
|
8414
|
+
console.error(error);
|
|
8415
|
+
}, [error]);
|
|
8351
8416
|
const [dismissedIds, setDismissedIds] = useLocalStorage('dismissedAnnouncementIds', []);
|
|
8352
8417
|
const filteredAnnouncements = announcements?.filter(({ id }) => !dismissedIds.includes(id));
|
|
8353
8418
|
return (jsx(TransitionGroup, { className: styles$B['announcement-provider'], children: filteredAnnouncements?.map(announcement => (jsx(CSSTransition, { classNames: {
|
|
@@ -10388,7 +10453,9 @@ function ConnectedSearchInput() {
|
|
|
10388
10453
|
const t = useFormattedMessage();
|
|
10389
10454
|
const navigate = useNavigate();
|
|
10390
10455
|
return (jsx(SearchInput, { autocomplete: autocomplete, formRef: formRef, inputRef: inputRef, onCancel: close, onSubmit: () => {
|
|
10391
|
-
|
|
10456
|
+
if (!inputRef.current?.value)
|
|
10457
|
+
return;
|
|
10458
|
+
navigate(`/search?keyword=${encodeURIComponent(inputRef.current.value)}`);
|
|
10392
10459
|
return close();
|
|
10393
10460
|
}, placeholder: t('What are you searching for?') }));
|
|
10394
10461
|
}
|
|
@@ -10499,7 +10566,7 @@ function StrokeRecentIcon(props) {
|
|
|
10499
10566
|
function WithResults() {
|
|
10500
10567
|
const { state } = useAlgoliaSearch();
|
|
10501
10568
|
const { close } = useGlobalSearchDisclosure();
|
|
10502
|
-
return (jsx("div", { children: jsx(SectionContainer, { buttons: jsxs(RouteButton, { className: clsx(styles$3['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${state.query}`, onClick: close, children: [jsx(FormattedMessage, { id: "See all results" }), jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })] }), leftContent: jsx(SuggestionsSection, {}), rightContent: jsx(ProductResultsSection, {}) }) }));
|
|
10569
|
+
return (jsx("div", { children: jsx(SectionContainer, { buttons: jsxs(RouteButton, { className: clsx(styles$3['show-all-button'], buttonStyles.button, buttonStyles.secondary, buttonStyles.outline, buttonStyles.md), href: `/search?keyword=${encodeURIComponent(state.query)}`, onClick: close, children: [jsx(FormattedMessage, { id: "See all results" }), jsx(GlyphsArrowBoldCapsRightIcon, { className: buttonStyles['right-arrow-icon'] })] }), leftContent: jsx(SuggestionsSection, {}), rightContent: jsx(ProductResultsSection, {}) }) }));
|
|
10503
10570
|
}
|
|
10504
10571
|
function SuggestionsSection() {
|
|
10505
10572
|
const { autocomplete, categories, querySuggestions, recentSearches } = useAlgoliaSearch();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PrintButton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { PrintButton } from './print-button';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof PrintButton;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface CartTotalsProps {
|
|
3
|
+
buttons?: ReactElement;
|
|
4
|
+
fulfillmentMethod?: string;
|
|
5
|
+
orderNumber?: string;
|
|
6
|
+
shippingCost: string;
|
|
7
|
+
subtotal: string;
|
|
8
|
+
tax: string;
|
|
9
|
+
total: string;
|
|
10
|
+
vatPercentage: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function CartTotals({ buttons, fulfillmentMethod, orderNumber, shippingCost, subtotal, tax, total, vatPercentage, }: CartTotalsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CartTotals } from './cart-totals';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof CartTotals;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Cart: Story;
|
|
14
|
+
export declare const Shipping: Story;
|
|
15
|
+
export declare const ReviewAndPayment: Story;
|
|
16
|
+
export declare const OrderConfirmation: Story;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Country, Language } from 'shared/model/countries-languages';
|
|
2
2
|
export interface CountrySelectorDialogProps {
|
|
3
3
|
countries: Country[];
|
|
4
|
+
isDismissable?: boolean;
|
|
4
5
|
isOpen: boolean;
|
|
6
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
5
7
|
onSubmit: ({ country, language, }: {
|
|
6
8
|
country: Country;
|
|
7
9
|
language: Language;
|
|
@@ -10,4 +12,4 @@ export interface CountrySelectorDialogProps {
|
|
|
10
12
|
selectedLanguage: Language;
|
|
11
13
|
showCountry?: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, selectedLanguage, showCountry, }: CountrySelectorDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function CountrySelectorDialog({ countries, isDismissable, isOpen, onOpenChange, onSubmit, selectedCountry, selectedLanguage, showCountry, }: CountrySelectorDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SolidEventIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SolidNewsIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SolidSaleIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Cancel' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Continue shopping' | 'Country' | 'Create new list' | 'create account' | 'Double check your spelling' | 'Downloads' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'Hide filters' | 'Incl. VAT' | 'Includes' | 'Language' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Product Features' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Shop more efficiently and quicker with a favorites list' | 'Easily add your favorite products' | 'Your favorites are available on multiple devices' | 'Save' | 'Share your favorite list with others' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Suggestions' | 'The product has been added to your cart.' | 'The product has been updated in your cart.' | 'The product has been removed from your cart.' | 'Unable to add the product to your cart.' | 'Unable to update the product in your cart.' | 'Unable to remove the product from your cart.' | 'Try another search' | 'Use fewer keywords' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
1
|
+
export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Cancel' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Continue shopping' | 'Cost overview' | 'Country' | 'Create new list' | 'create account' | 'Double check your spelling' | 'Downloads' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'Fulfillment method' | 'Hide filters' | 'Incl. VAT' | 'Includes' | 'Language' | 'List name already exists' | 'New list name' | 'Order number' | 'Please Sign In' | 'Popular searches' | 'Print' | 'Product Features' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Shop more efficiently and quicker with a favorites list' | 'Easily add your favorite products' | 'Your favorites are available on multiple devices' | 'Save' | 'Share your favorite list with others' | 'Shipping and handling' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Subtotal' | 'Suggestions' | 'The product has been added to your cart.' | 'The product has been updated in your cart.' | 'The product has been removed from your cart.' | 'Unable to add the product to your cart.' | 'Unable to update the product in your cart.' | 'Unable to remove the product from your cart.' | 'Try another search' | 'Total' | 'Use fewer keywords' | 'VAT' | 'Welcome to Sonic Equipment. Please choose your country and language below.' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
|
|
@@ -7,7 +7,7 @@ export interface ModalProps {
|
|
|
7
7
|
isFullScreen?: boolean;
|
|
8
8
|
isKeyboardDismissDisabled?: boolean;
|
|
9
9
|
isOpen: boolean;
|
|
10
|
-
onOpenChange
|
|
10
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
11
11
|
shouldCloseOnInteractOutside?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function Modal({ children, className, hasCloseButton, isDismissable, isFullScreen, isKeyboardDismissDisabled, isOpen, onOpenChange, shouldCloseOnInteractOutside, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ export interface AnnouncementProps {
|
|
|
3
3
|
announcement: AnnouncementType;
|
|
4
4
|
onDismiss?: (id: string) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare function Announcement({ announcement: { href, id, text, title, type }, onDismiss, }: AnnouncementProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function Announcement({ announcement: { href, id, subType, text, title, type }, onDismiss, }: AnnouncementProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
2
|
import { Announcement } from './announcement';
|
|
3
|
-
import { AnnouncementProvider } from './announcement-provider';
|
|
4
3
|
declare const meta: {
|
|
5
4
|
component: typeof Announcement;
|
|
6
5
|
parameters: {
|
|
@@ -11,8 +10,13 @@ declare const meta: {
|
|
|
11
10
|
};
|
|
12
11
|
export default meta;
|
|
13
12
|
type Story = StoryObj<typeof meta>;
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
13
|
+
export declare const PromoNewProductIntroduction: Story;
|
|
14
|
+
export declare const PromoEvent: Story;
|
|
15
|
+
export declare const PromoSale: Story;
|
|
16
|
+
export declare const PromoNews: Story;
|
|
17
|
+
export declare const ServiceInformative: Story;
|
|
18
|
+
export declare const ServiceNotice: Story;
|
|
19
|
+
export declare const ServiceCritical: Story;
|
|
20
|
+
export declare const Connected: StoryObj<{
|
|
21
|
+
languageCode: string;
|
|
22
|
+
}>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
+
import { FetchAnnouncementsArgs } from 'shared/api/bff/services/bff-service';
|
|
1
2
|
import { Announcement } from 'shared/model/announcement';
|
|
2
|
-
interface FetchAnnouncementsArgs {
|
|
3
|
-
languageCode: string;
|
|
4
|
-
}
|
|
5
3
|
export declare function useFetchAnnouncements({ languageCode, }: FetchAnnouncementsArgs): import("@tanstack/react-query").UseQueryResult<Announcement[], Error>;
|
|
6
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnnouncementResponse } from 'shared/api/bff/model/announcement.model';
|
|
2
|
+
export interface FetchAnnouncementsArgs {
|
|
3
|
+
languageCode: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function fetchAnnouncements({ languageCode, }: FetchAnnouncementsArgs): Promise<{
|
|
6
|
+
body: string | AnnouncementResponse;
|
|
7
|
+
headers: Headers;
|
|
8
|
+
status: number;
|
|
9
|
+
statusText: string;
|
|
10
|
+
}>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
export declare const announcementTypes: readonly ["promo", "
|
|
2
|
-
type AnnouncementType = (typeof announcementTypes)[number];
|
|
1
|
+
export declare const announcementTypes: readonly ["promo", "service"];
|
|
2
|
+
export type AnnouncementType = (typeof announcementTypes)[number];
|
|
3
|
+
export declare const announcementSubTypes: readonly ["sales", "news", "critical", "informative", "notice", "event", "new_product_introduction"];
|
|
4
|
+
export type AnnouncementSubType = (typeof announcementSubTypes)[number];
|
|
3
5
|
export interface Announcement {
|
|
4
6
|
endDate?: Date;
|
|
5
7
|
href: string;
|
|
6
8
|
id: string;
|
|
7
9
|
startDate?: Date;
|
|
10
|
+
subType: AnnouncementSubType;
|
|
8
11
|
text: string;
|
|
9
12
|
title: string;
|
|
10
13
|
type: AnnouncementType;
|
|
11
14
|
}
|
|
12
15
|
export declare function isAnnouncementType(type: string): type is AnnouncementType;
|
|
13
|
-
export
|
|
16
|
+
export declare function isAnnouncementSubtype(subtype: string): subtype is AnnouncementSubType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatPrice: (price: number) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SIZES: readonly ["xxl", "xl", "l", "m", "s", "xs", "xxs"];
|
|
1
|
+
export declare const SIZES: readonly ["xxl", "xl", "l", "m", "s", "xs", "xxs", "xxxs"];
|
|
2
2
|
export declare const TAGS: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "h7"];
|
|
3
3
|
type Size = (typeof SIZES)[number];
|
|
4
4
|
type Tag = (typeof TAGS)[number];
|
package/dist/styles.css
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
--font-weight-base: var(--font-weight-normal);
|
|
38
38
|
|
|
39
39
|
/* line heights */
|
|
40
|
+
--line-height-20: 1.25rem;
|
|
40
41
|
--line-height-22: 1.375rem;
|
|
41
42
|
--line-height-24: 1.5rem;
|
|
42
43
|
--line-height-28: 1.75rem;
|
|
@@ -88,6 +89,10 @@
|
|
|
88
89
|
--text-heading-xxs-size: var(--font-size-24);
|
|
89
90
|
--text-heading-xxs-line-height: var(--line-height-22);
|
|
90
91
|
--text-heading-xxs-line-height-uppercase: var(--line-height-24);
|
|
92
|
+
|
|
93
|
+
/* headings xxxs */
|
|
94
|
+
--text-heading-xxxs-size: var(--font-size-20);
|
|
95
|
+
--text-heading-xxxs-line-height: var(--line-height-20);
|
|
91
96
|
}
|
|
92
97
|
:root {
|
|
93
98
|
/*********************************************************
|
|
@@ -143,6 +148,7 @@
|
|
|
143
148
|
--color-red-950: #4d0206;
|
|
144
149
|
|
|
145
150
|
/* Neutrals */
|
|
151
|
+
--color-gray-25: #00000019;
|
|
146
152
|
--color-gray-50: #fbfbfb;
|
|
147
153
|
--color-gray-75: #f6f6f6;
|
|
148
154
|
--color-gray-100: #ededed;
|
|
@@ -230,8 +236,9 @@
|
|
|
230
236
|
--background-overlay-layer: 90;
|
|
231
237
|
--sidebar-layer: 100;
|
|
232
238
|
--search-layer: 200;
|
|
233
|
-
--
|
|
234
|
-
--
|
|
239
|
+
--sticky-bottom-price: 1300;
|
|
240
|
+
--modal-layer: 2000;
|
|
241
|
+
--zoom-image-layer: 2100;
|
|
235
242
|
}
|
|
236
243
|
:root {
|
|
237
244
|
--header-height-desktop: 96px;
|
|
@@ -2175,6 +2182,11 @@
|
|
|
2175
2182
|
line-height: var(--text-heading-xxs-line-height-uppercase);
|
|
2176
2183
|
}
|
|
2177
2184
|
|
|
2185
|
+
.heading-module-pMC65:where(.heading-module-qvrEk) {
|
|
2186
|
+
font-size: var(--text-heading-xxxs-size);
|
|
2187
|
+
line-height: var(--text-heading-xxxs-line-height);
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2178
2190
|
.dialog-module-qKzgy {
|
|
2179
2191
|
position: relative;
|
|
2180
2192
|
padding: var(--space-24);
|