@plurix/ecom-components 1.14.1-eng-task-1311.13 → 1.14.1-eng-task-1332.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.
Files changed (41) hide show
  1. package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +45 -0
  2. package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +34 -0
  3. package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +29 -0
  4. package/dist/packages/Carousel/Carousel.js +1 -1
  5. package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
  6. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +12 -12
  7. package/dist/packages/Coupons/Coupons.js +1 -1
  8. package/dist/packages/Coupons/api/addCoupon.js +6 -6
  9. package/dist/packages/Coupons/api/getCoupons.js +7 -5
  10. package/dist/packages/Coupons/views/LoadingView.js +6 -6
  11. package/dist/packages/Modal/Modal.js +1 -1
  12. package/dist/packages/Onboarding/Onboarding.js +1 -1
  13. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +2 -3
  14. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +31 -15
  15. package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
  16. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +2 -17
  17. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
  18. package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
  19. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +30 -31
  20. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +1 -8
  21. package/dist/packages/ProductCard/ProductCardPrice/index.js +31 -27
  22. package/dist/packages/ProductCard/ProductCardVertical/index.js +15 -16
  23. package/dist/packages/ProductCard/index.js +1 -1
  24. package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
  25. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  26. package/dist/packages/Regionalization/Regionalization.js +13 -15
  27. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  28. package/dist/packages/Regionalization/context/RegionalizationContext.js +29 -31
  29. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +0 -1
  30. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  31. package/dist/packages/Tour/Tour.js +1 -1
  32. package/dist/styles/product-card.global.css +1 -1
  33. package/dist/styles/regionalization.global.css +1 -1
  34. package/dist/types/ProductCard.d.ts +12 -13
  35. package/package.json +3 -1
  36. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +0 -18
  37. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +0 -80
  38. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +0 -10
  39. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +0 -61
  40. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +0 -8
  41. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +0 -44
