@plurix/ecom-components 1.14.2-shlo1555.0 → 1.14.3-com2034

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 (67) hide show
  1. package/dist/packages/Carousel/Carousel.js +1 -1
  2. package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
  3. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -1
  4. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +93 -84
  5. package/dist/packages/ChangeOrderModal/api/getOrderForm.js +6 -15
  6. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -4
  7. package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +22 -21
  8. package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
  9. package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -17
  10. package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +4 -1
  11. package/dist/packages/ChangeOrderModal/components/ModalFooter.js +3 -1
  12. package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +2 -3
  13. package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +4 -5
  14. package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +21 -21
  15. package/dist/packages/ChangeOrderModal/mocks.d.ts +1 -0
  16. package/dist/packages/ChangeOrderModal/mocks.js +1 -0
  17. package/dist/packages/Coupons/Coupons.d.ts +4 -1
  18. package/dist/packages/Coupons/Coupons.js +61 -51
  19. package/dist/packages/Coupons/api/addCoupon.d.ts +1 -1
  20. package/dist/packages/Coupons/api/addCoupon.js +7 -7
  21. package/dist/packages/Coupons/api/getCoupons.d.ts +1 -1
  22. package/dist/packages/Coupons/api/getCoupons.js +4 -4
  23. package/dist/packages/Coupons/api/removeCoupon.d.ts +1 -1
  24. package/dist/packages/Coupons/api/removeCoupon.js +6 -6
  25. package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
  26. package/dist/packages/Coupons/components/CouponCard.js +86 -76
  27. package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
  28. package/dist/packages/Coupons/views/CouponsView.js +87 -78
  29. package/dist/packages/Coupons/views/LoadingView.js +6 -6
  30. package/dist/packages/Modal/Modal.js +1 -1
  31. package/dist/packages/Onboarding/Onboarding.js +1 -1
  32. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.d.ts +1 -1
  33. package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +16 -22
  34. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
  35. package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
  36. package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
  37. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +18 -0
  38. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +80 -0
  39. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +10 -0
  40. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +61 -0
  41. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +8 -0
  42. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +44 -0
  43. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +17 -2
  44. package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
  45. package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
  46. package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
  47. package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
  48. package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
  49. package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
  50. package/dist/packages/ProductCard/index.js +1 -1
  51. package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
  52. package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
  53. package/dist/packages/Regionalization/Regionalization.js +15 -13
  54. package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
  55. package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
  56. package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
  57. package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
  58. package/dist/packages/Tour/Tour.js +1 -1
  59. package/dist/styles/change-order-modal.global.css +1 -1
  60. package/dist/styles/product-card.global.css +1 -1
  61. package/dist/styles/regionalization.global.css +1 -1
  62. package/dist/types/ProductCard.d.ts +13 -12
  63. package/dist/utils/changerOrderModal.js +13 -16
  64. package/package.json +69 -69
  65. package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +0 -45
  66. package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +0 -34
  67. package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +0 -29
