@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.
Files changed (73) hide show
  1. package/dist/algolia/algolia-filter-section.d.ts +18 -0
  2. package/dist/algolia/algolia-multi-select-filter-section.d.ts +5 -0
  3. package/dist/algolia/algolia-provider.d.ts +10 -3
  4. package/dist/algolia/algolia-query-string-routing.d.ts +3 -0
  5. package/dist/algolia/algolia-searchclient-offline.d.ts +3 -0
  6. package/dist/badges/tag/tag.d.ts +2 -1
  7. package/dist/badges/tag/tag.stories.d.ts +0 -1
  8. package/dist/breadcrumbs/breadcrumb.d.ts +9 -0
  9. package/dist/breadcrumbs/breadcrumb.stories.d.ts +19 -0
  10. package/dist/breadcrumbs/connected-breadcrumb.d.ts +1 -0
  11. package/dist/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +0 -1
  12. package/dist/buttons/button/button.stories.d.ts +0 -1
  13. package/dist/buttons/favorite/connected-favorite-button.d.ts +3 -0
  14. package/dist/buttons/favorite/favorite-button.stories.d.ts +0 -1
  15. package/dist/buttons/icon-button/icon-button.stories.d.ts +0 -1
  16. package/dist/buttons/link-button/link-button.stories.d.ts +0 -1
  17. package/dist/cards/category-card/category-card.d.ts +8 -0
  18. package/dist/cards/category-card/category-card.stories.d.ts +15 -0
  19. package/dist/cards/product-card/product-card.d.ts +4 -2
  20. package/dist/cards/product-card/product-card.stories.d.ts +2 -3
  21. package/dist/carousel/carousel-navigation-button.d.ts +6 -0
  22. package/dist/carousel/carousel.d.ts +13 -0
  23. package/dist/carousel/category-carousel/category-carousel.d.ts +5 -0
  24. package/dist/carousel/category-carousel/category-carousel.stories.d.ts +15 -0
  25. package/dist/collapsables/accordion/accordion-item.d.ts +3 -3
  26. package/dist/collapsables/accordion/accordion.stories.d.ts +0 -1
  27. package/dist/collapsables/show-all/show-all.stories.d.ts +0 -1
  28. package/dist/display/product-price/product-price.stories.d.ts +0 -1
  29. package/dist/display/product-sku/product-sku.stories.d.ts +0 -1
  30. package/dist/filters/multi-select/multi-select.d.ts +1 -3
  31. package/dist/filters/multi-select/multi-select.stories.d.ts +0 -1
  32. package/dist/filters/pagination/pagination.stories.d.ts +0 -1
  33. package/dist/forms/checkbox/checkbox.stories.d.ts +0 -1
  34. package/dist/forms/color-checkbox/color-checkbox.stories.d.ts +0 -1
  35. package/dist/forms/field-error/field-error.stories.d.ts +0 -1
  36. package/dist/forms/input/input.stories.d.ts +0 -1
  37. package/dist/forms/label/label.stories.d.ts +0 -1
  38. package/dist/forms/number-field/number-field.stories.d.ts +0 -1
  39. package/dist/forms/select/select.stories.d.ts +0 -1
  40. package/dist/forms/text-field/text-field.stories.d.ts +0 -1
  41. package/dist/forms/textarea/textarea.stories.d.ts +0 -1
  42. package/dist/icons/arrows/left-arrow-filled-icon.d.ts +2 -0
  43. package/dist/icons/home/home-filled-icon.d.ts +2 -0
  44. package/dist/index.d.ts +125 -47
  45. package/dist/index.js +5600 -1704
  46. package/dist/intl/formatted-message.d.ts +2 -0
  47. package/dist/intl/formatted-message.stories.d.ts +1 -1
  48. package/dist/intl/translation-id.d.ts +1 -1
  49. package/dist/intl/types.d.ts +1 -1
  50. package/dist/intl/use-format-message.d.ts +5 -1
  51. package/dist/media/image/image.stories.d.ts +0 -1
  52. package/dist/pages/page/page.d.ts +7 -0
  53. package/dist/pages/page/page.stories.d.ts +19 -0
  54. package/dist/pages/page-layout/page-layout.d.ts +5 -0
  55. package/dist/pages/page-layout/page-layout.stories.d.ts +22 -0
  56. package/dist/pages/product-listing-page/product-listing-page.d.ts +14 -0
  57. package/dist/{product-listing/product-listing.stories.d.ts → pages/product-listing-page/product-listing-page.stories.d.ts} +7 -4
  58. package/dist/shared/hooks/use-breakpoint.d.ts +12 -4
  59. package/dist/shared/hooks/use-disclosure.d.ts +1 -1
  60. package/dist/shared/providers/breadcrumb-provider.d.ts +11 -0
  61. package/dist/shared/providers/favorite-provider.d.ts +10 -0
  62. package/dist/sidebar/sidebar-context.d.ts +1 -0
  63. package/dist/styles.css +639 -60
  64. package/dist/typography/heading/heading.stories.d.ts +1 -2
  65. package/package.json +15 -4
  66. package/dist/algolia/algolia-multi-select.d.ts +0 -5
  67. package/dist/algolia/algolia-product-list.d.ts +0 -1
  68. package/dist/algolia/algolia-searchclient-mock.d.ts +0 -4
  69. package/dist/algolia/algolia.stories.d.ts +0 -17
  70. package/dist/product-listing/filters/colors/color-filter.d.ts +0 -11
  71. package/dist/product-listing/filters/filter/filter.d.ts +0 -7
  72. package/dist/product-listing/product-listing.d.ts +0 -13
  73. 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 {};
