@plurix/ecom-components 0.0.2-beta.2 → 0.0.2-beta.4

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 (166) hide show
  1. package/dist/assets/svgs/ArrowIcon.d.ts +9 -0
  2. package/dist/assets/svgs/ArrowIcon.js +37 -0
  3. package/dist/assets/svgs/CartEmptyCoupon.d.ts +1 -0
  4. package/dist/assets/svgs/CartEmptyCoupon.js +937 -0
  5. package/dist/assets/svgs/CloseIcon.d.ts +7 -1
  6. package/dist/assets/svgs/CloseIcon.js +13 -9
  7. package/dist/assets/svgs/CouponIcon.d.ts +4 -0
  8. package/dist/assets/svgs/CouponIcon.js +22 -0
  9. package/dist/assets/svgs/DeliveryExpressIcon.d.ts +1 -0
  10. package/dist/assets/svgs/DeliveryExpressIcon.js +21 -0
  11. package/dist/assets/svgs/DeliveryIcon.d.ts +1 -0
  12. package/dist/assets/svgs/DeliveryIcon.js +21 -0
  13. package/dist/assets/svgs/ErrorIcon.d.ts +5 -0
  14. package/dist/assets/svgs/ErrorIcon.js +29 -0
  15. package/dist/assets/svgs/GlassIcon.d.ts +1 -0
  16. package/dist/assets/svgs/GlassIcon.js +23 -0
  17. package/dist/assets/svgs/InfoIcon.d.ts +6 -0
  18. package/dist/assets/svgs/InfoIcon.js +47 -0
  19. package/dist/assets/svgs/NoCouponIcon.d.ts +1 -0
  20. package/dist/assets/svgs/NoCouponIcon.js +107 -0
  21. package/dist/assets/svgs/ShoppingBagsIcon.d.ts +1 -0
  22. package/dist/assets/svgs/ShoppingBagsIcon.js +30 -0
  23. package/dist/assets/svgs/ShoppingIcon.d.ts +1 -0
  24. package/dist/assets/svgs/ShoppingIcon.js +21 -0
  25. package/dist/assets/svgs/SuccessIcon.d.ts +6 -0
  26. package/dist/assets/svgs/SuccessIcon.js +38 -0
  27. package/dist/assets/svgs/WarningIcon.d.ts +1 -0
  28. package/dist/assets/svgs/WarningIcon.js +25 -0
  29. package/dist/main.d.ts +5 -0
  30. package/dist/main.js +11 -3
  31. package/dist/packages/Carousel/Carousel.d.ts +24 -0
  32. package/dist/packages/Carousel/Carousel.js +128 -0
  33. package/dist/packages/Carousel/components/Arrows.d.ts +8 -0
  34. package/dist/packages/Carousel/components/Arrows.js +43 -0
  35. package/dist/packages/Carousel/components/Bullets.d.ts +7 -0
  36. package/dist/packages/Carousel/components/Bullets.js +5 -0
  37. package/dist/packages/Carousel/test/Carrousel.test.js +80 -0
  38. package/dist/packages/Carousel/utils/defaultProps.d.ts +19 -0
  39. package/dist/packages/Carousel/utils/defaultProps.js +22 -0
  40. package/dist/packages/Coupons/Coupons.d.ts +14 -0
  41. package/dist/packages/Coupons/Coupons.js +100 -0
  42. package/dist/packages/Coupons/api/addCoupon.d.ts +3 -0
  43. package/dist/packages/Coupons/api/addCoupon.js +14 -0
  44. package/dist/packages/Coupons/api/getCoupons.d.ts +3 -0
  45. package/dist/packages/Coupons/api/getCoupons.js +15 -0
  46. package/dist/packages/Coupons/api/removeCoupon.d.ts +3 -0
  47. package/dist/packages/Coupons/api/removeCoupon.js +13 -0
  48. package/dist/packages/Coupons/components/Alert.d.ts +6 -0
  49. package/dist/packages/Coupons/components/Alert.js +13 -0
  50. package/dist/packages/Coupons/components/Breadcrumb.d.ts +6 -0
  51. package/dist/packages/Coupons/components/Breadcrumb.js +33 -0
  52. package/dist/packages/Coupons/components/CouponCard.d.ts +25 -0
  53. package/dist/packages/Coupons/components/CouponCard.js +132 -0
  54. package/dist/packages/Coupons/components/Modal.d.ts +8 -0
  55. package/dist/packages/Coupons/components/Modal.js +34 -0
  56. package/dist/packages/Coupons/components/ModalFooter.d.ts +8 -0
  57. package/dist/packages/Coupons/components/ModalFooter.js +14 -0
  58. package/dist/packages/Coupons/components/ModalHeader.d.ts +6 -0
  59. package/dist/packages/Coupons/components/ModalHeader.js +25 -0
  60. package/dist/packages/Coupons/components/NoCoupons.d.ts +1 -0
  61. package/dist/packages/Coupons/components/NoCoupons.js +10 -0
  62. package/dist/packages/Coupons/test/Alert.test.js +18 -0
  63. package/dist/packages/Coupons/test/Breadcrumb.test.js +41 -0
  64. package/dist/packages/Coupons/test/ModalFooter.test.js +32 -0
  65. package/dist/packages/Coupons/test/ModalHeader.test.js +23 -0
  66. package/dist/packages/Coupons/test/NoCoupons.test.js +17 -0
  67. package/dist/packages/Coupons/types/CouponType.d.ts +8 -0
  68. package/dist/packages/Coupons/types/CouponType.js +1 -0
  69. package/dist/packages/Coupons/types/SetOrderFormCouponResponse.d.ts +10 -0
  70. package/dist/packages/Coupons/types/SetOrderFormCouponResponse.js +1 -0
  71. package/dist/packages/Coupons/types/Views.d.ts +1 -0
  72. package/dist/packages/Coupons/types/Views.js +1 -0
  73. package/dist/packages/Coupons/views/CouponsView.d.ts +13 -0
  74. package/dist/packages/Coupons/views/CouponsView.js +122 -0
  75. package/dist/packages/Coupons/views/EmptyCartView.d.ts +6 -0
  76. package/dist/packages/Coupons/views/EmptyCartView.js +37 -0
  77. package/dist/packages/Coupons/views/LoadingView.d.ts +7 -0
  78. package/dist/packages/Coupons/views/LoadingView.js +39 -0
  79. package/dist/packages/Coupons/views/OverwriteView.d.ts +14 -0
  80. package/dist/packages/Coupons/views/OverwriteView.js +58 -0
  81. package/dist/packages/Coupons/views/RulesView.d.ts +13 -0
  82. package/dist/packages/Coupons/views/RulesView.js +49 -0
  83. package/dist/packages/Coupons/views/index.d.ts +5 -0
  84. package/dist/packages/Coupons/views/index.js +12 -0
  85. package/dist/packages/Regionalization/Regionalization.d.ts +3 -0
  86. package/dist/packages/Regionalization/Regionalization.js +93 -0
  87. package/dist/packages/Regionalization/components/Delivery.d.ts +24 -0
  88. package/dist/packages/Regionalization/components/Delivery.js +48 -0
  89. package/dist/packages/Regionalization/components/DeliveryExpress.d.ts +9 -0
  90. package/dist/packages/Regionalization/components/DeliveryExpress.js +25 -0
  91. package/dist/packages/Regionalization/components/InfoPrices.d.ts +9 -0
  92. package/dist/packages/Regionalization/components/InfoPrices.js +15 -0
  93. package/dist/packages/Regionalization/components/Navigation.d.ts +6 -0
  94. package/dist/packages/Regionalization/components/Navigation.js +59 -0
  95. package/dist/packages/Regionalization/components/NormalDelivery.d.ts +7 -0
  96. package/dist/packages/Regionalization/components/NormalDelivery.js +23 -0
  97. package/dist/packages/Regionalization/components/PickupPoint.d.ts +7 -0
  98. package/dist/packages/Regionalization/components/PickupPoint.js +32 -0
  99. package/dist/packages/Regionalization/components/Price.d.ts +7 -0
  100. package/dist/packages/Regionalization/components/Price.js +10 -0
  101. package/dist/packages/Regionalization/components/SetViewButton.d.ts +11 -0
  102. package/dist/packages/Regionalization/components/SetViewButton.js +24 -0
  103. package/dist/packages/Regionalization/components/Title.d.ts +8 -0
  104. package/dist/packages/Regionalization/components/Title.js +21 -0
  105. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +4 -0
  106. package/dist/packages/Regionalization/context/RegionalizationContext.js +113 -0
  107. package/dist/packages/Regionalization/types/Address.d.ts +13 -0
  108. package/dist/packages/Regionalization/types/Address.js +1 -0
  109. package/dist/packages/Regionalization/types/ContextProps.d.ts +29 -0
  110. package/dist/packages/Regionalization/types/ContextProps.js +1 -0
  111. package/dist/packages/Regionalization/types/PikcupPointType.d.ts +22 -0
  112. package/dist/packages/Regionalization/types/PikcupPointType.js +1 -0
  113. package/dist/packages/Regionalization/types/PricesAndHours.d.ts +13 -0
  114. package/dist/packages/Regionalization/types/PricesAndHours.js +1 -0
  115. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +87 -0
  116. package/dist/packages/Regionalization/types/RegionalizationProps.js +1 -0
  117. package/dist/packages/Regionalization/types/index.d.ts +5 -0
  118. package/dist/packages/Regionalization/types/index.js +1 -0
  119. package/dist/packages/Regionalization/utils/constants.d.ts +1 -0
  120. package/dist/packages/Regionalization/utils/constants.js +4 -0
  121. package/dist/packages/Regionalization/utils/deliverySetData.d.ts +3 -0
  122. package/dist/packages/Regionalization/utils/deliverySetData.js +13 -0
  123. package/dist/packages/Regionalization/utils/formatPrice.d.ts +1 -0
  124. package/dist/packages/Regionalization/utils/formatPrice.js +8 -0
  125. package/dist/packages/Regionalization/utils/localStorage.d.ts +9 -0
  126. package/dist/packages/Regionalization/utils/localStorage.js +23 -0
  127. package/dist/packages/Regionalization/utils/pickupSetData.d.ts +3 -0
  128. package/dist/packages/Regionalization/utils/pickupSetData.js +11 -0
  129. package/dist/packages/Regionalization/utils/postalCode.d.ts +2 -0
  130. package/dist/packages/Regionalization/utils/postalCode.js +9 -0
  131. package/dist/packages/Regionalization/views/AllStoresScreen.d.ts +1 -0
  132. package/dist/packages/Regionalization/views/AllStoresScreen.js +73 -0
  133. package/dist/packages/Regionalization/views/ConfirmScreen.d.ts +1 -0
  134. package/dist/packages/Regionalization/views/ConfirmScreen.js +60 -0
  135. package/dist/packages/Regionalization/views/InitialView.d.ts +1 -0
  136. package/dist/packages/Regionalization/views/InitialView.js +49 -0
  137. package/dist/packages/Regionalization/views/MoreInfosScreen.d.ts +1 -0
  138. package/dist/packages/Regionalization/views/MoreInfosScreen.js +42 -0
  139. package/dist/packages/Regionalization/views/PickupPointInfoScreen.d.ts +1 -0
  140. package/dist/packages/Regionalization/views/PickupPointInfoScreen.js +42 -0
  141. package/dist/packages/Regionalization/views/PostalCodeInputScreen.d.ts +1 -0
  142. package/dist/packages/Regionalization/views/PostalCodeInputScreen.js +87 -0
  143. package/dist/packages/Regionalization/views/ViewsContainer.d.ts +1 -0
  144. package/dist/packages/Regionalization/views/ViewsContainer.js +22 -0
  145. package/dist/packages/Tour/Tour.d.ts +10 -0
  146. package/dist/packages/Tour/Tour.js +68 -0
  147. package/dist/packages/Tour/components/TooltipFooter.d.ts +11 -0
  148. package/dist/packages/Tour/components/TooltipFooter.js +14 -0
  149. package/dist/packages/Tour/components/TooltipHeader.d.ts +8 -0
  150. package/dist/packages/Tour/components/TooltipHeader.js +13 -0
  151. package/dist/packages/Tour/components/TourOverlay.d.ts +7 -0
  152. package/dist/packages/Tour/components/TourOverlay.js +12 -0
  153. package/dist/packages/Tour/components/TourTooltip.d.ts +17 -0
  154. package/dist/packages/Tour/components/TourTooltip.js +42 -0
  155. package/dist/packages/Tour/test/TooltipFooter.test.js +68 -0
  156. package/dist/packages/Tour/test/TooltipHeader.test.js +18 -0
  157. package/dist/packages/Tour/test/Tour.test.js +49 -0
  158. package/dist/packages/Tour/test/TourOverlay.test.js +18 -0
  159. package/dist/packages/Tour/test/TourTooltip.test.js +40 -0
  160. package/dist/packages/Tour/types/TourStep.d.ts +4 -0
  161. package/dist/packages/Tour/types/TourStep.js +1 -0
  162. package/dist/styles/carousel.global.css +1 -0
  163. package/dist/styles/coupons.global.css +1 -0
  164. package/dist/styles/regionalization.global.css +1 -0
  165. package/dist/styles/tour.global.css +1 -0
  166. package/package.json +5 -1
