@sonic-equipment/ui 0.0.49 → 0.0.51
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/algolia/algolia-active-categories.d.ts +1 -0
- package/dist/algolia/algolia-categories-filters.d.ts +1 -0
- package/dist/algolia/algolia-filter-panel.d.ts +3 -2
- package/dist/algolia/algolia-insights-provider.d.ts +1 -1
- package/dist/algolia/algolia-multi-select-filter-section.d.ts +1 -1
- package/dist/{shared/types/product.d.ts → algolia/algolia-product-hit-type.d.ts} +2 -2
- package/dist/algolia/algolia-query-string-routing.d.ts +4 -1
- package/dist/algolia/filter-section.d.ts +26 -0
- package/dist/algolia/use-algolia-insights.d.ts +1 -1
- package/dist/algolia/use-algolia-product-hits.d.ts +2 -0
- package/dist/{global-search/global-search-provider → algolia}/use-algolia-search.d.ts +17 -7
- package/dist/cards/category-card/category-card.d.ts +7 -3
- package/dist/cards/product-card/product-card.d.ts +4 -4
- package/dist/cards/product-card/product-card.stories.d.ts +6 -2
- package/dist/config.d.ts +0 -1
- package/dist/global-search/categories-grid/categories-grid.d.ts +5 -0
- package/dist/global-search/plugins/products-plugin.d.ts +2 -2
- package/dist/global-search/search-section/search-list-item.d.ts +10 -0
- package/dist/global-search/search-section/search-list.d.ts +9 -0
- package/dist/global-search/search-section/search-section.d.ts +9 -0
- package/dist/global-search/types.d.ts +2 -2
- package/dist/index.d.ts +215 -155
- package/dist/index.js +571 -385
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/media/image/image.d.ts +2 -2
- package/dist/media/image/image.stories.d.ts +2 -1
- package/dist/pages/product-listing-page/product-listing-page-data-types.d.ts +11 -10
- package/dist/pages/product-listing-page/product-listing-page-provider/use-subcategories.d.ts +1 -1
- package/dist/promos/promo-card/promo-card.d.ts +3 -6
- package/dist/promos/promo-cards/promo-cards.d.ts +2 -2
- package/dist/promos/promo-cards/promo-cards.stories.d.ts +1 -1
- package/dist/shared/api/bff/model/bff.model.d.ts +6 -9
- package/dist/shared/api/shop/hooks/cart/use-add-product-to-current-cart.d.ts +1 -1
- package/dist/shared/api/shop/hooks/cart/use-fetch-current-cart-lines.d.ts +1 -1
- package/dist/shared/api/shop/hooks/cart/use-update-cart-line-by-id.d.ts +1 -1
- package/dist/shared/hooks/use-breakpoint.d.ts +2 -13
- package/dist/shared/hooks/use-is-breakpoint.d.ts +1 -1
- package/dist/shared/model/category.d.ts +6 -0
- package/dist/shared/model/image.d.ts +27 -0
- package/dist/shared/model/product-hit.d.ts +18 -0
- package/dist/shared/providers/global-state-provider.d.ts +3 -3
- package/dist/shared/utils/breakpoints.d.ts +12 -0
- package/dist/sidebar/sidebar-provider.d.ts +1 -1
- package/dist/sidebar/types.d.ts +10 -0
- package/dist/sidebar/use-sidebar.d.ts +3 -2
- package/dist/styles.css +252 -165
- package/package.json +3 -2
- package/dist/algolia/algolia-categories.d.ts +0 -1
- package/dist/global-search/search-result-panel/sections/search-content-section.d.ts +0 -3
- package/dist/shared/types/category.d.ts +0 -6
- package/dist/shared/types/image.d.ts +0 -30
- package/dist/sidebar/sidebar-context.d.ts +0 -8
- /package/dist/{global-search/global-search-provider → algolia}/algolia-search-provider.d.ts +0 -0
- /package/dist/algolia/{user-algolia-insights-provider-global-state.d.ts → use-algolia-insights-provider-global-state.d.ts} +0 -0
- /package/dist/shared/{types → model}/cart.d.ts +0 -0
- /package/dist/shared/{types → model}/price.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaActiveCategories(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaCategoriesFilters(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface AlgoliaFilterPanelProps {
|
|
2
|
-
|
|
2
|
+
showActiveCategories?: boolean;
|
|
3
|
+
showCategoriesFilters?: boolean;
|
|
3
4
|
}
|
|
4
|
-
export declare function AlgoliaFilterPanel({
|
|
5
|
+
export declare function AlgoliaFilterPanel({ showActiveCategories, showCategoriesFilters, }: AlgoliaFilterPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { AlgoliaInsightsProviderGlobalState } from './
|
|
2
|
+
import { AlgoliaInsightsProviderGlobalState } from './use-algolia-insights-provider-global-state';
|
|
3
3
|
export interface AlgoliaInsightsProviderState extends AlgoliaInsightsProviderGlobalState {
|
|
4
4
|
objectId?: string | string[] | undefined;
|
|
5
5
|
position?: number | number[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface AlgoliaMultiSelectFilterSectionProps {
|
|
2
2
|
attribute: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function AlgoliaMultiSelectFilterSection({ attribute, }: AlgoliaMultiSelectFilterSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare function AlgoliaMultiSelectFilterSection({ attribute, }: AlgoliaMultiSelectFilterSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hit } from '@algolia/client-search';
|
|
2
|
-
interface
|
|
2
|
+
interface AlgoliaProduct {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
alternativeNumber: string;
|
|
5
5
|
categories: string[];
|
|
@@ -35,5 +35,5 @@ interface Product {
|
|
|
35
35
|
weight: number;
|
|
36
36
|
width: number;
|
|
37
37
|
}
|
|
38
|
-
export type
|
|
38
|
+
export type AlgoliaProductHit = Hit<AlgoliaProduct>;
|
|
39
39
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { RouterProps } from 'instantsearch.js/es/middlewares/createRouterMiddleware';
|
|
2
2
|
import { UiState } from 'instantsearch.js/es/types';
|
|
3
3
|
import { Indexes } from './algolia-index-config';
|
|
4
|
-
export declare function createQueryStringRouting(algoliaIndex
|
|
4
|
+
export declare function createQueryStringRouting({ algoliaIndex, categoryPages, }: {
|
|
5
|
+
algoliaIndex: Indexes;
|
|
6
|
+
categoryPages: string;
|
|
7
|
+
}): RouterProps<UiState, UiState>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface RefinementListItem {
|
|
2
|
+
count: number;
|
|
3
|
+
highlighted?: string;
|
|
4
|
+
isRefined: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
interface BaseFilterSectionProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
title: string;
|
|
11
|
+
variant: 'default' | 'collapsible' | 'with-action';
|
|
12
|
+
}
|
|
13
|
+
interface CollapsibleFilterSectionProps extends BaseFilterSectionProps {
|
|
14
|
+
initialIsOpen?: boolean;
|
|
15
|
+
variant: 'collapsible';
|
|
16
|
+
}
|
|
17
|
+
interface WithActionFilterSectionProps extends BaseFilterSectionProps {
|
|
18
|
+
button: React.ReactNode;
|
|
19
|
+
variant: 'with-action';
|
|
20
|
+
}
|
|
21
|
+
interface DefaultFilterSectionProps extends BaseFilterSectionProps {
|
|
22
|
+
variant: 'default';
|
|
23
|
+
}
|
|
24
|
+
type FilterSectionProps = CollapsibleFilterSectionProps | WithActionFilterSectionProps | DefaultFilterSectionProps;
|
|
25
|
+
export declare function FilterSection({ ...props }: FilterSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlgoliaInsightsProviderGlobalState } from './
|
|
1
|
+
import { AlgoliaInsightsProviderGlobalState } from './use-algolia-insights-provider-global-state';
|
|
2
2
|
export interface UseAlgoliaEventResult {
|
|
3
3
|
context: Readonly<AlgoliaInsightsProviderGlobalState>;
|
|
4
4
|
sendAddToCartFromProductListPageEvent({ objectId, }: {
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import { AutocompleteCollection } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompleteCollection, BaseItem, InternalAutocompleteSource } from '@algolia/autocomplete-core';
|
|
2
2
|
import { CategoryHit } from 'global-search/plugins/categories-plugin';
|
|
3
3
|
import { PopularCategoryHit } from 'global-search/plugins/popular-categories-plugin';
|
|
4
4
|
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 { AlgoliaProductHit } from './algolia-product-hit-type';
|
|
9
|
+
interface ExtendedAutoCompleteCollection<T extends BaseItem> extends AutocompleteCollection<T> {
|
|
10
|
+
source: ExtendedInternalAutocompleteSource<T>;
|
|
11
|
+
}
|
|
12
|
+
interface ExtendedInternalAutocompleteSource<T extends BaseItem> extends InternalAutocompleteSource<T> {
|
|
13
|
+
onRemove: (id: string) => void;
|
|
14
|
+
}
|
|
9
15
|
export declare function useAlgoliaSearch(): {
|
|
10
16
|
categories: AutocompleteCollection<CategoryHit> | undefined;
|
|
11
17
|
hasResults: boolean;
|
|
12
18
|
popularCategories: AutocompleteCollection<PopularCategoryHit> | undefined;
|
|
13
19
|
popularSearches: AutocompleteCollection<PopularSearchHit> | undefined;
|
|
14
|
-
products:
|
|
20
|
+
products: {
|
|
21
|
+
items: import("shared/model/product-hit").ProductHit[];
|
|
22
|
+
source: InternalAutocompleteSource<AlgoliaProductHit>;
|
|
23
|
+
} | undefined;
|
|
15
24
|
querySuggestions: AutocompleteCollection<QuerySuggestionHit> | undefined;
|
|
16
25
|
quickAccess: AutocompleteCollection<QuickAccessHit> | undefined;
|
|
17
|
-
recentSearches:
|
|
18
|
-
autocomplete: import("../types").Autocomplete;
|
|
26
|
+
recentSearches: ExtendedAutoCompleteCollection<RecentSearchHit> | undefined;
|
|
27
|
+
autocomplete: import("../global-search/types").Autocomplete;
|
|
19
28
|
formRef: React.RefObject<HTMLFormElement>;
|
|
20
29
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
21
30
|
panelRef: React.RefObject<HTMLDivElement>;
|
|
22
31
|
productsIndexName: string;
|
|
23
32
|
productsQuerySuggestionsIndexName: string;
|
|
24
33
|
searchClient: import("algoliasearch").SearchClient;
|
|
25
|
-
setState: React.Dispatch<React.SetStateAction<import("../types").AutocompleteState>>;
|
|
26
|
-
state: import("../types").AutocompleteState;
|
|
34
|
+
setState: React.Dispatch<React.SetStateAction<import("../global-search/types").AutocompleteState>>;
|
|
35
|
+
state: import("../global-search/types").AutocompleteState;
|
|
27
36
|
};
|
|
37
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface CategoryCardProps
|
|
1
|
+
import { ImageSource } from 'shared/model/image';
|
|
2
|
+
export interface CategoryCardProps {
|
|
3
|
+
href: string;
|
|
4
|
+
image: ImageSource;
|
|
3
5
|
isSelected?: boolean;
|
|
6
|
+
title: string;
|
|
7
|
+
withArrow?: boolean;
|
|
4
8
|
}
|
|
5
|
-
export declare function CategoryCard({ href, image, isSelected, title, }: CategoryCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function CategoryCard({ href, image, isSelected, title, withArrow, }: CategoryCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { PressEvent } from 'react-aria-components';
|
|
3
|
+
import type { ImageSource } from 'shared/model/image';
|
|
4
|
+
import type { ProductPrice as ProductPriceType } from 'shared/model/price';
|
|
3
5
|
import { AutocompleteProps } from 'shared/routing/route-link';
|
|
4
|
-
import type { ImageSource } from 'shared/types/image';
|
|
5
|
-
import type { ProductPrice as ProductPriceType } from 'shared/types/price';
|
|
6
6
|
export interface ProductCardProps extends AutocompleteProps {
|
|
7
7
|
addToCartButton: ReactElement;
|
|
8
8
|
favoriteButton?: ReactElement;
|
|
@@ -12,6 +12,6 @@ export interface ProductCardProps extends AutocompleteProps {
|
|
|
12
12
|
price: ProductPriceType;
|
|
13
13
|
sku: string;
|
|
14
14
|
tags?: string[];
|
|
15
|
-
title:
|
|
15
|
+
title: ReactNode;
|
|
16
16
|
}
|
|
17
17
|
export declare function ProductCard({ addToCartButton: AddToCartButton, areaSelected, favoriteButton: FavoriteButton, href, id, image, onClick, onMouseDown, onMouseMove, onPress, price, role, sku, tags, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,9 +6,13 @@ declare const meta: {
|
|
|
6
6
|
favoriteButton: import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
href: string;
|
|
8
8
|
image: {
|
|
9
|
-
alt: string;
|
|
10
9
|
fit: "contain";
|
|
11
|
-
|
|
10
|
+
image: {
|
|
11
|
+
1: string;
|
|
12
|
+
2: string;
|
|
13
|
+
3: string;
|
|
14
|
+
altText: string;
|
|
15
|
+
};
|
|
12
16
|
title: string;
|
|
13
17
|
};
|
|
14
18
|
sku: string;
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AutocompletePlugin } from '@algolia/autocomplete-core';
|
|
2
|
+
import { AlgoliaProductHit } from 'algolia/algolia-product-hit-type';
|
|
2
3
|
import { SearchClient } from 'algoliasearch';
|
|
3
|
-
import type { ProductHit } from 'shared/types/product';
|
|
4
4
|
export declare const productsPlugin: ({ productsIndexName, searchClient, }: {
|
|
5
5
|
productsIndexName: string;
|
|
6
6
|
searchClient: SearchClient;
|
|
7
|
-
}) => AutocompletePlugin<
|
|
7
|
+
}) => AutocompletePlugin<AlgoliaProductHit, unknown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface SearchListItemProps {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
isRemovable?: boolean;
|
|
5
|
+
onClick?: React.MouseEventHandler<HTMLLIElement>;
|
|
6
|
+
onRemove?: VoidFunction;
|
|
7
|
+
text: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function SearchListItem({ icon, isRemovable, onClick, onRemove, text, }: SearchListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface SearchListProps {
|
|
2
|
+
ariaLabelledby?: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function SearchList({ ariaLabelledby, children, className, id, }: SearchListProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
interface SearchSectionProps {
|
|
3
|
+
button?: ReactElement;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function SearchSection({ button, children, className, title, }: SearchSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core';
|
|
2
|
+
import { AlgoliaProductHit } from 'algolia/algolia-product-hit-type';
|
|
2
3
|
import { SearchClient } from 'algoliasearch';
|
|
3
|
-
import { ProductHit } from 'shared/types/product';
|
|
4
4
|
import { CategoryHit } from './plugins/categories-plugin';
|
|
5
5
|
import { PopularCategoryHit } from './plugins/popular-categories-plugin';
|
|
6
6
|
import { PopularSearchHit } from './plugins/popular-searches-plugin';
|
|
7
7
|
import { QuerySuggestionHit } from './plugins/query-suggestions-plugin';
|
|
8
8
|
import { QuickAccessHit } from './plugins/quick-access-plugin';
|
|
9
9
|
import { RecentSearchHit } from './plugins/recent-searches-plugin';
|
|
10
|
-
export type AutocompleteItem =
|
|
10
|
+
export type AutocompleteItem = AlgoliaProductHit | QuerySuggestionHit | PopularCategoryHit | QuickAccessHit | RecentSearchHit | CategoryHit | PopularSearchHit;
|
|
11
11
|
export type Autocomplete = AutocompleteApi<AutocompleteItem, React.BaseSyntheticEvent, React.MouseEvent, React.KeyboardEvent>;
|
|
12
12
|
export type AutocompleteState = _AutocompleteState<AutocompleteItem>;
|
|
13
13
|
export type GlobalSearchContextValue = {
|