@plurix/ecom-components 1.14.3-com2034.0 → 1.15.0-loyalty.0

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 (100) hide show
  1. package/dist/assets/svgs/CheckMarkBoxIcon.d.ts +1 -0
  2. package/dist/assets/svgs/CheckMarkBoxIcon.js +30 -0
  3. package/dist/assets/svgs/CheckMarkIcon.d.ts +1 -0
  4. package/dist/assets/svgs/CheckMarkIcon.js +23 -0
  5. package/dist/assets/svgs/CouponIcon.d.ts +1 -4
  6. package/dist/assets/svgs/CouponIcon.js +50 -14
  7. package/dist/assets/svgs/ErrorIcon.d.ts +1 -5
  8. package/dist/assets/svgs/ErrorIcon.js +26 -14
  9. package/dist/assets/svgs/ErrorIconV2.d.ts +1 -0
  10. package/dist/assets/svgs/ErrorIconV2.js +33 -0
  11. package/dist/assets/svgs/SuccessIconV2.d.ts +1 -0
  12. package/dist/assets/svgs/SuccessIconV2.js +30 -0
  13. package/dist/assets/svgs/WarningIconV2.d.ts +1 -0
  14. package/dist/assets/svgs/WarningIconV2.js +40 -0
  15. package/dist/hooks/useVerticalShelfCarouselProps.d.ts +4 -0
  16. package/dist/hooks/useVerticalShelfCarouselProps.js +14 -0
  17. package/dist/hooks/useWindowDimensions.d.ts +5 -0
  18. package/dist/hooks/useWindowDimensions.js +38 -0
  19. package/dist/main.d.ts +1 -0
  20. package/dist/main.js +19 -17
  21. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.d.ts +14 -0
  22. package/dist/packages/AdaptiveCarousel/AdaptiveCarousel.js +69 -0
  23. package/dist/packages/ChangeOrderModal/ChangeOrderModal.d.ts +3 -3
  24. package/dist/packages/ChangeOrderModal/ChangeOrderModal.js +73 -71
  25. package/dist/packages/ChangeOrderModal/components/ModalFooter.d.ts +1 -4
  26. package/dist/packages/ChangeOrderModal/components/ModalFooter.js +1 -3
  27. package/dist/packages/ChangeOrderModal/components/SimilarProductList.d.ts +3 -2
  28. package/dist/packages/ChangeOrderModal/components/SimilarProducts.d.ts +5 -4
  29. package/dist/packages/ChangeOrderModal/components/SimilarProducts.js +21 -21
  30. package/dist/packages/ChangeOrderModal/mocks.d.ts +0 -1
  31. package/dist/packages/ChangeOrderModal/mocks.js +0 -1
  32. package/dist/packages/Coupons/Coupons.d.ts +3 -17
  33. package/dist/packages/Coupons/Coupons.js +76 -114
  34. package/dist/packages/Coupons/api/addCoupon.d.ts +1 -1
  35. package/dist/packages/Coupons/api/addCoupon.js +7 -7
  36. package/dist/packages/Coupons/api/getCoupons.d.ts +1 -1
  37. package/dist/packages/Coupons/api/getCoupons.js +4 -4
  38. package/dist/packages/Coupons/api/removeCoupon.d.ts +1 -1
  39. package/dist/packages/Coupons/api/removeCoupon.js +6 -6
  40. package/dist/packages/Coupons/components/Alert.d.ts +4 -2
  41. package/dist/packages/Coupons/components/Alert.js +10 -10
  42. package/dist/packages/Coupons/components/CouponCard.d.ts +5 -22
  43. package/dist/packages/Coupons/components/CouponCard.js +79 -133
  44. package/dist/packages/Coupons/components/NoCoupons.js +7 -7
  45. package/dist/packages/Coupons/hooks/useCoupons.d.ts +34 -0
  46. package/dist/packages/Coupons/hooks/useCoupons.js +109 -0
  47. package/dist/packages/Coupons/types/CouponType.d.ts +1 -1
  48. package/dist/packages/VouchersRedeemed/VouchersRedeemed.d.ts +24 -0
  49. package/dist/packages/VouchersRedeemed/VouchersRedeemed.js +145 -0
  50. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.d.ts +1 -0
  51. package/dist/packages/VouchersRedeemed/api/getCouponsCartonistByUser.js +20 -0
  52. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.d.ts +12 -0
  53. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/StatusMessageTryApply.js +27 -0
  54. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.d.ts +1 -0
  55. package/dist/packages/VouchersRedeemed/components/StatusMessageTryApply/index.js +4 -0
  56. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.d.ts +17 -0
  57. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/VoucherRedeemedCard.js +37 -0
  58. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.d.ts +1 -0
  59. package/dist/packages/VouchersRedeemed/components/VoucherRedeemedCard/index.js +4 -0
  60. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.d.ts +15 -0
  61. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/VouchersRedeemedSkeleton.js +49 -0
  62. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.d.ts +1 -0
  63. package/dist/packages/VouchersRedeemed/components/VouchersRedeemedSkeleton/index.js +4 -0
  64. package/dist/packages/VouchersRedeemed/data/validVouchers.d.ts +1 -0
  65. package/dist/packages/VouchersRedeemed/data/validVouchers.js +20 -0
  66. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.d.ts +1 -0
  67. package/dist/packages/VouchersRedeemed/utils/getCouponPrice.js +8 -0
  68. package/dist/styles/adaptive-carousel.global.css +1 -0
  69. package/dist/styles/change-order-modal.global.css +1 -1
  70. package/dist/styles/coupons.global.css +1 -1
  71. package/dist/styles/vouchers-redeemed.global.css +1 -0
  72. package/dist/utils/carousel/carouselProps.d.ts +33 -0
  73. package/dist/utils/carousel/carouselProps.js +59 -0
  74. package/dist/utils/scroll/isScrollToEnd.d.ts +1 -0
  75. package/dist/utils/scroll/isScrollToEnd.js +4 -0
  76. package/dist/utils/setBoldTextParts.d.ts +1 -0
  77. package/dist/utils/setBoldTextParts.js +7 -0
  78. package/package.json +69 -69
  79. package/dist/packages/Coupons/components/Breadcrumb.d.ts +0 -6
  80. package/dist/packages/Coupons/components/Breadcrumb.js +0 -33
  81. package/dist/packages/Coupons/components/Modal.d.ts +0 -8
  82. package/dist/packages/Coupons/components/Modal.js +0 -62
  83. package/dist/packages/Coupons/components/ModalFooter.d.ts +0 -9
  84. package/dist/packages/Coupons/components/ModalFooter.js +0 -25
  85. package/dist/packages/Coupons/components/ModalHeader.d.ts +0 -6
  86. package/dist/packages/Coupons/components/ModalHeader.js +0 -25
  87. package/dist/packages/Coupons/types/Views.d.ts +0 -1
  88. package/dist/packages/Coupons/types/Views.js +0 -1
  89. package/dist/packages/Coupons/views/CouponsView.d.ts +0 -15
  90. package/dist/packages/Coupons/views/CouponsView.js +0 -131
  91. package/dist/packages/Coupons/views/EmptyCartView.d.ts +0 -6
  92. package/dist/packages/Coupons/views/EmptyCartView.js +0 -36
  93. package/dist/packages/Coupons/views/LoadingView.d.ts +0 -7
  94. package/dist/packages/Coupons/views/LoadingView.js +0 -39
  95. package/dist/packages/Coupons/views/OverwriteView.d.ts +0 -14
  96. package/dist/packages/Coupons/views/OverwriteView.js +0 -58
  97. package/dist/packages/Coupons/views/RulesView.d.ts +0 -13
  98. package/dist/packages/Coupons/views/RulesView.js +0 -49
  99. package/dist/packages/Coupons/views/index.d.ts +0 -5
  100. package/dist/packages/Coupons/views/index.js +0 -12
