@plurix/ecom-components 1.16.4-commerce.1 → 1.16.4-commerce.3

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,7 +1,7 @@
1
- import { jsxs as o, jsx as C } from "react/jsx-runtime";
2
- const V = ({ account: i }) => {
3
- const t = i !== "domolivio" ? "#F4AF25" : "#181247", l = i !== "domolivio" ? "#2C3490" : "#EBE0CF";
4
- return /* @__PURE__ */ o(
1
+ import { jsxs as t, jsx as C } from "react/jsx-runtime";
2
+ const h = ({ account: i }) => {
3
+ const o = i === "domolivio" ? "#181247" : "#F4AF25", l = i === "domolivio" ? "#EBE0CF" : "#2C3490";
4
+ return /* @__PURE__ */ t(
5
5
  "svg",
6
6
  {
7
7
  "aria-label": "+amigo",
@@ -11,7 +11,7 @@ const V = ({ account: i }) => {
11
11
  viewBox: "0 0 51 18",
12
12
  fill: "none",
13
13
  children: [
14
- /* @__PURE__ */ C("rect", { width: "50.4", height: "18", rx: "4", fill: t }),
14
+ /* @__PURE__ */ C("rect", { width: "50.4", height: "18", rx: "4", fill: o }),
15
15
  /* @__PURE__ */ C(
16
16
  "path",
17
17
  {
@@ -66,14 +66,14 @@ const V = ({ account: i }) => {
66
66
  "path",
67
67
  {
68
68
  d: "M45.9811 4.56789C45.9811 5.8293 45 6.85186 43.7898 6.85186C42.5795 6.85186 41.5984 5.8293 41.5984 4.56789C41.5984 3.93719 42.0889 3.4259 42.6941 3.4259C43.2992 3.4259 43.7898 3.93719 43.7898 4.56789C43.7898 5.19857 44.2803 5.70988 44.8855 5.70988C45.4906 5.70988 45.9811 5.19857 45.9811 4.56789Z",
69
- fill: l
69
+ fill: i === "domolivio" ? "#F4AF25" : "#2C3490"
70
70
  }
71
71
  ),
72
72
  /* @__PURE__ */ C(
73
73
  "path",
74
74
  {
75
75
  d: "M45.9993 4.56786C45.9993 5.19845 45.5006 5.70976 44.8856 5.70976C44.2704 5.70976 43.7717 5.19845 43.7717 4.56786C43.7717 3.93728 44.2704 3.42596 44.8856 3.42596C45.5006 3.42596 45.9993 3.93728 45.9993 4.56786Z",
76
- fill: "white",
76
+ fill: i === "domolivio" ? "#FFCF70" : "white",
77
77
  fillOpacity: "0.7"
78
78
  }
79
79
  )
@@ -82,5 +82,5 @@ const V = ({ account: i }) => {
82
82
  );
83
83
  };
84
84
  export {
85
- V as ClubBadge
85
+ h as ClubBadge
86
86
  };
@@ -9,14 +9,14 @@ import { ProductCardName as p } from "../ProductCardName/index.js";
9
9
  import { ProductCardPrice as U } from "../ProductCardPrice/index.js";
10
10
  import { ProductCardPromotionFlag as E } from "../ProductCardPromotionFlag/index.js";
11
11
  const T = ({
12
- account: a,
12
+ account: r,
13
13
  hasPlusFriendBadge: c,
14
14
  promotion: i,
15
15
  product: e,
16
16
  hasPromotionalPrice: o,
17
17
  clubPrice: g,
18
18
  outOfStock: l,
19
- variant: r,
19
+ variant: a,
20
20
  defaultScListPrice: n,
21
21
  isClubClient: u,
22
22
  addToCartAction: P,
@@ -25,7 +25,7 @@ const T = ({
25
25
  openModal: S
26
26
  }) => {
27
27
  var f, d;
28
- const [b, k] = C(!1), [D, x] = C(!1), y = a !== "domolivio" ? "#FDF3DE" : "#EBE0CF";
28
+ const [b, k] = C(!1), [D, x] = C(!1), y = r === "domolivio" ? "#EBE0CF" : "#FDF3DE";
29
29
  if (l)
30
30
  return /* @__PURE__ */ s(
31
31
  z,
@@ -33,7 +33,7 @@ const T = ({
33
33
  image: (f = e.image) == null ? void 0 : f[0],
34
34
  name: e.name,
35
35
  variant: "horizontal",
36
- account: a
36
+ account: r
37
37
  }
38
38
  );
39
39
  const m = u && e.hasClubPrice;
@@ -55,11 +55,11 @@ const T = ({
55
55
  O,
56
56
  {
57
57
  isProductClubAndClient: m,
58
- variant: r,
58
+ variant: a,
59
59
  hasPlusFriendBadge: c,
60
60
  promotion: i,
61
61
  image: (d = e.image) == null ? void 0 : d[0],
62
- account: a
62
+ account: r
63
63
  }
64
64
  ),
65
65
  /* @__PURE__ */ t(
@@ -106,10 +106,10 @@ const T = ({
106
106
  }
107
107
  )
108
108
  ] }),
109
- r === "horizontal" && /* @__PURE__ */ s(
109
+ a === "horizontal" && /* @__PURE__ */ s(
110
110
  E,
111
111
  {
112
- variant: r,
112
+ variant: a,
113
113
  productSectionBadge: {
114
114
  text: i == null ? void 0 : i.flagText,
115
115
  color: {
@@ -122,6 +122,7 @@ const T = ({
122
122
  /* @__PURE__ */ s(
123
123
  U,
124
124
  {
125
+ account: r,
125
126
  isClubClient: u,
126
127
  unitMultiplier: e.unitMultiplier,
127
128
  hasPromotionalPrice: o,
@@ -150,7 +151,7 @@ const T = ({
150
151
  addToCartAction: P,
151
152
  quantitySelectorAction: h,
152
153
  productInCart: v,
153
- layout: r
154
+ layout: a
154
155
  }
155
156
  )
156
157
  ]
@@ -11,5 +11,5 @@ interface ProductCardImageProps {
11
11
  alternateName: string;
12
12
  };
13
13
  }
14
- export declare const ProductCardImage: ({ account, isProductClubAndClient, variant, hasPlusFriendBadge, image, promotion, }: ProductCardImageProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const ProductCardImage: ({ account, isProductClubAndClient, variant, hasPlusFriendBadge, image, promotion }: ProductCardImageProps) => import("react/jsx-runtime").JSX.Element;
15
15
  export {};
@@ -1,6 +1,7 @@
1
1
  import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
2
2
 
3
3
  interface ProductCardPricesProps {
4
+ account: string;
4
5
  clubPrice?: number;
5
6
  hasUnd?: string;
6
7
  oldPrice?: string;
@@ -20,7 +21,7 @@ interface ProductCardPricesProps {
20
21
  unitMultiplier: number;
21
22
  hasPlusFriendBadge?: boolean;
22
23
  }
23
- export declare const ProductCardPrice: ({ clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const ProductCardPrice: ({ account, clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
24
25
  interface getPriceToShowParams {
25
26
  spotPriceKg: number | undefined | null;
26
27
  unitMultiplier: number;
@@ -1,35 +1,46 @@
1
- import { jsx as e, Fragment as g, jsxs as a } from "react/jsx-runtime";
2
- const m = ({
1
+ import { jsx as i, Fragment as P, jsxs as n } from "react/jsx-runtime";
2
+ const x = ({
3
+ account: e,
3
4
  clubPrice: c,
4
5
  unitMultiplier: t,
5
6
  customOffers: r,
6
- measurementUnit: n,
7
- isClubClient: d,
7
+ measurementUnit: d,
8
+ isClubClient: a,
8
9
  hasPlusFriendBadge: p
9
10
  }) => {
10
- const l = !!(c && c !== r.spotPriceCustom), o = (u) => u.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), i = h({
11
- measurementUnit: n,
11
+ const s = !!(c && c !== r.spotPriceCustom), l = (C) => C.toLocaleString("pt-br", { style: "currency", currency: "BRL" }), o = g({
12
+ measurementUnit: d,
12
13
  spotPriceCustom: r.spotPriceCustom,
13
14
  spotPriceKg: r == null ? void 0 : r.spotPriceKg,
14
15
  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}` }) }),
18
- /* @__PURE__ */ a("div", { className: "product-card-price-container", children: [
19
- r.listPriceCustom !== i && /* @__PURE__ */ e("p", { className: "product-card-old-price", children: /* @__PURE__ */ a("span", { children: [
16
+ }), u = p ? "no +amigo" : "no clube";
17
+ return /* @__PURE__ */ i(P, { children: /* @__PURE__ */ n("div", { className: "product-card-price", children: [
18
+ !a && s && c !== o && /* @__PURE__ */ i("div", { className: "product-card-club-price-container", children: /* @__PURE__ */ i(
19
+ "p",
20
+ {
21
+ className: "product-card-club-price",
22
+ style: {
23
+ backgroundColor: e === "domolivio" ? "#EAE0D0" : "#F4AF25",
24
+ color: e === "domolivio" ? "#181247" : "#2c3490"
25
+ },
26
+ children: `${l(c || 0)} ${u}`
27
+ }
28
+ ) }),
29
+ /* @__PURE__ */ n("div", { className: "product-card-price-container", children: [
30
+ r.listPriceCustom !== o && /* @__PURE__ */ i("p", { className: "product-card-old-price", children: /* @__PURE__ */ n("span", { children: [
20
31
  " ",
21
- o(r.listPriceCustom)
32
+ l(r.listPriceCustom)
22
33
  ] }) }),
23
- /* @__PURE__ */ e("p", { className: "product-card-new-price", children: o(i != null ? i : 0) })
34
+ /* @__PURE__ */ i("p", { className: "product-card-new-price", children: l(o != null ? o : 0) })
24
35
  ] })
25
36
  ] }) });
26
- }, h = ({
27
- spotPriceKg: c,
28
- unitMultiplier: t,
29
- measurementUnit: r,
30
- spotPriceCustom: n
31
- }) => r === "kg" && t < 1 ? n : r === "kg" ? c : n;
37
+ }, g = ({
38
+ spotPriceKg: e,
39
+ unitMultiplier: c,
40
+ measurementUnit: t,
41
+ spotPriceCustom: r
42
+ }) => t === "kg" && c < 1 ? r : t === "kg" ? e : r;
32
43
  export {
33
- m as ProductCardPrice,
34
- h as getPriceToShow
44
+ x as ProductCardPrice,
45
+ g as getPriceToShow
35
46
  };
@@ -12,11 +12,11 @@ const G = ({
12
12
  hasPlusFriendBadge: o,
13
13
  promotion: d,
14
14
  product: i,
15
- hasPromotionalPrice: c,
15
+ hasPromotionalPrice: a,
16
16
  clubPrice: P,
17
17
  outOfStock: p,
18
18
  variant: r,
19
- defaultScListPrice: a,
19
+ defaultScListPrice: c,
20
20
  isClubClient: m,
21
21
  hasClub: C,
22
22
  openModal: g,
@@ -25,7 +25,7 @@ const G = ({
25
25
  productInCart: S
26
26
  }) => {
27
27
  var l, u;
28
- const [k, b] = f(!1), [D, O] = f(!1), B = t !== "domolivio" ? "#FDF3DE" : "#EBE0CF";
28
+ const [k, b] = f(!1), [D, O] = f(!1), B = t === "domolivio" ? "#EBE0CF" : "#FDF3DE";
29
29
  if (p)
30
30
  return /* @__PURE__ */ e(
31
31
  M,
@@ -81,12 +81,12 @@ const G = ({
81
81
  y,
82
82
  {
83
83
  offers: i.offers,
84
- defaultScListPrice: a,
84
+ defaultScListPrice: c,
85
85
  nativeListPrice: i.customOffers.listPriceCustom,
86
86
  nativeSpotPrice: i.customOffers.spotPriceCustom,
87
87
  skuSpecifications: i.skuSpecifications,
88
88
  unitMultiplier: i.unitMultiplier,
89
- hasPromotionalPrice: c,
89
+ hasPromotionalPrice: a,
90
90
  setIsShowProductBadge: b
91
91
  }
92
92
  )
@@ -97,10 +97,11 @@ const G = ({
97
97
  /* @__PURE__ */ e(
98
98
  I,
99
99
  {
100
+ account: t,
100
101
  hasClub: C,
101
102
  isClubClient: m,
102
103
  unitMultiplier: i.unitMultiplier,
103
- hasPromotionalPrice: c,
104
+ hasPromotionalPrice: a,
104
105
  measurementUnit: i.measurementUnit,
105
106
  skuSpecifications: i.skuSpecifications,
106
107
  customOffers: {
@@ -109,7 +110,7 @@ const G = ({
109
110
  spotPriceCustom: i.customOffers.spotPriceCustom,
110
111
  spotPriceKg: i.customOffers.spotPriceKg
111
112
  },
112
- defaultScListPrice: a,
113
+ defaultScListPrice: c,
113
114
  clubPrice: P,
114
115
  hasPlusFriendBadge: o
115
116
  }
package/package.json CHANGED
@@ -1,69 +1,69 @@
1
- {
2
- "name": "@plurix/ecom-components",
3
- "author": "Plurix",
4
- "private": false,
5
- "version": "1.16.4-commerce.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
- }
1
+ {
2
+ "name": "@plurix/ecom-components",
3
+ "author": "Plurix",
4
+ "private": false,
5
+ "version": "1.16.4-commerce.3",
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
+ }