@soma-vertical-web/multi-lib 0.0.57 → 0.0.58

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 (59) hide show
  1. package/contexts/contexts/cart/MiniCartData.d.ts +7 -0
  2. package/contexts/store/cart.d.ts +1 -1
  3. package/data/helpers/cart/index.d.ts +1 -1
  4. package/index-BR5lPUsH.js +1 -0
  5. package/index-C3QT-3iu.mjs +355 -0
  6. package/index-CuKKHhKx.mjs +355 -0
  7. package/index.js +20 -20
  8. package/index.mjs +5516 -4417
  9. package/index2.js +1 -1
  10. package/index2.mjs +1 -1
  11. package/layout/index.d.ts +53 -1
  12. package/layout/team-component/Header/index.d.ts +1 -1
  13. package/layout/template/MiniCart/Composite/Card/Card.d.ts +7 -0
  14. package/layout/template/MiniCart/Composite/Card/Composite/Actions.d.ts +7 -0
  15. package/layout/template/MiniCart/Composite/Card/Composite/Gift.d.ts +7 -0
  16. package/layout/template/MiniCart/Composite/Card/Composite/Media.d.ts +9 -0
  17. package/layout/template/MiniCart/Composite/Card/Composite/Name.d.ts +10 -0
  18. package/layout/template/MiniCart/Composite/Card/Composite/Price.d.ts +8 -0
  19. package/layout/template/MiniCart/Composite/Card/Composite/Sku.d.ts +7 -0
  20. package/layout/template/MiniCart/Composite/Card/Composite/Stepper.d.ts +7 -0
  21. package/layout/template/MiniCart/Composite/Card/Composite/Style.d.ts +7 -0
  22. package/layout/template/MiniCart/Composite/Card/Composite/Wishlist.d.ts +4 -0
  23. package/layout/template/MiniCart/Composite/Card/helpers.d.ts +8 -0
  24. package/layout/template/MiniCart/Composite/Card/index.d.ts +45 -0
  25. package/layout/template/MiniCart/Composite/Cashback.d.ts +7 -0
  26. package/layout/template/MiniCart/Composite/CouponSeller/CouponSeller.d.ts +7 -0
  27. package/layout/template/MiniCart/Composite/CouponSeller/index.d.ts +1 -0
  28. package/layout/template/MiniCart/Composite/Feedback.d.ts +7 -0
  29. package/layout/template/MiniCart/Composite/Field/Field.d.ts +7 -0
  30. package/layout/template/MiniCart/Composite/Field/Input.d.ts +7 -0
  31. package/layout/template/MiniCart/Composite/Field/index.d.ts +1 -0
  32. package/layout/template/MiniCart/Composite/Modal/Body.d.ts +7 -0
  33. package/layout/template/MiniCart/Composite/Modal/Footer/Discount/Discount.d.ts +7 -0
  34. package/layout/template/MiniCart/Composite/Modal/Footer/Discount/index.d.ts +1 -0
  35. package/layout/template/MiniCart/Composite/Modal/Footer/Footer.d.ts +7 -0
  36. package/layout/template/MiniCart/Composite/Modal/Footer/Resume/Items.d.ts +7 -0
  37. package/layout/template/MiniCart/Composite/Modal/Footer/Resume/Totals.d.ts +9 -0
  38. package/layout/template/MiniCart/Composite/Modal/Footer/index.d.ts +1 -0
  39. package/layout/template/MiniCart/Composite/Modal/Header.d.ts +7 -0
  40. package/layout/template/MiniCart/Composite/Notifications/Item/Item.d.ts +7 -0
  41. package/layout/template/MiniCart/Composite/Notifications/Item/index.d.ts +1 -0
  42. package/layout/template/MiniCart/Composite/Notifications/Notifications.d.ts +7 -0
  43. package/layout/template/MiniCart/Composite/Notifications/index.d.ts +1 -0
  44. package/layout/template/MiniCart/Composite/Shipping/Shipping.d.ts +7 -0
  45. package/layout/template/MiniCart/Composite/Shipping/index.d.ts +1 -0
  46. package/layout/template/MiniCart/Composite/TagMessage.d.ts +5 -0
  47. package/layout/template/MiniCart/Composite/Variations/Options.d.ts +17 -0
  48. package/layout/template/MiniCart/Composite/Variations/ProductVariations.d.ts +4 -0
  49. package/layout/template/MiniCart/Composite/Variations/VariationList.d.ts +3 -0
  50. package/layout/template/MiniCart/MiniCart.d.ts +4 -0
  51. package/layout/template/MiniCart/helpers.d.ts +7 -0
  52. package/layout/template/MiniCart/index.d.ts +53 -0
  53. package/package.json +1 -1
  54. package/style.css +1 -1
  55. package/types/constants.d.ts +34 -0
  56. package/types/contexts/contexts/cart/index.d.ts +9 -0
  57. package/types/contexts/store/cart.d.ts +2 -2
  58. package/types/layout/team-components/Header/index.d.ts +12 -2
  59. package/types/layout/templates/MiniCart/index.d.ts +192 -0
