kupos-ui-components-lib 9.0.6 → 9.0.7

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.
Files changed (38) hide show
  1. package/README copy.md +67 -223
  2. package/dist/assets/images/anims/service_list/directo.json +1 -1
  3. package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
  4. package/dist/components/ServiceItem/RatingHover.js +31 -31
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +263 -125
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +291 -44
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +0 -3
  9. package/dist/components/ServiceItem/types.d.ts +0 -7
  10. package/dist/styles.css +17 -66
  11. package/dist/ui/AmenitiesBlock.js +36 -25
  12. package/dist/ui/DurationBlock.js +2 -2
  13. package/dist/ui/FlexibleBlock.js +4 -2
  14. package/dist/ui/PetBlock.js +3 -1
  15. package/dist/ui/RatingBlock.js +2 -6
  16. package/package.json +1 -1
  17. package/src/assets/images/anims/service_list/directo.json +1 -1
  18. package/src/assets/images/anims/service_list/priority_stage.json +1 -1
  19. package/src/components/ServiceItem/RatingHover.tsx +51 -51
  20. package/src/components/ServiceItem/ServiceItemDesktop.tsx +466 -222
  21. package/src/components/ServiceItem/ServiceItemMobile.tsx +501 -120
  22. package/src/components/ServiceItem/mobileTypes.ts +0 -3
  23. package/src/components/ServiceItem/types.ts +0 -7
  24. package/src/ui/AmenitiesBlock.tsx +15 -34
  25. package/src/ui/DurationBlock.tsx +2 -2
  26. package/src/ui/FlexibleBlock.tsx +3 -3
  27. package/src/ui/PetBlock.tsx +2 -2
  28. package/src/ui/RatingBlock.tsx +4 -16
  29. package/src/assets/images/anims/service_list/bomb.json +0 -1
  30. package/src/ui/BottomAmenities/BottomAmenities.tsx +0 -109
  31. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +0 -85
  32. package/src/ui/KuposButton/KuposButton.tsx +0 -48
  33. package/src/ui/SeatSection/SeatSection.tsx +0 -187
  34. package/src/ui/TopAmenities/TopAmenities.tsx +0 -82
  35. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +0 -168
  36. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +0 -192
  37. package/src/ui/mobileweb/SeatSectionMobile.tsx +0 -256
  38. package/src/ui/mobileweb/TopAmenitieMobile.tsx +0 -82
@@ -1,9 +1,7 @@
1
1
  import React from "react";
2
2
  import LottiePlayer from "../../assets/LottiePlayer";
3
+ import DateService from "../../utils/DateService";
3
4
  import commonService from "../../utils/CommonService";
4
- import TopAmenitieMobile from "../../ui/mobileweb/TopAmenitieMobile";
5
- import BottomAmenitiesMobile from "../../ui/mobileweb/BottomAmenitiesMobile";
6
- import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
7
5
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
8
6
  const exceptions = [
9
7
  "gy",
@@ -20,7 +18,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
20
18
  var _a, _b, _c;
21
19
  const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
22
20
  let isSoldOut = serviceItem.available_seats <= 0;
23
- const showPromo = Math.random() > 0.5;
24
21
  const labelId = typeof serviceItem.boarding_stages === "string"
25
22
  ? serviceItem.boarding_stages.split("|")[0]
26
23
  : "";
@@ -38,6 +35,146 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
38
35
  return "";
39
36
  }
40
37
  };
