@sonic-equipment/ui 0.0.69 → 0.0.71

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 (24) hide show
  1. package/dist/index.d.ts +42 -41
  2. package/dist/index.js +301 -284
  3. package/dist/src/global-search/global-search-provider/{global-search-container.d.ts → global-search-provider.d.ts} +3 -1
  4. package/dist/src/global-search/global-search.d.ts +2 -8
  5. package/dist/src/index.d.ts +4 -5
  6. package/dist/src/intl/translation-id.d.ts +1 -1
  7. package/dist/src/pages/product-details-page/product-details-page.d.ts +4 -0
  8. package/dist/src/pages/product-details-page/product-details-page.stories.d.ts +20 -0
  9. package/dist/src/shared/api/shop/hooks/translation/use-fetch-translations.d.ts +1 -1
  10. package/dist/src/shared/api/shop/hooks/wishlist/use-create-wishlist.d.ts +5 -0
  11. package/dist/src/shared/api/shop/hooks/wishlist/use-fetch-all-wishlists-items.d.ts +2 -5
  12. package/dist/src/shared/api/shop/hooks/wishlist/wishlist.stories.d.ts +0 -1
  13. package/dist/src/shared/api/shop/model/shop.model.d.ts +5 -0
  14. package/dist/src/shared/api/shop/services/translation-service.d.ts +1 -1
  15. package/dist/src/shared/api/shop/services/wishlist-service.d.ts +12 -17
  16. package/dist/src/shared/feature-flags/use-feature-flags.d.ts +1 -0
  17. package/dist/src/shared/hooks/use-debounced-callback.d.ts +1 -1
  18. package/dist/styles.css +36 -38
  19. package/package.json +1 -1
  20. package/dist/src/global-search/search-root/search-root.d.ts +0 -1
  21. package/dist/src/shared/api/shop/hooks/wishlist/use-add-wishlist.d.ts +0 -5
  22. package/dist/src/shared/api/shop/hooks/wishlist/use-create-current-wishlist.d.ts +0 -1
  23. package/dist/src/shared/api/shop/hooks/wishlist/use-remove-wishlist-item-from-wishlist.d.ts +0 -4
  24. /package/dist/src/shared/api/shop/hooks/wishlist/{use-delete-wishlist-item.d.ts → use-delete-wishlist-item-from-wishlist.d.ts} +0 -0
@@ -1,9 +1,11 @@
1
+ import { SearchClient } from 'algoliasearch';
1
2
  export declare const GlobalSearchDisclosureContext: React.Context<{
2
3
  close: VoidFunction;
3
4
  isOpen: boolean;
4
5
  open: VoidFunction;
5
6
  toggle: VoidFunction;
6
7
  } | null>;