@@ -1,33 +0,0 @@
1
- import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import { ArrowIcon as a } from "../../../assets/svgs/ArrowIcon.js";
3
- const s = ({ title: c, cancelButtonAction: o }) => /* @__PURE__ */ t("div", { className: "breadcrumb-container", children: [
4
- /* @__PURE__ */ t("div", { className: "breadcrumb-content-container", children: [
5
- /* @__PURE__ */ r(
6
- "button",
7
- {
8
- onClick: o,
9
- "data-testid": "back-to-coupons-button",
10
- children: "Meus Cupons"
11
- }
12
- ),
13
- " ",
14
- /* @__PURE__ */ r(a, {}),
15
- " ",
16
- /* @__PURE__ */ r("span", { children: c })
17
- ] }),
18
- /* @__PURE__ */ t(
19
- "button",
20
- {
21
- className: "breadcrumb-back-button",
22
- onClick: o,
23
- "data-testid": "back-button",
24
- children: [
25
- /* @__PURE__ */ r(a, { color: "var(--color-support-links)", rotate: "Left" }),
26
- " Voltar"
27
- ]
28
- }
29
- )
30
- ] });
31
- export {
32
- s as Breadcrumb
33
- };
@@ -1,8 +0,0 @@
1
- import { ModalHeaderProps } from './ModalHeader';
2
- import { ModalFooterProps } from './ModalFooter';
3
-
4
- interface ModalProps extends ModalHeaderProps, ModalFooterProps {
5
- isIO?: boolean;
6
- }
7
- export declare const Modal: ({ children, isIO, closeModal, title, genericTaggingEvent, cancelButtonAction, ...modalFooterProps }: React.PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,62 +0,0 @@
1
- var x = Object.defineProperty;
2
- var m = Object.getOwnPropertySymbols;
3
- var c = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
4
- var i = (r, e, o) => e in r ? x(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o, p = (r, e) => {
5
- for (var o in e || (e = {}))
6
- c.call(e, o) && i(r, o, e[o]);
7
- if (m)
8
- for (var o of m(e))
9
- n.call(e, o) && i(r, o, e[o]);
10
- return r;
11
- };
12
- var u = (r, e) => {
13
- var o = {};
14
- for (var a in r)
15
- c.call(r, a) && e.indexOf(a) < 0 && (o[a] = r[a]);
16
- if (r != null && m)
17
- for (var a of m(r))
18
- e.indexOf(a) < 0 && n.call(r, a) && (o[a] = r[a]);
19
- return o;
20
- };
21
- import { jsx as l, jsxs as h } from "react/jsx-runtime";
22
- import { ModalHeader as v } from "./ModalHeader.js";
23
- import { Breadcrumb as M } from "./Breadcrumb.js";
24
- import { ModalFooter as N } from "./ModalFooter.js";
25
- const q = (j) => {
26
- var s = j, {
27
- children: r,
28
- isIO: e = !1,
29
- closeModal: o,
30
- title: a,
31
- genericTaggingEvent: f,
32
- cancelButtonAction: d
33
- } = s, t = u(s, [
34
- "children",
35
- "isIO",
36
- "closeModal",
37
- "title",
38
- "genericTaggingEvent",
39
- "cancelButtonAction"
40
- ]);
41
- return /* @__PURE__ */ l("div", { className: "modal-rule-coupon-external", children: /* @__PURE__ */ h("div", { className: "modal-rule-coupon-internal", children: [
42
- /* @__PURE__ */ l(
43
- v,
44
- {
45
- closeModal: o,
46
- title: a,
47
- genericTaggingEvent: f
48
- }
49
- ),
50
- e && /* @__PURE__ */ l(M, { title: a, cancelButtonAction: d }),
51
- /* @__PURE__ */ l("div", { className: "modal-rule-coupon-children", children: r }),
52
- /* @__PURE__ */ l(
53
- N,
54
- p({
55
- cancelButtonAction: d
56
- }, t)
57
- )
58
- ] }) });
59
- };
60
- export {
61
- q as Modal
62
- };
@@ -1,9 +0,0 @@
1
- export interface ModalFooterProps {
2
- cancelButtonAction: () => void;
3
- cancelButtonText: string;
4
- confirmButtonAction?: () => void;
5
- confirmButtonText?: string;
6
- isFloating?: boolean;
7
- redirectionClubText?: string;
8
- }
9
- export declare const ModalFooter: ({ cancelButtonAction, cancelButtonText, confirmButtonAction, confirmButtonText, isFloating, redirectionClubText }: ModalFooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,25 +0,0 @@
1
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- const d = ({
3
- cancelButtonAction: t,
4
- cancelButtonText: r,
5
- confirmButtonAction: c,
6
- confirmButtonText: l,
7
- isFloating: a,
8
- redirectionClubText: n
9
- }) => /* @__PURE__ */ e("div", { className: `modal-footer-container ${a ? "floating" : ""}`, children: [
10
- c && l && /* @__PURE__ */ o("button", { onClick: c, className: "modal-confirm-button", children: l }),
11
- /* @__PURE__ */ o("button", { onClick: t, className: "modal-cancel-button", children: r }),
12
- n && /* @__PURE__ */ o(
13
- "button",
14
- {
15
- onClick: () => {
16
- window.location.href = "/s/?clubProducts";
17
- },
18
- className: "modal-confirm-button redirection-club-button",
19
- children: n
20
- }
21
- )
22
- ] });
23
- export {
24
- d as ModalFooter
25
- };
@@ -1,6 +0,0 @@
1
- export interface ModalHeaderProps {
2
- closeModal: () => void;
3
- title: string;
4
- genericTaggingEvent?: (name: string, params: object) => void;
5
- }
6
- export declare const ModalHeader: ({ closeModal, title, genericTaggingEvent }: ModalHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,25 +0,0 @@
1
- import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
- import { CloseIcon as t } from "../../../assets/svgs/CloseIcon.js";
3
- const r = ({
4
- closeModal: d,
5
- title: s,
6
- genericTaggingEvent: o
7
- }) => /* @__PURE__ */ a("div", { className: "modal-title-container", children: [
8
- /* @__PURE__ */ l("h1", { className: "modal-title", children: s }),
9
- /* @__PURE__ */ l(
10
- "button",
11
- {
12
- onClick: () => {
13
- o == null || o("discount_coupon", {
14
- name: "Modal fechado no X"
15
- }), d();
16
- },
17
- className: "modal-close-icon",
18
- "data-testid": "close-button",
19
- children: /* @__PURE__ */ l(t, {})
20
- }
21
- )
22
- ] });
23
- export {
24
- r as ModalHeader
25
- };
@@ -1 +0,0 @@
1
- export type View = 'coupons-view' | 'rules-view' | 'overwrite-view';
@@ -1 +0,0 @@
1
-
@@ -1,15 +0,0 @@
1
- import { CouponCardProps } from '../components/CouponCard';
2
- import { CouponType } from '../types/CouponType';
3
-
4
- type OmittedProps = 'item' | 'setType' | 'setAlert';
5
- interface CouponsViewProps extends Omit<CouponCardProps, OmittedProps> {
6
- account: string;
7
- orderFormId: string;
8
- hasItemsInCart: boolean;
9
- closeIOModal?: () => void;
10
- coupons: CouponType[];
11
- addCouponMutation?: any;
12
- removeCouponMutation?: any;
13
- }
14
- export declare const CouponsView: ({ addCouponMutation, removeCouponMutation, account, orderFormId, hasItemsInCart, isIO, closeIOModal, coupons, firstCouponName, secondCouponName, replaceCoupon, setView, setActiveRule, setDataItem, setFirstCouponName, setSecondCouponName, setReplaceCoupon, setIsCloseModalEmpty, genericTaggingEvent }: CouponsViewProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,131 +0,0 @@
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,
16
- isIO: p,
17
- closeIOModal: s,
18
- coupons: n,
19
- firstCouponName: i,
20
- secondCouponName: L,
21
- replaceCoupon: C,
22
- setView: A,
23
- setActiveRule: q,
24
- setDataItem: H,
25
- setFirstCouponName: m,
26
- setSecondCouponName: f,
27
- setReplaceCoupon: B,
28
- setIsCloseModalEmpty: J,
29
- genericTaggingEvent: t
30
- }) => {
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();
35
- try {
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", {
45
- name: "Cupom aplicado do input",
46
- couponName: r
47
- }), u("success"), y(!0), m(r), p && window.location.reload()) : (t == null || t("discount_coupon", {
48
- name: "Cupom do input expirado ou invalido",
49
- couponName: r,
50
- objectError: j.error
51
- }), u("error"), y(!1), m("")), e(!0);
52
- } else
53
- f(r), A("overwrite-view");
54
- } catch (b) {
55
- t == null || t("discount_coupon", {
56
- name: "Cupom do input - error na api",
57
- couponName: r
58
- }), u("error"), y(!1), e(!0);
59
- } finally {
60
- N(!1);
61
- }
62
- };
63
- return Q(() => {
64
- h && setTimeout(() => e(!1), 5e3);
65
- }, [G, h]), /* @__PURE__ */ c(S, { children: [
66
- p && s && /* @__PURE__ */ o(
67
- R,
68
- {
69
- closeModal: s,
70
- title: "Meus Cupons",
71
- genericTaggingEvent: t
72
- }
73
- ),
74
- x ? /* @__PURE__ */ o("div", { className: "form-coupons", children: /* @__PURE__ */ c("form", { onSubmit: M, children: [
75
- /* @__PURE__ */ o(
76
- "input",
77
- {
78
- type: "text",
79
- placeholder: "Insira o cupom",
80
- value: r,
81
- onChange: K
82
- }
83
- ),
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, {}) }),
87
- "Para adicionar um cupom é necessário que você adicione pelo menos 1 produto no carrinho"
88
- ] }) }),
89
- /* @__PURE__ */ o("div", { className: "container-title-coupons", children: n.length > 0 ? /* @__PURE__ */ c(S, { children: [
90
- /* @__PURE__ */ o("h2", { children: "Cupons disponíveis" }),
91
- /* @__PURE__ */ o("div", { className: "container-coupons", children: n.map((a) => /* @__PURE__ */ o(
92
- V,
93
- {
94
- removeCouponMutation: _,
95
- addCouponMutation: w,
96
- account: D,
97
- orderFormId: d,
98
- hasItemsInCart: x,
99
- isIO: p,
100
- item: a,
101
- firstCouponName: i,
102
- secondCouponName: L,
103
- replaceCoupon: C,
104
- setView: A,
105
- setFirstCouponName: m,
106
- setSecondCouponName: f,
107
- setActiveRule: q,
108
- setDataItem: H,
109
- setReplaceCoupon: B,
110
- setAlert: e,
111
- setType: u,
112
- setIsCloseModalEmpty: J,
113
- genericTaggingEvent: t
114
- },
115
- a.couponName
116
- )) })
117
- ] }) : /* @__PURE__ */ o(W, {}) }),
118
- h && /* @__PURE__ */ o(X, { type: z }),
119
- p && s && /* @__PURE__ */ o(
120
- U,
121
- {
122
- isFloating: n.length > 0,
123
- cancelButtonAction: s,
124
- cancelButtonText: "Sair"
125
- }
126
- )
127
- ] });
128
- };
129
- export {
130
- to as CouponsView
131
- };
@@ -1,6 +0,0 @@
1
- interface EmptyCartViewProps {
2
- setIsCloseModalEmpty: (isCloseModalEmpty: boolean) => void;
3
- genericTaggingEvent?: (name: string, params: object) => void;
4
- }
5
- export declare const EmptyCartView: ({ setIsCloseModalEmpty, genericTaggingEvent }: EmptyCartViewProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,36 +0,0 @@
1
- import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
- import { Modal as e } from "../components/Modal.js";
3
- import { InfoIcon as s } from "../../../assets/svgs/InfoIcon.js";
4
- const u = ({
5
- setIsCloseModalEmpty: t,
6
- genericTaggingEvent: o
7
- }) => {
8
- const r = () => {
9
- t(!1);
10
- };
11
- return /* @__PURE__ */ c(
12
- e,
13
- {
14
- closeModal: r,
15
- title: "Cupons de desconto",
16
- genericTaggingEvent: o,
17
- cancelButtonText: "Voltar para Meus Cupons",
18
- cancelButtonAction: () => {
19
- o == null || o("discount_coupon", {
20
- name: "Modal do cart vazio - botão de sair"
21
- }), r();
22
- },
23
- redirectionClubText: "Ver Minhas Ofertas",
24
- children: [
25
- /* @__PURE__ */ a("h3", { className: "cartEmptyCoupon-h3", children: "Ops...Parece que seu carrinho está vazio..." }),
26
- /* @__PURE__ */ c("p", { id: "cartEmptyCoupon-p", children: [
27
- /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(s, {}) }),
28
- "Para adicionar um cupom é necessário que você adicione pelo menos 1 produto no carrinho"
29
- ] })
30
- ]
31
- }
32
- );
33
- };
34
- export {
35
- u as EmptyCartView
36
- };
@@ -1,7 +0,0 @@
1
- interface LoadingViewProps {
2
- isIO?: boolean;
3
- closeIOModal?: () => void;
4
- genericTaggingEvent?: (name: string, params: object) => void;
5
- }
6
- export declare const LoadingView: ({ isIO, closeIOModal, genericTaggingEvent }: LoadingViewProps) => import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,39 +0,0 @@
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";
5
- const f = ({
6
- isIO: t = !1,
7
- closeIOModal: o,
8
- genericTaggingEvent: e
9
- }) => /* @__PURE__ */ a(n, { children: [
10
- t && o && /* @__PURE__ */ r(
11
- i,
12
- {
13
- closeModal: o,
14
- title: "Meus Cupons",
15
- genericTaggingEvent: e
16
- }
17
- ),
18
- /* @__PURE__ */ r(
19
- u,
20
- {
21
- width: t ? "100%" : "90%",
22
- height: t ? 600 : 425,
23
- backgroundColor: "var(--color-grayScale-faded)",
24
- margin: "auto",
25
- animation: !0
26
- }
27
- ),
28
- t && o && /* @__PURE__ */ r(
29
- m,
30
- {
31
- isFloating: !0,
32
- cancelButtonAction: o,
33
- cancelButtonText: "Sair"
34
- }
35
- )
36
- ] });
37
- export {
38
- f as LoadingView
39
- };
@@ -1,14 +0,0 @@
1
- import { View } from '../types/Views';
2
-
3
- interface OverwriteViewProps {
4
- firstCouponName: string;
5
- secondCouponName: string;
6
- setView: (view: View) => void;
7
- setReplaceCoupon: (replaceCoupon: boolean) => void;
8
- setSecondCouponName: (secondCouponName: string) => void;
9
- isIO?: boolean;
10
- closeIOModal?: () => void;
11
- genericTaggingEvent?: (name: string, params: object) => void;
12
- }
13
- export declare const OverwriteView: ({ firstCouponName, secondCouponName, setView, setReplaceCoupon, setSecondCouponName, isIO, closeIOModal, genericTaggingEvent }: OverwriteViewProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,58 +0,0 @@
1
- import { jsx as t, jsxs as m } from "react/jsx-runtime";
2
- import { useState as h, useEffect as n } from "react";
3
- import { Modal as C } from "../components/Modal.js";
4
- import { InfoIcon as M } from "../../../assets/svgs/InfoIcon.js";
5
- const S = ({
6
- firstCouponName: d,
7
- secondCouponName: s,
8
- setView: u,
9
- setReplaceCoupon: i,
10
- setSecondCouponName: c,
11
- isIO: r,
12
- closeIOModal: l,
13
- genericTaggingEvent: o
14
- }) => {
15
- const [p, a] = h(!0), f = () => {
16
- a(!1), u("coupons-view");
17
- }, b = () => {
18
- o == null || o("discount_coupon", {
19
- name: "Modal de troca de cupom - botão de substituir cupom",
20
- cupomName: s
21
- }), i(!0), u("coupons-view");
22
- }, e = () => {
23
- o == null || o("discount_coupon", {
24
- name: "Modal de troca de cupom - botão de sair"
25
- }), c(""), u("coupons-view");
26
- };
27
- return n(() => {
28
- p || c("");
29
- }, [p]), /* @__PURE__ */ t(
30
- C,
31
- {
32
- isIO: r,
33
- closeModal: r && l ? l : f,
34
- genericTaggingEvent: o,
35
- title: "Substituir Cupom",
36
- confirmButtonAction: b,
37
- confirmButtonText: "Substituir Cupom",
38
- cancelButtonAction: e,
39
- cancelButtonText: "Voltar para Meus Cupons",
40
- children: /* @__PURE__ */ m("p", { children: [
41
- /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(M, {}) }),
42
- /* @__PURE__ */ m("span", { children: [
43
- /* @__PURE__ */ t("b", { children: "Não é possível adicionar 2 cupons ao mesmo tempo." }),
44
- /* @__PURE__ */ t("br", {}),
45
- 'Ao clicar em "Substituir Cupom" você irá substituir o cupom',
46
- " ",
47
- /* @__PURE__ */ t("b", { children: d }),
48
- " pelo cupom ",
49
- /* @__PURE__ */ t("b", { children: s }),
50
- "."
51
- ] })
52
- ] })
53
- }
54
- );
55
- };
56
- export {
57
- S as OverwriteView
58
- };
@@ -1,13 +0,0 @@
1
- import { CouponType } from '../types/CouponType';
2
- import { View } from '../types/Views';
3
-
4
- interface RulesViewProps {
5
- dataItem: CouponType | undefined;
6
- setActiveRule: (activeRule: boolean) => void;
7
- setView: (view: View) => void;
8
- isIO?: boolean;
9
- closeIOModal?: () => void;
10
- genericTaggingEvent?: (name: string, params: object) => void;
11
- }
12
- export declare const RulesView: ({ dataItem, setActiveRule, setView, isIO, closeIOModal, genericTaggingEvent }: RulesViewProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1,49 +0,0 @@
1
- import { jsx as u, jsxs as n } from "react/jsx-runtime";
2
- import { Modal as h } from "../components/Modal.js";
3
- import { InfoIcon as f } from "../../../assets/svgs/InfoIcon.js";
4
- const m = ({
5
- dataItem: l,
6
- setActiveRule: d,
7
- setView: i,
8
- isIO: r,
9
- closeIOModal: s,
10
- genericTaggingEvent: o
11
- }) => {
12
- const c = () => {
13
- d(!1), i("coupons-view");
14
- };
15
- return /* @__PURE__ */ u(
16
- h,
17
- {
18
- isIO: r,
19
- closeModal: r && s ? s : c,
20
- genericTaggingEvent: o,
21
- title: "Regra de Utilização",
22
- confirmButtonAction: () => {
23
- o == null || o("discount_coupon", {
24
- name: "Modal regra de utilização - botão Ok, entendi"
25
- }), c();
26
- },
27
- confirmButtonText: "Ok, Entendi",
28
- cancelButtonAction: () => {
29
- o == null || o("discount_coupon", {
30
- name: "Modal regra de utilização - botão sair"
31
- }), c();
32
- },
33
- cancelButtonText: "Voltar para Meus Cupons",
34
- children: /* @__PURE__ */ n("p", { children: [
35
- /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(f, {}) }),
36
- /* @__PURE__ */ n("ul", { children: [
37
- l == null ? void 0 : l.couponRules.map((p) => /* @__PURE__ */ u("li", { children: p }, p)),
38
- /* @__PURE__ */ n("li", { children: [
39
- "Válido até ",
40
- l == null ? void 0 : l.couponExpirationDate
41
- ] })
42
- ] })
43
- ] })
44
- }
45
- );
46
- };
47
- export {
48
- m as RulesView
49
- };
@@ -1,5 +0,0 @@
1
- export { LoadingView } from './LoadingView';
2
- export { CouponsView } from './CouponsView';
3
- export { RulesView } from './RulesView';
4
- export { OverwriteView } from './OverwriteView';
5
- export { EmptyCartView } from './EmptyCartView';
@@ -1,12 +0,0 @@
1
- import { LoadingView as r } from "./LoadingView.js";
2
- import { CouponsView as i } from "./CouponsView.js";
3
- import { RulesView as m } from "./RulesView.js";
4
- import { OverwriteView as f } from "./OverwriteView.js";
5
- import { EmptyCartView as V } from "./EmptyCartView.js";
6
- export {
7
- i as CouponsView,
8
- V as EmptyCartView,
9
- r as LoadingView,
10
- f as OverwriteView,
11
- m as RulesView
12
- };