@@ -1,122 +1,131 @@
1
- import { jsxs as e, Fragment as N, jsx as o } from "react/jsx-runtime";
2
- import { useState as a, useEffect as F } from "react";
3
- import { addCoupon as G } from "../api/addCoupon.js";
4
- import { ModalHeader as J } from "../components/ModalHeader.js";
5
- import { ModalFooter as K } from "../components/ModalFooter.js";
6
- import { CouponCard as Q } from "../components/CouponCard.js";
7
- import { NoCoupons as U } from "../components/NoCoupons.js";
8
- import { Alert as V } from "../components/Alert.js";
9
- import { InfoIcon as W } from "../../../assets/svgs/InfoIcon.js";
10
- const E = ({
11
- account: b,
12
- orderFormId: x,
13
- hasItemsInCart: C,
1
+ import { jsxs as c, Fragment as S, jsx as o } from "react/jsx-runtime";
2
+ import { useState as l, useEffect as Q } from "react";
3
+ import { ModalHeader as R } from "../components/ModalHeader.js";
4
+ import { ModalFooter as U } from "../components/ModalFooter.js";
5
+ import { CouponCard as V } from "../components/CouponCard.js";
6
+ import { NoCoupons as W } from "../components/NoCoupons.js";
7
+ import { Alert as X } from "../components/Alert.js";
8
+ import { InfoIcon as Y } from "../../../assets/svgs/InfoIcon.js";
9
+ import { addCoupon as Z } from "../api/addCoupon.js";
10
+ const to = ({
11
+ addCouponMutation: w,
12
+ removeCouponMutation: _,
13
+ account: D,
14
+ orderFormId: d,
15
+ hasItemsInCart: x,
14
16
  isIO: p,
15
- closeIOModal: u,
16
- coupons: c,
17
+ closeIOModal: s,
18
+ coupons: n,
17
19
  firstCouponName: i,
18
- secondCouponName: _,
19
- replaceCoupon: w,
20
+ secondCouponName: L,
21
+ replaceCoupon: C,
20
22
  setView: A,
21
- setActiveRule: D,
22
- setDataItem: L,
23
+ setActiveRule: q,
24
+ setDataItem: H,
23
25
  setFirstCouponName: m,
24
- setSecondCouponName: n,
26
+ setSecondCouponName: f,
25
27
  setReplaceCoupon: B,
26
- setIsCloseModalEmpty: S,
27
- genericTaggingEvent: r
28
+ setIsCloseModalEmpty: J,
29
+ genericTaggingEvent: t
28
30
  }) => {
29
- const [t, q] = a(""), [H, j] = a(!1), [M, s] = a(""), [f, d] = a(!1), [P, h] = a(!1), k = (l) => {
30
- l.preventDefault(), q(l.target.value);
31
- }, z = async (l) => {
32
- l.preventDefault();
31
+ const [r, P] = l(""), [k, N] = l(!1), [z, u] = l(""), [h, e] = l(!1), [G, y] = l(!1), K = (a) => {
32
+ a.preventDefault(), P(a.target.value);
33
+ }, M = async (a) => {
34
+ a.preventDefault();
33
35
  try {
34
- if (!i || i && w) {
35
- j(!0);
36
- const y = await G(b, x, t);
37
- B(!1), n(""), y.error.length <= 0 ? (r == null || r("discount_coupon", {
36
+ if (!i || i && C) {
37
+ N(!0);
38
+ const b = p ? await Z(d, r) : await w({
39
+ input: {
40
+ orderFormId: d,
41
+ couponId: r
42
+ }
43
+ }), j = p ? b : JSON.parse(b.addCoupon.data);
44
+ B(!1), f(""), j.error.length <= 0 ? (t == null || t("discount_coupon", {
38
45
  name: "Cupom aplicado do input",
39
- couponName: t
40
- }), s("success"), h(!0), m(t), p && window.location.reload()) : (r == null || r("discount_coupon", {
46
+ couponName: r
47
+ }), u("success"), y(!0), m(r), p && window.location.reload()) : (t == null || t("discount_coupon", {
41
48
  name: "Cupom do input expirado ou invalido",
42
- couponName: t,
43
- objectError: y.error
44
- }), s("error"), h(!1), m("")), d(!0);
49
+ couponName: r,
50
+ objectError: j.error
51
+ }), u("error"), y(!1), m("")), e(!0);
45
52
  } else
46
- n(t), A("overwrite-view");
47
- } catch (y) {
48
- r == null || r("discount_coupon", {
53
+ f(r), A("overwrite-view");
54
+ } catch (b) {
55
+ t == null || t("discount_coupon", {
49
56
  name: "Cupom do input - error na api",
50
- couponName: t
51
- }), s("error"), h(!1), d(!0);
57
+ couponName: r
58
+ }), u("error"), y(!1), e(!0);
52
59
  } finally {
53
- j(!1);
60
+ N(!1);
54
61
  }
55
62
  };
56
- return F(() => {
57
- f && setTimeout(() => d(!1), 5e3);
58
- }, [P, f]), /* @__PURE__ */ e(N, { children: [
59
- p && u && /* @__PURE__ */ o(
60
- J,
63
+ return Q(() => {
64
+ h && setTimeout(() => e(!1), 5e3);
65
+ }, [G, h]), /* @__PURE__ */ c(S, { children: [
66
+ p && s && /* @__PURE__ */ o(
67
+ R,
61
68
  {
62
- closeModal: u,
69
+ closeModal: s,
63
70
  title: "Meus Cupons",
64
- genericTaggingEvent: r
71
+ genericTaggingEvent: t
65
72
  }
66
73
  ),
67
- C ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */ e("form", { onSubmit: z, children: [
74
+ x ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */ c("form", { onSubmit: M, children: [
68
75
  /* @__PURE__ */ o(
69
76
  "input",
70
77
  {
71
78
  type: "text",
72
79
  placeholder: "Insira o cupom",
73
- value: t,
74
- onChange: k
80
+ value: r,
81
+ onChange: K
75
82
  }
76
83
  ),
77
- /* @__PURE__ */ o("button", { type: "submit", name: "adicionar", disabled: H, children: "Adicionar" })
78
- ] }) }) : /* @__PURE__ */ o("div", { className: "cart-empty-coupons-label", children: /* @__PURE__ */ e("p", { children: [
79
- /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(W, {}) }),
84
+ /* @__PURE__ */ o("button", { type: "submit", name: "adicionar", disabled: k, children: "Adicionar" })
85
+ ] }) }) : /* @__PURE__ */ o("div", { className: "cart-empty-coupons-label", children: /* @__PURE__ */ c("p", { children: [
86
+ /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(Y, {}) }),
80
87
  "Para adicionar um cupom é necessário que você adicione pelo menos 1 produto no carrinho"
81
88
  ] }) }),
82
- /* @__PURE__ */ o("div", { className: "container-title-coupons", children: c.length > 0 ? /* @__PURE__ */ e(N, { children: [
89
+ /* @__PURE__ */ o("div", { className: "container-title-coupons", children: n.length > 0 ? /* @__PURE__ */ c(S, { children: [
83
90
  /* @__PURE__ */ o("h2", { children: "Cupons disponíveis" }),
84
- /* @__PURE__ */ o("div", { className: "container-coupons", children: c.map((l) => /* @__PURE__ */ o(
85
- Q,
91
+ /* @__PURE__ */ o("div", { className: "container-coupons", children: n.map((a) => /* @__PURE__ */ o(
92
+ V,
86
93
  {
87
- account: b,
88
- orderFormId: x,
89
- hasItemsInCart: C,
94
+ removeCouponMutation: _,
95
+ addCouponMutation: w,
96
+ account: D,
97
+ orderFormId: d,
98
+ hasItemsInCart: x,
90
99
  isIO: p,
91
- item: l,
100
+ item: a,
92
101
  firstCouponName: i,
93
- secondCouponName: _,
94
- replaceCoupon: w,
102
+ secondCouponName: L,
103
+ replaceCoupon: C,
95
104
  setView: A,
96
105
  setFirstCouponName: m,
97
- setSecondCouponName: n,
98
- setActiveRule: D,
99
- setDataItem: L,
106
+ setSecondCouponName: f,
107
+ setActiveRule: q,
108
+ setDataItem: H,
100
109
  setReplaceCoupon: B,
101
- setAlert: d,
102
- setType: s,
103
- setIsCloseModalEmpty: S,
104
- genericTaggingEvent: r
110
+ setAlert: e,
111
+ setType: u,
112
+ setIsCloseModalEmpty: J,
113
+ genericTaggingEvent: t
105
114
  },
106
- l.couponName
115
+ a.couponName
107
116
  )) })
108
- ] }) : /* @__PURE__ */ o(U, {}) }),
109
- f && /* @__PURE__ */ o(V, { type: M }),
110
- p && u && /* @__PURE__ */ o(
111
- K,
117
+ ] }) : /* @__PURE__ */ o(W, {}) }),
118
+ h && /* @__PURE__ */ o(X, { type: z }),
119
+ p && s && /* @__PURE__ */ o(
120
+ U,
112
121
  {
113
- isFloating: c.length > 0,
114
- cancelButtonAction: u,
122
+ isFloating: n.length > 0,
123
+ cancelButtonAction: s,
115
124
  cancelButtonText: "Sair"
116
125
  }
117
126
  )
118
127
  ] });
119
128
  };
120
129
  export {
121
- E as CouponsView
130
+ to as CouponsView
122
131
  };
@@ -1,14 +1,14 @@
1
1
  import { jsxs as a, Fragment as n, jsx as r } from "react/jsx-runtime";
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";
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";
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
- m,
11
+ i,
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
- i,
19
+ u,
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
- u,
29
+ m,
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,
@@ -6,5 +6,5 @@ interface ProductCardBadgeProps {
6
6
  measurementUnit?: string;
7
7
  setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
8
8
  }
9
- export declare const ProductCardBadgeKg: ({ measurementUnit, skuSpecifications, unitMultiplier, setIsShowProductBadge }: ProductCardBadgeProps) => import("react/jsx-runtime").JSX.Element | undefined;
9
+ export declare const ProductCardBadgeKg: ({ measurementUnit, setIsShowProductBadge, unitMultiplier }: ProductCardBadgeProps) => import("react/jsx-runtime").JSX.Element | null;
10
10
  export {};
@@ -1,24 +1,18 @@
1
- import { jsx as c, jsxs as h } from "react/jsx-runtime";
2
- import { useMemo as g, useEffect as v } from "react";
3
- const b = ({
4
- measurementUnit: n,
5
- skuSpecifications: o,
6
- unitMultiplier: r,
7
- setIsShowProductBadge: s
8
- }) => {
9
- const m = "Venda por unidade", e = o == null ? void 0 : o.some((f) => f.field.originalName === m && f.values.some((N) => N.originalName === "true")), d = g(() => e ? null : r > 1 ? r : r === 1 ? n !== "un" ? r : null : r * 1e3, [e, r]), a = g(() => e ? "Un" : r * 1e3 >= 1e3 ? n : "g", [e, n, r]);
10
- if (v(() => {
11
- if (!d || !a) {
12
- s(!1);
13
- return;
14
- }
15
- s(!0);
16
- }, [d, a]), !(!d || !a))
17
- return /* @__PURE__ */ c("div", { className: "product-card-badge", children: /* @__PURE__ */ h("p", { className: "product-card-badge-kg", children: [
18
- d,
19
- a
20
- ] }) });
21
- };
1
+ import { jsx as a, jsxs as g } from "react/jsx-runtime";
2
+ import { useEffect as o } from "react";
3
+ const f = ({
4
+ measurementUnit: c,
5
+ setIsShowProductBadge: r,
6
+ 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: [
10
+ d * 1e3,
11
+ "g"
12
+ ] }) }) : /* @__PURE__ */ a("div", { className: "product-card-badge", children: /* @__PURE__ */ g("p", { className: "product-card-badge-kg", children: [
13
+ d,
14
+ "kg"
15
+ ] }) }));
22
16
  export {
23
- b as ProductCardBadgeKg
17
+ f as ProductCardBadgeKg
24
18
  };
@@ -1,4 +1,4 @@
1
- import { SkuSpecificationsProps, ProductCardProps } from '../../../types/ProductCard';
1
+ import { SkuSpecificationsProps, ProductCardProps, offers } from '../../../types/ProductCard';
2
2
 
3
3
  interface ProductCardDiscountBadge {
4
4
  skuSpecifications: SkuSpecificationsProps[];
@@ -8,6 +8,7 @@ interface ProductCardDiscountBadge {
8
8
  hasPromotionalPrice: ProductCardProps['hasPromotionalPrice'];
9
9
  defaultScListPrice?: number;
10
10
  setIsShowProductBadge: React.Dispatch<React.SetStateAction<boolean>>;
11
+ offers: offers;
11
12
  }
12
- export declare const ProductCardDiscountBadge: ({ nativeListPrice, nativeSpotPrice, skuSpecifications, unitMultiplier, hasPromotionalPrice, defaultScListPrice, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
13
+ export declare const ProductCardDiscountBadge: ({ offers, setIsShowProductBadge }: ProductCardDiscountBadge) => import("react/jsx-runtime").JSX.Element | null;
13
14
  export {};
@@ -1,42 +1,26 @@
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
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
11
6
  }) => {
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))
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))
28
12
  );
29
- return D(() => {
13
+ return a(() => {
30
14
  if (!t || t <= 0) {
31
- d(!1);
15
+ c(!1);
32
16
  return;
33
17
  }
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: [
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: [
36
20
  t,
37
21
  "%"
38
22
  ] }) });
39
23
  };
40
24
  export {
41
- E as ProductCardDiscountBadge
25
+ h as ProductCardDiscountBadge
42
26
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import o from "../../../node_modules/@faststore/components/dist/esm/atoms/Button/Button.js";
2
+ import o from "./CustomQuantitySelector/Button.js";
3
3
  const n = ({ handleAddToCart: t }) => /* @__PURE__ */ a(
4
4
  o,
5
5
  {
@@ -0,0 +1,18 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+
3
+ export type Variant = 'primary' | 'secondary' | 'tertiary';
4
+ export type Size = 'small' | 'regular';
5
+ export type IconPosition = 'left' | 'right';
6
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
7
+ testId?: string;
8
+ variant?: Variant;
9
+ size?: Size;
10
+ inverse?: boolean;
11
+ disabled?: boolean;
12
+ icon?: ReactNode;
13
+ loading?: boolean;
14
+ loadingLabel?: string;
15
+ iconPosition?: IconPosition;
16
+ }
17
+ declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
18
+ export default Button;
@@ -0,0 +1,80 @@
1
+ var k = Object.defineProperty, y = Object.defineProperties;
2
+ var z = Object.getOwnPropertyDescriptors;
3
+ var e = Object.getOwnPropertySymbols;
4
+ var i = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
5
+ var b = (t, a, r) => a in t ? k(t, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[a] = r, p = (t, a) => {
6
+ for (var r in a || (a = {}))
7
+ i.call(a, r) && b(t, r, a[r]);
8
+ if (e)
9
+ for (var r of e(a))
10
+ l.call(a, r) && b(t, r, a[r]);
11
+ return t;
12
+ }, m = (t, a) => y(t, z(a));
13
+ var h = (t, a) => {
14
+ var r = {};
15
+ for (var n in t)
16
+ i.call(t, n) && a.indexOf(n) < 0 && (r[n] = t[n]);
17
+ if (t != null && e)
18
+ for (var n of e(t))
19
+ a.indexOf(n) < 0 && l.call(t, n) && (r[n] = t[n]);
20
+ return r;
21
+ };
22
+ import { jsx as u, jsxs as c } from "react/jsx-runtime";
23
+ import { forwardRef as L } from "react";
24
+ import R from "./Loader.js";
25
+ const F = L(function(q, B) {
26
+ var s = q, {
27
+ children: a,
28
+ variant: r,
29
+ inverse: n,
30
+ size: g = "regular",
31
+ testId: x = "fs-button",
32
+ loading: o,
33
+ loadingLabel: j,
34
+ icon: d,
35
+ iconPosition: f = "left",
36
+ disabled: v
37
+ } = s, w = h(s, [
38
+ "children",
39
+ "variant",
40
+ "inverse",
41
+ "size",
42
+ "testId",
43
+ "loading",
44
+ "loadingLabel",
45
+ "icon",
46
+ "iconPosition",
47
+ "disabled"
48
+ ]);
49
+ return /* @__PURE__ */ u(
50
+ "button",
51
+ m(p({
52
+ ref: B,
53
+ "data-fs-button": !0,
54
+ "data-fs-button-inverse": n,
55
+ "data-fs-button-size": g,
56
+ "data-fs-button-loading": o,
57
+ "data-fs-button-variant": r,
58
+ disabled: v,
59
+ "data-testid": x
60
+ }, w), {
61
+ children: /* @__PURE__ */ c("div", { "data-fs-button-wrapper": !0, children: [
62
+ o && /* @__PURE__ */ c("p", { "data-fs-button-loading-label": !0, children: [
63
+ j,
64
+ /* @__PURE__ */ u(
65
+ R,
66
+ {
67
+ variant: r === "primary" && !n ? "light" : "dark"
68
+ }
69
+ )
70
+ ] }),
71
+ !!d && f === "left" && /* @__PURE__ */ u("span", { "data-fs-button-icon": !0, children: d }),
72
+ a && /* @__PURE__ */ u("span", { children: a }),
73
+ !!d && f === "right" && /* @__PURE__ */ u("span", { "data-fs-button-icon": !0, children: d })
74
+ ] })
75
+ })
76
+ );
77
+ });
78
+ export {
79
+ F as default
80
+ };
@@ -0,0 +1,10 @@
1
+ import { AriaAttributes, ReactNode } from 'react';
2
+ import { ButtonProps } from './Button';
3
+
4
+ export interface IconButtonProps extends Omit<ButtonProps, 'aria-label'> {
5
+ testId?: string;
6
+ icon: ReactNode;
7
+ 'aria-label': AriaAttributes['aria-label'];
8
+ }
9
+ declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
10
+ export default IconButton;
@@ -0,0 +1,61 @@
1
+ var x = Object.defineProperty, I = Object.defineProperties;
2
+ var g = Object.getOwnPropertyDescriptors;
3
+ var n = Object.getOwnPropertySymbols;
4
+ var c = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
5
+ var a = (t, o, r) => o in t ? x(t, o, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[o] = r, l = (t, o) => {
6
+ for (var r in o || (o = {}))
7
+ c.call(o, r) && a(t, r, o[r]);
8
+ if (n)
9
+ for (var r of n(o))
10
+ i.call(o, r) && a(t, r, o[r]);
11
+ return t;
12
+ }, m = (t, o) => I(t, g(o));
13
+ var s = (t, o) => {
14
+ var r = {};
15
+ for (var u in t)
16
+ c.call(t, u) && o.indexOf(u) < 0 && (r[u] = t[u]);
17
+ if (t != null && n)
18
+ for (var u of n(t))
19
+ o.indexOf(u) < 0 && i.call(t, u) && (r[u] = t[u]);
20
+ return r;
21
+ };
22
+ import { jsx as j } from "react/jsx-runtime";
23
+ import { forwardRef as w } from "react";
24
+ import y from "./Button.js";
25
+ const A = w(
26
+ function(R, B) {
27
+ var f = R, {
28
+ icon: o,
29
+ children: r,
30
+ testId: u = "fs-icon-button",
31
+ "aria-label": b,
32
+ size: d = "regular",
33
+ variant: e
34
+ } = f, p = s(f, [
35
+ "icon",
36
+ "children",
37
+ "testId",
38
+ "aria-label",
39
+ "size",
40
+ "variant"
41
+ ]);
42
+ return /* @__PURE__ */ j(
43
+ y,
44
+ m(l({
45
+ ref: B,
46
+ "data-fs-button": !0,
47
+ "data-fs-icon-button": !0,
48
+ variant: e != null ? e : "tertiary",
49
+ icon: o,
50
+ "aria-label": b,
51
+ testId: u,
52
+ size: d
53
+ }, p), {
54
+ children: r
55
+ })
56
+ );
57
+ }
58
+ );
59
+ export {
60
+ A as default
61
+ };
@@ -0,0 +1,8 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ export interface LoaderProps extends HTMLAttributes<HTMLSpanElement> {
4
+ testId?: string;
5
+ variant?: 'light' | 'dark';
6
+ }
7
+ declare const Loader: import('react').ForwardRefExoticComponent<LoaderProps & import('react').RefAttributes<HTMLDivElement>>;
8
+ export default Loader;
@@ -0,0 +1,44 @@
1
+ var c = Object.defineProperty, x = Object.defineProperties;
2
+ var j = Object.getOwnPropertyDescriptors;
3
+ var d = Object.getOwnPropertySymbols;
4
+ var n = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
5
+ var f = (a, r, t) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t, l = (a, r) => {
6
+ for (var t in r || (r = {}))
7
+ n.call(r, t) && f(a, t, r[t]);
8
+ if (d)
9
+ for (var t of d(r))
10
+ i.call(r, t) && f(a, t, r[t]);
11
+ return a;
12
+ }, m = (a, r) => x(a, j(r));
13
+ var p = (a, r) => {
14
+ var t = {};
15
+ for (var e in a)
16
+ n.call(a, e) && r.indexOf(e) < 0 && (t[e] = a[e]);
17
+ if (a != null && d)
18
+ for (var e of d(a))
19
+ r.indexOf(e) < 0 && i.call(a, e) && (t[e] = a[e]);
20
+ return t;
21
+ };
22
+ import { jsxs as L, jsx as o } from "react/jsx-runtime";
23
+ import { forwardRef as h } from "react";
24
+ const b = h(function(k, u) {
25
+ var s = k, { testId: r = "fs-loader", variant: t = "dark" } = s, e = p(s, ["testId", "variant"]);
26
+ return /* @__PURE__ */ L(
27
+ "span",
28
+ m(l({
29
+ ref: u,
30
+ "data-fs-loader": !0,
31
+ "data-fs-loader-variant": t,
32
+ "data-testid": r
33
+ }, e), {
34
+ children: [
35
+ /* @__PURE__ */ o("span", { "data-fs-loader-item": !0 }),
36
+ /* @__PURE__ */ o("span", { "data-fs-loader-item": !0 }),
37
+ /* @__PURE__ */ o("span", { "data-fs-loader-item": !0 })
38
+ ]
39
+ })
40
+ );
41
+ });
42
+ export {
43
+ b as default
44
+ };
@@ -1,6 +1,21 @@
1
- import { IconButtonProps } from '@faststore/ui';
2
- import { InputHTMLAttributes } from 'react';
1
+ import { AriaAttributes, ButtonHTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
3
2
 
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
+ }
4
19
  export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElement> {
5
20
  quantity: number | string;
6
21
  leftButtonProps: Omit<IconButtonProps, 'aria-label'>;