@@ -0,0 +1,5 @@
1
+ interface AlgoliaMultiSelectFilterSectionProps {
2
+ attribute: string;
3
+ }
4
+ export declare function AlgoliaMultiSelectFilterSection({ attribute, }: AlgoliaMultiSelectFilterSectionProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,13 +1,20 @@
1
- /// <reference types="react" />
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
- children: React.ReactNode;
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 {};
@@ -0,0 +1,3 @@
1
+ import { RouterProps } from 'instantsearch.js/es/middlewares/createRouterMiddleware';
2
+ import { UiState } from 'instantsearch.js/es/types';
3
+ export declare const queryStringRouting: RouterProps<UiState, UiState>;
@@ -0,0 +1,3 @@
1
+ import { SearchClient } from 'algoliasearch/lite';
2
+ export declare const searchClientLogger: (searchClient: SearchClient) => SearchClient;
3
+ export declare const offlineSearchClient: SearchClient;
@@ -1,5 +1,6 @@
1
+ import { ReactNode } from 'react';
1
2
  interface TagProps {
2
- children: string;
3
+ children: ReactNode;
3
4
  }
4
5
  export declare function Tag({ children }: TagProps): import("react/jsx-runtime").JSX.Element | null;
5
6
  export {};
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -0,0 +1,9 @@
1
+ interface Link {
2
+ href: string;
3
+ label: string;
4
+ }
5
+ export interface BreadcrumbProps {
6
+ links: Link[];
7
+ }
8
+ export declare function Breadcrumb({ links }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -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;
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  quantity: number;
7
7
  };
8
8
  component: typeof AddToCartButton;
9
- tags: string[];
10
9
  title: string;
11
10
  };
12
11
  export default meta;
@@ -9,7 +9,6 @@ declare const meta: {
9
9
  parameters: {
10
10
  layout: string;
11
11
  };
12
- tags: string[];
13
12
  title: string;
14
13
  };
15
14
  export default meta;
@@ -0,0 +1,3 @@
1
+ export declare function ConnectedFavoriteButton({ productId }: {
2
+ productId: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -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: React.MouseEventHandler<HTMLDivElement>;
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<[event: React.MouseEvent<HTMLDivElement, MouseEvent>], void>;
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,6 @@
1
+ interface CarouselNavigationButtonProps {
2
+ direction: 'previous' | 'next';
3
+ isDisabled?: boolean;
4
+ }
5
+ export declare function CarouselNavigationButton({ direction, isDisabled, }: CarouselNavigationButtonProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -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: string;
10
+ title: ReactNode;
11
11
  }
12
- export declare function AccordionItem({ _pseudo, children, className, id, isDisabled, isOpen: isOpenProp, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function AccordionItem({ _pseudo, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
@@ -5,7 +5,6 @@ declare const meta: {
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
8
- tags: string[];
9
8
  title: string;
10
9
  };
11
10
  export default meta;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -5,7 +5,6 @@ declare const meta: {
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
8
- tags: string[];
9
8
  title: string;
10
9
  };
11
10
  export default meta;
@@ -5,7 +5,6 @@ declare const meta: {
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
8
- tags: string[];
9
8
  title: string;
10
9
  };
11
10
  export default meta;
@@ -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, isOpen, onChange, onToggleOpen, options, render, }: MultiSelectProps<T>): import("react/jsx-runtime").JSX.Element;
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: {
@@ -10,7 +10,6 @@ declare const meta: {
10
10
  parameters: {
11
11
  layout: string;
12
12
  };
13
- tags: string[];
14
13
  title: string;
15
14
  };
16
15
  export default meta;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -8,7 +8,6 @@ declare const meta: {
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
11
- tags: string[];
12
11
  title: string;
13
12
  };
14
13
  export default meta;
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
9
- tags: string[];
10
9
  title: string;
11
10
  };
12
11
  export default meta;
@@ -16,7 +16,6 @@ declare const meta: {
16
16
  parameters: {
17
17
  layout: string;
18
18
  };
19
- tags: string[];
20
19
  title: string;
21
20
  };
22
21
  export default meta;
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
9
- tags: string[];
10
9
  title: string;
11
10
  };
12
11
  export default meta;
@@ -12,7 +12,6 @@ declare const meta: {
12
12
  parameters: {
13
13
  layout: string;
14
14
  };
15
- tags: string[];
16
15
  title: string;
17
16
  };
18
17
  export default meta;
@@ -15,7 +15,6 @@ declare const meta: {
15
15
  parameters: {
16
16
  layout: string;
17
17
  };
18
- tags: string[];
19
18
  title: string;
20
19
  };
21
20
  export default meta;
@@ -5,7 +5,6 @@ declare const meta: {
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
8
- tags: string[];
9
8
  title: string;
10
9
  };
11
10
  export default meta;
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
9
- tags: string[];
10
9
  title: string;
11
10
  };
12
11
  export default meta;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function LeftArrowFilledIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function HomeFilledIcon(props: React.SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;