@sonic-equipment/ui 0.0.19 → 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 +7 -0
- package/dist/algolia/algolia-categories.d.ts +1 -0
- package/dist/algolia/algolia-filter-panel.d.ts +4 -0
- package/dist/algolia/algolia-multi-select.d.ts +5 -0
- package/dist/algolia/algolia-pagination.d.ts +1 -0
- package/dist/algolia/algolia-product-list.d.ts +1 -0
- package/dist/algolia/algolia-provider.d.ts +13 -0
- package/dist/algolia/algolia-results-count.d.ts +1 -0
- package/dist/algolia/algolia-searchclient-mock.d.ts +4 -0
- package/dist/algolia/algolia-sort-by.d.ts +1 -0
- package/dist/algolia/algolia.stories.d.ts +17 -0
- 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/button/button.d.ts +5 -4
- package/dist/buttons/button/button.stories.d.ts +1 -0
- package/dist/buttons/icon-button/icon-button.d.ts +2 -1
- package/dist/buttons/link-button/link-button.d.ts +10 -0
- package/dist/buttons/link-button/link-button.stories.d.ts +19 -0
- 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 -1
- package/dist/collapsables/show-all/show-all.d.ts +9 -0
- package/dist/collapsables/show-all/show-all.stories.d.ts +17 -0
- package/dist/filters/active-filters/active-filters.d.ts +14 -0
- package/dist/filters/active-filters/active-filters.stories.d.ts +15 -0
- package/dist/filters/multi-select/multi-select.d.ts +19 -0
- package/dist/filters/multi-select/multi-select.stories.d.ts +20 -0
- package/dist/filters/pagination/pagination.d.ts +6 -0
- package/dist/filters/pagination/pagination.stories.d.ts +18 -0
- package/dist/forms/color-checkbox/color-checkbox.stories.d.ts +1 -0
- package/dist/forms/select/select.d.ts +5 -5
- package/dist/forms/select/select.stories.d.ts +10 -3
- 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/icons/close/close-filled-icon.d.ts +2 -0
- package/dist/icons/filter/filter-outlined-icon.d.ts +2 -0
- package/dist/index.d.ts +71 -32
- package/dist/index.js +402 -64
- package/dist/intl/translation-id.d.ts +1 -5
- package/dist/product-listing/product-listing.d.ts +12 -16
- package/dist/product-listing/product-listing.stories.d.ts +7 -2
- package/dist/shared/hooks/use-breakpoint.d.ts +5 -0
- package/dist/shared/hooks/use-debounce-callback.d.ts +1 -0
- package/dist/shared/hooks/use-disclosure.d.ts +9 -0
- package/dist/shared/hooks/use-scroll-lock.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/sidebar/sidebar-context.d.ts +6 -0
- package/dist/sidebar/sidebar-provider.d.ts +6 -0
- package/dist/sidebar/sidebar.d.ts +5 -0
- package/dist/sidebar/sidebar.stories.d.ts +8 -0
- package/dist/sidebar/toggle-sidebar-button.d.ts +1 -0
- package/dist/sidebar/use-sidebar.d.ts +2 -0
- package/dist/styles.css +435 -12
- package/dist/typography/heading/heading.d.ts +1 -1
- package/package.json +37 -32
|
@@ -0,0 +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
|
+
}
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaPagination(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaProductList(): 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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaResultsCount(): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AlgoliaSortBy(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
interface StoryProps {
|
|
3
|
+
online: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const meta: {
|
|
6
|
+
argTypes: {
|
|
7
|
+
online: {
|
|
8
|
+
control: "boolean";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
args: {
|
|
12
|
+
online: false;
|
|
13
|
+
};
|
|
14
|
+
title: string;
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
export declare const Default: StoryObj<StoryProps>;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export interface ButtonProps {
|
|
3
3
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
4
|
-
children?: string;
|
|
4
|
+
children?: ReactNode | string;
|
|
5
5
|
className?: string;
|
|
6
6
|
color?: 'primary' | 'secondary';
|
|
7
7
|
condensed?: boolean;
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
|
+
iconPosition?: 'left' | 'right';
|
|
9
10
|
isDisabled?: boolean;
|
|
10
11
|
onPress?: VoidFunction;
|
|
11
|
-
size?: 'md' | 'lg';
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
13
|
type?: 'button' | 'submit' | 'reset';
|
|
13
14
|
variant?: 'solid' | 'outline' | 'ghost';
|
|
14
15
|
withArrow?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare function Button({ _pseudo, children, className, color, condensed, icon, isDisabled, onPress, size, type, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Button({ _pseudo, children, className, color, condensed, icon, iconPosition, isDisabled, onPress, size, type, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,10 @@
|
|
|
1
|
+
import type { HTMLAttributeAnchorTarget } from 'react';
|
|
2
|
+
export interface LinkButtonProps {
|
|
3
|
+
children?: React.ReactNode | string;
|
|
4
|
+
className?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
onPress?: VoidFunction;
|
|
8
|
+
target?: HTMLAttributeAnchorTarget;
|
|
9
|
+
}
|
|
10
|
+
export declare function LinkButton({ children, className, href, isDisabled, onPress, target, }: LinkButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { LinkButton } from './link-button';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
args: {
|
|
5
|
+
onPress: import("@vitest/spy").Mock<[], void>;
|
|
6
|
+
};
|
|
7
|
+
component: typeof LinkButton;
|
|
8
|
+
parameters: {
|
|
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;
|
|
17
|
+
export declare const WithIcon: Story;
|
|
18
|
+
export declare const AsButton: Story;
|
|
19
|
+
export declare const Disabled: Story;
|
|
@@ -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,7 +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
|
-
export declare const Active: Story;
|
|
17
17
|
export declare const Large: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
export interface ShowAllProps {
|
|
3
|
+
children?: ReactElement | ReactElement[];
|
|
4
|
+
hasTransparency?: boolean;
|
|
5
|
+
initialHeight?: number;
|
|
6
|
+
isOpen?: boolean;
|
|
7
|
+
onToggle: (isOpen: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ShowAll: ({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ShowAllProps } from './show-all';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
args: {
|
|
5
|
+
onToggle: import("@vitest/spy").Mock<[isOpen: boolean], void>;
|
|
6
|
+
};
|
|
7
|
+
component: ({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
parameters: {
|
|
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 Text: Story;
|
|
17
|
+
export declare const Checkboxes: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SelectedFilter {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
}
|
|
5
|
+
export interface SelectedFilterCategory {
|
|
6
|
+
filters: SelectedFilter[];
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ActiveFiltersProps {
|
|
10
|
+
onClearAllFilters: () => void;
|
|
11
|
+
onClearFilter: (categoryLabel: string, filter: SelectedFilter) => void;
|
|
12
|
+
selectedFilterCategories: SelectedFilterCategory[];
|
|
13
|
+
}
|
|
14
|
+
export declare const ActiveFilters: ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }: ActiveFiltersProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
args: {
|
|
4
|
+
onClearAllFilters: import("@vitest/spy").Mock<[], void>;
|
|
5
|
+
onClearFilter: import("@vitest/spy").Mock<[categoryLabel: string, filter: import("./active-filters").SelectedFilter], void>;
|
|
6
|
+
};
|
|
7
|
+
component: ({ onClearAllFilters, onClearFilter, selectedFilterCategories, }: import("./active-filters").ActiveFiltersProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface FilterOption {
|
|
3
|
+
amount: number;
|
|
4
|
+
isSelected: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface MultiSelectProps<T extends FilterOption> {
|
|
9
|
+
amountShown?: number;
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onChange: (value: T) => void;
|
|
12
|
+
onToggleOpen: (isOpen: boolean) => void;
|
|
13
|
+
options: T[];
|
|
14
|
+
render: ({ onChange, option, }: {
|
|
15
|
+
onChange: (key: string) => void;
|
|
16
|
+
option: T;
|
|
17
|
+
}) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function MultiSelect<T extends FilterOption>({ amountShown, isOpen, onChange, onToggleOpen, options, render, }: MultiSelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { FilterOption, MultiSelect, MultiSelectProps } from './multi-select';
|
|
3
|
+
type ColorFilterOption = FilterOption & {
|
|
4
|
+
color: string;
|
|
5
|
+
};
|
|
6
|
+
declare const meta: {
|
|
7
|
+
args: {
|
|
8
|
+
onChange: import("@vitest/spy").Mock<[value: FilterOption], void>;
|
|
9
|
+
onToggleOpen: import("@vitest/spy").Mock<[isOpen: boolean], void>;
|
|
10
|
+
};
|
|
11
|
+
component: typeof MultiSelect;
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
};
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const WithCheckboxes: Story;
|
|
20
|
+
export declare const WithColorCheckboxes: StoryObj<MultiSelectProps<ColorFilterOption>>;
|
|
@@ -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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface SelectProps {
|
|
1
|
+
export interface SelectProps<T> {
|
|
2
2
|
disabled?: boolean;
|
|
3
3
|
label: string;
|
|
4
|
-
onChange: (value:
|
|
5
|
-
options:
|
|
6
|
-
selectedOption?:
|
|
4
|
+
onChange: (value: keyof T) => void;
|
|
5
|
+
options: T;
|
|
6
|
+
selectedOption?: keyof T;
|
|
7
7
|
showLabel?: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare
|
|
9
|
+
export declare function Select<T extends object>({ disabled, label, onChange, options, selectedOption, showLabel, }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
2
|
import { Select } from './select';
|
|
3
|
+
declare const options: {
|
|
4
|
+
readonly new: "New";
|
|
5
|
+
readonly popular: "Popular";
|
|
6
|
+
readonly price_asc: "Price: Low - High";
|
|
7
|
+
readonly price_desc: "Price: High - Low";
|
|
8
|
+
readonly recommended: "Recommended";
|
|
9
|
+
};
|
|
3
10
|
declare const meta: {
|
|
4
11
|
args: {
|
|
5
|
-
onChange: import("@vitest/spy").Mock<[value:
|
|
12
|
+
onChange: import("@vitest/spy").Mock<[value: never], void>;
|
|
6
13
|
};
|
|
7
|
-
component:
|
|
14
|
+
component: typeof Select;
|
|
8
15
|
parameters: {
|
|
9
16
|
layout: string;
|
|
10
17
|
};
|
|
@@ -15,5 +22,5 @@ export default meta;
|
|
|
15
22
|
type Story = StoryObj<typeof Select>;
|
|
16
23
|
export declare const WithLabel: Story;
|
|
17
24
|
export declare const WithoutLabel: Story;
|
|
18
|
-
export declare const DefaultSelected:
|
|
25
|
+
export declare const DefaultSelected: StoryObj<typeof Select<typeof options>>;
|
|
19
26
|
export declare const Disabled: Story;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { ReactNode, HTMLAttributeAnchorTarget, ReactElement, FormEventHandler, KeyboardEvent, ComponentType } from 'react';
|
|
4
4
|
|
|
5
5
|
type AddToCartState = 'initial' | 'spinner' | 'manual-input';
|
|
6
6
|
interface AddToCartButtonProps {
|
|
@@ -12,19 +12,20 @@ declare function AddToCartButton({ initialState, onChange, quantity, }: AddToCar
|
|
|
12
12
|
|
|
13
13
|
interface ButtonProps {
|
|
14
14
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
15
|
-
children?: string;
|
|
15
|
+
children?: ReactNode | string;
|
|
16
16
|
className?: string;
|
|
17
17
|
color?: 'primary' | 'secondary';
|
|
18
18
|
condensed?: boolean;
|
|
19
19
|
icon?: React.ReactNode;
|
|
20
|
+
iconPosition?: 'left' | 'right';
|
|
20
21
|
isDisabled?: boolean;
|
|
21
22
|
onPress?: VoidFunction;
|
|
22
|
-
size?: 'md' | 'lg';
|
|
23
|
+
size?: 'sm' | 'md' | 'lg';
|
|
23
24
|
type?: 'button' | 'submit' | 'reset';
|
|
24
25
|
variant?: 'solid' | 'outline' | 'ghost';
|
|
25
26
|
withArrow?: boolean;
|
|
26
27
|
}
|
|
27
|
-
declare function Button({ _pseudo, children, className, color, condensed, icon, isDisabled, onPress, size, type, variant, withArrow, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare function Button({ _pseudo, children, className, color, condensed, icon, iconPosition, isDisabled, onPress, size, type, variant, withArrow, }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
28
29
|
|
|
29
30
|
interface FavoriteButtonProps {
|
|
30
31
|
isFavorite: boolean;
|
|
@@ -36,10 +37,21 @@ interface IconButtonProps {
|
|
|
36
37
|
children: React.ReactNode;
|
|
37
38
|
className?: string;
|
|
38
39
|
color?: 'primary' | 'secondary';
|
|
40
|
+
isDisabled?: boolean;
|
|
39
41
|
onPress?: VoidFunction;
|
|
40
42
|
size?: 'md' | 'lg';
|
|
41
43
|
}
|
|
42
|
-
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;
|
|
45
|
+
|
|
46
|
+
interface LinkButtonProps {
|
|
47
|
+
children?: React.ReactNode | string;
|
|
48
|
+
className?: string;
|
|
49
|
+
href?: string;
|
|
50
|
+
isDisabled?: boolean;
|
|
51
|
+
onPress?: VoidFunction;
|
|
52
|
+
target?: HTMLAttributeAnchorTarget;
|
|
53
|
+
}
|
|
54
|
+
declare function LinkButton({ children, className, href, isDisabled, onPress, target, }: LinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
43
55
|
|
|
44
56
|
interface Source$1 {
|
|
45
57
|
url: string
|
|
@@ -85,6 +97,7 @@ declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton:
|
|
|
85
97
|
interface AccordionItemProps {
|
|
86
98
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
87
99
|
children: ReactNode;
|
|
100
|
+
className?: string;
|
|
88
101
|
id: string;
|
|
89
102
|
isDisabled?: boolean;
|
|
90
103
|
isOpen?: boolean;
|
|
@@ -96,9 +109,19 @@ interface AccordionProps {
|
|
|
96
109
|
children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];
|
|
97
110
|
color?: 'white' | 'black';
|
|
98
111
|
hasLineSeparator?: boolean;
|
|
112
|
+
indented?: boolean;
|
|
99
113
|
size?: 'md' | 'lg';
|
|
100
114
|
}
|
|
101
|
-
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;
|
|
116
|
+
|
|
117
|
+
interface ShowAllProps {
|
|
118
|
+
children?: ReactElement | ReactElement[];
|
|
119
|
+
hasTransparency?: boolean;
|
|
120
|
+
initialHeight?: number;
|
|
121
|
+
isOpen?: boolean;
|
|
122
|
+
onToggle: (isOpen: boolean) => void;
|
|
123
|
+
}
|
|
124
|
+
declare const ShowAll: ({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllProps) => react_jsx_runtime.JSX.Element;
|
|
102
125
|
|
|
103
126
|
interface ProductPriceProps {
|
|
104
127
|
className?: string;
|
|
@@ -113,6 +136,25 @@ interface ProductSkuProps {
|
|
|
113
136
|
}
|
|
114
137
|
declare function ProductSku({ sku }: ProductSkuProps): react_jsx_runtime.JSX.Element;
|
|
115
138
|
|
|
139
|
+
interface FilterOption {
|
|
140
|
+
amount: number;
|
|
141
|
+
isSelected: boolean;
|
|
142
|
+
label: string;
|
|
143
|
+
value: string;
|
|
144
|
+
}
|
|
145
|
+
interface MultiSelectProps<T extends FilterOption> {
|
|
146
|
+
amountShown?: number;
|
|
147
|
+
isOpen: boolean;
|
|
148
|
+
onChange: (value: T) => void;
|
|
149
|
+
onToggleOpen: (isOpen: boolean) => void;
|
|
150
|
+
options: T[];
|
|
151
|
+
render: ({ onChange, option, }: {
|
|
152
|
+
onChange: (key: string) => void;
|
|
153
|
+
option: T;
|
|
154
|
+
}) => ReactNode;
|
|
155
|
+
}
|
|
156
|
+
declare function MultiSelect<T extends FilterOption>({ amountShown, isOpen, onChange, onToggleOpen, options, render, }: MultiSelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
157
|
+
|
|
116
158
|
interface CheckboxProps$1 {
|
|
117
159
|
_pseudo?: 'none' | 'focus' | 'hover' | 'active';
|
|
118
160
|
children: ReactNode;
|
|
@@ -169,15 +211,15 @@ interface NumberFieldProps {
|
|
|
169
211
|
*/
|
|
170
212
|
declare function NumberField({ autoFocus, autoGrow, defaultValue, formatOptions, isDisabled, isInvalid, isReadOnly, isRequired, label, maxLength, maxValue, minValue, name, onChange, onInput, onKeyUp, placeholder, showLabel, size, value, withButtons, }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
171
213
|
|
|
172
|
-
interface SelectProps {
|
|
214
|
+
interface SelectProps<T> {
|
|
173
215
|
disabled?: boolean;
|
|
174
216
|
label: string;
|
|
175
|
-
onChange: (value:
|
|
176
|
-
options:
|
|
177
|
-
selectedOption?:
|
|
217
|
+
onChange: (value: keyof T) => void;
|
|
218
|
+
options: T;
|
|
219
|
+
selectedOption?: keyof T;
|
|
178
220
|
showLabel?: boolean;
|
|
179
221
|
}
|
|
180
|
-
declare
|
|
222
|
+
declare function Select<T extends object>({ disabled, label, onChange, options, selectedOption, showLabel, }: SelectProps<T>): react_jsx_runtime.JSX.Element;
|
|
181
223
|
|
|
182
224
|
interface TextFieldProps {
|
|
183
225
|
autoFocus?: boolean;
|
|
@@ -220,11 +262,7 @@ declare function FavoriteOutlinedIcon(props: React.SVGProps<SVGSVGElement>): rea
|
|
|
220
262
|
|
|
221
263
|
declare function HashedOutlinedIcon(props: React.SVGProps<SVGSVGElement>): react_jsx_runtime.JSX.Element;
|
|
222
264
|
|
|
223
|
-
|
|
224
|
-
'Excl. VAT': string;
|
|
225
|
-
'Incl. VAT': string;
|
|
226
|
-
}
|
|
227
|
-
type TranslationId = keyof Translations;
|
|
265
|
+
type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. VAT' | 'Show' | 'Show all' | 'Show filters' | 'Show less' | 'Sort' | 'articles' | 'article' | 'of';
|
|
228
266
|
|
|
229
267
|
interface FormattedMessageProps {
|
|
230
268
|
id: TranslationId;
|
|
@@ -278,31 +316,27 @@ interface Filters {
|
|
|
278
316
|
}[];
|
|
279
317
|
};
|
|
280
318
|
}
|
|
319
|
+
declare const sortOptions: {
|
|
320
|
+
readonly new: "New";
|
|
321
|
+
readonly popular: "Popular";
|
|
322
|
+
readonly price_asc: "Price: Low - High";
|
|
323
|
+
readonly price_desc: "Price: High - Low";
|
|
324
|
+
readonly recommended: "Recommended";
|
|
325
|
+
};
|
|
326
|
+
type SortKey = keyof typeof sortOptions;
|
|
281
327
|
type ActiveFilters = {
|
|
282
328
|
colors: string[];
|
|
283
329
|
};
|
|
284
|
-
type Sort = {
|
|
285
|
-
by: string;
|
|
286
|
-
direction: string;
|
|
287
|
-
};
|
|
288
330
|
type ProductListingProps = {
|
|
289
331
|
activeFilters: ActiveFilters;
|
|
290
332
|
filters: Filters;
|
|
291
333
|
isLoading?: boolean;
|
|
292
334
|
onFilterChange: (filters: ActiveFilters) => void;
|
|
293
|
-
onSortChange: (sort:
|
|
294
|
-
|
|
295
|
-
products: {
|
|
296
|
-
id: string;
|
|
297
|
-
title: string;
|
|
298
|
-
}[];
|
|
299
|
-
sort: {
|
|
300
|
-
by: string;
|
|
301
|
-
direction: string;
|
|
302
|
-
};
|
|
335
|
+
onSortChange: (sort: SortKey) => void;
|
|
336
|
+
sort: SortKey;
|
|
303
337
|
total: number;
|
|
304
338
|
};
|
|
305
|
-
declare function ProductListing({
|
|
339
|
+
declare function ProductListing({ isLoading }: ProductListingProps): react_jsx_runtime.JSX.Element;
|
|
306
340
|
|
|
307
341
|
declare function createProductListingSearchParams(state: {
|
|
308
342
|
filters: {
|
|
@@ -323,4 +357,9 @@ declare function parseProductListingSearchParams(params: URLSearchParams): {
|
|
|
323
357
|
};
|
|
324
358
|
};
|
|
325
359
|
|
|
326
|
-
|
|
360
|
+
interface SidebarProps {
|
|
361
|
+
children: React.ReactNode;
|
|
362
|
+
}
|
|
363
|
+
declare function Sidebar({ children }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
365
|
+
export { Accordion, type ActiveFilters, AddToCartButton, Button, type ButtonProps, CartFilledIcon, CartOutlinedIcon, Checkbox, type CheckboxProps$1 as CheckboxProps, ColorCheckbox, type ColorCheckboxProps, DehashedOutlinedIcon, FavoriteButton, type FavoriteButtonProps, FavoriteFilledIcon, FavoriteOutlinedIcon, type FilterOption, type Filters, FormattedMessage, type FormattedMessageFunction, type FormattedMessageProps, HashedOutlinedIcon, IconButton, type IconButtonProps, Image, type ImageProps, IntlProvider, LinkButton, type LinkButtonProps, MultiSelect, type MultiSelectProps, NumberField, type NumberFieldSize, 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, useFormattedMessage };
|