@plurix/ecom-components 0.0.2-beta.1 → 0.0.2-beta.2
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/assets/svgs/CloseIcon.d.ts +1 -0
- package/dist/assets/svgs/CloseIcon.js +37 -0
- package/dist/assets/svgs/FacebookIcon.d.ts +1 -0
- package/dist/assets/svgs/FacebookIcon.js +22 -0
- package/dist/assets/svgs/InstagramIcon.d.ts +1 -0
- package/dist/assets/svgs/InstagramIcon.js +49 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +4 -2
- package/dist/packages/CartClubAlert/CartClubAlert.js +1 -1
- package/dist/packages/Onboarding/Onboarding.d.ts +10 -0
- package/dist/packages/Onboarding/Onboarding.js +47 -0
- package/dist/packages/Onboarding/components/Bullets.d.ts +5 -0
- package/dist/packages/Onboarding/components/Bullets.js +10 -0
- package/dist/packages/Onboarding/components/Content.d.ts +9 -0
- package/dist/packages/Onboarding/components/Content.js +30 -0
- package/dist/packages/Onboarding/components/Footer.d.ts +9 -0
- package/dist/packages/Onboarding/components/Footer.js +15 -0
- package/dist/packages/Onboarding/components/Header.d.ts +6 -0
- package/dist/packages/Onboarding/components/Header.js +11 -0
- package/dist/packages/Onboarding/components/SocialMedia.d.ts +10 -0
- package/dist/packages/Onboarding/components/SocialMedia.js +36 -0
- package/dist/packages/Onboarding/constants/tips.d.ts +11 -0
- package/dist/packages/Onboarding/constants/tips.js +36 -0
- package/dist/packages/Onboarding/test/Bullets.test.js +20 -0
- package/dist/packages/Onboarding/test/Content.test.js +52 -0
- package/dist/packages/Onboarding/test/Footer.test.js +60 -0
- package/dist/packages/Onboarding/test/Header.test.js +30 -0
- package/dist/packages/Onboarding/test/Onboarding.test.js +22 -0
- package/dist/packages/Onboarding/test/SocialMedia.test.js +39 -0
- package/dist/packages/Onboarding/tips/Tip1.d.ts +1 -0
- package/dist/packages/Onboarding/tips/Tip1.js +2130 -0
- package/dist/packages/Onboarding/tips/Tip2.d.ts +1 -0
- package/dist/packages/Onboarding/tips/Tip2.js +361 -0
- package/dist/packages/Onboarding/tips/Tip3.d.ts +1 -0
- package/dist/packages/Onboarding/tips/Tip3.js +350 -0
- package/dist/packages/Onboarding/tips/Tip4.d.ts +1 -0
- package/dist/packages/Onboarding/tips/Tip4.js +593 -0
- package/dist/packages/Onboarding/tips/Tip5.d.ts +1 -0
- package/dist/packages/Onboarding/tips/Tip5.js +1571 -0
- package/dist/styles/onboarding.global.css +1 -0
- package/dist/types/FixedLengthArray.d.ts +7 -0
- package/dist/types/FixedLengthArray.js +1 -0
- package/package.json +4 -1
- /package/dist/assets/{svg → svgs}/DiscountIcon.d.ts +0 -0
- /package/dist/assets/{svg → svgs}/DiscountIcon.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
const e = () => /* @__PURE__ */ r(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
width: "24",
|
|
6
|
+
height: "24",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
fill: "none",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
"data-testid": "close-icon",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ o(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
d: "M18 6L6 18",
|
|
16
|
+
stroke: "var(--color-main)",
|
|
17
|
+
strokeWidth: "1.8",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
/* @__PURE__ */ o(
|
|
23
|
+
"path",
|
|
24
|
+
{
|
|
25
|
+
d: "M6 6L18 18",
|
|
26
|
+
stroke: "var(--color-main)",
|
|
27
|
+
strokeWidth: "1.8",
|
|
28
|
+
strokeLinecap: "round",
|
|
29
|
+
strokeLinejoin: "round"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
export {
|
|
36
|
+
e as CloseIcon
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FacebookIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
const t = () => /* @__PURE__ */ C(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
width: "32",
|
|
6
|
+
height: "32",
|
|
7
|
+
viewBox: "0 0 32 32",
|
|
8
|
+
fill: "none",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
"data-testid": "facebook-icon",
|
|
11
|
+
children: /* @__PURE__ */ C(
|
|
12
|
+
"path",
|
|
13
|
+
{
|
|
14
|
+
d: "M28.0595 32H21.9913C22.0015 31.8664 22.0211 31.7328 22.0211 31.5985C22.0211 28.2036 22.0195 24.8087 22.0164 21.4138C22.0164 21.1115 22.1033 21.0185 22.4081 21.0232C23.1689 21.0427 23.9305 21.0232 24.6905 21.0357C24.949 21.042 25.0783 20.9576 25.1747 20.717C25.7521 19.2445 26.346 17.7783 26.9336 16.3089C26.9704 16.216 26.9939 16.1176 27.0394 15.9691H22.3384C22.1746 15.9691 22.0203 15.9785 22.0211 15.7403C22.025 14.5318 22.0015 13.3234 22.0328 12.1165C22.0532 11.3502 22.2624 11.1432 23.0326 11.0877C23.769 11.0346 24.5095 11.0463 25.2483 11.0315C25.4951 11.0268 25.7419 11.0315 26.0052 11.0315V5.97037H25.6189C24.3888 5.97037 23.1587 5.97037 21.9286 5.97037C21.6377 5.9727 21.3473 5.99304 21.0589 6.03129C18.2383 6.39843 15.9607 8.98562 15.9552 11.8275C15.9552 13.0664 15.9552 14.3055 15.9552 15.545C15.9552 15.966 15.9552 15.9668 15.5196 15.9668C14.4567 15.9668 13.3932 15.9668 12.3292 15.9668C12.2101 15.9668 12.0903 15.977 11.9813 15.9816V21.0271H12.3833C13.4363 21.0271 14.4891 21.0271 15.5416 21.0271C15.9552 21.0271 15.9552 21.0271 15.9552 21.4396C15.9552 24.8246 15.9552 28.2096 15.9552 31.5946C15.9552 31.7289 15.9748 31.8625 15.985 31.9961H3.91211C3.81495 31.9672 3.71857 31.9359 3.62063 31.9102C3.18031 31.7946 2.70709 31.7477 2.30594 31.5532C0.700553 30.7759 0.00479752 29.4222 0.00401402 27.6841C-0.000686965 20.1642 -0.000686965 12.6443 0.00401402 5.12437C0.00401402 4.64709 0.0243796 4.16824 0.0572865 3.69096C0.115969 2.84413 0.450652 2.03962 1.01034 1.39996C1.57002 0.760295 2.32404 0.320534 3.15759 0.147639C3.40831 0.0960832 3.66061 0.0492127 3.91211 0H28.0595C28.1535 0.0377382 28.2512 0.0657422 28.351 0.0835793C30.0339 0.208564 31.5061 1.49747 31.8485 3.1543C31.9025 3.41443 31.9503 3.67611 32.0005 3.93546V28.0575C31.9624 28.1514 31.9346 28.2491 31.9174 28.3489C31.7921 30.0299 30.5017 31.5008 28.843 31.843C28.5844 31.9024 28.3204 31.95 28.0595 32Z",
|
|
15
|
+
fill: "#4864AE"
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
t as FacebookIcon
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const InstagramIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as t, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
const l = () => /* @__PURE__ */ t(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
width: "32",
|
|
6
|
+
height: "32",
|
|
7
|
+
viewBox: "0 0 32 32",
|
|
8
|
+
fill: "none",
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
"data-testid": "instagram-icon",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ t("g", { clipPath: "url(#clip0_46032_17319)", children: [
|
|
13
|
+
/* @__PURE__ */ C(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M16.0005 2.88243C20.2729 2.88243 20.7785 2.89894 22.466 2.97579C24.0259 3.04693 24.8731 3.30733 25.4371 3.52645C26.1329 3.78265 26.7623 4.19177 27.279 4.72365C27.8108 5.24027 28.22 5.8697 28.4762 6.56551C28.6953 7.1295 28.9557 7.97675 29.0268 9.53661C29.1037 11.2241 29.1202 11.7297 29.1202 16.0022C29.1202 20.2746 29.1037 20.7802 29.0268 22.4677C28.9557 24.0276 28.6953 24.8748 28.4762 25.4388C28.2097 26.1287 27.8019 26.7552 27.279 27.2781C26.756 27.8011 26.1295 28.2089 25.4397 28.4753C24.8757 28.6944 24.0284 28.9548 22.4686 29.026C20.7817 29.1028 20.2755 29.1193 16.003 29.1193C11.7306 29.1193 11.2244 29.1028 9.53748 29.026C7.97762 28.9548 7.13036 28.6944 6.56638 28.4753C5.87057 28.2191 5.24114 27.81 4.72452 27.2781C4.19265 26.7615 3.78352 26.1321 3.52732 25.4363C3.3082 24.8723 3.0478 24.025 2.97667 22.4652C2.89982 20.7776 2.88331 20.2721 2.88331 15.9996C2.88331 11.7271 2.89982 11.2216 2.97667 9.53407C3.0478 7.97421 3.3082 7.12695 3.52732 6.56297C3.78352 5.86716 4.19265 5.23773 4.72452 4.72111C5.24114 4.18923 5.87057 3.78011 6.56638 3.52391C7.13036 3.30479 7.97762 3.04439 9.53748 2.97325C11.225 2.8964 11.7306 2.87989 16.003 2.87989L16.0005 2.88243ZM16.003 -0.00292969C11.6575 -0.00292969 11.1126 0.0154889 9.406 0.0936089C7.69943 0.171729 6.53716 0.444196 5.52097 0.839243C4.45307 1.24124 3.48557 1.87107 2.68578 2.68491C1.87194 3.4847 1.24212 4.4522 0.840119 5.52009C0.445073 6.53629 0.174512 7.70111 0.0970268 9.40387C0.0195419 11.1066 0.000488281 11.6541 0.000488281 15.9996C0.000488281 20.3451 0.0189068 20.8901 0.0970268 22.5966C0.175147 24.3032 0.445073 25.4629 0.840119 26.4791C1.24228 27.5466 1.8721 28.5136 2.68578 29.3131C3.4853 30.1274 4.45286 30.7575 5.52097 31.1594C6.53716 31.555 7.70197 31.8256 9.40473 31.9031C11.1075 31.9806 11.6562 31.9996 16.0017 31.9996C20.3472 31.9996 20.8922 31.9812 22.5988 31.9031C24.3053 31.825 25.4638 31.555 26.48 31.1594C27.5432 30.7485 28.5088 30.12 29.3148 29.314C30.1208 28.508 30.7494 27.5424 31.1602 26.4791C31.5559 25.4629 31.8264 24.2981 31.9039 22.5954C31.9814 20.8926 32.0005 20.3439 32.0005 15.9983C32.0005 11.6528 31.982 11.1079 31.9039 9.40133C31.8258 7.69475 31.5559 6.53629 31.1602 5.52009C30.7585 4.45256 30.1289 3.48546 29.3152 2.68618C28.5155 1.87188 27.548 1.24161 26.48 0.839243C25.4638 0.444196 24.299 0.173634 22.5962 0.0961494C20.8935 0.0186645 20.346 -0.0003892 16.0005 -0.0003892L16.003 -0.00292969Z",
|
|
17
|
+
fill: "#E02D69"
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
/* @__PURE__ */ C(
|
|
21
|
+
"path",
|
|
22
|
+
{
|
|
23
|
+
d: "M16.0006 7.78418C14.3757 7.78418 12.7872 8.26604 11.4361 9.16882C10.085 10.0716 9.03192 11.3548 8.41007 12.856C7.78823 14.3573 7.62552 16.0092 7.94254 17.603C8.25955 19.1967 9.04205 20.6607 10.1911 21.8097C11.3401 22.9587 12.804 23.7412 14.3978 24.0582C15.9915 24.3752 17.6435 24.2125 19.1447 23.5907C20.646 22.9688 21.9291 21.9158 22.8319 20.5647C23.7347 19.2135 24.2166 17.6251 24.2166 16.0001C24.2166 14.9212 24.0042 13.8528 23.5913 12.8559C23.1785 11.8591 22.5733 10.9533 21.8103 10.1904C21.0474 9.42745 20.1417 8.82227 19.1448 8.40941C18.148 7.99655 17.0796 7.7841 16.0006 7.78418ZM16.0006 21.3351C14.9454 21.3351 13.914 21.0223 13.0366 20.436C12.1593 19.8498 11.4755 19.0166 11.0717 18.0417C10.6679 17.0669 10.5622 15.9942 10.7681 14.9593C10.974 13.9244 11.4821 12.9738 12.2282 12.2277C12.9743 11.4816 13.9249 10.9735 14.9598 10.7676C15.9947 10.5618 17.0674 10.6674 18.0422 11.0712C19.0171 11.475 19.8503 12.1588 20.4365 13.0361C21.0227 13.9135 21.3356 14.945 21.3356 16.0001C21.3356 17.4151 20.7736 18.772 19.773 19.7726C18.7725 20.7731 17.4156 21.3351 16.0006 21.3351Z",
|
|
24
|
+
fill: "#E02D69"
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ C(
|
|
28
|
+
"path",
|
|
29
|
+
{
|
|
30
|
+
d: "M24.5416 9.37901C25.6019 9.37901 26.4615 8.51941 26.4615 7.45904C26.4615 6.39866 25.6019 5.53906 24.5416 5.53906C23.4812 5.53906 22.6216 6.39866 22.6216 7.45904C22.6216 8.51941 23.4812 9.37901 24.5416 9.37901Z",
|
|
31
|
+
fill: "#E02D69"
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ C("clipPath", { id: "clip0_46032_17319", children: /* @__PURE__ */ C(
|
|
36
|
+
"rect",
|
|
37
|
+
{
|
|
38
|
+
width: "32",
|
|
39
|
+
height: "32",
|
|
40
|
+
fill: "white",
|
|
41
|
+
transform: "translate(0.000488281)"
|
|
42
|
+
}
|
|
43
|
+
) }) })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
export {
|
|
48
|
+
l as InstagramIcon
|
|
49
|
+
};
|
package/dist/main.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { CartClubAlert as
|
|
1
|
+
import { CartClubAlert as t } from "./packages/CartClubAlert/CartClubAlert.js";
|
|
2
|
+
import { Onboarding as a } from "./packages/Onboarding/Onboarding.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
t as CartClubAlert,
|
|
5
|
+
a as Onboarding
|
|
4
6
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SocialMediaLinks } from './components/SocialMedia';
|
|
2
|
+
|
|
3
|
+
interface OnboardingProps {
|
|
4
|
+
socialMediaLinks?: SocialMediaLinks;
|
|
5
|
+
handleCloseAction: () => void;
|
|
6
|
+
handleFinishAction?: () => void;
|
|
7
|
+
genericTaggingEvent?: (name: string, params: object) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Onboarding: ({ socialMediaLinks, handleCloseAction, handleFinishAction, genericTaggingEvent }: OnboardingProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as i, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d } from "react";
|
|
3
|
+
import { Header as x } from "./components/Header.js";
|
|
4
|
+
import { Content as S } from "./components/Content.js";
|
|
5
|
+
import { Footer as c } from "./components/Footer.js";
|
|
6
|
+
import { TIPS_LENGTH as h } from "./constants/tips.js";
|
|
7
|
+
/* empty css */const w = ({
|
|
8
|
+
socialMediaLinks: a,
|
|
9
|
+
handleCloseAction: r,
|
|
10
|
+
handleFinishAction: n,
|
|
11
|
+
genericTaggingEvent: s
|
|
12
|
+
}) => {
|
|
13
|
+
const [t, m] = d(1), e = (o) => {
|
|
14
|
+
s == null || s("ofertas_pelo_whatsapp", {
|
|
15
|
+
clickText: o,
|
|
16
|
+
name: t
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ i("div", { className: "onboarding-container", children: [
|
|
20
|
+
/* @__PURE__ */ p(x, { sendEvent: e, handleCloseAction: r }),
|
|
21
|
+
/* @__PURE__ */ p(
|
|
22
|
+
S,
|
|
23
|
+
{
|
|
24
|
+
step: t,
|
|
25
|
+
sendEvent: e,
|
|
26
|
+
socialMediaLinks: a
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ p(
|
|
30
|
+
c,
|
|
31
|
+
{
|
|
32
|
+
step: t,
|
|
33
|
+
handleBackStep: (o) => {
|
|
34
|
+
e(o.target.innerText), t > 1 ? m(t - 1) : r();
|
|
35
|
+
},
|
|
36
|
+
handleNextStep: (o) => {
|
|
37
|
+
e(o.target.innerText);
|
|
38
|
+
const f = n ?? r;
|
|
39
|
+
t < h ? m(t + 1) : f();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
w as Onboarding
|
|
47
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { TIPS_LENGTH as l } from "../constants/tips.js";
|
|
3
|
+
const o = ({ step: i }) => /* @__PURE__ */ r("div", { className: "bullets-container", children: [
|
|
4
|
+
/* @__PURE__ */ t(e, { isActive: i === 1 }),
|
|
5
|
+
/* @__PURE__ */ t(e, { isActive: i > 1 && i < l }),
|
|
6
|
+
/* @__PURE__ */ t(e, { isActive: i === l })
|
|
7
|
+
] }), e = ({ isActive: i }) => /* @__PURE__ */ t("div", { className: `bullet ${i ? "active" : ""}` });
|
|
8
|
+
export {
|
|
9
|
+
o as Bullets
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SocialMediaLinks } from './SocialMedia';
|
|
2
|
+
|
|
3
|
+
interface ContentProps {
|
|
4
|
+
step: number;
|
|
5
|
+
socialMediaLinks?: SocialMediaLinks;
|
|
6
|
+
sendEvent: (clickText: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const Content: ({ step, socialMediaLinks, sendEvent }: ContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { SocialMedia as o } from "./SocialMedia.js";
|
|
3
|
+
import { TIPS as c, TIPS_LENGTH as r } from "../constants/tips.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
step: i,
|
|
6
|
+
socialMediaLinks: t,
|
|
7
|
+
sendEvent: a
|
|
8
|
+
}) => {
|
|
9
|
+
const s = c[i - 1];
|
|
10
|
+
return s ? /* @__PURE__ */ n("div", { className: "onboarding-content-container", children: [
|
|
11
|
+
/* @__PURE__ */ e("div", { className: "svg-container", children: s.svg() }),
|
|
12
|
+
s.isIllustration && /* @__PURE__ */ e("p", { className: "illustration-message", children: "Imagem Ilustrativa" }),
|
|
13
|
+
/* @__PURE__ */ n("p", { className: "steps-count", children: [
|
|
14
|
+
i,
|
|
15
|
+
" de ",
|
|
16
|
+
r
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ e("p", { className: "tip-message", children: s.tip }),
|
|
19
|
+
i === r && /* @__PURE__ */ e(
|
|
20
|
+
o,
|
|
21
|
+
{
|
|
22
|
+
socialMediaLinks: t,
|
|
23
|
+
sendEvent: a
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] }) : null;
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
p as Content
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
interface FooterProps {
|
|
4
|
+
step: number;
|
|
5
|
+
handleBackStep: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
handleNextStep: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const Footer: ({ step, handleBackStep, handleNextStep }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Bullets as i } from "./Bullets.js";
|
|
3
|
+
import { TIPS_LENGTH as l } from "../constants/tips.js";
|
|
4
|
+
const a = ({
|
|
5
|
+
step: t,
|
|
6
|
+
handleBackStep: r,
|
|
7
|
+
handleNextStep: n
|
|
8
|
+
}) => /* @__PURE__ */ e("footer", { children: [
|
|
9
|
+
/* @__PURE__ */ o("button", { onClick: r, className: "back-button", children: "Voltar" }),
|
|
10
|
+
/* @__PURE__ */ o(i, { step: t }),
|
|
11
|
+
/* @__PURE__ */ o("button", { onClick: n, className: "confirm-button", children: t === l ? "Legal, Entendi" : "Próximo" })
|
|
12
|
+
] });
|
|
13
|
+
export {
|
|
14
|
+
a as Footer
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { CloseIcon as l } from "../../../assets/svgs/CloseIcon.js";
|
|
3
|
+
const i = ({ sendEvent: e, handleCloseAction: n }) => /* @__PURE__ */ r("header", { children: [
|
|
4
|
+
/* @__PURE__ */ o("h2", { children: "Experiência Personalizada" }),
|
|
5
|
+
/* @__PURE__ */ o("button", { onClick: () => {
|
|
6
|
+
e("Fechou o modal no X"), n();
|
|
7
|
+
}, children: /* @__PURE__ */ o(l, {}) })
|
|
8
|
+
] });
|
|
9
|
+
export {
|
|
10
|
+
i as Header
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface SocialMediaProps {
|
|
2
|
+
socialMediaLinks?: SocialMediaLinks;
|
|
3
|
+
sendEvent: (clickText: string) => void;
|
|
4
|
+
}
|
|
5
|
+
export interface SocialMediaLinks {
|
|
6
|
+
facebook?: string;
|
|
7
|
+
instagram?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SocialMedia: ({ socialMediaLinks, sendEvent }: SocialMediaProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { FacebookIcon as t } from "../../../assets/svgs/FacebookIcon.js";
|
|
3
|
+
import { InstagramIcon as i } from "../../../assets/svgs/InstagramIcon.js";
|
|
4
|
+
const s = ({
|
|
5
|
+
socialMediaLinks: o,
|
|
6
|
+
sendEvent: e
|
|
7
|
+
}) => {
|
|
8
|
+
if (!o)
|
|
9
|
+
return null;
|
|
10
|
+
const { facebook: n, instagram: a } = o;
|
|
11
|
+
return /* @__PURE__ */ c("div", { className: "social-media-container", children: [
|
|
12
|
+
n && /* @__PURE__ */ r(
|
|
13
|
+
"a",
|
|
14
|
+
{
|
|
15
|
+
href: n,
|
|
16
|
+
target: "_blank",
|
|
17
|
+
rel: "noopener noreferrer",
|
|
18
|
+
onClick: () => e("facebook"),
|
|
19
|
+
children: /* @__PURE__ */ r(t, {})
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
a && /* @__PURE__ */ r(
|
|
23
|
+
"a",
|
|
24
|
+
{
|
|
25
|
+
href: a,
|
|
26
|
+
target: "_blank",
|
|
27
|
+
rel: "noopener noreferrer",
|
|
28
|
+
onClick: () => e("instagram"),
|
|
29
|
+
children: /* @__PURE__ */ r(i, {})
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
s as SocialMedia
|
|
36
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FixedLengthArray } from '../../../types/FixedLengthArray';
|
|
2
|
+
|
|
3
|
+
type Tips = FixedLengthArray<Tip, typeof TIPS_LENGTH>;
|
|
4
|
+
interface Tip {
|
|
5
|
+
svg: () => React.ReactNode;
|
|
6
|
+
isIllustration: boolean;
|
|
7
|
+
tip: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TIPS_LENGTH = 5;
|
|
10
|
+
export declare const TIPS: Tips;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Tip1 as o } from "../tips/Tip1.js";
|
|
2
|
+
import { Tip2 as e } from "../tips/Tip2.js";
|
|
3
|
+
import { Tip3 as i } from "../tips/Tip3.js";
|
|
4
|
+
import { Tip4 as a } from "../tips/Tip4.js";
|
|
5
|
+
import { Tip5 as s } from "../tips/Tip5.js";
|
|
6
|
+
const p = 5, u = [
|
|
7
|
+
{
|
|
8
|
+
svg: o,
|
|
9
|
+
isIllustration: !1,
|
|
10
|
+
tip: "O site e aplicativo vai ficando com a sua cara conforme você vai comprando, assim você tem uma experiência de acordo com seu padrão de compra"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
svg: e,
|
|
14
|
+
isIllustration: !0,
|
|
15
|
+
tip: "Veja produtos que você comprou anteriormente e adicione eles ao seu carrinho, fazendo suas compras com mais rapidez"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
svg: i,
|
|
19
|
+
isIllustration: !0,
|
|
20
|
+
tip: "Você também consegue consegue repetir um pedido adicionando ele inteiro ao seu carrinho, onde você pode aumentar ou diminuir a quantidade dos produtos"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
svg: a,
|
|
24
|
+
isIllustration: !0,
|
|
25
|
+
tip: "Você terá acesso aos corredores que você mais compra logo na tela inicial, assim você consegue conferir melhor a variedade dos produtos que você mais leva"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
svg: s,
|
|
29
|
+
isIllustration: !1,
|
|
30
|
+
tip: "Siga nossas redes sociais! Estamos sempre melhorando sua experiencia em nossas Lojas, Site e Aplicativo!"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
export {
|
|
34
|
+
u as TIPS,
|
|
35
|
+
p as TIPS_LENGTH
|
|
36
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { render as s } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { Bullets as o } from "../components/Bullets.js";
|
|
5
|
+
jest.mock("../constants/tips", () => ({ TIPS_LENGTH: 3 }));
|
|
6
|
+
describe("Bullets component tests", () => {
|
|
7
|
+
it("renders correctly amount of bullets", () => {
|
|
8
|
+
const { container: t } = s(/* @__PURE__ */ l(o, { step: 1 })), e = t.querySelectorAll(".bullet");
|
|
9
|
+
expect(e.length).toBe(3);
|
|
10
|
+
}), it("should first bullet active if step is 1", () => {
|
|
11
|
+
const { container: t } = s(/* @__PURE__ */ l(o, { step: 1 })), e = t.querySelector(".bullet");
|
|
12
|
+
expect(e).toHaveClass("active");
|
|
13
|
+
}), it("should middle bullet active if step is greater than 1 and less than TIPS_LENGTH", () => {
|
|
14
|
+
const { container: t } = s(/* @__PURE__ */ l(o, { step: 2 })), e = t.querySelector(".bullet:nth-child(2)");
|
|
15
|
+
expect(e).toHaveClass("active");
|
|
16
|
+
}), it("should last bullet active if step is equal than TIPS_LENGTH", () => {
|
|
17
|
+
const { container: t } = s(/* @__PURE__ */ l(o, { step: 3 })), e = t.querySelector(".bullet:last-child");
|
|
18
|
+
expect(e).toHaveClass("active");
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { render as s } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { Content as o } from "../components/Content.js";
|
|
5
|
+
jest.mock("../components/SocialMedia", () => ({
|
|
6
|
+
SocialMedia: () => /* @__PURE__ */ e("div", { "data-testid": "social media" })
|
|
7
|
+
}));
|
|
8
|
+
jest.mock("../constants/tips", () => ({
|
|
9
|
+
TIPS_LENGTH: 2,
|
|
10
|
+
TIPS: [
|
|
11
|
+
{
|
|
12
|
+
tip: "tip 1",
|
|
13
|
+
svg: () => /* @__PURE__ */ e("div", { "data-testid": "svg 1" }),
|
|
14
|
+
isIllustration: !1
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
tip: "tip 2",
|
|
18
|
+
svg: () => /* @__PURE__ */ e("div", { "data-testid": "svg 2" }),
|
|
19
|
+
isIllustration: !0
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}));
|
|
23
|
+
const n = jest.fn();
|
|
24
|
+
describe("Content component tests", () => {
|
|
25
|
+
it("should render nothing if step is invalid", () => {
|
|
26
|
+
const { container: t } = s(/* @__PURE__ */ e(o, { step: 0, sendEvent: n }));
|
|
27
|
+
expect(t.firstChild).toBeNull();
|
|
28
|
+
}), it("should render correctly texts", () => {
|
|
29
|
+
const { getByTestId: t, getByText: i } = s(
|
|
30
|
+
/* @__PURE__ */ e(o, { step: 1, sendEvent: n })
|
|
31
|
+
);
|
|
32
|
+
expect(t("svg 1")).toBeInTheDocument(), expect(i("1 de 2")).toBeInTheDocument(), expect(i("tip 1")).toBeInTheDocument();
|
|
33
|
+
}), it("should render correctly illustration message", () => {
|
|
34
|
+
const { getByText: t } = s(/* @__PURE__ */ e(o, { step: 2, sendEvent: n }));
|
|
35
|
+
expect(t("Imagem Ilustrativa")).toBeInTheDocument();
|
|
36
|
+
}), it("should render correctly social media section", () => {
|
|
37
|
+
const { getByTestId: t } = s(
|
|
38
|
+
/* @__PURE__ */ e(
|
|
39
|
+
o,
|
|
40
|
+
{
|
|
41
|
+
step: 2,
|
|
42
|
+
socialMediaLinks: {
|
|
43
|
+
facebook: "facebook_link",
|
|
44
|
+
instagram: "instagram_link"
|
|
45
|
+
},
|
|
46
|
+
sendEvent: n
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
expect(t("social media")).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { render as c, fireEvent as a } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { Footer as l } from "../components/Footer.js";
|
|
5
|
+
jest.mock("../constants/tips", () => ({ TIPS_LENGTH: 3 }));
|
|
6
|
+
jest.mock("../components/Bullets", () => ({
|
|
7
|
+
Bullets: () => /* @__PURE__ */ n("div", { "data-testid": "bullets" })
|
|
8
|
+
}));
|
|
9
|
+
const t = jest.fn(), o = jest.fn();
|
|
10
|
+
describe("Footer component tests", () => {
|
|
11
|
+
it("renders default UI", () => {
|
|
12
|
+
const { getByText: e } = c(
|
|
13
|
+
/* @__PURE__ */ n(
|
|
14
|
+
l,
|
|
15
|
+
{
|
|
16
|
+
step: 1,
|
|
17
|
+
handleBackStep: t,
|
|
18
|
+
handleNextStep: o
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
expect(e("Voltar")).toBeInTheDocument(), expect(e("Próximo")).toBeInTheDocument();
|
|
23
|
+
}), it("renders correctly button text if step is equal than TIPS_LENGTH", () => {
|
|
24
|
+
const { queryByText: e, getByText: s } = c(
|
|
25
|
+
/* @__PURE__ */ n(
|
|
26
|
+
l,
|
|
27
|
+
{
|
|
28
|
+
step: 3,
|
|
29
|
+
handleBackStep: t,
|
|
30
|
+
handleNextStep: o
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
expect(e("Próximo")).not.toBeInTheDocument(), expect(s("Legal, Entendi")).toBeInTheDocument();
|
|
35
|
+
}), it("should call handleBackStep on click back button", () => {
|
|
36
|
+
const { getByText: e } = c(
|
|
37
|
+
/* @__PURE__ */ n(
|
|
38
|
+
l,
|
|
39
|
+
{
|
|
40
|
+
step: 1,
|
|
41
|
+
handleBackStep: t,
|
|
42
|
+
handleNextStep: o
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
a.click(e("Voltar")), expect(t).toHaveBeenCalled();
|
|
47
|
+
}), it("should call handleNextStep on click confirm button", () => {
|
|
48
|
+
const { getByText: e } = c(
|
|
49
|
+
/* @__PURE__ */ n(
|
|
50
|
+
l,
|
|
51
|
+
{
|
|
52
|
+
step: 1,
|
|
53
|
+
handleBackStep: t,
|
|
54
|
+
handleNextStep: o
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
a.click(e("Próximo")), expect(o).toHaveBeenCalled();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { render as c, fireEvent as d } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { Header as s } from "../components/Header.js";
|
|
5
|
+
const t = jest.fn(), n = jest.fn();
|
|
6
|
+
describe("Header component tests", () => {
|
|
7
|
+
it("renders correctly UI", () => {
|
|
8
|
+
const { getByText: e, getByTestId: l } = c(
|
|
9
|
+
/* @__PURE__ */ o(
|
|
10
|
+
s,
|
|
11
|
+
{
|
|
12
|
+
sendEvent: t,
|
|
13
|
+
handleCloseAction: n
|
|
14
|
+
}
|
|
15
|
+
)
|
|
16
|
+
);
|
|
17
|
+
expect(e("Experiência Personalizada")).toBeInTheDocument(), expect(l("close-icon")).toBeInTheDocument();
|
|
18
|
+
}), it("should call sendEvent and handleCloseAction on click close button", () => {
|
|
19
|
+
const { getByTestId: e } = c(
|
|
20
|
+
/* @__PURE__ */ o(
|
|
21
|
+
s,
|
|
22
|
+
{
|
|
23
|
+
sendEvent: t,
|
|
24
|
+
handleCloseAction: n
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
d.click(e("close-icon")), expect(t).toHaveBeenCalled(), expect(n).toHaveBeenCalled();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { render as o } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { Onboarding as n } from "../Onboarding.js";
|
|
5
|
+
jest.mock("../components/Header", () => ({
|
|
6
|
+
Header: () => /* @__PURE__ */ e("div", { "data-testid": "header" })
|
|
7
|
+
}));
|
|
8
|
+
jest.mock("../components/Content", () => ({
|
|
9
|
+
Content: () => /* @__PURE__ */ e("div", { "data-testid": "content" })
|
|
10
|
+
}));
|
|
11
|
+
jest.mock("../components/Footer", () => ({
|
|
12
|
+
Footer: () => /* @__PURE__ */ e("div", { "data-testid": "footer" })
|
|
13
|
+
}));
|
|
14
|
+
const c = jest.fn();
|
|
15
|
+
describe("Onboarding package tests", () => {
|
|
16
|
+
it("should render sections correctly", () => {
|
|
17
|
+
const { getByTestId: t } = o(
|
|
18
|
+
/* @__PURE__ */ e(n, { handleCloseAction: c })
|
|
19
|
+
);
|
|
20
|
+
expect(t("header")).toBeInTheDocument(), expect(t("content")).toBeInTheDocument(), expect(t("footer")).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { render as n, fireEvent as c } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom";
|
|
4
|
+
import { SocialMedia as t } from "../components/SocialMedia.js";
|
|
5
|
+
const o = jest.fn();
|
|
6
|
+
describe("SocialMedia component tests", () => {
|
|
7
|
+
it("should render nothing if socialMediaLinks does not exist", () => {
|
|
8
|
+
const { container: e } = n(/* @__PURE__ */ i(t, { sendEvent: o }));
|
|
9
|
+
expect(e.firstChild).toBeNull();
|
|
10
|
+
}), it("should render media section if link exist", () => {
|
|
11
|
+
const { getByTestId: e } = n(
|
|
12
|
+
/* @__PURE__ */ i(
|
|
13
|
+
t,
|
|
14
|
+
{
|
|
15
|
+
socialMediaLinks: {
|
|
16
|
+
facebook: "facebook_link",
|
|
17
|
+
instagram: "instagram_link"
|
|
18
|
+
},
|
|
19
|
+
sendEvent: o
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
expect(e("facebook-icon")).toBeInTheDocument(), expect(e("instagram-icon")).toBeInTheDocument();
|
|
24
|
+
}), it("should call sendEvent on click social media link", () => {
|
|
25
|
+
const { getByTestId: e } = n(
|
|
26
|
+
/* @__PURE__ */ i(
|
|
27
|
+
t,
|
|
28
|
+
{
|
|
29
|
+
socialMediaLinks: {
|
|
30
|
+
facebook: "facebook_link",
|
|
31
|
+
instagram: "instagram_link"
|
|
32
|
+
},
|
|
33
|
+
sendEvent: o
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
c.click(e("facebook-icon")), expect(o).toHaveBeenCalledWith("facebook");
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Tip1: () => import("react/jsx-runtime").JSX.Element;
|