kupos-ui-components-lib 9.10.1 → 9.10.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/KuposUIComponent.d.ts +14 -1
- package/dist/KuposUIComponent.js +3 -0
- package/dist/components/Survey/SurveyMobile.js +17 -16
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -1
- package/dist/styles.css +32 -0
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +22 -1
- package/src/assets/images/anims/service_list/succes_anim.json +1 -0
- package/src/components/Survey/ResponsiveSurvey.tsx +14 -0
- package/src/components/Survey/SurveyDesktop.tsx +121 -0
- package/src/components/Survey/SurveyMobile.tsx +125 -0
- package/src/components/Survey/index.ts +5 -0
- package/src/components/Survey/types.ts +22 -0
- package/src/index.ts +23 -0
- package/src/ui/BottomSheet/BottomSheet.tsx +131 -0
- package/src/ui/BottomSheet/index.ts +2 -0
- package/src/ui/Modal/Modal.tsx +92 -0
- package/src/ui/Modal/ModalHeader.tsx +58 -0
- package/src/ui/Modal/index.ts +4 -0
- package/src/ui/Survey/FeedbackBanner.tsx +36 -0
- package/src/ui/Survey/FeedbackTextarea.tsx +84 -0
- package/src/ui/Survey/HeartIcon.tsx +18 -0
- package/src/ui/Survey/ScoreButtons.tsx +91 -0
- package/src/ui/Survey/SurveyFooter.tsx +145 -0
- package/src/ui/Survey/SurveyHeader.tsx +72 -0
- package/src/ui/Survey/ThankYouCard.tsx +100 -0
- package/src/ui/Survey/constants.ts +59 -0
- package/src/ui/Survey/index.ts +9 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BRAND } from "./constants";
|
|
3
|
+
|
|
4
|
+
interface SurveyHeaderProps {
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const SurveyHeader = ({ onClose }: SurveyHeaderProps) => (
|
|
9
|
+
<div
|
|
10
|
+
style={{
|
|
11
|
+
display: "flex",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
justifyContent: "space-between",
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
<div style={{ display: "flex", alignItems: "center", gap: 6 }}>
|
|
17
|
+
<span
|
|
18
|
+
style={{
|
|
19
|
+
width: 8,
|
|
20
|
+
height: 8,
|
|
21
|
+
borderRadius: "50%",
|
|
22
|
+
backgroundColor: BRAND,
|
|
23
|
+
display: "inline-block",
|
|
24
|
+
flexShrink: 0,
|
|
25
|
+
}}
|
|
26
|
+
/>
|
|
27
|
+
<span
|
|
28
|
+
style={{
|
|
29
|
+
color: BRAND,
|
|
30
|
+
fontSize: 11,
|
|
31
|
+
fontWeight: 700,
|
|
32
|
+
letterSpacing: "0.1em",
|
|
33
|
+
textTransform: "uppercase",
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
Comentarios rápidos
|
|
37
|
+
</span>
|
|
38
|
+
<span
|
|
39
|
+
style={{
|
|
40
|
+
color: "#9CA3AF",
|
|
41
|
+
fontSize: 11,
|
|
42
|
+
letterSpacing: "0.06em",
|
|
43
|
+
textTransform: "uppercase",
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
· Tarda 20 segundos
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<button
|
|
51
|
+
onClick={onClose}
|
|
52
|
+
style={{
|
|
53
|
+
width: 36,
|
|
54
|
+
height: 36,
|
|
55
|
+
borderRadius: "50%",
|
|
56
|
+
background: "#F3F4F6",
|
|
57
|
+
border: "none",
|
|
58
|
+
cursor: "pointer",
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
color: "#6B7280",
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
flexShrink: 0,
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
✕
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export default SurveyHeader;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import HeartIcon from "./HeartIcon";
|
|
3
|
+
import { BRAND } from "./constants";
|
|
4
|
+
|
|
5
|
+
import succes_anim from "../../assets/images/anims/service_list/succes_anim.json";
|
|
6
|
+
import LottiePlayer from "../../assets/LottiePlayer";
|
|
7
|
+
|
|
8
|
+
interface ThankYouCardProps {
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
titleFontSize?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ThankYouCard = ({
|
|
14
|
+
onClose,
|
|
15
|
+
titleFontSize = "1.5rem",
|
|
16
|
+
}: ThankYouCardProps) => (
|
|
17
|
+
<div
|
|
18
|
+
style={{
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
padding: "48px 40px 40px",
|
|
24
|
+
position: "relative",
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<button
|
|
28
|
+
onClick={onClose}
|
|
29
|
+
style={{
|
|
30
|
+
position: "absolute",
|
|
31
|
+
top: 16,
|
|
32
|
+
right: 16,
|
|
33
|
+
width: 34,
|
|
34
|
+
height: 34,
|
|
35
|
+
borderRadius: "50%",
|
|
36
|
+
border: "none",
|
|
37
|
+
background: "#F3F4F6",
|
|
38
|
+
color: "#6B7280",
|
|
39
|
+
fontSize: 14,
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
display: "flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
✕
|
|
47
|
+
</button>
|
|
48
|
+
|
|
49
|
+
<div
|
|
50
|
+
style={{
|
|
51
|
+
width: 64,
|
|
52
|
+
height: 64,
|
|
53
|
+
borderRadius: "50%",
|
|
54
|
+
backgroundColor: "#DCFCE7",
|
|
55
|
+
display: "flex",
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
justifyContent: "center",
|
|
58
|
+
marginBottom: 20,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<LottiePlayer
|
|
62
|
+
animationData={succes_anim}
|
|
63
|
+
loop={true}
|
|
64
|
+
autoplay={true}
|
|
65
|
+
width="70px"
|
|
66
|
+
height="70px"
|
|
67
|
+
/>
|
|
68
|
+
{/* <HeartIcon /> */}
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<h2
|
|
72
|
+
style={{
|
|
73
|
+
fontSize: titleFontSize,
|
|
74
|
+
fontWeight: 700,
|
|
75
|
+
color: "#111827",
|
|
76
|
+
textAlign: "center",
|
|
77
|
+
marginBottom: 10,
|
|
78
|
+
lineHeight: 1.3,
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
Gracias por tu{" "}
|
|
82
|
+
<em
|
|
83
|
+
style={{
|
|
84
|
+
color: BRAND,
|
|
85
|
+
fontFamily: "Georgia, 'Times New Roman', serif",
|
|
86
|
+
fontStyle: "italic",
|
|
87
|
+
fontWeight: "bold",
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
comentario
|
|
91
|
+
</em>
|
|
92
|
+
</h2>
|
|
93
|
+
|
|
94
|
+
<p style={{ fontSize: "13.33px", color: "#6B7280", textAlign: "center" }}>
|
|
95
|
+
Hemos leído todas las respuestas. ¡Que tengas un buen viaje!
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export default ThankYouCard;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export const BRAND = "#E84C0D";
|
|
2
|
+
export const MAX_CHARS = 250;
|
|
3
|
+
|
|
4
|
+
export type FeedbackConfig = {
|
|
5
|
+
emoji: string;
|
|
6
|
+
message: string;
|
|
7
|
+
bannerBg: string;
|
|
8
|
+
bannerText: string;
|
|
9
|
+
question: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const getZoneColor = (num: number): string => {
|
|
14
|
+
if (num <= 6) return "#E84C0D";
|
|
15
|
+
if (num <= 8) return "#F59E0B";
|
|
16
|
+
return "#22C55E";
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const getZoneShadow = (num: number): string => {
|
|
20
|
+
if (num <= 6) return "0 2px 8px rgba(232,76,13,0.35)";
|
|
21
|
+
if (num <= 8) return "0 2px 8px rgba(245,158,11,0.35)";
|
|
22
|
+
return "0 2px 8px rgba(34,197,94,0.35)";
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const getFeedbackConfig = (
|
|
26
|
+
score: number | null | undefined,
|
|
27
|
+
): FeedbackConfig | null => {
|
|
28
|
+
if (score == null) return null;
|
|
29
|
+
if (score <= 6)
|
|
30
|
+
return {
|
|
31
|
+
emoji: "😔",
|
|
32
|
+
message: "Lo sentimos, no cumplimos tus expectativas.",
|
|
33
|
+
bannerBg: "#FFF0EE",
|
|
34
|
+
bannerText: BRAND,
|
|
35
|
+
question: "¿Qué salió mal?",
|
|
36
|
+
placeholder:
|
|
37
|
+
"Cuéntanos qué podríamos haber hecho mejor — cada detalle nos ayuda.",
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
if (score <= 8)
|
|
41
|
+
return {
|
|
42
|
+
emoji: "🤔",
|
|
43
|
+
message: "Gracias — apreciamos tu sinceridad.",
|
|
44
|
+
bannerBg: "#FFFBEB",
|
|
45
|
+
bannerText: "#92400E",
|
|
46
|
+
question: "¿Qué podría mejorar?",
|
|
47
|
+
placeholder:
|
|
48
|
+
"Cuéntanos qué podría hacer que la experiencia sea aún mejor.",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
emoji: "🎉",
|
|
53
|
+
message: "¡Nos acabas de alegrar el día!",
|
|
54
|
+
bannerBg: "#F0FDF4",
|
|
55
|
+
bannerText: "#166534",
|
|
56
|
+
question: "¿Qué hicimos bien?",
|
|
57
|
+
placeholder: "¡Nos encantaría saber qué fue lo que más te gustó!",
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as HeartIcon } from "./HeartIcon";
|
|
2
|
+
export { default as ThankYouCard } from "./ThankYouCard";
|
|
3
|
+
export { default as SurveyHeader } from "./SurveyHeader";
|
|
4
|
+
export { default as ScoreButtons } from "./ScoreButtons";
|
|
5
|
+
export { default as FeedbackBanner } from "./FeedbackBanner";
|
|
6
|
+
export { default as FeedbackTextarea } from "./FeedbackTextarea";
|
|
7
|
+
export { default as SurveyFooter } from "./SurveyFooter";
|
|
8
|
+
export { BRAND, MAX_CHARS, getZoneColor, getZoneShadow, getFeedbackConfig } from "./constants";
|
|
9
|
+
export type { FeedbackConfig } from "./constants";
|