@sonic-equipment/ui 0.0.22 → 0.0.23

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 (37) hide show
  1. package/dist/algolia/algolia-provider.d.ts +6 -3
  2. package/dist/algolia/algolia-searchclient-offline.d.ts +3 -0
  3. package/dist/badges/tag/tag.stories.d.ts +0 -1
  4. package/dist/buttons/add-to-cart-button/add-to-cart-button.stories.d.ts +0 -1
  5. package/dist/buttons/button/button.stories.d.ts +0 -1
  6. package/dist/buttons/favorite/favorite-button.stories.d.ts +0 -1
  7. package/dist/buttons/icon-button/icon-button.stories.d.ts +0 -1
  8. package/dist/buttons/link-button/link-button.stories.d.ts +0 -1
  9. package/dist/cards/product-card/product-card.stories.d.ts +0 -1
  10. package/dist/collapsables/accordion/accordion-item.d.ts +1 -1
  11. package/dist/collapsables/accordion/accordion.stories.d.ts +0 -1
  12. package/dist/collapsables/show-all/show-all.stories.d.ts +0 -1
  13. package/dist/display/product-price/product-price.stories.d.ts +0 -1
  14. package/dist/display/product-sku/product-sku.stories.d.ts +0 -1
  15. package/dist/filters/pagination/pagination.stories.d.ts +0 -1
  16. package/dist/forms/checkbox/checkbox.stories.d.ts +0 -1
  17. package/dist/forms/color-checkbox/color-checkbox.stories.d.ts +0 -1
  18. package/dist/forms/field-error/field-error.stories.d.ts +0 -1
  19. package/dist/forms/input/input.stories.d.ts +0 -1
  20. package/dist/forms/label/label.stories.d.ts +0 -1
  21. package/dist/forms/number-field/number-field.stories.d.ts +0 -1
  22. package/dist/forms/select/select.stories.d.ts +0 -1
  23. package/dist/forms/text-field/text-field.stories.d.ts +0 -1
  24. package/dist/forms/textarea/textarea.stories.d.ts +0 -1
  25. package/dist/index.d.ts +27 -11
  26. package/dist/index.js +129 -1518
  27. package/dist/intl/formatted-message.d.ts +1 -0
  28. package/dist/intl/formatted-message.stories.d.ts +1 -1
  29. package/dist/intl/use-format-message.d.ts +4 -1
  30. package/dist/media/image/image.stories.d.ts +0 -1
  31. package/dist/product-listing/product-listing.stories.d.ts +0 -1
  32. package/dist/shared/hooks/use-breakpoint.d.ts +9 -4
  33. package/dist/shared/hooks/use-disclosure.d.ts +1 -1
  34. package/dist/styles.css +51 -20
  35. package/dist/typography/heading/heading.stories.d.ts +1 -2
  36. package/package.json +1 -1
  37. package/dist/algolia/algolia-searchclient-mock.d.ts +0 -4
@@ -1,13 +1,16 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
+ import { SearchClient } from 'algoliasearch/lite';
2
3
  interface AlgoliaContextType {
3
4
  online: boolean;
4
5
  setOnline: (online: boolean) => void;
5
6
  toggleOnline: VoidFunction;
6
7
  }
7
8
  interface AlgoliaProviderProps {
8
- children: React.ReactNode;
9
+ children: ReactNode;
10
+ offlineSearchClient?: SearchClient;
9
11
  online?: boolean;
12
+ searchClient: SearchClient;
10
13
  }
