@plurix/ecom-components 1.16.1-commerce.1 → 1.16.1-commerce.2

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.
@@ -4,7 +4,6 @@ interface ProductCardBadgeProps {
4
4
  unitMultiplier: number;
5
5
  skuSpecifications?: SkuSpecificationsProps[];
6
6
  measurementUnit?: string;
7
- setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
8
7
  }
9
- export declare const ProductCardBadgeKg: ({ measurementUnit, setIsShowProductBadge, unitMultiplier }: ProductCardBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const ProductCardBadgeKg: ({ measurementUnit, unitMultiplier }: ProductCardBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
10
9
  export {};
@@ -1,18 +1,14 @@
1
- import { jsx as a, jsxs as g } from "react/jsx-runtime";
2
- import { useEffect as o } from "react";
3
- const f = ({
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ const s = ({
4
3
  measurementUnit: c,
5
- setIsShowProductBadge: r,
6
4
  unitMultiplier: d
7
- }) => (o(() => {
8
- c !== "un" && (d < 1 || d >= 1) && r(!0);
9
- }, [c, d, r]), c === "un" ? null : d < 1 ? /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
5
+ }) => c === "un" ? null : d < 1 ? /* @__PURE__ */ r("div", { className: "product-card-badge", children: /* @__PURE__ */ a("p", { className: "product-card-badge-kg", children: [
10
6
  d * 1e3,
11
7
  "g"
12
- ] }) }) : /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
8
+ ] }) }) : /* @__PURE__ */ r("div", { className: "product-card-badge", children: /* @__PURE__ */ a("p", { className: "product-card-badge-kg", children: [
13
9
  d,
14
10
  "kg"
15
- ] }) }));
11
+ ] }) });
16
12
  export {
17
- f as ProductCardBadgeKg
13
+ s as ProductCardBadgeKg
18
14
  };
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as r } from "react/jsx-runtime";
2
2
  import { useState as v } from "react";
3
3
  import { ProductCardUnavailable as x } from "../ProducCardUnavailable/index.js";
4
4
  import { ProductCardBadgeKg as y } from "../ProductCardBadge/ProductCardBadgeKg.js";
@@ -7,26 +7,26 @@ import { ProductCardButton as b } from "../ProductCardButton/index.js";
7
7
  import { ProductCardImage as M } from "../ProductCardImage/index.js";
8
8
  import { ProductCardName as N } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as O } from "../ProductCardPrice/index.js";
