kupos-ui-components-lib 9.7.4 → 9.7.6
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 +0 -3
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +2 -15
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +7 -16
- package/dist/components/ServiceItem/mobileTypes.d.ts +3 -28
- package/dist/components/ServiceItem/types.d.ts +0 -18
- package/dist/styles.css +9 -165
- package/dist/types.d.ts +3 -0
- package/dist/ui/BottomAmenities/BottomAmenities.js +1 -1
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +7 -14
- package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +101 -31
- package/dist/ui/SeatSection/SeatSection.js +1 -1
- package/dist/ui/mobileweb/ExpandedDropdownMobile.js +6 -15
- package/dist/utils/CommonService.js +1 -11
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +0 -3
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +0 -42
- package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -332
- package/src/components/ServiceItem/mobileTypes.ts +4 -24
- package/src/components/ServiceItem/types.ts +0 -19
- package/src/types.ts +3 -0
- package/src/ui/BottomAmenities/BottomAmenities.tsx +1 -1
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +12 -26
- package/src/ui/SeatSection/SeatSection.tsx +1 -1
- package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +14 -34
- package/src/utils/CommonService.ts +1 -13
- package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
- package/src/assets/images/anims/service_list/users_anim.json +0 -1
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -1021
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -480
package/dist/types.d.ts
CHANGED
|
@@ -109,6 +109,9 @@ export interface ServiceItemProps {
|
|
|
109
109
|
specialDeparture?: string;
|
|
110
110
|
fireIcon?: string;
|
|
111
111
|
cancelTicketIcon?: string;
|
|
112
|
+
changeTicketIcon?: string;
|
|
113
|
+
petFriendlyIcon?: string;
|
|
114
|
+
womenSeatIcon?: string;
|
|
112
115
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
113
116
|
};
|
|
114
117
|
useLottieFor?: string[];
|
|
@@ -12,7 +12,7 @@ function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, i
|
|
|
12
12
|
return (React.createElement("div", { className: "flex items-center mt-[15px] border-t border-[#eee] pt-[6px]" },
|
|
13
13
|
React.createElement("div", { className: "grid items-center gap-[2%] flex-1 ", style: {
|
|
14
14
|
// gridTemplateColumns: " 28% 21% 23% 23%",
|
|
15
|
-
gridTemplateColumns: "
|
|
15
|
+
gridTemplateColumns: "25.3% 17% 23% 23%",
|
|
16
16
|
} }, otherItems.map((item) => (React.createElement("div", { key: item.key, className: "flex items-center" }, item.render)))),
|
|
17
17
|
React.createElement("div", { className: "flex items-center justify-end shrink-0 ml-[5px] w-[150px]" },
|
|
18
18
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: grayscaleClass + " mr-[10px]" },
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
2
|
function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAnimationIcon, isChangeTicket = false, isSoldOut, ladiesBookedSeats, isDpEnabled, renderIcon, }) {
|
|
4
3
|
const hasPetInfo = serviceItem.pet_seat_info &&
|
|
5
4
|
Object.keys(serviceItem.pet_seat_info).length > 0;
|
|
@@ -9,9 +8,7 @@ function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAn
|
|
|
9
8
|
} },
|
|
10
9
|
React.createElement("div", { className: "flex flex-col gap-[6px] text-[13px] text-[#464647]", style: { lineHeight: 1.5, opacity: isSoldOut ? 0.5 : 1 } },
|
|
11
10
|
isPeru ? null : isChangeTicket ? (React.createElement("div", { className: "flex gap-[8px]", style: { lineHeight: 1.5 } },
|
|
12
|
-
React.createElement("span",
|
|
13
|
-
" ",
|
|
14
|
-
React.createElement(LottiePlayer, { animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" })),
|
|
11
|
+
React.createElement("span", null, renderIcon("changeTicketIcon", "16px")),
|
|
15
12
|
React.createElement("span", null,
|
|
16
13
|
React.createElement("span", { className: "bold-text" }, "Pasaje flexible:"),
|
|
17
14
|
" Tu pasaje puede ser cambiado de manera online",
|
|
@@ -22,28 +19,24 @@ function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAn
|
|
|
22
19
|
" horas antes"),
|
|
23
20
|
" ",
|
|
24
21
|
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay."))) : (React.createElement("div", { className: "flex gap-[8px] text-[13.33px]" },
|
|
25
|
-
React.createElement("span",
|
|
26
|
-
" ",
|
|
27
|
-
React.createElement(LottiePlayer, { animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" })),
|
|
22
|
+
React.createElement("span", null, renderIcon("changeTicketIcon", "16px")),
|
|
28
23
|
React.createElement("span", null,
|
|
29
24
|
React.createElement("span", null,
|
|
30
25
|
React.createElement("span", { className: "bold-text" }, "Pasaje flexible:"),
|
|
31
26
|
" Esta empresa no permite cambios de pasajes.")))),
|
|
32
27
|
hasPetInfo && (React.createElement("div", { className: "flex items-center gap-[10px]" },
|
|
33
|
-
React.createElement(
|
|
28
|
+
React.createElement("span", null, renderIcon("petFriendlyIcon", "16px")),
|
|
34
29
|
React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
|
|
35
30
|
React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly)))),
|
|
36
31
|
ladiesBookedSeats &&
|
|
37
32
|
String(ladiesBookedSeats).trim() !== "" &&
|
|
38
|
-
isDpEnabled === true && (React.createElement("div", { className: "flex gap-[6px]
|
|
39
|
-
React.createElement("span",
|
|
40
|
-
|
|
41
|
-
React.createElement(LottiePlayer, { animationData: getAnimationIcon("femaaleAnimation"), width: "20px", height: "20px" })),
|
|
42
|
-
React.createElement("span", null,
|
|
33
|
+
isDpEnabled === true && (React.createElement("div", { className: "flex gap-[6px]" },
|
|
34
|
+
React.createElement("span", null, renderIcon("womenSeatIcon", "16px")),
|
|
35
|
+
React.createElement("span", { className: "ml-[2px] mb-[3px]" },
|
|
43
36
|
React.createElement("span", { className: "bold-text" }, "Asientos para damas:"),
|
|
44
37
|
" Esta empresa cuenta con asientos recomendados para mujeres."))),
|
|
45
38
|
React.createElement("div", { className: "flex gap-[8px] text-[13.33px]" },
|
|
46
|
-
React.createElement("span", null, renderIcon("cancelTicketIcon", "
|
|
39
|
+
React.createElement("span", null, renderIcon("cancelTicketIcon", "16px")),
|
|
47
40
|
React.createElement("span", null,
|
|
48
41
|
React.createElement("span", { className: "bold-text" }, "Pol\u00EDticas de anulaci\u00F3n:"),
|
|
49
42
|
" Tu pasaje puede ser anulado de forma online",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
3
|
import commonService from "../../utils/CommonService";
|
|
4
|
+
const TIME_SLOTS = [
|
|
5
|
+
"Entre 07:00 AM y 10:00 AM",
|
|
6
|
+
"Entre 11:00 AM y 14:00 AM",
|
|
7
|
+
"Entre 15:00 PM y 18:00 PM",
|
|
8
|
+
"Entre 19:00 PM y 22:00 PM",
|
|
9
|
+
];
|
|
4
10
|
const HARDCODED_OPERATORS = [
|
|
5
11
|
{
|
|
6
12
|
logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
|
|
@@ -22,7 +28,7 @@ const HARDCODED_OPERATORS = [
|
|
|
22
28
|
},
|
|
23
29
|
];
|
|
24
30
|
const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity = 1, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, }) => {
|
|
25
|
-
var _a, _b, _c, _d
|
|
31
|
+
var _a, _b, _c, _d;
|
|
26
32
|
const operators = ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operators) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
27
33
|
? serviceItem.operators
|
|
28
34
|
: HARDCODED_OPERATORS;
|
|
@@ -73,25 +79,15 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
73
79
|
showTopLabel
|
|
74
80
|
? "mt-[24px]"
|
|
75
81
|
: "mt-[20px]"}` },
|
|
76
|
-
React.createElement("div", {
|
|
77
|
-
|
|
82
|
+
React.createElement("div", {
|
|
83
|
+
// className="shadow-service"
|
|
84
|
+
style: {
|
|
85
|
+
border: "1px solid #c0c0c0",
|
|
78
86
|
padding: "12px",
|
|
79
87
|
borderRadius: "14px",
|
|
80
88
|
} },
|
|
81
89
|
React.createElement("div", { className: "flex flex-col items-center px-[12px] pb-[8px] text-[13.33px] gap-[8px]" },
|
|
82
|
-
React.createElement("div",
|
|
83
|
-
React.createElement("span", { className: "flex items-center" },
|
|
84
|
-
React.createElement("img", { src: (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.fireIcon, alt: "fire", className: "h-[14px] w-[14px] mr-[4px]" }),
|
|
85
|
-
React.createElement("span", { className: "bold-text" }, "Remate"),
|
|
86
|
-
" t\u00E9rmina en",
|
|
87
|
-
" ",
|
|
88
|
-
React.createElement("span", { className: "bold-text text-end", ref: (node) => commonService.startCountdown(node, 599), style: {
|
|
89
|
-
fontVariantNumeric: "tabular-nums",
|
|
90
|
-
display: "inline-block",
|
|
91
|
-
color: "#FF5C60",
|
|
92
|
-
minWidth: "40px",
|
|
93
|
-
} }))),
|
|
94
|
-
React.createElement("div", { className: "flex items-center gap-[10px]" },
|
|
90
|
+
React.createElement("div", { className: "flex items-center gap-[10px] mt-[10px]" },
|
|
95
91
|
React.createElement("span", null, "Salida flexible"),
|
|
96
92
|
React.createElement("div", { className: "bold-text font-[9px]", style: {
|
|
97
93
|
backgroundColor: "#FF5C60",
|
|
@@ -107,10 +103,10 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
107
103
|
React.createElement("div", { className: " text-[white]" },
|
|
108
104
|
React.createElement("div", { className: "flex flex-col gap-[10px] relative" },
|
|
109
105
|
React.createElement("div", { className: "flex items-center gap-[6px]" },
|
|
110
|
-
React.createElement("img", { src: (
|
|
106
|
+
React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.whiteOrigin, alt: "origin", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}` }),
|
|
111
107
|
React.createElement("span", { className: "text-[13px] bold-text" }, cityOrigin === null || cityOrigin === void 0 ? void 0 :
|
|
112
108
|
cityOrigin.label.split(",")[0],
|
|
113
|
-
React.createElement("span", { className: "mx-[
|
|
109
|
+
React.createElement("span", { className: "mx-[10px]" }, "\u2192"), cityDestination === null || cityDestination === void 0 ? void 0 :
|
|
114
110
|
cityDestination.label.split(",")[0])),
|
|
115
111
|
React.createElement("div", { style: {
|
|
116
112
|
width: "1px",
|
|
@@ -123,11 +119,72 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
123
119
|
left: "7px",
|
|
124
120
|
} }),
|
|
125
121
|
React.createElement("div", { className: "flex items-center gap-[6px]" },
|
|
126
|
-
React.createElement("img", { src: (
|
|
127
|
-
React.createElement("
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
React.createElement("img", { src: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.whiteDestination, alt: "destination", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
|
|
123
|
+
React.createElement("details", { className: "kupos-time-dd relative" },
|
|
124
|
+
React.createElement("summary", { className: "flex items-center gap-[6px] bold-text text-[13px] text-white", style: { cursor: "pointer", userSelect: "none" } },
|
|
125
|
+
React.createElement("span", { "data-time-label": "true" }, TIME_SLOTS[0]),
|
|
126
|
+
React.createElement("svg", { className: "kupos-time-chevron", width: "10", height: "6", viewBox: "0 0 10 6", fill: "none" },
|
|
127
|
+
React.createElement("path", { d: "M1 1l4 4 4-4", stroke: "#fff", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }))),
|
|
128
|
+
React.createElement("div", { className: "absolute left-0 top-[calc(100%+10px)]", style: {
|
|
129
|
+
zIndex: 20,
|
|
130
|
+
backgroundColor: "#fff",
|
|
131
|
+
borderRadius: "14px",
|
|
132
|
+
minWidth: "248px",
|
|
133
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.28)",
|
|
134
|
+
overflow: "hidden",
|
|
135
|
+
padding: "6px 0",
|
|
136
|
+
} }, TIME_SLOTS.map((slot, index) => {
|
|
137
|
+
const isFirst = index === 0;
|
|
138
|
+
return (React.createElement("button", { key: slot, type: "button", "data-time-option": "true", "data-time-slot": slot, onClick: (e) => {
|
|
139
|
+
const details = e.currentTarget.closest("details");
|
|
140
|
+
if (details) {
|
|
141
|
+
const label = details.querySelector("[data-time-label]");
|
|
142
|
+
if (label)
|
|
143
|
+
label.textContent = slot;
|
|
144
|
+
details
|
|
145
|
+
.querySelectorAll("[data-time-option]")
|
|
146
|
+
.forEach((btn) => {
|
|
147
|
+
const el = btn;
|
|
148
|
+
const active = el.dataset.timeSlot === slot;
|
|
149
|
+
el.style.background = active
|
|
150
|
+
? "#4169E1"
|
|
151
|
+
: "transparent";
|
|
152
|
+
el.style.color = active
|
|
153
|
+
? "#fff"
|
|
154
|
+
: "#1a1a1a";
|
|
155
|
+
const ck = el.querySelector("[data-checkmark]");
|
|
156
|
+
if (ck)
|
|
157
|
+
ck.style.display = active
|
|
158
|
+
? "flex"
|
|
159
|
+
: "none";
|
|
160
|
+
const lbl = el.querySelector("[data-slot-label]");
|
|
161
|
+
if (lbl)
|
|
162
|
+
lbl.style.fontWeight = active
|
|
163
|
+
? "bold"
|
|
164
|
+
: "normal";
|
|
165
|
+
});
|
|
166
|
+
details.open = false;
|
|
167
|
+
}
|
|
168
|
+
}, className: "flex w-full items-center gap-[10px] px-[16px] py-[13px] text-[13px]", style: {
|
|
169
|
+
background: isFirst ? "#4169E1" : "transparent",
|
|
170
|
+
border: "none",
|
|
171
|
+
cursor: "pointer",
|
|
172
|
+
textAlign: "left",
|
|
173
|
+
color: isFirst ? "#fff" : "#1a1a1a",
|
|
174
|
+
} },
|
|
175
|
+
React.createElement("div", { "data-checkmark": "true", style: {
|
|
176
|
+
width: "16px",
|
|
177
|
+
flexShrink: 0,
|
|
178
|
+
display: isFirst ? "flex" : "none",
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
justifyContent: "center",
|
|
181
|
+
} },
|
|
182
|
+
React.createElement("svg", { width: "14", height: "11", viewBox: "0 0 14 11", fill: "none" },
|
|
183
|
+
React.createElement("path", { d: "M1 5.5l3.5 4L13 1", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }))),
|
|
184
|
+
React.createElement("span", { "data-slot-label": "true", style: {
|
|
185
|
+
fontWeight: isFirst ? "bold" : "normal",
|
|
186
|
+
} }, slot)));
|
|
187
|
+
})))))),
|
|
131
188
|
React.createElement("div", { className: "border-t border-[#363c48] my-[8px]" }),
|
|
132
189
|
React.createElement("div", null,
|
|
133
190
|
React.createElement("span", { className: "text-[15px] bold-text text-[white] flex items-center justify-center mb-[10px]" }, "3 operadores compitiendo por tu compra"),
|
|
@@ -176,7 +233,7 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
176
233
|
React.createElement("button", { type: "button", "aria-label": "Disminuir pasajes", disabled: !canDecreaseTicketQuantity, onClick: () => onDecreaseTicketQuantity === null || onDecreaseTicketQuantity === void 0 ? void 0 : onDecreaseTicketQuantity(serviceItem), className: `flex h-[34px] w-[34px] items-center justify-center rounded-full border-none text-[25px] leading-none text-[white] ${canDecreaseTicketQuantity
|
|
177
234
|
? "cursor-pointer bg-[#2d374d]"
|
|
178
235
|
: "cursor-not-allowed bg-[#222b3d] opacity-50"}` }, "-"),
|
|
179
|
-
React.createElement("span", { className: "bold-text text-[20px] text-white" }, ticketQuantity),
|
|
236
|
+
React.createElement("span", { className: "bold-text text-[20px] text-[white]" }, ticketQuantity),
|
|
180
237
|
React.createElement("button", { type: "button", "aria-label": "Aumentar pasajes", onClick: () => onIncreaseTicketQuantity === null || onIncreaseTicketQuantity === void 0 ? void 0 : onIncreaseTicketQuantity(serviceItem), className: "flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full border-none bg-[#2d374d] text-[25px] leading-none text-[white]" }, "+"))),
|
|
181
238
|
React.createElement("div", { className: "mt-[10px] flex justify-between items-center rounded-[14px]", style: {
|
|
182
239
|
// height: "80px",
|
|
@@ -198,11 +255,10 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
198
255
|
transformOrigin: "center",
|
|
199
256
|
} })),
|
|
200
257
|
React.createElement("span", { className: "text-[white] bold-text text-[28px] leading-none mt-[4px]" }, `$${(4000 * ticketQuantity).toLocaleString()}`)),
|
|
201
|
-
React.createElement("
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
} }, "60% OFF"))),
|
|
258
|
+
React.createElement("span", { className: "text-[#FF8F45] bold-text text-[26px] leading-tight", style: {
|
|
259
|
+
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
260
|
+
whiteSpace: "nowrap",
|
|
261
|
+
} }, "60% OFF")),
|
|
206
262
|
React.createElement("button", { type: "button", onClick: onBookButtonPress, className: "flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-[white] bold-text text-[13px] mt-[10px] justify-center border-none cursor-pointer", style: {
|
|
207
263
|
backgroundColor: "#FF5C60",
|
|
208
264
|
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
@@ -212,7 +268,7 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
212
268
|
React.createElement(LottiePlayer, { animationData: serviceItem.icons.thunderAnim, width: "18px", height: "18px" }),
|
|
213
269
|
React.createElement("span", { className: "whitespace-nowrap" }, "\u00A1Lo quiero!")),
|
|
214
270
|
React.createElement("div", { className: `flex justify-end mt-[10px] transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`, onClick: onToggleExpand },
|
|
215
|
-
React.createElement("img", { src: (
|
|
271
|
+
React.createElement("img", { src: (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.downArrow, alt: "down arrow", style: {
|
|
216
272
|
width: "14px",
|
|
217
273
|
height: "8px",
|
|
218
274
|
filter: "brightness(0) invert(1)",
|
|
@@ -241,6 +297,20 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
241
297
|
// {step.text}
|
|
242
298
|
// </span>
|
|
243
299
|
// </div>
|
|
244
|
-
)))))))
|
|
300
|
+
))))))),
|
|
301
|
+
React.createElement("div", { className: "absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 " },
|
|
302
|
+
React.createElement("div", { className: "flex items-center gap-[6px] py-[5px] px-[14px] rounded-[38px] text-[12.5px] bg-[#FF8F45] text-white whitespace-nowrap" },
|
|
303
|
+
React.createElement("span", { className: "flex items-center" },
|
|
304
|
+
React.createElement(LottiePlayer, { animationData: serviceItem.icons.bombAnim, width: "14px", height: "14px" }),
|
|
305
|
+
React.createElement("span", { className: "bold-text ml-[5px] text-[white]" }, "Remate\u00A0"),
|
|
306
|
+
" ",
|
|
307
|
+
React.createElement("span", { className: "text-[white]" }, "t\u00E9rmina en"),
|
|
308
|
+
" ",
|
|
309
|
+
React.createElement("span", { className: "bold-text text-end", ref: (node) => commonService.startCountdown(node, 599), style: {
|
|
310
|
+
fontVariantNumeric: "tabular-nums",
|
|
311
|
+
display: "inline-block",
|
|
312
|
+
color: "#fff",
|
|
313
|
+
minWidth: "40px",
|
|
314
|
+
} }))))));
|
|
245
315
|
};
|
|
246
316
|
export default FeatureServiceUiMobile;
|
|
@@ -184,7 +184,7 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
|
|
|
184
184
|
React.createElement("span", { className: "text-[13.33px] font-normal leading-[24px] text-[#464647]" }, "Desde")),
|
|
185
185
|
React.createElement("div", null,
|
|
186
186
|
React.createElement("div", { className: "relative" },
|
|
187
|
-
React.createElement("div", { className: "absolute -left-[20px]
|
|
187
|
+
React.createElement("div", { className: "absolute -left-[20px] transform -translate-y-1/2 top-[16px]" }, renderIcon("fireIcon", "16px")),
|
|
188
188
|
React.createElement("div", { className: "absolute bottom-[35px] left-1/2 -translate-x-1/2 ", style: {
|
|
189
189
|
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
190
190
|
whiteSpace: "nowrap",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
2
|
function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyAnim, isSoldOut, isChangeTicket = false, ladiesBookedSeats, isDpEnabled, femaleAnim, flexibleAnim, renderIcon, }) {
|
|
4
3
|
return (React.createElement("div", { className: "px-[12px] pt-[22px] pb-[12px] relative -z-9", style: {
|
|
5
4
|
backgroundColor: "#ffefef",
|
|
@@ -8,10 +7,7 @@ function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyA
|
|
|
8
7
|
} },
|
|
9
8
|
React.createElement("div", { className: "flex flex-col gap-[8px] text-[11px] min-[420px]:text-[12px] text-[#464647]", style: { lineHeight: 1.6 } },
|
|
10
9
|
isPeru ? null : isChangeTicket ? (React.createElement("div", { className: "flex gap-[6px]" },
|
|
11
|
-
React.createElement("span", {
|
|
12
|
-
" ",
|
|
13
|
-
React.createElement("div", null,
|
|
14
|
-
React.createElement(LottiePlayer, { animationData: flexibleAnim, width: "16px", height: "16px" }))),
|
|
10
|
+
React.createElement("span", { className: "mt-[3px]" }, renderIcon("changeTicketIcon", "14px")),
|
|
15
11
|
React.createElement("span", null,
|
|
16
12
|
React.createElement("span", { className: "bold-text" }, "Pasaje flexible:"),
|
|
17
13
|
" Tu pasaje puede ser cambiado de manera online",
|
|
@@ -22,10 +18,7 @@ function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyA
|
|
|
22
18
|
" horas antes"),
|
|
23
19
|
" ",
|
|
24
20
|
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera kupospay."))) : (React.createElement("div", { className: "flex gap-[8px] " },
|
|
25
|
-
React.createElement("span", {
|
|
26
|
-
" ",
|
|
27
|
-
React.createElement("div", null,
|
|
28
|
-
React.createElement(LottiePlayer, { animationData: flexibleAnim, width: "16px", height: "16px" }))),
|
|
21
|
+
React.createElement("span", { className: "mt-[3px]" }, renderIcon("changeTicketIcon", "14px")),
|
|
29
22
|
React.createElement("span", null,
|
|
30
23
|
React.createElement("span", null,
|
|
31
24
|
React.createElement("span", { className: "bold-text" }, "Pasaje flexible:"),
|
|
@@ -33,10 +26,9 @@ function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyA
|
|
|
33
26
|
ladiesBookedSeats &&
|
|
34
27
|
String(ladiesBookedSeats).trim() !== "" &&
|
|
35
28
|
isDpEnabled === true && (React.createElement("div", { className: "flex gap-[6px]" },
|
|
36
|
-
React.createElement("span", {
|
|
29
|
+
React.createElement("span", { className: "mt-[3px]" },
|
|
37
30
|
" ",
|
|
38
|
-
|
|
39
|
-
React.createElement(LottiePlayer, { animationData: femaleAnim, width: "16px", height: "16px" }))),
|
|
31
|
+
renderIcon("womenSeatIcon", "14px")),
|
|
40
32
|
React.createElement("span", null,
|
|
41
33
|
React.createElement("span", { className: "bold-text" }, "Asientos para damas:"),
|
|
42
34
|
" Esta empresa cuenta con asientos recomendados para mujeres."))),
|
|
@@ -44,15 +36,14 @@ function ExpandedDropdownMobile({ serviceItem, isPeru, petSeatInfo, petFriendlyA
|
|
|
44
36
|
React.createElement("div", { className: `relative group cursor-default ` },
|
|
45
37
|
React.createElement("div", { className: "flex items-center" },
|
|
46
38
|
React.createElement("div", { className: `flex items-justify gap-[6px] mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
|
|
47
|
-
React.createElement("
|
|
48
|
-
React.createElement(LottiePlayer, { animationData: petFriendlyAnim, width: "16px", height: "16px" })),
|
|
39
|
+
React.createElement("span", { className: "mt-[3px]" }, renderIcon("petFriendlyIcon", "14px")),
|
|
49
40
|
React.createElement("div", null,
|
|
50
41
|
React.createElement("span", null, "Servicio Pet friendly"),
|
|
51
42
|
React.createElement("span", null,
|
|
52
43
|
" ",
|
|
53
44
|
"Asientos designados Pet friendly, lo que significa que puede viajar con su mascota a bordo."))))))) : null,
|
|
54
45
|
React.createElement("div", { className: "flex gap-[6px]" },
|
|
55
|
-
React.createElement("span",
|
|
46
|
+
React.createElement("span", { className: "mt-[3px]" }, renderIcon("cancelTicketIcon", "14px")),
|
|
56
47
|
React.createElement("span", null,
|
|
57
48
|
React.createElement("span", { className: "bold-text" }, "Pol\u00EDticas de anulaci\u00F3n:"),
|
|
58
49
|
" Tu pasaje puede ser anulado de forma online",
|
|
@@ -296,14 +296,10 @@ const commonService = {
|
|
|
296
296
|
startViewerCount: (node, viewersConfig) => {
|
|
297
297
|
if (!node || !viewersConfig)
|
|
298
298
|
return;
|
|
299
|
-
const { min, max, interval = 5000 } = viewersConfig;
|
|
300
|
-
const configKey = `${min}-${max}-${interval}`;
|
|
301
|
-
if (node.dataset.viewerId && node.dataset.viewerConfig === configKey) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
299
|
const prevId = node.dataset.viewerId;
|
|
305
300
|
if (prevId)
|
|
306
301
|
clearInterval(Number(prevId));
|
|
302
|
+
const { min, max, interval = 5000 } = viewersConfig;
|
|
307
303
|
const clamp = (v) => Math.min(max, Math.max(min, v));
|
|
308
304
|
const initialValue = Math.floor(Math.random() * (max - min + 1)) + min;
|
|
309
305
|
node.textContent = String(initialValue);
|
|
@@ -314,7 +310,6 @@ const commonService = {
|
|
|
314
310
|
node.textContent = String(clamp(Math.round(next)));
|
|
315
311
|
}, interval);
|
|
316
312
|
node.dataset.viewerId = String(id);
|
|
317
|
-
node.dataset.viewerConfig = configKey;
|
|
318
313
|
},
|
|
319
314
|
startCountdown: (node, countdownSeconds = 599) => {
|
|
320
315
|
if (!node)
|
|
@@ -344,10 +339,6 @@ const commonService = {
|
|
|
344
339
|
startComprandoCount: (node, min = 4, max = 16) => {
|
|
345
340
|
if (!node)
|
|
346
341
|
return;
|
|
347
|
-
const configKey = `${min}-${max}`;
|
|
348
|
-
if (node.dataset.comprandoId && node.dataset.comprandoConfig === configKey) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
342
|
const prevId = node.dataset.comprandoId;
|
|
352
343
|
if (prevId)
|
|
353
344
|
clearInterval(Number(prevId));
|
|
@@ -364,7 +355,6 @@ const commonService = {
|
|
|
364
355
|
node.textContent = String(next);
|
|
365
356
|
}, 5000); // Update every 5 seconds
|
|
366
357
|
node.dataset.comprandoId = String(id);
|
|
367
|
-
node.dataset.comprandoConfig = configKey;
|
|
368
358
|
},
|
|
369
359
|
};
|
|
370
360
|
export default commonService;
|
package/package.json
CHANGED
package/src/KuposUIComponent.tsx
CHANGED
|
@@ -32,9 +32,6 @@ interface KuposUIComponentProps {
|
|
|
32
32
|
orignLabel?: string;
|
|
33
33
|
destinationLabel?: string;
|
|
34
34
|
t?: (key: string) => string;
|
|
35
|
-
ticketQuantity?: number;
|
|
36
|
-
onIncreaseTicketQuantity?: (serviceItem: any) => void;
|
|
37
|
-
onDecreaseTicketQuantity?: (serviceItem: any) => void;
|
|
38
35
|
|
|
39
36
|
// New ServiceItem props
|
|
40
37
|
id?: string;
|
|
@@ -27,7 +27,6 @@ import bombAnimation from "../../assets/images/anims/service_list/bomb.json";
|
|
|
27
27
|
import dotAnimation from "../../assets/images/anims/service_list/dot_animation.json";
|
|
28
28
|
import starAnimation from "../../assets/images/anims/service_list/star_anim.json";
|
|
29
29
|
import femaleAnimation from "../../assets/images/anims/service_list/female_anim.json";
|
|
30
|
-
import usersAnimation from "../../assets/images/anims/service_list/users_anim.json";
|
|
31
30
|
|
|
32
31
|
import RatingBlock from "../../ui/RatingBlock";
|
|
33
32
|
import DurationBlock from "../../ui/DurationBlock";
|
|
@@ -38,9 +37,6 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
|
38
37
|
import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
|
|
39
38
|
import SeatSection from "../../ui/SeatSection/SeatSection";
|
|
40
39
|
import DateTimeSection from "../../ui/DateTimeSection/DateTimeSection";
|
|
41
|
-
import FeatureServiceUi from "../../ui/FeatureServiceUI/FeatureServiceUi";
|
|
42
|
-
|
|
43
|
-
import thunderAnimation from "../../assets/images/anims/service_list/thunder_icon.json";
|
|
44
40
|
import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
|
|
45
41
|
|
|
46
42
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
@@ -75,9 +71,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
75
71
|
bombAnimation: {
|
|
76
72
|
kupos: bombAnimation,
|
|
77
73
|
},
|
|
78
|
-
thunderAnimation: {
|
|
79
|
-
kupos: thunderAnimation,
|
|
80
|
-
},
|
|
81
74
|
dotAnimation: {
|
|
82
75
|
kupos: dotAnimation,
|
|
83
76
|
},
|
|
@@ -87,9 +80,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
87
80
|
femaaleAnimation: {
|
|
88
81
|
kupos: femaleAnimation,
|
|
89
82
|
},
|
|
90
|
-
usersAnimation: {
|
|
91
|
-
kupos: usersAnimation,
|
|
92
|
-
},
|
|
93
83
|
};
|
|
94
84
|
|
|
95
85
|
function ServiceItemPB({
|
|
@@ -123,16 +113,9 @@ function ServiceItemPB({
|
|
|
123
113
|
setIsExpand,
|
|
124
114
|
coachKey,
|
|
125
115
|
viewersConfig,
|
|
126
|
-
isNewUi,
|
|
127
116
|
showLoginModal,
|
|
128
117
|
isLoggedIn,
|
|
129
118
|
showLoginOption,
|
|
130
|
-
isFeatureDropDownExpand,
|
|
131
|
-
setIsFeatureDropDownExpand,
|
|
132
|
-
ticketQuantity,
|
|
133
|
-
onIncreaseTicketQuantity,
|
|
134
|
-
onDecreaseTicketQuantity,
|
|
135
|
-
onRemateUiButtonClick,
|
|
136
119
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
137
120
|
const getAnimationIcon = (icon: string) => {
|
|
138
121
|
const animation = ANIMATION_MAP[icon];
|
|
@@ -432,31 +415,6 @@ function ServiceItemPB({
|
|
|
432
415
|
siteType={siteType}
|
|
433
416
|
isAllinBus={isAllinBus}
|
|
434
417
|
/>
|
|
435
|
-
) : isNewUi ? (
|
|
436
|
-
<FeatureServiceUi
|
|
437
|
-
serviceItem={serviceItem}
|
|
438
|
-
showTopLabel={showTopLabel}
|
|
439
|
-
isSoldOut={isSoldOut}
|
|
440
|
-
getAnimationIcon={getAnimationIcon}
|
|
441
|
-
cityOrigin={cityOrigin}
|
|
442
|
-
cityDestination={cityDestination}
|
|
443
|
-
renderIcon={renderIcon}
|
|
444
|
-
viewersConfig={viewersConfig}
|
|
445
|
-
isFeatureDropDownExpand={isFeatureDropDownExpand}
|
|
446
|
-
ticketQuantity={ticketQuantity}
|
|
447
|
-
onIncreaseTicketQuantity={onIncreaseTicketQuantity}
|
|
448
|
-
onDecreaseTicketQuantity={onDecreaseTicketQuantity}
|
|
449
|
-
onBookButtonPress={onRemateUiButtonClick}
|
|
450
|
-
onToggleExpand={() =>
|
|
451
|
-
setIsFeatureDropDownExpand &&
|
|
452
|
-
setIsFeatureDropDownExpand(
|
|
453
|
-
isFeatureDropDownExpand === serviceItem.id ||
|
|
454
|
-
isFeatureDropDownExpand === true
|
|
455
|
-
? null
|
|
456
|
-
: serviceItem.id,
|
|
457
|
-
)
|
|
458
|
-
}
|
|
459
|
-
/>
|
|
460
418
|
) : (
|
|
461
419
|
<div
|
|
462
420
|
className={`relative hover:z-[150] ${hasOfferText || hasDpEnabled ? "mb-[55px]" : "mb-[10px]"} ${
|