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.
- 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/dist/ui/FeatureServiceUI/FeatureServiceUi.js +10 -9
- 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/FeatureServiceUI/FeatureServiceUi.tsx +10 -8
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface KuposUIComponentProps {
|
|
3
|
-
typeOfComponent: "serviceitem" | "paymentsidebar" | "servicelist" | "filterbar";
|
|
3
|
+
typeOfComponent: "serviceitem" | "paymentsidebar" | "servicelist" | "filterbar" | "survey" | "cuponerafilterbar";
|
|
4
4
|
variant?: "mobile" | "desktop";
|
|
5
5
|
serviceItem?: any;
|
|
6
6
|
onBookButtonPress?: () => void;
|
|
@@ -82,6 +82,19 @@ interface KuposUIComponentProps {
|
|
|
82
82
|
sortOrder?: "asc" | "desc";
|
|
83
83
|
};
|
|
84
84
|
onFilterChange?: (filters: any) => void;
|
|
85
|
+
isOpen?: boolean;
|
|
86
|
+
selectedScore?: number | null;
|
|
87
|
+
onScoreChange?: (score: number) => void;
|
|
88
|
+
feedback?: string;
|
|
89
|
+
onFeedbackChange?: (text: string) => void;
|
|
90
|
+
onClose?: () => void;
|
|
91
|
+
onSkip?: () => void;
|
|
92
|
+
onSubmit?: (score: number, feedback: string) => void;
|
|
93
|
+
isSubmitted?: boolean;
|
|
94
|
+
bookingId?: string;
|
|
95
|
+
origin?: string;
|
|
96
|
+
destination?: string;
|
|
97
|
+
operatorName?: string;
|
|
85
98
|
}
|
|
86
99
|
export default function KuposUIComponent(props: KuposUIComponentProps): React.ReactElement;
|
|
87
100
|
export {};
|
package/dist/KuposUIComponent.js
CHANGED
|
@@ -15,6 +15,7 @@ import { ResponsivePaymentSideBar } from "./components/PaymentSideBar";
|
|
|
15
15
|
import { ResponsiveServiceList } from "./components/ServiceList";
|
|
16
16
|
import { ResponsiveFilterBar } from "./components/FilterBar";
|
|
17
17
|
import ResponsiveCuponeraFilterBar from "./components/CuponeraFilterBar/ResponsiveCuponeraFilterBar";
|
|
18
|
+
import { ResponsiveSurvey } from "./components/Survey";
|
|
18
19
|
// Using imported ResponsivePaymentSideBar component instead
|
|
19
20
|
export default function KuposUIComponent(props) {
|
|
20
21
|
const { typeOfComponent } = props, restProps = __rest(props, ["typeOfComponent"]);
|
|
@@ -29,6 +30,8 @@ export default function KuposUIComponent(props) {
|
|
|
29
30
|
return (React.createElement(ResponsiveFilterBar, Object.assign({}, restProps)));
|
|
30
31
|
case "cuponerafilterbar":
|
|
31
32
|
return (React.createElement(ResponsiveCuponeraFilterBar, Object.assign({}, restProps)));
|
|
33
|
+
case "survey":
|
|
34
|
+
return React.createElement(ResponsiveSurvey, Object.assign({}, restProps));
|
|
32
35
|
default:
|
|
33
36
|
return (React.createElement("div", { className: "error-message" },
|
|
34
37
|
"Invalid component type: ",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BottomSheet } from "../../ui/BottomSheet";
|
|
3
|
-
import {
|
|
3
|
+
import { ScoreButtons, FeedbackTextarea, getFeedbackConfig, } from "../../ui/Survey";
|
|
4
4
|
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
5
5
|
const SurveyMobile = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback = "", onFeedbackChange, onClose, onSkip, onSubmit, colors, icons, isLoading, }) => {
|
|
6
6
|
if (!isOpen)
|
|
@@ -11,20 +11,21 @@ const SurveyMobile = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedb
|
|
|
11
11
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(selectedScore, feedback);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
|
-
return (React.createElement(BottomSheet, { isOpen: isOpen !== null && isOpen !== void 0 ? isOpen : false, onClose: onClose, showHandle: true, showBackdrop: false, blurBackground: true, blurAmount: "2px", padding: isSubmitted ? 0 : "0 20px 32px" },
|
|
15
|
-
React.createElement(
|
|
16
|
-
React.createElement("
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
React.createElement("div", { className: "
|
|
28
|
-
React.createElement(
|
|
14
|
+
return (React.createElement(BottomSheet, { isOpen: isOpen !== null && isOpen !== void 0 ? isOpen : false, onClose: onClose, showHandle: true, showBackdrop: false, blurBackground: true, blurAmount: "2px", padding: isSubmitted ? 0 : "0 20px 32px" },
|
|
15
|
+
React.createElement(React.Fragment, null,
|
|
16
|
+
React.createElement("button", { onClick: onClose, "aria-label": "Close survey", className: "absolute top-[15px] right-[25px] bg-transparent border-none cursor-pointer text-[22px] text-gray-400 flex items-center justify-center p-1 z-10 transition-colors duration-200 hover:text-gray-600" },
|
|
17
|
+
React.createElement("img", { src: icons.closeIcon, alt: "Close", className: "w-[16px] h-[16px] block" })),
|
|
18
|
+
(icons === null || icons === void 0 ? void 0 : icons.surveyIcon) && (React.createElement("div", { className: "flex justify-center mb-3 mt-2" },
|
|
19
|
+
React.createElement("img", { src: icons.surveyIcon, alt: "Survey Illustration", className: "w-[90px] h-[90px] block" }))),
|
|
20
|
+
React.createElement("h2", { className: "text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2" }, "Ay\u00FAdanos a mejorar"),
|
|
21
|
+
React.createElement("p", { className: "text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto" },
|
|
22
|
+
"Bas\u00E1ndote en tu experiencia de compra.",
|
|
23
|
+
React.createElement("br", null),
|
|
24
|
+
"\u00BFNos recomendar\u00EDas a un amigo?"),
|
|
25
|
+
React.createElement(ScoreButtons, { selectedScore: selectedScore, onScoreChange: onScoreChange, buttonHeight: 44, fontSize: 13, gap: 6, colors: colors }),
|
|
26
|
+
React.createElement(FeedbackTextarea, { config: config, feedback: feedback, onFeedbackChange: onFeedbackChange }),
|
|
27
|
+
React.createElement("div", { className: "flex justify-center mt-[20px]" },
|
|
28
|
+
React.createElement("div", { className: "w-[180px]" },
|
|
29
|
+
React.createElement(KuposButton, { isSoldOut: selectedScore == null, isLoading: isLoading || false, buttonColor: "#FF8E43", buyLabel: "Enviar", soldOutLabel: "Enviar", onClick: handleSubmit }))))));
|
|
29
30
|
};
|
|
30
31
|
export default SurveyMobile;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,13 @@ import KuposUIComponent from "./KuposUIComponent";
|
|
|
6
6
|
import { PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar } from "./components/PaymentSideBar";
|
|
7
7
|
import { ServiceListDesktop, ServiceListMobile, ResponsiveServiceList } from "./components/ServiceList";
|
|
8
8
|
import { FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar } from "./components/FilterBar";
|
|
9
|
-
|
|
9
|
+
import { SurveyDesktop, SurveyMobile, ResponsiveSurvey } from "./components/Survey";
|
|
10
|
+
import { Modal, ModalHeader } from "./ui/Modal";
|
|
11
|
+
export { ServiceItemDesktop, ServiceItemMobile, ResponsiveServiceItem, ServiceItemPBMobile, KuposUIComponent, PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar, ServiceListDesktop, ServiceListMobile, ResponsiveServiceList, FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar, SurveyDesktop, SurveyMobile, ResponsiveSurvey, Modal, ModalHeader, };
|
|
10
12
|
export type { ServiceItemProps } from "./types";
|
|
11
13
|
export type { MobileServiceItemProps } from "./components/ServiceItem/mobileTypes";
|
|
12
14
|
export type { PaymentSideBarProps } from "./components/PaymentSideBar/types";
|
|
13
15
|
export type { ServiceListProps } from "./components/ServiceList/types";
|
|
14
16
|
export type { FilterBarProps } from "./components/FilterBar/tyoes";
|
|
17
|
+
export type { SurveyProps } from "./components/Survey/types";
|
|
18
|
+
export type { ModalProps, ModalVariant, ModalSize, ModalHeaderProps } from "./ui/Modal";
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,18 @@ import { PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar,
|
|
|
9
9
|
import { ServiceListDesktop, ServiceListMobile, ResponsiveServiceList, } from "./components/ServiceList";
|
|
10
10
|
// Import FilterBar components
|
|
11
11
|
import { FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar, } from "./components/FilterBar";
|
|
12
|
+
// Import Survey components
|
|
13
|
+
import { SurveyDesktop, SurveyMobile, ResponsiveSurvey, } from "./components/Survey";
|
|
14
|
+
// Import Modal components
|
|
15
|
+
import { Modal, ModalHeader } from "./ui/Modal";
|
|
12
16
|
export { ServiceItemDesktop, ServiceItemMobile, ResponsiveServiceItem, ServiceItemPBMobile, KuposUIComponent,
|
|
13
17
|
// PaymentSideBar components
|
|
14
18
|
PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar,
|
|
15
19
|
// ServiceList components
|
|
16
20
|
ServiceListDesktop, ServiceListMobile, ResponsiveServiceList,
|
|
17
21
|
// FilterBar components
|
|
18
|
-
FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar,
|
|
22
|
+
FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar,
|
|
23
|
+
//Survey components
|
|
24
|
+
SurveyDesktop, SurveyMobile, ResponsiveSurvey,
|
|
25
|
+
// Modal components
|
|
26
|
+
Modal, ModalHeader, };
|
package/dist/styles.css
CHANGED
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
.top-\[5px\] {
|
|
46
46
|
top: 5px;
|
|
47
47
|
}
|
|
48
|
+
.top-\[15px\] {
|
|
49
|
+
top: 15px;
|
|
50
|
+
}
|
|
48
51
|
.top-\[16px\] {
|
|
49
52
|
top: 16px;
|
|
50
53
|
}
|
|
@@ -72,6 +75,9 @@
|
|
|
72
75
|
.right-\[18px\] {
|
|
73
76
|
right: 18px;
|
|
74
77
|
}
|
|
78
|
+
.right-\[25px\] {
|
|
79
|
+
right: 25px;
|
|
80
|
+
}
|
|
75
81
|
.-bottom-\[9\%\] {
|
|
76
82
|
bottom: calc(9% * -1);
|
|
77
83
|
}
|
|
@@ -384,6 +390,9 @@
|
|
|
384
390
|
.h-\[30px\] {
|
|
385
391
|
height: 30px;
|
|
386
392
|
}
|
|
393
|
+
.h-\[90px\] {
|
|
394
|
+
height: 90px;
|
|
395
|
+
}
|
|
387
396
|
.h-\[100\%\] {
|
|
388
397
|
height: 100%;
|
|
389
398
|
}
|
|
@@ -444,6 +453,9 @@
|
|
|
444
453
|
.w-\[80\%\] {
|
|
445
454
|
width: 80%;
|
|
446
455
|
}
|
|
456
|
+
.w-\[90px\] {
|
|
457
|
+
width: 90px;
|
|
458
|
+
}
|
|
447
459
|
.w-\[100\%\] {
|
|
448
460
|
width: 100%;
|
|
449
461
|
}
|
|
@@ -456,6 +468,9 @@
|
|
|
456
468
|
.w-\[150px\] {
|
|
457
469
|
width: 150px;
|
|
458
470
|
}
|
|
471
|
+
.w-\[180px\] {
|
|
472
|
+
width: 180px;
|
|
473
|
+
}
|
|
459
474
|
.w-\[188px\] {
|
|
460
475
|
width: 188px;
|
|
461
476
|
}
|
|
@@ -494,6 +509,9 @@
|
|
|
494
509
|
.max-w-\[220px\] {
|
|
495
510
|
max-width: 220px;
|
|
496
511
|
}
|
|
512
|
+
.max-w-\[460px\] {
|
|
513
|
+
max-width: 460px;
|
|
514
|
+
}
|
|
497
515
|
.max-w-full {
|
|
498
516
|
max-width: 100%;
|
|
499
517
|
}
|
|
@@ -536,6 +554,9 @@
|
|
|
536
554
|
.cursor-pointer {
|
|
537
555
|
cursor: pointer;
|
|
538
556
|
}
|
|
557
|
+
.resize {
|
|
558
|
+
resize: both;
|
|
559
|
+
}
|
|
539
560
|
.\[grid-template-columns\:14\%_40\%_0\.5\%_24\%_13\.5\%\] {
|
|
540
561
|
grid-template-columns: 14% 40% 0.5% 24% 13.5%;
|
|
541
562
|
}
|
|
@@ -1048,6 +1069,14 @@
|
|
|
1048
1069
|
--tw-leading: 1.3;
|
|
1049
1070
|
line-height: 1.3;
|
|
1050
1071
|
}
|
|
1072
|
+
.leading-\[1\.4\] {
|
|
1073
|
+
--tw-leading: 1.4;
|
|
1074
|
+
line-height: 1.4;
|
|
1075
|
+
}
|
|
1076
|
+
.leading-\[1\.25\] {
|
|
1077
|
+
--tw-leading: 1.25;
|
|
1078
|
+
line-height: 1.25;
|
|
1079
|
+
}
|
|
1051
1080
|
.leading-\[14px\] {
|
|
1052
1081
|
--tw-leading: 14px;
|
|
1053
1082
|
line-height: 14px;
|
|
@@ -1148,6 +1177,9 @@
|
|
|
1148
1177
|
.uppercase {
|
|
1149
1178
|
text-transform: uppercase;
|
|
1150
1179
|
}
|
|
1180
|
+
.italic {
|
|
1181
|
+
font-style: italic;
|
|
1182
|
+
}
|
|
1151
1183
|
.tabular-nums {
|
|
1152
1184
|
--tw-numeric-spacing: tabular-nums;
|
|
1153
1185
|
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
@@ -170,7 +170,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
170
170
|
React.createElement("div", { className: "flex items-center gap-[8px]" },
|
|
171
171
|
React.createElement("img", { src: (_f = serviceItem.icons) === null || _f === void 0 ? void 0 : _f.whiteDestination, alt: "destination", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
|
|
172
172
|
React.createElement("span", { className: "text-[13px] bold-text" }, cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.label.split(",")[0]))),
|
|
173
|
-
React.createElement("div", { className: "flex flex-col gap-[
|
|
173
|
+
React.createElement("div", { className: "flex flex-col gap-[10px]" },
|
|
174
174
|
React.createElement("div", { className: "text-[12px] bold-text" }, travelDate
|
|
175
175
|
? new Date(travelDate).toLocaleDateString("es-CL", {
|
|
176
176
|
weekday: "long",
|
|
@@ -192,15 +192,13 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
192
192
|
} }, "Tu compra est\u00E1 100% asegurada.")))),
|
|
193
193
|
React.createElement("div", { className: "min-w-0 px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]" },
|
|
194
194
|
React.createElement("div", { className: "text-center" },
|
|
195
|
-
React.createElement("div", { className: "bold-text text-[
|
|
195
|
+
React.createElement("div", { className: "bold-text text-[13px]" },
|
|
196
196
|
operatorsCompetingCount,
|
|
197
|
-
" operadores compitiendo",
|
|
198
|
-
React.createElement("br", null),
|
|
199
|
-
" por tu compra")),
|
|
197
|
+
" operadores compitiendo por tu compra")),
|
|
200
198
|
React.createElement("div", { className: "grid w-full grid-cols-3 items-stretch gap-[14px] " }, operators.map((op, idx) => (React.createElement("div", { key: idx, className: "flex min-w-0 flex-col items-center justify-center gap-[8px] rounded-[8px]", style: {
|
|
201
199
|
// height: "80px",
|
|
202
200
|
border: "1px solid #363c48",
|
|
203
|
-
backgroundColor: "#
|
|
201
|
+
backgroundColor: "#fff",
|
|
204
202
|
padding: "14px 10px",
|
|
205
203
|
} },
|
|
206
204
|
React.createElement("img", { src: op.logo, alt: op.name, onError: (e) => {
|
|
@@ -209,13 +207,16 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
209
207
|
((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[0]) ||
|
|
210
208
|
"/images/service-list/bus-icon.svg";
|
|
211
209
|
}, className: `h-[24px] max-w-full object-contain ${isSoldOut ? "grayscale" : ""}` }),
|
|
212
|
-
React.createElement("span", { className: "text-[11px] truncate max-w-full text-center" }, op.name),
|
|
210
|
+
React.createElement("span", { className: "text-[11px] truncate max-w-full text-center text-[#464647]" }, op.name),
|
|
213
211
|
React.createElement("div", { className: "bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap" },
|
|
214
212
|
React.createElement("span", null, op === null || op === void 0 ? void 0 : op.time)),
|
|
215
|
-
React.createElement("span", { className: "text-[10px] mt-[6px]" }, op === null || op === void 0 ? void 0 : op.seatsAvailable))))),
|
|
216
|
-
React.createElement("div", { className: "flex w-full items-center justify-center gap-[6px] text-[12px]", style: {
|
|
213
|
+
React.createElement("span", { className: "text-[10px] mt-[6px] text-[#464647]" }, op === null || op === void 0 ? void 0 : op.seatsAvailable))))),
|
|
214
|
+
React.createElement("div", { className: "flex w-full items-center justify-center gap-[6px] text-[12px] rounded-full", style: {
|
|
217
215
|
padding: "8px 14px",
|
|
218
216
|
marginBottom: "6px",
|
|
217
|
+
border: "1px solid #363c48",
|
|
218
|
+
backgroundColor: "#1a202e",
|
|
219
|
+
// padding: "14px 10px",
|
|
219
220
|
} },
|
|
220
221
|
React.createElement(LottiePlayer
|
|
221
222
|
// animationData={serviceItem.icons.flexibleAnim}
|
package/package.json
CHANGED
package/src/KuposUIComponent.tsx
CHANGED
|
@@ -9,13 +9,16 @@ import { FilterBarProps } from "./components/FilterBar/tyoes";
|
|
|
9
9
|
import { CuponeraFilterBarProps } from "./components/CuponeraFilterBar/types";
|
|
10
10
|
import { ResponsiveFilterBar } from "./components/FilterBar";
|
|
11
11
|
import ResponsiveCuponeraFilterBar from "./components/CuponeraFilterBar/ResponsiveCuponeraFilterBar";
|
|
12
|
+
import { ResponsiveSurvey, SurveyProps } from "./components/Survey";
|
|
12
13
|
|
|
13
14
|
interface KuposUIComponentProps {
|
|
14
15
|
typeOfComponent:
|
|
15
16
|
| "serviceitem"
|
|
16
17
|
| "paymentsidebar"
|
|
17
18
|
| "servicelist"
|
|
18
|
-
| "filterbar"
|
|
19
|
+
| "filterbar"
|
|
20
|
+
| "survey"
|
|
21
|
+
| "cuponerafilterbar";
|
|
19
22
|
variant?: "mobile" | "desktop";
|
|
20
23
|
|
|
21
24
|
// Original ServiceItem props
|
|
@@ -105,6 +108,21 @@ interface KuposUIComponentProps {
|
|
|
105
108
|
sortOrder?: "asc" | "desc";
|
|
106
109
|
};
|
|
107
110
|
onFilterChange?: (filters: any) => void;
|
|
111
|
+
|
|
112
|
+
// Survey props
|
|
113
|
+
isOpen?: boolean;
|
|
114
|
+
selectedScore?: number | null;
|
|
115
|
+
onScoreChange?: (score: number) => void;
|
|
116
|
+
feedback?: string;
|
|
117
|
+
onFeedbackChange?: (text: string) => void;
|
|
118
|
+
onClose?: () => void;
|
|
119
|
+
onSkip?: () => void;
|
|
120
|
+
onSubmit?: (score: number, feedback: string) => void;
|
|
121
|
+
isSubmitted?: boolean;
|
|
122
|
+
bookingId?: string;
|
|
123
|
+
origin?: string;
|
|
124
|
+
destination?: string;
|
|
125
|
+
operatorName?: string;
|
|
108
126
|
}
|
|
109
127
|
|
|
110
128
|
// Using imported ResponsivePaymentSideBar component instead
|
|
@@ -144,6 +162,9 @@ export default function KuposUIComponent(
|
|
|
144
162
|
/>
|
|
145
163
|
);
|
|
146
164
|
|
|
165
|
+
case "survey":
|
|
166
|
+
return <ResponsiveSurvey {...(restProps as unknown as SurveyProps)} />;
|
|
167
|
+
|
|
147
168
|
default:
|
|
148
169
|
return (
|
|
149
170
|
<div className="error-message">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"5.7.6","fr":30,"ip":0,"op":60,"w":512,"h":512,"nm":"Checkmark-final","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Capa de formas 6","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[173.75,411.25,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":25,"s":[0,0,100]},{"t":39,"s":[3.598,3.598,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 5","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[423.5,238.5,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":36,"s":[0,0,100]},{"t":50,"s":[4.406,4.406,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Capa de formas 4","sr":1,"ks":{"o":{"a":0,"k":67,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[100,140,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":46,"s":[0,0,100]},{"t":60,"s":[5.219,5.219,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":67,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,0.969,0.576,0.118,0.5,0.957,0.465,0.129,1,0.945,0.353,0.141],"ix":9}},"s":{"a":0,"k":[0,0],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":0,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"Capa 1/Check-Mark-Animation2 contornos","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2,"l":2},"a":{"a":0,"k":[256,256,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-54.205,3.498],[-19.88,36.986],[54.205,-36.986]],"c":false},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":14.2,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[262.249,261.506],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Grupo 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":21,"s":[0]},{"t":40,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"CirculoNaranja","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[254,256,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[0,0,100]},{"t":25,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0,1,0.655,0.212,0.5,1,0.608,0.241,1,1,0.561,0.271],"ix":9}},"s":{"a":0,"k":[-29,-62],"ix":5},"e":{"a":0,"k":[100,0],"ix":6},"t":2,"h":{"a":0,"k":21,"ix":7},"a":{"a":0,"k":0,"ix":8},"nm":"Relleno de degradado 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"CirculoBlanco","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[254,256,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[0,0,100]},{"t":25,"s":[109,109,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[187.68,187.68],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[1.988,-0.426],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[131.424,131.424],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":7,"ty":4,"nm":"CirculoAnaranjadoFondo","sr":1,"ks":{"o":{"a":0,"k":14,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[256,256,0],"ix":2,"l":2},"a":{"a":0,"k":[256,256,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":20,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-141.385,0],[0,-141.385],[141.385,0],[0,141.385]],"o":[[141.385,0],[0,141.385],[-141.385,0],[0,-141.385]],"v":[[0,-256],[256,0],[0,256],[-256,0]],"c":true},"ix":2},"nm":"Trazado 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.944999964097,0.352999997606,0.141000007181,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 2","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[256,256],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Grupo 1","np":5,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0},{"ddd":0,"ind":8,"ty":4,"nm":"Capa de formas 7","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,252,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[518.633,518.633],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Trazado de rectángulo 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[3.316,3.316],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectángulo 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":60,"st":0,"bm":0}],"markers":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SurveyProps } from "./types";
|
|
3
|
+
import SurveyDesktop from "./SurveyDesktop";
|
|
4
|
+
import SurveyMobile from "./SurveyMobile";
|
|
5
|
+
|
|
6
|
+
export default function ResponsiveSurvey(props: SurveyProps) {
|
|
7
|
+
const { variant } = props;
|
|
8
|
+
|
|
9
|
+
if (variant === "mobile") {
|
|
10
|
+
return <SurveyMobile {...(props as unknown as SurveyProps)} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return <SurveyDesktop {...props} />;
|
|
14
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SurveyProps } from "./types";
|
|
3
|
+
import { Modal } from "../../ui/Modal";
|
|
4
|
+
import {
|
|
5
|
+
ThankYouCard,
|
|
6
|
+
ScoreButtons,
|
|
7
|
+
FeedbackTextarea,
|
|
8
|
+
getFeedbackConfig,
|
|
9
|
+
} from "../../ui/Survey";
|
|
10
|
+
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
11
|
+
|
|
12
|
+
const SurveyDesktop = ({
|
|
13
|
+
isOpen,
|
|
14
|
+
isSubmitted,
|
|
15
|
+
selectedScore,
|
|
16
|
+
onScoreChange,
|
|
17
|
+
feedback = "",
|
|
18
|
+
onFeedbackChange,
|
|
19
|
+
onClose,
|
|
20
|
+
onSkip,
|
|
21
|
+
onSubmit,
|
|
22
|
+
colors,
|
|
23
|
+
icons,
|
|
24
|
+
isLoading,
|
|
25
|
+
}: SurveyProps) => {
|
|
26
|
+
if (!isOpen) return null;
|
|
27
|
+
|
|
28
|
+
const config = getFeedbackConfig(selectedScore);
|
|
29
|
+
|
|
30
|
+
const handleSubmit = () => {
|
|
31
|
+
if (selectedScore != null) {
|
|
32
|
+
onSubmit?.(selectedScore, feedback);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Modal
|
|
38
|
+
isOpen={isOpen}
|
|
39
|
+
onClose={onClose}
|
|
40
|
+
variant="center"
|
|
41
|
+
size="lg"
|
|
42
|
+
maxWidth={550}
|
|
43
|
+
padding={isSubmitted ? 0 : "40px 48px 36px"}
|
|
44
|
+
borderRadius={28}
|
|
45
|
+
closeOnBackdrop={false}
|
|
46
|
+
>
|
|
47
|
+
{/* {isSubmitted ? (
|
|
48
|
+
<ThankYouCard onClose={onClose} />
|
|
49
|
+
) : ( */}
|
|
50
|
+
<>
|
|
51
|
+
{/* Close Button */}
|
|
52
|
+
<button
|
|
53
|
+
onClick={onClose}
|
|
54
|
+
aria-label="Close survey"
|
|
55
|
+
className="absolute top-[15px] right-[25px] bg-transparent border-none cursor-pointer text-[22px] text-gray-400 flex items-center justify-center p-1 z-10 transition-colors duration-200 hover:text-gray-600"
|
|
56
|
+
>
|
|
57
|
+
<img
|
|
58
|
+
src={icons.closeIcon}
|
|
59
|
+
alt="Close"
|
|
60
|
+
className="w-[16px] h-[16px] block"
|
|
61
|
+
/>
|
|
62
|
+
</button>
|
|
63
|
+
|
|
64
|
+
{/* Centered Illustration */}
|
|
65
|
+
{icons?.surveyIcon && (
|
|
66
|
+
<div className="flex justify-center mb-3 mt-2">
|
|
67
|
+
<img
|
|
68
|
+
src={icons.surveyIcon}
|
|
69
|
+
alt="Survey Illustration"
|
|
70
|
+
className="w-[90px] h-[90px] block"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
{/* Centered Title */}
|
|
76
|
+
<h2 className="text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2">
|
|
77
|
+
Ayúdanos a mejorar
|
|
78
|
+
</h2>
|
|
79
|
+
|
|
80
|
+
{/* Centered Subtitle */}
|
|
81
|
+
<p className="text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto">
|
|
82
|
+
Basándote en tu experiencia de compra.
|
|
83
|
+
<br />
|
|
84
|
+
¿Nos recomendarías a un amigo?
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<ScoreButtons
|
|
88
|
+
selectedScore={selectedScore}
|
|
89
|
+
onScoreChange={onScoreChange}
|
|
90
|
+
buttonHeight={45}
|
|
91
|
+
fontSize={15}
|
|
92
|
+
colors={colors}
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<FeedbackTextarea
|
|
96
|
+
config={config}
|
|
97
|
+
feedback={feedback}
|
|
98
|
+
onFeedbackChange={onFeedbackChange}
|
|
99
|
+
colors={colors}
|
|
100
|
+
/>
|
|
101
|
+
|
|
102
|
+
{/* Centered Submit Button */}
|
|
103
|
+
<div className="flex justify-center mt-[20px]">
|
|
104
|
+
<div className="w-[180px]">
|
|
105
|
+
<KuposButton
|
|
106
|
+
isSoldOut={selectedScore == null}
|
|
107
|
+
isLoading={isLoading || false}
|
|
108
|
+
buttonColor={"#FF8E43"}
|
|
109
|
+
buyLabel="Enviar"
|
|
110
|
+
soldOutLabel="Enviar"
|
|
111
|
+
onClick={handleSubmit}
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</>
|
|
116
|
+
{/* )} */}
|
|
117
|
+
</Modal>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default SurveyDesktop;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SurveyProps } from "./types";
|
|
3
|
+
import { BottomSheet } from "../../ui/BottomSheet";
|
|
4
|
+
import {
|
|
5
|
+
ThankYouCard,
|
|
6
|
+
SurveyHeader,
|
|
7
|
+
ScoreButtons,
|
|
8
|
+
FeedbackBanner,
|
|
9
|
+
FeedbackTextarea,
|
|
10
|
+
SurveyFooter,
|
|
11
|
+
getFeedbackConfig,
|
|
12
|
+
} from "../../ui/Survey";
|
|
13
|
+
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
14
|
+
|
|
15
|
+
const SurveyMobile = ({
|
|
16
|
+
isOpen,
|
|
17
|
+
isSubmitted,
|
|
18
|
+
selectedScore,
|
|
19
|
+
onScoreChange,
|
|
20
|
+
feedback = "",
|
|
21
|
+
onFeedbackChange,
|
|
22
|
+
onClose,
|
|
23
|
+
onSkip,
|
|
24
|
+
onSubmit,
|
|
25
|
+
colors,
|
|
26
|
+
icons,
|
|
27
|
+
isLoading,
|
|
28
|
+
}: SurveyProps) => {
|
|
29
|
+
if (!isOpen) return null;
|
|
30
|
+
|
|
31
|
+
const config = getFeedbackConfig(selectedScore);
|
|
32
|
+
|
|
33
|
+
const handleSubmit = () => {
|
|
34
|
+
if (selectedScore != null) {
|
|
35
|
+
onSubmit?.(selectedScore, feedback);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<BottomSheet
|
|
41
|
+
isOpen={isOpen ?? false}
|
|
42
|
+
onClose={onClose}
|
|
43
|
+
showHandle={true}
|
|
44
|
+
showBackdrop={false}
|
|
45
|
+
blurBackground={true}
|
|
46
|
+
blurAmount="2px"
|
|
47
|
+
padding={isSubmitted ? 0 : "0 20px 32px"}
|
|
48
|
+
>
|
|
49
|
+
{/* {isSubmitted ? (
|
|
50
|
+
<ThankYouCard onClose={onClose} titleFontSize="1.35rem" />
|
|
51
|
+
) : ( */}
|
|
52
|
+
<>
|
|
53
|
+
{/* <SurveyHeader onClose={onClose} /> */}
|
|
54
|
+
{/* Close Button */}
|
|
55
|
+
<button
|
|
56
|
+
onClick={onClose}
|
|
57
|
+
aria-label="Close survey"
|
|
58
|
+
className="absolute top-[15px] right-[25px] bg-transparent border-none cursor-pointer text-[22px] text-gray-400 flex items-center justify-center p-1 z-10 transition-colors duration-200 hover:text-gray-600"
|
|
59
|
+
>
|
|
60
|
+
<img
|
|
61
|
+
src={icons.closeIcon}
|
|
62
|
+
alt="Close"
|
|
63
|
+
className="w-[16px] h-[16px] block"
|
|
64
|
+
/>
|
|
65
|
+
</button>
|
|
66
|
+
|
|
67
|
+
{/* Centered Illustration */}
|
|
68
|
+
{icons?.surveyIcon && (
|
|
69
|
+
<div className="flex justify-center mb-3 mt-2">
|
|
70
|
+
<img
|
|
71
|
+
src={icons.surveyIcon}
|
|
72
|
+
alt="Survey Illustration"
|
|
73
|
+
className="w-[90px] h-[90px] block"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
|
|
78
|
+
{/* Centered Title */}
|
|
79
|
+
<h2 className="text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2">
|
|
80
|
+
Ayúdanos a mejorar
|
|
81
|
+
</h2>
|
|
82
|
+
|
|
83
|
+
{/* Centered Subtitle */}
|
|
84
|
+
<p className="text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto">
|
|
85
|
+
Basándote en tu experiencia de compra.
|
|
86
|
+
<br />
|
|
87
|
+
¿Nos recomendarías a un amigo?
|
|
88
|
+
</p>
|
|
89
|
+
|
|
90
|
+
<ScoreButtons
|
|
91
|
+
selectedScore={selectedScore}
|
|
92
|
+
onScoreChange={onScoreChange}
|
|
93
|
+
buttonHeight={44}
|
|
94
|
+
fontSize={13}
|
|
95
|
+
gap={6}
|
|
96
|
+
colors={colors}
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
{/* <FeedbackBanner config={config} /> */}
|
|
100
|
+
|
|
101
|
+
<FeedbackTextarea
|
|
102
|
+
config={config}
|
|
103
|
+
feedback={feedback}
|
|
104
|
+
onFeedbackChange={onFeedbackChange}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<div className="flex justify-center mt-[20px]">
|
|
108
|
+
<div className="w-[180px]">
|
|
109
|
+
<KuposButton
|
|
110
|
+
isSoldOut={selectedScore == null}
|
|
111
|
+
isLoading={isLoading || false}
|
|
112
|
+
buttonColor={"#FF8E43"}
|
|
113
|
+
buyLabel="Enviar"
|
|
114
|
+
soldOutLabel="Enviar"
|
|
115
|
+
onClick={handleSubmit}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</>
|
|
120
|
+
{/* )} */}
|
|
121
|
+
</BottomSheet>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default SurveyMobile;
|