10
- import { ProductCardPromotionFlag as B } from "../ProductCardPromotionFlag/index.js";
11
- const G = ({
12
- hasPlusFriendBadge: a,
10
+ import { ProductCardPromotionFlag as U } from "../ProductCardPromotionFlag/index.js";
11
+ const H = ({
12
+ hasPlusFriendBadge: t,
13
13
  promotion: i,
14
14
  product: e,
15
15
  hasPromotionalPrice: c,
16
16
  clubPrice: C,
17
- outOfStock: o,
18
- variant: t,
19
- defaultScListPrice: l,
20
- isClubClient: u,
17
+ outOfStock: l,
18
+ variant: a,
19
+ defaultScListPrice: o,
20
+ isClubClient: n,
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, n] = v(!1);
28
- if (o)
29
- return /* @__PURE__ */ r(
27
+ const [k, m] = v(!1);
28
+ if (l)
29
+ return /* @__PURE__ */ s(
30
30
  x,
31
31
  {
32
32
  image: (f = e.image) == null ? void 0 : f[0],
@@ -34,77 +34,77 @@ const G = ({
34
34
  variant: "horizontal"
35
35
  }
36
36
  );
37
- const m = u && e.hasClubPrice;
38
- return /* @__PURE__ */ s(
37
+ (e == null ? void 0 : e.measurementUnit) !== "un" && m(!0);
38
+ const u = n && e.hasClubPrice;
39
+ return /* @__PURE__ */ r(
39
40
  "div",
40
41
  {
41
42
  className: "product-card-horizontal",
42
43
  style: {
43
- backgroundColor: o ? "var(--color-grayScale-faded" : "#fff"
44
+ backgroundColor: l ? "var(--color-grayScale-faded" : "#fff"
44
45
  },
45
46
  children: [
46
- /* @__PURE__ */ s(
47
+ /* @__PURE__ */ r(
47
48
  "div",
48
49
  {
49
50
  onClick: S,
50
51
  className: "product-card-section-product-horizontal",
51
52
  children: [
52
- /* @__PURE__ */ r(
53
+ /* @__PURE__ */ s(
53
54
  M,
54
55
  {
55
- isProductClubAndClient: m,
56
- variant: t,
57
- hasPlusFriendBadge: a,
56
+ isProductClubAndClient: u,
57
+ variant: a,
58
+ hasPlusFriendBadge: t,
58
59
  promotion: i,
59
60
  image: (d = e.image) == null ? void 0 : d[0]
60
61
  }
61
62
  ),
62
- /* @__PURE__ */ s(
63
+ /* @__PURE__ */ r(
63
64
  "div",
64
65
  {
65
66
  className: "product-card-horizontal-description",
66
67
  style: {
67
- backgroundColor: m ? "#FDF3DE" : "var(--color-grayScale-faded)"
68
+ backgroundColor: u ? "#FDF3DE" : "var(--color-grayScale-faded)"
68
69
  },
69
70
  children: [
70
- /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
71
- /* @__PURE__ */ r(N, { name: e.name }),
72
- /* @__PURE__ */ s(
71
+ /* @__PURE__ */ r("div", { className: "product-card-section-name", children: [
72
+ /* @__PURE__ */ s(N, { name: e.name }),
73
+ /* @__PURE__ */ r(
73
74
  "div",
74
75
  {
75
76
  className: "product-card-section-badge-horizontal",
76
77
  style: { display: k ? "" : "none" },
77
78
  children: [
78
- /* @__PURE__ */ r(
79
+ /* @__PURE__ */ s(
79
80
  y,
80
81
  {
81
82
  unitMultiplier: e.unitMultiplier,
82
83
  skuSpecifications: e.skuSpecifications,
83
- measurementUnit: e.measurementUnit,
84
- setIsShowProductBadge: n
84
+ measurementUnit: e.measurementUnit
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ r(
87
+ /* @__PURE__ */ s(
88
88
  z,
89
89
  {
90
90
  offers: e.offers,
91
- defaultScListPrice: l,
91
+ defaultScListPrice: o,
92
92
  nativeListPrice: e.customOffers.listPriceCustom,
93
93
  nativeSpotPrice: e.customOffers.spotPriceCustom,
94
94
  skuSpecifications: e.skuSpecifications,
95
95
  unitMultiplier: e.unitMultiplier,
96
96
  hasPromotionalPrice: c,
97
- setIsShowProductBadge: n
97
+ setIsShowProductBadge: m
98
98
  }
99
99
  )
100
100
  ]
101
101
  }
102
102
  )
103
103
  ] }),
104
- t === "horizontal" && /* @__PURE__ */ r(
105
- B,
104
+ a === "horizontal" && /* @__PURE__ */ s(
105
+ U,
106
106
  {
107
- variant: t,
107
+ variant: a,
108
108
  productSectionBadge: {
109
109
  text: i == null ? void 0 : i.flagText,
110
110
  color: {
@@ -114,10 +114,10 @@ const G = ({
114
114
  }
115
115
  }
116
116
  ),
117
- /* @__PURE__ */ r(
117
+ /* @__PURE__ */ s(
118
118
  O,
119
119
  {
120
- isClubClient: u,
120
+ isClubClient: n,
121
121
  unitMultiplier: e.unitMultiplier,
122
122
  hasPromotionalPrice: c,
123
123
  measurementUnit: e.measurementUnit,
@@ -128,9 +128,9 @@ const G = ({
128
128
  spotPriceCustom: e.customOffers.spotPriceCustom,
129
129
  spotPriceKg: e.customOffers.spotPriceKg
130
130
  },
131
- defaultScListPrice: l,
131
+ defaultScListPrice: o,
132
132
  clubPrice: C,
133
- hasPlusFriendBadge: a
133
+ hasPlusFriendBadge: t
134
134
  }
135
135
  )
136
136
  ]
@@ -139,13 +139,13 @@ const G = ({
139
139
  ]
140
140
  }
141
141
  ),
142
- /* @__PURE__ */ r(
142
+ /* @__PURE__ */ s(
143
143
  b,
144
144
  {
145
145
  addToCartAction: P,
146
146
  quantitySelectorAction: g,
147
147
  productInCart: h,
148
- layout: t
148
+ layout: a
149
149
  }
150
150
  )
151
151
  ]
@@ -153,5 +153,5 @@ const G = ({
153
153
  );
154
154
  };
155
155
  export {
156
- G as ProductCardHorizontal
156
+ H as ProductCardHorizontal
157
157
  };
@@ -3,28 +3,28 @@ import { useState as v } from "react";
3
3
  import { ProductCardUnavailable as O } from "../ProducCardUnavailable/index.js";
4
4
  import { ProductCardBadgeKg as M } from "../ProductCardBadge/ProductCardBadgeKg.js";
5
5
  import { ProductCardDiscountBadge as N } from "../ProductCardBadge/ProductCardDiscountBadge.js";
6
- import { ProductCardButton as y } from "../ProductCardButton/index.js";
7
- import { ProductCardImage as D } from "../ProductCardImage/index.js";
8
- import { ProductCardName as U } from "../ProductCardName/index.js";
6
+ import { ProductCardButton as U } from "../ProductCardButton/index.js";
7
+ import { ProductCardImage as y } from "../ProductCardImage/index.js";
8
+ import { ProductCardName as D } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as b } from "../ProductCardPrice/index.js";
10
10
  const V = ({
11
11
  hasPlusFriendBadge: r,
12
- promotion: f,
12
+ promotion: l,
13
13
  product: i,
14
- hasPromotionalPrice: o,
14
+ hasPromotionalPrice: a,
15
15
  clubPrice: d,
16
16
  outOfStock: P,
17
17
  variant: t,
18
- defaultScListPrice: a,
19
- isClubClient: c,
20
- hasClub: p,
21
- openModal: C,
22
- addToCartAction: g,
18
+ defaultScListPrice: o,
19
+ isClubClient: m,
20
+ hasClub: C,
21
+ openModal: g,
22
+ addToCartAction: p,
23
23
  quantitySelectorAction: S,
24
24
  productInCart: h
25
25
  }) => {
26
- var u, l;
27
- const [k, m] = v(!1);
26
+ var u, f;
27
+ const [k, c] = v(!1);
28
28
  if (P)
29
29
  return /* @__PURE__ */ e(
30
30
  O,
@@ -34,17 +34,18 @@ const V = ({
34
34
  variant: t
35
35
  }
36
36
  );
37
- const n = c && i.hasClubPrice;
37
+ (i == null ? void 0 : i.measurementUnit) !== "un" && c(!0);
38
+ const n = m && i.hasClubPrice;
38
39
  return /* @__PURE__ */ s("div", { id: "product-card", children: [
39
- /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: C, children: [
40
+ /* @__PURE__ */ e("div", { className: "product-card", children: /* @__PURE__ */ s("div", { className: "product-card-container", onClick: g, children: [
40
41
  /* @__PURE__ */ e(
41
- D,
42
+ y,
42
43
  {
43
44
  isProductClubAndClient: n,
44
45
  variant: t,
45
46
  hasPlusFriendBadge: r,
46
- promotion: f,
47
- image: (l = i.image) == null ? void 0 : l[0]
47
+ promotion: l,
48
+ image: (f = i.image) == null ? void 0 : f[0]
48
49
  }
49
50
  ),
50
51
  /* @__PURE__ */ s(
@@ -56,7 +57,7 @@ const V = ({
56
57
  },
57
58
  children: [
58
59
  /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
59
- /* @__PURE__ */ e(U, { name: i.name }),
60
+ /* @__PURE__ */ e(D, { name: i.name }),
60
61
  /* @__PURE__ */ s(
61
62
  "div",
62
63
  {
@@ -68,21 +69,20 @@ const V = ({
68
69
  {
69
70
  unitMultiplier: i.unitMultiplier,
70
71
  skuSpecifications: i.skuSpecifications,
71
- measurementUnit: i.measurementUnit,
72
- setIsShowProductBadge: m
72
+ measurementUnit: i.measurementUnit
73
73
  }
74
74
  ),
75
75
  /* @__PURE__ */ e(
76
76
  N,
77
77
  {
78
78
  offers: i.offers,
79
- defaultScListPrice: a,
79
+ defaultScListPrice: o,
80
80
  nativeListPrice: i.customOffers.listPriceCustom,
81
81
  nativeSpotPrice: i.customOffers.spotPriceCustom,
82
82
  skuSpecifications: i.skuSpecifications,
83
83
  unitMultiplier: i.unitMultiplier,
84
- hasPromotionalPrice: o,
85
- setIsShowProductBadge: m
84
+ hasPromotionalPrice: a,
85
+ setIsShowProductBadge: c
86
86
  }
87
87
  )
88
88
  ]
@@ -92,10 +92,10 @@ const V = ({
92
92
  /* @__PURE__ */ e(
93
93
  b,
94
94
  {
95
- hasClub: p,
96
- isClubClient: c,
95
+ hasClub: C,
96
+ isClubClient: m,
97
97
  unitMultiplier: i.unitMultiplier,
98
- hasPromotionalPrice: o,
98
+ hasPromotionalPrice: a,
99
99
  measurementUnit: i.measurementUnit,
100
100
  skuSpecifications: i.skuSpecifications,
101
101
  customOffers: {
@@ -104,7 +104,7 @@ const V = ({
104
104
  spotPriceCustom: i.customOffers.spotPriceCustom,
105
105
  spotPriceKg: i.customOffers.spotPriceKg
106
106
  },
107
- defaultScListPrice: a,
107
+ defaultScListPrice: o,
108
108
  clubPrice: d,
109
109
  hasPlusFriendBadge: r
110
110
  }
@@ -114,9 +114,9 @@ const V = ({
114
114
  )
115
115
  ] }) }),
116
116
  /* @__PURE__ */ e(
117
- y,
117
+ U,
118
118
  {
119
- addToCartAction: g,
119
+ addToCartAction: p,
120
120
  quantitySelectorAction: S,
121
121
  productInCart: h,
122
122
  layout: t
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.16.1-commerce.1",
5
+ "version": "1.16.1-commerce.2",
6
6
  "type": "module",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/main.d.ts",