kupos-ui-components-lib 9.9.9 → 9.10.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.
- package/dist/components/ServiceItem/ServiceItemDesktop.js +4 -4
- package/dist/components/ServiceItem/ServiceItemMobile.js +8 -3
- package/dist/components/Survey/SurveyDesktop.d.ts +1 -1
- package/dist/components/Survey/SurveyDesktop.js +18 -24
- package/dist/components/Survey/SurveyMobile.d.ts +1 -1
- package/dist/components/Survey/SurveyMobile.js +16 -25
- package/dist/components/Survey/types.d.ts +4 -0
- package/dist/styles.css +6 -3
- package/dist/ui/OfferBanner.js +1 -1
- package/dist/ui/SeatSection/SeatSection.js +1 -1
- package/dist/ui/ServiceBadges/ServiceBadges.d.ts +1 -1
- package/dist/ui/ServiceBadges/ServiceBadges.js +3 -1
- package/dist/ui/Survey/FeedbackTextarea.d.ts +4 -1
- package/dist/ui/Survey/FeedbackTextarea.js +19 -21
- package/dist/ui/Survey/ScoreButtons.d.ts +5 -1
- package/dist/ui/Survey/ScoreButtons.js +13 -9
- package/dist/ui/Survey/constants.d.ts +1 -1
- package/dist/ui/Survey/constants.js +1 -1
- package/dist/ui/mobileweb/SeatSectionMobile.js +1 -1
- package/dist/ui/mobileweb/ServiceBadgesMobile.d.ts +1 -1
- package/dist/ui/mobileweb/ServiceBadgesMobile.js +3 -3
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +6 -3
- package/src/components/ServiceItem/ServiceItemMobile.tsx +14 -3
- package/src/ui/OfferBanner.tsx +1 -1
- package/src/ui/SeatSection/SeatSection.tsx +4 -1
- package/src/ui/ServiceBadges/ServiceBadges.tsx +6 -4
- package/src/ui/mobileweb/SeatSectionMobile.tsx +4 -1
- package/src/ui/mobileweb/ServiceBadgesMobile.tsx +8 -5
|
@@ -148,12 +148,12 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
148
148
|
// zIndex: 1,
|
|
149
149
|
}
|
|
150
150
|
: {};
|
|
151
|
-
const renderIcon = (iconKey, size = "14px") => {
|
|
151
|
+
const renderIcon = (iconKey, size = "14px", styles) => {
|
|
152
152
|
var _a;
|
|
153
153
|
const iconValue = (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a[iconKey];
|
|
154
154
|
if (iconValue) {
|
|
155
155
|
if (typeof iconValue === "string") {
|
|
156
|
-
return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`}
|
|
156
|
+
return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`} `, style: Object.assign({}, (styles || {})) }));
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
return null;
|
|
@@ -275,10 +275,10 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
275
275
|
setIsFeatureDropDownExpand(isFeatureDropDownExpand === serviceItem.id ||
|
|
276
276
|
isFeatureDropDownExpand === true
|
|
277
277
|
? null
|
|
278
|
-
: serviceItem.id), selectedTimeSlot: selectedTimeSlot, onTimeSlotChange: onTimeSlotChange, isTimeDropdownOpen: isTimeDropdownOpen, onTimeDropdownToggle: onTimeDropdownToggle, wowDealData: wowDealData })) : (React.createElement("div", { className: `relative hover:z-[150] ${hasOfferText || hasDpEnabled ? "mb-[55px]" : "mb-[10px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
|
|
278
|
+
: serviceItem.id), selectedTimeSlot: selectedTimeSlot, onTimeSlotChange: onTimeSlotChange, isTimeDropdownOpen: isTimeDropdownOpen, onTimeDropdownToggle: onTimeDropdownToggle, wowDealData: wowDealData })) : (React.createElement("div", { className: `relative hover:z-[150] ${hasOfferText || hasDpEnabled || isNewUiEnabled ? "mb-[55px]" : "mb-[10px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
|
|
279
279
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
|
|
280
280
|
showTopLabel
|
|
281
|
-
? "mt-[
|
|
281
|
+
? "mt-[30px]"
|
|
282
282
|
: "mt-[20px]"} ` },
|
|
283
283
|
((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || hasDpEnabled) && !isSoldOut && (React.createElement(OfferBanner, { offerGradient: offerGradient, isSoldOut: isSoldOut, serviceItem: serviceItem, renderIcon: renderIcon, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, viewersConfig: viewersConfig, getAnimationIcon: getAnimationIcon, showLoginOption: showLoginOption, isNewUiEnabled: isNewUiEnabled, colors: colors })),
|
|
284
284
|
React.createElement("div", { id: `service-card-${serviceItem.id}`, className: `bg-white mx-auto relative ${(hasOfferText && isNewUiEnabled && !isSoldOut) || hasDpEnabled
|
|
@@ -75,12 +75,12 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
75
75
|
});
|
|
76
76
|
return nodes;
|
|
77
77
|
};
|
|
78
|
-
const renderIcon = (iconKey, size = "14px") => {
|
|
78
|
+
const renderIcon = (iconKey, size = "14px", styles) => {
|
|
79
79
|
var _a;
|
|
80
80
|
const iconValue = (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a[iconKey];
|
|
81
81
|
if (iconValue) {
|
|
82
82
|
if (typeof iconValue === "string") {
|
|
83
|
-
return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`} mr-[5px]`, style: { filter: isSoldOut ? "grayscale" : "" } }));
|
|
83
|
+
return (React.createElement("img", { src: iconValue, alt: iconKey, className: `${`w-[${size}] h-[${size}]`} mr-[5px]`, style: Object.assign({ filter: isSoldOut ? "grayscale" : "" }, (styles || {})) }));
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
return null;
|
|
@@ -104,7 +104,12 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
104
104
|
!isSoldOut
|
|
105
105
|
? "rounded-[18px]"
|
|
106
106
|
: "rounded-[10px] border border-[#ccc]"}`, style: Object.assign(Object.assign({}, serviceCardStyle), { backgroundColor: "#fff" }) },
|
|
107
|
-
React.createElement("div", { style: {
|
|
107
|
+
React.createElement("div", { style: {
|
|
108
|
+
padding: "12px 12px 8px 12px",
|
|
109
|
+
marginTop: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && showTopLabel && isConexion
|
|
110
|
+
? " 10px"
|
|
111
|
+
: "",
|
|
112
|
+
} },
|
|
108
113
|
React.createElement("div", { className: "flex justify-between items-center mb-[10px]" },
|
|
109
114
|
React.createElement("div", { className: "flex items-center justify-center gap-x-4", style: {
|
|
110
115
|
marginBottom: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || hasDiscount ? "10px" : "",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SurveyProps } from "./types";
|
|
3
|
-
declare const SurveyDesktop: ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback, onFeedbackChange, onClose, onSkip, onSubmit, colors, }: SurveyProps) => React.JSX.Element;
|
|
3
|
+
declare const SurveyDesktop: ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback, onFeedbackChange, onClose, onSkip, onSubmit, colors, icons, isLoading, }: SurveyProps) => React.JSX.Element;
|
|
4
4
|
export default SurveyDesktop;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Modal } from "../../ui/Modal";
|
|
3
|
-
import { ThankYouCard,
|
|
4
|
-
|
|
3
|
+
import { ThankYouCard, ScoreButtons, FeedbackTextarea, getFeedbackConfig, } from "../../ui/Survey";
|
|
4
|
+
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
5
|
+
const SurveyDesktop = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback = "", onFeedbackChange, onClose, onSkip, onSubmit, colors, icons, isLoading, }) => {
|
|
5
6
|
if (!isOpen)
|
|
6
7
|
return null;
|
|
7
8
|
const config = getFeedbackConfig(selectedScore);
|
|
@@ -10,27 +11,20 @@ const SurveyDesktop = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feed
|
|
|
10
11
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(selectedScore, feedback);
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
|
-
return (React.createElement(Modal, { isOpen: isOpen, onClose: onClose, variant: "center", size: "lg", maxWidth:
|
|
14
|
-
React.createElement(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"\
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
color: colors === null || colors === void 0 ? void 0 : colors.primaryColor,
|
|
29
|
-
marginBottom: 20,
|
|
30
|
-
} }, "Pulsa un n\u00FAmero: 1 significa en absoluto, 10 significa absolutamente."),
|
|
31
|
-
React.createElement(ScoreButtons, { selectedScore: selectedScore, onScoreChange: onScoreChange, buttonHeight: 54, fontSize: 15 }),
|
|
32
|
-
React.createElement(FeedbackBanner, { config: config }),
|
|
33
|
-
React.createElement(FeedbackTextarea, { config: config, feedback: feedback, onFeedbackChange: onFeedbackChange }),
|
|
34
|
-
React.createElement(SurveyFooter, { selectedScore: selectedScore, onSkip: onSkip, onSubmit: handleSubmit, colors: colors })))));
|
|
14
|
+
return (React.createElement(Modal, { isOpen: isOpen, onClose: onClose, variant: "center", size: "lg", maxWidth: 550, padding: isSubmitted ? 0 : "40px 48px 36px", borderRadius: 28, closeOnBackdrop: false }, isSubmitted ? (React.createElement(ThankYouCard, { onClose: onClose })) : (React.createElement(React.Fragment, null,
|
|
15
|
+
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" },
|
|
16
|
+
React.createElement("img", { src: icons.closeIcon, alt: "Close", className: "w-[16px] h-[16px] block" })),
|
|
17
|
+
(icons === null || icons === void 0 ? void 0 : icons.surveyIcon) && (React.createElement("div", { className: "flex justify-center mb-3 mt-2" },
|
|
18
|
+
React.createElement("img", { src: icons.surveyIcon, alt: "Survey Illustration", className: "w-[90px] h-[90px] block" }))),
|
|
19
|
+
React.createElement("h2", { className: "text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2" }, "Ay\u00FAdanos a mejorar"),
|
|
20
|
+
React.createElement("p", { className: "text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto" },
|
|
21
|
+
"Bas\u00E1ndote en tu experiencia de compra.",
|
|
22
|
+
React.createElement("br", null),
|
|
23
|
+
"\u00BFNos recomendar\u00EDas a un amigo?"),
|
|
24
|
+
React.createElement(ScoreButtons, { selectedScore: selectedScore, onScoreChange: onScoreChange, buttonHeight: 45, fontSize: 15, colors: colors }),
|
|
25
|
+
React.createElement(FeedbackTextarea, { config: config, feedback: feedback, onFeedbackChange: onFeedbackChange, colors: colors }),
|
|
26
|
+
React.createElement("div", { className: "flex justify-center mt-[20px]" },
|
|
27
|
+
React.createElement("div", { className: "w-[180px]" },
|
|
28
|
+
React.createElement(KuposButton, { isSoldOut: selectedScore == null, isLoading: isLoading || false, buttonColor: "#FF8E43", buyLabel: "Enviar", soldOutLabel: "Enviar", onClick: handleSubmit })))))));
|
|
35
29
|
};
|
|
36
30
|
export default SurveyDesktop;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SurveyProps } from "./types";
|
|
3
|
-
declare const SurveyMobile: ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback, onFeedbackChange, onClose, onSkip, onSubmit, colors, }: SurveyProps) => React.JSX.Element;
|
|
3
|
+
declare const SurveyMobile: ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback, onFeedbackChange, onClose, onSkip, onSubmit, colors, icons, isLoading, }: SurveyProps) => React.JSX.Element;
|
|
4
4
|
export default SurveyMobile;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BottomSheet } from "../../ui/BottomSheet";
|
|
3
|
-
import { ThankYouCard,
|
|
4
|
-
|
|
3
|
+
import { ThankYouCard, ScoreButtons, FeedbackTextarea, getFeedbackConfig, } from "../../ui/Survey";
|
|
4
|
+
import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
5
|
+
const SurveyMobile = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedback = "", onFeedbackChange, onClose, onSkip, onSubmit, colors, icons, isLoading, }) => {
|
|
5
6
|
if (!isOpen)
|
|
6
7
|
return null;
|
|
7
8
|
const config = getFeedbackConfig(selectedScore);
|
|
@@ -11,29 +12,19 @@ const SurveyMobile = ({ isOpen, isSubmitted, selectedScore, onScoreChange, feedb
|
|
|
11
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" }, isSubmitted ? (React.createElement(ThankYouCard, { onClose: onClose, titleFontSize: "1.35rem" })) : (React.createElement(React.Fragment, null,
|
|
14
|
-
React.createElement(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"\
|
|
23
|
-
|
|
24
|
-
React.createElement("em", { style: {
|
|
25
|
-
color: colors === null || colors === void 0 ? void 0 : colors.secondaryColor,
|
|
26
|
-
} }, "recomiendes"),
|
|
27
|
-
" ",
|
|
28
|
-
"a un amigo?"),
|
|
29
|
-
React.createElement("p", { style: {
|
|
30
|
-
fontSize: "13.33px",
|
|
31
|
-
color: colors === null || colors === void 0 ? void 0 : colors.primaryColor,
|
|
32
|
-
marginBottom: 16,
|
|
33
|
-
} }, "Pulsa un n\u00FAmero: 1 significa en absoluto, 10 significa absolutamente."),
|
|
34
|
-
React.createElement(ScoreButtons, { selectedScore: selectedScore, onScoreChange: onScoreChange, buttonHeight: 44, fontSize: 13, gap: 6 }),
|
|
35
|
-
React.createElement(FeedbackBanner, { config: config }),
|
|
15
|
+
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" },
|
|
16
|
+
React.createElement("img", { src: icons.closeIcon, alt: "Close", className: "w-[16px] h-[16px] block" })),
|
|
17
|
+
(icons === null || icons === void 0 ? void 0 : icons.surveyIcon) && (React.createElement("div", { className: "flex justify-center mb-3 mt-2" },
|
|
18
|
+
React.createElement("img", { src: icons.surveyIcon, alt: "Survey Illustration", className: "w-[90px] h-[90px] block" }))),
|
|
19
|
+
React.createElement("h2", { className: "text-[18px] bold-text leading-[1.25] text-center mt-4 mb-2" }, "Ay\u00FAdanos a mejorar"),
|
|
20
|
+
React.createElement("p", { className: "text-[13.33px] text-center leading-[1.4] mb-6 max-w-[460px] mx-auto" },
|
|
21
|
+
"Bas\u00E1ndote en tu experiencia de compra.",
|
|
22
|
+
React.createElement("br", null),
|
|
23
|
+
"\u00BFNos recomendar\u00EDas a un amigo?"),
|
|
24
|
+
React.createElement(ScoreButtons, { selectedScore: selectedScore, onScoreChange: onScoreChange, buttonHeight: 44, fontSize: 13, gap: 6, colors: colors }),
|
|
36
25
|
React.createElement(FeedbackTextarea, { config: config, feedback: feedback, onFeedbackChange: onFeedbackChange }),
|
|
37
|
-
React.createElement(
|
|
26
|
+
React.createElement("div", { className: "flex justify-center mt-[20px]" },
|
|
27
|
+
React.createElement("div", { className: "w-[180px]" },
|
|
28
|
+
React.createElement(KuposButton, { isSoldOut: selectedScore == null, isLoading: isLoading || false, buttonColor: "#FF8E43", buyLabel: "Enviar", soldOutLabel: "Enviar", onClick: handleSubmit })))))));
|
|
38
29
|
};
|
|
39
30
|
export default SurveyMobile;
|
package/dist/styles.css
CHANGED
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
.-top-\[11px\] {
|
|
34
34
|
top: calc(11px * -1);
|
|
35
35
|
}
|
|
36
|
+
.-top-\[12px\] {
|
|
37
|
+
top: calc(12px * -1);
|
|
38
|
+
}
|
|
36
39
|
.-top-\[13px\] {
|
|
37
40
|
top: calc(13px * -1);
|
|
38
41
|
}
|
|
@@ -237,6 +240,9 @@
|
|
|
237
240
|
.mt-\[24px\] {
|
|
238
241
|
margin-top: 24px;
|
|
239
242
|
}
|
|
243
|
+
.mt-\[30px\] {
|
|
244
|
+
margin-top: 30px;
|
|
245
|
+
}
|
|
240
246
|
.-mr-\[12px\] {
|
|
241
247
|
margin-right: calc(12px * -1);
|
|
242
248
|
}
|
|
@@ -855,9 +861,6 @@
|
|
|
855
861
|
.p-\[15px\] {
|
|
856
862
|
padding: 15px;
|
|
857
863
|
}
|
|
858
|
-
.p-\[15px_15px\] {
|
|
859
|
-
padding: 15px 15px;
|
|
860
|
-
}
|
|
861
864
|
.p-\[16px_20px\] {
|
|
862
865
|
padding: 16px 20px;
|
|
863
866
|
}
|
package/dist/ui/OfferBanner.js
CHANGED
|
@@ -3,7 +3,7 @@ import LottiePlayer from "../assets/LottiePlayer";
|
|
|
3
3
|
import CommonService from "../utils/CommonService";
|
|
4
4
|
const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, renderIcon, isLoggedIn, showLoginModal, viewersConfig, getAnimationIcon, showLoginOption, isNewUiEnabled, colors, }) => {
|
|
5
5
|
var _a, _b, _c, _d;
|
|
6
|
-
return (React.createElement("div", { className: "text-white p-[
|
|
6
|
+
return (React.createElement("div", { className: "text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[44px] pt-[50px] rounded-b-[14px] text-[14px] mt-[10px]", style: {
|
|
7
7
|
background: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && !isNewUiEnabled
|
|
8
8
|
? colors === null || colors === void 0 ? void 0 : colors.bottomStripColor
|
|
9
9
|
: offerGradient,
|
|
@@ -95,7 +95,7 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
|
|
|
95
95
|
? removeDuplicateSeats && isPeru
|
|
96
96
|
? CommonService.truncateSeatLabel(val.label)
|
|
97
97
|
: isTrain
|
|
98
|
-
? CommonService.truncateSeatLabel(val.label, 8)
|
|
98
|
+
? CommonService.truncateSeatLabel(CommonService.capitalize(String(val.label)), 8)
|
|
99
99
|
: val.label
|
|
100
100
|
: null)));
|
|
101
101
|
});
|
|
@@ -3,7 +3,7 @@ interface ServiceBadgesProps {
|
|
|
3
3
|
showTopLabel?: string;
|
|
4
4
|
isSoldOut: boolean;
|
|
5
5
|
colors: any;
|
|
6
|
-
renderIcon: (iconKey: string, size?: string) => React.ReactNode;
|
|
6
|
+
renderIcon: (iconKey: string, size?: string, styles?: any) => React.ReactNode;
|
|
7
7
|
translation?: {
|
|
8
8
|
directService?: string;
|
|
9
9
|
};
|
|
@@ -8,7 +8,9 @@ const ServiceBadges = ({ showTopLabel, isSoldOut, colors, renderIcon, translatio
|
|
|
8
8
|
: `1px solid ${colors.topLabelColor}`,
|
|
9
9
|
color: isSoldOut ? "#ccc" : colors.topLabelColor,
|
|
10
10
|
} },
|
|
11
|
-
|
|
11
|
+
renderIcon("specialDeparture", "12px", {
|
|
12
|
+
filter: isSoldOut ? "grayscale(0.5)" : "",
|
|
13
|
+
}),
|
|
12
14
|
React.createElement("div", null, showTopLabel))),
|
|
13
15
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) && (React.createElement("div", { className: `flex items-center gap-[10px] py-[4px] px-[14px] rounded-[38px] text-[12.5px] z-20`, style: {
|
|
14
16
|
backgroundColor: "#fff",
|
|
@@ -4,6 +4,9 @@ interface FeedbackTextareaProps {
|
|
|
4
4
|
config: FeedbackConfig | null;
|
|
5
5
|
feedback: string;
|
|
6
6
|
onFeedbackChange?: (text: string) => void;
|
|
7
|
+
colors?: {
|
|
8
|
+
primaryColor?: string;
|
|
9
|
+
};
|
|
7
10
|
}
|
|
8
|
-
declare const FeedbackTextarea: ({ config, feedback, onFeedbackChange, }: FeedbackTextareaProps) => React.JSX.Element;
|
|
11
|
+
declare const FeedbackTextarea: ({ config, feedback, onFeedbackChange, colors, }: FeedbackTextareaProps) => React.JSX.Element;
|
|
9
12
|
export default FeedbackTextarea;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MAX_CHARS } from "./constants";
|
|
3
|
-
const FeedbackTextarea = ({ config, feedback, onFeedbackChange, }) => {
|
|
3
|
+
const FeedbackTextarea = ({ config, feedback, onFeedbackChange, colors, }) => {
|
|
4
4
|
if (!config)
|
|
5
5
|
return null;
|
|
6
|
-
return (React.createElement("div", { style: { marginTop:
|
|
7
|
-
React.createElement("
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
borderRadius: 6,
|
|
19
|
-
padding: "2px 8px",
|
|
20
|
-
} }, "Opcional")),
|
|
6
|
+
return (React.createElement("div", { style: { position: "relative", marginTop: 42 } },
|
|
7
|
+
React.createElement("span", { style: {
|
|
8
|
+
position: "absolute",
|
|
9
|
+
left: 16,
|
|
10
|
+
top: -10,
|
|
11
|
+
background: "#FFFFFF",
|
|
12
|
+
padding: "0 8px",
|
|
13
|
+
fontSize: "13.33px",
|
|
14
|
+
fontWeight: 600,
|
|
15
|
+
color: (colors === null || colors === void 0 ? void 0 : colors.primaryColor) || "#374151",
|
|
16
|
+
zIndex: 1,
|
|
17
|
+
} }, config.question),
|
|
21
18
|
React.createElement("div", { style: {
|
|
22
19
|
border: "1.5px solid #E5E7EB",
|
|
23
|
-
borderRadius:
|
|
20
|
+
borderRadius: 16,
|
|
24
21
|
overflow: "hidden",
|
|
25
22
|
position: "relative",
|
|
23
|
+
background: "transparent",
|
|
26
24
|
} },
|
|
27
25
|
React.createElement("textarea", { value: feedback, onChange: (e) => {
|
|
28
26
|
if (e.target.value.length <= MAX_CHARS)
|
|
29
27
|
onFeedbackChange === null || onFeedbackChange === void 0 ? void 0 : onFeedbackChange(e.target.value);
|
|
30
|
-
}, placeholder:
|
|
28
|
+
}, placeholder: "D\u00E9janos tus comentarios (opcional)", rows: 4, style: {
|
|
31
29
|
width: "100%",
|
|
32
|
-
padding: "
|
|
30
|
+
padding: "16px 16px 28px",
|
|
33
31
|
background: "transparent",
|
|
34
32
|
color: "#374151",
|
|
35
33
|
fontSize: "13.33px",
|
|
@@ -42,12 +40,12 @@ const FeedbackTextarea = ({ config, feedback, onFeedbackChange, }) => {
|
|
|
42
40
|
React.createElement("div", { style: {
|
|
43
41
|
position: "absolute",
|
|
44
42
|
bottom: 8,
|
|
45
|
-
right:
|
|
43
|
+
right: 16,
|
|
46
44
|
fontSize: 12,
|
|
47
45
|
color: "#9CA3AF",
|
|
48
46
|
} },
|
|
49
47
|
feedback.length,
|
|
50
|
-
"
|
|
48
|
+
"/",
|
|
51
49
|
MAX_CHARS))));
|
|
52
50
|
};
|
|
53
51
|
export default FeedbackTextarea;
|
|
@@ -5,6 +5,10 @@ interface ScoreButtonsProps {
|
|
|
5
5
|
buttonHeight?: number;
|
|
6
6
|
fontSize?: number;
|
|
7
7
|
gap?: number;
|
|
8
|
+
colors?: {
|
|
9
|
+
secondaryColor?: string;
|
|
10
|
+
primaryColor?: string;
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
|
-
declare const ScoreButtons: ({ selectedScore, onScoreChange, buttonHeight, fontSize, gap, }: ScoreButtonsProps) => React.JSX.Element;
|
|
13
|
+
declare const ScoreButtons: ({ selectedScore, onScoreChange, buttonHeight, fontSize, gap, colors, }: ScoreButtonsProps) => React.JSX.Element;
|
|
10
14
|
export default ScoreButtons;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { getZoneColor, getZoneShadow } from "./constants";
|
|
3
|
-
const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSize = 15, gap = 8, }) => (React.createElement("div", { style: { marginBottom: 4 } },
|
|
3
|
+
const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSize = 15, gap = 8, colors, }) => (React.createElement("div", { style: { marginBottom: 4 } },
|
|
4
4
|
React.createElement("div", { style: {
|
|
5
5
|
display: "grid",
|
|
6
6
|
gridTemplateColumns: "repeat(10, 1fr)",
|
|
@@ -8,10 +8,11 @@ const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSiz
|
|
|
8
8
|
} }, Array.from({ length: 10 }, (_, i) => i + 1).map((num) => {
|
|
9
9
|
const isSelected = selectedScore === num;
|
|
10
10
|
const zoneColor = getZoneColor(num);
|
|
11
|
+
const activeColor = (colors === null || colors === void 0 ? void 0 : colors.secondaryColor) || zoneColor;
|
|
11
12
|
return (React.createElement("button", { key: num, onClick: () => onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange(num), onMouseEnter: (e) => {
|
|
12
13
|
if (!isSelected) {
|
|
13
|
-
e.currentTarget.style.borderColor =
|
|
14
|
-
e.currentTarget.style.color =
|
|
14
|
+
e.currentTarget.style.borderColor = activeColor;
|
|
15
|
+
e.currentTarget.style.color = activeColor;
|
|
15
16
|
}
|
|
16
17
|
}, onMouseLeave: (e) => {
|
|
17
18
|
if (!isSelected) {
|
|
@@ -20,15 +21,18 @@ const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSiz
|
|
|
20
21
|
}
|
|
21
22
|
}, style: {
|
|
22
23
|
height: buttonHeight,
|
|
23
|
-
borderRadius:
|
|
24
|
+
borderRadius: 10,
|
|
24
25
|
fontSize,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
background: isSelected ? zoneColor : "#FFFFFF",
|
|
26
|
+
border: isSelected ? "none" : "1px solid #E5E7EB",
|
|
27
|
+
background: isSelected ? activeColor : "#FFFFFF",
|
|
28
28
|
color: isSelected ? "#FFFFFF" : "#111827",
|
|
29
29
|
cursor: "pointer",
|
|
30
30
|
transition: "border-color 0.15s, color 0.15s, background 0.15s",
|
|
31
|
-
boxShadow: isSelected
|
|
31
|
+
boxShadow: isSelected
|
|
32
|
+
? (colors === null || colors === void 0 ? void 0 : colors.secondaryColor)
|
|
33
|
+
? `0 2px 8px ${colors.secondaryColor}58`
|
|
34
|
+
: getZoneShadow(num)
|
|
35
|
+
: "none",
|
|
32
36
|
display: "flex",
|
|
33
37
|
alignItems: "center",
|
|
34
38
|
justifyContent: "center",
|
|
@@ -40,6 +44,6 @@ const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSiz
|
|
|
40
44
|
justifyContent: "space-between",
|
|
41
45
|
marginTop: 8,
|
|
42
46
|
} },
|
|
43
|
-
React.createElement("span", { style: { fontSize: 12, color: "#9CA3AF" } }, "
|
|
47
|
+
React.createElement("span", { style: { fontSize: 12, color: "#9CA3AF" } }, "Poco probable"),
|
|
44
48
|
React.createElement("span", { style: { fontSize: 12, color: "#9CA3AF" } }, "Muy probable"))));
|
|
45
49
|
export default ScoreButtons;
|
|
@@ -21,7 +21,7 @@ const SeatRow = ({ type, index, displayLabel, fare, isSoldOut, seatPriceColor, h
|
|
|
21
21
|
const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
|
|
22
22
|
return (React.createElement("div", { className: rowClass, key: index },
|
|
23
23
|
React.createElement("span", { className: `min-[420]:text-[13px] ${textSize} `, style: { color: labelColor } }, isTrain
|
|
24
|
-
? commonService.truncateSeatLabel(displayLabel, 8)
|
|
24
|
+
? commonService.truncateSeatLabel(commonService.capitalize(displayLabel), 8)
|
|
25
25
|
: displayLabel),
|
|
26
26
|
React.createElement("span", { className: `min-[420]:text-[13px] ${textSize} bold-text`, style: { color: priceColor } }, fare)));
|
|
27
27
|
};
|
|
@@ -3,7 +3,7 @@ interface ServiceBadgesMobileProps {
|
|
|
3
3
|
showTopLabel?: string;
|
|
4
4
|
isSoldOut: boolean;
|
|
5
5
|
colors: any;
|
|
6
|
-
renderIcon: (iconKey: string, size?: string) => React.ReactNode;
|
|
6
|
+
renderIcon: (iconKey: string, size?: string, styles?: any) => React.ReactNode;
|
|
7
7
|
translation?: {
|
|
8
8
|
directService?: string;
|
|
9
9
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
const ServiceBadgesMobile = ({ showTopLabel, isSoldOut, colors, renderIcon, serviceItem, isConexion, }) => {
|
|
3
|
-
return (React.createElement("div", { className: "absolute -top-[
|
|
4
|
-
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[
|
|
3
|
+
return (React.createElement("div", { className: "absolute -top-[12px] left-0 w-full flex items-center justify-end gap-[12px] pr-[17px] z-10" },
|
|
4
|
+
showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2p x] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20`, style: {
|
|
5
5
|
backgroundColor: "#fff",
|
|
6
6
|
border: isSoldOut
|
|
7
7
|
? "1px solid #ccc"
|
|
8
8
|
: `1px solid ${colors.topLabelColor}`,
|
|
9
9
|
color: isSoldOut ? "#ccc" : colors.topLabelColor,
|
|
10
10
|
} },
|
|
11
|
-
React.createElement("div", { className: isSoldOut ? "grayscale" : "" }, renderIcon("specialDeparture", "12px")),
|
|
11
|
+
React.createElement("div", { className: isSoldOut ? "grayscale" : "", style: { marginTop: "1px" } }, renderIcon("specialDeparture", "12px", { marginTop: "1px" })),
|
|
12
12
|
React.createElement("div", { style: {
|
|
13
13
|
color: isSoldOut ? "#ccc" : colors.topLabelColor,
|
|
14
14
|
} }, showTopLabel))),
|
package/package.json
CHANGED
|
@@ -259,7 +259,7 @@ function ServiceItemPB({
|
|
|
259
259
|
}
|
|
260
260
|
: {};
|
|
261
261
|
|
|
262
|
-
const renderIcon = (iconKey: string, size: string = "14px") => {
|
|
262
|
+
const renderIcon = (iconKey: string, size: string = "14px", styles?: any) => {
|
|
263
263
|
const iconValue = serviceItem.icons?.[iconKey];
|
|
264
264
|
if (iconValue) {
|
|
265
265
|
if (typeof iconValue === "string") {
|
|
@@ -268,6 +268,9 @@ function ServiceItemPB({
|
|
|
268
268
|
src={iconValue}
|
|
269
269
|
alt={iconKey}
|
|
270
270
|
className={`${`w-[${size}] h-[${size}]`} `}
|
|
271
|
+
style={{
|
|
272
|
+
...(styles || {}),
|
|
273
|
+
}}
|
|
271
274
|
/>
|
|
272
275
|
);
|
|
273
276
|
}
|
|
@@ -511,11 +514,11 @@ function ServiceItemPB({
|
|
|
511
514
|
/>
|
|
512
515
|
) : (
|
|
513
516
|
<div
|
|
514
|
-
className={`relative hover:z-[150] ${hasOfferText || hasDpEnabled ? "mb-[55px]" : "mb-[10px]"} ${
|
|
517
|
+
className={`relative hover:z-[150] ${hasOfferText || hasDpEnabled || isNewUiEnabled ? "mb-[55px]" : "mb-[10px]"} ${
|
|
515
518
|
serviceItem?.is_direct_trip ||
|
|
516
519
|
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
517
520
|
showTopLabel
|
|
518
|
-
? "mt-[
|
|
521
|
+
? "mt-[30px]"
|
|
519
522
|
: "mt-[20px]"
|
|
520
523
|
} `}
|
|
521
524
|
>
|
|
@@ -148,7 +148,7 @@ function ServiceItemMobile({
|
|
|
148
148
|
return nodes;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
const renderIcon = (iconKey: string, size: string = "14px") => {
|
|
151
|
+
const renderIcon = (iconKey: string, size: string = "14px", styles?: any) => {
|
|
152
152
|
const iconValue = serviceItem.icons?.[iconKey];
|
|
153
153
|
if (iconValue) {
|
|
154
154
|
if (typeof iconValue === "string") {
|
|
@@ -157,7 +157,10 @@ function ServiceItemMobile({
|
|
|
157
157
|
src={iconValue}
|
|
158
158
|
alt={iconKey}
|
|
159
159
|
className={`${`w-[${size}] h-[${size}]`} mr-[5px]`}
|
|
160
|
-
style={{
|
|
160
|
+
style={{
|
|
161
|
+
filter: isSoldOut ? "grayscale" : "",
|
|
162
|
+
...(styles || {}),
|
|
163
|
+
}}
|
|
161
164
|
/>
|
|
162
165
|
);
|
|
163
166
|
}
|
|
@@ -225,7 +228,15 @@ function ServiceItemMobile({
|
|
|
225
228
|
}`}
|
|
226
229
|
style={{ ...serviceCardStyle, backgroundColor: "#fff" }}
|
|
227
230
|
>
|
|
228
|
-
<div
|
|
231
|
+
<div
|
|
232
|
+
style={{
|
|
233
|
+
padding: "12px 12px 8px 12px",
|
|
234
|
+
marginTop:
|
|
235
|
+
serviceItem?.is_direct_trip && showTopLabel && isConexion
|
|
236
|
+
? " 10px"
|
|
237
|
+
: "",
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
229
240
|
{/* Header with operator info and favorite */}
|
|
230
241
|
<div className="flex justify-between items-center mb-[10px]">
|
|
231
242
|
<div
|
package/src/ui/OfferBanner.tsx
CHANGED
|
@@ -38,7 +38,7 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
38
38
|
}) => {
|
|
39
39
|
return (
|
|
40
40
|
<div
|
|
41
|
-
className="text-white p-[
|
|
41
|
+
className="text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[44px] pt-[50px] rounded-b-[14px] text-[14px] mt-[10px]"
|
|
42
42
|
style={{
|
|
43
43
|
background:
|
|
44
44
|
serviceItem?.offer_text && !isNewUiEnabled
|
|
@@ -190,7 +190,10 @@ function SeatSection({
|
|
|
190
190
|
? removeDuplicateSeats && isPeru
|
|
191
191
|
? CommonService.truncateSeatLabel(val.label)
|
|
192
192
|
: isTrain
|
|
193
|
-
? CommonService.truncateSeatLabel(
|
|
193
|
+
? CommonService.truncateSeatLabel(
|
|
194
|
+
CommonService.capitalize(String(val.label)),
|
|
195
|
+
8,
|
|
196
|
+
)
|
|
194
197
|
: val.label
|
|
195
198
|
: null}
|
|
196
199
|
</span>
|
|
@@ -4,7 +4,7 @@ interface ServiceBadgesProps {
|
|
|
4
4
|
showTopLabel?: string;
|
|
5
5
|
isSoldOut: boolean;
|
|
6
6
|
colors: any;
|
|
7
|
-
renderIcon: (iconKey: string, size?: string) => React.ReactNode;
|
|
7
|
+
renderIcon: (iconKey: string, size?: string, styles?: any) => React.ReactNode;
|
|
8
8
|
translation?: {
|
|
9
9
|
directService?: string;
|
|
10
10
|
};
|
|
@@ -36,9 +36,11 @@ const ServiceBadges: React.FC<ServiceBadgesProps> = ({
|
|
|
36
36
|
color: isSoldOut ? "#ccc" : colors.topLabelColor,
|
|
37
37
|
}}
|
|
38
38
|
>
|
|
39
|
-
<div className={isSoldOut ? "grayscale" : ""}>
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
{/* <div className={isSoldOut ? "grayscale" : ""}> */}
|
|
40
|
+
{renderIcon("specialDeparture", "12px", {
|
|
41
|
+
filter: isSoldOut ? "grayscale(0.5)" : "",
|
|
42
|
+
})}
|
|
43
|
+
{/* </div> */}
|
|
42
44
|
<div>{showTopLabel}</div>
|
|
43
45
|
</div>
|
|
44
46
|
)}
|
|
@@ -73,7 +73,10 @@ const SeatRow: React.FC<SeatRowProps> = ({
|
|
|
73
73
|
style={{ color: labelColor }}
|
|
74
74
|
>
|
|
75
75
|
{isTrain
|
|
76
|
-
? commonService.truncateSeatLabel(
|
|
76
|
+
? commonService.truncateSeatLabel(
|
|
77
|
+
commonService.capitalize(displayLabel),
|
|
78
|
+
8,
|
|
79
|
+
)
|
|
77
80
|
: displayLabel}
|
|
78
81
|
</span>
|
|
79
82
|
<span
|
|
@@ -4,7 +4,7 @@ interface ServiceBadgesMobileProps {
|
|
|
4
4
|
showTopLabel?: string;
|
|
5
5
|
isSoldOut: boolean;
|
|
6
6
|
colors: any;
|
|
7
|
-
renderIcon: (iconKey: string, size?: string) => React.ReactNode;
|
|
7
|
+
renderIcon: (iconKey: string, size?: string, styles?: any) => React.ReactNode;
|
|
8
8
|
translation?: {
|
|
9
9
|
directService?: string;
|
|
10
10
|
};
|
|
@@ -24,10 +24,10 @@ const ServiceBadgesMobile: React.FC<ServiceBadgesMobileProps> = ({
|
|
|
24
24
|
isConexion,
|
|
25
25
|
}) => {
|
|
26
26
|
return (
|
|
27
|
-
<div className="absolute -top-[
|
|
27
|
+
<div className="absolute -top-[12px] left-0 w-full flex items-center justify-end gap-[12px] pr-[17px] z-10">
|
|
28
28
|
{showTopLabel && (
|
|
29
29
|
<div
|
|
30
|
-
className={`flex items-center gap-[
|
|
30
|
+
className={`flex items-center gap-[2p x] py-[4px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20`}
|
|
31
31
|
style={{
|
|
32
32
|
backgroundColor: "#fff",
|
|
33
33
|
border: isSoldOut
|
|
@@ -36,8 +36,11 @@ const ServiceBadgesMobile: React.FC<ServiceBadgesMobileProps> = ({
|
|
|
36
36
|
color: isSoldOut ? "#ccc" : colors.topLabelColor,
|
|
37
37
|
}}
|
|
38
38
|
>
|
|
39
|
-
<div
|
|
40
|
-
{
|
|
39
|
+
<div
|
|
40
|
+
className={isSoldOut ? "grayscale" : ""}
|
|
41
|
+
style={{ marginTop: "1px" }}
|
|
42
|
+
>
|
|
43
|
+
{renderIcon("specialDeparture", "12px", { marginTop: "1px" })}
|
|
41
44
|
</div>
|
|
42
45
|
<div
|
|
43
46
|
style={{
|