@plurix/ecom-components 1.9.0 → 1.10.0

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.
@@ -3,6 +3,7 @@ interface CartClubAlertProps {
3
3
  discount: string;
4
4
  participeLink: string;
5
5
  learnMoreLink: string;
6
+ hasPlusFriendBadge?: boolean;
6
7
  }
7
- export declare const CartClubAlert: ({ discount, participeLink, learnMoreLink }: CartClubAlertProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CartClubAlert: ({ discount, participeLink, learnMoreLink, hasPlusFriendBadge }: CartClubAlertProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,13 +1,18 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { DiscountIcon as l } from "../../assets/svgs/DiscountIcon.js";
3
- /* empty css */const d = ({
2
+ import { DiscountIcon as s } from "../../assets/svgs/DiscountIcon.js";
3
+ /* empty css */const t = ({
4
4
  discount: a,
5
5
  participeLink: c,
6
- learnMoreLink: o
6
+ learnMoreLink: o,
7
+ hasPlusFriendBadge: l = !1
7
8
  }) => /* @__PURE__ */ r("div", { className: "club-cart-alert-container", children: [
8
9
  /* @__PURE__ */ r("header", { children: [
9
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(l, {}) }),
10
- /* @__PURE__ */ e("p", { className: "club-infos-container", children: "Produtos do seu carrinho estão em promoção no Clube de Fidelidade" })
10
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(s, {}) }),
11
+ /* @__PURE__ */ r("p", { className: "club-infos-container", children: [
12
+ "Produtos do seu carrinho estão em promoção no",
13
+ " ",
14
+ l ? "+ Amigo" : "Clube de Fidelidade"
15
+ ] })
11
16
  ] }),
12
17
  /* @__PURE__ */ r("p", { className: "club-alert-ad", children: [
13
18
  "Tenha ",
@@ -18,5 +23,5 @@ import { DiscountIcon as l } from "../../assets/svgs/DiscountIcon.js";
18
23
  /* @__PURE__ */ e("a", { className: "club-more-infos", href: o, children: "Saber Mais" })
19
24
  ] });
20
25
  export {
21
- d as CartClubAlert
26
+ t as CartClubAlert
22
27
  };
@@ -1,104 +1,105 @@
1
- import { jsx as a, jsxs as j, Fragment as q } from "react/jsx-runtime";
2
- import { useState as u, useEffect as w } from "react";
1
+ import { jsx as n, jsxs as j, Fragment as q } from "react/jsx-runtime";
2
+ import { useState as e, useEffect as w } from "react";
3
3
  import { Modal as M } from "../Modal/Modal.js";
4
- import { ProductSelected as k } from "./components/ProductSelected.js";
5
- import { SimilarProducts as v } from "./components/SimilarProducts.js";
6
- import { ModalFooter as A } from "./components/ModalFooter.js";
7
- /* empty css */import { Skeleton as E } from "@acctglobal/skeleton";
8
- import { getProductsSimilars as N } from "./api/getProductsSimilars.js";
4
+ import { ProductSelected as N } from "./components/ProductSelected.js";
5
+ import { SimilarProducts as k } from "./components/SimilarProducts.js";
6
+ import { ModalFooter as v } from "./components/ModalFooter.js";
7
+ /* empty css */import { Skeleton as A } from "@acctglobal/skeleton";
8
+ import { getProductsSimilars as E } from "./api/getProductsSimilars.js";
9
9
  import _ from "../../hooks/useAnalitcsEvents.js";
10
- import { getOrderForm as J } from "./api/getOrderForm.js";
11
- import { postChangeOrder as L } from "./api/postChangeOrder.js";
12
- const D = ({
13
- selectedItem: r,
14
- postalCode: g,
15
- orderFormId: c,
16
- isClubClient: S,
17
- isOpen: h,
18
- environment: y,
19
- setIsOpen: e,
20
- saveSelectedSimilarProduct: d
10
+ import { NoSimilarProduct as J } from "./components/NoSimilarProduct.js";
11
+ import { getOrderForm as L } from "./api/getOrderForm.js";
12
+ import { postChangeOrder as T } from "./api/postChangeOrder.js";
13
+ const oo = ({
14
+ selectedItem: o,
15
+ postalCode: S,
16
+ orderFormId: f,
17
+ isClubClient: h,
18
+ isOpen: y,
19
+ environment: O,
20
+ setIsOpen: l,
21
+ saveSelectedSimilarProduct: m
21
22
  }) => {
22
- const [O, b] = u(), [C, s] = u(!1), n = y === "io", { genericTaggingEvent: F } = _(), [o, f] = u({ itemId: "" });
23
+ const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = _(), [r, p] = e({ itemId: "" });
23
24
  return w(() => {
24
25
  (async () => {
25
26
  s(!0);
26
27
  try {
27
- const i = await N({
28
- postalCode: g,
29
- selectedItem: r,
30
- isIO: n
31
- });
32
- b(i == null ? void 0 : i.products);
28
+ const t = await E({
29
+ postalCode: S,
30
+ selectedItem: o,
31
+ isIO: a
32
+ }), d = (t == null ? void 0 : t.products) || [];
33
+ b(d);
33
34
  } finally {
34
35
  s(!1);
35
36
  }
36
37
  })(), (async () => {
37
- var i, l;
38
+ var t, d;
38
39
  s(!0);
39
40
  try {
40
- const m = await J(c, n), t = ((l = (i = m == null ? void 0 : m.customData) == null ? void 0 : i.customApps) == null ? void 0 : l.find(
41
+ const c = await L(f, a), i = ((d = (t = c == null ? void 0 : c.customData) == null ? void 0 : t.customApps) == null ? void 0 : d.find(
41
42
  (x) => x.id === "janis"
42
43
  )) || null;
43
- let p = {};
44
- t != null && t.fields.idSubstitutionCriterias && (p = JSON.parse(
45
- t == null ? void 0 : t.fields.idSubstitutionCriterias
44
+ let g = {};
45
+ i != null && i.fields.idSubstitutionCriterias && (g = JSON.parse(
46
+ i == null ? void 0 : i.fields.idSubstitutionCriterias
46
47
  ));
47
- const P = r == null ? void 0 : r.productOriginId;
48
- f({
49
- itemId: `${p[P]}`
48
+ const F = o == null ? void 0 : o.productOriginId;
49
+ p({
50
+ itemId: `${g[F]}`
50
51
  });
51
52
  } finally {
52
53
  s(!1);
53
54
  }
54
55
  })();
55
- }, []), /* @__PURE__ */ a(
56
+ }, []), /* @__PURE__ */ n(
56
57
  M,
57
58
  {
58
- isOpen: h,
59
- setIsOpen: e,
59
+ isOpen: y,
60
+ setIsOpen: l,
60
61
  className: "change-order-modal",
61
62
  title: "Produto com estoque baixo",
62
- Footer: /* @__PURE__ */ a(
63
- A,
63
+ Footer: /* @__PURE__ */ n(
64
+ v,
64
65
  {
65
66
  saveSelectedSimilarProduct: () => {
66
- L(
67
- c,
68
- n,
69
- r.productOriginId,
70
- o.itemId
71
- ), o && (d == null || d(o), F("salvar_substituto", {
72
- name: r.name,
73
- replacement_item: o == null ? void 0 : o.name
74
- })), e(!1);
67
+ T(
68
+ f,
69
+ a,
70
+ o.productOriginId,
71
+ r.itemId
72
+ ), r && (m == null || m(r), C("salvar_substituto", {
73
+ name: o.name,
74
+ replacement_item: r == null ? void 0 : r.name
75
+ })), l(!1);
75
76
  }
76
77
  }
77
78
  ),
78
- children: C ? /* @__PURE__ */ a(
79
- E,
79
+ children: P ? /* @__PURE__ */ n(
80
+ A,
80
81
  {
81
- width: n ? "100%" : "90%",
82
- height: n ? 600 : 425,
82
+ width: a ? "100%" : "90%",
83
+ height: a ? 600 : 425,
83
84
  backgroundColor: "var(--color-grayScale-faded)",
84
85
  margin: "auto",
85
86
  animation: !0
86
87
  }
87
88
  ) : /* @__PURE__ */ j(q, { children: [
88
- r && /* @__PURE__ */ a(k, { selectedItem: r }),
89
- /* @__PURE__ */ a(
90
- v,
89
+ o && /* @__PURE__ */ n(N, { selectedItem: o }),
90
+ u && u.length > 0 ? /* @__PURE__ */ n(
91
+ k,
91
92
  {
92
- isClubClient: S,
93
- similarProductSelect: o,
94
- setSimilarProductSelect: f,
95
- products: O
93
+ isClubClient: h,
94
+ similarProductSelect: r,
95
+ setSimilarProductSelect: p,
96
+ products: u
96
97
  }
97
- )
98
+ ) : /* @__PURE__ */ n(J, {})
98
99
  ] })
99
100
  }
100
101
  );
101
102
  };
102
103
  export {
103
- D as ChangeOrderModal
104
+ oo as ChangeOrderModal
104
105
  };
@@ -0,0 +1 @@
1
+ export declare const NoSimilarProduct: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsxs as s, jsx as o } from "react/jsx-runtime";
2
+ import { GroceriesShopping as r } from "../../../assets/svgs/GroceriesShopping.js";
3
+ const i = () => /* @__PURE__ */ s("section", { className: "change-order-no-similar-products", children: [
4
+ /* @__PURE__ */ o("h3", { className: "no-similar-title", children: "Nesse momento este produto não possui um substituto automático!" }),
5
+ /* @__PURE__ */ o(r, {})
6
+ ] });
7
+ export {
8
+ i as NoSimilarProduct
9
+ };
@@ -1 +1 @@
1
- .change-order-modal p{margin:0;padding:0}.change-order-modal #modal-content-container{width:100%}.change-order-modal #modal-content-container #modal-content{display:flex;flex-direction:column;background-color:var(--color-grayScale-white);border-radius:16px 16px 0 0}.change-order-modal #modal-content-container #modal-content #modal-scroll{flex:1}.change-order-modal #modal-content-container #modal-pre-content{padding:16px}.change-order-modal #modal-content-container #modal-content header{width:100%;display:flex;justify-content:space-between;padding:24px 16px 16px;align-items:center}.change-order-modal #modal-content-container #modal-content header .modal-title{font-size:24px;font-weight:700;line-height:28px;color:var(--color-grayScale)}.change-order-modal .modal-close{background:none;border:none;cursor:pointer}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content{border-radius:16px}.change-order-modal header .modal-title{font-size:24px;line-height:28px}}.change-order-modal #modal-content-container #modal-content .change-order-pre-content{display:flex;margin:16px}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos{width:100%;margin-left:8px}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details{display:flex;justify-content:space-between;align-items:center}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .quantity{color:var(--color-grayScale);font-size:14px;line-height:18px;font-weight:700}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .sellingPrice-multiply{font-weight:400}.change-order-modal #modal-content-container{max-height:675px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .quantity{font-size:16px;line-height:20px}.change-order-modal #modal-content-container{max-height:716px}}.change-order-modal #modal-content-container #modal-content .change-order-similar-products{overflow-y:auto;margin:0 8px;padding:8px;height:80%}.change-order-modal #modal-content-container #modal-content .change-order-similar-products::-webkit-scrollbar{width:4px;background-color:var(--color-main-faded)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products::-webkit-scrollbar-thumb{width:3px;padding-top:16px;background-color:var(--color-main);max-height:34px;border-radius:20px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .remove-buttom{color:var(--color-negativeFeedback);background-color:transparent;border:none;font-weight:700;font-size:14px;line-height:18px;display:flex;align-items:center;justify-content:center;margin:22px 0;column-gap:4px;text-decoration:underline;cursor:pointer}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .title{font-size:14px;line-height:18px;font-weight:700;color:var(--color-grayScale);margin-bottom:16px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .change-order-similar-products .remove-buttom{margin:16px 0}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .title{font-size:20px;line-height:24px}}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list{display:flex;row-gap:16px;flex-direction:column}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item{display:flex;border-style:solid;border-width:1px;border-radius:8px;padding:8px;width:100%}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item{display:flex;cursor:pointer;background-color:var(--color-grayScale-white)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos{width:100%;margin-left:8px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .description{width:100%;display:flex;justify-content:space-between}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .seal-container{display:flex;gap:4px;flex-wrap:wrap;margin:4px 0}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .seal{color:var(--color-grayScale-white);font-size:9px;list-style:16px;text-align:center;padding:4px;border-radius:2px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .description .choose-icon{width:16px;height:16px;border-radius:100%;display:flex;align-items:center;justify-content:center}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount .list-price{font-size:12px;line-height:16px;font-weight:400;color:var(--color-grayScale-dark);text-decoration:line-through}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount{display:flex;column-gap:4px;align-items:center}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount .badge{width:46px;height:17px;justify-content:center;display:flex;align-items:center;padding:4px;color:var(--color-main);border-radius:16px;font-size:12px;font-weight:700;background-color:var(--color-secondary)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices{display:flex;flex-direction:column;row-gap:5px}.change-order-modal #modal-content-container .modal-footer{border-radius:0 0 16px 16px;padding:16px}.change-order-modal .change-order-moda-footer .change-order-save-buttom{width:100%;height:34px;background-color:var(--color-main);border-color:transparent;border-radius:2px;color:var(--color-assistant-main);font-size:14px;line-height:18px;font-weight:500;cursor:pointer}.change-order-modal #modal-content-container #modal-content .product-name{font-size:16px;line-height:20px;font-weight:400;color:var(--color-grayScale);margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:start}.change-order-modal #modal-content-container #modal-content .badge{padding:1px 4px;color:var(--color-main);border-radius:16px;font-size:12px;font-weight:700;background-color:var(--color-secondary)}.change-order-modal #modal-content-container #modal-content .sellingPrice{color:var(--color-main);font-size:20px;line-height:24px;font-weight:600;display:flex;align-items:center;column-gap:1px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .sellingPrice{font-size:20px;line-height:24px}}@media (max-width: 992px){.change-order-modal .choose-icon{flex:0 0 16px;margin-left:8px}}
1
+ .change-order-modal p{margin:0;padding:0}.change-order-modal #modal-content-container{width:100%}.change-order-modal #modal-content-container #modal-content{display:flex;flex-direction:column;background-color:var(--color-grayScale-white);border-radius:16px 16px 0 0}.change-order-modal #modal-content-container #modal-content #modal-scroll{flex:1}.change-order-modal #modal-content-container #modal-pre-content{padding:16px}.change-order-modal #modal-content-container #modal-content header{width:100%;display:flex;justify-content:space-between;padding:24px 16px 16px;align-items:center}.change-order-modal #modal-content-container #modal-content header .modal-title{font-size:24px;font-weight:700;line-height:28px;color:var(--color-grayScale)}.change-order-modal .modal-close{background:none;border:none;cursor:pointer}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content{border-radius:16px}.change-order-modal header .modal-title{font-size:24px;line-height:28px}}.change-order-modal #modal-content-container #modal-content .change-order-pre-content{display:flex;margin:16px}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos{width:100%;margin-left:8px}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details{display:flex;justify-content:space-between;align-items:center}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .quantity{color:var(--color-grayScale);font-size:14px;line-height:18px;font-weight:700}.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .sellingPrice-multiply{font-weight:400}.change-order-modal #modal-content-container{max-height:675px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .change-order-pre-content .change-order-pre-content-infos .product-details .quantity{font-size:16px;line-height:20px}.change-order-modal #modal-content-container{max-height:716px}}.change-order-modal #modal-content-container #modal-content .change-order-similar-products{overflow-y:auto;margin:0 8px;padding:8px;height:80%}.change-order-modal #modal-content-container #modal-content .change-order-similar-products::-webkit-scrollbar{width:4px;background-color:var(--color-main-faded)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products::-webkit-scrollbar-thumb{width:3px;padding-top:16px;background-color:var(--color-main);max-height:34px;border-radius:20px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .remove-buttom{color:var(--color-negativeFeedback);background-color:transparent;border:none;font-weight:700;font-size:14px;line-height:18px;display:flex;align-items:center;justify-content:center;margin:22px 0;column-gap:4px;text-decoration:underline;cursor:pointer}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .title{font-size:14px;line-height:18px;font-weight:700;color:var(--color-grayScale);margin-bottom:16px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .change-order-similar-products .remove-buttom{margin:16px 0}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .title{font-size:20px;line-height:24px}}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list{display:flex;row-gap:16px;flex-direction:column}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item{display:flex;border-style:solid;border-width:1px;border-radius:8px;padding:8px;width:100%}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item{display:flex;cursor:pointer;background-color:var(--color-grayScale-white)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos{width:100%;margin-left:8px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .description{width:100%;display:flex;justify-content:space-between}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .seal-container{display:flex;gap:4px;flex-wrap:wrap;margin:4px 0}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .seal{color:var(--color-grayScale-white);font-size:9px;list-style:16px;text-align:center;padding:4px;border-radius:2px}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .description .choose-icon{width:16px;height:16px;border-radius:100%;display:flex;align-items:center;justify-content:center}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount .list-price{font-size:12px;line-height:16px;font-weight:400;color:var(--color-grayScale-dark);text-decoration:line-through}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount{display:flex;column-gap:4px;align-items:center}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices .discount .badge{width:46px;height:17px;justify-content:center;display:flex;align-items:center;padding:4px;color:var(--color-main);border-radius:16px;font-size:12px;font-weight:700;background-color:var(--color-secondary)}.change-order-modal #modal-content-container #modal-content .change-order-similar-products .similar-product-list .similar-product-list-item .infos .prices{display:flex;flex-direction:column;row-gap:5px}.change-order-no-similar-products{display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.no-similar-title{font-size:14px;line-height:18px;font-weight:700;color:var(--color-grayScale);margin-bottom:16px;margin-top:16px}.change-order-modal #modal-content-container .modal-footer{border-radius:0 0 16px 16px;padding:16px}.change-order-modal .change-order-moda-footer .change-order-save-buttom{width:100%;height:34px;background-color:var(--color-main);border-color:transparent;border-radius:2px;color:var(--color-assistant-main);font-size:14px;line-height:18px;font-weight:500;cursor:pointer}.change-order-modal #modal-content-container #modal-content .product-name{font-size:16px;line-height:20px;font-weight:400;color:var(--color-grayScale);margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:start}.change-order-modal #modal-content-container #modal-content .badge{padding:1px 4px;color:var(--color-main);border-radius:16px;font-size:12px;font-weight:700;background-color:var(--color-secondary)}.change-order-modal #modal-content-container #modal-content .sellingPrice{color:var(--color-main);font-size:20px;line-height:24px;font-weight:600;display:flex;align-items:center;column-gap:1px}@media (min-width: 768px){.change-order-modal #modal-content-container #modal-content .sellingPrice{font-size:20px;line-height:24px}}@media (max-width: 992px){.change-order-modal .choose-icon{flex:0 0 16px;margin-left:8px}}
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.9.0",
5
+ "version": "1.10.0",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",