@sonic-equipment/ui 0.0.73 → 0.0.75

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 (26) hide show
  1. package/dist/index.d.ts +33 -20
  2. package/dist/index.js +395 -233
  3. package/dist/src/algolia/use-algolia-insights.d.ts +1 -2
  4. package/dist/src/buttons/favorite/connected-favorite-button.d.ts +3 -2
  5. package/dist/src/cards/product-card/connected-product-cart.d.ts +3 -2
  6. package/dist/src/carousel/carousel.d.ts +7 -3
  7. package/dist/src/carousel/product-carousel/product-carousel.d.ts +5 -1
  8. package/dist/src/carousel/product-carousel/product-carousel.stories.d.ts +1 -0
  9. package/dist/src/collapsables/accordion/accordion-item.d.ts +3 -1
  10. package/dist/src/collapsables/accordion/accordion.d.ts +4 -4
  11. package/dist/src/collapsables/accordion/accordion.stories.d.ts +3 -0
  12. package/dist/src/collapsables/show-all/show-all.d.ts +12 -5
  13. package/dist/src/collapsables/show-all/show-all.stories.d.ts +6 -4
  14. package/dist/src/intl/translation-id.d.ts +1 -1
  15. package/dist/src/lists/download-document-list/document-download-list.stories.d.ts +13 -0
  16. package/dist/src/lists/download-document-list/download-document-list.d.ts +11 -0
  17. package/dist/src/lists/feature-list/feature-list.d.ts +26 -0
  18. package/dist/src/lists/feature-list/feature-list.stories.d.ts +16 -0
  19. package/dist/src/pages/product-details-page/components/product-details-panel.d.ts +4 -0
  20. package/dist/src/shared/api/bff/model/bff.model.d.ts +3 -3
  21. package/dist/src/shared/hooks/use-resize-observer.d.ts +4 -0
  22. package/dist/src/shared/utils/merge.d.ts +12 -0
  23. package/dist/styles.css +307 -133
  24. package/package.json +2 -1
  25. package/dist/src/algolia/algolia-filter-section.d.ts +0 -17
  26. package/dist/src/global-search/plugins/products-plugin.d.ts +0 -7
@@ -28,8 +28,7 @@ export interface UseAlgoliaEventResult {
28
28
  objectId: string;
29
29
  position: number;
30
30
  }): void;
