@sonic-equipment/ui 0.0.20 → 0.0.22
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-filters.d.ts +6 -0
- package/dist/algolia/algolia-categories.d.ts +1 -0
- package/dist/algolia/algolia-filter-panel.d.ts +4 -1
- package/dist/algolia/algolia-provider.d.ts +13 -0
- package/dist/algolia/algolia-sort-by.d.ts +1 -1
- package/dist/algolia/algolia.stories.d.ts +2 -2
- package/dist/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +1 -0
- package/dist/buttons/add-to-cart-button/connected-add-to-cart-button.d.ts +5 -0
- package/dist/buttons/icon-button/icon-button.d.ts +2 -1
- package/dist/cards/product-card/connected-product-cart.d.ts +6 -0
- package/dist/cards/product-card/product-card.stories.d.ts +1 -0
- package/dist/collapsables/accordion/accordion-item.d.ts +2 -1
- package/dist/collapsables/accordion/accordion.d.ts +2 -1
- package/dist/collapsables/accordion/accordion.stories.d.ts +1 -0
- package/dist/filters/active-filters/active-filters.d.ts +9 -8
- package/dist/filters/active-filters/active-filters.stories.d.ts +2 -2
- package/dist/filters/pagination/pagination.d.ts +6 -0
- package/dist/filters/pagination/pagination.stories.d.ts +18 -0
- package/dist/icons/arrows/right-arrow-filled-icon.d.ts +0 -1
- package/dist/icons/chevrons/chevron-left-filled-icon.d.ts +2 -0
- package/dist/icons/chevrons/chevron-right-filled-icon.d.ts +2 -0
- package/dist/index.d.ts +182 -34
- package/dist/index.js +1917 -102
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/product-listing/product-listing.d.ts +1 -25
- package/dist/product-listing/product-listing.stories.d.ts +7 -3
- package/dist/shared/hooks/{use-device.d.ts → use-breakpoint.d.ts} +1 -1
- package/dist/shared/hooks/use-debounce-callback.d.ts +1 -0
- package/dist/shared/providers/cart-provider.d.ts +33 -0
- package/dist/shared/providers/global-state-provider.d.ts +23 -0
- package/dist/shared/types/cart.d.ts +8 -0
- package/dist/shared/utils/event-emitter.d.ts +9 -0
- package/dist/styles.css +309 -97
- package/dist/typography/heading/heading.d.ts +1 -1
- package/package.json +25 -24
|
@@ -1 +1,7 @@
|
|
|
1
|
+
import { SelectedFilter } from 'filters/active-filters/active-filters';
|
|
2
|
+
import type { CurrentRefinementsConnectorParamsRefinement } from 'instantsearch.js/es/connectors/current-refinements/connectCurrentRefinements';
|
|
3
|
+
export interface AlgoliaSelectedFilterCategory {
|
|
4
|
+
filters: (SelectedFilter & CurrentRefinementsConnectorParamsRefinement)[];
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
1
7
|
export declare function AlgoliaActiveFilters(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaCategories(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface AlgoliaFilterPanelProps {
|
|
2
|
+
onShowProducts: VoidFunction;
|
|
3
|
+
}
|
|
4
|
+
export declare function AlgoliaFilterPanel({ onShowProducts, }: AlgoliaFilterPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface AlgoliaContextType {
|
|
3
|
+
online: boolean;
|
|
4
|
+
setOnline: (online: boolean) => void;
|
|
5
|
+
toggleOnline: VoidFunction;
|
|
6
|
+
}
|
|
7
|
+
interface AlgoliaProviderProps {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
online?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function AlgoliaProvider({ children, online: _online, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useAlgolia(): AlgoliaContextType;
|
|
13
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function AlgoliaSortBy(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function AlgoliaSortBy(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
-
interface
|
|
2
|
+
interface StoryProps {
|
|
3
3
|
online: boolean;
|
|
4
4
|
}
|
|
5
5
|
declare const meta: {
|
|
@@ -14,4 +14,4 @@ declare const meta: {
|
|
|
14
14
|
title: string;
|
|
15
15
|
};
|
|
16
16
|
export default meta;
|
|
17
|
-
export declare const Default: StoryObj<
|
|
17
|
+
export declare const Default: StoryObj<StoryProps>;
|
|
@@ -3,7 +3,8 @@ export interface IconButtonProps {
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
color?: 'primary' | 'secondary';
|
|
6
|
+
isDisabled?: boolean;
|
|
6
7
|
onPress?: VoidFunction;
|
|
7
8
|
size?: 'md' | 'lg';
|
|
8
9
|
}
|
|
9
|
-
export declare function IconButton({ children, className, color, onPress, size, }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function IconButton({ children, className, color, isDisabled, onPress, size, }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProductCardProps } from './product-card';
|
|
2
|
+
interface ConnectedProductCartProps extends Omit<ProductCardProps, 'addToCartButton'> {
|
|
3
|
+
productId: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function ConnectedProductCart({ productId, ...props }: ConnectedProductCartProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -2,10 +2,11 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface AccordionItemProps {
|
|
3
3
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
4
4
|
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
5
6
|
id: string;
|
|
6
7
|
isDisabled?: boolean;
|
|
7
8
|
isOpen?: boolean;
|
|
8
9
|
size?: 'md' | 'lg';
|
|
9
10
|
title: string;
|
|
10
11
|
}
|
|
11
|
-
export declare function AccordionItem({ _pseudo, children, id, isDisabled, isOpen: isOpenProp, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function AccordionItem({ _pseudo, children, className, id, isDisabled, isOpen: isOpenProp, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,8 @@ interface AccordionProps {
|
|
|
4
4
|
children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];
|
|
5
5
|
color?: 'white' | 'black';
|
|
6
6
|
hasLineSeparator?: boolean;
|
|
7
|
+
indented?: boolean;
|
|
7
8
|
size?: 'md' | 'lg';
|
|
8
9
|
}
|
|
9
|
-
export declare function Accordion({ children, color, hasLineSeparator, size, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Accordion({ children, color, hasLineSeparator, indented, size, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -11,6 +11,7 @@ declare const meta: {
|
|
|
11
11
|
export default meta;
|
|
12
12
|
type Story = StoryObj<typeof meta>;
|
|
13
13
|
export declare const Default: Story;
|
|
14
|
+
export declare const Indented: Story;
|
|
14
15
|
export declare const Disabled: Story;
|
|
15
16
|
export declare const Focus: Story;
|
|
16
17
|
export declare const Large: Story;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
export interface SelectedFilter {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
}
|
|
1
5
|
export interface SelectedFilterCategory {
|
|
2
|
-
filters:
|
|
3
|
-
|
|
4
|
-
value: string;
|
|
5
|
-
}[];
|
|
6
|
-
name: string;
|
|
6
|
+
filters: SelectedFilter[];
|
|
7
|
+
label: string;
|
|
7
8
|
}
|
|
8
9
|
export interface ActiveFiltersProps {
|
|
9
10
|
onClearAllFilters: () => void;
|
|
10
|
-
onClearFilter: (
|
|
11
|
-
|
|
11
|
+
onClearFilter: (categoryLabel: string, filter: SelectedFilter) => void;
|
|
12
|
+
selectedFilterCategories: SelectedFilterCategory[];
|
|
12
13
|
}
|
|
13
|
-
export declare const ActiveFilters: ({ onClearAllFilters, onClearFilter,
|
|
14
|
+
export declare const ActiveFilters: ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }: ActiveFiltersProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,9 +2,9 @@ import type { StoryObj } from '@storybook/react';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
args: {
|
|
4
4
|
onClearAllFilters: import("@vitest/spy").Mock<[], void>;
|
|
5
|
-
onClearFilter: import("@vitest/spy").Mock<[
|
|
5
|
+
onClearFilter: import("@vitest/spy").Mock<[categoryLabel: string, filter: import("./active-filters").SelectedFilter], void>;
|
|
6
6
|
};
|
|
7
|
-
component: ({ onClearAllFilters, onClearFilter,
|
|
7
|
+
component: ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }: import("./active-filters").ActiveFiltersProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
10
10
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Pagination } from './pagination';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
args: {
|
|
5
|
+
currentPage: number;
|
|
6
|
+
onChange: import("@vitest/spy").Mock<[pageNumber: number], void>;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
};
|
|
9
|
+
component: typeof Pagination;
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: string;
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
title: string;
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof Pagination>;
|
|
18
|
+
export declare const Default: Story;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,136 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ReactElement, MutableRefObject, ReactNode, HTMLAttributeAnchorTarget, FormEventHandler, KeyboardEvent, ComponentType } from 'react';
|
|
2
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { ReactNode, HTMLAttributeAnchorTarget, ReactElement, FormEventHandler, KeyboardEvent, ComponentType } from 'react';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
declare const useBreakpoint: () => {
|
|
6
|
+
isDesktop: boolean;
|
|
7
|
+
isMobile: boolean;
|
|
8
|
+
isTablet: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
12
|
+
|
|
13
|
+
interface UseDisclosureReturnType {
|
|
14
|
+
close: () => void;
|
|
15
|
+
isClosed: boolean;
|
|
16
|
+
isOpen: boolean;
|
|
17
|
+
open: () => void;
|
|
18
|
+
toggle: () => void;
|
|
19
|
+
}
|
|
20
|
+
declare const useDisclosure: () => UseDisclosureReturnType;
|
|
21
|
+
|
|
22
|
+
declare const useScrollLock: (lock: boolean) => void;
|
|
23
|
+
|
|
24
|
+
interface CartLine$1 {
|
|
25
|
+
id: string
|
|
26
|
+
productId: string | null
|
|
27
|
+
qtyOrdered: number | null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Cart$1<T extends CartLine$1 = CartLine$1> {
|
|
31
|
+
cartLines?: T[] | null
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface Props$1<TCartLine extends CartLine$1 = CartLine$1, TCart extends Cart$1<TCartLine> = Cart$1<TCartLine>> {
|
|
35
|
+
addToCart: (args: {
|
|
36
|
+
productId: string;
|
|
37
|
+
quantity: number;
|
|
38
|
+
}) => void;
|
|
39
|
+
currentCart: Readonly<TCart> | undefined;
|
|
40
|
+
isLoaded: boolean;
|
|
41
|
+
isLoading: boolean;
|
|
42
|
+
loadCurrentCart: VoidFunction;
|
|
43
|
+
removeCartLine: (args: {
|
|
44
|
+
cartLineId: string;
|
|
45
|
+
}) => void;
|
|
46
|
+
updateCartLine: (cartLine: TCartLine) => void;
|
|
47
|
+
}
|
|
48
|
+
declare function CartProvider<TCartLine extends CartLine$1 = CartLine$1, TCart extends Cart$1<TCartLine> = Cart$1<TCartLine>>(props: Props$1<TCartLine, TCart>): null;
|
|
49
|
+
declare function useCart(): Props$1<CartLine$1, Cart$1<CartLine$1>>;
|
|
50
|
+
declare function useProductCartLine(productId: string): {
|
|
51
|
+
addToCart: (args: {
|
|
52
|
+
productId: string;
|
|
53
|
+
quantity: number;
|
|
54
|
+
}) => void;
|
|
55
|
+
cartLine: CartLine$1 | undefined;
|
|
56
|
+
currentCart: Readonly<Cart$1<CartLine$1>> | undefined;
|
|
57
|
+
isLoaded: boolean;
|
|
58
|
+
isLoading: boolean;
|
|
59
|
+
loadCurrentCart: VoidFunction;
|
|
60
|
+
removeCartLine: (args: {
|
|
61
|
+
cartLineId: string;
|
|
62
|
+
}) => void;
|
|
63
|
+
updateCartLine: (cartLine: CartLine$1) => void;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
type EventCallback<T> = (data: T) => void
|
|
67
|
+
|
|
68
|
+
declare class EventEmitter<T> {
|
|
69
|
+
private listeners: Map<string, EventCallback<T>[]>
|
|
70
|
+
|
|
71
|
+
constructor() {
|
|
72
|
+
this.listeners = new Map()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
addEventListener(event: string, listener: EventCallback<T>): void {
|
|
76
|
+
if (!this.listeners.has(event)) {
|
|
77
|
+
this.listeners.set(event, [])
|
|
78
|
+
}
|
|
79
|
+
this.listeners.get(event)!.push(listener)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
removeEventListener(event: string, listener: EventCallback<T>): void {
|
|
83
|
+
const listeners = this.listeners.get(event)
|
|
84
|
+
if (!listeners) return
|
|
85
|
+
|
|
86
|
+
const index = listeners.indexOf(listener)
|
|
87
|
+
if (index !== -1) {
|
|
88
|
+
listeners.splice(index, 1)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
trigger(event: string, data: T): void {
|
|
93
|
+
const listeners = this.listeners.get(event)
|
|
94
|
+
if (!listeners) return
|
|
95
|
+
|
|
96
|
+
listeners.forEach(listener => listener(data))
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare class State<T> extends EventEmitter<T | undefined> {
|
|
101
|
+
private _state;
|
|
102
|
+
constructor(state?: T);
|
|
103
|
+
get value(): T | undefined;
|
|
104
|
+
set value(newState: T | undefined);
|
|
105
|
+
}
|
|
106
|
+
declare class GlobalState {
|
|
107
|
+
private states;
|
|
108
|
+
constructor(states: MutableRefObject<Record<string | symbol, State<any>>>);
|
|
109
|
+
get<T>(key: string | symbol): State<T>;
|
|
110
|
+
get<T>(key: string | symbol, initialState: T | undefined): State<T>;
|
|
111
|
+
set<T>(key: string | symbol, state: State<T>): void;
|
|
112
|
+
}
|
|
113
|
+
declare const GlobalStateProviderContext: React.Context<GlobalState>;
|
|
114
|
+
interface GlobalStateProviderProps {
|
|
115
|
+
children: ReactNode;
|
|
116
|
+
}
|
|
117
|
+
declare function GlobalStateProvider({ children, }: GlobalStateProviderProps): ReactElement | null;
|
|
118
|
+
declare function useGlobalState<T>(key: string | symbol): [T | undefined, (value: T) => void];
|
|
119
|
+
declare function useGlobalState<T>(key: string | symbol, initialState: T): [T, (value: T) => void];
|
|
120
|
+
|
|
121
|
+
interface CartLine {
|
|
122
|
+
id: string;
|
|
123
|
+
productId: string | null;
|
|
124
|
+
qtyOrdered: number | null;
|
|
125
|
+
}
|
|
126
|
+
interface Cart<T extends CartLine = CartLine> {
|
|
127
|
+
cartLines?: T[] | null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface Product {
|
|
131
|
+
id: string;
|
|
132
|
+
title: string;
|
|
10
133
|
}
|
|
11
|
-
declare function AddToCartButton({ initialState, onChange, quantity, }: AddToCartButtonProps): react_jsx_runtime.JSX.Element;
|
|
12
134
|
|
|
13
135
|
interface ButtonProps {
|
|
14
136
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
@@ -37,10 +159,11 @@ interface IconButtonProps {
|
|
|
37
159
|
children: React.ReactNode;
|
|
38
160
|
className?: string;
|
|
39
161
|
color?: 'primary' | 'secondary';
|
|
162
|
+
isDisabled?: boolean;
|
|
40
163
|
onPress?: VoidFunction;
|
|
41
164
|
size?: 'md' | 'lg';
|
|
42
165
|
}
|
|
43
|
-
declare function IconButton({ children, className, color, onPress, size, }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
166
|
+
declare function IconButton({ children, className, color, isDisabled, onPress, size, }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
44
167
|
|
|
45
168
|
interface LinkButtonProps {
|
|
46
169
|
children?: React.ReactNode | string;
|
|
@@ -52,6 +175,19 @@ interface LinkButtonProps {
|
|
|
52
175
|
}
|
|
53
176
|
declare function LinkButton({ children, className, href, isDisabled, onPress, target, }: LinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
54
177
|
|
|
178
|
+
type AddToCartState = 'initial' | 'spinner' | 'manual-input';
|
|
179
|
+
interface AddToCartButtonProps {
|
|
180
|
+
initialState?: AddToCartState;
|
|
181
|
+
onChange?: (quantity: number) => void;
|
|
182
|
+
quantity: number;
|
|
183
|
+
}
|
|
184
|
+
declare function AddToCartButton({ initialState, onChange, quantity, }: AddToCartButtonProps): react_jsx_runtime.JSX.Element;
|
|
185
|
+
|
|
186
|
+
interface Props {
|
|
187
|
+
productId: string;
|
|
188
|
+
}
|
|
189
|
+
declare const ConnectedAddToCartButton: ({ productId }: Props) => react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
55
191
|
interface Source$1 {
|
|
56
192
|
url: string
|
|
57
193
|
width: number
|
|
@@ -96,6 +232,7 @@ declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton:
|
|
|
96
232
|
interface AccordionItemProps {
|
|
97
233
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
98
234
|
children: ReactNode;
|
|
235
|
+
className?: string;
|
|
99
236
|
id: string;
|
|
100
237
|
isDisabled?: boolean;
|
|
101
238
|
isOpen?: boolean;
|
|
@@ -107,9 +244,10 @@ interface AccordionProps {
|
|
|
107
244
|
children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];
|
|
108
245
|
color?: 'white' | 'black';
|
|
109
246
|
hasLineSeparator?: boolean;
|
|
247
|
+
indented?: boolean;
|
|
110
248
|
size?: 'md' | 'lg';
|
|
111
249
|
}
|
|
112
|
-
declare function Accordion({ children, color, hasLineSeparator, size, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
250
|
+
declare function Accordion({ children, color, hasLineSeparator, indented, size, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
113
251
|
|
|
114
252
|
interface ShowAllProps {
|
|
115
253
|
children?: ReactElement | ReactElement[];
|
|
@@ -259,7 +397,7 @@ declare function FavoriteOutlinedIcon(props: React.SVGProps<SVGSVGElement>): rea
|
|
|
259
397
|
|
|
260
398
|
declare function HashedOutlinedIcon(props: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
261
399
|
|
|
262
|
-
type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article';
|
|
400
|
+
type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article' | 'of';
|
|
263
401
|
|
|
264
402
|
interface FormattedMessageProps {
|
|
265
403
|
id: TranslationId;
|
|
@@ -313,32 +451,10 @@ interface Filters {
|
|
|
313
451
|
}[];
|
|
314
452
|
};
|
|
315
453
|
}
|
|
316
|
-
declare const sortOptions: {
|
|
317
|
-
readonly new: "New";
|
|
318
|
-
readonly popular: "Popular";
|
|
319
|
-
readonly price_asc: "Price: Low - High";
|
|
320
|
-
readonly price_desc: "Price: High - Low";
|
|
321
|
-
readonly recommended: "Recommended";
|
|
322
|
-
};
|
|
323
|
-
type SortKey = keyof typeof sortOptions;
|
|
324
|
-
type ActiveFilters = {
|
|
325
|
-
colors: string[];
|
|
326
|
-
};
|
|
327
454
|
type ProductListingProps = {
|
|
328
|
-
activeFilters: ActiveFilters;
|
|
329
|
-
filters: Filters;
|
|
330
455
|
isLoading?: boolean;
|
|
331
|
-
onFilterChange: (filters: ActiveFilters) => void;
|
|
332
|
-
onSortChange: (sort: SortKey) => void;
|
|
333
|
-
productCard: ComponentType;
|
|
334
|
-
products: {
|
|
335
|
-
id: string;
|
|
336
|
-
title: string;
|
|
337
|
-
}[];
|
|
338
|
-
sort: SortKey;
|
|
339
|
-
total: number;
|
|
340
456
|
};
|
|
341
|
-
declare function ProductListing({
|
|
457
|
+
declare function ProductListing({ isLoading }: ProductListingProps): react_jsx_runtime.JSX.Element;
|
|
342
458
|
|
|
343
459
|
declare function createProductListingSearchParams(state: {
|
|
344
460
|
filters: {
|
|
@@ -364,4 +480,36 @@ interface SidebarProps {
|
|
|
364
480
|
}
|
|
365
481
|
declare function Sidebar({ children }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
366
482
|
|
|
367
|
-
|
|
483
|
+
declare function AlgoliaCategories(): react_jsx_runtime.JSX.Element;
|
|
484
|
+
|
|
485
|
+
interface AlgoliaFilterPanelProps {
|
|
486
|
+
onShowProducts: VoidFunction;
|
|
487
|
+
}
|
|
488
|
+
declare function AlgoliaFilterPanel({ onShowProducts, }: AlgoliaFilterPanelProps): react_jsx_runtime.JSX.Element;
|
|
489
|
+
|
|
490
|
+
interface AlgoliaMultiSelectProps {
|
|
491
|
+
attribute: string;
|
|
492
|
+
}
|
|
493
|
+
declare function AlgoliaMultiSelect({ attribute }: AlgoliaMultiSelectProps): react_jsx_runtime.JSX.Element;
|
|
494
|
+
|
|
495
|
+
declare function AlgoliaPagination(): react_jsx_runtime.JSX.Element;
|
|
496
|
+
|
|
497
|
+
declare function AlgoliaProductList(): react_jsx_runtime.JSX.Element;
|
|
498
|
+
|
|
499
|
+
interface AlgoliaContextType {
|
|
500
|
+
online: boolean;
|
|
501
|
+
setOnline: (online: boolean) => void;
|
|
502
|
+
toggleOnline: VoidFunction;
|
|
503
|
+
}
|
|
504
|
+
interface AlgoliaProviderProps {
|
|
505
|
+
children: React.ReactNode;
|
|
506
|
+
online?: boolean;
|
|
507
|
+
}
|
|
508
|
+
declare function AlgoliaProvider({ children, online: _online, }: AlgoliaProviderProps): react_jsx_runtime.JSX.Element;
|
|
509
|
+
declare function useAlgolia(): AlgoliaContextType;
|
|
510
|
+
|
|
511
|
+
declare function AlgoliaResultsCount(): string | null;
|
|
512
|
+
|
|
513
|
+
declare function AlgoliaSortBy(): react_jsx_runtime.JSX.Element | null;
|
|
514
|
+
|
|
515
|
+
export { Accordion, AddToCartButton, AlgoliaCategories, AlgoliaFilterPanel, type AlgoliaFilterPanelProps, AlgoliaMultiSelect, AlgoliaPagination, AlgoliaProductList, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, Button, type ButtonProps, type Cart, CartFilledIcon, type CartLine, CartOutlinedIcon, CartProvider, Checkbox, type CheckboxProps$1 as CheckboxProps, ColorCheckbox, type ColorCheckboxProps, ConnectedAddToCartButton, DehashedOutlinedIcon, FavoriteButton, type FavoriteButtonProps, FavoriteFilledIcon, FavoriteOutlinedIcon, type FilterOption, type Filters, FormattedMessage, type FormattedMessageFunction, type FormattedMessageProps, GlobalStateProvider, GlobalStateProviderContext, HashedOutlinedIcon, IconButton, type IconButtonProps, Image, type ImageProps, IntlProvider, LinkButton, type LinkButtonProps, MultiSelect, type MultiSelectProps, NumberField, type NumberFieldSize, type Product, ProductCard, type ProductCardProps, ProductListing, type ProductListingProps, ProductOverviewGrid, type ProductOverviewGridProps, ProductPrice, type ProductPriceProps, ProductSku, type ProductSkuProps, RightArrowFilledIcon, Select, type SelectProps, ShowAll, type ShowAllProps, Sidebar, type SidebarProps, TextField, createProductListingSearchParams, parseProductListingSearchParams, useAlgolia, useBreakpoint, useCart, useDebouncedCallback, useDisclosure, useFormattedMessage, useGlobalState, useProductCartLine, useScrollLock };
|