@sonic-equipment/ui 0.0.20 → 0.0.21
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/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 +7 -9
- package/dist/index.js +342 -80
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/product-listing/product-listing.d.ts +1 -7
- package/dist/product-listing/product-listing.stories.d.ts +6 -1
- 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 +221 -9
- package/dist/typography/heading/heading.d.ts +1 -1
- package/package.json +4 -3
|
@@ -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 SelectedFilterCategory {
|
|
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
|
@@ -37,10 +37,11 @@ interface IconButtonProps {
|
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
className?: string;
|
|
39
39
|
color?: 'primary' | 'secondary';
|
|
40
|
+
isDisabled?: boolean;
|
|
40
41
|
onPress?: VoidFunction;
|
|
41
42
|
size?: 'md' | 'lg';
|
|
42
43
|
}
|
|
43
|
-
declare function IconButton({ children, className, color, onPress, size, }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare function IconButton({ children, className, color, isDisabled, onPress, size, }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
44
45
|
|
|
45
46
|
interface LinkButtonProps {
|
|
46
47
|
children?: React.ReactNode | string;
|
|
@@ -96,6 +97,7 @@ declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton:
|
|
|
96
97
|
interface AccordionItemProps {
|
|
97
98
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
98
99
|
children: ReactNode;
|
|
100
|
+
className?: string;
|
|
99
101
|
id: string;
|
|
100
102
|
isDisabled?: boolean;
|
|
101
103
|
isOpen?: boolean;
|
|
@@ -107,9 +109,10 @@ interface AccordionProps {
|
|
|
107
109
|
children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];
|
|
108
110
|
color?: 'white' | 'black';
|
|
109
111
|
hasLineSeparator?: boolean;
|
|
112
|
+
indented?: boolean;
|
|
110
113
|
size?: 'md' | 'lg';
|
|
111
114
|
}
|
|
112
|
-
declare function Accordion({ children, color, hasLineSeparator, size, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
115
|
+
declare function Accordion({ children, color, hasLineSeparator, indented, size, }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
113
116
|
|
|
114
117
|
interface ShowAllProps {
|
|
115
118
|
children?: ReactElement | ReactElement[];
|
|
@@ -259,7 +262,7 @@ declare function FavoriteOutlinedIcon(props: React.SVGProps<SVGSVGElement>): rea
|
|
|
259
262
|
|
|
260
263
|
declare function HashedOutlinedIcon(props: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
261
264
|
|
|
262
|
-
type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article';
|
|
265
|
+
type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article' | 'of';
|
|
263
266
|
|
|
264
267
|
interface FormattedMessageProps {
|
|
265
268
|
id: TranslationId;
|
|
@@ -330,15 +333,10 @@ type ProductListingProps = {
|
|
|
330
333
|
isLoading?: boolean;
|
|
331
334
|
onFilterChange: (filters: ActiveFilters) => void;
|
|
332
335
|
onSortChange: (sort: SortKey) => void;
|
|
333
|
-
productCard: ComponentType;
|
|
334
|
-
products: {
|
|
335
|
-
id: string;
|
|
336
|
-
title: string;
|
|
337
|
-
}[];
|
|
338
336
|
sort: SortKey;
|
|
339
337
|
total: number;
|
|
340
338
|
};
|
|
341
|
-
declare function ProductListing({
|
|
339
|
+
declare function ProductListing({ isLoading }: ProductListingProps): react_jsx_runtime.JSX.Element;
|
|
342
340
|
|
|
343
341
|
declare function createProductListingSearchParams(state: {
|
|
344
342
|
filters: {
|