@plurix/ecom-components 1.19.1 → 1.19.3

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.
@@ -1,59 +1,61 @@
1
- import { jsxs as x, jsx as v } from "react/jsx-runtime";
2
- import { SetViewButton as d } from "./SetViewButton.js";
1
+ import { jsxs as s, jsx as v } from "react/jsx-runtime";
2
+ import { SetViewButton as w } from "./SetViewButton.js";
3
3
  import { ArrowIcon as C } from "../../../assets/svgs/ArrowIcon.js";
4
4
  import { useRegionalizationContext as N } from "../context/RegionalizationContext.js";
5
5
  import { deliverySetData as V } from "../utils/deliverySetData.js";
6
6
  import { pickupSetData as j } from "../utils/pickupSetData.js";
7
- const F = ({
7
+ const E = ({
8
8
  moreInfosScreen: a,
9
- pickuConfirmScreem: h
9
+ pickuConfirmScreem: B
10
10
  }) => {
11
11
  const {
12
- confirmButton: s,
13
- textBackButton: I,
12
+ confirmButton: I,
13
+ textBackButton: x,
14
14
  delivery: e,
15
15
  pickup: l,
16
- pickupAddress: o,
16
+ pickupAddress: t,
17
17
  internalMethod: i,
18
18
  regionalizeCatalog: n,
19
- address: t,
20
- deliveryRequestInfos: S,
21
- postalCode: p,
19
+ address: o,
20
+ deliveryRequestInfos: h,
21
+ postalCode: d,
22
22
  setMethod: r,
23
23
  setCity: c,
24
24
  setUf: m,
25
- setPickupName: f,
26
- setPickupTimes: u,
27
- pickupTimes: w,
28
- setInputPostalCode: b
25
+ setPickupName: u,
26
+ setPickupTimes: f,
27
+ pickupTimes: b,
28
+ setInputPostalCode: S
29
29
  } = N();
30
- return /* @__PURE__ */ x("div", { className: "container-navigation", children: [
31
- /* @__PURE__ */ x(
32
- d,
30
+ return /* @__PURE__ */ s("div", { className: "container-navigation", children: [
31
+ /* @__PURE__ */ s(
32
+ w,
33
33
  {
34
- view: a ? "InitialView" : h ? "AllStoresScreen" : "PostalCodeInputScreen",
34
+ view: a ? "InitialView" : B ? "AllStoresScreen" : "PostalCodeInputScreen",
35
35
  className: "back-button",
36
+ dataTestId: "back-button",
36
37
  children: [
37
38
  /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(C, { color: "var(--color-main)" }) }),
38
- I
39
+ x
39
40
  ]
40
41
  }
41
42
  ),
42
43
  /* @__PURE__ */ v(
43
- d,
44
+ w,
44
45
  {
45
46
  view: "InitialView",
46
47
  closeModal: !a,
47
48
  className: "continue-button",
49
+ dataTestId: "continue-button",
48
50
  onClick: () => {
49
- var B;
50
- r == null || r(i), i === "delivery" && (V(t, S, p), c == null || c(t == null ? void 0 : t.localidade), m == null || m(t == null ? void 0 : t.uf), n == null || n(p)), i === "pickup-in-point" && (b(((B = o == null ? void 0 : o.address) == null ? void 0 : B.postalCode) || ""), j(o, w), f == null || f(o == null ? void 0 : o.name), u == null || u(w), n == null || n(o == null ? void 0 : o.address.postalCode));
51
+ var p;
52
+ r == null || r(i), i === "delivery" && (V(o, h, d), c == null || c(o == null ? void 0 : o.localidade), m == null || m(o == null ? void 0 : o.uf), n == null || n(d)), i === "pickup-in-point" && (S(((p = t == null ? void 0 : t.address) == null ? void 0 : p.postalCode) || ""), j(t, b), u == null || u(t == null ? void 0 : t.name), f == null || f(b), n == null || n(t == null ? void 0 : t.address.postalCode));
51
53
  },
52
- children: a ? s : i === "delivery" ? e == null ? void 0 : e.confirmButton : l == null ? void 0 : l.confirmButton
54
+ children: a ? I : i === "delivery" ? e == null ? void 0 : e.confirmButton : l == null ? void 0 : l.confirmButton
53
55
  }
54
56
  )
55
57
  ] });
56
58
  };
57
59
  export {
58
- F as Navigation
60
+ E as Navigation
59
61
  };
@@ -1,32 +1,40 @@
1
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { SetViewButton as h } from "./SetViewButton.js";
3
- import { useRegionalizationContext as u } from "../context/RegionalizationContext.js";
4
- const x = ({ pickupPointInfos: c }) => {
5
- const { pickup: i, setPickupAddress: n, setInternalMethod: e } = u(), { isActive: m, name: l, address: o } = c;
6
- return m ? /* @__PURE__ */ r("div", { className: "store-container", children: [
7
- /* @__PURE__ */ t("h3", { children: l }),
8
- /* @__PURE__ */ r("div", { children: [
9
- /* @__PURE__ */ r("p", { children: [
10
- o == null ? void 0 : o.street,
11
- ", ",
12
- o == null ? void 0 : o.number,
13
- /* @__PURE__ */ t("br", {}),
14
- o == null ? void 0 : o.neighborhood
15
- ] }),
16
- /* @__PURE__ */ t(
17
- h,
18
- {
19
- view: "ConfirmScreen",
20
- className: "choose-store",
21
- onClick: () => {
22
- e == null || e("pickup-in-point"), n == null || n(c);
23
- },
24
- children: i == null ? void 0 : i.chooseStore
25
- }
26
- )
27
- ] })
28
- ] }) : null;
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { SetViewButton as m } from "./SetViewButton.js";
3
+ import { useRegionalizationContext as h } from "../context/RegionalizationContext.js";
4
+ const d = ({ pickupPointInfos: c }) => {
5
+ const { pickup: i, setPickupAddress: o, setInternalMethod: e } = h(), { isActive: p, name: a, address: t } = c;
6
+ return p ? /* @__PURE__ */ n(
7
+ "div",
8
+ {
9
+ className: "store-container",
10
+ "data-testid": `pickup-point-container-${a}`,
11
+ children: [
12
+ /* @__PURE__ */ r("h3", { "data-testid": "pickup-point-name", children: a }),
13
+ /* @__PURE__ */ n("div", { children: [
14
+ /* @__PURE__ */ n("p", { "data-testid": "pickup-point-address", children: [
15
+ t == null ? void 0 : t.street,
16
+ ", ",
17
+ t == null ? void 0 : t.number,
18
+ /* @__PURE__ */ r("br", {}),
19
+ t == null ? void 0 : t.neighborhood
20
+ ] }),
21
+ /* @__PURE__ */ r(
22
+ m,
23
+ {
24
+ view: "ConfirmScreen",
25
+ className: "choose-store",
26
+ dataTestId: "choose-store",
27
+ onClick: () => {
28
+ e == null || e("pickup-in-point"), o == null || o(c);
29
+ },
30
+ children: i == null ? void 0 : i.chooseStore
31
+ }
32
+ )
33
+ ] })
34
+ ]
35
+ }
36
+ ) : null;
29
37
  };
30
38
  export {
31
- x as PickupPoint
39
+ d as PickupPoint
32
40
  };
@@ -6,6 +6,7 @@ interface SetViewButtonProps {
6
6
  closeModal?: boolean;
7
7
  className?: string;
8
8
  onClick?: () => void;
9
+ dataTestId?: string;
9
10
  }
10
- export declare const SetViewButton: ({ children, view, closeModal, className, onClick }: SetViewButtonProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const SetViewButton: ({ children, view, closeModal, className, onClick, dataTestId }: SetViewButtonProps) => import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -1,24 +1,26 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { useRegionalizationContext as m } from "../context/RegionalizationContext.js";
3
- const u = ({
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useRegionalizationContext as f } from "../context/RegionalizationContext.js";
3
+ const d = ({
4
4
  children: e,
5
5
  view: n,
6
- closeModal: r,
7
- className: a,
8
- onClick: o
6
+ closeModal: a,
7
+ className: r,
8
+ onClick: o,
9
+ dataTestId: i = "set-view-button"
9
10
  }) => {
10
- const { setModalOpen: f, setView: t } = m();
11
- return /* @__PURE__ */ i(
11
+ const { setModalOpen: s, setView: t } = f();
12
+ return /* @__PURE__ */ u(
12
13
  "button",
13
14
  {
15
+ "data-testid": i,
14
16
  onClick: () => {
15
- o == null || o(), r ? (t == null || t("InitialView"), f(!1)) : t == null || t(n);
17
+ o == null || o(), a ? (t == null || t("InitialView"), s(!1)) : t == null || t(n);
16
18
  },
17
- className: a,
19
+ className: r,
18
20
  children: e
19
21
  }
20
22
  );
21
23
  };
22
24
  export {
23
- u as SetViewButton
25
+ d as SetViewButton
24
26
  };
@@ -1,21 +1,22 @@
1
- import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { CloseIcon as l } from "../../../assets/svgs/CloseIcon.js";
1
+ import { jsxs as l, jsx as o } from "react/jsx-runtime";
2
+ import { CloseIcon as r } from "../../../assets/svgs/CloseIcon.js";
3
3
  import { useRegionalizationContext as s } from "../context/RegionalizationContext.js";
4
- const d = ({ title: n, view: i }) => {
5
- const { setModalOpen: e, setView: o } = s();
6
- return /* @__PURE__ */ r("div", { className: "title-container", children: [
7
- /* @__PURE__ */ t("h1", { children: n }),
8
- /* @__PURE__ */ t(
4
+ const m = ({ title: n, view: i }) => {
5
+ const { setModalOpen: e, setView: t } = s();
6
+ return /* @__PURE__ */ l("div", { className: "title-container", children: [
7
+ /* @__PURE__ */ o("h1", { children: n }),
8
+ /* @__PURE__ */ o(
9
9
  "button",
10
10
  {
11
+ "data-testid": "close-button",
11
12
  onClick: () => {
12
- o == null || o(i || "InitialView"), i || e(!1);
13
+ t == null || t(i || "InitialView"), i || e(!1);
13
14
  },
14
- children: /* @__PURE__ */ t(l, {})
15
+ children: /* @__PURE__ */ o(r, {})
15
16
  }
16
17
  )
17
18
  ] });
18
19
  };
19
20
  export {
20
- d as Title
21
+ m as Title
21
22
  };
@@ -1,38 +1,38 @@
1
1
  import { jsxs as o, Fragment as f, jsx as e } from "react/jsx-runtime";
2
- import { useRef as v, useState as b, useEffect as S } from "react";
3
- import { Title as w } from "../components/Title.js";
4
- import { PickupPoint as x } from "../components/PickupPoint.js";
5
- import { GlassIcon as N } from "../../../assets/svgs/GlassIcon.js";
6
- import { SetViewButton as u } from "../components/SetViewButton.js";
2
+ import { useRef as b, useState as v, useEffect as S } from "react";
3
+ import { Title as u } 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
7
  import { ArrowIcon as C } from "../../../assets/svgs/ArrowIcon.js";
8
8
  import { useRegionalizationContext as F } from "../context/RegionalizationContext.js";
9
- const z = () => {
10
- const { pickup: r, pickupPoints: l, textBackButton: d, disabledSearch: m } = F(), a = v(null), [n, s] = b(l), h = l.length > 0 ? l : [];
9
+ const T = () => {
10
+ const { pickup: t, pickupPoints: l, textBackButton: d, disabledSearch: m } = F(), n = b(null), [a, s] = v(l), h = l.length > 0 ? l : [];
11
11
  S(() => {
12
12
  s(h);
13
13
  }, [l]);
14
14
  const i = () => {
15
15
  s(
16
16
  l == null ? void 0 : l.filter(
17
- ({ name: t }) => {
17
+ ({ name: r }) => {
18
18
  var c;
19
- return t.toLowerCase().includes(((c = a.current) == null ? void 0 : c.value.toLowerCase()) || "");
19
+ return r.toLowerCase().includes(((c = n.current) == null ? void 0 : c.value.toLowerCase()) || "");
20
20
  }
21
21
  )
22
22
  );
23
23
  };
24
24
  return /* @__PURE__ */ o(f, { children: [
25
- /* @__PURE__ */ e(w, { title: r == null ? void 0 : r.title }),
25
+ /* @__PURE__ */ e(u, { title: t == null ? void 0 : t.title }),
26
26
  !m && /* @__PURE__ */ o("div", { className: "stores-filter", children: [
27
- /* @__PURE__ */ e("p", { children: r == null ? void 0 : r.labelFilter }),
27
+ /* @__PURE__ */ e("p", { children: t == null ? void 0 : t.labelFilter }),
28
28
  /* @__PURE__ */ o("div", { children: [
29
29
  /* @__PURE__ */ e(
30
30
  "input",
31
31
  {
32
32
  type: "text",
33
33
  placeholder: "Loja",
34
- ref: a,
35
- onKeyDown: (t) => t.key === "Enter" && i()
34
+ ref: n,
35
+ onKeyDown: (r) => r.key === "Enter" && i()
36
36
  }
37
37
  ),
38
38
  /* @__PURE__ */ e(
@@ -40,26 +40,27 @@ const z = () => {
40
40
  {
41
41
  className: "filter-ico-container",
42
42
  onClick: () => i(),
43
- children: /* @__PURE__ */ e(N, {})
43
+ children: /* @__PURE__ */ e(x, {})
44
44
  }
45
45
  )
46
46
  ] }),
47
- /* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: r == null ? void 0 : r.divider }) })
47
+ /* @__PURE__ */ e("div", { className: "divider", children: /* @__PURE__ */ e("span", { children: t == null ? void 0 : t.divider }) })
48
48
  ] }),
49
- /* @__PURE__ */ e("p", { className: "stores-label", children: r == null ? void 0 : r.labelStores }),
50
- /* @__PURE__ */ e("div", { className: "stores-container", children: n == null ? void 0 : n.map((t) => /* @__PURE__ */ e(
51
- x,
49
+ /* @__PURE__ */ e("p", { className: "stores-label", children: t == null ? void 0 : t.labelStores }),
50
+ /* @__PURE__ */ e("div", { className: "stores-container", children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ e(
51
+ w,
52
52
  {
53
- pickupPointInfos: t
53
+ pickupPointInfos: r
54
54
  },
55
- t == null ? void 0 : t.id
55
+ r == null ? void 0 : r.id
56
56
  )) }),
57
57
  /* @__PURE__ */ e("br", {}),
58
58
  /* @__PURE__ */ o(
59
- u,
59
+ N,
60
60
  {
61
61
  view: "PickupPointInfoScreen",
62
62
  className: "back-button-all-store",
63
+ dataTestId: "back-button",
63
64
  children: [
64
65
  /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(C, { color: "var(--color-main)" }) }),
65
66
  d
@@ -69,5 +70,5 @@ const z = () => {
69
70
  ] });
70
71
  };
71
72
  export {
72
- z as AllStoresScreen
73
+ T as AllStoresScreen
73
74
  };
@@ -1,49 +1,71 @@
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 = () => {
1
+ import { jsxs as d, Fragment as s, jsx as a } from "react/jsx-runtime";
2
+ import { Title as b } from "../components/Title.js";
3
+ import { SetViewButton as f } from "../components/SetViewButton.js";
4
+ import { InfoPrices as y } from "../components/InfoPrices.js";
5
+ import { Navigation as g } from "../components/Navigation.js";
6
+ import { Delivery as v } from "../components/Delivery.js";
7
+ import { useRegionalizationContext as C } from "../context/RegionalizationContext.js";
8
+ const p = () => {
9
9
  const {
10
- editAddress: s,
11
- delivery: i,
10
+ editAddress: c,
11
+ delivery: n,
12
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,
13
+ address: r,
14
+ pickupAddress: t,
15
+ internalMethod: i,
16
+ pickupTimes: l,
17
+ pickupConfirmScreenText: o
18
+ } = C(), m = `Retiradas entre ${(l == null ? void 0 : l.openingTime) || "08"}h e ${(l == null ? void 0 : l.closingTime) || "20"}h, ou agendada`, h = o && o !== "" ? o : m;
19
+ return /* @__PURE__ */ d(s, { children: [
20
+ /* @__PURE__ */ a(
21
+ b,
22
22
  {
23
- title: l === "delivery" ? i == null ? void 0 : i.titleOk : e == null ? void 0 : e.titleOk
23
+ title: i === "delivery" ? n == null ? void 0 : n.titleOk : e == null ? void 0 : e.titleOk
24
24
  }
25
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 })
26
+ /* @__PURE__ */ d("div", { className: "address-container", children: [
27
+ /* @__PURE__ */ d("p", { className: "address-title", children: [
28
+ /* @__PURE__ */ a("span", { "data-testid": "address-label-type", children: i === "delivery" ? n == null ? void 0 : n.labelAddress : e == null ? void 0 : e.labelAddress }),
29
+ i === "delivery" && /* @__PURE__ */ a(
30
+ f,
31
+ {
32
+ view: "PostalCodeInputScreen",
33
+ className: "edit-button",
34
+ dataTestId: "address-label-type",
35
+ children: c
36
+ }
37
+ )
30
38
  ] }),
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
- ] })
39
+ i === "delivery" ? /* @__PURE__ */ d(s, { children: [
40
+ /* @__PURE__ */ a("span", { "data-testid": "address-label-zip-code", children: r == null ? void 0 : r.cep }),
41
+ /* @__PURE__ */ a(
42
+ "span",
43
+ {
44
+ className: "address-delivery",
45
+ "data-testid": "address-label-city-country",
46
+ children: (r == null ? void 0 : r.logradouro) || (r == null ? void 0 : r.localidade)
47
+ }
48
+ )
49
+ ] }) : /* @__PURE__ */ d(s, { children: [
50
+ /* @__PURE__ */ a("span", { "data-testid": "address-label-name", children: t == null ? void 0 : t.name }),
51
+ /* @__PURE__ */ d(
52
+ "p",
53
+ {
54
+ className: "address-pickup",
55
+ "data-testid": "address-label-street-address",
56
+ children: [
57
+ t == null ? void 0 : t.address.street,
58
+ ", ",
59
+ t == null ? void 0 : t.address.number,
60
+ /* @__PURE__ */ a("br", {}),
61
+ t == null ? void 0 : t.address.neighborhood
62
+ ]
63
+ }
64
+ )
43
65
  ] })
44
66
  ] }),
45
- l === "delivery" ? /* @__PURE__ */ n(b, { delivery: i, containerClassName: "delivery-container" }) : /* @__PURE__ */ n(
46
- C,
67
+ i === "delivery" ? /* @__PURE__ */ a(v, { delivery: n, containerClassName: "delivery-container" }) : /* @__PURE__ */ a(
68
+ y,
47
69
  {
48
70
  containerClassName: "pickup-container",
49
71
  priceClassName: "pickup-price",
@@ -52,9 +74,9 @@ const I = () => {
52
74
  scheduling: h
53
75
  }
54
76
  ),
55
- /* @__PURE__ */ n(N, { pickuConfirmScreem: l !== "delivery" })
77
+ /* @__PURE__ */ a(g, { pickuConfirmScreem: i !== "delivery" })
56
78
  ] });
57
79
  };
58
80
  export {
59
- I as ConfirmScreen
81
+ p as ConfirmScreen
60
82
  };
@@ -1,49 +1,73 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { useEffect as p } from "react";
3
- import { Title as f } from "../components/Title.js";
4
- import { SetViewButton as n } from "../components/SetViewButton.js";
5
- import { ArrowIcon as d } from "../../../assets/svgs/ArrowIcon.js";
3
+ import { Title as d } from "../components/Title.js";
4
+ import { SetViewButton as t } from "../components/SetViewButton.js";
5
+ import { ArrowIcon as f } from "../../../assets/svgs/ArrowIcon.js";
6
6
  import { ShoppingBagsIcon as h } from "../../../assets/svgs/ShoppingBagsIcon.js";
7
- import { ShoppingIcon as v } from "../../../assets/svgs/ShoppingIcon.js";
8
- import { useRegionalizationContext as I } from "../context/RegionalizationContext.js";
9
- import { formatPrice as u } from "../utils/formatPrice.js";
10
- const R = () => {
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 j = () => {
11
11
  const {
12
- titleText: c,
13
- moreInfosText: a,
14
- deliveryPrice: m,
15
- priceStockInformation: l,
16
- backToDelivery: t,
12
+ titleText: a,
13
+ moreInfosText: c,
14
+ deliveryPrice: s,
15
+ priceStockInformation: m,
16
+ backToDelivery: n,
17
17
  setBackToDelivery: r,
18
18
  status: o,
19
- setStatus: s
20
- } = I();
19
+ setStatus: l
20
+ } = u();
21
21
  return p(() => {
22
- t && (r == null || r(!1)), (o == null ? void 0 : o.status) === "failed" && s({});
23
- }, [t, o]), /* @__PURE__ */ i("div", { className: "inital-view-container", children: [
24
- /* @__PURE__ */ e(f, { title: c }),
25
- /* @__PURE__ */ e("p", { className: "price-stock-information", children: l }),
26
- /* @__PURE__ */ i(n, { view: "MoreInfosScreen", className: "more-infos-button", children: [
27
- a,
28
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(d, { color: "var(--color-main)" }) })
29
- ] }),
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(d, { title: a }),
25
+ /* @__PURE__ */ e("p", { className: "price-stock-information", children: m }),
26
+ /* @__PURE__ */ i(
27
+ t,
28
+ {
29
+ view: "MoreInfosScreen",
30
+ className: "more-infos-button",
31
+ dataTestId: "more-infos-button",
32
+ children: [
33
+ c,
34
+ /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(f, { color: "var(--color-main)" }) })
35
+ ]
36
+ }
37
+ ),
30
38
  /* @__PURE__ */ i("div", { className: "delivery-option-container", children: [
31
- /* @__PURE__ */ i(n, { 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
- u(m || 0)
37
- ] })
38
- ] }),
39
- /* @__PURE__ */ i(n, { view: "PickupPointInfoScreen", className: "option", children: [
40
- /* @__PURE__ */ e(v, {}),
41
- /* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
42
- /* @__PURE__ */ e("p", { children: " Grátis" })
43
- ] })
39
+ /* @__PURE__ */ i(
40
+ t,
41
+ {
42
+ view: "PostalCodeInputScreen",
43
+ className: "option",
44
+ dataTestId: "delivery-options",
45
+ children: [
46
+ /* @__PURE__ */ e(h, {}),
47
+ /* @__PURE__ */ e("h4", { children: "Receber em casa" }),
48
+ /* @__PURE__ */ i("p", { children: [
49
+ " A partir de ",
50
+ v(s || 0)
51
+ ] })
52
+ ]
53
+ }
54
+ ),
55
+ /* @__PURE__ */ i(
56
+ t,
57
+ {
58
+ view: "PickupPointInfoScreen",
59
+ className: "option",
60
+ dataTestId: "pickup-options",
61
+ children: [
62
+ /* @__PURE__ */ e(I, {}),
63
+ /* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
64
+ /* @__PURE__ */ e("p", { children: " Grátis" })
65
+ ]
66
+ }
67
+ )
44
68
  ] })
45
69
  ] });
46
70
  };
47
71
  export {
48
- R as InitialView
72
+ j as InitialView
49
73
  };
@@ -1,15 +1,15 @@
1
- import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
- import { Title as c } from "../components/Title.js";
3
- import { InfoPrices as l } from "../components/InfoPrices.js";
4
- import { SetViewButton as i } from "../components/SetViewButton.js";
5
- import { ArrowIcon as a } from "../../../assets/svgs/ArrowIcon.js";
6
- import { useRegionalizationContext as s } from "../context/RegionalizationContext.js";
7
- const N = () => {
8
- const { pickup: e, textBackButton: o, backToDelivery: t } = s();
9
- return /* @__PURE__ */ r("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ n("div", { className: "content-container", children: [
10
- /* @__PURE__ */ r(c, { title: e == null ? void 0 : e.title }),
11
- /* @__PURE__ */ r(
12
- l,
1
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
+ import { Title as a } from "../components/Title.js";
3
+ import { InfoPrices as c } from "../components/InfoPrices.js";
4
+ import { SetViewButton as r } from "../components/SetViewButton.js";
5
+ import { ArrowIcon as s } from "../../../assets/svgs/ArrowIcon.js";
6
+ import { useRegionalizationContext as l } from "../context/RegionalizationContext.js";
7
+ const v = () => {
8
+ const { pickup: e, textBackButton: o, backToDelivery: i } = l();
9
+ return /* @__PURE__ */ t("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ n("div", { className: "content-container", children: [
10
+ /* @__PURE__ */ t(a, { title: e == null ? void 0 : e.title }),
11
+ /* @__PURE__ */ t(
12
+ c,
13
13
  {
14
14
  containerClassName: "pickup-container",
15
15
  priceClassName: "pickup-price",
@@ -18,25 +18,34 @@ const N = () => {
18
18
  }
19
19
  ),
20
20
  /* @__PURE__ */ n("div", { className: "pickup-instructions", children: [
21
- /* @__PURE__ */ r("p", { children: e == null ? void 0 : e.labelScheduling }),
22
- /* @__PURE__ */ r("span", { children: e == null ? void 0 : e.scheduling })
21
+ /* @__PURE__ */ t("p", { children: e == null ? void 0 : e.labelScheduling }),
22
+ /* @__PURE__ */ t("span", { children: e == null ? void 0 : e.scheduling })
23
23
  ] }),
24
24
  /* @__PURE__ */ n("div", { className: "pickup-open-stores-container", children: [
25
25
  /* @__PURE__ */ n(
26
- i,
26
+ r,
27
27
  {
28
- view: t ? "PostalCodeInputScreen" : "InitialView",
28
+ view: i ? "PostalCodeInputScreen" : "InitialView",
29
29
  className: "back-button",
30
+ dataTestId: "back-button",
30
31
  children: [
31
- /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(a, { color: "var(--color-main)" }) }),
32
+ /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(s, { color: "var(--color-main)" }) }),
32
33
  o
33
34
  ]
34
35
  }
35
36
  ),
36
- /* @__PURE__ */ r(i, { view: "AllStoresScreen", className: "pickup-open-stores", children: e == null ? void 0 : e.buttonOpenStores })
37
+ /* @__PURE__ */ t(
38
+ r,
39
+ {
40
+ view: "AllStoresScreen",
41
+ className: "pickup-open-stores",
42
+ dataTestId: "pickup-open-stores-button",
43
+ children: e == null ? void 0 : e.buttonOpenStores
44
+ }
45
+ )
37
46
  ] })
38
47
  ] }) });
39
48
  };
40
49
  export {
41
- N as PickupPointInfoScreen
50
+ v as PickupPointInfoScreen
42
51
  };
@@ -1,36 +1,36 @@
1
1
  import { jsx as n, Fragment as f, jsxs as c } from "react/jsx-runtime";
2
- import { Title as g } from "../components/Title.js";
2
+ import { Title as k } from "../components/Title.js";
3
3
  import { SetViewButton as s } from "../components/SetViewButton.js";
4
- import { InfoPrices as k } from "../components/InfoPrices.js";
5
- import { ShoppingIcon as N } from "../../../assets/svgs/ShoppingIcon.js";
6
- import { WarningIcon as u } from "../../../assets/svgs/WarningIcon.js";
7
- import { ArrowIcon as w } from "../../../assets/svgs/ArrowIcon.js";
8
- import { useRegionalizationContext as x } from "../context/RegionalizationContext.js";
9
- import { postalCodeMask as P } from "../utils/postalCode.js";
10
- const T = () => {
4
+ import { InfoPrices as u } from "../components/InfoPrices.js";
5
+ import { ShoppingIcon as g } from "../../../assets/svgs/ShoppingIcon.js";
6
+ import { WarningIcon as N } from "../../../assets/svgs/WarningIcon.js";
7
+ import { ArrowIcon as b } from "../../../assets/svgs/ArrowIcon.js";
8
+ import { useRegionalizationContext as I } from "../context/RegionalizationContext.js";
9
+ import { postalCodeMask as w } from "../utils/postalCode.js";
10
+ const K = () => {
11
11
  const {
12
12
  delivery: e,
13
- status: r,
14
- postalCodeValidation: o,
15
- setInputPostalCode: m,
16
- postalCode: p,
17
- deliveryPrice: h,
18
- textBackButton: d,
19
- pickup: t,
13
+ status: o,
14
+ postalCodeValidation: t,
15
+ setInputPostalCode: p,
16
+ postalCode: m,
17
+ deliveryPrice: d,
18
+ textBackButton: h,
19
+ pickup: i,
20
20
  setBackToDelivery: a
21
- } = x(), l = (r == null ? void 0 : r.status) === "failed";
21
+ } = I(), l = (o == null ? void 0 : o.status) === "failed";
22
22
  return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ c("div", { className: "content-container", children: [
23
- /* @__PURE__ */ n(g, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
23
+ /* @__PURE__ */ n(k, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
24
24
  l ? /* @__PURE__ */ c("div", { className: "warning-container", children: [
25
- /* @__PURE__ */ n(u, {}),
26
- /* @__PURE__ */ n("span", { className: "warning-text", children: r == null ? void 0 : r.message })
25
+ /* @__PURE__ */ n(N, {}),
26
+ /* @__PURE__ */ n("span", { className: "warning-text", children: o == null ? void 0 : o.message })
27
27
  ] }) : /* @__PURE__ */ n(
28
- k,
28
+ u,
29
29
  {
30
30
  containerClassName: "delivery-container",
31
31
  priceClassName: "info-price",
32
32
  labelPrice: e == null ? void 0 : e.labelPrice,
33
- price: h
33
+ price: d
34
34
  }
35
35
  ),
36
36
  /* @__PURE__ */ c("div", { className: "postal-code-container", children: [
@@ -38,21 +38,23 @@ const T = () => {
38
38
  /* @__PURE__ */ n(
39
39
  "input",
40
40
  {
41
- onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
41
+ "data-testid": "postal-code-input",
42
+ onKeyDown: (r) => r.key === "Enter" && (t == null ? void 0 : t()),
42
43
  type: "text",
43
- onChange: (i) => m(i.target.value),
44
+ onChange: (r) => p(r.target.value),
44
45
  maxLength: 9,
45
- placeholder: p || "00000-000",
46
- onKeyUp: P
46
+ placeholder: m || "00000-000",
47
+ onKeyUp: w
47
48
  }
48
49
  ),
49
50
  /* @__PURE__ */ n(
50
51
  "button",
51
52
  {
52
- onKeyDown: (i) => i.key === "Enter" && (o == null ? void 0 : o()),
53
- onClick: () => o == null ? void 0 : o(),
54
- disabled: r == null ? void 0 : r.loading,
55
- children: r != null && r.loading ? r.message : e == null ? void 0 : e.searchButton
53
+ "data-testid": "postal-code-button",
54
+ onKeyDown: (r) => r.key === "Enter" && (t == null ? void 0 : t()),
55
+ onClick: () => t == null ? void 0 : t(),
56
+ disabled: o == null ? void 0 : o.loading,
57
+ children: o != null && o.loading ? o.message : e == null ? void 0 : e.searchButton
56
58
  }
57
59
  )
58
60
  ] }),
@@ -62,13 +64,14 @@ const T = () => {
62
64
  /* @__PURE__ */ c(
63
65
  s,
64
66
  {
65
- onClick: () => a == null ? void 0 : a(!0),
66
67
  view: "PickupPointInfoScreen",
67
68
  className: "postal-code-container-pickup-select",
69
+ dataTestId: "postal-code-container-pickup-select",
70
+ onClick: () => a == null ? void 0 : a(!0),
68
71
  children: [
69
- /* @__PURE__ */ n(N, {}),
72
+ /* @__PURE__ */ n(g, {}),
70
73
  /* @__PURE__ */ c("div", { className: "postal-code-container-pickup-select-informative", children: [
71
- /* @__PURE__ */ n("h4", { children: t == null ? void 0 : t.title }),
74
+ /* @__PURE__ */ n("h4", { children: i == null ? void 0 : i.title }),
72
75
  /* @__PURE__ */ n("p", { children: " Grátis" })
73
76
  ] })
74
77
  ]
@@ -76,12 +79,20 @@ const T = () => {
76
79
  )
77
80
  ] })
78
81
  ] }),
79
- /* @__PURE__ */ c(s, { view: "InitialView", className: "back-button", children: [
80
- /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(w, { color: "var(--color-main)" }) }),
81
- d
82
- ] })
82
+ /* @__PURE__ */ c(
83
+ s,
84
+ {
85
+ view: "InitialView",
86
+ className: "back-button",
87
+ dataTestId: "back-button",
88
+ children: [
89
+ /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(b, { color: "var(--color-main)" }) }),
90
+ h
91
+ ]
92
+ }
93
+ )
83
94
  ] }) }) });
84
95
  };
85
96
  export {
86
- T as PostalCodeInputScreen
97
+ K as PostalCodeInputScreen
87
98
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@plurix/ecom-components",
3
3
  "author": "Plurix",
4
4
  "private": false,
5
- "version": "1.19.1",
5
+ "version": "1.19.3",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",