@plurix/ecom-components 1.14.2-COM-1647.4 → 1.14.2-COM-1647.5

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,36 +1,37 @@
1
- import { jsx as n, Fragment as f, jsxs as r } from "react/jsx-runtime";
2
- import { Title as g } from "../components/Title.js";
3
- import { SetViewButton as s } from "../components/SetViewButton.js";
4
- import { InfoPrices as N } from "../components/InfoPrices.js";
5
- import { ShoppingIcon as k } from "../../../assets/svgs/ShoppingIcon.js";
6
- import { WarningIcon as u } from "../../../assets/svgs/WarningIcon.js";
1
+ import { jsx as n, Fragment as u, jsxs as r } from "react/jsx-runtime";
2
+ import { Title as N } from "../components/Title.js";
3
+ import { SetViewButton as p } from "../components/SetViewButton.js";
4
+ import { InfoPrices as k } from "../components/InfoPrices.js";
5
+ import { ShoppingIcon as P } from "../../../assets/svgs/ShoppingIcon.js";
6
+ import { WarningIcon as C } from "../../../assets/svgs/WarningIcon.js";
7
7
  import { ArrowIcon as x } from "../../../assets/svgs/ArrowIcon.js";
8
- import { useRegionalizationContext as P } from "../context/RegionalizationContext.js";
9
- import { postalCodeMask as b } from "../utils/postalCode.js";
10
- const T = () => {
8
+ import { useRegionalizationContext as b } from "../context/RegionalizationContext.js";
9
+ import { postalCodeMask as w } from "../utils/postalCode.js";
10
+ import { useState as I } from "react";
11
+ const F = () => {
11
12
  const {
12
13
  delivery: e,
13
14
  status: o,
14
15
  postalCodeValidation: i,
15
- setInputPostalCode: m,
16
- postalCode: p,
17
- deliveryPrice: d,
18
- textBackButton: h,
19
- pickup: t,
16
+ setInputPostalCode: s,
17
+ postalCode: d,
18
+ deliveryPrice: h,
19
+ textBackButton: f,
20
+ pickup: c,
20
21
  setBackToDelivery: a
21
- } = P(), l = (o == null ? void 0 : o.status) === "failed";
22
- return /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ r("div", { className: "content-container", children: [
23
- /* @__PURE__ */ n(g, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
22
+ } = b(), [m, g] = I(""), l = (o == null ? void 0 : o.status) === "failed";
23
+ return /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n("div", { className: "delivery-pickup-container", children: /* @__PURE__ */ r("div", { className: "content-container", children: [
24
+ /* @__PURE__ */ n(N, { title: l ? "Tente outro CEP" : e == null ? void 0 : e.title }),
24
25
  l ? /* @__PURE__ */ r("div", { className: "warning-container", children: [
25
- /* @__PURE__ */ n(u, {}),
26
+ /* @__PURE__ */ n(C, {}),
26
27
  /* @__PURE__ */ n("span", { className: "warning-text", children: o == null ? void 0 : o.message })
27
28
  ] }) : /* @__PURE__ */ n(
28
- N,
29
+ k,
29
30
  {
30
31
  containerClassName: "delivery-container",
31
32
  priceClassName: "info-price",
32
33
  labelPrice: e == null ? void 0 : e.labelPrice,
33
- price: d
34
+ price: h
34
35
  }
35
36
  ),
36
37
  /* @__PURE__ */ r("div", { className: "postal-code-container", children: [
@@ -39,19 +40,23 @@ const T = () => {
39
40
  "input",
40
41
  {
41
42
  type: "text",
42
- onChange: (c) => {
43
- c.target.value.length === 9 && m(c.target.value);
43
+ onChange: (t) => {
44
+ t.target.value.length === 9 && g(t.target.value);
44
45
  },
45
46
  maxLength: 9,
46
- placeholder: p || "00000-000",
47
- onKeyUp: b
47
+ placeholder: d || "00000-000",
48
+ onKeyUp: w
48
49
  }
49
50
  ),
50
51
  /* @__PURE__ */ n(
51
52
  "button",
52
53
  {
53
- onKeyDown: (c) => c.key === "Enter" && (i == null ? void 0 : i()),
54
- onClick: () => i == null ? void 0 : i(),
54
+ onKeyDown: (t) => {
55
+ s(m), t.key === "Enter" && (i == null || i());
56
+ },
57
+ onClick: () => {
58
+ s(m), i == null || i();
59
+ },
55
60
  disabled: o == null ? void 0 : o.loading,
56
61
  children: o != null && o.loading ? o.message : e == null ? void 0 : e.searchButton
57
62
  }
@@ -61,15 +66,15 @@ const T = () => {
61
66
  l && /* @__PURE__ */ r("div", { className: "postal-code-container-pickup", children: [
62
67
  /* @__PURE__ */ n("label", { children: "Você pode escolhes retirar na loja" }),
63
68
  /* @__PURE__ */ r(
64
- s,
69
+ p,
65
70
  {
66
71
  onClick: () => a == null ? void 0 : a(!0),
67
72
  view: "PickupPointInfoScreen",
68
73
  className: "postal-code-container-pickup-select",
69
74
  children: [
70
- /* @__PURE__ */ n(k, {}),
75
+ /* @__PURE__ */ n(P, {}),
71
76
  /* @__PURE__ */ r("div", { className: "postal-code-container-pickup-select-informative", children: [
72
- /* @__PURE__ */ n("h4", { children: t == null ? void 0 : t.title }),
77
+ /* @__PURE__ */ n("h4", { children: c == null ? void 0 : c.title }),
73
78
  /* @__PURE__ */ n("p", { children: " Grátis" })
74
79
  ] })
75
80
  ]
@@ -77,12 +82,12 @@ const T = () => {
77
82
  )
78
83
  ] })
79
84
  ] }),
80
- /* @__PURE__ */ r(s, { view: "InitialView", className: "back-button", children: [
85
+ /* @__PURE__ */ r(p, { view: "InitialView", className: "back-button", children: [
81
86
  /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(x, { color: "var(--color-main)" }) }),
82
- h
87
+ f
83
88
  ] })
84
89
  ] }) }) });
85
90
  };
86
91
  export {
87
- T as PostalCodeInputScreen
92
+ F as PostalCodeInputScreen
88
93
  };
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.14.2-COM-1647.4",
5
+ "version": "1.14.2-COM-1647.5",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",