31
- sendProductClickFromSearchEvent({ index, objectId, position, queryId, }: {
32
- index: string;
31
+ sendProductClickFromSearchEvent({ objectId, position, queryId, }: {
33
32
  objectId: string | string[] | undefined;
34
33
  position: number | number[];
35
34
  queryId: string;
@@ -1,4 +1,5 @@
1
- export declare function ConnectedFavoriteButton({ onFavorite: _onFavorite, productId, }: {
2
- onFavorite?: VoidFunction;
1
+ export declare function ConnectedFavoriteButton({ onFavorited: _onFavorited, onFavoriting: _onFavoriting, productId, }: {
2
+ onFavorited?: VoidFunction;
3
+ onFavoriting?: VoidFunction;
3
4
  productId: string;
4
5
  }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,7 +1,8 @@
1
1
  import { ProductCardProps } from './product-card';
2
2
  export interface ConnectedProductCartProps extends Omit<ProductCardProps, 'addToCartButton' | 'favoriteButton'> {
3
3
  onAddToCart?: VoidFunction;
4
- onFavorite?: VoidFunction;
4
+ onFavorited?: VoidFunction;
5
+ onFavoriting?: VoidFunction;
5
6
  productId: string;
6
7
  }
7
- export declare function ConnectedProductCard({ onAddToCart, onFavorite, productId, ...props }: ConnectedProductCartProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ConnectedProductCard({ onAddToCart, onFavorited, onFavoriting, productId, ...props }: ConnectedProductCartProps): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
+ import { Breakpoint } from 'shared/utils/breakpoints';
2
3
  import { SwiperOptions } from 'swiper/types';
3
4
  import 'swiper/css';
5
+ type SlidesPerViewBreakpoints = Partial<Record<Breakpoint, number | 'auto'>>;
6
+ type SwiperBreakpoints = SwiperOptions['breakpoints'];
4
7
  export interface CarouselProps {
5
- breakpoints?: SwiperOptions['breakpoints'];
8
+ breakpoints?: SwiperBreakpoints;
6
9
  className?: string;
7
10
  hasNavigation?: boolean;
8
11
  hasOverflow?: boolean;
9
12
  navigationButtonsPosition?: 'top' | 'center';
10
13
  slideClasses?: string;
11
14
  slides: ReactNode[];
12
- slidesPerView?: number | 'auto';
15
+ slidesPerView?: number | 'auto' | SlidesPerViewBreakpoints;
13
16
  spaceBetween?: number;
14
17
  }
15
- export declare function Carousel({ breakpoints, className, hasNavigation, hasOverflow, navigationButtonsPosition, slideClasses, slides, slidesPerView, spaceBetween, }: CarouselProps): import("react/jsx-runtime").JSX.Element | null;
18
+ export declare function Carousel({ breakpoints: _breakpoints, className, hasNavigation, hasOverflow, navigationButtonsPosition, slideClasses, slides, slidesPerView: _slidesPerView, spaceBetween, }: CarouselProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export {};
@@ -1,6 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
+ import { CarouselProps } from 'carousel/carousel';
2
3
  export interface ProductCarouselProps {
4
+ allowExpandToGrid?: boolean;
5
+ cardWidth?: 'normal' | 'narrow' | 'auto';
3
6
  hasOverflow?: boolean;
4
7
  productCards: ReactNode[];
8
+ productsPerView?: CarouselProps['slidesPerView'];
5
9
  }
6
- export declare function ProductCarousel({ hasOverflow, productCards, }: ProductCarouselProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ProductCarousel({ allowExpandToGrid, cardWidth, hasOverflow, productCards, productsPerView, }: ProductCarouselProps): import("react/jsx-runtime").JSX.Element;
@@ -16,4 +16,5 @@ type Story = StoryObj<typeof meta>;
16
16
  export declare const Small: Story;
17
17
  export declare const Medium: Story;
18
18
  export declare const Large: Story;
19
+ export declare const Narrow: Story;
19
20
  export declare const Hover: Story;
@@ -1,6 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
+ export type BorderType = 'top' | 'middle' | 'middle-accentuated' | 'bottom';
2
3
  export interface AccordionItemProps {
3
4
  _pseudo?: 'none' | 'focus' | 'hover' | 'active';
5
+ borderType?: BorderType | BorderType[];
4
6
  children: ReactNode;
5
7
  className?: string;
6
8
  id: string;
@@ -9,4 +11,4 @@ export interface AccordionItemProps {
9
11
  size?: 'md' | 'lg';
10
12
  title: ReactNode;
11
13
  }
12
- export declare function AccordionItem({ _pseudo, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function AccordionItem({ _pseudo, borderType, children, className, id, initialIsOpen, isDisabled, size, title, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import { ReactElement } from 'react';
2
- import { AccordionItemProps } from './accordion-item';
2
+ import { AccordionItemProps, BorderType } from './accordion-item';
3
3
  interface AccordionProps {
4
- borderPosition?: 'top' | 'bottom';
5
- children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[];
4
+ borderType?: BorderType | BorderType[];
5
+ children?: ReactElement<AccordionItemProps> | ReactElement<AccordionItemProps>[] | false | undefined | null | (false | undefined | null | ReactElement<AccordionItemProps>)[];
6
6
  color?: 'white' | 'black';
7
7
  hasLineSeparator?: boolean;
8
8
  indented?: boolean;
9
9
  size?: 'md' | 'lg';
10
10
  }
11
- export declare function Accordion({ borderPosition, children, color, hasLineSeparator, indented, size, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function Accordion({ borderType, children, color, hasLineSeparator, indented, size, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -15,3 +15,6 @@ export declare const Indented: Story;
15
15
  export declare const Disabled: Story;
16
16
  export declare const Focus: Story;
17
17
  export declare const Large: Story;
18
+ export declare const BorderLineTop: Story;
19
+ export declare const BorderLineMiddle: Story;
20
+ export declare const BorderLineBottom: Story;
@@ -1,9 +1,16 @@
1
- import { type ReactElement } from 'react';
2
- export interface ShowAllProps {
3
- children?: ReactElement | ReactElement[];
1
+ import { type ReactElement, ReactNode } from 'react';
2
+ interface ShowAllProps {
3
+ children: ReactElement | ReactElement[];
4
4
  hasTransparency?: boolean;
5
5
  initialHeight?: number;
6
- isOpen?: boolean;
6
+ }
7
+ export interface ShowAllPropsControlled extends ShowAllProps {
8
+ isOpen: boolean;
7
9
  onToggle: (isOpen: boolean) => void;
8
10
  }
9
- export declare const ShowAll: ({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllProps) => import("react/jsx-runtime").JSX.Element;
11
+ export interface ShowAllPropsUncontrolled extends ShowAllProps {
12
+ initialIsOpen?: boolean;
13
+ }
14
+ export declare function ShowAll({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllPropsControlled): ReactNode;
15
+ export declare function ShowAll({ children, hasTransparency, initialHeight, initialIsOpen, }: ShowAllPropsUncontrolled): ReactNode;
16
+ export {};
@@ -1,10 +1,10 @@
1
- import { StoryObj } from '@storybook/react';
2
- import { ShowAllProps } from './show-all';
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { ShowAll, ShowAllPropsControlled, ShowAllPropsUncontrolled } from './show-all';
3
3
  declare const meta: {
4
4
  args: {
5
5
  onToggle: import("@vitest/spy").Mock<(...args: any[]) => any>;
6
6
  };
7
- component: ({ children, hasTransparency, initialHeight, isOpen, onToggle, }: ShowAllProps) => import("react/jsx-runtime").JSX.Element;
7
+ component: typeof ShowAll;
8
8
  parameters: {
9
9
  layout: string;
10
10
  };
@@ -12,6 +12,8 @@ declare const meta: {
12
12
  title: string;
13
13
  };
14
14
  export default meta;
15
- type Story = StoryObj<typeof meta>;
15
+ type Story = StoryObj<Meta<ShowAllPropsControlled>>;
16
16
  export declare const Text: Story;
17
17
  export declare const Checkboxes: Story;
18
+ export declare const Uncontrolled: StoryObj<Meta<ShowAllPropsUncontrolled>>;
19
+ export declare const ShortText: StoryObj<Meta<ShowAllPropsUncontrolled>>;
@@ -1 +1 @@
1
- export type TranslationId = "'{0}' in all products" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Cancel' | 'Create new list' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Double check your spelling' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Hide filters' | 'Incl. VAT' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Products' | 'Quick access' | 'Recent searches' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, we could not find matches for' | 'Sort by' | 'Submit' | 'Suggestions' | 'Use fewer keywords' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new' | 'What are you searching for?' | 'You could try exploring our products by category' | "Try 'Search' and try to find the product you're looking for" | 'Sorry, there are no products found' | 'Continue shopping' | "Unfortnately, We found no articles for your search '{0}'" | 'You could try checking the spelling of your search query' | 'Try another search' | 'Are you looking for information about our service? Please visit our customer support page';
1
+ export type TranslationId = "'{0}' in all products" | "Try 'Search' and try to find the product you're looking for" | "Unfortnately, We found no articles for your search '{0}'" | ' to your account to manage your lists.' | 'Add to list' | 'An unexpected error occured' | 'Are you looking for information about our service? Please visit our customer support page' | 'Cancel' | 'Chosen filters' | 'Clear filters' | 'Clear' | 'Continue shopping' | 'Create new list' | 'Double check your spelling' | 'Downloads' | 'Excl. VAT' | 'Explore by categories' | 'Exploring our products by category' | 'Features' | 'Hide filters' | 'Incl. VAT' | 'Includes' | 'List name already exists' | 'New list name' | 'Please Sign In' | 'Popular searches' | 'Product Features' | 'Products' | 'Quick access' | 'Recent searches' | 'Recently viewed' | 'Searching again using more general terms' | 'See all results' | 'Select a list' | 'Show all' | 'Show filters' | 'Show less' | 'Show' | 'Sorry, there are no products found' | 'Sorry, we could not find matches for' | 'Sort by' | 'Specifications' | 'Submit' | 'Suggestions' | 'Try another search' | 'Use fewer keywords' | 'What are you searching for?' | 'You could try checking the spelling of your search query' | 'You could try exploring our products by category' | 'You could try' | 'You must ' | 'article' | 'articles' | 'facet.categories' | 'facet.height' | 'facet.weight' | 'of' | 'sign in' | 'sort.newest' | 'sort.price_asc' | 'sort.price_desc' | 'sort.relevance' | 'tag.limited' | 'tag.new';
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { DownloadDocumentList } from './download-document-list';
3
+ declare const meta: {
4
+ args: {};
5
+ component: typeof DownloadDocumentList;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ title: string;
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
@@ -0,0 +1,11 @@
1
+ interface Document {
2
+ href: string;
3
+ id: string;
4
+ name: string;
5
+ }
6
+ interface DownloadDocumentListProps {
7
+ className?: string;
8
+ documents: Document[];
9
+ }
10
+ export declare function DownloadDocumentList({ className, documents, }: DownloadDocumentListProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ type FeatureKey = string | ReactNode;
3
+ type FeatureValue = string | boolean | ReactNode;
4
+ interface FeatureListKey {
5
+ label: FeatureKey;
6
+ }
7
+ interface FeatureListValue {
8
+ value: FeatureValue;
9
+ }
10
+ interface KeyValue {
11
+ id: string;
12
+ key?: FeatureListKey;
13
+ value: FeatureValue | FeatureValue[];
14
+ }
15
+ interface FeatureListProps {
16
+ className?: string;
17
+ features: KeyValue[];
18
+ style?: {
19
+ keyAlignment?: 'left' | 'right';
20
+ valueAlignment?: 'left' | 'right';
21
+ };
22
+ }
23
+ declare function FeatureKey({ label }: FeatureListKey): FeatureKey;
24
+ declare function FeatureValue({ value }: FeatureListValue): import("react/jsx-runtime").JSX.Element;
25
+ export declare function FeatureList({ className, features, style }: FeatureListProps): import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { FeatureList } from './feature-list';
3
+ declare const meta: {
4
+ args: {};
5
+ component: typeof FeatureList;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ title: string;
11
+ };
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ export declare const Default: Story;
15
+ export declare const Alignment: Story;
16
+ export declare const LongLabels: Story;
@@ -0,0 +1,4 @@
1
+ import { ProductDetails } from 'shared/api/bff/model/bff.model';
2
+ export declare function ProductDetailsPanel({ product }: {
3
+ product: ProductDetails;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -66,7 +66,7 @@ interface ProductSummary {
66
66
  tags?: string[];
67
67
  title: string;
68
68
  }
69
- interface ProductDetails {
69
+ export interface ProductDetails {
70
70
  attributeTypes: Array<{
71
71
  attributeValues: Array<{
72
72
  id: string;
@@ -127,8 +127,8 @@ export interface ProductDetailsPageDataResponse {
127
127
  }
128
128
  export interface ProductListingPageDataResponse {
129
129
  breadCrumb: Array<{
130
- text: string;
131
- url: string;
130
+ href: string;
131
+ label: string;
132
132
  }>;
133
133
  categories: Category | null;
134
134
  categoryPages: string;
@@ -0,0 +1,4 @@
1
+ export declare function useResizeObserver(resizeCallback: (size: DOMRectReadOnly) => void): {
2
+ ref: <T extends HTMLElement>(el: T | null) => void;
3
+ size: DOMRectReadOnly | undefined;
4
+ };
@@ -0,0 +1,12 @@
1
+ export default main;
2
+ export declare function main(clone: boolean, ...items: any[]): any;
3
+ export declare function main(...items: any[]): any;
4
+ export declare namespace main {
5
+ var clone: typeof import("./merge").clone;
6
+ var isPlainObject: typeof import("./merge").isPlainObject;
7
+ var deepMerge: typeof import("./merge").deepMerge;
8
+ }
9
+ export declare function merge<T = any>(...items: T[]): T;
10
+ export declare function deepMerge<T = any>(...items: T[]): T;
11
+ export declare function clone<T>(input: T): T;
12
+ export declare function isPlainObject(input: unknown): input is NonNullable<unknown>;