kupos-ui-components-lib 9.7.3 → 9.7.5
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 -27
- package/dist/components/ServiceItem/types.d.ts +0 -17
- package/dist/styles.css +6 -165
- package/dist/types.d.ts +3 -0
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +6 -13
- package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +98 -52
- package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +22 -24
- 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 -41
- package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -331
- package/src/components/ServiceItem/mobileTypes.ts +4 -23
- package/src/components/ServiceItem/types.ts +0 -18
- package/src/types.ts +3 -0
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +11 -25
- 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 -1042
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -477
|
@@ -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
33
|
isDpEnabled === true && (React.createElement("div", { className: "flex gap-[6px] items-center" },
|
|
39
|
-
React.createElement("span",
|
|
40
|
-
|
|
41
|
-
React.createElement(LottiePlayer, { animationData: getAnimationIcon("femaaleAnimation"), width: "20px", height: "20px" })),
|
|
42
|
-
React.createElement("span", null,
|
|
34
|
+
React.createElement("span", null, renderIcon("womenSeatIcon", "16px")),
|
|
35
|
+
React.createElement("span", { className: "ml-[2px]" },
|
|
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",
|
|
@@ -21,29 +27,6 @@ const HARDCODED_OPERATORS = [
|
|
|
21
27
|
seatsAvailable: "3 disponibles",
|
|
22
28
|
},
|
|
23
29
|
];
|
|
24
|
-
const HARDCODED_COUNTDOWN = "09:55";
|
|
25
|
-
const HOW_IT_WORKS_STEPS = [
|
|
26
|
-
{
|
|
27
|
-
icon: "flexible",
|
|
28
|
-
name: "1. Salida flexible",
|
|
29
|
-
text: "Viajas en un horario entre las 07:00 y las 10:00 AM del día elegido.",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
icon: "bus",
|
|
33
|
-
name: "2. Empresa asignada",
|
|
34
|
-
text: "Una de las empresas disponibles confirma tu viaje una vez pagado.",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
icon: "price",
|
|
38
|
-
name: "3. Precio garantizado",
|
|
39
|
-
text: "Al seleccionar este servicio aseguras el precio reducido.",
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
icon: "ticket",
|
|
43
|
-
name: "4. ¡Listo!",
|
|
44
|
-
text: "Recibe todos los detalles de tu viaje al instante tras la compra.",
|
|
45
|
-
},
|
|
46
|
-
];
|
|
47
30
|
const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity = 1, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, }) => {
|
|
48
31
|
var _a, _b, _c, _d;
|
|
49
32
|
const operators = ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operators) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
@@ -61,12 +44,12 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
61
44
|
{
|
|
62
45
|
icon: "bus",
|
|
63
46
|
name: "2. Empresa asignada",
|
|
64
|
-
text: "Una de las empresas
|
|
47
|
+
text: "Una de las empresas confirmará tu viaje al instante tras el pago.",
|
|
65
48
|
},
|
|
66
49
|
{
|
|
67
50
|
icon: "price",
|
|
68
51
|
name: "3. Precio garantizado",
|
|
69
|
-
text: "
|
|
52
|
+
text: "Mejor precio garantizado. Sin cambios ni cancelación.",
|
|
70
53
|
},
|
|
71
54
|
{
|
|
72
55
|
icon: "ticket",
|
|
@@ -96,26 +79,15 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
96
79
|
showTopLabel
|
|
97
80
|
? "mt-[24px]"
|
|
98
81
|
: "mt-[20px]"}` },
|
|
99
|
-
React.createElement("div", {
|
|
82
|
+
React.createElement("div", {
|
|
83
|
+
// className="shadow-service"
|
|
84
|
+
style: {
|
|
100
85
|
border: "1px solid #c0c0c0",
|
|
101
86
|
padding: "12px",
|
|
102
87
|
borderRadius: "14px",
|
|
103
88
|
} },
|
|
104
89
|
React.createElement("div", { className: "flex flex-col items-center px-[12px] pb-[8px] text-[13.33px] gap-[8px]" },
|
|
105
|
-
React.createElement("div",
|
|
106
|
-
React.createElement("span", null,
|
|
107
|
-
renderIcon("fireIcon", "14px"),
|
|
108
|
-
" ",
|
|
109
|
-
React.createElement("span", { className: "bold-text" }, "Remate"),
|
|
110
|
-
" t\u00E9rmina en",
|
|
111
|
-
" ",
|
|
112
|
-
React.createElement("span", { className: "bold-text text-end", ref: (node) => commonService.startCountdown(node, 599), style: {
|
|
113
|
-
fontVariantNumeric: "tabular-nums",
|
|
114
|
-
display: "inline-block",
|
|
115
|
-
color: "#FF5C60",
|
|
116
|
-
minWidth: "40px",
|
|
117
|
-
} }))),
|
|
118
|
-
React.createElement("div", { className: "flex items-center gap-[10px]" },
|
|
90
|
+
React.createElement("div", { className: "flex items-center gap-[10px] mt-[10px]" },
|
|
119
91
|
React.createElement("span", null, "Salida flexible"),
|
|
120
92
|
React.createElement("div", { className: "bold-text font-[9px]", style: {
|
|
121
93
|
backgroundColor: "#FF5C60",
|
|
@@ -134,7 +106,7 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
134
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" : ""}` }),
|
|
135
107
|
React.createElement("span", { className: "text-[13px] bold-text" }, cityOrigin === null || cityOrigin === void 0 ? void 0 :
|
|
136
108
|
cityOrigin.label.split(",")[0],
|
|
137
|
-
React.createElement("span", { className: "mx-[
|
|
109
|
+
React.createElement("span", { className: "mx-[10px]" }, "\u2192"), cityDestination === null || cityDestination === void 0 ? void 0 :
|
|
138
110
|
cityDestination.label.split(",")[0])),
|
|
139
111
|
React.createElement("div", { style: {
|
|
140
112
|
width: "1px",
|
|
@@ -148,10 +120,71 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
148
120
|
} }),
|
|
149
121
|
React.createElement("div", { className: "flex items-center gap-[6px]" },
|
|
150
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 } }),
|
|
151
|
-
React.createElement("
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
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
|
+
})))))),
|
|
155
188
|
React.createElement("div", { className: "border-t border-[#363c48] my-[8px]" }),
|
|
156
189
|
React.createElement("div", null,
|
|
157
190
|
React.createElement("span", { className: "text-[15px] bold-text text-[white] flex items-center justify-center mb-[10px]" }, "3 operadores compitiendo por tu compra"),
|
|
@@ -200,7 +233,7 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
200
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
|
|
201
234
|
? "cursor-pointer bg-[#2d374d]"
|
|
202
235
|
: "cursor-not-allowed bg-[#222b3d] opacity-50"}` }, "-"),
|
|
203
|
-
React.createElement("span", { className: "bold-text text-[20px] text-white" }, ticketQuantity),
|
|
236
|
+
React.createElement("span", { className: "bold-text text-[20px] text-[white]" }, ticketQuantity),
|
|
204
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]" }, "+"))),
|
|
205
238
|
React.createElement("div", { className: "mt-[10px] flex justify-between items-center rounded-[14px]", style: {
|
|
206
239
|
// height: "80px",
|
|
@@ -222,11 +255,10 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
222
255
|
transformOrigin: "center",
|
|
223
256
|
} })),
|
|
224
257
|
React.createElement("span", { className: "text-[white] bold-text text-[28px] leading-none mt-[4px]" }, `$${(4000 * ticketQuantity).toLocaleString()}`)),
|
|
225
|
-
React.createElement("
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} }, "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")),
|
|
230
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: {
|
|
231
263
|
backgroundColor: "#FF5C60",
|
|
232
264
|
animation: "pulse-zoom 2s ease-in-out infinite",
|
|
@@ -265,6 +297,20 @@ const FeatureServiceUiMobile = ({ serviceItem, showTopLabel, colors, isSoldOut,
|
|
|
265
297
|
// {step.text}
|
|
266
298
|
// </span>
|
|
267
299
|
// </div>
|
|
268
|
-
)))))))
|
|
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
|
+
} }))))));
|
|
269
315
|
};
|
|
270
316
|
export default FeatureServiceUiMobile;
|
|
@@ -22,7 +22,7 @@ const HARDCODED_OPERATORS = [
|
|
|
22
22
|
},
|
|
23
23
|
];
|
|
24
24
|
const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIcon, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity = 1, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, }) => {
|
|
25
|
-
var _a, _b, _c, _d;
|
|
25
|
+
var _a, _b, _c, _d, _e;
|
|
26
26
|
const operators = ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operators) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
27
27
|
? serviceItem.operators
|
|
28
28
|
: HARDCODED_OPERATORS;
|
|
@@ -38,12 +38,12 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
38
38
|
{
|
|
39
39
|
icon: "bus",
|
|
40
40
|
name: "2. Empresa asignada",
|
|
41
|
-
text: "Una de las empresas
|
|
41
|
+
text: "Una de las empresas confirmará tu viaje al instante tras el pago.",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
icon: "price",
|
|
45
45
|
name: "3. Precio garantizado",
|
|
46
|
-
text: "
|
|
46
|
+
text: "Mejor precio garantizado. Sin cambios ni cancelación.",
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
icon: "ticket",
|
|
@@ -73,8 +73,8 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
73
73
|
showTopLabel
|
|
74
74
|
? "mt-[24px]"
|
|
75
75
|
: "mt-[20px]"}` },
|
|
76
|
-
React.createElement("div", { className: "", style: {
|
|
77
|
-
border: "1px solid #c0c0c0",
|
|
76
|
+
React.createElement("div", { className: "shadow-service", style: {
|
|
77
|
+
// border: "1px solid #c0c0c0",
|
|
78
78
|
padding: "14px",
|
|
79
79
|
borderRadius: "14px",
|
|
80
80
|
} },
|
|
@@ -90,28 +90,26 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
90
90
|
whiteSpace: "nowrap",
|
|
91
91
|
} },
|
|
92
92
|
React.createElement("span", null, "AHORRAS 60%"))),
|
|
93
|
-
React.createElement("
|
|
94
|
-
React.createElement("
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
minWidth: "40px",
|
|
105
|
-
} })))),
|
|
93
|
+
React.createElement("span", null,
|
|
94
|
+
React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.fireIcon, alt: "fire", className: "w-[14px] h-[14px] mb-[4px] mr-[4px]" }),
|
|
95
|
+
React.createElement("span", { className: "bold-text" }, "Remate"),
|
|
96
|
+
" t\u00E9rmina en",
|
|
97
|
+
" ",
|
|
98
|
+
React.createElement("span", { className: "bold-text text-end", ref: (node) => commonService.startCountdown(node, 599), style: {
|
|
99
|
+
fontVariantNumeric: "tabular-nums",
|
|
100
|
+
display: "inline-block",
|
|
101
|
+
color: "#FF5C60",
|
|
102
|
+
minWidth: "40px",
|
|
103
|
+
} }))),
|
|
106
104
|
React.createElement("div", { id: `service-card-${serviceItem.id}`, className: "bg-[#0C1421] text-white mx-auto relative rounded-[14px] p-[14px] text-[13.33px]" },
|
|
107
105
|
React.createElement("div", { className: "grid grid-cols-[23%_50%_27%] items-stretch" },
|
|
108
106
|
React.createElement("div", { className: "flex flex-col justify-between gap-[20px] my-[14px] pr-[22px]" },
|
|
109
107
|
React.createElement("div", { className: "flex flex-col gap-[8px]" },
|
|
110
108
|
React.createElement("div", { className: "flex items-center gap-[8px]" },
|
|
111
|
-
React.createElement("img", { src: (
|
|
109
|
+
React.createElement("img", { src: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.whiteOrigin, alt: "origin", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}` }),
|
|
112
110
|
React.createElement("span", { className: "text-[13px] bold-text" }, cityOrigin === null || cityOrigin === void 0 ? void 0 : cityOrigin.label.split(",")[0])),
|
|
113
111
|
React.createElement("div", { className: "flex items-center gap-[8px]" },
|
|
114
|
-
React.createElement("img", { src: (
|
|
112
|
+
React.createElement("img", { src: (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.whiteDestination, alt: "destination", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
|
|
115
113
|
React.createElement("span", { className: "text-[13px] bold-text" }, cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.label.split(",")[0]))),
|
|
116
114
|
React.createElement("div", { className: "flex flex-col gap-[8px]" },
|
|
117
115
|
React.createElement("div", { className: "text-[12px] bold-text whitespace-nowrap" }, "Entre 07:00 AM y 10:00 AM"),
|
|
@@ -119,12 +117,12 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
119
117
|
React.createElement("div", { className: "flex flex-col items-start gap-[10px] text-[12px] " },
|
|
120
118
|
React.createElement("div", { className: "flex items-justify gap-[8px]" },
|
|
121
119
|
renderIcon("sheildIcon", "16px"),
|
|
122
|
-
React.createElement("span", { className: "text-[
|
|
120
|
+
React.createElement("span", { className: "text-[11px]", style: {
|
|
123
121
|
lineHeight: 1.3,
|
|
124
122
|
} }, "Empresa y hora a confirmar luego del pago.")),
|
|
125
123
|
React.createElement("div", { className: "flex items-justify gap-[8px]" },
|
|
126
124
|
renderIcon("confirmarIcon", "16px"),
|
|
127
|
-
React.createElement("span", { className: "text-[
|
|
125
|
+
React.createElement("span", { className: "text-[11px]", style: {
|
|
128
126
|
lineHeight: 1.3,
|
|
129
127
|
} }, "Tu compra est\u00E1 100% asegurada.")))),
|
|
130
128
|
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]" },
|
|
@@ -152,7 +150,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
152
150
|
, {
|
|
153
151
|
// animationData={serviceItem.icons.flexibleAnim}
|
|
154
152
|
animationData: getAnimationIcon("usersAnimation"), width: "18px", height: "18px" }),
|
|
155
|
-
React.createElement("span",
|
|
153
|
+
React.createElement("span", { className: "text-[13px]" },
|
|
156
154
|
React.createElement("span", { className: "bold-text text-white" },
|
|
157
155
|
" ",
|
|
158
156
|
React.createElement("span", { className: "bold-text", ref: (node) => commonService.startViewerCount(node, viewersConfig), style: {
|
|
@@ -212,7 +210,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
|
|
|
212
210
|
animationData: getAnimationIcon("thunderAnimation"), width: "18px", height: "18px" }),
|
|
213
211
|
React.createElement("span", { className: "whitespace-nowrap" }, "\u00A1Lo quiero!"))),
|
|
214
212
|
React.createElement("div", { className: `absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`, onClick: onToggleExpand },
|
|
215
|
-
React.createElement("img", { src: (
|
|
213
|
+
React.createElement("img", { src: (_e = serviceItem.icons) === null || _e === void 0 ? void 0 : _e.downArrow, alt: "down arrow", style: {
|
|
216
214
|
width: "14px",
|
|
217
215
|
height: "8px",
|
|
218
216
|
filter: "brightness(0) invert(1)",
|
|
@@ -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,15 +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
119
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
136
120
|
const getAnimationIcon = (icon: string) => {
|
|
137
121
|
const animation = ANIMATION_MAP[icon];
|
|
@@ -431,31 +415,6 @@ function ServiceItemPB({
|
|
|
431
415
|
siteType={siteType}
|
|
432
416
|
isAllinBus={isAllinBus}
|
|
433
417
|
/>
|
|
434
|
-
) : isNewUi ? (
|
|
435
|
-
<FeatureServiceUi
|
|
436
|
-
serviceItem={serviceItem}
|
|
437
|
-
showTopLabel={showTopLabel}
|
|
438
|
-
isSoldOut={isSoldOut}
|
|
439
|
-
getAnimationIcon={getAnimationIcon}
|
|
440
|
-
cityOrigin={cityOrigin}
|
|
441
|
-
cityDestination={cityDestination}
|
|
442
|
-
renderIcon={renderIcon}
|
|
443
|
-
viewersConfig={viewersConfig}
|
|
444
|
-
isFeatureDropDownExpand={isFeatureDropDownExpand}
|
|
445
|
-
ticketQuantity={ticketQuantity}
|
|
446
|
-
onIncreaseTicketQuantity={onIncreaseTicketQuantity}
|
|
447
|
-
onDecreaseTicketQuantity={onDecreaseTicketQuantity}
|
|
448
|
-
onBookButtonPress={onBookButtonPress}
|
|
449
|
-
onToggleExpand={() =>
|
|
450
|
-
setIsFeatureDropDownExpand &&
|
|
451
|
-
setIsFeatureDropDownExpand(
|
|
452
|
-
isFeatureDropDownExpand === serviceItem.id ||
|
|
453
|
-
isFeatureDropDownExpand === true
|
|
454
|
-
? null
|
|
455
|
-
: serviceItem.id,
|
|
456
|
-
)
|
|
457
|
-
}
|
|
458
|
-
/>
|
|
459
418
|
) : (
|
|
460
419
|
<div
|
|
461
420
|
className={`relative hover:z-[150] ${hasOfferText || hasDpEnabled ? "mb-[55px]" : "mb-[10px]"} ${
|