@plurix/ecom-components 1.19.6 → 1.20.1

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,6 +1,6 @@
1
1
  import { ReactNode, Dispatch, SetStateAction } from 'react';
2
2
 
3
- export interface ModalProps {
3
+ interface ModalProps {
4
4
  isOpen: boolean;
5
5
  setIsOpen: Dispatch<SetStateAction<boolean>>;
6
6
  children: ReactNode;
@@ -11,11 +11,6 @@ export interface ModalProps {
11
11
  Footer?: ReactNode;
12
12
  hideHeader?: boolean;
13
13
  PreContent?: ReactNode;
14
- /** Fecha o modal com a tecla Esc. Default: true. */
15
- closeOnEsc?: boolean;
16
- /** Mantém o foco do teclado dentro do modal enquanto aberto. Default: true. */
17
- trapFocus?: boolean;
18
- /** Texto acessível do botão de fechar. Default: 'Fechar'. */
19
- closeButtonLabel?: string;
20
14
  }
21
15
  export declare const Modal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
16
+ export {};
@@ -1,151 +1,62 @@
1
- var j = Object.defineProperty, B = Object.defineProperties;
2
- var K = Object.getOwnPropertyDescriptors;
3
- var v = Object.getOwnPropertySymbols;
4
- var T = Object.prototype.hasOwnProperty, $ = Object.prototype.propertyIsEnumerable;
5
- var N = (r, t, o) => t in r ? j(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o, R = (r, t) => {
6
- for (var o in t || (t = {}))
7
- T.call(t, o) && N(r, o, t[o]);
8
- if (v)
9
- for (var o of v(t))
10
- $.call(t, o) && N(r, o, t[o]);
11
- return r;
12
- }, F = (r, t) => B(r, K(t));
13
- import { jsx as i, jsxs as E } from "react/jsx-runtime";
14
- import { useRef as m, useId as M, useEffect as w } from "react";
15
- import { ArrowIcon as W } from "../../assets/svgs/ArrowIcon.js";
16
- import { CloseIcon as _ } from "../../assets/svgs/CloseIcon.js";
17
- import { HAS_WINDOW as H } from "../../constants/index.js";
18
- /* empty css */const q = [
19
- "a[href]",
20
- "button:not([disabled])",
21
- "input:not([disabled])",
22
- "select:not([disabled])",
23
- "textarea:not([disabled])",
24
- '[tabindex]:not([tabindex="-1"])'
25
- ].join(","), X = (r) => {
1
+ import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
+ import { useRef as s, useEffect as p } from "react";
3
+ import { ArrowIcon as g } from "../../assets/svgs/ArrowIcon.js";
4
+ import { CloseIcon as k } from "../../assets/svgs/CloseIcon.js";
5
+ import { HAS_WINDOW as v } from "../../constants/index.js";
6
+ /* empty css */const R = (w) => {
26
7
  const {
27
- isOpen: t,
28
- setIsOpen: o,
29
- children: O,
30
- className: S,
31
- title: f,
32
- titleAction: L,
33
- hasTitleArrow: D,
34
- Footer: g,
35
- hideHeader: d,
36
- PreContent: x,
37
- closeOnEsc: A = !0,
38
- trapFocus: s = !0,
39
- closeButtonLabel: I = "Fechar"
40
- } = r, h = m(null), b = m(null), u = m(null), C = m(null), p = `modal-title-${M()}`, y = () => o == null ? void 0 : o(!1);
41
- return w(() => {
42
- if (H)
43
- return t ? window.document.body.classList.add("no-scroll") : window.document.body.classList.remove("no-scroll"), () => {
8
+ isOpen: r,
9
+ setIsOpen: C,
10
+ children: L,
11
+ className: N,
12
+ title: d,
13
+ titleAction: a,
14
+ hasTitleArrow: x,
15
+ Footer: m,
16
+ hideHeader: b,
17
+ PreContent: u
18
+ } = w, t = s(null), n = s(null), l = s(null), f = () => C(!1);
19
+ return p(() => {
20
+ if (v)
21
+ return r ? window.document.body.classList.add("no-scroll") : window.document.body.classList.remove("no-scroll"), () => {
44
22
  window.document.body.classList.remove("no-scroll");
45
23
  };
46
- }, [t]), w(() => {
47
- if (b.current && h.current) {
48
- const n = d ? 0 : 56;
49
- h.current.style.maxHeight = `calc(100% - ${n}px - ${b.current.offsetHeight}px)`;
50
- }
51
- const c = (n) => {
52
- var e;
53
- u.current && (n == null ? void 0 : n.target) instanceof Node && !((e = u.current) != null && e.contains(n == null ? void 0 : n.target)) && y();
24
+ }, [r]), p(() => {
25
+ n.current && t.current && (t.current.style.maxHeight = `calc(100% - 56px - ${n.current.offsetHeight}px)`);
26
+ const c = (e) => {
27
+ var h;
28
+ l.current && (e == null ? void 0 : e.target) instanceof Node && !((h = l.current) != null && h.contains(e == null ? void 0 : e.target)) && f();
54
29
  };
55
- return t ? document.addEventListener("mousedown", c) : document.removeEventListener("mousedown", c), () => {
30
+ return r ? document.addEventListener("mousedown", c) : document.removeEventListener("mousedown", c), () => {
56
31
  document.removeEventListener("mousedown", c);
57
32
  };
58
- }, [t, d]), w(() => {
59
- if (!t || !H)
60
- return;
61
- C.current = document.activeElement;
62
- const c = () => {
63
- var e, l;
64
- return Array.from(
65
- (l = (e = u.current) == null ? void 0 : e.querySelectorAll(q)) != null ? l : []
66
- ).filter(
67
- (a) => !a.hasAttribute("hidden") && a.getAttribute("aria-hidden") !== "true"
68
- );
69
- };
70
- if (s) {
71
- const [e] = c();
72
- e == null || e.focus();
73
- }
74
- const n = (e) => {
75
- if (A && e.key === "Escape") {
76
- y();
77
- return;
78
- }
79
- if (!s || e.key !== "Tab")
80
- return;
81
- const l = c();
82
- if (l.length === 0)
83
- return;
84
- const a = l[0], k = l[l.length - 1];
85
- if (e.shiftKey && document.activeElement === a) {
86
- e.preventDefault(), k.focus();
87
- return;
88
- }
89
- !e.shiftKey && document.activeElement === k && (e.preventDefault(), a.focus());
90
- };
91
- return document.addEventListener("keydown", n), () => {
92
- var e, l;
93
- document.removeEventListener("keydown", n), s && ((l = (e = C.current) == null ? void 0 : e.focus) == null || l.call(e));
94
- };
95
- }, [t, A, s]), t ? /* @__PURE__ */ i(
33
+ }, [r]), r ? /* @__PURE__ */ o(
96
34
  "div",
97
35
  {
98
36
  id: "modal-container",
99
37
  "data-testid": "modal-container",
100
- className: S,
101
- children: /* @__PURE__ */ i("div", { id: "modal-content-container", children: /* @__PURE__ */ E(
102
- "div",
103
- F(R({
104
- id: "modal-content",
105
- ref: u,
106
- role: "dialog",
107
- "aria-modal": "true"
108
- }, d ? { "aria-label": f } : { "aria-labelledby": p }), {
109
- children: [
110
- !d && /* @__PURE__ */ E("header", { children: [
111
- L ? /* @__PURE__ */ E(
112
- "button",
113
- {
114
- id: p,
115
- onClick: L,
116
- className: "modal-title",
117
- children: [
118
- D && /* @__PURE__ */ i(
119
- W,
120
- {
121
- rotate: "Left",
122
- color: "var(--color-support-links)"
123
- }
124
- ),
125
- f
126
- ]
127
- }
128
- ) : /* @__PURE__ */ i("h2", { id: p, className: "modal-title", children: f }),
129
- /* @__PURE__ */ i(
130
- "button",
131
- {
132
- onClick: y,
133
- className: "modal-close",
134
- type: "button",
135
- "aria-label": I,
136
- children: /* @__PURE__ */ i(_, { color: "var(--color-main)" })
137
- }
138
- )
139
- ] }),
140
- !!x && x,
141
- /* @__PURE__ */ i("div", { ref: h, children: O }),
142
- g && /* @__PURE__ */ i("footer", { className: "modal-footer", ref: b, children: g })
143
- ]
144
- })
145
- ) })
38
+ className: N,
39
+ children: /* @__PURE__ */ o("div", { id: "modal-content-container", children: /* @__PURE__ */ i("div", { id: "modal-content", ref: l, children: [
40
+ !b && /* @__PURE__ */ i("header", { children: [
41
+ a ? /* @__PURE__ */ i("button", { onClick: a, className: "modal-title", children: [
42
+ x && /* @__PURE__ */ o(
43
+ g,
44
+ {
45
+ rotate: "Left",
46
+ color: "var(--color-support-links)"
47
+ }
48
+ ),
49
+ d
50
+ ] }) : /* @__PURE__ */ o("h2", { className: "modal-title", children: d }),
51
+ /* @__PURE__ */ o("button", { onClick: f, className: "modal-close", children: /* @__PURE__ */ o(k, { color: "var(--color-main)" }) })
52
+ ] }),
53
+ !!u && u,
54
+ /* @__PURE__ */ o("div", { ref: t, children: L }),
55
+ m && /* @__PURE__ */ o("footer", { className: "modal-footer", ref: n, children: m })
56
+ ] }) })
146
57
  }
147
58
  ) : null;
148
59
  };
149
60
  export {
150
- X as Modal
61
+ R as Modal
151
62
  };
@@ -1,3 +1,3 @@
1
1
  import { RegionalizationProps } from './types/RegionalizationProps';
2
2
 
3
- export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup, disabledSearch }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Regionalization: ({ setMethod, setPickupName, setCity, deliveryPrice, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, addressDelivery, status, setStatus, pickupPoints, pickupConfirmScreenText, regionalizeCatalog, titleText, priceStockInformation, moreInfosText, textBackButton, confirmButton, editAddress, delivery, pickup, disabledSearch }: RegionalizationProps) => import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,7 @@ import { ViewsContainer as k } from "./views/ViewsContainer.js";
12
12
  setModalOpen: l,
13
13
  inputPostalCode: d,
14
14
  setInputPostalCode: c,
15
- sendPostalCode: m,
15
+ addressDelivery: m,
16
16
  status: p,
17
17
  setStatus: u,
18
18
  pickupPoints: g,
@@ -72,7 +72,7 @@ import { ViewsContainer as k } from "./views/ViewsContainer.js";
72
72
  setModalOpen: l,
73
73
  inputPostalCode: d,
74
74
  setInputPostalCode: c,
75
- sendPostalCode: m,
75
+ addressDelivery: m,
76
76
  pickupPoints: g,
77
77
  titleText: j,
78
78
  moreInfosText: E,
@@ -1,4 +1,4 @@
1
1
  import { RegionalizationProps, ContextProps } from '../types';
2
2
 
3
- export declare const RegionalizationContextProvider: ({ setMethod, setPickupName, setCity, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, sendPostalCode, status, setStatus, priceStockInformation, pickupPoints, titleText, moreInfosText, textBackButton, confirmButton, editAddress, delivery, deliveryPrice, pickup, regionalizeCatalog, pickupConfirmScreenText, disabledSearch, children }: RegionalizationProps & ContextProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const RegionalizationContextProvider: ({ setMethod, setPickupName, setCity, setUf, setPickupTimes, pricesAndHours, setModalOpen, inputPostalCode, setInputPostalCode, addressDelivery, status, setStatus, priceStockInformation, pickupPoints, titleText, moreInfosText, textBackButton, confirmButton, editAddress, delivery, deliveryPrice, pickup, regionalizeCatalog, pickupConfirmScreenText, disabledSearch, children }: RegionalizationProps & ContextProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const useRegionalizationContext: () => RegionalizationProps & ContextProps;
@@ -1,115 +1,106 @@
1
- import { jsx as _ } from "react/jsx-runtime";
2
- import { createContext as M, useState as e, useEffect as ee, useContext as oe } from "react";
3
- import { removeSpecialCharacter as se } from "../utils/postalCode.js";
4
- import { getFullLocalStorage as c } from "../utils/localStorage.js";
5
- const v = M(null), re = ({
6
- setMethod: o,
7
- setPickupName: C,
8
- setCity: p,
9
- setUf: x,
10
- setPickupTimes: y,
11
- pricesAndHours: R,
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { createContext as D, useState as n, useEffect as d, useContext as oo } from "react";
3
+ import { removeSpecialCharacter as no } from "../utils/postalCode.js";
4
+ import { getFullLocalStorage as g } from "../utils/localStorage.js";
5
+ const x = D(null), uo = ({
6
+ setMethod: t,
7
+ setPickupName: I,
8
+ setCity: S,
9
+ setUf: R,
10
+ setPickupTimes: T,
11
+ pricesAndHours: b,
12
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
- disabledSearch: j,
31
- children: B
13
+ inputPostalCode: c,
14
+ setInputPostalCode: z,
15
+ addressDelivery: o,
16
+ status: P,
17
+ setStatus: a,
18
+ priceStockInformation: E = "",
19
+ pickupPoints: H,
20
+ titleText: h,
21
+ moreInfosText: k,
22
+ textBackButton: V,
23
+ confirmButton: q,
24
+ editAddress: F,
25
+ delivery: L,
26
+ deliveryPrice: W,
27
+ pickup: j,
28
+ regionalizeCatalog: A,
29
+ pickupConfirmScreenText: B,
30
+ disabledSearch: Q,
31
+ children: U
32
32
  }) => {
33
- const [F, u] = e(), [L, g] = e("InitialView"), [Q, m] = e(""), [$, A] = e(), [s, G] = e(), [J, f] = e(), [K, N] = e(), [O, U] = e(!1), X = {
34
- openingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
35
- closingTime: (s == null ? void 0 : s.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
36
- }, Y = async () => {
37
- i({ loading: !0, message: "Carregando..." });
38
- const {
39
- isValid: n,
40
- address: t,
41
- deliveryInfos: a,
42
- customShipping: r
43
- } = await d();
44
- n && (i({ loading: !1 }), u("delivery"), A(t), i({}), m(l), f(a), g("ConfirmScreen"), N(r));
45
- }, Z = () => {
33
+ const [$, m] = n(), [G, f] = n("InitialView"), [J, s] = n(""), [K, N] = n(), [i, O] = n(), [X, C] = n(), [Y, Z] = n(), [_, M] = n(!1), r = {
34
+ openingTime: (i == null ? void 0 : i.businessHours.businessHoursWeek.openingTime.slice(0, 2)) || "",
35
+ closingTime: (i == null ? void 0 : i.businessHours.businessHoursWeek.closingTime.slice(0, 2)) || ""
36
+ }, v = () => {
46
37
  /\d{8}$/.test(
47
- se(l)
48
- ) ? Y() : i({
49
- status: "failed",
38
+ no(c)
39
+ ) || !(o != null && o.loading) && (o != null && o.address) && (o != null && o.deliveryInfos) ? o != null && o.loading && (o != null && o.address) && (o != null && o.deliveryInfos) && (a({ status: "SUCCESS", loading: !1, message: "" }), m("delivery"), N(o.address), s(c), C(o.deliveryInfos), f("ConfirmScreen"), Z(o.customShipping)) : a({
40
+ status: "FAILED",
50
41
  loading: !1,
51
42
  message: "Que Pena, ainda não entregamos na sua região."
52
43
  });
53
44
  };
54
- return ee(() => {
55
- var n, t, a, r;
56
- 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);
57
- }, []), /* @__PURE__ */ _(
58
- v.Provider,
45
+ return d(() => {
46
+ var u, p, e, l;
47
+ s((p = (u = g()) == null ? void 0 : u.userAddressInfos) == null ? void 0 : p.postalCode), t == null || t((e = g()) == null ? void 0 : e.regionalized), C((l = g()) == null ? void 0 : l.deliveryInfos);
48
+ }, []), /* @__PURE__ */ y(
49
+ x.Provider,
59
50
  {
60
51
  value: {
61
- backToDelivery: O,
62
- setBackToDelivery: U,
63
- setMethod: o,
64
- priceStockInformation: T,
65
- setPickupName: C,
66
- setCity: p,
67
- setUf: x,
68
- setPickupTimes: y,
69
- pickupTimes: X,
70
- pickupConfirmScreenText: W,
71
- pricesAndHours: R,
52
+ addressDelivery: o,
53
+ backToDelivery: _,
54
+ setBackToDelivery: M,
55
+ setMethod: t,
56
+ priceStockInformation: E,
57
+ setPickupName: I,
58
+ setCity: S,
59
+ setUf: R,
60
+ setPickupTimes: T,
61
+ pickupTimes: r,
62
+ pickupConfirmScreenText: B,
63
+ pricesAndHours: b,
72
64
  setModalOpen: w,
73
- inputPostalCode: l,
74
- setInputPostalCode: D,
75
- sendPostalCode: d,
76
- status: I,
77
- setStatus: i,
78
- pickupPoints: b,
79
- titleText: z,
80
- moreInfosText: P,
81
- customShippingData: K,
82
- textBackButton: S,
83
- confirmButton: h,
84
- editAddress: H,
85
- delivery: V,
86
- pickup: q,
87
- view: L,
88
- setView: g,
89
- postalCodeValidation: Z,
90
- address: $,
91
- pickupAddress: s,
92
- setPickupAddress: G,
93
- deliveryRequestInfos: J,
94
- postalCode: Q,
95
- internalMethod: F,
96
- setInternalMethod: u,
97
- regionalizeCatalog: E,
98
- disabledSearch: j,
99
- deliveryPrice: k
65
+ inputPostalCode: c,
66
+ setInputPostalCode: z,
67
+ status: P,
68
+ setStatus: a,
69
+ pickupPoints: H,
70
+ titleText: h,
71
+ moreInfosText: k,
72
+ customShippingData: Y,
73
+ textBackButton: V,
74
+ confirmButton: q,
75
+ editAddress: F,
76
+ delivery: L,
77
+ pickup: j,
78
+ view: G,
79
+ setView: f,
80
+ postalCodeValidation: v,
81
+ address: K,
82
+ pickupAddress: i,
83
+ setPickupAddress: O,
84
+ deliveryRequestInfos: X,
85
+ postalCode: J,
86
+ internalMethod: $,
87
+ setInternalMethod: m,
88
+ regionalizeCatalog: A,
89
+ disabledSearch: Q,
90
+ deliveryPrice: W
100
91
  },
101
- children: B
92
+ children: U
102
93
  }
103
94
  );
104
- }, le = () => {
105
- const o = oe(v);
106
- if (!o)
95
+ }, go = () => {
96
+ const t = oo(x);
97
+ if (!t)
107
98
  throw new Error(
108
99
  "useRegionalizationContext must be used within a RegionalizationContextProvider"
109
100
  );
110
- return o;
101
+ return t;
111
102
  };
112
103
  export {
113
- re as RegionalizationContextProvider,
114
- le as useRegionalizationContext
104
+ uo as RegionalizationContextProvider,
105
+ go as useRegionalizationContext
115
106
  };
@@ -28,12 +28,12 @@ export interface RegionalizationProps {
28
28
  setModalOpen: (modalOpen: boolean) => void;
29
29
  inputPostalCode: string;
30
30
  setInputPostalCode: (value: string) => void;
31
- sendPostalCode: () => Promise<{
32
- isValid?: boolean;
31
+ addressDelivery: {
32
+ loading: boolean;
33
33
  address?: Address;
34
34
  deliveryInfos?: DeliveryProps;
35
35
  customShipping?: CustomShippingProps;
36
- }>;
36
+ };
37
37
  status: Status;
38
38
  setStatus: (status: Status) => void;
39
39
  pickupPoints: PikcupPointType[];
@@ -82,7 +82,7 @@ export interface RegionalizationProps {
82
82
  children?: ReactNode;
83
83
  }
84
84
  export interface Status {
85
- status?: 'failed';
86
- message?: string;
87
- loading?: boolean;
85
+ status: "FAILED" | "SUCCESS" | "LOADING";
86
+ message: string;
87
+ loading: boolean;
88
88
  }
@@ -1,67 +1,66 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useEffect as p } from "react";
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
- 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 j = () => {
1
+ import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import { useEffect as l } from "react";
3
+ import { Title as p } from "../components/Title.js";
4
+ import { SetViewButton as r } from "../components/SetViewButton.js";
5
+ import { ArrowIcon as d } from "../../../assets/svgs/ArrowIcon.js";
6
+ import { ShoppingBagsIcon as f } from "../../../assets/svgs/ShoppingBagsIcon.js";
7
+ import { ShoppingIcon as h } 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 k = () => {
11
11
  const {
12
- titleText: a,
13
- moreInfosText: c,
14
- deliveryPrice: s,
15
- priceStockInformation: m,
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(d, { title: a }),
25
- /* @__PURE__ */ e("p", { className: "price-stock-information", children: m }),
26
- /* @__PURE__ */ i(
27
- t,
12
+ titleText: n,
13
+ moreInfosText: a,
14
+ deliveryPrice: c,
15
+ priceStockInformation: s,
16
+ backToDelivery: t,
17
+ setBackToDelivery: i,
18
+ status: m
19
+ } = I();
20
+ return l(() => {
21
+ t && (i == null || i(!1));
22
+ }, [t, m]), /* @__PURE__ */ e("div", { className: "inital-view-container", children: [
23
+ /* @__PURE__ */ o(p, { title: n }),
24
+ /* @__PURE__ */ o("p", { className: "price-stock-information", children: s }),
25
+ /* @__PURE__ */ e(
26
+ r,
28
27
  {
29
28
  view: "MoreInfosScreen",
30
29
  className: "more-infos-button",
31
30
  dataTestId: "more-infos-button",
32
31
  children: [
33
- c,
34
- /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(f, { color: "var(--color-main)" }) })
32
+ a,
33
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(d, { color: "var(--color-main)" }) })
35
34
  ]
36
35
  }
37
36
  ),
38
- /* @__PURE__ */ i("div", { className: "delivery-option-container", children: [
39
- /* @__PURE__ */ i(
40
- t,
37
+ /* @__PURE__ */ e("div", { className: "delivery-option-container", children: [
38
+ /* @__PURE__ */ e(
39
+ r,
41
40
  {
42
41
  view: "PostalCodeInputScreen",
43
42
  className: "option",
44
43
  dataTestId: "delivery-options",
45
44
  children: [
46
- /* @__PURE__ */ e(h, {}),
47
- /* @__PURE__ */ e("h4", { children: "Receber em casa" }),
48
- /* @__PURE__ */ i("p", { children: [
45
+ /* @__PURE__ */ o(f, {}),
46
+ /* @__PURE__ */ o("h4", { children: "Receber em casa" }),
47
+ /* @__PURE__ */ e("p", { children: [
49
48
  " A partir de ",
50
- v(s || 0)
49
+ u(c || 0)
51
50
  ] })
52
51
  ]
53
52
  }
54
53
  ),
55
- /* @__PURE__ */ i(
56
- t,
54
+ /* @__PURE__ */ e(
55
+ r,
57
56
  {
58
57
  view: "PickupPointInfoScreen",
59
58
  className: "option",
60
59
  dataTestId: "pickup-options",
61
60
  children: [
62
- /* @__PURE__ */ e(I, {}),
63
- /* @__PURE__ */ e("h4", { children: "Retirar na Loja" }),
64
- /* @__PURE__ */ e("p", { children: " Grátis" })
61
+ /* @__PURE__ */ o(h, {}),
62
+ /* @__PURE__ */ o("h4", { children: "Retirar na Loja" }),
63
+ /* @__PURE__ */ o("p", { children: " Grátis" })
65
64
  ]
66
65
  }
67
66
  )
@@ -69,5 +68,5 @@ const j = () => {
69
68
  ] });
70
69
  };
71
70
  export {
72
- j as InitialView
71
+ k as InitialView
73
72
  };
@@ -18,7 +18,7 @@ const K = () => {
18
18
  textBackButton: h,
19
19
  pickup: i,
20
20
  setBackToDelivery: a
21
- } = I(), l = (o == null ? void 0 : o.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
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: [
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "@plurix/ecom-components",
3
- "author": "Plurix",
4
- "private": false,
5
- "version": "1.19.6",
6
- "type": "module",
7
- "main": "dist/main.js",
8
- "types": "dist/main.d.ts",
9
- "files": [
10
- "dist"
11
- ],
12
- "repository": {
13
- "type": "git",
14
- "url": "git+https://github.com/plurix-ecommerce/ecom-components.git"
15
- },
16
- "sideEffects": [
17
- "**/*.css"
18
- ],
19
- "scripts": {
20
- "dev": "vite",
21
- "build": "tsc --p ./tsconfig-build.json && vite build",
22
- "format": "prettier --write .",
23
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
24
- "prepare": "husky install",
25
- "preview": "vite preview",
26
- "test": "jest"
27
- },
28
- "peerDependencies": {
29
- "react": "^18.2.0",
30
- "react-dom": "^18.2.0"
31
- },
32
- "devDependencies": {
33
- "@babel/preset-env": "^7.24.5",
34
- "@babel/preset-react": "^7.24.1",
35
- "@commitlint/cli": "^17.4.2",
36
- "@commitlint/config-conventional": "^17.4.2",
37
- "@jest/globals": "^29.7.0",
38
- "@testing-library/jest-dom": "^6.4.5",
39
- "@testing-library/react": "^15.0.7",
40
- "@types/jest": "^29.5.12",
41
- "@types/node": "^20.11.30",
42
- "@types/react": "^18.2.71",
43
- "@types/react-dom": "^18.2.22",
44
- "@typescript-eslint/eslint-plugin": "^6.21.0",
45
- "@typescript-eslint/parser": "^6.21.0",
46
- "@vitejs/plugin-react": "^4.2.1",
47
- "eslint": "^8.57.0",
48
- "eslint-plugin-react-hooks": "^4.6.0",
49
- "eslint-plugin-react-refresh": "^0.4.6",
50
- "glob": "^10.3.10",
51
- "husky": "^9.0.11",
52
- "identity-obj-proxy": "^3.0.0",
53
- "jest": "^29.7.0",
54
- "jest-environment-jsdom": "^29.7.0",
55
- "jest-svg-transformer": "^1.0.0",
56
- "prettier": "^2.2.1",
57
- "react": "^18.2.0",
58
- "react-dom": "^18.2.0",
59
- "rollup-plugin-delete": "^2.0.0",
60
- "ts-jest": "^29.1.2",
61
- "typescript": "^5.4.3",
62
- "vite": "^4.5.3",
63
- "vite-plugin-dts": "^3.7.3",
64
- "vite-plugin-lib-inject-css": "^2.0.1"
65
- },
66
- "dependencies": {
67
- "axios": "^1.7.4"
68
- }
69
- }
1
+ {
2
+ "name": "@plurix/ecom-components",
3
+ "author": "Plurix",
4
+ "private": false,
5
+ "version": "1.20.1",
6
+ "type": "module",
7
+ "main": "dist/main.js",
8
+ "types": "dist/main.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/plurix-ecommerce/ecom-components.git"
15
+ },
16
+ "sideEffects": [
17
+ "**/*.css"
18
+ ],
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "build": "tsc --p ./tsconfig-build.json && vite build",
22
+ "format": "prettier --write .",
23
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
24
+ "prepare": "husky install",
25
+ "preview": "vite preview",
26
+ "test": "jest"
27
+ },
28
+ "peerDependencies": {
29
+ "react": "^18.2.0",
30
+ "react-dom": "^18.2.0"
31
+ },
32
+ "devDependencies": {
33
+ "@babel/preset-env": "^7.24.5",
34
+ "@babel/preset-react": "^7.24.1",
35
+ "@commitlint/cli": "^17.4.2",
36
+ "@commitlint/config-conventional": "^17.4.2",
37
+ "@jest/globals": "^29.7.0",
38
+ "@testing-library/jest-dom": "^6.4.5",
39
+ "@testing-library/react": "^15.0.7",
40
+ "@types/jest": "^29.5.12",
41
+ "@types/node": "^20.11.30",
42
+ "@types/react": "^18.2.71",
43
+ "@types/react-dom": "^18.2.22",
44
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
45
+ "@typescript-eslint/parser": "^6.21.0",
46
+ "@vitejs/plugin-react": "^4.2.1",
47
+ "eslint": "^8.57.0",
48
+ "eslint-plugin-react-hooks": "^4.6.0",
49
+ "eslint-plugin-react-refresh": "^0.4.6",
50
+ "glob": "^10.3.10",
51
+ "husky": "^9.0.11",
52
+ "identity-obj-proxy": "^3.0.0",
53
+ "jest": "^29.7.0",
54
+ "jest-environment-jsdom": "^29.7.0",
55
+ "jest-svg-transformer": "^1.0.0",
56
+ "prettier": "^2.2.1",
57
+ "react": "^18.2.0",
58
+ "react-dom": "^18.2.0",
59
+ "rollup-plugin-delete": "^2.0.0",
60
+ "ts-jest": "^29.1.2",
61
+ "typescript": "^5.4.3",
62
+ "vite": "^4.5.3",
63
+ "vite-plugin-dts": "^3.7.3",
64
+ "vite-plugin-lib-inject-css": "^2.0.1"
65
+ },
66
+ "dependencies": {
67
+ "axios": "^1.7.4"
68
+ }
69
+ }