7
- export declare function GlobalSearchContainer({ children, }: {
8
+ export declare function GlobalSearchProvider({ children, searchClient, }: {
8
9
  children: React.ReactNode;
10
+ searchClient: SearchClient;
9
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,4 @@
1
- import { ReactNode } from 'react';
2
- import { SearchClient } from 'algoliasearch';
3
- interface GlobalSearchProps {
4
- children: ReactNode;
5
- searchClient?: SearchClient;
6
- }
1
+ export declare function SearchRoot(): import("react/jsx-runtime").JSX.Element;
7
2
  /**
8
3
  * Global search using algolia autocomplete with a custom renderer
9
4
  * https://www.algolia.com/doc/ui-libraries/autocomplete/guides/creating-a-renderer/
@@ -12,5 +7,4 @@ interface GlobalSearchProps {
12
7
  * uses the autocomplete widgets
13
8
  * https://codesandbox.io/p/sandbox/github/algolia/autocomplete/tree/next/examples/two-column-layout
14
9
  */
15
- export declare function GlobalSearch({ children, searchClient }: GlobalSearchProps): import("react/jsx-runtime").JSX.Element;
16
- export {};
10
+ export declare function GlobalSearch(): import("react/jsx-runtime").JSX.Element;
@@ -21,12 +21,10 @@ export * from './shared/api/shop/hooks/cart/use-update-cart-line-by-id';
21
21
  export * from './shared/api/shop/hooks/translation/use-fetch-translations';
22
22
  export * from './shared/api/shop/hooks/wishlist/use-add-wishlist-item-to-current-wishlist';
23
23
  export * from './shared/api/shop/hooks/wishlist/use-add-wishlist-item-to-wishlist';
24
- export * from './shared/api/shop/hooks/wishlist/use-add-wishlist';
25
- export * from './shared/api/shop/hooks/wishlist/use-create-current-wishlist';
26
- export * from './shared/api/shop/hooks/wishlist/use-delete-wishlist-item';
24
+ export * from './shared/api/shop/hooks/wishlist/use-create-wishlist';
25
+ export * from './shared/api/shop/hooks/wishlist/use-delete-wishlist-item-from-wishlist';
27
26
  export * from './shared/api/shop/hooks/wishlist/use-fetch-all-wishlists-items';
28
27
  export * from './shared/api/shop/hooks/wishlist/use-fetch-wishlists';
29
- export * from './shared/api/shop/hooks/wishlist/use-remove-wishlist-item-from-wishlist';
30
28
  export * from './shared/hooks/use-breakpoint';
31
29
  export * from './shared/hooks/use-is-breakpoint';
32
30
  export * from './shared/hooks/use-debounced-callback';
@@ -68,6 +66,7 @@ export * from './loading/progress-circle';
68
66
  export * from './media/image/image';
69
67
  export * from './pages/page-container/page-container';
70
68
  export * from './pages/page/page';
69
+ export * from './pages/product-details-page/product-details-page';
71
70
  export * from './pages/product-listing-page/product-listing-page';
72
71
  export * from './pages/search-result-page/search-results-page';
73
72
  export * from './sidebar/sidebar';
@@ -86,7 +85,7 @@ export * from './algolia/algolia-results-count';
86
85
  export * from './algolia/algolia-sort-by';
87
86
  export * from './algolia/use-algolia-insights';
88
87
  export * from './global-search/global-search';
89
- export * from './global-search/global-search-provider/global-search-container';
88
+ export * from './global-search/global-search-provider/global-search-provider';
90
89
  export * from './algolia/use-algolia-search';
91
90
  export * from './global-search/global-search-provider/use-search-disclosure';
92
91
  export * from './shared/providers/react-query-container';
@@ -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' | 'Search tools, toolsets, boxes and more' | '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" | ' 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';
@@ -0,0 +1,4 @@
1
+ export interface ProductDetailsPageProps {
2
+ pageUrl: string;
3
+ }
4
+ export declare function ProductDetailsPage({ pageUrl }: ProductDetailsPageProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ComponentProps } from 'react';
2
+ import { StoryObj } from '@storybook/react';
3
+ import { ProductDetailsPage } from './product-details-page';
4
+ type StoryProps = Omit<ComponentProps<typeof ProductDetailsPage>, 'searchClient'> & {
5
+ languageCode: string;
6
+ pageUrl: string;
7
+ };
8
+ declare const meta: {
9
+ args: {
10
+ languageCode: string;
11
+ pageUrl: string;
12
+ };
13
+ parameters: {
14
+ layout: string;
15
+ };
16
+ title: string;
17
+ };
18
+ export default meta;
19
+ type Story = StoryObj<StoryProps>;
20
+ export declare const Default: Story;
@@ -1 +1 @@
1
- export declare function useFetchTranslations(): import("@tanstack/react-query").UseQueryResult<import("../../../../../intl/types").Translations, Error>;
1
+ export declare function useFetchTranslations(languagCode?: string): import("@tanstack/react-query").UseQueryResult<import("../../../../../intl/types").Translations, Error>;
@@ -0,0 +1,5 @@
1
+ interface CreateWishListParams {
2
+ name: string;
3
+ }
4
+ export declare function useCreateWishList(): import("@tanstack/react-query").UseMutationResult<string, Error, CreateWishListParams, unknown>;
5
+ export {};
@@ -1,9 +1,6 @@
1
- import { WishListLineModel, WishListModel } from 'shared/api/shop/model/shop.model';
1
+ import { WishListLines } from 'shared/api/shop/model/shop.model';
2
2
  interface UseFetchAllWishListsItemsArgs {
3
3
  enabled?: boolean;
4
4
  }
5
- export declare function useFetchAllWishListsItems({ enabled }?: UseFetchAllWishListsItemsArgs): import("@tanstack/react-query").UseQueryResult<{
6
- wishList: WishListModel;
7
- wishListItem: WishListLineModel;
8
- }[], Error>;
5
+ export declare function useFetchAllWishListsItems({ enabled }?: UseFetchAllWishListsItemsArgs): import("@tanstack/react-query").UseQueryResult<WishListLines, Error>;
9
6
  export {};
@@ -8,4 +8,3 @@ declare const meta: {
8
8
  export default meta;
9
9
  export declare const UseFetchWishListsStory: StoryObj;
10
10
  export declare const UseFetchAllWishListsItemsStory: StoryObj;
11
- export declare const UseCreateCurrentWishListStory: StoryObj;
@@ -2940,3 +2940,8 @@ export interface VmiUserImportModel extends BaseModel {
2940
2940
  export interface VmiUserImportCollectionModel extends BaseModel {
2941
2941
  vmiUsers: VmiUserImportModel[] | null;
2942
2942
  }
2943
+ export interface WishListLine {
2944
+ wishList: WishListModel;
2945
+ wishListItem: WishListLineModel;
2946
+ }
2947
+ export type WishListLines = Array<WishListLine>;
@@ -1,2 +1,2 @@
1
1
  import { Translations } from 'intl/types';
2
- export declare function fetchTranslations(): Promise<Translations>;
2
+ export declare function fetchTranslations(languageCode?: string): Promise<Translations>;
@@ -1,30 +1,25 @@
1
- import { WishListCollectionModel, WishListLineCollectionModel, WishListModel } from 'shared/api/shop/model/shop.model';
2
- export declare function createWishList(): Promise<WishListModel>;
3
- export declare function addWishListItemToWishList({ productId, wishListId, }: {
4
- productId: string;
5
- wishListId: string;
6
- }): Promise<void>;
7
- export declare function removeWishListItemFromWishList({ wishListId, wishListItemId, }: {
1
+ import { WishListCollectionModel, WishListLineCollectionModel, WishListLineModel, WishListModel } from 'shared/api/shop/model/shop.model';
2
+ export declare function getWishList({ wishListId, }: {
8
3
  wishListId: string;
9
- wishListItemId: string;
10
- }): Promise<void>;
4
+ }): Promise<WishListModel>;
5
+ export declare function getWishLists(): Promise<WishListCollectionModel>;
11
6
  export declare class WishListNameAlreadyExistsError extends Error {
12
7
  constructor();
13
8
  }
14
- export declare function addWishList({ name, }: {
9
+ export declare function createWishList(args?: {
15
10
  name: string;
16
11
  }): Promise<WishListModel>;
17
- export declare function deleteWishListItemFromWishList({ wishListId, wishListItemId, }: {
18
- wishListId: string;
19
- wishListItemId: string;
20
- }): Promise<void>;
21
12
  export declare function deleteWishList({ wishListId, }: {
22
13
  wishListId: string;
23
14
  }): Promise<void>;
24
- export declare function getWishLists(): Promise<WishListCollectionModel>;
25
- export declare function getWishList({ wishListId, }: {
15
+ export declare function addWishListItemToWishList({ productId, wishListId, }: {
16
+ productId: string;
26
17
  wishListId: string;
27
- }): Promise<WishListModel>;
18
+ }): Promise<WishListLineModel>;
19
+ export declare function deleteWishListItemFromWishList({ wishListId, wishListItemId, }: {
20
+ wishListId: string;
21
+ wishListItemId: string;
22
+ }): Promise<void>;
28
23
  export declare function getWishListItemsByWishListId({ wishListId, }: {
29
24
  wishListId: string;
30
25
  }): Promise<WishListLineCollectionModel>;
@@ -1,4 +1,5 @@
1
1
  interface UseFeatureFlagsReturnType {
2
+ pdpV2: boolean;
2
3
  plpV2: boolean;
3
4
  searchV2: boolean;
4
5
  }
@@ -1 +1 @@
1
- export declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
1
+ export declare function useDebouncedCallback<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => Promise<ReturnType<T>>;
package/dist/styles.css CHANGED
@@ -2490,7 +2490,6 @@
2490
2490
  z-index: calc(var(--sidebar-layer) + 1);
2491
2491
  top: 0;
2492
2492
  left: 0;
2493
- overflow: hidden;
2494
2493
  width: 382px;
2495
2494
  max-width: 100vw;
2496
2495
  height: 100%;
@@ -2874,15 +2873,47 @@
2874
2873
 
2875
2874
  .global-search-module-d2g2F {
2876
2875
  position: relative;
2877
- z-index: var(--search-layer);
2876
+ z-index: -1;
2878
2877
  font-family: var(--font-family-sonic);
2879
2878
  }
2880
2879
 
2881
- .global-search-module-d2g2F .global-search-module-Sx8Lx {
2882
- position: relative;
2883
- z-index: -1;
2880
+ .global-search-module-Sx8Lx {
2881
+ position: relative;
2882
+ }
2883
+
2884
+ .global-search-module-Sx8Lx .global-search-module--orCF {
2885
+ position: absolute;
2886
+ z-index: var(--search-layer);
2887
+ top: 0;
2888
+ right: 0;
2889
+ left: 0;
2890
+ box-sizing: border-box;
2891
+ transition: transform 0.3s ease-in-out;
2884
2892
  }
2885
2893
 
2894
+ .global-search-module-Sx8Lx .global-search-module--orCF .global-search-module-vXnL6 {
2895
+ position: relative;
2896
+ z-index: calc(var(--search-layer) + 1);
2897
+ }
2898
+
2899
+ .global-search-module-Sx8Lx .global-search-module--orCF.global-search-module-MYwlp {
2900
+ transform: translateY(0);
2901
+ }
2902
+
2903
+ .global-search-module-Sx8Lx .global-search-module--orCF.global-search-module-Jmt3c {
2904
+ transform: translateY(0);
2905
+ }
2906
+
2907
+ .global-search-module-Sx8Lx .global-search-module--orCF.global-search-module-gQQfY {
2908
+ transform: translateY(-100%);
2909
+ }
2910
+
2911
+ .global-search-module-Sx8Lx .global-search-module--orCF.global-search-module-AABcw {
2912
+ opacity: 0;
2913
+ pointer-events: none;
2914
+ transform: translateY(-100%);
2915
+ }
2916
+
2886
2917
  .search-input-module-xCCzd {
2887
2918
  box-sizing: border-box;
2888
2919
  }
@@ -3295,36 +3326,3 @@
3295
3326
  pointer-events: none;
3296
3327
  transform: translateY(-100%);
3297
3328
  }
3298
-
3299
- .search-root-module-g9MP0 {
3300
- position: absolute;
3301
- z-index: var(--search-layer);
3302
- top: 0;
3303
- right: 0;
3304
- left: 0;
3305
- box-sizing: border-box;
3306
- transition: transform 0.3s ease-in-out;
3307
- }
3308
-
3309
- .search-root-module-g9MP0 .search-root-module-X7N83 {
3310
- position: relative;
3311
- z-index: calc(var(--search-layer) + 1);
3312
- }
3313
-
3314
- .search-root-module-g9MP0.search-root-module-dQDFs {
3315
- transform: translateY(0);
3316
- }
3317
-
3318
- .search-root-module-g9MP0.search-root-module-fXUUb {
3319
- transform: translateY(0);
3320
- }
3321
-
3322
- .search-root-module-g9MP0.search-root-module-ZFQys {
3323
- transform: translateY(-100%);
3324
- }
3325
-
3326
- .search-root-module-g9MP0.search-root-module-gd9xY {
3327
- opacity: 0;
3328
- pointer-events: none;
3329
- transform: translateY(-100%);
3330
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonic-equipment/ui",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -1 +0,0 @@
1
- export declare function SearchRoot(): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +0,0 @@
1
- interface AddWishListParams {
2
- name: string;
3
- }
4
- export declare function useAddWishList(): import("@tanstack/react-query").UseMutationResult<string, Error, AddWishListParams, unknown>;
5
- export {};
@@ -1 +0,0 @@
1
- export declare function useCreateCurrentWishList(): import("@tanstack/react-query").UseMutationResult<string, Error, void, unknown>;
@@ -1,4 +0,0 @@
1
- export declare function useRemoveWishListItemFromCurrentWishList(): import("@tanstack/react-query").UseMutationResult<void, Error, {
2
- wishListId: string;
3
- wishListItemId: string;
4
- }, unknown>;