@@ -0,0 +1,45 @@
1
+ var R = Object.defineProperty;
2
+ var o = Object.getOwnPropertySymbols;
3
+ var b = Object.prototype.hasOwnProperty, m = Object.prototype.propertyIsEnumerable;
4
+ var l = (e, a, t) => a in e ? R(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, p = (e, a) => {
5
+ for (var t in a || (a = {}))
6
+ b.call(a, t) && l(e, t, a[t]);
7
+ if (o)
8
+ for (var t of o(a))
9
+ m.call(a, t) && l(e, t, a[t]);
10
+ return e;
11
+ };
12
+ var c = (e, a) => {
13
+ var t = {};
14
+ for (var r in e)
15
+ b.call(e, r) && a.indexOf(r) < 0 && (t[r] = e[r]);
16
+ if (e != null && o)
17
+ for (var r of o(e))
18
+ a.indexOf(r) < 0 && m.call(e, r) && (t[r] = e[r]);
19
+ return t;
20
+ };
21
+ import n, { forwardRef as h } from "react";
22
+ import k from "../Loader/Loader.js";
23
+ const x = h(function(y, w) {
24
+ var s = y, { children: a, variant: t, inverse: r, size: i = "regular", testId: E = "fs-button", loading: f, loadingLabel: g, icon: u, iconPosition: d = "left", disabled: B } = s, v = c(s, ["children", "variant", "inverse", "size", "testId", "loading", "loadingLabel", "icon", "iconPosition", "disabled"]);
25
+ return n.createElement(
26
+ "button",
27
+ p({ ref: w, "data-fs-button": !0, "data-fs-button-inverse": r, "data-fs-button-size": i, "data-fs-button-loading": f, "data-fs-button-variant": t, disabled: B, "data-testid": E }, v),
28
+ n.createElement(
29
+ "div",
30
+ { "data-fs-button-wrapper": !0 },
31
+ f && n.createElement(
32
+ "p",
33
+ { "data-fs-button-loading-label": !0 },
34
+ g,
35
+ n.createElement(k, { variant: t === "primary" && !r ? "light" : "dark" })
36
+ ),
37
+ !!u && d === "left" && n.createElement("span", { "data-fs-button-icon": !0 }, u),
38
+ a && n.createElement("span", null, a),
39
+ !!u && d === "right" && n.createElement("span", { "data-fs-button-icon": !0 }, u)
40
+ )
41
+ );
42
+ }), j = x;
43
+ export {
44
+ j as default
45
+ };
@@ -0,0 +1,34 @@
1
+ var u = Object.defineProperty;
2
+ var d = Object.getOwnPropertySymbols;
3
+ var f = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
4
+ var s = (e, t, a) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, m = (e, t) => {
5
+ for (var a in t || (t = {}))
6
+ f.call(t, a) && s(e, a, t[a]);
7
+ if (d)
8
+ for (var a of d(t))
9
+ l.call(t, a) && s(e, a, t[a]);
10
+ return e;
11
+ };
12
+ var c = (e, t) => {
13
+ var a = {};
14
+ for (var r in e)
15
+ f.call(e, r) && t.indexOf(r) < 0 && (a[r] = e[r]);
16
+ if (e != null && d)
17
+ for (var r of d(e))
18
+ t.indexOf(r) < 0 && l.call(e, r) && (a[r] = e[r]);
19
+ return a;
20
+ };
21
+ import o, { forwardRef as p } from "react";
22
+ const E = p(function(L, i) {
23
+ var n = L, { testId: t = "fs-loader", variant: a = "dark" } = n, r = c(n, ["testId", "variant"]);
24
+ return o.createElement(
25
+ "span",
26
+ m({ ref: i, "data-fs-loader": !0, "data-fs-loader-variant": a, "data-testid": t }, r),
27
+ o.createElement("span", { "data-fs-loader-item": !0 }),
28
+ o.createElement("span", { "data-fs-loader-item": !0 }),
29
+ o.createElement("span", { "data-fs-loader-item": !0 })
30
+ );
31
+ }), v = E;
32
+ export {
33
+ v as default
34
+ };
@@ -0,0 +1,29 @@
1
+ var I = Object.defineProperty;
2
+ var r = Object.getOwnPropertySymbols;
3
+ var f = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
4
+ var c = (t, e, o) => e in t ? I(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, i = (t, e) => {
5
+ for (var o in e || (e = {}))
6
+ f.call(e, o) && c(t, o, e[o]);
7
+ if (r)
8
+ for (var o of r(e))
9
+ s.call(e, o) && c(t, o, e[o]);
10
+ return t;
11
+ };
12
+ var l = (t, e) => {
13
+ var o = {};
14
+ for (var n in t)
15
+ f.call(t, n) && e.indexOf(n) < 0 && (o[n] = t[n]);
16
+ if (t != null && r)
17
+ for (var n of r(t))
18
+ e.indexOf(n) < 0 && s.call(t, n) && (o[n] = t[n]);
19
+ return o;
20
+ };
21
+ import p, { forwardRef as R } from "react";
22
+ import g from "../../atoms/Button/Button.js";
23
+ const w = R(function(x, B) {
24
+ var a = x, { icon: e, children: o, testId: n = "fs-icon-button", "aria-label": b, size: d = "regular", variant: u } = a, m = l(a, ["icon", "children", "testId", "aria-label", "size", "variant"]);
25
+ return p.createElement(g, i({ ref: B, "data-fs-button": !0, "data-fs-icon-button": !0, variant: u != null ? u : "tertiary", icon: e, "aria-label": b, testId: n, size: d }, m), o);
26
+ }), $ = w;
27
+ export {
28
+ $ as default
29
+ };
@@ -15,7 +15,7 @@ import { Children as X, useState as m, useRef as D, useEffect as Y } from "react
15
15
  import Z from "./components/Bullets.js";
16
16
  import E from "./components/Arrows.js";
17
17
  import { DefaultProps as M } from "./utils/defaultProps.js";
18
- /* empty css */const rt = ({
18
+ /* empty css */const rt = ({
19
19
  children: s,
20
20
  id: r,
21
21
  bullet: t,
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { DiscountIcon as s } from "../../assets/svgs/DiscountIcon.js";
3
- /* empty css */const t = ({
3
+ /* empty css */const t = ({
4
4
  discount: a,
5
5
  participeLink: c,
6
6
  learnMoreLink: o,
@@ -4,12 +4,12 @@ import { Modal as M } from "../Modal/Modal.js";
4
4
  import { ProductSelected as N } from "./components/ProductSelected.js";
5
5
  import { SimilarProducts as k } from "./components/SimilarProducts.js";
6
6
  import { ModalFooter as v } from "./components/ModalFooter.js";
7
- /* empty css */import { getProductsSimilars as A } from "./api/getProductsSimilars.js";
8
- import E from "../../hooks/useAnalitcsEvents.js";
9
- import { NoSimilarProduct as _ } from "./components/NoSimilarProduct.js";
10
- import { getOrderForm as J } from "./api/getOrderForm.js";
11
- import { postChangeOrder as L } from "./api/postChangeOrder.js";
12
- import { Skeleton as T } from "../Skeleton/index.js";
7
+ /* empty css */import { Skeleton as A } from "@acctglobal/skeleton";
8
+ import { getProductsSimilars as E } from "./api/getProductsSimilars.js";
9
+ import _ from "../../hooks/useAnalitcsEvents.js";
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
13
  const oo = ({
14
14
  selectedItem: o,
15
15
  postalCode: S,
@@ -20,12 +20,12 @@ const oo = ({
20
20
  setIsOpen: l,
21
21
  saveSelectedSimilarProduct: m
22
22
  }) => {
23
- const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = E(), [r, p] = e({ itemId: "" });
23
+ const [u, b] = e(), [P, s] = e(!1), a = O === "io", { genericTaggingEvent: C } = _(), [r, p] = e({ itemId: "" });
24
24
  return w(() => {
25
25
  (async () => {
26
26
  s(!0);
27
27
  try {
28
- const t = await A({
28
+ const t = await E({
29
29
  postalCode: S,
30
30
  selectedItem: o,
31
31
  isIO: a
@@ -38,7 +38,7 @@ const oo = ({
38
38
  var t, d;
39
39
  s(!0);
40
40
  try {
41
- const c = await J(f, a), i = ((d = (t = c == null ? void 0 : c.customData) == null ? void 0 : t.customApps) == null ? void 0 : d.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(
42
42
  (x) => x.id === "janis"
43
43
  )) || null;
44
44
  let g = {};
@@ -64,7 +64,7 @@ const oo = ({
64
64
  v,
65
65
  {
66
66
  saveSelectedSimilarProduct: () => {
67
- L(
67
+ T(
68
68
  f,
69
69
  a,
70
70
  o.productOriginId,
@@ -77,7 +77,7 @@ const oo = ({
77
77
  }
78
78
  ),
79
79
  children: P ? /* @__PURE__ */ n(
80
- T,
80
+ A,
81
81
  {
82
82
  width: a ? "100%" : "90%",
83
83
  height: a ? 600 : 425,
@@ -95,7 +95,7 @@ const oo = ({
95
95
  setSimilarProductSelect: p,
96
96
  products: u
97
97
  }
98
- ) : /* @__PURE__ */ n(_, {})
98
+ ) : /* @__PURE__ */ n(J, {})
99
99
  ] })
100
100
  }
101
101
  );
@@ -6,7 +6,7 @@ import { CouponsView as H } from "./views/CouponsView.js";
6
6
  import { RulesView as K } from "./views/RulesView.js";
7
7
  import { OverwriteView as P } from "./views/OverwriteView.js";
8
8
  import { EmptyCartView as Q } from "./views/EmptyCartView.js";
9
- /* empty css */const I = ({
9
+ /* empty css */const I = ({
10
10
  orderFormId: h,
11
11
  hasItemsInCart: a,
12
12
  builder: j,
@@ -1,14 +1,14 @@
1
- import s from "axios";
2
- const n = async (o, t, a) => {
3
- const { data: r } = await s.post(
4
- `https://${o}.myvtex.com/_v/faststoreapi/coupon/order`,
1
+ import r from "axios";
2
+ const s = async (o, t, a) => {
3
+ const { data: p } = await r.post(
4
+ `https://${o}.vtex.app/api/coupon/order`,
5
5
  {
6
6
  orderFormId: t,
7
7
  couponId: a
8
8
  }
9
9
  );
10
- return r;
10
+ return p;
11
11
  };
12
12
  export {
13
- n as addCoupon
13
+ s as addCoupon
14
14
  };
@@ -1,8 +1,10 @@
1
- import a from "axios";
2
- const m = async (s, n, t) => {
3
- const o = `https://${s}.myvtex.com/_v/faststoreapi/coupon/list`, r = Math.random(), { data: p } = t ? await a.post(o, { couponsList: t }) : await a.get(o, { params: { builder: n, random: r } });
4
- return p.coupons;
1
+ import n from "axios";
2
+ const e = async (c, s, o) => {
3
+ const a = "/api/coupon/list", r = Math.random();
4
+ console.log("account", c);
5
+ const { data: t } = o ? await n.post(a, { couponsList: o }) : await n.get(a, { params: { builder: s, random: r } });
6
+ return console.log("account", t), t.coupons;
5
7
  };
6
8
  export {
7
- m as getCoupons
9
+ e as getCoupons
8
10
  };
@@ -1,14 +1,14 @@
1
1
  import { jsxs as a, Fragment as n, jsx as r } from "react/jsx-runtime";
2
- import { ModalHeader as i } from "../components/ModalHeader.js";
3
- import { ModalFooter as m } from "../components/ModalFooter.js";
4
- import { Skeleton as u } from "../../Skeleton/index.js";
2
+ import { Skeleton as i } from "@acctglobal/skeleton";
3
+ import { ModalHeader as m } from "../components/ModalHeader.js";
4
+ import { ModalFooter as u } from "../components/ModalFooter.js";
5
5
  const f = ({
6
6
  isIO: t = !1,
7
7
  closeIOModal: o,
8
8
  genericTaggingEvent: e
9
9
  }) => /* @__PURE__ */ a(n, { children: [
10
10
  t && o && /* @__PURE__ */ r(
11
- i,
11
+ m,
12
12
  {
13
13
  closeModal: o,
14
14
  title: "Meus Cupons",
@@ -16,7 +16,7 @@ const f = ({
16
16
  }
17
17
  ),
18
18
  /* @__PURE__ */ r(
19
- u,
19
+ i,
20
20
  {
21
21
  width: t ? "100%" : "90%",
22
22
  height: t ? 600 : 425,
@@ -26,7 +26,7 @@ const f = ({
26
26
  }
27
27
  ),
28
28
  t && o && /* @__PURE__ */ r(
29
- m,
29
+ u,
30
30
  {
31
31
  isFloating: !0,
32
32
  cancelButtonAction: o,
@@ -3,7 +3,7 @@ import { useRef as s, useEffect as p } from "react";
3
3
  import { ArrowIcon as g } from "../../assets/svgs/ArrowIcon.js";
4
4
  import { CloseIcon as k } from "../../assets/svgs/CloseIcon.js";
5
5
  import { HAS_WINDOW as v } from "../../constants/index.js";
6
- /* empty css */const R = (w) => {
6
+ /* empty css */const R = (w) => {
7
7
  const {
8
8
  isOpen: r,
9
9
  setIsOpen: C,
@@ -4,7 +4,7 @@ import { Header as x } from "./components/Header.js";
4
4
  import { Content as S } from "./components/Content.js";
5
5
  import { Footer as c } from "./components/Footer.js";
6
6
  import { TIPS_LENGTH as h } from "./constants/tips.js";
7
- /* empty css */const w = ({
7
+ /* empty css */const w = ({
8
8
  socialMediaLinks: a,
9
9
  handleCloseAction: r,
10
10
  handleFinishAction: n,
@@ -1,4 +1,4 @@
1
- import { SkuSpecificationsProps, ProductCardProps, offers } from '../../../types/ProductCard';
1
+ import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
2
2
 
3
3
  interface ProductCardDiscountBadge {
4
4
  skuSpecifications: SkuSpecificationsProps[];
@@ -8,7 +8,6 @@ interface ProductCardDiscountBadge {
8
8
  hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
9
9
  defaultScListPrice?: number;
10
10
  setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
11
- offers: offers;
12
11
  }
13
- export declare const ProductCardDiscountBadge: ({ offers, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
12
+ export declare const ProductCardDiscountBadge: ({ nativeListPrice, nativeSpotPrice, skuSpecifications, unitMultiplier, hasPromotionalPrice, defaultScListPrice, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
14
13
  export {};
@@ -1,26 +1,42 @@
1
- import { jsx as d, jsxs as i } from "react/jsx-runtime";
2
- import { useEffect as a, useMemo as m } from "react";
3
- const h = ({
4
- offers: n,
5
- setIsShowProductBadge: c
1
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
2
+ import { useMemo as l, useEffect as D } from "react";
3
+ const E = ({
4
+ nativeListPrice: c,
5
+ nativeSpotPrice: s,
6
+ skuSpecifications: n,
7
+ unitMultiplier: a,
8
+ hasPromotionalPrice: i,
9
+ defaultScListPrice: P,
10
+ setIsShowProductBadge: d
6
11
  }) => {
7
- const { listPrice: u, price: o } = n == null ? void 0 : n.offers[0], t = Math.round(
8
- Number(((r, e) => m(() => {
9
- const s = (r - e) * 100 / r;
10
- return Math.round(s);
11
- }, [e, r]))(u, o))
12
+ const { listPrice: u, spotPrice: o } = i || {}, f = (r, e) => l(() => {
13
+ const g = (r - e) * 100 / r;
14
+ return Math.round(g);
15
+ }, [e, r]), { listPriceCustom: m, spotPriceCustom: p } = l(() => u && o && o !== s ? {
16
+ listPriceCustom: u,
17
+ spotPriceCustom: o
18
+ } : {
19
+ listPriceCustom: c,
20
+ spotPriceCustom: s
21
+ }, [
22
+ u,
23
+ o,
24
+ s,
25
+ c
26
+ ]), C = "Venda por unidade", N = n == null ? void 0 : n.some((r) => r.field.originalName === C && r.values.some((e) => e.originalName === "true")), h = P || (N ? m : ((r) => Number(r.toString().match(/^\d+(?:\.\d{0,2})?/)))(m * a)), t = Math.round(
27
+ Number(f(h, p))
12
28
  );
13
- return a(() => {
29
+ return D(() => {
14
30
  if (!t || t <= 0) {
15
- c(!1);
31
+ d(!1);
16
32
  return;
17
33
  }
18
- c(!0);
19
- }, [t]), !t || t <= 0 ? null : /* @__PURE__ */ d("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ i("p", { className: "product-card-discount-badge-value", children: [
34
+ d(!0);
35
+ }, [t]), !t || t <= 0 ? null : /* @__PURE__ */ b("div", { className: "product-card-discount-badge", children: /* @__PURE__ */ x("p", { className: "product-card-discount-badge-value", children: [
20
36
  t,
21
37
  "%"
22
38
  ] }) });
23
39
  };
24
40
  export {
25
- h as ProductCardDiscountBadge
41
+ E as ProductCardDiscountBadge
26
42
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import o from "./CustomQuantitySelector/Button.js";
2
+ import o from "../../../node_modules/@faststore/components/dist/esm/atoms/Button/Button.js";
3
3
  const n = ({ handleAddToCart: t }) => /* @__PURE__ */ a(
4
4
  o,
5
5
  {
@@ -1,21 +1,6 @@
1
- import { AriaAttributes, ButtonHTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
1
+ import { IconButtonProps } from '@faststore/ui';
2
+ import { InputHTMLAttributes } from 'react';
2
3
 
3
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
- testId?: string;
5
- variant?: 'primary' | 'secondary' | 'tertiary';
6
- size?: 'small' | 'regular';
7
- inverse?: boolean;
8
- disabled?: boolean;
9
- icon?: ReactNode;
10
- loading?: boolean;
11
- loadingLabel?: string;
12
- iconPosition?: 'left' | 'right';
13
- }
14
- export interface IconButtonProps extends Omit<ButtonProps, 'aria-label'> {
15
- testId?: string;
16
- icon: ReactNode;
17
- 'aria-label': AriaAttributes['aria-label'];
18
- }
19
4
  export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElement> {
20
5
  quantity: number | string;
21
6
  leftButtonProps: Omit<IconButtonProps, 'aria-label'>;
@@ -21,7 +21,7 @@ var m = (t, a) => {
21
21
  };
22
22
  import { jsxs as q, jsx as n } from "react/jsx-runtime";
23
23
  import { forwardRef as Q } from "react";
24
- import p from "./IconButton.js";
24
+ import p from "../../../../node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js";
25
25
  const A = Q(function(j, h) {
26
26
  var s = j, {
27
27
  quantity: a,
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as d, Fragment as c } from "react/jsx-runtime";
2
- import { memo as s } from "react";
3
- import h from "./CustomQuantitySelector/index.js";
4
- import { Skeleton as m } from "../../Skeleton/index.js";
2
+ import { Skeleton as s } from "@acctglobal/skeleton";
3
+ import { memo as h } from "react";
4
+ import m from "./CustomQuantitySelector/index.js";
5
5
  const p = ({
6
6
  hasUndQtd: i,
7
7
  decrease: r,
@@ -13,7 +13,7 @@ const p = ({
13
13
  }) => /* @__PURE__ */ t("div", { className: "input-add", "data-testid": "quantity-selector-container", children: o ? /* @__PURE__ */ d(c, { children: [
14
14
  !a && /* @__PURE__ */ t("div", { className: "product-add-text", children: /* @__PURE__ */ t("p", { children: "Produto adicionado" }) }),
15
15
  /* @__PURE__ */ t(
16
- h,
16
+ m,
17
17
  {
18
18
  measureUnit: o,
19
19
  quantity: i,
@@ -62,13 +62,13 @@ const p = ({
62
62
  }
63
63
  )
64
64
  ] }) : /* @__PURE__ */ t(
65
- m,
65
+ s,
66
66
  {
67
67
  width: 100,
68
68
  height: 40,
69
69
  backgroundColor: "var(--color-grayScale-faded)"
70
70
  }
71
- ) }), v = s(p);
71
+ ) }), v = h(p);
72
72
  export {
73
73
  v as default
74
74
  };
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as t, 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,7 +7,7 @@ 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";
10
+ import { ProductCardPromotionFlag as p } from "../ProductCardPromotionFlag/index.js";
11
11
  const G = ({
12
12
  hasPlusFriendBadge: a,
13
13
  promotion: i,
@@ -15,7 +15,7 @@ const G = ({
15
15
  hasPromotionalPrice: c,
16
16
  clubPrice: C,
17
17
  outOfStock: o,
18
- variant: t,
18
+ variant: s,
19
19
  defaultScListPrice: l,
20
20
  isClubClient: u,
21
21
  addToCartAction: P,
@@ -23,19 +23,19 @@ const G = ({
23
23
  productInCart: h,
24
24
  openModal: S
25
25
  }) => {
26
- var f, d;
27
- const [k, n] = v(!1);
26
+ var d, f;
27
+ const [k, m] = v(!1);
28
28
  if (o)
29
- return /* @__PURE__ */ r(
29
+ return /* @__PURE__ */ t(
30
30
  x,
31
31
  {
32
- image: (f = e.image) == null ? void 0 : f[0],
32
+ image: (d = e.image) == null ? void 0 : d[0],
33
33
  name: e.name,
34
34
  variant: "horizontal"
35
35
  }
36
36
  );
37
- const m = u && e.hasClubPrice;
38
- return /* @__PURE__ */ s(
37
+ const n = u && e.hasClubPrice;
38
+ return /* @__PURE__ */ r(
39
39
  "div",
40
40
  {
41
41
  className: "product-card-horizontal",
@@ -43,68 +43,67 @@ const G = ({
43
43
  backgroundColor: o ? "var(--color-grayScale-faded" : "#fff"
44
44
  },
45
45
  children: [
46
- /* @__PURE__ */ s(
46
+ /* @__PURE__ */ r(
47
47
  "div",
48
48
  {
49
49
  onClick: S,
50
50
  className: "product-card-section-product-horizontal",
51
51
  children: [
52
- /* @__PURE__ */ r(
52
+ /* @__PURE__ */ t(
53
53
  M,
54
54
  {
55
- isProductClubAndClient: m,
56
- variant: t,
55
+ isProductClubAndClient: n,
56
+ variant: s,
57
57
  hasPlusFriendBadge: a,
58
58
  promotion: i,
59
- image: (d = e.image) == null ? void 0 : d[0]
59
+ image: (f = e.image) == null ? void 0 : f[0]
60
60
  }
61
61
  ),
62
- /* @__PURE__ */ s(
62
+ /* @__PURE__ */ r(
63
63
  "div",
64
64
  {
65
65
  className: "product-card-horizontal-description",
66
66
  style: {
67
- backgroundColor: m ? "#FDF3DE" : "var(--color-grayScale-faded)"
67
+ backgroundColor: n ? "#FDF3DE" : "var(--color-grayScale-faded)"
68
68
  },
69
69
  children: [
70
- /* @__PURE__ */ s("div", { className: "product-card-section-name", children: [
71
- /* @__PURE__ */ r(N, { name: e.name }),
72
- /* @__PURE__ */ s(
70
+ /* @__PURE__ */ r("div", { className: "product-card-section-name", children: [
71
+ /* @__PURE__ */ t(N, { name: e.name }),
72
+ /* @__PURE__ */ r(
73
73
  "div",
74
74
  {
75
75
  className: "product-card-section-badge-horizontal",
76
76
  style: { display: k ? "" : "none" },
77
77
  children: [
78
- /* @__PURE__ */ r(
78
+ /* @__PURE__ */ t(
79
79
  y,
80
80
  {
81
81
  unitMultiplier: e.unitMultiplier,
82
82
  skuSpecifications: e.skuSpecifications,
83
83
  measurementUnit: e.measurementUnit,
84
- setIsShowProductBadge: n
84
+ setIsShowProductBadge: m
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ r(
87
+ /* @__PURE__ */ t(
88
88
  z,
89
89
  {
90
- offers: e.offers,
91
90
  defaultScListPrice: l,
92
91
  nativeListPrice: e.customOffers.listPriceCustom,
93
92
  nativeSpotPrice: e.customOffers.spotPriceCustom,
94
93
  skuSpecifications: e.skuSpecifications,
95
94
  unitMultiplier: e.unitMultiplier,
96
95
  hasPromotionalPrice: c,
97
- setIsShowProductBadge: n
96
+ setIsShowProductBadge: m
98
97
  }
99
98
  )
100
99
  ]
101
100
  }
102
101
  )
103
102
  ] }),
104
- t === "horizontal" && /* @__PURE__ */ r(
105
- B,
103
+ s === "horizontal" && /* @__PURE__ */ t(
104
+ p,
106
105
  {
107
- variant: t,
106
+ variant: s,
108
107
  productSectionBadge: {
109
108
  text: i == null ? void 0 : i.flagText,
110
109
  color: {
@@ -114,7 +113,7 @@ const G = ({
114
113
  }
115
114
  }
116
115
  ),
117
- /* @__PURE__ */ r(
116
+ /* @__PURE__ */ t(
118
117
  O,
119
118
  {
120
119
  isClubClient: u,
@@ -126,7 +125,7 @@ const G = ({
126
125
  listPriceCustom: e.customOffers.listPriceCustom,
127
126
  hasDiscount: e.customOffers.hasDiscount,
128
127
  spotPriceCustom: e.customOffers.spotPriceCustom,
129
- spotPriceKg: e.customOffers.spotPriceKg
128
+ spotPriceKg: e.customOffers.spotPriceCustom
130
129
  },
131
130
  defaultScListPrice: l,
132
131
  clubPrice: C,
@@ -139,13 +138,13 @@ const G = ({
139
138
  ]
140
139
  }
141
140
  ),
142
- /* @__PURE__ */ r(
141
+ /* @__PURE__ */ t(
143
142
  b,
144
143
  {
145
144
  addToCartAction: P,
146
145
  quantitySelectorAction: g,
147
146
  productInCart: h,
148
- layout: t
147
+ layout: s
149
148
  }
150
149
  )
151
150
  ]
@@ -20,12 +20,5 @@ interface ProductCardPricesProps {
20
20
  unitMultiplier: number;
21
21
  hasPlusFriendBadge?: boolean;
22
22
  }
23
- export declare const ProductCardPrice: ({ clubPrice, unitMultiplier, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
24
- interface getPriceToShowParams {
25
- spotPriceKg: number | undefined | null;
26
- unitMultiplier: number;
27
- measurementUnit?: string;
28
- spotPriceCustom: number;
29
- }
30
- export declare const getPriceToShow: ({ spotPriceKg, unitMultiplier, measurementUnit, spotPriceCustom }: getPriceToShowParams) => number | null | undefined;
23
+ export declare const ProductCardPrice: ({ skuSpecifications, hasPromotionalPrice, clubPrice, unitMultiplier, defaultScListPrice, customOffers, measurementUnit, isClubClient, hasPlusFriendBadge }: ProductCardPricesProps) => import("react/jsx-runtime").JSX.Element;
31
24
  export {};