@@ -0,0 +1,113 @@
1
+ import { jsx as Z } from "react/jsx-runtime";
2
+ import { createContext as _, useState as e, useEffect as M, useContext as ee } from "react";
3
+ import { removeSpecialCharacter as oe } from "../utils/postalCode.js";
4
+ import { getFullLocalStorage as c } from "../utils/localStorage.js";
5
+ const v = _(null), ae = ({
6
+ setMethod: o,
7
+ setPickupName: C,
8
+ setCity: p,
9
+ setUf: x,
10
+ setPickupTimes: y,
11
+ pricesAndHours: R,
12
+ setModalOpen: w,
13
+ inputPostalCode: l,
14
+ setInputPostalCode: D,
15
+ sendPostalCode: d,
16
+ status: I,
17
+ setStatus: i,
18
+ priceStockInformation: T = "",
19
+ pickupPoints: b,
20
+ titleText: z,
21
+ moreInfosText: P,
22
+ textBackButton: S,
23
+ confirmButton: h,
24
+ editAddress: H,
25
+ delivery: V,
26
+ deliveryPrice: k,
27
+ pickup: q,
28
+ regionalizeCatalog: E,
29
+ pickupConfirmScreenText: W,
30
+ children: j
31
+ }) => {
32
+ const [B, u] = e(), [F, g] = e("InitialView"), [L, m] = e(""), [Q, $] = e(), [s, A] = e(), [G, f] = e(), [J, K] = e(), [N, O] = e(!1), U = {
33
+ openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) ?? "",
34
+ closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) ?? ""
35
+ }, X = async () => {
36
+ i({ loading: !0, message: "Carregando..." });
37
+ const {
38
+ isValid: n,
39
+ address: t,
40
+ deliveryInfos: a,
41
+ customShipping: r
42
+ } = await d();
43
+ n && (i({ loading: !1 }), u("delivery"), $(t), i({}), m(l), f(a), g("ConfirmScreen"), K(r));
44
+ }, Y = () => {
45
+ /\d{8}$/.test(
46
+ oe(l)
47
+ ) ? X() : i({
48
+ status: "failed",
49
+ loading: !1,
50
+ message: "Que Pena, ainda não entregamos na sua região."
51
+ });
52
+ };
53
+ return M(() => {
54
+ var n, t, a, r;
55
+ m((t = (n = c()) == null ? void 0 : n.userAddressInfos) == null ? void 0 : t.postalCode), o == null || o((a = c()) == null ? void 0 : a.regionalized), f((r = c()) == null ? void 0 : r.deliveryInfos);
56
+ }, []), /* @__PURE__ */ Z(
57
+ v.Provider,
58
+ {
59
+ value: {
60
+ backToDelivery: N,
61
+ setBackToDelivery: O,
62
+ setMethod: o,
63
+ priceStockInformation: T,
64
+ setPickupName: C,
65
+ setCity: p,
66
+ setUf: x,
67
+ setPickupTimes: y,
68
+ pickupTimes: U,
69
+ pickupConfirmScreenText: W,
70
+ pricesAndHours: R,
71
+ setModalOpen: w,
72
+ inputPostalCode: l,
73
+ setInputPostalCode: D,
74
+ sendPostalCode: d,
75
+ status: I,
76
+ setStatus: i,
77
+ pickupPoints: b,
78
+ titleText: z,
79
+ moreInfosText: P,
80
+ customShippingData: J,
81
+ textBackButton: S,
82
+ confirmButton: h,
83
+ editAddress: H,
84
+ delivery: V,
85
+ pickup: q,
86
+ view: F,
87
+ setView: g,
88
+ postalCodeValidation: Y,
89
+ address: Q,
90
+ pickupAddress: s,
91
+ setPickupAddress: A,
92
+ deliveryRequestInfos: G,
93
+ postalCode: L,
94
+ internalMethod: B,
95
+ setInternalMethod: u,
96
+ regionalizeCatalog: E,
97
+ deliveryPrice: k
98
+ },
99
+ children: j
100
+ }
101
+ );
102
+ }, re = () => {
103
+ const o = ee(v);
104
+ if (!o)
105
+ throw new Error(
106
+ "useRegionalizationContext must be used within a RegionalizationContextProvider"
107
+ );
108
+ return o;
109
+ };
110
+ export {
111
+ ae as RegionalizationContextProvider,
112
+ re as useRegionalizationContext
113
+ };
@@ -0,0 +1,13 @@
1
+ export interface Address {
2
+ cep: string;
3
+ logradouro: string;
4
+ complemento: string;
5
+ bairro: string;
6
+ localidade: string;
7
+ uf: string;
8
+ ibge: string;
9
+ gia: string;
10
+ ddd: string;
11
+ siafi: string;
12
+ error?: string;
13
+ }
@@ -0,0 +1,29 @@
1
+ import { Address } from './Address';
2
+ import { BusinessHours, PikcupPointType } from './PikcupPointType';
3
+ import { CustomShippingProps } from './RegionalizationProps';
4
+
5
+ export interface ContextProps {
6
+ view?: View;
7
+ setView?: (view: View) => void;
8
+ postalCodeValidation?: () => void;
9
+ address?: Address;
10
+ pickupAddress?: PikcupPointType;
11
+ setPickupAddress?: (pickupAddress: PikcupPointType) => void;
12
+ deliveryRequestInfos?: DeliveryProps;
13
+ postalCode?: string;
14
+ internalMethod?: string;
15
+ setInternalMethod?: (method?: string) => void;
16
+ pickupTimes?: BusinessHours;
17
+ customShippingData?: CustomShippingProps;
18
+ }
19
+ export interface DeliveryProps {
20
+ deliveryChannel?: string;
21
+ deliveryName?: string;
22
+ shippingEstimate?: string;
23
+ }
24
+ export type View = 'PickupPointInfoScreen' | 'InitialView' | 'PostalCodeInputScreen' | 'MoreInfosScreen' | 'ConfirmScreen' | 'AllStoresScreen';
25
+ export interface UserAddressProps {
26
+ postalCode?: string;
27
+ city?: string;
28
+ uf?: string;
29
+ }
@@ -0,0 +1,22 @@
1
+ export interface PikcupPointType {
2
+ id: string;
3
+ name: string;
4
+ address: {
5
+ postalCode: string;
6
+ city: string;
7
+ state: string;
8
+ neighborhood: string;
9
+ street: string;
10
+ number: string;
11
+ };
12
+ isActive: boolean;
13
+ businessHours: {
14
+ businessHoursWeek: BusinessHours;
15
+ businessHoursWeekend: BusinessHours;
16
+ };
17
+ }
18
+ export interface BusinessHours {
19
+ dayOfWeek?: number;
20
+ openingTime: string;
21
+ closingTime: string;
22
+ }
@@ -0,0 +1,13 @@
1
+ export interface PricesAndHours {
2
+ deliveryStartPrice: number;
3
+ pickupStartPrice: number;
4
+ pickupScheduling: number;
5
+ deliveryTimeWeekday: {
6
+ start: number;
7
+ end: number;
8
+ };
9
+ deliveryTimeWeekEndAndHolidays: {
10
+ start: number;
11
+ end: number;
12
+ };
13
+ }
@@ -0,0 +1,87 @@
1
+ import { ReactNode } from 'react';
2
+ import { Address } from './Address';
3
+ import { PricesAndHours } from './PricesAndHours';
4
+ import { DeliveryProps } from './ContextProps';
5
+ import { BusinessHours, PikcupPointType } from './PikcupPointType';
6
+
7
+ export interface CustomShippingProps {
8
+ shippingList?: {
9
+ id: string;
10
+ name: string;
11
+ shippingEstimate: string;
12
+ listPrice: number;
13
+ }[];
14
+ isExpressEligible?: boolean;
15
+ expressShippingCmsQuantity?: string;
16
+ }
17
+ export interface RegionalizationProps {
18
+ backToDelivery?: boolean;
19
+ setBackToDelivery?: (backToDelivery: boolean) => void;
20
+ pickupConfirmScreenText?: string;
21
+ deliveryPrice?: number;
22
+ setMethod?: (method?: string) => void;
23
+ setPickupName?: (pickupName?: string) => void;
24
+ setCity?: (city?: string) => void;
25
+ setUf?: (uf?: string) => void;
26
+ setPickupTimes?: (pickupTimes?: BusinessHours) => void;
27
+ pricesAndHours: PricesAndHours;
28
+ setModalOpen: (modalOpen: boolean) => void;
29
+ inputPostalCode: string;
30
+ setInputPostalCode: (value: string) => void;
31
+ sendPostalCode: () => Promise<{
32
+ isValid?: boolean;
33
+ address?: Address;
34
+ deliveryInfos?: DeliveryProps;
35
+ customShipping?: CustomShippingProps;
36
+ }>;
37
+ status: Status;
38
+ setStatus: (status: Status) => void;
39
+ pickupPoints: PikcupPointType[];
40
+ titleText?: string;
41
+ priceStockInformation?: string;
42
+ moreInfosText?: string;
43
+ textBackButton?: string;
44
+ confirmButton?: string;
45
+ editAddress?: string;
46
+ delivery?: {
47
+ title?: string;
48
+ normalDelivery?: string;
49
+ expressDelivery?: string;
50
+ labelPrice?: string;
51
+ price?: number;
52
+ expressPrice?: number;
53
+ labelScheduling?: string;
54
+ scheduling?: string;
55
+ normalScheduling?: string;
56
+ expressScheduling?: string;
57
+ expressMessage?: string;
58
+ searchButton?: string;
59
+ linkHref?: string;
60
+ linkText?: string;
61
+ titleOk?: string;
62
+ labelAddress?: string;
63
+ confirmButton?: string;
64
+ };
65
+ pickup?: {
66
+ title?: string;
67
+ labelPrice?: string;
68
+ price?: number;
69
+ labelScheduling?: string;
70
+ scheduling?: string;
71
+ buttonOpenStores?: string;
72
+ labelFilter?: string;
73
+ labelStores?: string;
74
+ divider?: string;
75
+ chooseStore?: string;
76
+ titleOk?: string;
77
+ labelAddress?: string;
78
+ confirmButton?: string;
79
+ };
80
+ regionalizeCatalog?: (postalCodeChoiced?: string) => void;
81
+ children?: ReactNode;
82
+ }
83
+ export interface Status {
84
+ status?: 'failed';
85
+ message?: string;
86
+ loading?: boolean;
87
+ }
@@ -0,0 +1,5 @@
1
+ export * from './Address';
2
+ export * from './ContextProps';
3
+ export * from './PikcupPointType';
4
+ export * from './PricesAndHours';
5
+ export * from './RegionalizationProps';
@@ -0,0 +1 @@
1
+ export declare const HAS_WINDOW: boolean;
@@ -0,0 +1,4 @@
1
+ const e = typeof window < "u";
2
+ export {
3
+ e as HAS_WINDOW
4
+ };
@@ -0,0 +1,3 @@
1
+ import { Address, DeliveryProps } from '../types';
2
+
3
+ export declare const deliverySetData: (address?: Address, deliveryRequestInfos?: DeliveryProps, postalCode?: string) => void;
@@ -0,0 +1,13 @@
1
+ import { setLocalStorage as g } from "./localStorage.js";
2
+ const c = (i, t, m) => {
3
+ const p = JSON.stringify({
4
+ city: String(i == null ? void 0 : i.localidade),
5
+ uf: String(i == null ? void 0 : i.uf),
6
+ deliveryName: String(t == null ? void 0 : t.deliveryName),
7
+ shippingEstimate: String(t == null ? void 0 : t.shippingEstimate)
8
+ });
9
+ g("postalCode", m ?? ""), g("method", "delivery"), g("deliveryInfos", p);
10
+ };
11
+ export {
12
+ c as deliverySetData
13
+ };
@@ -0,0 +1 @@
1
+ export declare const formatPrice: (price: number) => string;
@@ -0,0 +1,8 @@
1
+ const t = (r) => r <= 0 ? "Grátis" : r.toLocaleString("pt-BR", {
2
+ minimumFractionDigits: 2,
3
+ style: "currency",
4
+ currency: "BRL"
5
+ });
6
+ export {
7
+ t as formatPrice
8
+ };
@@ -0,0 +1,9 @@
1
+ import { UserAddressProps } from '../types';
2
+
3
+ export declare const setLocalStorage: (name: string, value: string) => void;
4
+ export declare const getLocalStorage: (name: string) => string | null | undefined;
5
+ export declare const getFullLocalStorage: () => {
6
+ regionalized: string | undefined;
7
+ deliveryInfos: any;
8
+ userAddressInfos: UserAddressProps;
9
+ };
@@ -0,0 +1,23 @@
1
+ import { HAS_WINDOW as a } from "./constants.js";
2
+ const n = (t, e) => {
3
+ a && localStorage.setItem(t, e);
4
+ }, s = (t) => {
5
+ if (a)
6
+ return localStorage.getItem(t);
7
+ }, d = () => {
8
+ const t = s("postalCode"), e = s("method"), o = JSON.parse(s("deliveryInfos") ?? "{}"), c = {
9
+ postalCode: t ?? "00000-000",
10
+ city: o == null ? void 0 : o.city,
11
+ uf: o == null ? void 0 : o.uf
12
+ }, r = e ?? void 0;
13
+ return {
14
+ regionalized: r,
15
+ deliveryInfos: r ? o : void 0,
16
+ userAddressInfos: c
17
+ };
18
+ };
19
+ export {
20
+ d as getFullLocalStorage,
21
+ s as getLocalStorage,
22
+ n as setLocalStorage
23
+ };
@@ -0,0 +1,3 @@
1
+ import { BusinessHours, PikcupPointType } from '../types';
2
+
3
+ export declare const pickupSetData: (pickupAddress?: PikcupPointType, pickupTimes?: BusinessHours) => void;
@@ -0,0 +1,11 @@
1
+ import { setLocalStorage as t } from "./localStorage.js";
2
+ const S = (o, n) => {
3
+ const a = JSON.stringify({
4
+ pickupTimes: n,
5
+ pickupPointName: String(o == null ? void 0 : o.name)
6
+ });
7
+ t("postalCode", String(o == null ? void 0 : o.address.postalCode)), t("method", "pickup-in-point"), t("pickupInfos", a);
8
+ };
9
+ export {
10
+ S as pickupSetData
11
+ };
@@ -0,0 +1,2 @@
1
+ export declare const postalCodeMask: (e: any) => any;
2
+ export declare const removeSpecialCharacter: (value: string) => string;
@@ -0,0 +1,9 @@
1
+ const t = (e) => {
2
+ e.currentTarget.maxLength = 9;
3
+ let r = e.currentTarget.value;
4
+ return r = r.replace(/^(\d{5})(\d)/, "$1-$2"), e.currentTarget.value = r, e;
5
+ }, a = (e) => e.replace(/\D/g, "");
6
+ export {
7
+ t as postalCodeMask,
8
+ a as removeSpecialCharacter
9
+ };
@@ -0,0 +1 @@
1
+ export declare const AllStoresScreen: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,73 @@
1
+ import { jsxs as o, Fragment as h, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as f, useState as v, useEffect as b } from "react";
3
+ import { Title as S } from "../components/Title.js";
4
+ import { PickupPoint as w } from "../components/PickupPoint.js";
5
+ import { GlassIcon as x } from "../../../assets/svgs/GlassIcon.js";
6
+ import { SetViewButton as N } from "../components/SetViewButton.js";
7
+ import { ArrowIcon as u } from "../../../assets/svgs/ArrowIcon.js";
8
+ import { useRegionalizationContext as C } from "../context/RegionalizationContext.js";
9
+ const E = () => {
10
+ const { pickup: t, pickupPoints: l, textBackButton: d } = C(), s = f(null), [n, a] = v(l), m = l.length > 0 ? l : [];
11
+ b(() => {
12
+ a(m);
13
+ }, [l]);
14
+ const i = () => {
15
+ a(
16
+ l == null ? void 0 : l.filter(
17
+ ({ name: r }) => {
18
+ var c;
19
+ return r.toLowerCase().includes(((c = s.current) == null ? void 0 : c.value.toLowerCase()) ?? "");
20
+ }
21
+ )
22
+ );
23
+ };
24
+ return /* @__PURE__ */ o(h, { children: [
25
+ /* @__PURE__ */ e(S, { title: t == null ? void 0 : t.title }),
26
+ /* @__PURE__ */ o("div", { className: "stores-filter", children: [
27
+ /* @__PURE__ */ e("p", { children: t == null ? void 0 : t.labelFilter }),
28
+ /* @__PURE__ */ o("div", { children: [
29
+ /* @__PURE__ */ e(
30
+ "input",
31
+ {
32
+ type: "text",
33
+ placeholder: "Loja",
34
+ ref: s,
35
+ onKeyDown: (r) => r.key === "Enter" && i()
36
+ }
37
+ ),
38
+ /* @__PURE__ */ e(
39
+ "button",
40
+ {
41
+ className: "filter-ico-container",
42
+ onClick: () => i(),
43
+ children: /* @__PURE__ */ e(x, {})
44
+ }
45
+ )
46
+ ] }),
47
+ /* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: t == null ? void 0 : t.divider }) })
48
+ ] }),
49
+ /* @__PURE__ */ e("p", { className: "stores-label", children: t == null ? void 0 : t.labelStores }),
50
+ /* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ e(
51
+ w,
52
+ {
53
+ pickupPointInfos: r
54
+ },
55
+ r == null ? void 0 : r.id
56
+ )) }),
57
+ /* @__PURE__ */ e("br", {}),
58
+ /* @__PURE__ */ o(
59
+ N,
60
+ {
61
+ view: "PickupPointInfoScreen",
62
+ className: "back-button-all-store",
63
+ children: [
64
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(u, {}) }),
65
+ d
66
+ ]
67
+ }
68
+ )
69
+ ] });
70
+ };
71
+ export {
72
+ E as AllStoresScreen
73
+ };
@@ -0,0 +1 @@
1
+ export declare const ConfirmScreen: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
1
+ import { jsxs as o, Fragment as m, jsx as n } from "react/jsx-runtime";
2
+ import { Title as f } from "../components/Title.js";
3
+ import { SetViewButton as g } from "../components/SetViewButton.js";
4
+ import { InfoPrices as C } from "../components/InfoPrices.js";
5
+ import { Navigation as N } from "../components/Navigation.js";
6
+ import { Delivery as b } from "../components/Delivery.js";
7
+ import { useRegionalizationContext as v } from "../context/RegionalizationContext.js";
8
+ const I = () => {
9
+ const {
10
+ editAddress: s,
11
+ delivery: i,
12
+ pickup: e,
13
+ address: t,
14
+ pickupAddress: r,
15
+ internalMethod: l,
16
+ pickupTimes: a,
17
+ pickupConfirmScreenText: c
18
+ } = v(), d = `Retiradas entre ${(a == null ? void 0 : a.openingTime) ?? "08"}h e ${(a == null ? void 0 : a.closingTime) ?? "20"}h, ou agendada`, h = c && c !== "" ? c : d;
19
+ return /* @__PURE__ */ o(m, { children: [
20
+ /* @__PURE__ */ n(
21
+ f,
22
+ {
23
+ title: l === "delivery" ? i == null ? void 0 : i.titleOk : e == null ? void 0 : e.titleOk
24
+ }
25
+ ),
26
+ /* @__PURE__ */ o("div", { className: "address-container", children: [
27
+ /* @__PURE__ */ o("p", { className: "address-title", children: [
28
+ /* @__PURE__ */ n("span", { children: l === "delivery" ? i == null ? void 0 : i.labelAddress : e == null ? void 0 : e.labelAddress }),
29
+ /* @__PURE__ */ n(g, { view: "PostalCodeInputScreen", className: "edit-button", children: s })
30
+ ] }),
31
+ l === "delivery" ? /* @__PURE__ */ o(m, { children: [
32
+ /* @__PURE__ */ n("span", { children: t == null ? void 0 : t.cep }),
33
+ /* @__PURE__ */ n("span", { className: "address-delivery", children: (t == null ? void 0 : t.logradouro) ?? (t == null ? void 0 : t.localidade) })
34
+ ] }) : /* @__PURE__ */ o(m, { children: [
35
+ /* @__PURE__ */ n("span", { children: r == null ? void 0 : r.name }),
36
+ /* @__PURE__ */ o("p", { className: "address-pickup", children: [
37
+ r == null ? void 0 : r.address.street,
38
+ ", ",
39
+ r == null ? void 0 : r.address.number,
40
+ /* @__PURE__ */ n("br", {}),
41
+ r == null ? void 0 : r.address.neighborhood
42
+ ] })
43
+ ] })
44
+ ] }),
45
+ l === "delivery" ? /* @__PURE__ */ n(b, { delivery: i, containerClassName: "delivery-container" }) : /* @__PURE__ */ n(
46
+ C,
47
+ {
48
+ containerClassName: "pickup-container",
49
+ priceClassName: "pickup-price",
50
+ labelPrice: e == null ? void 0 : e.labelPrice,
51
+ price: e == null ? void 0 : e.price,
52
+ scheduling: h
53
+ }
54
+ ),
55
+ /* @__PURE__ */ n(N, { pickuConfirmScreem: l !== "delivery" })
56
+ ] });
57
+ };
58
+ export {
59
+ I as ConfirmScreen
60
+ };
@@ -0,0 +1 @@
1
+ export declare const InitialView: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,49 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { useEffect as p } from "react";
3
+ import { Title as f } from "../components/Title.js";
4
+ import { SetViewButton as t } from "../components/SetViewButton.js";
5
+ import { ArrowIcon as d } from "../../../assets/svgs/ArrowIcon.js";
6
+ import { ShoppingBagsIcon as h } from "../../../assets/svgs/ShoppingBagsIcon.js";
7
+ import { ShoppingIcon as I } from "../../../assets/svgs/ShoppingIcon.js";
8
+ import { useRegionalizationContext as u } from "../context/RegionalizationContext.js";
9
+ import { formatPrice as v } from "../utils/formatPrice.js";
10
+ const R = () => {
11
+ const {
12
+ titleText: c,
13
+ moreInfosText: a,
14
+ deliveryPrice: m,
15
+ priceStockInformation: s,
16
+ backToDelivery: n,
17
+ setBackToDelivery: r,
18
+ status: o,
19
+ setStatus: l
20
+ } = u();
21
+ return p(() => {
22
+ n && (r == null || r(!1)), (o == null ? void 0 : o.status) === "failed" && l({});
23
+ }, [n, o]), /* @__PURE__ */ i("div", { className: "inital-view-container", children: [
24
+ /* @__PURE__ */ e(f, { title: c }),
25
+ /* @__PURE__ */ e("p", { className: "price-stock-information", children: s }),
26
+ /* @__PURE__ */ i(t, { view: "MoreInfosScreen", className: "more-infos-button", children: [
27
+ a,
28
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(d, {}) })
29
+ ] }),
30
+ /* @__PURE__ */ i("div", { className: "delivery-option-container", children: [
31
+ /* @__PURE__ */ i(t, { view: "PostalCodeInputScreen", className: "option", children: [
32
+ /* @__PURE__ */ e(h, {}),
33
+ /* @__PURE__ */ e("h4", { children: "Receber em casa" }),
34
+ /* @__PURE__ */ i("p", { children: [
35
+ " A partir de ",
36
+ v(m ?? 0)
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ i(t, { view: "PickupPointInfoScreen", className: "option", children: [
40
+ /* @__PURE__ */ e(I, {}),
41
+ /* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
42
+ /* @__PURE__ */ e("p", { children: " Grátis" })
43
+ ] })
44
+ ] })
45
+ ] });
46
+ };
47
+ export {
48
+ R as InitialView
49
+ };
@@ -0,0 +1 @@
1
+ export declare const MoreInfosScreen: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { jsxs as o, Fragment as s, jsx as e } from "react/jsx-runtime";
2
+ import { Title as a } from "../components/Title.js";
3
+ import { Navigation as d } from "../components/Navigation.js";
4
+ import { useRegionalizationContext as m } from "../context/RegionalizationContext.js";
5
+ const i = ({ text: t, startHour: r, endHour: n }) => /* @__PURE__ */ o("div", { className: "opening-hours-container", children: [
6
+ /* @__PURE__ */ e("p", { children: t }),
7
+ /* @__PURE__ */ o("span", { children: [
8
+ "Das ",
9
+ r,
10
+ "h até às ",
11
+ n,
12
+ "h"
13
+ ] })
14
+ ] }), x = () => {
15
+ const {
16
+ moreInfosText: t,
17
+ pricesAndHours: { deliveryTimeWeekday: r, deliveryTimeWeekEndAndHolidays: n }
18
+ } = m();
19
+ return /* @__PURE__ */ o(s, { children: [
20
+ /* @__PURE__ */ e(a, { title: t, view: "InitialView" }),
21
+ /* @__PURE__ */ e(
22
+ i,
23
+ {
24
+ text: "Segunda a Sexta:",
25
+ startHour: r.start,
26
+ endHour: r.end
27
+ }
28
+ ),
29
+ /* @__PURE__ */ e(
30
+ i,
31
+ {
32
+ text: "Fins de Semana e Feriados:",
33
+ startHour: n.start,
34
+ endHour: n.end
35
+ }
36
+ ),
37
+ /* @__PURE__ */ e(d, { moreInfosScreen: !0 })
38
+ ] });
39
+ };
40
+ export {
41
+ x as MoreInfosScreen
42
+ };
@@ -0,0 +1 @@
1
+ export declare const PickupPointInfoScreen: () => import("react/jsx-runtime").JSX.Element;