@@ -0,0 +1,192 @@
1
+ import { ButtonProps } from '@soma-vertical-web/core-components/src/lib/Button/interfaces';
2
+ import { ToggleSizeProps } from '@soma-vertical-web/core-components/src/lib/ToggleSize/interfaces';
3
+ import { CartContextProps, CartItemStore, NotificationsStore, NotificationStore } from '../../../contexts/store/cart';
4
+ import { ICONSType, MESSAGE_CASHBACKType, MINICART_CONFIGType, NAME_SPLIT_SYMBOLType, PLP_NOT_RESULTType, StoreConfigType, TEXTURE_IMAGEType, TOGGLE_STYLE_MODIFIERType, Z_INDEX_WARType } from '../../../constants';
5
+ import { InputCustomProps } from '@soma-vertical-web/core-components/src/lib/TextField/interfaces';
6
+ import { PropsWithChildren } from 'react';
7
+
8
+ export interface ModalMiniCartProps {
9
+ isOpen: boolean;
10
+ setModalIsOpen: (isOpen: boolean) => void;
11
+ }
12
+ export interface VariationListProps {
13
+ variations: {
14
+ name: string;
15
+ value: string;
16
+ id: string;
17
+ }[];
18
+ }
19
+ export interface ProductQuantityProps {
20
+ quantity: number;
21
+ updateQuantity: (quantity: number) => void;
22
+ }
23
+ type CartActionType = 'favorite-true' | 'favorite-false' | 'delete' | 'add' | 'minus';
24
+ export interface ButtonActionProps extends ButtonProps {
25
+ icon: CartActionType;
26
+ children?: React.ReactNode;
27
+ iconPosition?: 'Start' | 'End';
28
+ }
29
+ export interface ProductsProps {
30
+ addToCart: CartContextProps['addToCart'];
31
+ product: CartItemStore;
32
+ index: number;
33
+ available: boolean;
34
+ removeProduct(id: string, message?: string, callback?: () => void): void;
35
+ updateProductQuantity: (quantity: number) => void;
36
+ }
37
+ interface InputState {
38
+ value: string;
39
+ error: boolean;
40
+ valid: boolean;
41
+ isLoading?: boolean;
42
+ isValidated?: boolean;
43
+ }
44
+ export type ActionAlias = 'sellerCode' | 'couponCode' | 'freightCalculation';
45
+ export type StatePromocode = {
46
+ [key in ActionAlias]: InputState;
47
+ };
48
+ export declare enum ActionType {
49
+ SET_INPUT_VALUE = "SET_INPUT_VALUE",
50
+ CLEAR_INPUT_VALUE = "CLEAR_INPUT_VALUE",
51
+ SET_INPUT_ERROR = "SET_INPUT_ERROR",
52
+ SET_INPUT_VALID = "SET_INPUT_VALID",
53
+ SET_IS_LOADING = "SET_IS_LOADING"
54
+ }
55
+ export type Action = {
56
+ type: ActionType.SET_INPUT_VALUE;
57
+ alias: keyof StatePromocode;
58
+ value?: string;
59
+ } | {
60
+ type: ActionType.CLEAR_INPUT_VALUE;
61
+ alias: keyof StatePromocode;
62
+ } | {
63
+ type: ActionType.SET_INPUT_ERROR;
64
+ alias: keyof StatePromocode;
65
+ value?: boolean;
66
+ } | {
67
+ type: ActionType.SET_INPUT_VALID;
68
+ alias: keyof StatePromocode;
69
+ value?: boolean;
70
+ } | {
71
+ type: ActionType.SET_IS_LOADING;
72
+ alias: keyof StatePromocode;
73
+ value?: boolean;
74
+ };
75
+ export type OptionType = 'color' | 'size' | 'texture' | 'image';
76
+ export interface OptionProps extends React.HTMLAttributes<HTMLElement> {
77
+ fill?: string;
78
+ src?: string;
79
+ text?: string;
80
+ active?: boolean;
81
+ size?: ToggleSizeProps['size'];
82
+ type: OptionType;
83
+ }
84
+ export type FieldState = 'error' | 'valid' | 'value' | 'isLoading';
85
+ export type MiniCartProps = {
86
+ ICONS: ICONSType;
87
+ MINICART_CONFIG: MINICART_CONFIGType;
88
+ NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
89
+ PLP_NOT_RESULT: PLP_NOT_RESULTType;
90
+ TEXTURE_IMAGE: TEXTURE_IMAGEType;
91
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
92
+ Z_INDEX_WAR: Z_INDEX_WARType;
93
+ storeConfig: StoreConfigType;
94
+ minicartStyleModifiers?: string;
95
+ };
96
+ export type CommonActionConstants = Pick<MiniCartProps, 'ICONS' | 'MINICART_CONFIG'>;
97
+ export interface ActionsProps extends Pick<StepperProps, 'handleSendEvent'>, Pick<ButtonProps, 'size' | 'variant'>, CommonActionConstants {
98
+ product: CartItemStore;
99
+ }
100
+ export interface StepperProps {
101
+ handleSendEvent(event: string, type: 'productEvents' | 'skuEvents'): void;
102
+ product: CartItemStore;
103
+ MINICART_CONFIG: MINICART_CONFIGType;
104
+ }
105
+ export interface CardProps extends Pick<ActionsProps, 'product'>, Omit<SkuCardProps, 'product'>, CommonActionConstants {
106
+ index: number;
107
+ available: boolean;
108
+ }
109
+ export type StyleCardProps = {
110
+ product: CartItemStore;
111
+ TEXTURE_IMAGE: TEXTURE_IMAGEType;
112
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
113
+ };
114
+ export interface SkuCardProps extends StyleCardProps {
115
+ NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
116
+ }
117
+ export interface GiftProps extends Pick<CartItemStore, 'bundleItems' | 'offerings'>, CommonActionConstants {
118
+ uniqueId: string;
119
+ }
120
+ export interface WishlistActionProps extends ActionsProps {
121
+ handleSendEvent: StepperProps['handleSendEvent'];
122
+ onHandleRemove: (info: Record<string, string>, quantity: number, callback?: () => void) => void;
123
+ MINICART_CONFIG: MINICART_CONFIGType;
124
+ }
125
+ export interface CouponSellerProps {
126
+ type: 'coupon' | 'seller';
127
+ MINICART_CONFIG: MINICART_CONFIGType;
128
+ ICONS: ICONSType;
129
+ }
130
+ export interface InputProps extends Omit<FieldProps, 'MINICART_CONFIG'> {
131
+ feedback?: InputCustomProps['feedback'];
132
+ }
133
+ export interface FieldProps {
134
+ type?: 'cep' | 'coupon' | 'seller';
135
+ hasSuccess: boolean;
136
+ hasError: boolean;
137
+ isLoading: boolean;
138
+ onHandler(value: string): void;
139
+ title: string;
140
+ value: string | number;
141
+ MINICART_CONFIG: MINICART_CONFIGType;
142
+ ICONS: ICONSType;
143
+ }
144
+ export type DiscountProps = PropsWithChildren<{
145
+ className?: string;
146
+ ICONS: ICONSType;
147
+ MINICART_CONFIG: MINICART_CONFIGType;
148
+ }>;
149
+ export interface ResumeItemsProps {
150
+ discount: number;
151
+ shipping?: number;
152
+ total: number;
153
+ }
154
+ export interface ModalFooterProps extends PropsWithChildren {
155
+ storeConfig: StoreConfigType;
156
+ MINICART_CONFIG: MINICART_CONFIGType;
157
+ }
158
+ export interface ModalBodyProps extends PropsWithChildren {
159
+ ICONS: ICONSType;
160
+ MINICART_CONFIG: MINICART_CONFIGType;
161
+ NAME_SPLIT_SYMBOL: NAME_SPLIT_SYMBOLType;
162
+ TEXTURE_IMAGE: TEXTURE_IMAGEType;
163
+ TOGGLE_STYLE_MODIFIER: TOGGLE_STYLE_MODIFIERType;
164
+ PLP_NOT_RESULT: PLP_NOT_RESULTType;
165
+ }
166
+ export type ModalHeaderProps = {
167
+ ICONS: ICONSType;
168
+ MINICART_CONFIG: MINICART_CONFIGType;
169
+ };
170
+ export interface NotificationItemProps {
171
+ item: NotificationStore;
172
+ removeNotification: NotificationsStore['actions']['removeNotification'];
173
+ ICONS: ICONSType;
174
+ }
175
+ export type NotificationsProps = {
176
+ ICONS: ICONSType;
177
+ };
178
+ export type ShippingProps = {
179
+ ICONS: ICONSType;
180
+ MINICART_CONFIG: MINICART_CONFIGType;
181
+ };
182
+ export type CashbackProps = {
183
+ ICONS: ICONSType;
184
+ MESSAGE_CASHBACK: MESSAGE_CASHBACKType;
185
+ type?: 'positive' | 'alert';
186
+ };
187
+ export type FeedbackProps = {
188
+ ICONS: ICONSType;
189
+ MINICART_CONFIG: MINICART_CONFIGType;
190
+ PLP_NOT_RESULT: PLP_NOT_RESULTType;
191
+ };
192
+ export {};