@sonic-equipment/ui 0.0.22 → 0.0.24
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-filter-section.d.ts +18 -0
- package/dist/algolia/algolia-multi-select-filter-section.d.ts +5 -0
- package/dist/algolia/algolia-provider.d.ts +10 -3
- package/dist/algolia/algolia-query-string-routing.d.ts +3 -0
- package/dist/algolia/algolia-searchclient-offline.d.ts +3 -0
- package/dist/badges/tag/tag.d.ts +2 -1
- package/dist/badges/tag/tag.stories.d.ts +0 -1
- package/dist/breadcrumbs/breadcrumb.d.ts +9 -0
- package/dist/breadcrumbs/breadcrumb.stories.d.ts +19 -0
- package/dist/breadcrumbs/connected-breadcrumb.d.ts +1 -0
- package/dist/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +0 -1
- package/dist/buttons/button/button.stories.d.ts +0 -1
- package/dist/buttons/favorite/connected-favorite-button.d.ts +3 -0
- package/dist/buttons/favorite/favorite-button.stories.d.ts +0 -1
- package/dist/buttons/icon-button/icon-button.stories.d.ts +0 -1
- package/dist/buttons/link-button/link-button.stories.d.ts +0 -1
- package/dist/cards/category-card/category-card.d.ts +8 -0
- package/dist/cards/category-card/category-card.stories.d.ts +15 -0
- package/dist/cards/product-card/product-card.d.ts +4 -2
- package/dist/cards/product-card/product-card.stories.d.ts +2 -3
- package/dist/carousel/carousel-navigation-button.d.ts +6 -0
- package/dist/carousel/carousel.d.ts +13 -0
- package/dist/carousel/category-carousel/category-carousel.d.ts +5 -0
- package/dist/carousel/category-carousel/category-carousel.stories.d.ts +15 -0
- package/dist/collapsables/accordion/accordion-item.d.ts +3 -3
- package/dist/collapsables/accordion/accordion.stories.d.ts +0 -1
- package/dist/collapsables/show-all/show-all.stories.d.ts +0 -1
- package/dist/display/product-price/product-price.stories.d.ts +0 -1
- package/dist/display/product-sku/product-sku.stories.d.ts +0 -1
- package/dist/filters/multi-select/multi-select.d.ts +1 -3
- package/dist/filters/multi-select/multi-select.stories.d.ts +0 -1
- package/dist/filters/pagination/pagination.stories.d.ts +0 -1
- package/dist/forms/checkbox/checkbox.stories.d.ts +0 -1
- package/dist/forms/color-checkbox/color-checkbox.stories.d.ts +0 -1
- package/dist/forms/field-error/field-error.stories.d.ts +0 -1
- package/dist/forms/input/input.stories.d.ts +0 -1
- package/dist/forms/label/label.stories.d.ts +0 -1
- package/dist/forms/number-field/number-field.stories.d.ts +0 -1
- package/dist/forms/select/select.stories.d.ts +0 -1
- package/dist/forms/text-field/text-field.stories.d.ts +0 -1
- package/dist/forms/textarea/textarea.stories.d.ts +0 -1
- package/dist/icons/arrows/left-arrow-filled-icon.d.ts +2 -0
- package/dist/icons/home/home-filled-icon.d.ts +2 -0
- package/dist/index.d.ts +125 -47
- package/dist/index.js +5600 -1704
- package/dist/intl/formatted-message.d.ts +2 -0
- package/dist/intl/formatted-message.stories.d.ts +1 -1
- package/dist/intl/translation-id.d.ts +1 -1
- package/dist/intl/types.d.ts +1 -1
- package/dist/intl/use-format-message.d.ts +5 -1
- package/dist/media/image/image.stories.d.ts +0 -1
- package/dist/pages/page/page.d.ts +7 -0
- package/dist/pages/page/page.stories.d.ts +19 -0
- package/dist/pages/page-layout/page-layout.d.ts +5 -0
- package/dist/pages/page-layout/page-layout.stories.d.ts +22 -0
- package/dist/pages/product-listing-page/product-listing-page.d.ts +14 -0
- package/dist/{product-listing/product-listing.stories.d.ts → pages/product-listing-page/product-listing-page.stories.d.ts} +7 -4
- package/dist/shared/hooks/use-breakpoint.d.ts +12 -4
- package/dist/shared/hooks/use-disclosure.d.ts +1 -1
- package/dist/shared/providers/breadcrumb-provider.d.ts +11 -0
- package/dist/shared/providers/favorite-provider.d.ts +10 -0
- package/dist/sidebar/sidebar-context.d.ts +1 -0
- package/dist/styles.css +639 -60
- package/dist/typography/heading/heading.stories.d.ts +1 -2
- package/package.json +15 -4
- package/dist/algolia/algolia-multi-select.d.ts +0 -5
- package/dist/algolia/algolia-product-list.d.ts +0 -1
- package/dist/algolia/algolia-searchclient-mock.d.ts +0 -4
- package/dist/algolia/algolia.stories.d.ts +0 -17
- package/dist/product-listing/filters/colors/color-filter.d.ts +0 -11
- package/dist/product-listing/filters/filter/filter.d.ts +0 -7
- package/dist/product-listing/product-listing.d.ts +0 -13
- package/dist/product-listing/search-params.d.ts +0 -18
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface RefinementListItem {
|
|
3
|
+
count: number;
|
|
4
|
+
highlighted?: string;
|
|
5
|
+
isRefined: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
interface AlgoliaFilterSectionProps {
|
|
10
|
+
attribute: string;
|
|
11
|
+
children({ items, refine, }: {
|
|
12
|
+
items: RefinementListItem[];
|
|
13
|
+
refine(value: string): void;
|
|
14
|
+
}): React.ReactNode;
|
|
15
|
+
initialIsOpen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function AlgoliaFilterSection({ attribute, children, initialIsOpen, }: AlgoliaFilterSectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SearchClient } from 'algoliasearch/lite';
|
|
3
|
+
import { RouterProps } from 'instantsearch.js/es/middlewares/createRouterMiddleware';
|
|
4
|
+
import { UiState } from 'instantsearch.js/es/types';
|
|
2
5
|
interface AlgoliaContextType {
|
|
3
6
|
online: boolean;
|
|
4
7
|
setOnline: (online: boolean) => void;
|
|
5
8
|
toggleOnline: VoidFunction;
|
|
6
9
|
}
|
|
7
10
|
interface AlgoliaProviderProps {
|
|
8
|
-
|
|
11
|
+
category: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
offlineSearchClient?: SearchClient;
|
|
9
14
|
online?: boolean;
|
|
15
|
+
routing?: boolean | RouterProps<UiState, UiState> | undefined;
|
|
16
|
+
searchClient: SearchClient;
|
|
10
17
|
}
|
|
11
|
-
export declare function AlgoliaProvider({ children, online: _online, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function AlgoliaProvider({ category, children, offlineSearchClient, online: _online, routing, searchClient, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
19
|
export declare function useAlgolia(): AlgoliaContextType;
|
|
13
20
|
export {};
|
package/dist/badges/tag/tag.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Link } from 'shared/providers/breadcrumb-provider';
|
|
3
|
+
import { Breadcrumb } from './breadcrumb';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
component: typeof Breadcrumb;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
title: string;
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const FourLevels: Story;
|
|
14
|
+
export declare const FourLevelsMobile: Story;
|
|
15
|
+
export declare const TwoLevels: Story;
|
|
16
|
+
export declare const TwoLevelsMobile: Story;
|
|
17
|
+
export declare const Connected: StoryObj<{
|
|
18
|
+
links: Link[];
|
|
19
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ConnectedBreadcrumb(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ImageProps } from 'media/image/image';
|
|
2
|
+
export interface CategoryCardProps {
|
|
3
|
+
href: string;
|
|
4
|
+
image: ImageProps;
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
title: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CategoryCard({ href, image, isSelected, title, }: CategoryCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CategoryCard } from './category-card';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof CategoryCard;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Small: Story;
|
|
13
|
+
export declare const Medium: Story;
|
|
14
|
+
export declare const Large: Story;
|
|
15
|
+
export declare const Selected: Story;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
+
import { PressEvent } from 'react-aria-components';
|
|
2
3
|
import { ImageProps } from 'media/image/image';
|
|
3
4
|
import type { ProductPrice as ProductPriceType } from 'shared/types/price';
|
|
4
5
|
export interface ProductCardProps {
|
|
5
6
|
addToCartButton: ReactElement;
|
|
6
7
|
favoriteButton?: ReactElement;
|
|
8
|
+
href: string;
|
|
7
9
|
image: ImageProps;
|
|
8
|
-
onClick:
|
|
10
|
+
onClick?: (e: PressEvent) => void;
|
|
9
11
|
price: ProductPriceType;
|
|
10
12
|
sku: string;
|
|
11
13
|
tag?: 'new' | 'sale';
|
|
12
14
|
title: string;
|
|
13
15
|
}
|
|
14
|
-
export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, image: { alt, fit, src, title: imageTitle }, onClick, price, sku, tag, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, image: { alt, fit, src, title: imageTitle }, onClick, price, sku, tag, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { StoryObj } from '@storybook/react';
|
|
3
2
|
import { ProductCard } from './product-card';
|
|
4
3
|
declare const meta: {
|
|
5
4
|
args: {
|
|
6
5
|
addToCartButton: import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
favoriteButton: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
href: string;
|
|
8
8
|
image: {
|
|
9
9
|
alt: string;
|
|
10
10
|
fit: "contain";
|
|
11
11
|
src: string;
|
|
12
12
|
title: string;
|
|
13
13
|
};
|
|
14
|
-
onClick: import("@vitest/spy").Mock<[
|
|
14
|
+
onClick: import("@vitest/spy").Mock<[e: import("react-aria").PressEvent], void>;
|
|
15
15
|
sku: string;
|
|
16
16
|
tag: "new";
|
|
17
17
|
};
|
|
@@ -26,7 +26,6 @@ declare const meta: {
|
|
|
26
26
|
};
|
|
27
27
|
layout: string;
|
|
28
28
|
};
|
|
29
|
-
tags: string[];
|
|
30
29
|
title: string;
|
|
31
30
|
};
|
|
32
31
|
export default meta;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SwiperOptions } from 'swiper/types';
|
|
3
|
+
import 'swiper/css';
|
|
4
|
+
export interface CarouselProps {
|
|
5
|
+
breakpoints?: SwiperOptions['breakpoints'];
|
|
6
|
+
hasNavigation?: boolean;
|
|
7
|
+
hasOverflow?: boolean;
|
|
8
|
+
navigationButtonsPosition?: 'top' | 'center';
|
|
9
|
+
slides: ReactNode[];
|
|
10
|
+
slidesPerView?: number | 'auto';
|
|
11
|
+
spaceBetween?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function Carousel({ breakpoints, hasNavigation, navigationButtonsPosition, slides, slidesPerView, spaceBetween, }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CategoryCardProps } from 'cards/category-card/category-card';
|
|
2
|
+
export interface CategoryCarouselProps {
|
|
3
|
+
categories: CategoryCardProps[];
|
|
4
|
+
}
|
|
5
|
+
export declare function CategoryCarousel({ categories }: CategoryCarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CategoryCarousel } from './category-carousel';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: typeof CategoryCarousel;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
title: string;
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Small: Story;
|
|
13
|
+
export declare const Medium: Story;
|
|
14
|
+
export declare const Large: Story;
|
|
15
|
+
export declare const Hover: Story;
|
|
@@ -4,9 +4,9 @@ export interface AccordionItemProps {
|
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
6
|
id: string;
|
|
7
|
+
initialIsOpen?: boolean;
|
|
7
8
|
isDisabled?: boolean;
|
|
8
|
-
isOpen?: boolean;
|
|
9
9
|
size?: 'md' | 'lg';
|
|
10
|
-
title:
|
|
10
|
+
title: ReactNode;
|
|
11
11
|
}
|
|
12
|
-
export declare function AccordionItem({ _pseudo, children, className, id,
|
|
12
|
+
export declare function AccordionItem({ _pseudo, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,13 +7,11 @@ export interface FilterOption {
|
|
|
7
7
|
}
|
|
8
8
|
export interface MultiSelectProps<T extends FilterOption> {
|
|
9
9
|
amountShown?: number;
|
|
10
|
-
isOpen: boolean;
|
|
11
10
|
onChange: (value: T) => void;
|
|
12
|
-
onToggleOpen: (isOpen: boolean) => void;
|
|
13
11
|
options: T[];
|
|
14
12
|
render: ({ onChange, option, }: {
|
|
15
13
|
onChange: (key: string) => void;
|
|
16
14
|
option: T;
|
|
17
15
|
}) => ReactNode;
|
|
18
16
|
}
|
|
19
|
-
export declare function MultiSelect<T extends FilterOption>({ amountShown,
|
|
17
|
+
export declare function MultiSelect<T extends FilterOption>({ amountShown, onChange, options, render, }: MultiSelectProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -6,7 +6,6 @@ type ColorFilterOption = FilterOption & {
|
|
|
6
6
|
declare const meta: {
|
|
7
7
|
args: {
|
|
8
8
|
onChange: import("@vitest/spy").Mock<[value: FilterOption], void>;
|
|
9
|
-
onToggleOpen: import("@vitest/spy").Mock<[isOpen: boolean], void>;
|
|
10
9
|
};
|
|
11
10
|
component: typeof MultiSelect;
|
|
12
11
|
parameters: {
|