11
- export declare function AlgoliaProvider({ children, online: _online, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function AlgoliaProvider({ children, offlineSearchClient, online: _online, searchClient, }: AlgoliaProviderProps): import("react/jsx-runtime").JSX.Element;
12
15
  export declare function useAlgolia(): AlgoliaContextType;
13
16
  export {};
@@ -0,0 +1,3 @@
1
+ import { SearchClient } from 'algoliasearch/lite';
2
+ export declare const searchClientLogger: (searchClient: SearchClient) => SearchClient;
3
+ export declare const offlineSearchClient: SearchClient;
@@ -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
  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;
@@ -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;
@@ -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;
@@ -7,6 +7,6 @@ export interface AccordionItemProps {
7
7
  isDisabled?: boolean;
8
8
  isOpen?: boolean;
9
9
  size?: 'md' | 'lg';
10
- title: string;
10
+ title: ReactNode;
11
11
  }
12
12
  export declare function AccordionItem({ _pseudo, children, className, id, isDisabled, isOpen: isOpenProp, 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;
@@ -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;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,17 @@
1
1
  /// <reference types="react" />
2
2
  import { ReactElement, MutableRefObject, ReactNode, HTMLAttributeAnchorTarget, FormEventHandler, KeyboardEvent, ComponentType } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
-
5
- declare const useBreakpoint: () => {
6
- isDesktop: boolean;
7
- isMobile: boolean;
8
- isTablet: boolean;
4
+ import { SearchClient } from 'algoliasearch/lite';
5
+
6
+ declare const breakpoints: {
7
+ readonly sm: readonly [0, 575];
8
+ readonly md: readonly [576, 767];
9
+ readonly lg: readonly [768, 1023];
10
+ readonly xl: readonly [1024, 1439];
11
+ readonly xxl: readonly [1440];
9
12
  };
13
+ type UseBreakpointReturnType = Record<keyof typeof breakpoints, boolean>;
14
+ declare const useBreakpoint: () => UseBreakpointReturnType;
10
15
 
11
16
  declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
12
17
 
@@ -17,7 +22,7 @@ interface UseDisclosureReturnType {
17
22
  open: () => void;
18
23
  toggle: () => void;
19
24
  }
20
- declare const useDisclosure: () => UseDisclosureReturnType;
25
+ declare const useDisclosure: (initialState?: boolean) => UseDisclosureReturnType;
21
26
 
22
27
  declare const useScrollLock: (lock: boolean) => void;
23
28
 
@@ -237,7 +242,7 @@ interface AccordionItemProps {
237
242
  isDisabled?: boolean;
238
243
  isOpen?: boolean;
239
244
  size?: 'md' | 'lg';
240
- title: string;
245
+ title: ReactNode;
241
246
  }
242
247
 
243
248
  interface AccordionProps {
@@ -401,6 +406,7 @@ type TranslationId = 'Chosen filters' | 'Clear filters' | 'Excl. VAT' | 'Incl. V
401
406
 
402
407
  interface FormattedMessageProps {
403
408
  id: TranslationId;
409
+ optional?: boolean;
404
410
  replacementValues?: Record<string, string>;
405
411
  }
406
412
  declare const FormattedMessage: ComponentType<FormattedMessageProps>;
@@ -413,7 +419,10 @@ interface IntlProviderProps {
413
419
  }
414
420
  declare function IntlProvider({ children, formatMessage }: IntlProviderProps): react_jsx_runtime.JSX.Element;
415
421
 
416
- type FormattedMessageFunction = (key: TranslationId, replacementValues?: Record<string, string>) => string;
422
+ type FormattedMessageFunction = (id: TranslationId, options?: {
423
+ optional?: boolean;
424
+ replacementValues?: Record<string, string>;
425
+ }) => string;
417
426
  declare const useFormattedMessage: () => FormattedMessageFunction;
418
427
 
419
428
  interface ProductOverviewGridProps {
@@ -480,6 +489,11 @@ interface SidebarProps {
480
489
  }
481
490
  declare function Sidebar({ children }: SidebarProps): react_jsx_runtime.JSX.Element;
482
491
 
492
+ interface SidebarProviderProps {
493
+ children: ReactElement;
494
+ }
495
+ declare function SidebarProvider({ children }: SidebarProviderProps): react_jsx_runtime.JSX.Element;
496
+
483
497
  declare function AlgoliaCategories(): react_jsx_runtime.JSX.Element;
484
498
 
485
499
  interface AlgoliaFilterPanelProps {
@@ -502,14 +516,16 @@ interface AlgoliaContextType {
502
516
  toggleOnline: VoidFunction;
503
517
  }
504
518
  interface AlgoliaProviderProps {
505
- children: React.ReactNode;
519
+ children: ReactNode;
520
+ offlineSearchClient?: SearchClient;
506
521
  online?: boolean;
522
+ searchClient: SearchClient;
507
523
  }
508
- declare function AlgoliaProvider({ children, online: _online, }: AlgoliaProviderProps): react_jsx_runtime.JSX.Element;
524
+ declare function AlgoliaProvider({ children, offlineSearchClient, online: _online, searchClient, }: AlgoliaProviderProps): react_jsx_runtime.JSX.Element;
509
525
  declare function useAlgolia(): AlgoliaContextType;
510
526
 
511
527
  declare function AlgoliaResultsCount(): string | null;
512
528
 
513
529
  declare function AlgoliaSortBy(): react_jsx_runtime.JSX.Element | null;
514
530
 
515
- export { Accordion, AddToCartButton, AlgoliaCategories, AlgoliaFilterPanel, type AlgoliaFilterPanelProps, AlgoliaMultiSelect, AlgoliaPagination, AlgoliaProductList, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, Button, type ButtonProps, type Cart, CartFilledIcon, type CartLine, CartOutlinedIcon, CartProvider, Checkbox, type CheckboxProps$1 as CheckboxProps, ColorCheckbox, type ColorCheckboxProps, ConnectedAddToCartButton, DehashedOutlinedIcon, FavoriteButton, type FavoriteButtonProps, FavoriteFilledIcon, FavoriteOutlinedIcon, type FilterOption, type Filters, FormattedMessage, type FormattedMessageFunction, type FormattedMessageProps, GlobalStateProvider, GlobalStateProviderContext, HashedOutlinedIcon, IconButton, type IconButtonProps, Image, type ImageProps, IntlProvider, LinkButton, type LinkButtonProps, MultiSelect, type MultiSelectProps, NumberField, type NumberFieldSize, type Product, 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, useAlgolia, useBreakpoint, useCart, useDebouncedCallback, useDisclosure, useFormattedMessage, useGlobalState, useProductCartLine, useScrollLock };
531
+ export { Accordion, AddToCartButton, AlgoliaCategories, AlgoliaFilterPanel, type AlgoliaFilterPanelProps, AlgoliaMultiSelect, AlgoliaPagination, AlgoliaProductList, AlgoliaProvider, AlgoliaResultsCount, AlgoliaSortBy, Button, type ButtonProps, type Cart, CartFilledIcon, type CartLine, CartOutlinedIcon, CartProvider, Checkbox, type CheckboxProps$1 as CheckboxProps, ColorCheckbox, type ColorCheckboxProps, ConnectedAddToCartButton, DehashedOutlinedIcon, FavoriteButton, type FavoriteButtonProps, FavoriteFilledIcon, FavoriteOutlinedIcon, type FilterOption, type Filters, FormattedMessage, type FormattedMessageFunction, type FormattedMessageProps, GlobalStateProvider, GlobalStateProviderContext, HashedOutlinedIcon, IconButton, type IconButtonProps, Image, type ImageProps, IntlProvider, LinkButton, type LinkButtonProps, MultiSelect, type MultiSelectProps, NumberField, type NumberFieldSize, type Product, 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, SidebarProvider, TextField, createProductListingSearchParams, parseProductListingSearchParams, useAlgolia, useBreakpoint, useCart, useDebouncedCallback, useDisclosure, useFormattedMessage, useGlobalState, useProductCartLine, useScrollLock };