38
+ const seatTypes = () => {
39
+ var _a, _b, _c, _d;
40
+ let seatTypes = (_d = (_c = (_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.sort((a, b) => a.fare - b.fare) // Add this line to sort by fare
41
+ ) === null || _c === void 0 ? void 0 : _c.slice(0, 2)) === null || _d === void 0 ? void 0 : _d.map((type, i) => {
42
+ var _a;
43
+ return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
44
+ ? "w-[100%] flex flex-row justify-between "
45
+ : "w-[100%] flex flex-row justify-between items-center", key: i },
46
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] ", style: {
47
+ // marginLeft: "10px",
48
+ color: isSoldOut ? "#bbb" : "#464647",
49
+ } }, type.label),
50
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, commonService.currency(type.fare, currencySign))));
51
+ });
52
+ return seatTypes;
53
+ };
54
+ const seatTypesWithRemoveDuplicateSeats = () => {
55
+ var _a, _b;
56
+ const seatMap = new Map();
57
+ (_b = (_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.filter((item) => getFilteredSeats(item.label))) === null || _b === void 0 ? void 0 : _b.forEach((item) => {
58
+ if (exceptions.includes(item.key))
59
+ return;
60
+ const existing = seatMap.get(item.label);
61
+ if (!existing ||
62
+ parseFloat(item.fare) < parseFloat(existing.fare)) {
63
+ seatMap.set(item.label, item);
64
+ }
65
+ });
66
+ const uniqueSeats = Array.from(seatMap.values())
67
+ .sort((a, b) => a.fare - b.fare)
68
+ .slice(0, 3);
69
+ return uniqueSeats.map((type, i) => {
70
+ var _a;
71
+ return exceptions.includes(type.label) ? null : (React.createElement("div", { className: ((_a = serviceItem.seat_types) === null || _a === void 0 ? void 0 : _a.length) > 2
72
+ ? "w-[100%] flex flex-row justify-between "
73
+ : "w-[100%] flex flex-row justify-between items-center", key: i },
74
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] ", style: {
75
+ // marginLeft: "10px",
76
+ color: isSoldOut ? "#bbb" : "#464647",
77
+ } }, commonService.truncateSeatLabel(type.label)),
78
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[11px] bold-text", style: { color: isSoldOut ? "#bbb" : colors.seatPriceColor } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) <= 0 && !isPeru
79
+ ? commonService.currency(0, currencySign)
80
+ : commonService.currency(type.fare, currencySign))));
81
+ });
82
+ };
83
+ const getFilteredSeats = (item) => {
84
+ return item;
85
+ };
86
+ const getAmenitiesImage = (name) => {
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
88
+ switch (name) {
89
+ case "air_condtion.png": {
90
+ return (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _a === void 0 ? void 0 : _a.airConditionIcon;
91
+ }
92
+ case "baggage.png": {
93
+ return (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _b === void 0 ? void 0 : _b.baggageIcon;
94
+ }
95
+ case "charging_plug.png": {
96
+ return (_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _c === void 0 ? void 0 : _c.chargingIcon;
97
+ }
98
+ case "coffee.png": {
99
+ return (_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _d === void 0 ? void 0 : _d.coffeeIcon;
100
+ }
101
+ case "food_new_icon.png": {
102
+ return (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.foodIcon;
103
+ }
104
+ case "gaming.png": {
105
+ return (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.gamingIcon;
106
+ }
107
+ case "handicap.png": {
108
+ return (_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _g === void 0 ? void 0 : _g.handicapIcon;
109
+ }
110
+ case "mobile_ticket.png": {
111
+ return (_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.mobileTicketIcon;
112
+ }
113
+ case "movie.png": {
114
+ return (_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.movieIcon;
115
+ }
116
+ case "restrooms.png": {
117
+ return (_k = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _k === void 0 ? void 0 : _k.restroomsIcon;
118
+ }
119
+ case "snacks_new.png": {
120
+ return (_l = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _l === void 0 ? void 0 : _l.snackIcon;
121
+ }
122
+ case "wifi.png": {
123
+ return (_m = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _m === void 0 ? void 0 : _m.wifiIcon;
124
+ }
125
+ case "cortina_divisoria.png": {
126
+ return (_o = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _o === void 0 ? void 0 : _o.cortinaIcon;
127
+ }
128
+ case "frazada.png": {
129
+ return (_p = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _p === void 0 ? void 0 : _p.frazaIcon;
130
+ }
131
+ case "blanket.png": {
132
+ return (_q = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _q === void 0 ? void 0 : _q.blankketIcon;
133
+ }
134
+ case "cctv.png": {
135
+ return (_r = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _r === void 0 ? void 0 : _r.cctvIcon;
136
+ }
137
+ case "cup_holder.png": {
138
+ return (_s = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _s === void 0 ? void 0 : _s.cupHolderIcon;
139
+ }
140
+ case "emergency_contact.png": {
141
+ return (_t = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _t === void 0 ? void 0 : _t.emergencyContactIcon;
142
+ }
143
+ case "emergency_exit.png": {
144
+ return (_u = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _u === void 0 ? void 0 : _u.emergencyExitIcon;
145
+ }
146
+ case "fire_extinguisher.png": {
147
+ return (_v = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _v === void 0 ? void 0 : _v.fireExtinguisherIcon;
148
+ }
149
+ case "reading_light.png": {
150
+ return (_w = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _w === void 0 ? void 0 : _w.readingLIghtIcon;
151
+ }
152
+ case "seat_belt.png": {
153
+ return (_x = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _x === void 0 ? void 0 : _x.sercurityBeltIcon;
154
+ }
155
+ case "service_on_board.png": {
156
+ return (_y = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _y === void 0 ? void 0 : _y.serviceOnBoardIcon;
157
+ }
158
+ case "personal_tv.png": {
159
+ return (_z = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _z === void 0 ? void 0 : _z.personalTVIcon;
160
+ }
161
+ case "pet_admission.png": {
162
+ return (_0 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _0 === void 0 ? void 0 : _0.petAdmissionIcon;
163
+ }
164
+ case "music.png": {
165
+ return (_1 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _1 === void 0 ? void 0 : _1.musicIcon;
166
+ }
167
+ case "headset.png": {
168
+ return (_2 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _2 === void 0 ? void 0 : _2.headPhoneIcon;
169
+ }
170
+ case "allows_cancellation.png": {
171
+ return (_3 = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _3 === void 0 ? void 0 : _3.allowCancellationIcon;
172
+ }
173
+ default: {
174
+ return "";
175
+ }
176
+ }
177
+ };
41
178
  const amenities = () => {
42
179
  var _a;
43
180
  const raw = (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[3];
@@ -48,7 +185,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
48
185
  : [];
49
186
  const nodes = list.slice(0, 2).map((am, i) => {
50
187
  var _a;
51
- return (React.createElement("img", { key: i, className: "amenity", height: 12, width: 12,
188
+ return (React.createElement("img", { key: i, className: "amenity", height: 14, width: 14,
52
189
  // src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
53
190
  src: commonService.getAmenitiesImage((_a = amenitiesData === null || amenitiesData === void 0 ? void 0 : amenitiesData[am]) === null || _a === void 0 ? void 0 : _a.toLowerCase(), serviceItem), alt: "icon" }));
54
191
  });
@@ -68,52 +205,140 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
68
205
  if (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) {
69
206
  isConexion = true;
70
207
  }
208
+ const depTime = serviceItem.dep_time || "";
209
+ // Extract hours and minutes and check for AM/PM
210
+ const hasAM = depTime.includes("AM");
211
+ const hasPM = depTime.includes("PM");
212
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
213
+ const [hour, minute] = timePart.split(":").map(Number);
214
+ // Convert to 24-hour format
215
+ let cleanedDepTime;
216
+ if (hasAM) {
217
+ cleanedDepTime =
218
+ hour === 12
219
+ ? `00:${minute < 10 ? "0" + minute : minute}`
220
+ : `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
221
+ }
222
+ else if (hasPM) {
223
+ cleanedDepTime =
224
+ hour === 12
225
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
226
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
227
+ }
228
+ else {
229
+ cleanedDepTime = timePart;
230
+ }
71
231
  return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[14px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
72
232
  isConexion ||
73
233
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
74
234
  showTopLabel
75
- ? "mt-[10px]"
235
+ ? "mt-[20px]"
76
236
  : "mt-[10px]"} `, style: { backgroundColor: "#fff", zIndex: 1 } },
77
- React.createElement(TopAmenitieMobile, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, seatPriceColor: colors.seatPriceColor, bombAnim: serviceItem.icons.bombAnim, priorityStageAnim: serviceItem.icons.priorityStageAnim }),
78
- React.createElement("div", { className: " rounded-[20px]", style: {
79
- backgroundColor: "#fff",
80
- zIndex: 1,
81
- // borderRadius: showTopLabel ? "10px 0 10px 10px" : "10px",
82
- borderRadius: "14px 0 14px 14px",
83
- border: `1px solid ${colors.bottomStripColor}`,
84
- } },
85
- React.createElement("div", {
86
- // className={` ${
87
- // serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
88
- // showTopLabel ||
89
- // serviceItem?.is_direct_trip ||
90
- // serviceItem?.is_transpordo
91
- // ? "mt-[10px]"
92
- // : ""
93
- // }`}
94
- style: { padding: "12px 12px 8px 12px" } },
95
- React.createElement("div", { className: "flex justify-between items-center mb-[10px]" },
96
- React.createElement("div", { className: "flex items-center justify-between" },
237
+ React.createElement("div", { className: "border border-[#E6E6E6] rounded-[20px]", style: { backgroundColor: "#fff", zIndex: 1 } },
238
+ React.createElement("div", { className: `p-[12px] ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
239
+ showTopLabel ||
240
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
241
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo)
242
+ ? "mt-[10px]"
243
+ : ""}` },
244
+ React.createElement("div", { className: "flex justify-between mb-[8px]" },
245
+ React.createElement("div", { className: "flex items-center w-[50%] justify-between" },
97
246
  React.createElement("div", { className: "w-[120px] overflow-y-hidden" },
98
247
  React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `w-[100px] h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
99
- isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] items-center" },
100
- React.createElement("div", { className: "flex items-center" },
248
+ isCiva ? (React.createElement("div", { className: "black-text min-[420]:text-[12px] text-[12px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details[2])) : showRating ? (React.createElement("div", { className: "flex min-[420]:text-[13px] text-[12px] bold-text items-center" },
249
+ React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
250
+ React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem)))) : null),
251
+ showLastSeats ? (React.createElement("div", { className: "flex justify-end -mt-[5px] -mb-[5px] items-center pt-[5px] pb-[5px] text-center " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
252
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("span", { className: "text-[12px] text-[red] mt-1 flex justify-end pt-[5px] pb-[5px] pl-[15px] pr-[15px] rounded-[8px] ", style: {
253
+ backgroundColor: colors.lastSeatBg,
254
+ color: colors.lastSeatText,
255
+ } }, "\u00A1 \u00DAltimos Asientos!")))) : null),
256
+ React.createElement("div", { className: "flex justify-between gap-[5px] w-full", onClick: onBookButtonPress },
257
+ React.createElement("div", { className: "min-h-[2.5rem] flex flex-col justify-between gap-[4px] w-[50%] ", style: { justifyContent: isCiva && "center" } },
258
+ React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
259
+ React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
260
+ React.createElement("div", null,
261
+ " ",
262
+ orignLabel ? (React.createElement("div", { className: "w-[60px]" }, orignLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
263
+ React.createElement("img", { src: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, alt: "origin", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
264
+ React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
265
+ React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.travel_date)),
266
+ React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
267
+ React.createElement("div", { className: "font-[900] relative black-text" }, isLinatal ? (React.createElement("div", null,
268
+ React.createElement("span", null,
269
+ " ",
270
+ cleanedDepTime,
271
+ " ",
272
+ React.createElement("span", null, hasPM ? "PM" : hasAM ? "AM" : "")),
273
+ React.createElement("span", null, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("AM")) ||
274
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("PM"))
275
+ ? null
276
+ : DateService.ampmOnly(serviceItem.dep_time)))) : (DateService.formatTime(serviceItem.dep_time)))))),
277
+ isCiva ? null : (React.createElement("div", { className: `flex items-center min-[420]:text-[13px] text-[12px] justify-between ${isSoldOut ? "text-[#c0c0c0]" : ""}` },
278
+ React.createElement("div", { className: "flex items-center", style: { flex: 1 } },
279
+ React.createElement("div", null,
280
+ " ",
281
+ destinationLabel ? (React.createElement("div", { className: "w-[60px]" }, destinationLabel)) : (React.createElement("div", { className: "w-[14px] h-auto mr-[5px]" },
282
+ React.createElement("img", { src: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, alt: "destination", className: `w-[14px] h-auto mr-[5px] ${isSoldOut ? "grayscale" : ""}` })))),
283
+ React.createElement("div", { className: "flex items-center relative capitalize justify-between ", style: { flex: 1 } },
284
+ React.createElement("span", { className: "cursor-pointer black-text" }, DateService.getServiceItemDate(serviceItem.arrival_date)),
285
+ React.createElement("div", { className: "absolute left-[50%]" }, "\u2022"),
286
+ React.createElement("div", { className: "font-[900] relative black-text" }, DateService.formatTime(serviceItem.arr_time))))))),
287
+ React.createElement("div", { style: {
288
+ width: "1px",
289
+ height: "2.5rem",
290
+ backgroundColor: "#ccc",
291
+ margin: "auto",
292
+ } }),
293
+ React.createElement("div", { className: "content-center", style: {
294
+ width: isPeru ? "40%" : "40%",
295
+ } },
296
+ React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
297
+ gap: isSoldOut ? "0px" : "5px",
298
+ justifyContent: ((_c = serviceItem.seat_types) === null || _c === void 0 ? void 0 : _c.length) > 2
299
+ ? "space-between"
300
+ : "center",
301
+ } },
302
+ removeDuplicateSeats
303
+ ? seatTypesWithRemoveDuplicateSeats()
304
+ : seatTypes(),
305
+ isSoldOut ? (React.createElement("div", { className: "flex justify-end" },
306
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] text-[#ccc]" }, "Agotado"))) : null))),
307
+ React.createElement("div", { className: "bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]" }),
308
+ React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
309
+ React.createElement("div", null,
310
+ React.createElement("div", { className: "flex items-center " },
311
+ React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
312
+ React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] bold-text" }, serviceItem.operator_details[2])))),
313
+ React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
314
+ React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
315
+ "\u00A0",
316
+ React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
317
+ serviceItem.duration,
318
+ "hrs")),
319
+ React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenities()),
320
+ (serviceItem.is_change_ticket || isPetSeat) && (React.createElement("div", { onClick: () => {
321
+ setShowDropdown(!showDropdown);
322
+ setAmenetiesAtomValue({
323
+ service: serviceItem,
324
+ showTopLabel: showTopLabel,
325
+ });
326
+ }, className: "flex items-center" },
327
+ serviceItem.pet_seat_info &&
328
+ Object.keys(serviceItem.pet_seat_info).length > 0 ? (React.createElement("div", { className: "flex items-center" },
329
+ React.createElement("div", { className: `relative group cursor-default ` },
330
+ React.createElement("div", { className: "flex items-center" },
331
+ React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
332
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.petFriendlyAnim, width: "20px", height: "20px" })))))) : null,
333
+ serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center" },
334
+ React.createElement("div", { className: "relative group cursor-default" },
101
335
  React.createElement("div", { className: "flex items-center" },
102
- React.createElement("img", { src: serviceItem.icons.rating, alt: "origin", className: `w-[12px] h-[12px] mr-[4px] object-contain ${isSoldOut ? "grayscale" : ""}` }),
103
- React.createElement("span", { style: { lineHeight: "normal" } }, getServiceStars(serviceItem))),
104
- React.createElement("div", { className: "flex items-center cursor-pointer ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
105
- React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px]" }, serviceItem.operator_details[2]))))) : null),
106
- showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
107
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-[#464647] text-center" }, "\u00A1 \u00DAltimos Asientos!")))) : null),
108
- React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_a = serviceItem.icons) === null || _a === void 0 ? void 0 : _a.origin, destinationIcon: (_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats }),
109
- React.createElement("div", { className: "bg-[#E6E6E6] mt-[10px] mb-[10px] h-[1px]" }),
110
- React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_c = serviceItem.duration) === null || _c === void 0 ? void 0 : _c.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: showDropdown, setShowDropdown: setShowDropdown, onDropdownToggle: () => {
111
- setShowDropdown(!showDropdown);
112
- setAmenetiesAtomValue({
113
- service: serviceItem,
114
- showTopLabel: showTopLabel,
115
- });
116
- } })),
336
+ React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
337
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.flexibleAnim, width: "20px", height: "20px" })))))),
338
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: "flex items-center mr-[10px]" },
339
+ React.createElement("div", { className: `h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
340
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.locationAnim, width: "20px", height: "20px" })))),
341
+ (serviceItem.is_change_ticket || isPetSeat) && (React.createElement("img", { src: serviceItem.icons.plus, alt: "icon", width: 11 })))))),
117
342
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) && (React.createElement("div", { className: ` text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[35px] pt-[50px] z-10 rounded-b-[14px] min-[420]:text-[14px] text-[12px]`, style: {
118
343
  backgroundColor: isSoldOut ? "#ccc" : colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
119
344
  zIndex: -1,
@@ -123,6 +348,28 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
123
348
  } },
124
349
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
125
350
  React.createElement("span", { className: "ml-[10px] text-[#fff] min-[380px]:text-[11px] text-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
126
- React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 " }))));
351
+ React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 " },
352
+ showTopLabel && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
353
+ backgroundColor: isSoldOut ? "#ccc" : colors.ratingBottomColor,
354
+ } },
355
+ React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
356
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.priorityStageAnim, width: "18px", height: "18px" })),
357
+ React.createElement("div", { className: isSoldOut ? "text-[#bbb]" : `text-[${colors.topLabelColor}]` }, showTopLabel))),
358
+ isConexion && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[11px] z-20 ${isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]`}`, style: {
359
+ backgroundColor: !isSoldOut && colors.ratingBottomColor,
360
+ } },
361
+ renderIcon("airportIcon", "14px"),
362
+ React.createElement("div", null, "Conexi\u00F3n"))),
363
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
364
+ backgroundColor: isSoldOut ? "#ddd" : colors.tooltipBgColor,
365
+ color: isSoldOut ? "#bbb" : colors.directoColor,
366
+ } },
367
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "16px", height: "16px" }),
368
+ React.createElement("div", { className: "ml-[5px]" }, "Directo"))),
369
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" && (React.createElement("div", { className: `flex items-center gap-[2px] py-[5px] text-white px-[10px] rounded-[38px] min-[420]:text-[12px] text-[10px] z-20 `, style: {
370
+ backgroundColor: isSoldOut ? "#ddd" : colors.tooltipColor,
371
+ } },
372
+ React.createElement(LottiePlayer, { animationData: serviceItem.icons.directoAnim, width: "20px", height: "20px" }),
373
+ React.createElement("div", null, "Tren Express")))))));
127
374
  }
128
375
  export default ServiceItemMobile;
@@ -110,9 +110,6 @@ export interface MobileServiceItemProps {
110
110
  seatFallBackIcon: string;
111
111
  headPhoneIcon?: string;
112
112
  allowCancellationIcon?: string;
113
- bombAnim?: string;
114
- whiteBoardingIcon?: string;
115
- downArrow?: string;
116
113
  [key: string]: string | Record<string, string | undefined> | undefined;
117
114
  };
118
115
  useLottieFor?: string[];
@@ -115,9 +115,6 @@ export interface ServiceItemProps {
115
115
  seatFallBackIcon: string;
116
116
  headPhoneIcon?: string;
117
117
  allowCancellationIcon?: string;
118
- whiteBoardingIcon?: string;
119
- bombJson?: string;
120
- downArrow?: string;
121
118
  [key: string]: string | Record<string, string | undefined> | undefined;
122
119
  };
123
120
  useLottieFor?: string[];
@@ -193,11 +190,7 @@ export interface ServiceItemProps {
193
190
  petFriendlyAnim?: string;
194
191
  priorityStageAnim?: string;
195
192
  promoAnim?: string;
196
- bombAnimation?: string;
197
193
  isPeru?: boolean;
198
194
  siteType?: "kupos" | "pullman" | "opsites" | "linatal";
199
195
  isAllinBus?: boolean;
200
- isExpand?: any;
201
- setIsExpand?: (value: any) => void;
202
- coachKey?: number;
203
196
  }
package/dist/styles.css CHANGED
@@ -30,9 +30,6 @@
30
30
  .-top-\[14px\] {
31
31
  top: calc(14px * -1);
32
32
  }
33
- .-top-\[16px\] {
34
- top: calc(16px * -1);
35
- }
36
33
  .top-\[2px\] {
37
34
  top: 2px;
38
35
  }
@@ -48,9 +45,6 @@
48
45
  .top-\[88\%\] {
49
46
  top: 88%;
50
47
  }
51
- .right-\[0\] {
52
- right: 0;
53
- }
54
48
  .-bottom-\[9\%\] {
55
49
  bottom: calc(9% * -1);
56
50
  }
@@ -87,9 +81,6 @@
87
81
  .left-\[80px\] {
88
82
  left: 80px;
89
83
  }
90
- .-z-9 {
91
- z-index: calc(9 * -1);
92
- }
93
84
  .-z-10 {
94
85
  z-index: calc(10 * -1);
95
86
  }
@@ -129,27 +120,18 @@
129
120
  .-mt-\[5px\] {
130
121
  margin-top: calc(5px * -1);
131
122
  }
132
- .-mt-\[16px\] {
133
- margin-top: calc(16px * -1);
134
- }
135
123
  .mt-\[2px\] {
136
124
  margin-top: 2px;
137
125
  }
138
126
  .mt-\[5px\] {
139
127
  margin-top: 5px;
140
128
  }
141
- .mt-\[6px\] {
142
- margin-top: 6px;
143
- }
144
129
  .mt-\[10px\] {
145
130
  margin-top: 10px;
146
131
  }
147
132
  .mt-\[13px\] {
148
133
  margin-top: 13px;
149
134
  }
150
- .mt-\[14px\] {
151
- margin-top: 14px;
152
- }
153
135
  .mt-\[15px\] {
154
136
  margin-top: 15px;
155
137
  }
@@ -192,6 +174,9 @@
192
174
  .mb-\[5px\] {
193
175
  margin-bottom: 5px;
194
176
  }
177
+ .mb-\[8px\] {
178
+ margin-bottom: 8px;
179
+ }
195
180
  .mb-\[10px\] {
196
181
  margin-bottom: 10px;
197
182
  }
@@ -219,9 +204,6 @@
219
204
  .ml-\[3px\] {
220
205
  margin-left: 3px;
221
206
  }
222
- .ml-\[4px\] {
223
- margin-left: 4px;
224
- }
225
207
  .ml-\[5px\] {
226
208
  margin-left: 5px;
227
209
  }
@@ -318,9 +300,6 @@
318
300
  .w-\[50\%\] {
319
301
  width: 50%;
320
302
  }
321
- .w-\[55\%\] {
322
- width: 55%;
323
- }
324
303
  .w-\[60\%\] {
325
304
  width: 60%;
326
305
  }
@@ -342,9 +321,6 @@
342
321
  .w-\[130px\] {
343
322
  width: 130px;
344
323
  }
345
- .w-\[150px\] {
346
- width: 150px;
347
- }
348
324
  .w-\[188px\] {
349
325
  width: 188px;
350
326
  }
@@ -357,8 +333,8 @@
357
333
  .w-\[260px\] {
358
334
  width: 260px;
359
335
  }
360
- .w-\[280px\] {
361
- width: 280px;
336
+ .w-\[320px\] {
337
+ width: 320px;
362
338
  }
363
339
  .w-\[auto\] {
364
340
  width: auto;
@@ -369,13 +345,6 @@
369
345
  .w-full {
370
346
  width: 100%;
371
347
  }
372
- .w-max {
373
- width: -moz-max-content;
374
- width: max-content;
375
- }
376
- .max-w-\[120px\] {
377
- max-width: 120px;
378
- }
379
348
  .max-w-\[165px\] {
380
349
  max-width: 165px;
381
350
  }
@@ -405,15 +374,12 @@
405
374
  .cursor-pointer {
406
375
  cursor: pointer;
407
376
  }
377
+ .\[grid-template-columns\:14\%_30\%_2\.5\%_30\%_15\.5\%\] {
378
+ grid-template-columns: 14% 30% 2.5% 30% 15.5%;
379
+ }
408
380
  .\[grid-template-columns\:14\%_40\%_0\.5\%_24\%_13\.5\%\] {
409
381
  grid-template-columns: 14% 40% 0.5% 24% 13.5%;
410
382
  }
411
- .\[grid-template-columns\:18\%_28\%_2\.5\%_28\%_15\.5\%\] {
412
- grid-template-columns: 18% 28% 2.5% 28% 15.5%;
413
- }
414
- .\[grid-template-columns\:22\%_28\%_2\.5\%_24\%_15\.5\%\] {
415
- grid-template-columns: 22% 28% 2.5% 24% 15.5%;
416
- }
417
383
  .grid-cols-\[0\.8fr_auto_26\%_1fr\] {
418
384
  grid-template-columns: 0.8fr auto 26% 1fr;
419
385
  }
@@ -546,6 +512,9 @@
546
512
  --tw-border-style: none;
547
513
  border-style: none;
548
514
  }
515
+ .border-\[\#E6E6E6\] {
516
+ border-color: #E6E6E6;
517
+ }
549
518
  .border-\[\#ccc\] {
550
519
  border-color: #ccc;
551
520
  }
@@ -604,6 +573,9 @@
604
573
  .p-\[10px_15px\] {
605
574
  padding: 10px 15px;
606
575
  }
576
+ .p-\[12px\] {
577
+ padding: 12px;
578
+ }
607
579
  .p-\[15px\] {
608
580
  padding: 15px;
609
581
  }
@@ -619,9 +591,6 @@
619
591
  .px-\[14px\] {
620
592
  padding-inline: 14px;
621
593
  }
622
- .px-\[15px\] {
623
- padding-inline: 15px;
624
- }
625
594
  .px-\[20px\] {
626
595
  padding-inline: 20px;
627
596
  }
@@ -634,9 +603,6 @@
634
603
  .py-\[6px\] {
635
604
  padding-block: 6px;
636
605
  }
637
- .py-\[10px\] {
638
- padding-block: 10px;
639
- }
640
606
  .py-\[12px\] {
641
607
  padding-block: 12px;
642
608
  }
@@ -646,18 +612,12 @@
646
612
  .pt-\[5px\] {
647
613
  padding-top: 5px;
648
614
  }
649
- .pt-\[6px\] {
650
- padding-top: 6px;
651
- }
652
615
  .pt-\[10px\] {
653
616
  padding-top: 10px;
654
617
  }
655
618
  .pt-\[20px\] {
656
619
  padding-top: 20px;
657
620
  }
658
- .pt-\[26px\] {
659
- padding-top: 26px;
660
- }
661
621
  .pt-\[35px\] {
662
622
  padding-top: 35px;
663
623
  }
@@ -679,12 +639,6 @@
679
639
  .pb-\[10px\] {
680
640
  padding-bottom: 10px;
681
641
  }
682
- .pb-\[14px\] {
683
- padding-bottom: 14px;
684
- }
685
- .pl-\[6px\] {
686
- padding-left: 6px;
687
- }
688
642
  .pl-\[15px\] {
689
643
  padding-left: 15px;
690
644
  }
@@ -736,13 +690,13 @@
736
690
  --tw-font-weight: 900;
737
691
  font-weight: 900;
738
692
  }
693
+ .text-wrap {
694
+ text-wrap: wrap;
695
+ }
739
696
  .break-normal {
740
697
  overflow-wrap: normal;
741
698
  word-break: normal;
742
699
  }
743
- .text-ellipsis {
744
- text-overflow: ellipsis;
745
- }
746
700
  .whitespace-normal {
747
701
  white-space: normal;
748
702
  }
@@ -776,9 +730,6 @@
776
730
  .uppercase {
777
731
  text-transform: uppercase;
778
732
  }
779
- .line-through {
780
- text-decoration-line: line-through;
781
- }
782
733
  .opacity-0 {
783
734
  opacity: 0%;
784
735
  }