@soma-vertical-web/multi-lib 0.0.61 → 0.0.62

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.
@@ -12,6 +12,7 @@ export interface CrossSellingFacet {
12
12
  * TODO: remove 'textarea-size' from InputSizes in core-compoennts
13
13
  */
14
14
  export type InputSizes = Exclude<Size, 'textarea-size'>;
15
+ export type ACCESSIBILITY_INFOType = boolean;
15
16
  export type ADD_TO_CARTType = Record<string, Record<string, string>>;
16
17
  export type ALIGNMENT_MENUType = 'flex-start' | 'center' | 'flex-end';
17
18
  export type AUTH_TOKEN_COOKIEType = string;
@@ -31,6 +32,8 @@ export type COMMON_PAGE_COLUMN_GAPType = CSSProperties['gap'];
31
32
  export type COMMON_PAGE_COLUMN_GAP_PDCType = CSSProperties['gap'];
32
33
  export type COMPONENT_LISTType = Record<string, string>;
33
34
  export type CREATE_CONTENTType = (jsonData: string) => EditorState;
35
+ export type CURRENCYType = string;
36
+ export type DELIVERY_INFO_BOXES_ALLOWEDType = boolean;
34
37
  export type EXTENDED_BLOCK_RENDER_MAPType = Immutable.Map<any, any>;
35
38
  export type FREIGHT_CALCULATIONType = {
36
39
  messages: {
@@ -98,6 +101,42 @@ export type MINICART_CONFIGType = {
98
101
  };
99
102
  };
100
103
  export type NAME_SPLIT_SYMBOLType = string;
104
+ export type NEWSLETTER_CONFIGSType = {
105
+ messages: {
106
+ success_title: string;
107
+ success_description: string;
108
+ invalid_name: string;
109
+ invalid_email: string;
110
+ invalid_generic: string;
111
+ required_field: string;
112
+ error: string;
113
+ accept_terms_and_conditions: string;
114
+ terms_and_conditions_not_accepted: string;
115
+ lgpd: string;
116
+ notify: string;
117
+ };
118
+ inputNamePlaceholder: string;
119
+ inputEmailPlaceholder: string;
120
+ submitLabel: string;
121
+ hasTermsAndConditions: boolean;
122
+ hasLoadingState: boolean;
123
+ interactionSizeDesk: string;
124
+ interactionSizeMob: string;
125
+ form: {
126
+ status: {
127
+ error: string;
128
+ };
129
+ };
130
+ };
131
+ export type NOTIFY_INFOType = {
132
+ title: string;
133
+ subtitle: string;
134
+ description: string;
135
+ legal: string;
136
+ selector_label: string;
137
+ email_placeholder: string;
138
+ button: string;
139
+ };
101
140
  export type OBJECT_FITS_DEFAULTType = (typeof ObjectFitsDefault)[number];
102
141
  export type PAYMENT_FLAGS_DICTIONARYType = Record<string, string>;
103
142
  export type PAYMENT_FLAGSType = any;
@@ -147,14 +186,40 @@ export type PRODUCT_CARD_TEXTSType = {
147
186
  };
148
187
  };
149
188
  export type PRODUCT_CARD_TOP_WISHLIST_TOGGLEType = boolean;
150
- export type PRODUCT_IMAGE_DIMENSIONSType = Record<string, {
151
- width: number;
152
- height: number;
153
- } | Record<string, {
154
- width: number;
155
- height: number;
156
- }>>;
189
+ export type PRODUCT_IMAGE_DIMENSIONSType = {
190
+ product_card: {
191
+ width: number;
192
+ height: number;
193
+ };
194
+ pdp: {
195
+ width: number;
196
+ height: number;
197
+ };
198
+ image_zoom: {
199
+ desktop: {
200
+ width: number;
201
+ height: number;
202
+ };
203
+ mobile: {
204
+ width: number;
205
+ height: number;
206
+ };
207
+ };
208
+ };
209
+ export type QUICKSHOPType = {
210
+ title: string;
211
+ };
157
212
  export type SECOND_IMAGEType = string;
213
+ export type MEASUREMENTS_SIZESType = {
214
+ bannerImage: string;
215
+ title: string;
216
+ descriptions: {
217
+ title: string;
218
+ text: string;
219
+ }[];
220
+ head: string[];
221
+ rows: string[][];
222
+ };
158
223
  export type TEXTURE_IMAGEType = string[];
159
224
  export type TIME_ZONEType = string;
160
225
  export type TIPBAR_CONFIGSType = {
@@ -1,24 +1,14 @@
1
- import { ProductInfoProps } from '@soma-vertical-web/core-components/src/lib/ProductInfo/interfaces';
2
1
  import { PropsWithChildren } from 'react';
3
- import { Sizes as BtnSizes } from '@soma-vertical-web/core-components/src/lib/Button/interfaces';
4
2
  import { ImageType, ProductType_PDP } from '../../global/product';
5
3
  import { TagCommercialConsumer } from '../../cms/ContentTypes/FlagsAndTags';
6
4
  import { UseBackPDCProps } from '../hooks';
7
5
  import { PDP_INFOType, NAME_SPLIT_SYMBOLType, TEXTURE_IMAGEType } from '../../constants';
8
6
 
9
- export type SimilarsType = {
10
- currentSimilarInfo: {
11
- images: ImageType[];
12
- color: string[];
13
- };
14
- productId: string;
15
- };
16
7
  export interface PDPContextProps {
17
8
  sizesContainerRef: React.MutableRefObject<HTMLDivElement | null>;
18
9
  }
19
10
  export interface PDPProviderProps extends PropsWithChildren, UseBackPDCProps {
20
11
  }
21
- export type PDPPriceProps = ProductInfoProps;
22
12
  export type Installments = {
23
13
  count: number;
24
14
  value: number;
@@ -28,11 +18,6 @@ export type PricesInfos = {
28
18
  listPrice: number;
29
19
  installments: Installments;
30
20
  };
31
- export type DescriptionContent = {
32
- label: string;
33
- value: string;
34
- content: string | TrustedHTML;
35
- }[];
36
21
  export type Sizes = {
37
22
  name: string;
38
23
  sku: string;
@@ -41,6 +26,11 @@ export type Sizes = {
41
26
  sellerId: string;
42
27
  sellerName: string;
43
28
  }[];
29
+ export type DescriptionContent = {
30
+ label: string;
31
+ value: string;
32
+ content: string | TrustedHTML;
33
+ }[];
44
34
  export type PDPDataContextProps = {
45
35
  productData: ProductType_PDP;
46
36
  productId: string;
@@ -77,37 +67,6 @@ export type PDPDataContextProps = {
77
67
  size?: string;
78
68
  }) => void;
79
69
  };
80
- export interface SubSectionProps extends PropsWithChildren {
81
- className?: string;
82
- }
83
- export interface GalleryWrapperProps {
84
- productImgs: ImageType[];
85
- PRODUCT_IMAGE_DIMENSIONS: any;
86
- ImageZoom: React.ComponentType<any>;
87
- }
88
- export interface PDPActionsProps {
89
- showWishlist?: boolean;
90
- callBack?: Function;
91
- addToCartBtnSize?: {
92
- mobile: BtnSizes;
93
- desktop: BtnSizes;
94
- };
95
- }
96
- export interface AddToCartProps {
97
- addToCartBtnSize?: {
98
- mobile: BtnSizes;
99
- desktop: BtnSizes;
100
- };
101
- onAddCallBack?: Function;
102
- onDisabledClickCallBack?: Function;
103
- }
104
- export interface BottomNavigationProps {
105
- addToCartBtnSize?: {
106
- mobile: BtnSizes;
107
- desktop: BtnSizes;
108
- };
109
- }
110
- export type BottomNavigationActionsProps = BottomNavigationProps;
111
70
  export interface PDPDataProviderProps extends PropsWithChildren {
112
71
  productData: ProductType_PDP;
113
72
  isKit: boolean;
@@ -1,5 +1,5 @@
1
1
  import { ImageType, ItemType_PDP } from '../../global/product';
2
- import { MAIN_IMAGEType, NAME_SPLIT_SYMBOLType, SECOND_IMAGEType, TEXTURE_IMAGEType } from '../../constants';
2
+ import { MAIN_IMAGEType, NAME_SPLIT_SYMBOLType, PLP_SIZE_ORDERType, SECOND_IMAGEType, TEXTURE_IMAGEType } from '../../constants';
3
3
  import { ProductCardProps } from '../../layout/team-components/ProductCard';
4
4
 
5
5
  export type GetSkuInfosProps = {
@@ -35,3 +35,8 @@ export type GetThumbImageProps = {
35
35
  images: ImageType[];
36
36
  TEXTURE_IMAGE: TEXTURE_IMAGEType;
37
37
  };
38
+ export type OrderSizesProps = {
39
+ items: any[];
40
+ getLabel: (item: any) => string;
41
+ PLP_SIZE_ORDER: PLP_SIZE_ORDERType;
42
+ };
@@ -1,6 +1,8 @@
1
1
  import { ButtonProps } from '@soma-vertical-web/core-components/src/lib/Button/interfaces';
2
2
  import { ImageType } from '../../../global/product';
3
- import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
3
+ import { ButtonHTMLAttributes, Dispatch, HTMLAttributes, PropsWithChildren, ReactNode, RefObject, SetStateAction } from 'react';
4
+ import { ICONSType, PRODUCT_IMAGE_DIMENSIONSType, Z_INDEX_WARType } from '../../../constants';
5
+ import { QuickShopProps } from '../../templates/QuickShop/index';
4
6
 
5
7
  interface CommonProps {
6
8
  images: ImageType[];
@@ -8,30 +10,61 @@ interface CommonProps {
8
10
  onThumbnailClick: (index: number) => void;
9
11
  }
10
12
  export interface ImageDesktopProps extends CommonProps {
13
+ PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
11
14
  }
12
15
  export interface ImageZoomProps extends CommonProps {
13
16
  handleClose: () => void;
14
17
  isDesktopOpen: boolean;
15
18
  isMobileOpen: boolean;
16
19
  }
17
- export interface ImagesThumbsProps extends CommonProps {
20
+ export interface ImageMobileProps {
21
+ imgRef: RefObject<HTMLImageElement>;
22
+ image: ImageZoomMobileProps['images'][0];
23
+ PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
18
24
  }
19
- export interface ImageMobileProps extends HTMLAttributes<HTMLDivElement> {
25
+ export type ImagesThumbsProps = CommonProps;
26
+ export interface ImageZoomMobileProps extends HTMLAttributes<HTMLDivElement> {
20
27
  images: ImageType[];
21
28
  items_per_page?: number;
22
29
  gap?: number;
23
30
  loop?: boolean;
24
31
  direction?: 'horizontal' | 'vertical';
32
+ ICONS: ICONSType;
33
+ PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
25
34
  }
26
35
  export interface MobileWrapperProps extends HTMLAttributes<HTMLDivElement> {
36
+ Z_INDEX_WAR: Z_INDEX_WARType;
27
37
  }
28
38
  export interface ButtonCloseProps extends ButtonProps {
29
39
  onClose: () => void;
30
40
  btnAdornment?: {
31
41
  buttonClosed: ReactNode;
32
42
  };
43
+ ICONS: ICONSType;
33
44
  }
34
45
  export interface ShopBagProps extends ButtonHTMLAttributes<HTMLButtonElement> {
35
46
  skuSelectModal: () => void;
36
47
  }
48
+ export interface ImageZoomRootProps extends Omit<QuickShopProps, 'callBackProductAdded'> {
49
+ images: ImageType[];
50
+ initialSelectedImageIndex?: number;
51
+ setShowImageZoom: Dispatch<SetStateAction<{
52
+ show: boolean;
53
+ initialIndex: number;
54
+ }>>;
55
+ PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
56
+ }
57
+ export type BlurImageProps = {
58
+ image: ImageType;
59
+ };
60
+ export interface WrapperDesktopProps extends PropsWithChildren {
61
+ Z_INDEX_WAR: Z_INDEX_WARType;
62
+ }
63
+ export type CarouselProps = {
64
+ images: ImageZoomMobileProps['images'];
65
+ setCurrent: Dispatch<SetStateAction<number>>;
66
+ setFirstImgLoaded: Dispatch<SetStateAction<boolean>>;
67
+ ICONS: ICONSType;
68
+ PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
69
+ };
37
70
  export {};
@@ -1,4 +1,5 @@
1
1
  import { Dispatch, HTMLAttributes, SetStateAction } from 'react';
2
+ import { ICONSType, NEWSLETTER_CONFIGSType, NOTIFY_INFOType, PRODUCT_CARD_TEXTSType, Z_INDEX_WARType } from '../../../constants';
2
3
 
3
4
  export type SKU = {
4
5
  disable: boolean;
@@ -11,10 +12,13 @@ export interface FormProps extends HTMLAttributes<HTMLDivElement> {
11
12
  setStatus: Dispatch<SetStateAction<boolean | null>>;
12
13
  setIsLoading: Dispatch<SetStateAction<boolean>>;
13
14
  color?: string;
15
+ NEWSLETTER_CONFIGS: NEWSLETTER_CONFIGSType;
16
+ NOTIFY_INFO: NOTIFY_INFOType;
14
17
  }
15
18
  export interface StatusProps {
16
- delay?: number;
17
19
  status: boolean | null;
20
+ ICONS: ICONSType;
21
+ PRODUCT_CARD_TEXTS: PRODUCT_CARD_TEXTSType;
18
22
  }
19
23
  export interface SelectorProps extends HTMLAttributes<HTMLDivElement> {
20
24
  label?: string;
@@ -25,8 +29,24 @@ export interface SelectorProps extends HTMLAttributes<HTMLDivElement> {
25
29
  export interface AvailabilityNotifyProps {
26
30
  open?: boolean;
27
31
  setSku: Dispatch<SetStateAction<SKU | null>>;
28
- setVisible: Dispatch<SetStateAction<boolean>>;
32
+ setVisible: (value: boolean) => void;
29
33
  sku: SKU | null;
30
34
  skus: SKU[];
31
35
  color?: string;
36
+ ICONS: ICONSType;
37
+ NEWSLETTER_CONFIGS: NEWSLETTER_CONFIGSType;
38
+ NOTIFY_INFO: NOTIFY_INFOType;
39
+ PRODUCT_CARD_TEXTS: PRODUCT_CARD_TEXTSType;
40
+ Z_INDEX_WAR: Z_INDEX_WARType;
32
41
  }
42
+ export type ControlProps = {
43
+ isMobile?: boolean;
44
+ ICONS: ICONSType;
45
+ NOTIFY_INFO: NOTIFY_INFOType;
46
+ };
47
+ export type ItemProps = {
48
+ icon: string;
49
+ subtitle: string;
50
+ title: string;
51
+ type: 'success' | 'error';
52
+ };
@@ -1,7 +1,147 @@
1
- import { PRODUCT_IMAGE_DIMENSIONSType, TEXTURE_IMAGEType } from '../../../constants';
1
+ import { BUY_BUTTON_LABELSType, CURRENCYType, DELIVERY_INFO_BOXES_ALLOWEDType, FREIGHT_CALCULATIONType, ICONSType, MEASUREMENTS_SIZESType, NEWSLETTER_CONFIGSType, NOTIFY_INFOType, PDP_INFOType, PLP_SIZE_ORDERType, PRODUCT_CARD_TEXTSType, PRODUCT_IMAGE_DIMENSIONSType, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType } from '../../../constants';
2
+ import { Sizes as BtnSizes } from '@soma-vertical-web/core-components/src/lib/Button/interfaces';
3
+ import { ProductInfoProps } from '@soma-vertical-web/core-components/src/lib/ProductInfo/interfaces';
4
+ import { Dispatch, HTMLAttributes, PropsWithChildren, SetStateAction } from 'react';
5
+ import { ImageType } from '../../../global/product';
6
+ import { SimilarType } from '../../../../types/data/api/catalog/product';
7
+ import { ImageZoomRootProps } from '../../team-components/ImageZoom';
2
8
 
3
- export type GalleryProps = {
4
- TEXTURE_IMAGE: TEXTURE_IMAGEType;
9
+ export type BreadCrumbProps = {
10
+ className?: string;
11
+ ICONS: ICONSType;
12
+ device: 'mobile' | 'desktop';
13
+ };
14
+ export type CreditsProps = {
15
+ className?: string;
16
+ };
17
+ export type SimilarsType = {
18
+ currentSimilarInfo: {
19
+ images: ImageType[];
20
+ color: string[];
21
+ };
22
+ productId: string;
23
+ };
24
+ type SelectedSkuInfoType = {
25
+ productId: string;
26
+ name: string;
27
+ size: string;
28
+ sku: string;
29
+ sellerId: string;
30
+ sellerName: string;
31
+ available: boolean;
32
+ quantity: number;
33
+ };
34
+ export interface PDPContextProps {
35
+ selectedSkuInfo: SelectedSkuInfoType;
36
+ setSelectedSkuInfo: Dispatch<SetStateAction<SelectedSkuInfoType>>;
37
+ openLetMeKnow: boolean;
38
+ setOpenLetMeKnow: Dispatch<SetStateAction<boolean>>;
39
+ showBottomNavigation: boolean;
40
+ setShowBottomNavigation: Dispatch<SetStateAction<boolean>>;
41
+ handleShowNavigation: (show: boolean) => void;
42
+ showNotify: boolean;
43
+ setShowNotify: Dispatch<SetStateAction<boolean>>;
44
+ sizesContainerRef: React.MutableRefObject<HTMLDivElement | null>;
45
+ openMeasurements: boolean;
46
+ setOpenMeasurements: Dispatch<SetStateAction<boolean>>;
47
+ }
48
+ export type PDPPriceProps = ProductInfoProps;
49
+ export type Installments = {
50
+ count: number;
51
+ value: number;
52
+ };
53
+ export type PricesInfos = {
54
+ price: number;
55
+ listPrice: number;
56
+ installments: Installments;
57
+ };
58
+ export interface SubSectionProps extends PropsWithChildren {
59
+ className?: string;
60
+ type: 'product-info' | 'similars' | 'sizes' | 'actions';
61
+ }
62
+ export interface GalleryWrapperProps extends Omit<ImageZoomRootProps, 'images' | 'setShowImageZoom' | 'initialSelectedImageIndex'> {
63
+ productImgs: ImageType[];
5
64
  PRODUCT_IMAGE_DIMENSIONS: PRODUCT_IMAGE_DIMENSIONSType;
6
- ImageZoom: React.ComponentType<any>;
65
+ }
66
+ export type GalleryProps = Omit<GalleryWrapperProps, 'productImgs'>;
67
+ export interface PDPActionsProps {
68
+ showWishlist?: boolean;
69
+ callBack?: Function;
70
+ addToCartBtnSize?: {
71
+ mobile: BtnSizes;
72
+ desktop: BtnSizes;
73
+ };
74
+ BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
75
+ ICONS: ICONSType;
76
+ Z_INDEX_WAR: Z_INDEX_WARType;
77
+ }
78
+ export interface AddToCartProps {
79
+ addToCartBtnSize?: {
80
+ mobile: BtnSizes;
81
+ desktop: BtnSizes;
82
+ };
83
+ onAddCallBack?: Function;
84
+ onDisabledClickCallBack?: Function;
85
+ BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
86
+ }
87
+ export type AddToWishlistProps = {
88
+ ICONS: ICONSType;
89
+ };
90
+ export interface BottomNavigationProps {
91
+ addToCartBtnSize?: {
92
+ mobile: BtnSizes;
93
+ desktop: BtnSizes;
94
+ };
95
+ BUY_BUTTON_LABELS: BUY_BUTTON_LABELSType;
96
+ Z_INDEX_WAR: Z_INDEX_WARType;
97
+ }
98
+ export type BottomNavigationActionsProps = Omit<BottomNavigationProps, 'Z_INDEX_WAR'>;
99
+ export type PDPLinksProps = {
100
+ ICONS: ICONSType;
101
+ PDP_INFO: PDP_INFOType;
102
+ className?: string;
103
+ hasIcons?: boolean;
104
+ };
105
+ export type DescriptionProps = {
106
+ title: string;
107
+ text: string;
108
+ };
109
+ export type ProductMeasurementsProps = {
110
+ ICONS: ICONSType;
111
+ SIZES: MEASUREMENTS_SIZESType;
112
+ Z_INDEX_WAR: Z_INDEX_WARType;
113
+ };
114
+ export interface PDPSimilarsType extends PropsWithChildren {
115
+ apiUrl: string;
116
+ productId: string;
117
+ ClientItems: React.ComponentType<ItemsProps>;
118
+ PDP_INFO: PDP_INFOType;
119
+ TEXTURE_IMAGE: TEXTURE_IMAGEType;
120
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
121
+ }
122
+ export type ItemsProps = {
123
+ productId: string;
124
+ similars: SimilarType[];
125
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
126
+ };
127
+ export interface ToggleWrapperProps extends PropsWithChildren {
128
+ link: string | null;
129
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
130
+ }
131
+ export type PDPSizesProps = {
132
+ ICONS: ICONSType;
133
+ NEWSLETTER_CONFIGS: NEWSLETTER_CONFIGSType;
134
+ NOTIFY_INFO: NOTIFY_INFOType;
135
+ PDP_INFO: PDP_INFOType;
136
+ PLP_SIZE_ORDER: PLP_SIZE_ORDERType;
137
+ PRODUCT_CARD_TEXTS: PRODUCT_CARD_TEXTSType;
138
+ Z_INDEX_WAR: Z_INDEX_WARType;
139
+ };
140
+ export type FreightProps = {
141
+ CURRENCY: CURRENCYType;
142
+ DELIVERY_INFO_BOXES_ALLOWED: DELIVERY_INFO_BOXES_ALLOWEDType;
143
+ FREIGHT_CALCULATION: FREIGHT_CALCULATIONType;
144
+ Z_INDEX_WAR: Z_INDEX_WARType;
7
145
  };
146
+ export type PDPCommonContainerProps = HTMLAttributes<HTMLDivElement>;
147
+ export {};