@sonic-equipment/ui 0.0.88 → 0.0.90
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/.storybook/RenderHook.d.ts +1 -1
- package/dist/index.d.ts +117 -38
- package/dist/index.js +622 -367
- package/dist/src/algolia/{algolia-product-hit-type.d.ts → algolia-hit-type.d.ts} +17 -2
- package/dist/src/algolia/algolia-hits-provider.d.ts +6 -0
- package/dist/src/algolia/use-algolia-hits.d.ts +10 -0
- package/dist/src/algolia/use-algolia-search.d.ts +3 -3
- package/dist/src/carousel/card-carousel/card-carousel.d.ts +10 -0
- package/dist/src/carousel/{product-carousel/product-carousel.stories.d.ts → card-carousel/product-card-carousel.stories.d.ts} +3 -3
- package/dist/src/carousel/card-carousel/promo-card-carousel.stories.d.ts +20 -0
- package/dist/src/carousel/promo-card-carousel/promo-card-carousel.d.ts +10 -0
- package/dist/src/country-selector/country-selector-dialog/country-selector-dialog.d.ts +13 -0
- package/dist/src/country-selector/country-selector-dialog/country-selector-dialog.stories.d.ts +20 -0
- package/dist/src/country-selector/country-selector-trigger/country-selector-trigger.d.ts +8 -0
- package/dist/src/country-selector/country-selector-trigger/country-selector-trigger.stories.d.ts +16 -0
- package/dist/src/country-selector/country-selector.d.ts +12 -0
- package/dist/src/country-selector/country-selector.stories.d.ts +19 -0
- package/dist/src/country-selector/use-countries-languages.d.ts +43 -0
- package/dist/src/country-selector/use-countries-languages.stories.d.ts +9 -0
- package/dist/src/forms/select/select.d.ts +2 -1
- package/dist/src/global-search/types.d.ts +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/intl/translation-id.d.ts +1 -1
- package/dist/src/modals/dialog/dialog.d.ts +1 -1
- package/dist/src/modals/dialog/dialog.stories.d.ts +1 -0
- package/dist/src/modals/modal/modal.d.ts +1 -1
- package/dist/src/modals/modal/modal.stories.d.ts +0 -1
- package/dist/src/pages/product-listing-page/product-listing-page-data-types.d.ts +3 -3
- package/dist/src/promos/promo-banner/promo-banner.d.ts +7 -0
- package/dist/src/promos/promo-banner/promo-banner.stories.d.ts +19 -0
- package/dist/src/promos/promo-banners/promo-banners.d.ts +8 -0
- package/dist/src/promos/{promo-cards/promo-cards.stories.d.ts → promo-banners/promo-banners.stories.d.ts} +3 -3
- package/dist/src/promos/promo-card/promo-card.d.ts +5 -5
- package/dist/src/promos/promo-card/promo-card.stories.d.ts +1 -8
- package/dist/src/shared/api/bff/model/bff.model.d.ts +4 -4
- package/dist/src/shared/api/storefront/hooks/website/use-fetch-countries-languages.d.ts +4 -0
- package/dist/src/shared/api/storefront/hooks/website/use-fetch-countries.d.ts +1 -0
- package/dist/src/shared/api/storefront/hooks/website/use-update-language-by-id.d.ts +2 -0
- package/dist/src/shared/api/storefront/hooks/website/website.stories.d.ts +10 -0
- package/dist/src/shared/api/storefront/services/website-service.d.ts +9 -0
- package/dist/src/shared/hooks/use-cookie.d.ts +8 -0
- package/dist/src/shared/hooks/use-disclosure.d.ts +1 -0
- package/dist/src/shared/hooks/use-session-storage.d.ts +6 -0
- package/dist/src/shared/model/countries-languages.d.ts +13 -0
- package/dist/src/shared/model/{product-hit.d.ts → hit.d.ts} +12 -1
- package/dist/styles.css +520 -373
- package/package.json +3 -1
- package/dist/src/algolia/algolia-products-hits-provider.d.ts +0 -6
- package/dist/src/algolia/use-algolia-product-hits.d.ts +0 -10
- package/dist/src/carousel/product-carousel/product-carousel.d.ts +0 -10
- package/dist/src/promos/promo-cards/promo-cards.d.ts +0 -8
- package/dist/src/shared/utils/cookies.d.ts +0 -3
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { Hit } from '@algolia/client-search';
|
|
2
|
-
|
|
2
|
+
import { Image } from 'shared/model/image';
|
|
3
|
+
interface AlgoliaHitBase {
|
|
3
4
|
[key: string]: any;
|
|
5
|
+
type: 'promo' | 'product';
|
|
6
|
+
}
|
|
7
|
+
export interface AlgoliaPromo extends AlgoliaHitBase {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
image: Image;
|
|
10
|
+
isExternal: boolean;
|
|
11
|
+
type: 'promo';
|
|
12
|
+
url: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AlgoliaProduct extends AlgoliaHitBase {
|
|
15
|
+
[key: string]: unknown;
|
|
4
16
|
alternativeNumber: string;
|
|
5
17
|
categories: string[];
|
|
6
18
|
categoryPageId: string[];
|
|
@@ -32,9 +44,12 @@ interface AlgoliaProduct {
|
|
|
32
44
|
slug: string;
|
|
33
45
|
storefrontId: string;
|
|
34
46
|
storefrontSlug: string;
|
|
35
|
-
type: '
|
|
47
|
+
type: 'product';
|
|
36
48
|
weight: number;
|
|
37
49
|
width: number;
|
|
38
50
|
}
|
|
51
|
+
export declare function isAlgoliaProductHit(hit: AlgoliaHit): hit is AlgoliaProductHit;
|
|
52
|
+
export type AlgoliaPromoHit = Hit<AlgoliaPromo>;
|
|
39
53
|
export type AlgoliaProductHit = Hit<AlgoliaProduct>;
|
|
54
|
+
export type AlgoliaHit = AlgoliaPromoHit | AlgoliaProductHit;
|
|
40
55
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ProductHit, PromoHit } from 'shared/model/hit';
|
|
2
|
+
import { AlgoliaHit } from './algolia-hit-type';
|
|
3
|
+
export declare const useAlgoliaHitsItems: () => [AlgoliaHit[], import("shared/providers/global-state-provider").UpdateGlobalState<AlgoliaHit[]>];
|
|
4
|
+
export declare const useAlgoliaHitsLoading: () => [boolean | undefined, import("shared/providers/global-state-provider").UpdateGlobalState<boolean | undefined>];
|
|
5
|
+
interface UseHitsReturnType {
|
|
6
|
+
hits: (ProductHit | PromoHit)[];
|
|
7
|
+
isLoading: boolean | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function useAlgoliaHits(): UseHitsReturnType;
|
|
10
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { PopularSearchHit } from 'global-search/plugins/popular-searches-plugin'
|
|
|
5
5
|
import { QuerySuggestionHit } from 'global-search/plugins/query-suggestions-plugin';
|
|
6
6
|
import { QuickAccessHit } from 'global-search/plugins/quick-access-plugin';
|
|
7
7
|
import { RecentSearchHit } from 'global-search/plugins/recent-searches-plugin';
|
|
8
|
-
import {
|
|
8
|
+
import { AlgoliaHit } from './algolia-hit-type';
|
|
9
9
|
interface ExtendedAutoCompleteCollection<T extends BaseItem> extends AutocompleteCollection<T> {
|
|
10
10
|
source: ExtendedInternalAutocompleteSource<T>;
|
|
11
11
|
}
|
|
@@ -18,8 +18,8 @@ export declare function useAlgoliaSearch(): {
|
|
|
18
18
|
popularCategories: AutocompleteCollection<PopularCategoryHit> | undefined;
|
|
19
19
|
popularSearches: AutocompleteCollection<PopularSearchHit> | undefined;
|
|
20
20
|
products: {
|
|
21
|
-
items: import("shared/model/
|
|
22
|
-
source: InternalAutocompleteSource<
|
|
21
|
+
items: (import("shared/model/hit").PromoHit | import("shared/model/hit").ProductHit)[];
|
|
22
|
+
source: InternalAutocompleteSource<AlgoliaHit>;
|
|
23
23
|
} | undefined;
|
|
24
24
|
querySuggestions: AutocompleteCollection<QuerySuggestionHit> | undefined;
|
|
25
25
|
quickAccess: AutocompleteCollection<QuickAccessHit> | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CarouselProps } from 'carousel/carousel';
|
|
3
|
+
export interface CardCarouselProps {
|
|
4
|
+
allowExpandToGrid?: boolean;
|
|
5
|
+
cardWidth?: 'normal' | 'narrow' | 'auto';
|
|
6
|
+
cards: ReactNode[];
|
|
7
|
+
cardsPerView?: CarouselProps['slidesPerView'];
|
|
8
|
+
hasOverflow?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function CardCarousel({ allowExpandToGrid, cards, cardsPerView, cardWidth, hasOverflow, }: CardCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { CardCarousel } from './card-carousel';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
args: {
|
|
5
|
-
|
|
5
|
+
cards: import("react/jsx-runtime").JSX.Element[];
|
|
6
6
|
};
|
|
7
|
-
component: typeof
|
|
7
|
+
component: typeof CardCarousel;
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
10
10
|
tags: string[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CardCarousel } from './card-carousel';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
args: {
|
|
5
|
+
cards: import("react/jsx-runtime").JSX.Element[];
|
|
6
|
+
};
|
|
7
|
+
component: typeof CardCarousel;
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
};
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Small: Story;
|
|
17
|
+
export declare const Medium: Story;
|
|
18
|
+
export declare const Large: Story;
|
|
19
|
+
export declare const Narrow: Story;
|
|
20
|
+
export declare const Hover: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CarouselProps } from 'carousel/carousel';
|
|
3
|
+
interface PromoCardCarouselProps {
|
|
4
|
+
cardWidth?: 'normal' | 'narrow' | 'auto';
|
|
5
|
+
hasOverflow?: boolean;
|
|
6
|
+
promoCards: ReactNode[];
|
|
7
|
+
promosPerView?: CarouselProps['slidesPerView'];
|
|
8
|
+
}
|
|
9
|
+
export declare function PromoCardCarousel({ promoCards }: PromoCardCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Country, Language } from 'shared/model/countries-languages';
|
|
2
|
+
export interface CountrySelectorDialogProps {
|
|
3
|
+
countries: Country[];
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onSubmit: ({ country, language, }: {
|
|
6
|
+
country: Country;
|
|
7
|
+
language: Language;
|
|
8
|
+
}) => void;
|
|
9
|
+
selectedCountry: Country;
|
|
10
|
+
selectedLanguage: Language;
|
|
11
|
+
showCountry?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function CountrySelectorDialog({ countries, isOpen, onSubmit, selectedCountry, selectedLanguage, showCountry, }: CountrySelectorDialogProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/src/country-selector/country-selector-dialog/country-selector-dialog.stories.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CountrySelectorDialog } from './country-selector-dialog';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
argTypes: {
|
|
5
|
+
isOpen: {
|
|
6
|
+
control: {
|
|
7
|
+
type: "boolean";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
component: typeof CountrySelectorDialog;
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
tags: string[];
|
|
16
|
+
title: string;
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Country, Language } from 'shared/model/countries-languages';
|
|
2
|
+
export interface CountrySelectorTriggerProps {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
selectedCountry: Country | undefined;
|
|
5
|
+
selectedLanguage: Language | undefined;
|
|
6
|
+
showCountry?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function CountrySelectorTrigger({ onClick, selectedCountry, selectedLanguage, showCountry, }: CountrySelectorTriggerProps): import("react/jsx-runtime").JSX.Element | undefined;
|
package/dist/src/country-selector/country-selector-trigger/country-selector-trigger.stories.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CountrySelectorTrigger } from './country-selector-trigger';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof CountrySelectorTrigger;
|
|
5
|
+
parameters: {
|
|
6
|
+
backgrounds: {
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
tags: string[];
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Country, Language } from 'shared/model/countries-languages';
|
|
2
|
+
interface CountrySelectorProps {
|
|
3
|
+
defaultCountryCode: string;
|
|
4
|
+
defaultLanguageCode: string;
|
|
5
|
+
onChange?: (args: {
|
|
6
|
+
country: Country;
|
|
7
|
+
language: Language;
|
|
8
|
+
}) => void;
|
|
9
|
+
showCountry?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function CountrySelector({ defaultCountryCode, defaultLanguageCode, onChange, showCountry, }: CountrySelectorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CountrySelector } from './country-selector';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
args: {
|
|
5
|
+
defaultCountryCode: string;
|
|
6
|
+
defaultLanguageCode: string;
|
|
7
|
+
};
|
|
8
|
+
component: typeof CountrySelector;
|
|
9
|
+
parameters: {
|
|
10
|
+
backgrounds: {
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CountriesLanguages, Country, Language } from 'shared/model/countries-languages';
|
|
2
|
+
interface UseCountriesLanguagesArgs {
|
|
3
|
+
defaultCountryCode: string;
|
|
4
|
+
defaultLanguageCode: string;
|
|
5
|
+
}
|
|
6
|
+
interface UseCountriesLanguagesReturnTypeFetching {
|
|
7
|
+
countries: undefined;
|
|
8
|
+
defaultCountry: undefined;
|
|
9
|
+
defaultLanguage: undefined;
|
|
10
|
+
isFetching: true;
|
|
11
|
+
selectedCountry: undefined;
|
|
12
|
+
selectedLanguage: undefined;
|
|
13
|
+
updateCountryLanguage(args: {
|
|
14
|
+
country: Country;
|
|
15
|
+
language: Language;
|
|
16
|
+
}): void;
|
|
17
|
+
}
|
|
18
|
+
interface UseCountriesLanguagesReturnTypeSelected {
|
|
19
|
+
countries: CountriesLanguages;
|
|
20
|
+
defaultCountry: Country;
|
|
21
|
+
defaultLanguage: Language;
|
|
22
|
+
isFetching: false;
|
|
23
|
+
selectedCountry: Country;
|
|
24
|
+
selectedLanguage: Language;
|
|
25
|
+
updateCountryLanguage(args: {
|
|
26
|
+
country: Country;
|
|
27
|
+
language: Language;
|
|
28
|
+
}): void;
|
|
29
|
+
}
|
|
30
|
+
interface UseCountriesLanguagesReturnType {
|
|
31
|
+
countries: CountriesLanguages;
|
|
32
|
+
defaultCountry: Country;
|
|
33
|
+
defaultLanguage: Language;
|
|
34
|
+
isFetching: false;
|
|
35
|
+
selectedCountry: Country | undefined;
|
|
36
|
+
selectedLanguage: Language | undefined;
|
|
37
|
+
updateCountryLanguage(args: {
|
|
38
|
+
country: Country;
|
|
39
|
+
language: Language;
|
|
40
|
+
}): void;
|
|
41
|
+
}
|
|
42
|
+
export declare function useCountriesLanguages({ defaultCountryCode, defaultLanguageCode, }: UseCountriesLanguagesArgs): UseCountriesLanguagesReturnType | UseCountriesLanguagesReturnTypeFetching | UseCountriesLanguagesReturnTypeSelected;
|
|
43
|
+
export {};
|
|
@@ -6,7 +6,8 @@ export interface SelectProps<T> {
|
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
selectedOption?: keyof T;
|
|
8
8
|
showLabel?: boolean;
|
|
9
|
+
showPlaceholder?: boolean;
|
|
9
10
|
size?: 'sm' | 'md';
|
|
10
11
|
variant?: 'outline' | 'solid';
|
|
11
12
|
}
|
|
12
|
-
export declare function Select<T extends object>({ isDisabled, label, onChange, options, placeholder, selectedOption, showLabel, size, variant, }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function Select<T extends object>({ isDisabled, label, onChange, options, placeholder, selectedOption, showLabel, showPlaceholder, size, variant, }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core';
|
|
2
|
-
import { AlgoliaProductHit } from 'algolia/algolia-
|
|
2
|
+
import { AlgoliaProductHit } from 'algolia/algolia-hit-type';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
import { CategoryHit } from './plugins/categories-plugin';
|
|
5
5
|
import { PopularCategoryHit } from './plugins/popular-categories-plugin';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export * from './shared/providers/global-state-provider';
|
|
|
34
34
|
export * from './shared/routing/route-provider';
|
|
35
35
|
export * from './shared/routing/route-link';
|
|
36
36
|
export * from './shared/routing/route-button';
|
|
37
|
-
export * from './shared/model/
|
|
37
|
+
export * from './shared/model/hit';
|
|
38
38
|
export * from './breadcrumbs/breadcrumb';
|
|
39
39
|
export * from './buttons/button/button';
|
|
40
40
|
export * from './buttons/favorite/favorite-button';
|
|
@@ -46,6 +46,7 @@ export * from './cards/product-card/product-card';
|
|
|
46
46
|
export * from './carousel/category-carousel/category-carousel';
|
|
47
47
|
export * from './collapsables/accordion/accordion';
|
|
48
48
|
export * from './collapsables/show-all/show-all';
|
|
49
|
+
export * from './country-selector/country-selector';
|
|
49
50
|
export * from './display/product-price/product-price';
|
|
50
51
|
export * from './display/product-sku/product-sku';
|
|
51
52
|
export * from './filters/multi-select/multi-select';
|
|
@@ -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' | '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' | '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' | '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' | 'Try another search' | 'Use fewer keywords' | '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' | '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' | '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';
|
|
@@ -15,5 +15,5 @@ interface DialogProps extends Omit<ModalProps, 'children'> {
|
|
|
15
15
|
title: string;
|
|
16
16
|
validationErrors?: ComponentProps<typeof AriaForm>['validationErrors'];
|
|
17
17
|
}
|
|
18
|
-
export declare function Dialog({ allowClose, children, className, dialogClassName, footer, hideTitle, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, onSubmit, title, validationErrors, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function Dialog({ allowClose, children, className, dialogClassName, footer, hasCloseButton, hideTitle, isDismissable, isFullScreen, isKeyboardDismissDisabled, isOpen, onOpenChange, onSubmit, title, validationErrors, }: DialogProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -9,4 +9,4 @@ export interface ModalProps {
|
|
|
9
9
|
isOpen: boolean;
|
|
10
10
|
onOpenChange: (isOpen: boolean) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare function Modal({ children, className,
|
|
12
|
+
export declare function Modal({ children, className, isDismissable, isFullScreen, isKeyboardDismissDisabled, isOpen, onOpenChange, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Image, ResponsiveImage } from 'shared/model/image';
|
|
2
|
-
export interface
|
|
2
|
+
export interface PromoBanner {
|
|
3
3
|
href: string;
|
|
4
4
|
image: ResponsiveImage;
|
|
5
5
|
}
|
|
@@ -17,8 +17,8 @@ export interface ProductListingPageData {
|
|
|
17
17
|
category: Category | undefined;
|
|
18
18
|
categoryPages: string;
|
|
19
19
|
hierarchicalCategories: string[];
|
|
20
|
-
|
|
21
|
-
top:
|
|
20
|
+
promoBanners?: {
|
|
21
|
+
top: PromoBanner[] | undefined;
|
|
22
22
|
};
|
|
23
23
|
subcategories: Category[] | undefined;
|
|
24
24
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ResponsiveImage } from 'shared/model/image';
|
|
2
|
+
export interface PromoBannerProps {
|
|
3
|
+
href?: string;
|
|
4
|
+
image: ResponsiveImage;
|
|
5
|
+
variant: 'sm' | 'lg';
|
|
6
|
+
}
|
|
7
|
+
export declare function PromoBanner({ href, image, variant }: PromoBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { PromoBanner } from './promo-banner';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof PromoBanner;
|
|
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 SmallSVP: Story;
|
|
14
|
+
export declare const SmallMVP: Story;
|
|
15
|
+
export declare const SmallLVP: Story;
|
|
16
|
+
export declare const LargeSVP: Story;
|
|
17
|
+
export declare const LargeMVP: Story;
|
|
18
|
+
export declare const LargeLVP: Story;
|
|
19
|
+
export declare const NoLink: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResponsiveImage } from 'shared/model/image';
|
|
2
|
+
export interface PromoBannersProps {
|
|
3
|
+
promoBannersData?: Array<{
|
|
4
|
+
href: string;
|
|
5
|
+
image: ResponsiveImage;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
export declare function PromoBanners({ promoBannersData }: PromoBannersProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { PromoBanners } from './promo-banners';
|
|
3
3
|
declare const meta: {
|
|
4
|
-
component: typeof
|
|
4
|
+
component: typeof PromoBanners;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
8
|
-
render: (args: import("./promo-
|
|
8
|
+
render: (args: import("./promo-banners").PromoBannersProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
tags: string[];
|
|
10
10
|
title: string;
|
|
11
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Image as ImageType } from 'shared/model/image';
|
|
2
2
|
export interface PromoCardProps {
|
|
3
|
-
href
|
|
4
|
-
image:
|
|
5
|
-
|
|
3
|
+
href: string;
|
|
4
|
+
image: ImageType;
|
|
5
|
+
onClick?: () => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function PromoCard({ href, image,
|
|
7
|
+
export declare function PromoCard({ href, image, onClick }: PromoCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,15 +5,8 @@ declare const meta: {
|
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
8
|
-
tags: string[];
|
|
9
8
|
title: string;
|
|
10
9
|
};
|
|
11
10
|
export default meta;
|
|
12
11
|
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const SmallMVP: Story;
|
|
15
|
-
export declare const SmallLVP: Story;
|
|
16
|
-
export declare const LargeSVP: Story;
|
|
17
|
-
export declare const LargeMVP: Story;
|
|
18
|
-
export declare const LargeLVP: Story;
|
|
19
|
-
export declare const NoLink: Story;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -26,12 +26,12 @@ interface Category {
|
|
|
26
26
|
uri: null;
|
|
27
27
|
urlSegment: string;
|
|
28
28
|
}
|
|
29
|
-
interface
|
|
29
|
+
interface PromoBanner {
|
|
30
30
|
href: string;
|
|
31
31
|
image: ResponsiveImage;
|
|
32
32
|
}
|
|
33
|
-
interface
|
|
34
|
-
top:
|
|
33
|
+
interface PromoBanners {
|
|
34
|
+
top: PromoBanner[] | null;
|
|
35
35
|
}
|
|
36
36
|
interface BreadCrumb {
|
|
37
37
|
href: string;
|
|
@@ -141,6 +141,6 @@ export interface ProductListingPageDataResponse {
|
|
|
141
141
|
categories: Category | null;
|
|
142
142
|
categoryPages: string;
|
|
143
143
|
hierarchicalCategories: string[];
|
|
144
|
-
|
|
144
|
+
promoBanners: PromoBanners | null;
|
|
145
145
|
}
|
|
146
146
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useFetchCountries(): import("@tanstack/react-query").UseQueryResult<import("../../model/shop.model").CountryModel[], Error>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
parameters: {
|
|
4
|
+
layout: string;
|
|
5
|
+
};
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export declare const UseFetchCountriesStory: StoryObj;
|
|
10
|
+
export declare const UseFetchCountryLanguagesStory: StoryObj;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CountryModel, LanguageModel, SessionModel } from 'shared/api/storefront/model/shop.model';
|
|
2
|
+
export declare function fetchCountries(): Promise<CountryModel[]>;
|
|
3
|
+
export declare function fetchCountriesLanguages(): Promise<{
|
|
4
|
+
countries: CountryModel[];
|
|
5
|
+
languages: LanguageModel[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare function updateLanguageById({ languageId, }: {
|
|
8
|
+
languageId: string;
|
|
9
|
+
}): Promise<SessionModel>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CookieAttributes } from 'js-cookie';
|
|
2
|
+
interface SetValueFn {
|
|
3
|
+
(value: string | undefined): void;
|
|
4
|
+
(fn: (value: string | undefined) => string | undefined): void;
|
|
5
|
+
}
|
|
6
|
+
type UseCookieReturnType = [string | undefined, SetValueFn];
|
|
7
|
+
export declare function useCookie(name: string, options?: CookieAttributes): UseCookieReturnType;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface UpdateSessionStorage<T> {
|
|
2
|
+
(value: T): void;
|
|
3
|
+
(fn: (value: T) => T): void;
|
|
4
|
+
}
|
|
5
|
+
export declare function useSessionStorage<T>(key: string): [T | undefined, UpdateSessionStorage<T | undefined>];
|
|
6
|
+
export declare function useSessionStorage<T>(key: string, initialState: T): [T, UpdateSessionStorage<T>];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Language {
|
|
2
|
+
cultureCode: string;
|
|
3
|
+
description: string;
|
|
4
|
+
id: string;
|
|
5
|
+
languageCode: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Country {
|
|
8
|
+
abbreviation: string;
|
|
9
|
+
id: string;
|
|
10
|
+
languages: Language[];
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export type CountriesLanguages = Country[];
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import { AlgoliaProductHit } from 'algolia/algolia-
|
|
1
|
+
import { AlgoliaProductHit, AlgoliaPromoHit } from 'algolia/algolia-hit-type';
|
|
2
2
|
import { Image } from 'shared/model/image';
|
|
3
|
+
export declare function transformAlgoliaPromoHitToPromoHit(algoliaPromoHit: AlgoliaPromoHit): PromoHit;
|
|
3
4
|
export declare function transformAlgoliaProductHitToProductHit(algoliaProductHit: AlgoliaProductHit): ProductHit;
|
|
5
|
+
export interface PromoHit {
|
|
6
|
+
hit: AlgoliaPromoHit;
|
|
7
|
+
href: string;
|
|
8
|
+
id: string;
|
|
9
|
+
image: Image;
|
|
10
|
+
isExternal: boolean;
|
|
11
|
+
type: 'promo';
|
|
12
|
+
}
|
|
4
13
|
export interface ProductHit {
|
|
5
14
|
hit: AlgoliaProductHit;
|
|
6
15
|
id: string;
|
|
@@ -15,4 +24,6 @@ export interface ProductHit {
|
|
|
15
24
|
queryId: string | undefined;
|
|
16
25
|
storefrontId: string;
|
|
17
26
|
storefrontSlug: string;
|
|
27
|
+
type: 'product';
|
|
18
28
|
}
|
|
29
|
+
export declare function isProductHit(hit: ProductHit | PromoHit): hit is ProductHit;
|