hasting-swatchcart-module 1.0.38 → 1.0.40

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 (125) hide show
  1. package/dist/assets/index-CIv0ji-N.js +164 -0
  2. package/dist/assets/index-shLdPuto.css +1 -0
  3. package/dist/index.html +14 -0
  4. package/package.json +102 -102
  5. package/dist/assets/index.css +0 -3117
  6. package/dist/cdn/lib/components/SwatchesModule.d.ts +0 -11
  7. package/dist/cdn/lib/main.d.ts +0 -9
  8. package/dist/cdn/lib/store/LibraryProvider.d.ts +0 -4
  9. package/dist/cdn/lib/store/rootReducer.d.ts +0 -11
  10. package/dist/cdn/lib/store/store.d.ts +0 -25
  11. package/dist/cdn/lib/store/withStore.d.ts +0 -2
  12. package/dist/cdn/lib/vite-env.d.ts +0 -1
  13. package/dist/cdn/main.css +0 -3117
  14. package/dist/cdn/main.js +0 -31572
  15. package/dist/cdn/src/app/App.d.ts +0 -12
  16. package/dist/cdn/src/app/assets/svg/ArrowIconSVG.d.ts +0 -3
  17. package/dist/cdn/src/app/assets/svg/CheckMarkIconSVG.d.ts +0 -3
  18. package/dist/cdn/src/app/assets/svg/ChevronSVGIcon.d.ts +0 -3
  19. package/dist/cdn/src/app/assets/svg/CloseIconSVG.d.ts +0 -3
  20. package/dist/cdn/src/app/assets/svg/DarkWhiteIconSVG.d.ts +0 -1
  21. package/dist/cdn/src/app/assets/svg/MinusIconSVG.d.ts +0 -3
  22. package/dist/cdn/src/app/assets/svg/PlusIconSVG.d.ts +0 -3
  23. package/dist/cdn/src/app/assets/svg/SearchIconSVG.d.ts +0 -3
  24. package/dist/cdn/src/app/assets/svg/TrashIconSVG.d.ts +0 -3
  25. package/dist/cdn/src/app/assets/svg/WhiteWhiteIconSVG.d.ts +0 -1
  26. package/dist/cdn/src/app/main.d.ts +0 -0
  27. package/dist/cdn/src/app/providers/StoreProvider.d.ts +0 -6
  28. package/dist/cdn/src/app/store/rootReducer.d.ts +0 -11
  29. package/dist/cdn/src/app/store/storageMiddleware.d.ts +0 -7
  30. package/dist/cdn/src/app/store/store.d.ts +0 -24
  31. package/dist/cdn/src/features/Cart/lib/CartCervices.d.ts +0 -5
  32. package/dist/cdn/src/features/Cart/model/cartSlice.d.ts +0 -3
  33. package/dist/cdn/src/features/Cart/model/selectors.d.ts +0 -223
  34. package/dist/cdn/src/features/Cart/model/types.d.ts +0 -7
  35. package/dist/cdn/src/features/Cart/ui/CartHeader/CartHeader.d.ts +0 -31
  36. package/dist/cdn/src/features/Cart/ui/CartList/CartList.d.ts +0 -1
  37. package/dist/cdn/src/features/Cart/ui/CartListItem/CartListItem.d.ts +0 -10
  38. package/dist/cdn/src/features/Cart/ui/CartWrapper/CartWrapper.d.ts +0 -9
  39. package/dist/cdn/src/features/Cart/ui/Counter/Counter.d.ts +0 -9
  40. package/dist/cdn/src/features/DataAdapter/lib/DataAdapterServices.d.ts +0 -19
  41. package/dist/cdn/src/features/DataAdapter/utils/types.d.ts +0 -11
  42. package/dist/cdn/src/features/MultiProduct/lib/MultiProductCartServices.d.ts +0 -13
  43. package/dist/cdn/src/features/MultiProduct/model/API/api.d.ts +0 -7
  44. package/dist/cdn/src/features/MultiProduct/model/API/routes.d.ts +0 -7
  45. package/dist/cdn/src/features/MultiProduct/model/multiProductCartSlice.d.ts +0 -9
  46. package/dist/cdn/src/features/MultiProduct/model/selectors.d.ts +0 -38
  47. package/dist/cdn/src/features/MultiProduct/model/thunk.d.ts +0 -11
  48. package/dist/cdn/src/features/MultiProduct/model/types.d.ts +0 -71
  49. package/dist/cdn/src/features/MultiProduct/ui/CartSelectedProductList/CartSelectedProductList.d.ts +0 -1
  50. package/dist/cdn/src/features/MultiProduct/ui/FiltersSelectedProductItem/FiltersSelectedProductItem.d.ts +0 -1
  51. package/dist/cdn/src/features/MultiProduct/ui/MaterialMultiProductList/MaterialMultiProductList.d.ts +0 -42
  52. package/dist/cdn/src/features/MultiProduct/ui/MultiProductCartHeader/MultiProductCartHeader.d.ts +0 -5
  53. package/dist/cdn/src/features/MultiProduct/ui/MultiProductItemCart/MultiProductItemCart.d.ts +0 -25
  54. package/dist/cdn/src/features/MultiProduct/ui/MultiProductWrapper/MultiProductWrapper.d.ts +0 -6
  55. package/dist/cdn/src/features/MultiProduct/ui/ProductList/ProductList.d.ts +0 -14
  56. package/dist/cdn/src/features/MultiProduct/ui/ProductListItem/ProductListItem.d.ts +0 -6
  57. package/dist/cdn/src/features/MultiProduct/ui/SelectedProductItem/SelectedProductItem.d.ts +0 -1
  58. package/dist/cdn/src/features/MultiProduct/ui/SwatchContentContainer/SwatchContentContainer.d.ts +0 -15
  59. package/dist/cdn/src/features/MultiProduct/ui/SwatchListItem/SwatchListItem.d.ts +0 -41
  60. package/dist/cdn/src/features/MultiProduct/ui/SwatchesMultiProductList/SwatchesMultiProductList.d.ts +0 -29
  61. package/dist/cdn/src/features/MultiProduct/utils/constants.d.ts +0 -6
  62. package/dist/cdn/src/features/MultiProduct/utils/randomList.d.ts +0 -2
  63. package/dist/cdn/src/features/SwatchModule/SwatchModule/ui/SwatchModule.d.ts +0 -2
  64. package/dist/cdn/src/features/swatches/lib/AttributeHelper.d.ts +0 -7
  65. package/dist/cdn/src/features/swatches/lib/SwatchesServices.d.ts +0 -11
  66. package/dist/cdn/src/features/swatches/model/selectors.d.ts +0 -10
  67. package/dist/cdn/src/features/swatches/model/swatchesSlice.d.ts +0 -53
  68. package/dist/cdn/src/features/swatches/model/thunks.d.ts +0 -22
  69. package/dist/cdn/src/features/swatches/model/types.d.ts +0 -148
  70. package/dist/cdn/src/features/swatches/ui/Filters/ColorsFilter.d.ts +0 -1
  71. package/dist/cdn/src/features/swatches/ui/Filters/LooksFilter.d.ts +0 -1
  72. package/dist/cdn/src/features/swatches/ui/Filters/MaterialsFilter.d.ts +0 -1
  73. package/dist/cdn/src/features/swatches/ui/Filters/index.d.ts +0 -1
  74. package/dist/cdn/src/features/swatches/ui/HexGridZoom/HexGridZoom.d.ts +0 -3
  75. package/dist/cdn/src/features/swatches/ui/ImageGridZoom/ImageGridZoom.d.ts +0 -3
  76. package/dist/cdn/src/features/swatches/ui/MaterialSingleProductList/MaterialSingleProductList.d.ts +0 -7
  77. package/dist/cdn/src/features/swatches/ui/ProductElement/index.d.ts +0 -28
  78. package/dist/cdn/src/features/swatches/ui/SwatchWrapper/SwatchWrapper.d.ts +0 -8
  79. package/dist/cdn/src/features/swatches/ui/Swatches.d.ts +0 -2
  80. package/dist/cdn/src/features/swatches/ui/SwatchesList/SwatchesList.d.ts +0 -28
  81. package/dist/cdn/src/features/swatches/ui/SwatchesListWrapper/SwatchesListWrapper.d.ts +0 -1
  82. package/dist/cdn/src/features/swatches/utils/constants.d.ts +0 -3
  83. package/dist/cdn/src/features/swatches/utils/hooks/useCartCount.d.ts +0 -18
  84. package/dist/cdn/src/features/swatches/utils/types.d.ts +0 -22
  85. package/dist/cdn/src/shared/constants/constants.d.ts +0 -1
  86. package/dist/cdn/src/shared/constants/props.d.ts +0 -1058
  87. package/dist/cdn/src/shared/constants/select.d.ts +0 -4
  88. package/dist/cdn/src/shared/constants/selectedMaterials.d.ts +0 -1
  89. package/dist/cdn/src/shared/types/activeTab.d.ts +0 -5
  90. package/dist/cdn/src/shared/types/fetchData.d.ts +0 -41
  91. package/dist/cdn/src/shared/types/svg.d.ts +0 -3
  92. package/dist/cdn/src/shared/ui/CartPrice/CartPrice.d.ts +0 -7
  93. package/dist/cdn/src/shared/ui/Checkbox/Checkbox.d.ts +0 -4
  94. package/dist/cdn/src/shared/ui/CustomButton/CustomButton.d.ts +0 -6
  95. package/dist/cdn/src/shared/ui/CustomModal/CustomModal.d.ts +0 -11
  96. package/dist/cdn/src/shared/ui/CustomSidebar/CustomSidebar.d.ts +0 -8
  97. package/dist/cdn/src/shared/ui/Dialog/Dialog.d.ts +0 -19
  98. package/dist/cdn/src/shared/ui/Hint/Hint.d.ts +0 -60
  99. package/dist/cdn/src/shared/ui/Label/Label.d.ts +0 -7
  100. package/dist/cdn/src/shared/ui/Loader/Loader.d.ts +0 -10
  101. package/dist/cdn/src/shared/ui/Markdown/MDWithAccordion.d.ts +0 -10
  102. package/dist/cdn/src/shared/ui/MaterialItem/MaterialItem.d.ts +0 -8
  103. package/dist/cdn/src/shared/ui/MaterialListItem/MaterialListItem.d.ts +0 -8
  104. package/dist/cdn/src/shared/ui/MultiSelect/MultiSelect.d.ts +0 -20
  105. package/dist/cdn/src/shared/ui/PopoverTooltip/InfoIcon.d.ts +0 -1
  106. package/dist/cdn/src/shared/ui/PopoverTooltip/PopoverTooltip.d.ts +0 -11
  107. package/dist/cdn/src/shared/ui/SingleSelect/SingleSelect.d.ts +0 -18
  108. package/dist/cdn/src/shared/ui/Slider/Slider.d.ts +0 -11
  109. package/dist/cdn/src/shared/ui/SwatchLimitModal/SwatchLimitModal.d.ts +0 -6
  110. package/dist/cdn/src/shared/ui/popover.d.ts +0 -9
  111. package/dist/cdn/src/shared/utils/cn.d.ts +0 -2
  112. package/dist/cdn/src/shared/utils/storageService.d.ts +0 -38
  113. package/dist/cdn/src/shared/utils/toast.d.ts +0 -3
  114. package/dist/cdn/src/shared/utils/uniqueList.d.ts +0 -1
  115. package/dist/components/SwatchesModule.d.ts +0 -11
  116. package/dist/main.cjs +0 -158
  117. package/dist/main.cjs.map +0 -1
  118. package/dist/main.d.ts +0 -9
  119. package/dist/main.js +0 -24547
  120. package/dist/main.js.map +0 -1
  121. package/dist/store/LibraryProvider.d.ts +0 -4
  122. package/dist/store/rootReducer.d.ts +0 -11
  123. package/dist/store/store.d.ts +0 -25
  124. package/dist/store/withStore.d.ts +0 -2
  125. /package/dist/{cdn/vite.svg → vite.svg} +0 -0
