@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.
- package/dist/packages/Carousel/Carousel.js +1 -1
- package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +12 -1
- package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +93 -84
- package/dist/packages/ChangeOrderModal/api/getOrderForm.js +6 -15
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.d.ts +7 -4
- package/dist/packages/ChangeOrderModal/api/getProductsSimilars.js +22 -21
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.d.ts +6 -1
- package/dist/packages/ChangeOrderModal/api/postChangeOrder.js +11 -17
- package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +4 -1
- package/dist/packages/ChangeOrderModal/components/ModalFooter.js +3 -1
- package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +2 -3
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +4 -5
- package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +21 -21
- package/dist/packages/ChangeOrderModal/mocks.d.ts +1 -0
- package/dist/packages/ChangeOrderModal/mocks.js +1 -0
- package/dist/packages/Coupons/Coupons.d.ts +4 -1
- package/dist/packages/Coupons/Coupons.js +61 -51
- package/dist/packages/Coupons/api/addCoupon.d.ts +1 -1
- package/dist/packages/Coupons/api/addCoupon.js +7 -7
- package/dist/packages/Coupons/api/getCoupons.d.ts +1 -1
- package/dist/packages/Coupons/api/getCoupons.js +4 -4
- package/dist/packages/Coupons/api/removeCoupon.d.ts +1 -1
- package/dist/packages/Coupons/api/removeCoupon.js +6 -6
- package/dist/packages/Coupons/components/CouponCard.d.ts +3 -1
- package/dist/packages/Coupons/components/CouponCard.js +86 -76
- package/dist/packages/Coupons/views/CouponsView.d.ts +3 -1
- package/dist/packages/Coupons/views/CouponsView.js +87 -78
- package/dist/packages/Coupons/views/LoadingView.js +6 -6
- package/dist/packages/Modal/Modal.js +1 -1
- package/dist/packages/Onboarding/Onboarding.js +1 -1
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.d.ts +1 -1
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardBadgeKg.js +16 -22
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.d.ts +3 -2
- package/dist/packages/ProductCard/ProductCardBadge/ProductCardDiscountBadge.js +15 -31
- package/dist/packages/ProductCard/ProductCardButton/AddToCartButton.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.d.ts +18 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Button.js +80 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.d.ts +10 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/IconButton.js +61 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.d.ts +8 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/Loader.js +44 -0
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.d.ts +17 -2
- package/dist/packages/ProductCard/ProductCardButton/CustomQuantitySelector/index.js +1 -1
- package/dist/packages/ProductCard/ProductCardButton/QuantitySelector.js +6 -6
- package/dist/packages/ProductCard/ProductCardHorizontal/index.js +31 -30
- package/dist/packages/ProductCard/ProductCardPrice/index.d.ts +8 -1
- package/dist/packages/ProductCard/ProductCardPrice/index.js +27 -31
- package/dist/packages/ProductCard/ProductCardVertical/index.js +16 -15
- package/dist/packages/ProductCard/index.js +1 -1
- package/dist/packages/ProductCardSeeMore/ProductCardSeeMore.js +1 -1
- package/dist/packages/Regionalization/Regionalization.d.ts +1 -1
- package/dist/packages/Regionalization/Regionalization.js +15 -13
- package/dist/packages/Regionalization/context/RegionalizationContext.d.ts +1 -1
- package/dist/packages/Regionalization/context/RegionalizationContext.js +31 -29
- package/dist/packages/Regionalization/types/RegionalizationProps.d.ts +1 -0
- package/dist/packages/Regionalization/views/AllStoresScreen.js +21 -21
- package/dist/packages/Tour/Tour.js +1 -1
- package/dist/styles/change-order-modal.global.css +1 -1
- package/dist/styles/product-card.global.css +1 -1
- package/dist/styles/regionalization.global.css +1 -1
- package/dist/types/ProductCard.d.ts +13 -12
- package/dist/utils/changerOrderModal.js +13 -16
- package/package.json +69 -69
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Button/Button.js +0 -45
- package/dist/node_modules/@faststore/components/dist/esm/atoms/Loader/Loader.js +0 -34
- package/dist/node_modules/@faststore/components/dist/esm/molecules/IconButton/IconButton.js +0 -29
|
@@ -1,122 +1,131 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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:
|
|
16
|
-
coupons:
|
|
17
|
+
closeIOModal: s,
|
|
18
|
+
coupons: n,
|
|
17
19
|
firstCouponName: i,
|
|
18
|
-
secondCouponName:
|
|
19
|
-
replaceCoupon:
|
|
20
|
+
secondCouponName: L,
|
|
21
|
+
replaceCoupon: C,
|
|
20
22
|
setView: A,
|
|
21
|
-
setActiveRule:
|
|
22
|
-
setDataItem:
|
|
23
|
+
setActiveRule: q,
|
|
24
|
+
setDataItem: H,
|
|
23
25
|
setFirstCouponName: m,
|
|
24
|
-
setSecondCouponName:
|
|
26
|
+
setSecondCouponName: f,
|
|
25
27
|
setReplaceCoupon: B,
|
|
26
|
-
setIsCloseModalEmpty:
|
|
27
|
-
genericTaggingEvent:
|
|
28
|
+
setIsCloseModalEmpty: J,
|
|
29
|
+
genericTaggingEvent: t
|
|
28
30
|
}) => {
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
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 &&
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
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:
|
|
40
|
-
}),
|
|
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:
|
|
43
|
-
objectError:
|
|
44
|
-
}),
|
|
49
|
+
couponName: r,
|
|
50
|
+
objectError: j.error
|
|
51
|
+
}), u("error"), y(!1), m("")), e(!0);
|
|
45
52
|
} else
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
48
|
-
|
|
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:
|
|
51
|
-
}),
|
|
57
|
+
couponName: r
|
|
58
|
+
}), u("error"), y(!1), e(!0);
|
|
52
59
|
} finally {
|
|
53
|
-
|
|
60
|
+
N(!1);
|
|
54
61
|
}
|
|
55
62
|
};
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
p &&
|
|
60
|
-
|
|
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:
|
|
69
|
+
closeModal: s,
|
|
63
70
|
title: "Meus Cupons",
|
|
64
|
-
genericTaggingEvent:
|
|
71
|
+
genericTaggingEvent: t
|
|
65
72
|
}
|
|
66
73
|
),
|
|
67
|
-
|
|
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:
|
|
74
|
-
onChange:
|
|
80
|
+
value: r,
|
|
81
|
+
onChange: K
|
|
75
82
|
}
|
|
76
83
|
),
|
|
77
|
-
/* @__PURE__ */ o("button", { type: "submit", name: "adicionar", disabled:
|
|
78
|
-
] }) }) : /* @__PURE__ */ o("div", { className: "cart-empty-coupons-label", children: /* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
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:
|
|
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:
|
|
85
|
-
|
|
91
|
+
/* @__PURE__ */ o("div", { className: "container-coupons", children: n.map((a) => /* @__PURE__ */ o(
|
|
92
|
+
V,
|
|
86
93
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
removeCouponMutation: _,
|
|
95
|
+
addCouponMutation: w,
|
|
96
|
+
account: D,
|
|
97
|
+
orderFormId: d,
|
|
98
|
+
hasItemsInCart: x,
|
|
90
99
|
isIO: p,
|
|
91
|
-
item:
|
|
100
|
+
item: a,
|
|
92
101
|
firstCouponName: i,
|
|
93
|
-
secondCouponName:
|
|
94
|
-
replaceCoupon:
|
|
102
|
+
secondCouponName: L,
|
|
103
|
+
replaceCoupon: C,
|
|
95
104
|
setView: A,
|
|
96
105
|
setFirstCouponName: m,
|
|
97
|
-
setSecondCouponName:
|
|
98
|
-
setActiveRule:
|
|
99
|
-
setDataItem:
|
|
106
|
+
setSecondCouponName: f,
|
|
107
|
+
setActiveRule: q,
|
|
108
|
+
setDataItem: H,
|
|
100
109
|
setReplaceCoupon: B,
|
|
101
|
-
setAlert:
|
|
102
|
-
setType:
|
|
103
|
-
setIsCloseModalEmpty:
|
|
104
|
-
genericTaggingEvent:
|
|
110
|
+
setAlert: e,
|
|
111
|
+
setType: u,
|
|
112
|
+
setIsCloseModalEmpty: J,
|
|
113
|
+
genericTaggingEvent: t
|
|
105
114
|
},
|
|
106
|
-
|
|
115
|
+
a.couponName
|
|
107
116
|
)) })
|
|
108
|
-
] }) : /* @__PURE__ */ o(
|
|
109
|
-
|
|
110
|
-
p &&
|
|
111
|
-
|
|
117
|
+
] }) : /* @__PURE__ */ o(W, {}) }),
|
|
118
|
+
h && /* @__PURE__ */ o(X, { type: z }),
|
|
119
|
+
p && s && /* @__PURE__ */ o(
|
|
120
|
+
U,
|
|
112
121
|
{
|
|
113
|
-
isFloating:
|
|
114
|
-
cancelButtonAction:
|
|
122
|
+
isFloating: n.length > 0,
|
|
123
|
+
cancelButtonAction: s,
|
|
115
124
|
cancelButtonText: "Sair"
|
|
116
125
|
}
|
|
117
126
|
)
|
|
118
127
|
] });
|
|
119
128
|
};
|
|
120
129
|
export {
|
|
121
|
-
|
|
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 {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
measurementUnit:
|
|
5
|
-
|
|
6
|
-
unitMultiplier:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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: ({
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
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,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
13
|
+
return a(() => {
|
|
30
14
|
if (!t || t <= 0) {
|
|
31
|
-
|
|
15
|
+
c(!1);
|
|
32
16
|
return;
|
|
33
17
|
}
|
|
34
|
-
|
|
35
|
-
}, [t]), !t || t <= 0 ? null : /* @__PURE__ */
|
|
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
|
-
|
|
25
|
+
h as ProductCardDiscountBadge
|
|
42
26
|
};
|
|
@@ -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 {
|
|
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'>;
|