kupos-ui-components-lib 9.10.1 → 9.10.3

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.
@@ -0,0 +1,145 @@
1
+ import React from "react";
2
+ import { BRAND } from "./constants";
3
+
4
+ interface SurveyFooterProps {
5
+ selectedScore?: number | null;
6
+ onSkip?: () => void;
7
+ onSubmit: () => void;
8
+ layout?: "inline" | "stacked";
9
+ colors?: {
10
+ secondaryColor?: string;
11
+ tertiaryColor?: string;
12
+ primaryColor?: string;
13
+ };
14
+ }
15
+
16
+ const SurveyFooter = ({
17
+ selectedScore,
18
+ onSkip,
19
+ onSubmit,
20
+ layout = "inline",
21
+ colors,
22
+ }: SurveyFooterProps) => {
23
+ if (layout === "stacked") {
24
+ return (
25
+ <div style={{ marginTop: 24 }}>
26
+ <button
27
+ onClick={onSkip}
28
+ style={{
29
+ display: "block",
30
+ width: "100%",
31
+ textAlign: "center",
32
+ fontSize: "13.33px",
33
+ color: "#6B7280",
34
+ background: "none",
35
+ border: "none",
36
+ cursor: "pointer",
37
+ padding: "0 0 14px",
38
+ }}
39
+ >
40
+ Saltar por ahora
41
+ </button>
42
+
43
+ <button
44
+ onClick={onSubmit}
45
+ disabled={selectedScore == null}
46
+ style={{
47
+ display: "flex",
48
+ alignItems: "center",
49
+ justifyContent: "center",
50
+ gap: 8,
51
+ width: "100%",
52
+ padding: "16px",
53
+ borderRadius: 999,
54
+ fontSize: "13.33px",
55
+ fontWeight: 700,
56
+ letterSpacing: "0.08em",
57
+ textTransform: "uppercase" as const,
58
+ border: "none",
59
+ cursor: selectedScore != null ? "pointer" : "not-allowed",
60
+ background:
61
+ selectedScore != null
62
+ ? colors?.secondaryColor
63
+ : "rgba(232,76,13,0.28)",
64
+ color: "#FFFFFF",
65
+ transition: "background 0.15s",
66
+ }}
67
+ >
68
+ Enviar comentarios <span>→</span>
69
+ </button>
70
+ </div>
71
+ );
72
+ }
73
+
74
+ return (
75
+ <>
76
+ <div
77
+ style={{
78
+ display: "flex",
79
+ alignItems: "center",
80
+ justifyContent: "space-between",
81
+ marginTop: 24,
82
+ }}
83
+ >
84
+ <button
85
+ onClick={onSkip}
86
+ style={{
87
+ fontSize: "13.33px",
88
+ color: "#6B7280",
89
+ background: "none",
90
+ border: "none",
91
+ cursor: "pointer",
92
+ padding: 0,
93
+ }}
94
+ >
95
+ Saltar por ahora
96
+ </button>
97
+
98
+ <button
99
+ onClick={onSubmit}
100
+ disabled={selectedScore == null}
101
+ style={{
102
+ display: "flex",
103
+ alignItems: "center",
104
+ gap: 8,
105
+ padding: "14px 28px",
106
+ borderRadius: 999,
107
+ fontSize: "13.33px",
108
+ fontWeight: 700,
109
+ letterSpacing: "0.08em",
110
+ textTransform: "uppercase" as const,
111
+ border: "none",
112
+ cursor: selectedScore != null ? "pointer" : "not-allowed",
113
+ background:
114
+ selectedScore != null
115
+ ? colors?.secondaryColor
116
+ : "rgba(232,76,13,0.28)",
117
+ color: "#FFFFFF",
118
+ transition: "background 0.15s",
119
+ minWidth: 160,
120
+ justifyContent: "center",
121
+ }}
122
+ >
123
+ Enviar comentarios <span>→</span>
124
+ </button>
125
+ </div>
126
+
127
+ <div
128
+ style={{
129
+ display: "flex",
130
+ alignItems: "center",
131
+ justifyContent: "center",
132
+ gap: 6,
133
+ marginTop: 14,
134
+ fontSize: 12,
135
+ color: "#9CA3AF",
136
+ }}
137
+ >
138
+ <span>🔒</span>
139
+ <span>Anónimo · solo se usa para mejorar el servicio</span>
140
+ </div>
141
+ </>
142
+ );
143
+ };
144
+
145
+ export default SurveyFooter;
@@ -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";