@plurix/ecom-components 1.14.1-eng-task-1311.8 → 1.14.1-eng-task-1311.10

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.
@@ -9,22 +9,22 @@ import { ProductCardName as N } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as O } from "../ProductCardPrice/index.js";
10
10
  import { ProductCardPromotionFlag as B } from "../ProductCardPromotionFlag/index.js";
11
11
  const G = ({
12
- hasPlusFriendBadge: t,
12
+ hasPlusFriendBadge: a,
13
13
  promotion: i,
14
14
  product: e,
15
15
  hasPromotionalPrice: c,
16
16
  clubPrice: C,
17
17
  outOfStock: o,
18
- variant: a,
18
+ variant: t,
19
19
  defaultScListPrice: l,
20
- isClubClient: n,
20
+ isClubClient: u,
21
21
  addToCartAction: P,
22
22
  quantitySelectorAction: g,
23
23
  productInCart: h,
24
24
  openModal: S
25
25
  }) => {
26
26
  var f, d;
27
- const [k, m] = v(!1);
27
+ const [k, n] = v(!1);
28
28
  if (o)
29
29
  return /* @__PURE__ */ r(
30
30
  x,
@@ -34,7 +34,7 @@ const G = ({
34
34
  variant: "horizontal"
35
35
  }
36
36
  );
37
- const u = n && e.hasClubPrice;
37
+ const m = u && e.hasClubPrice;
38
38
  return /* @__PURE__ */ s(
39
39
  "div",
40
40
  {
@@ -52,9 +52,9 @@ const G = ({
52
52
  /* @__PURE__ */ r(
53
53
  M,
54
54
  {
55
- isProductClubAndClient: u,
56
- variant: a,
57
- hasPlusFriendBadge: t,
55
+ isProductClubAndClient: m,
56
+ variant: t,
57
+ hasPlusFriendBadge: a,
58
58
  promotion: i,
59
59
  image: (d = e.image) == null ? void 0 : d[0]
60
60
  }
@@ -64,7 +64,7 @@ const G = ({
64
64
  {
65
65
  className: "product-card-horizontal-description",
66
66
  style: {
67
- backgroundColor: u ? "#FDF3DE" : "var(--color-grayScale-faded)"
67
+ backgroundColor: m ? "#FDF3DE" : "var(--color-grayScale-faded)"
68
68
  },
69
69
  children: [
70
70
  /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
@@ -81,7 +81,7 @@ const G = ({
81
81
  unitMultiplier: e.unitMultiplier,
82
82
  skuSpecifications: e.skuSpecifications,
83
83
  measurementUnit: e.measurementUnit,
84
- setIsShowProductBadge: m
84
+ setIsShowProductBadge: n
85
85
  }
86
86
  ),
87
87
  /* @__PURE__ */ r(
@@ -94,17 +94,17 @@ const G = ({
94
94
  skuSpecifications: e.skuSpecifications,
95
95
  unitMultiplier: e.unitMultiplier,
96
96
  hasPromotionalPrice: c,
97
- setIsShowProductBadge: m
97
+ setIsShowProductBadge: n
98
98
  }
99
99
  )
100
100
  ]
101
101
  }
102
102
  )
103
103
  ] }),
104
- a === "horizontal" && /* @__PURE__ */ r(
104
+ t === "horizontal" && /* @__PURE__ */ r(
105
105
  B,
106
106
  {
107
- variant: a,
107
+ variant: t,
108
108
  productSectionBadge: {
109
109
  text: i == null ? void 0 : i.flagText,
110
110
  color: {
@@ -117,8 +117,7 @@ const G = ({
117
117
  /* @__PURE__ */ r(
118
118
  O,
119
119
  {
120
- name: e.name,
121
- isClubClient: n,
120
+ isClubClient: u,
122
121
  unitMultiplier: e.unitMultiplier,
123
122
  hasPromotionalPrice: c,
124
123
  measurementUnit: e.measurementUnit,
@@ -131,7 +130,7 @@ const G = ({
131
130
  },
132
131
  defaultScListPrice: l,
133
132
  clubPrice: C,
134
- hasPlusFriendBadge: t
133
+ hasPlusFriendBadge: a
135
134
  }
136
135
  )
137
136
  ]
@@ -146,7 +145,7 @@ const G = ({
146
145
  addToCartAction: P,
147
146
  quantitySelectorAction: g,
148
147
  productInCart: h,
149
- layout: a
148
+ layout: t
150
149
  }
151
150
  )
152
151
  ]
@@ -19,7 +19,6 @@ interface ProductCardPricesProps {
19
19
  hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
20
20
  unitMultiplier: number;
21
21
  hasPlusFriendBadge?: boolean;
22
- name: string;
23
22
  }
24
23
  export declare const ProductCardPrice: ({ clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
25
24
  interface getPriceToShowParams {
@@ -1,38 +1,35 @@
1
1
  import { jsx as e, Fragment as g, jsxs as a } from "react/jsx-runtime";
2
2
  const m = ({
3
- // skuSpecifications,
4
- // hasPromotionalPrice,
5
3
  clubPrice: c,
6
- unitMultiplier: n,
7
- // defaultScListPrice,
4
+ unitMultiplier: t,
8
5
  customOffers: r,
9
- measurementUnit: i,
6
+ measurementUnit: n,
10
7
  isClubClient: d,
11
- hasPlusFriendBadge: l
8
+ hasPlusFriendBadge: p
12
9
  }) => {
13
- const p = !!(c && c !== r.spotPriceCustom), o = (u) => u.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), t = P({
14
- measurementUnit: i,
10
+ const l = !!(c && c !== r.spotPriceCustom), o = (u) => u.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), i = h({
11
+ measurementUnit: n,
15
12
  spotPriceCustom: r.spotPriceCustom,
16
13
  spotPriceKg: r == null ? void 0 : r.spotPriceKg,
17
- unitMultiplier: n
18
- }), s = l ? "no + Amigo" : "no clube";
19
- return console.log(name, r.listPriceCustom), /* @__PURE__ */ e(g, { children: /* @__PURE__ */ a("div", { className: "product-card-price", children: [
20
- !d && p && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${o(c || 0)} ${s}` }) }),
14
+ unitMultiplier: t
15
+ }), s = p ? "no + Amigo" : "no clube";
16
+ return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ a("div", { className: "product-card-price", children: [
17
+ !d && l && c !== i && /* @__PURE__ */ e("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ e("p", { className: "product-card-club-price", children: `${o(c || 0)} ${s}` }) }),
21
18
  /* @__PURE__ */ a("div", { className: "product-card-price-container", children: [
22
- /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ a("span", { children: [
19
+ r.listPriceCustom !== i && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ a("span", { children: [
23
20
  " ",
24
21
  o(r.listPriceCustom)
25
22
  ] }) }),
26
- /* @__PURE__ */ e("p", { className: "product-card-new-price", children: o(t != null ? t : 0) })
23
+ /* @__PURE__ */ e("p", { className: "product-card-new-price", children: o(i != null ? i : 0) })
27
24
  ] })
28
25
  ] }) });
29
- }, P = ({
26
+ }, h = ({
30
27
  spotPriceKg: c,
31
- unitMultiplier: n,
28
+ unitMultiplier: t,
32
29
  measurementUnit: r,
33
- spotPriceCustom: i
34
- }) => r === "kg" && n < 1 ? i : r === "kg" ? c : i;
30
+ spotPriceCustom: n
31
+ }) => r === "kg" && t < 1 ? n : r === "kg" ? c : n;
35
32
  export {
36
33
  m as ProductCardPrice,
37
- P as getPriceToShow
34
+ h as getPriceToShow
38
35
  };
@@ -11,14 +11,14 @@ const V = ({
11
11
  hasPlusFriendBadge: r,
12
12
  promotion: f,
13
13
  product: i,
14
- hasPromotionalPrice: a,
14
+ hasPromotionalPrice: o,
15
15
  clubPrice: d,
16
16
  outOfStock: P,
17
17
  variant: t,
18
- defaultScListPrice: o,
18
+ defaultScListPrice: a,
19
19
  isClubClient: c,
20
- hasClub: C,
21
- openModal: p,
20
+ hasClub: p,
21
+ openModal: C,
22
22
  addToCartAction: g,
23
23
  quantitySelectorAction: S,
24
24
  productInCart: h
@@ -36,7 +36,7 @@ const V = ({
36
36
  );
37
37
  const n = c && i.hasClubPrice;
38
38
  return /* @__PURE__ */ s("div", { id: "product-card", children: [
39
- /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: p, children: [
39
+ /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: C, children: [
40
40
  /* @__PURE__ */ e(
41
41
  D,
42
42
  {
@@ -76,12 +76,12 @@ const V = ({
76
76
  N,
77
77
  {
78
78
  offers: i.offers,
79
- defaultScListPrice: o,
79
+ defaultScListPrice: a,
80
80
  nativeListPrice: i.customOffers.listPriceCustom,
81
81
  nativeSpotPrice: i.customOffers.spotPriceCustom,
82
82
  skuSpecifications: i.skuSpecifications,
83
83
  unitMultiplier: i.unitMultiplier,
84
- hasPromotionalPrice: a,
84
+ hasPromotionalPrice: o,
85
85
  setIsShowProductBadge: m
86
86
  }
87
87
  )
@@ -92,11 +92,10 @@ const V = ({
92
92
  /* @__PURE__ */ e(
93
93
  b,
94
94
  {
95
- name: i.name,
96
- hasClub: C,
95
+ hasClub: p,
97
96
  isClubClient: c,
98
97
  unitMultiplier: i.unitMultiplier,
99
- hasPromotionalPrice: a,
98
+ hasPromotionalPrice: o,
100
99
  measurementUnit: i.measurementUnit,
101
100
  skuSpecifications: i.skuSpecifications,
102
101
  customOffers: {
@@ -105,7 +104,7 @@ const V = ({
105
104
  spotPriceCustom: i.customOffers.spotPriceCustom,
106
105
  spotPriceKg: i.customOffers.spotPriceKg
107
106
  },
108
- defaultScListPrice: o,
107
+ defaultScListPrice: a,
109
108
  clubPrice: d,
110
109
  hasPlusFriendBadge: r
111
110
  }
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.1-eng-task-1311.8",
5
+ "version": "1.14.1-eng-task-1311.10",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",