@@ -1,42 +0,0 @@
1
- interface IMaterialListProps {
2
- /** Tailwind / className for the scroll container */
3
- containerStyles?: string;
4
- /** Tailwind / className for the grid wrapper */
5
- gridStyles?: string;
6
- /** Number of columns on ≥ sm screens */
7
- desktopColumnsCount?: number;
8
- }
9
- /**
10
- * Renders a virtualized grid of materials for the multi-product cart.
11
- *
12
- * Features:
13
- * - Uses filters from the store (Finish, Color, Look) to derive `filteredItems`.
14
- * - Uses TanStack Virtual to render only visible rows for performance.
15
- * - Supports responsive column count (1 on mobile, `desktopColumnsCount` on sm+).
16
- * - Enforces a global swatch limit (5 items across all products) and shows
17
- * `SwatchLimitModal` when the limit is exceeded.
18
- *
19
- * Selection logic:
20
- * - Clicking a material toggles it for the active product:
21
- * - If it already exists, it’s removed from the combined `allItems` list.
22
- * - If it does not exist and the limit is not reached, it’s added with `count: 1`.
23
- * - Keeps `setMultiCartItems` and `setActiveMultiCartProduct` in sync.
24
- *
25
- * Virtualization:
26
- * - Computes rows from `filteredItems` based on column count.
27
- * - Uses padding (`padTop` / `padBottom`) to emulate full scroll height.
28
- * - Measures the last item in each row for accurate row height.
29
- *
30
- * @component
31
- *
32
- * @param {string} [containerStyles]
33
- * Optional classes for the scroll container.
34
- *
35
- * @param {string} [gridStyles]
36
- * Optional classes for the grid container.
37
- *
38
- * @param {number} [desktopColumnsCount=3]
39
- * Number of columns on desktop / sm+ breakpoints.
40
- */
41
- export declare const MaterialMultiProductList: ({ containerStyles, gridStyles, desktopColumnsCount, }: IMaterialListProps) => import("react/jsx-runtime").JSX.Element;
42
- export {};
@@ -1,5 +0,0 @@
1
- interface IMultiProductCartHeaderProps {
2
- totalCount: number;
3
- }
4
- export declare const MultiProductCartHeader: ({ totalCount, }: IMultiProductCartHeaderProps) => import("react/jsx-runtime").JSX.Element;
5
- export {};
@@ -1,25 +0,0 @@
1
- /**
2
- * Props for {@link MultiProductItemCart}.
3
- */
4
- interface IMultiProductItemCartProps {
5
- /**
6
- * Optional callback fired when user proceeds to shipping.
7
- * Receives the current selected products payload.
8
- */
9
- onSendData?: (data: unknown) => void;
10
- }
11
- /**
12
- * Renders a multi-product cart with grouped items, quantity controls, and totals.
13
- *
14
- * Features:
15
- * - grouped rendering by product
16
- * - increment/decrement/delete actions for cart items
17
- * - synchronizes deletion with the swatches selected materials state
18
- * - shows totals and a "Go to shipping" action
19
- *
20
- * @component
21
- *
22
- * @param props - {@link IMultiProductItemCartProps}
23
- */
24
- export declare const MultiProductItemCart: ({ onSendData, }: IMultiProductItemCartProps) => import("react/jsx-runtime").JSX.Element;
25
- export {};
@@ -1,6 +0,0 @@
1
- interface IMultiProductWrapperProps {
2
- onSendData: (data: unknown) => void;
3
- onToggleSidebar?: () => void;
4
- }
5
- export declare const MultiProductWrapper: ({ onSendData, }: IMultiProductWrapperProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,14 +0,0 @@
1
- /**
2
- * Renders the product list with category filtering, search, and sorting.
3
- *
4
- * Features:
5
- * - fetches the product list on mount
6
- * - builds unique categories for the slider
7
- * - supports debounced text search
8
- * - supports A–Z and Z–A sorting
9
- * - hides the header image while the user scrolls down
10
- * - shows swatch cart content when products are selected
11
- *
12
- * @component
13
- */
14
- export declare const ProductList: () => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { IProductListItem } from '../../model/types';
2
- interface IProductListItemProps {
3
- productListItem: IProductListItem;
4
- }
5
- export declare const ProductListItem: ({ productListItem }: IProductListItemProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1 +0,0 @@
1
- export declare const SelectedProductItem: () => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- /**
2
- * Container component responsible for:
3
- * - Displaying a combined list of swatches from all selected products
4
- * - Showing a preview section and an action button
5
- * - Handling the opening of the Multi-Product Cart modal
6
- *
7
- * It collects materials from all products, normalizes them with additional
8
- * context (product name), and renders them in a structured two-column layout.
9
- *
10
- * Also includes the "Add Swatches to Cart" button which opens the cart modal
11
- * only when there are selected items.
12
- *
13
- * @component
14
- */
15
- export declare const SwatchContentContainer: () => import("react/jsx-runtime").JSX.Element;
@@ -1,41 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ISwatchSelectedMaterial } from '../../model/types';
3
- interface ISwatchesListItemProps {
4
- val: ISwatchSelectedMaterial;
5
- onDelete: (arg: ISwatchSelectedMaterial) => void;
6
- }
7
- /**
8
- * Renders a selected swatch item inside the list of chosen materials.
9
- *
10
- * The component shows the material preview (image or HEX grid), displays a
11
- * delete button, and on hover opens a `Hint` tooltip with detailed material
12
- * information (material name, parent category, product name).
13
- *
14
- * Hover logic:
15
- * - When the user hovers over the swatch, it captures the hovered element,
16
- * prepares the tooltip text, and opens the `Hint` component.
17
- * - The tooltip closes when the mouse leaves the item.
18
- *
19
- * Delete logic:
20
- * - Clicking the close icon triggers `onDelete` with the full swatch object.
21
- * - The click event is stopped from bubbling so that it does not interfere
22
- * with parent click handlers.
23
- *
24
- * Accessibility:
25
- * - The swatch container is focusable (`tabIndex={0}`) for keyboard navigation.
26
- * - Enter/Space keys are prevented to avoid unintended actions.
27
- * - ARIA label describes the content for screen readers.
28
- *
29
- * @component
30
- *
31
- * @param {ISwatchSelectedMaterial} val
32
- * The selected material object containing metadata, image/hex info,
33
- * and product/category names.
34
- *
35
- * @param {(arg: ISwatchSelectedMaterial) => void} onDelete
36
- * Callback triggered when the user removes the swatch from the list.
37
- *
38
- * @returns {JSX.Element}
39
- */
40
- declare const SwatchListItem: React.FC<ISwatchesListItemProps>;
41
- export default SwatchListItem;
@@ -1,29 +0,0 @@
1
- import { ISwatchSelectedMaterial } from '../../model/types';
2
- interface ISwatchesListProps {
3
- /**
4
- * Optional wrapper classes for the outer container
5
- * (padding, border, etc. – Tailwind / className string).
6
- */
7
- containerStyles?: string;
8
- /**
9
- * List of currently selected swatch materials across products.
10
- * Used to render the visual list and compute remaining free slots.
11
- */
12
- selectedMaterials: ISwatchSelectedMaterial[];
13
- }
14
- /**
15
- * Renders the "Swatches list" section for the multi-product cart.
16
- *
17
- * Features:
18
- * - Displays all selected swatches as tiles using `SwatchListItem`.
19
- * - Allows removing a swatch across all products via `onDelete`.
20
- * - Shows the current count and the `MAX_SLOTS` limit (with "Free" label).
21
- * - Fills remaining slots with placeholder tiles (`MockTile`) for a
22
- * consistent grid layout.
23
- *
24
- * Removal logic:
25
- * - When the user deletes a swatch, finds which product currently owns it,
26
- * removes that swatch from that product, and updates the multi-cart store.
27
- */
28
- export declare const SwatchesMultiProductList: ({ selectedMaterials, containerStyles, }: ISwatchesListProps) => import("react/jsx-runtime").JSX.Element;
29
- export {};
@@ -1,6 +0,0 @@
1
- export declare const MOCK_ALL_CATEGORY_SLIDER_ITEM: {
2
- name: string;
3
- value: string;
4
- productId: number;
5
- items: never[];
6
- };
@@ -1,2 +0,0 @@
1
- import { IProduct } from '../../swatches/model/types';
2
- export declare const generateRandomProducts: (count?: number) => IProduct[];
@@ -1,2 +0,0 @@
1
- import { ISwatchesModuleProps } from '../../../../../lib/main';
2
- export declare const SwatchModule: ({ isOpen, uiDataType, data, onToggleSidebar, onSendData, }: ISwatchesModuleProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- export declare class AttributeHelper {
2
- static getImage(value: any): string | undefined;
3
- static getValueLabel(attribute: any): any;
4
- static getZoomIconColor(value: any): any;
5
- static getHexColor(value: any): any;
6
- static getAttributeLabel(attribute: any): any;
7
- }
@@ -1,11 +0,0 @@
1
- import { IAttributeAsset, AttributeValue, IMaterialSelectState } from '../model/types';
2
- import { INonZeroSelectedFilters, TAllValue, TFilterGroup } from '../utils/types';
3
- export declare class SwatchesServices {
4
- static getMaterialsValuesFromOptions(options: IAttributeAsset[]): AttributeValue[] | undefined;
5
- static getUniqueByAssetId<T extends {
6
- assetId: string;
7
- }>(array: T[]): T[];
8
- static normalizeToArray(input: string | string[] | null | undefined, splitByComma?: boolean): string[];
9
- static mapFiltersFromValues(allValues: TAllValue[], selected: IMaterialSelectState): TFilterGroup[];
10
- static getPositiveSelectedFilers(mappedData: TFilterGroup[]): INonZeroSelectedFilters[];
11
- }
@@ -1,10 +0,0 @@
1
- import { RootState } from '../../../app/store/store';
2
- export declare const getListAttributes: (state: RootState) => import('./types').IAttributeAsset[];
3
- export declare const getAttributeByName: (optionName: string) => (state: RootState) => import('./types').IAttributeAsset | undefined;
4
- export declare const getAllMaterialValues: (state: RootState) => import('./types').AttributeValue[];
5
- export declare const getMaterialSelectStateFilters: (state: RootState) => import('./types').IMaterialSelectState;
6
- export declare const getProductElementOptions: (state: RootState) => any[];
7
- export declare const getSelectedMaterials: (state: RootState) => import('./types').AttributeValue[];
8
- export declare const getIsLoadingSelectedProduct: (state: RootState) => boolean;
9
- export declare const getIsOpenMultiCart: (state: RootState) => boolean;
10
- export declare const getSelectedProduct: (state: RootState) => import('../../MultiProduct/model/types').IProductListItem | null;
@@ -1,53 +0,0 @@
1
- import { PayloadAction } from '@reduxjs/toolkit';
2
- import { AttributeValue, IAttributeAsset, IMaterialSelectState, ISetFiltersPayload, ISwatchesSlice } from './types';
3
- import { IMapUIData } from '../../DataAdapter/utils/types';
4
- import { IProductListItem } from '../../MultiProduct/model/types';
5
- export declare const swatchesSlice: import('@reduxjs/toolkit').Slice<ISwatchesSlice, {
6
- setMaterialSelect(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<ISetFiltersPayload>): void;
7
- setPanelFilter(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
8
- attributes: IAttributeAsset[];
9
- }>): void;
10
- clearMaterialFilter: (state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<keyof IMaterialSelectState>) => void;
11
- clearAllMaterialFilters: (state: import('immer').WritableDraft<ISwatchesSlice>) => void;
12
- setAllMaterialsOptions: (state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<IMapUIData>) => void;
13
- setSelectedMaterial(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
14
- materialCount: number;
15
- selectedMaterial: AttributeValue;
16
- selectedMaterials: AttributeValue[];
17
- }>): void;
18
- resetSelectedMaterials(state: import('immer').WritableDraft<ISwatchesSlice>): void;
19
- setSelectedProduct(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<IProductListItem>): void;
20
- deleteSelectedProduct(state: import('immer').WritableDraft<ISwatchesSlice>): void;
21
- setIsOpenMultiProductCart(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<boolean>): void;
22
- removeItem(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
23
- selectedMaterial: AttributeValue;
24
- }>): void;
25
- increment(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
26
- selectedMaterial: AttributeValue;
27
- }>): void;
28
- decrement(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
29
- selectedMaterial: AttributeValue;
30
- }>): void;
31
- setCount(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<{
32
- selectedMaterial: AttributeValue;
33
- next: number;
34
- }>): void;
35
- setCartMaterials(state: import('immer').WritableDraft<ISwatchesSlice>, action: PayloadAction<AttributeValue[]>): void;
36
- }, "swatches", "swatches", import('@reduxjs/toolkit').SliceSelectors<ISwatchesSlice>>;
37
- export declare const swatchesReducer: import('redux').Reducer<ISwatchesSlice>;
38
- export declare const setMaterialSelect: import('@reduxjs/toolkit').ActionCreatorWithPayload<ISetFiltersPayload, "swatches/setMaterialSelect">, setAllMaterialsOptions: import('@reduxjs/toolkit').ActionCreatorWithPayload<IMapUIData, "swatches/setAllMaterialsOptions">, setPanelFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
39
- attributes: IAttributeAsset[];
40
- }, "swatches/setPanelFilter">, setSelectedMaterial: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
41
- materialCount: number;
42
- selectedMaterial: AttributeValue;
43
- selectedMaterials: AttributeValue[];
44
- }, "swatches/setSelectedMaterial">, clearMaterialFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<keyof IMaterialSelectState, "swatches/clearMaterialFilter">, clearAllMaterialFilters: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/clearAllMaterialFilters">, setSelectedProduct: import('@reduxjs/toolkit').ActionCreatorWithPayload<IProductListItem, "swatches/setSelectedProduct">, deleteSelectedProduct: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/deleteSelectedProduct">, setIsOpenMultiProductCart: import('@reduxjs/toolkit').ActionCreatorWithPayload<boolean, "swatches/setIsOpenMultiProductCart">, resetSelectedMaterials: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"swatches/resetSelectedMaterials">, removeItem: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
45
- selectedMaterial: AttributeValue;
46
- }, "swatches/removeItem">, increment: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
47
- selectedMaterial: AttributeValue;
48
- }, "swatches/increment">, decrement: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
49
- selectedMaterial: AttributeValue;
50
- }, "swatches/decrement">, setCount: import('@reduxjs/toolkit').ActionCreatorWithPayload<{
51
- selectedMaterial: AttributeValue;
52
- next: number;
53
- }, "swatches/setCount">, setCartMaterials: import('@reduxjs/toolkit').ActionCreatorWithPayload<AttributeValue[], "swatches/setCartMaterials">;
@@ -1,22 +0,0 @@
1
- import { IGetProductParameters, IProductInformationResponse } from '../../MultiProduct/model/types';
2
- import { IFetchProductData } from '../../../shared/types/fetchData';
3
- export declare const getSelectedProductThunk: import('@reduxjs/toolkit').AsyncThunk<IFetchProductData | null, IGetProductParameters, {
4
- rejectValue: string;
5
- state?: unknown;
6
- dispatch?: import('redux-thunk').ThunkDispatch<unknown, unknown, import('redux').UnknownAction> | undefined;
7
- extra?: unknown;
8
- serializedErrorType?: unknown;
9
- pendingMeta?: unknown;
10
- fulfilledMeta?: unknown;
11
- rejectedMeta?: unknown;
12
- }>;
13
- export declare const getSelectedProductInformationThunk: import('@reduxjs/toolkit').AsyncThunk<IProductInformationResponse, IGetProductParameters, {
14
- rejectValue: string;
15
- state?: unknown;
16
- dispatch?: import('redux-thunk').ThunkDispatch<unknown, unknown, import('redux').UnknownAction> | undefined;
17
- extra?: unknown;
18
- serializedErrorType?: unknown;
19
- pendingMeta?: unknown;
20
- fulfilledMeta?: unknown;
21
- rejectedMeta?: unknown;
22
- }>;
@@ -1,148 +0,0 @@
1
- import { IProductListItem } from '../../MultiProduct/model/types';
2
- export interface IProduct {
3
- attributes: AttributeValue[] | any[];
4
- name: string;
5
- productId: number;
6
- categories: string[];
7
- }
8
- export interface ISwatchesSlice {
9
- listAttributes: IAttributeAsset[];
10
- productElementOptions: any[];
11
- materialSelectState: IMaterialSelectState;
12
- allMaterialsValues: AttributeValue[];
13
- selectedMaterials: AttributeValue[];
14
- selectedProduct: IProductListItem | null;
15
- isLoadingSelectedProduct: boolean;
16
- isOpenMultiProductCart: boolean;
17
- }
18
- export interface IMaterialSelectState {
19
- Finish: string[];
20
- Color: string[];
21
- Look: string[];
22
- }
23
- export type TFilterName = keyof IMaterialSelectState;
24
- export interface ISetFiltersPayload {
25
- filterName: keyof IMaterialSelectState;
26
- values: string[];
27
- }
28
- export interface IAttributeAsset {
29
- assetType: string;
30
- blacklist: unknown[];
31
- defaultValue: {
32
- assetId: string;
33
- type: string;
34
- }[];
35
- disabledValues: unknown[];
36
- enabled: boolean;
37
- global: {
38
- defaultValue: {
39
- assetId: string;
40
- type: string;
41
- };
42
- id: string;
43
- metadata: unknown[];
44
- name: string;
45
- type: string;
46
- };
47
- hiddenValues: unknown[];
48
- id: string;
49
- label: string;
50
- metadata: {
51
- [key: string]: string;
52
- };
53
- name: string;
54
- type: string;
55
- value: {
56
- assetId: string;
57
- configuration: unknown;
58
- metadata: {
59
- [key: string]: string;
60
- };
61
- name: string;
62
- tags: string[];
63
- type: string;
64
- };
65
- values: IAttributeAssetValues[];
66
- visible: boolean;
67
- valuesArray?: IMaterialMetadata[];
68
- option?: string;
69
- }
70
- export interface IAttributeAssetValues {
71
- assetId: string;
72
- enabled: boolean;
73
- fileSize: number;
74
- handleSelect: () => unknown;
75
- label: string;
76
- metadata: {
77
- [key: string]: string;
78
- };
79
- name: string;
80
- selected: boolean;
81
- tagids: string[];
82
- tags: string[];
83
- type: string;
84
- visible: boolean;
85
- }
86
- export interface IValueItem {
87
- value: string;
88
- label: string;
89
- additionalFilter?: string;
90
- }
91
- export interface IOption {
92
- option: string;
93
- label: string;
94
- optionName: string;
95
- order: string;
96
- type: string;
97
- typeComponent: string;
98
- values?: Record<string, string>;
99
- valuesArray?: IValueItem[];
100
- }
101
- export interface IGroup {
102
- groupName: string;
103
- order: string;
104
- type: string;
105
- options: IOption[];
106
- }
107
- export interface ISection {
108
- section: string;
109
- sort: string;
110
- groups: IGroup[];
111
- enabledCTA: boolean;
112
- }
113
- export declare const ETypeComponent: {
114
- readonly MATERIAL: "material";
115
- readonly FILTRATION: "filtration";
116
- readonly LIST: "list";
117
- readonly IMAGE: "image";
118
- readonly COMBINED: "combined";
119
- };
120
- export type ETypeComponent = (typeof ETypeComponent)[keyof typeof ETypeComponent];
121
- export interface AttributeValue {
122
- count: number;
123
- assetId?: string;
124
- name?: string;
125
- tags?: string[];
126
- metadata?: IMaterialMetadata;
127
- parentName: string;
128
- fileSize?: number;
129
- tagids?: string[];
130
- type?: 'item' | string;
131
- label: string;
132
- visible?: boolean;
133
- enabled?: boolean;
134
- option?: string;
135
- optionName?: string;
136
- valuesArray?: IMaterialMetadata[];
137
- value?: string;
138
- }
139
- export interface IMaterialMetadata {
140
- Look?: string;
141
- Color?: string;
142
- image?: string;
143
- label?: string;
144
- value?: string;
145
- Material?: string;
146
- zoomIconColor?: string;
147
- [key: string]: string | undefined;
148
- }
@@ -1 +0,0 @@
1
- export declare const ColorsFilter: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const LooksFilter: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const MaterialsFilter: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare const Filters: () => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare const HexGridZoom: ({ item }: {
2
- item: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare const ImageGridZoom: ({ item }: {
2
- item: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- interface IMaterialListProps {
2
- containerStyles?: string;
3
- gridStyles?: string;
4
- desktopColumnsCount?: number;
5
- }
6
- export declare const MaterialSingleProductList: ({ containerStyles, gridStyles, desktopColumnsCount, }: IMaterialListProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,28 +0,0 @@
1
- /**
2
- * Props for {@link ProductElement}.
3
- */
4
- interface IProductElementProps {
5
- /**
6
- * ClassName string applied to the outer container.
7
- */
8
- containerStyles: string;
9
- /**
10
- * ClassName string applied to the {@link MultiSelect} component.
11
- */
12
- selectStyles: string;
13
- }
14
- /**
15
- * Renders a product element filter based on a multi-select control.
16
- *
17
- * Builds selectable options from `allProductElementOptions` and
18
- * applies filtering logic that:
19
- * - updates selected product element values
20
- * - remaps and prunes related filters based on available counts
21
- * - updates the panel attributes list according to selection
22
- *
23
- * @component
24
- *
25
- * @param props - {@link IProductElementProps}
26
- */
27
- export declare const ProductElement: ({ containerStyles, selectStyles, }: IProductElementProps) => import("react/jsx-runtime").JSX.Element;
28
- export {};
@@ -1,8 +0,0 @@
1
- import { EActiveTab } from '../../../../shared/types/activeTab';
2
- interface ISidebarWrapperProps {
3
- isOpen: boolean;
4
- onSetActiveTab: (activeTab: EActiveTab) => void;
5
- onToggleSidebar: () => void;
6
- }
7
- export declare const SwatchWrapper: ({ isOpen, onToggleSidebar, onSetActiveTab, }: ISidebarWrapperProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,2 +0,0 @@
1
- import { ISwatchesModuleProps } from '../../../../lib/main';
2
- export declare const Swatches: ({ isOpen, onToggleSidebar, onSendData, }: ISwatchesModuleProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,28 +0,0 @@
1
- import { AttributeValue } from '../../model/types';
2
- /**
3
- * Props for {@link SwatchesList}.
4
- */
5
- interface ISwatchesListProps {
6
- /**
7
- * Optional className string applied to the outer container.
8
- */
9
- containerStyles?: string;
10
- /**
11
- * Currently selected swatch materials.
12
- */
13
- selectedMaterials: AttributeValue[];
14
- }
15
- /**
16
- * Renders the swatches list with selected materials and remaining empty slots.
17
- *
18
- * Displays:
19
- * - header with selected count
20
- * - selected swatches as list items
21
- * - placeholder tiles for unused slots up to {@link MAX_SLOTS}
22
- *
23
- * @component
24
- *
25
- * @param props - {@link ISwatchesListProps}
26
- */
27
- export declare const SwatchesList: ({ selectedMaterials, containerStyles, }: ISwatchesListProps) => import("react/jsx-runtime").JSX.Element;
28
- export {};
@@ -1 +0,0 @@
1
- export declare const SwatchesSingleProductListWrapper: () => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { TFilterName } from '../model/types';
2
- import { TValueKey } from './types';
3
- export declare const FILTER_TO_VALUE_KEY: Record<TFilterName, TValueKey>;
@@ -1,18 +0,0 @@
1
- type WithCount = {
2
- /**
3
- * Numeric count value.
4
- * Can be `null` when the item is not counted.
5
- */
6
- count: number | null;
7
- };
8
- /**
9
- * Calculates the total count of items.
10
- *
11
- * Sums the `count` property of all provided items and
12
- * memoizes the result to prevent unnecessary recalculations.
13
- *
14
- * @param items - Array of items containing a `count` field
15
- * @returns Total count of all items
16
- */
17
- export declare function useCartCount<T extends WithCount>(items: T[]): number;
18
- export {};
@@ -1,22 +0,0 @@
1
- import { TFilterName } from '../model/types';
2
- export type TValueKey = 'Material' | 'Color' | 'Look';
3
- export type TValueEntry = {
4
- metadata?: Partial<Record<TValueKey, string | string[] | null | undefined>>;
5
- };
6
- export type TFilterItem = {
7
- filterKey: string;
8
- filterCount: number;
9
- };
10
- export type TFilterGroup = {
11
- filterType: TFilterName;
12
- filters: TFilterItem[];
13
- };
14
- export interface INonZeroSelectedFilters {
15
- filterName: TFilterName;
16
- filterKeys: string[];
17
- }
18
- export type TAllValue = {
19
- assetId: string;
20
- name: string;
21
- values?: TValueEntry[] | null;
22
- };
@@ -1 +0,0 @@
1
- export declare const MATERIAL_PRICE = 6.5;