kupos-ui-components-lib 9.0.4 → 9.0.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.
Files changed (57) hide show
  1. package/README copy.md +223 -67
  2. package/dist/assets/images/anims/service_list/bomb.json +1 -0
  3. package/dist/assets/images/anims/service_list/directo.json +1 -1
  4. package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
  5. package/dist/components/ServiceItem/ExpandedDropdown.d.ts +19 -0
  6. package/dist/components/ServiceItem/ExpandedDropdown.js +28 -0
  7. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  8. package/dist/components/ServiceItem/ServiceItemDesktop.js +125 -262
  9. package/dist/components/ServiceItem/ServiceItemMobile.js +44 -291
  10. package/dist/components/ServiceItem/mobileTypes.d.ts +3 -0
  11. package/dist/components/ServiceItem/types.d.ts +7 -0
  12. package/dist/styles.css +67 -12
  13. package/dist/ui/AmenitiesBlock.js +60 -66
  14. package/dist/ui/BottomAmenities/BottomAmenities.d.ts +26 -0
  15. package/dist/ui/BottomAmenities/BottomAmenities.js +22 -0
  16. package/dist/ui/DurationBlock.js +2 -2
  17. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +19 -0
  18. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +27 -0
  19. package/dist/ui/FlexibleBlock.js +2 -4
  20. package/dist/ui/KuposButton/KuposButton.d.ts +12 -0
  21. package/dist/ui/KuposButton/KuposButton.js +12 -0
  22. package/dist/ui/PetBlock.js +1 -3
  23. package/dist/ui/RatingBlock.js +6 -2
  24. package/dist/ui/SeatSection/SeatSection.d.ts +17 -0
  25. package/dist/ui/SeatSection/SeatSection.js +92 -0
  26. package/dist/ui/TopAmenities/TopAmenities.d.ts +12 -0
  27. package/dist/ui/TopAmenities/TopAmenities.js +32 -0
  28. package/dist/ui/mobileweb/BottomAmenitiesMobile.d.ts +23 -0
  29. package/dist/ui/mobileweb/BottomAmenitiesMobile.js +37 -0
  30. package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +23 -0
  31. package/dist/ui/mobileweb/DateTimeSectionMobile.js +57 -0
  32. package/dist/ui/mobileweb/SeatSectionMobile.d.ts +17 -0
  33. package/dist/ui/mobileweb/SeatSectionMobile.js +100 -0
  34. package/dist/ui/mobileweb/TopAmenitieMobile.d.ts +10 -0
  35. package/dist/ui/mobileweb/TopAmenitieMobile.js +35 -0
  36. package/package.json +1 -1
  37. package/src/assets/images/anims/service_list/bomb.json +1 -0
  38. package/src/assets/images/anims/service_list/directo.json +1 -1
  39. package/src/assets/images/anims/service_list/priority_stage.json +1 -1
  40. package/src/components/ServiceItem/ServiceItemDesktop.tsx +222 -465
  41. package/src/components/ServiceItem/ServiceItemMobile.tsx +120 -501
  42. package/src/components/ServiceItem/mobileTypes.ts +3 -0
  43. package/src/components/ServiceItem/types.ts +7 -0
  44. package/src/ui/AmenitiesBlock.tsx +115 -97
  45. package/src/ui/BottomAmenities/BottomAmenities.tsx +109 -0
  46. package/src/ui/DurationBlock.tsx +2 -2
  47. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +85 -0
  48. package/src/ui/FlexibleBlock.tsx +3 -3
  49. package/src/ui/KuposButton/KuposButton.tsx +48 -0
  50. package/src/ui/PetBlock.tsx +2 -2
  51. package/src/ui/RatingBlock.tsx +16 -4
  52. package/src/ui/SeatSection/SeatSection.tsx +187 -0
  53. package/src/ui/TopAmenities/TopAmenities.tsx +82 -0
  54. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +168 -0
  55. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +192 -0
  56. package/src/ui/mobileweb/SeatSectionMobile.tsx +256 -0
  57. package/src/ui/mobileweb/TopAmenitieMobile.tsx +82 -0
@@ -1,7 +1,9 @@
1
1
  import React from "react";
2
2
  import LottiePlayer from "../../assets/LottiePlayer";
3
- import DateService from "../../utils/DateService";
4
3
  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";
5
7
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
6
8
  const exceptions = [
7
9
  "gy",
@@ -18,6 +20,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
18
20
  var _a, _b, _c;
19
21
  const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
20
22
  let isSoldOut = serviceItem.available_seats <= 0;
23
+ const showPromo = Math.random() > 0.5;
21
24
  const labelId = typeof serviceItem.boarding_stages === "string"
22
25
  ? serviceItem.boarding_stages.split("|")[0]
23
26
  : "";
@@ -35,146 +38,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
35
38
  return "";
36
39
  }
37
40
  };
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
- };
178
41
  const amenities = () => {
179
42
  var _a;
180
43
  const raw = (_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[3];
@@ -185,7 +48,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
185
48
  : [];
186
49
  const nodes = list.slice(0, 2).map((am, i) => {
187
50
  var _a;
188
- return (React.createElement("img", { key: i, className: "amenity", height: 14, width: 14,
51
+ return (React.createElement("img", { key: i, className: "amenity", height: 12, width: 12,
189
52
  // src={getAmenitiesImage(amenitiesData?.[am]?.toLowerCase())}
190
53
  src: commonService.getAmenitiesImage((_a = amenitiesData === null || amenitiesData === void 0 ? void 0 : amenitiesData[am]) === null || _a === void 0 ? void 0 : _a.toLowerCase(), serviceItem), alt: "icon" }));
191
54
  });
@@ -205,140 +68,52 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
205
68
  if (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_transpordo) {
206
69
  isConexion = true;
207
70
  }
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
- }
231
71
  return (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[14px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
232
72
  isConexion ||
233
73
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
234
74
  showTopLabel
235
- ? "mt-[20px]"
75
+ ? "mt-[10px]"
236
76
  : "mt-[10px]"} `, style: { backgroundColor: "#fff", zIndex: 1 } },
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" },
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" },
246
97
  React.createElement("div", { className: "w-[120px] overflow-y-hidden" },
247
98
  React.createElement("img", { src: serviceItem.operator_details[0], alt: "service logo", className: `w-[100px] h-auto object-contain ${isSoldOut ? "grayscale" : ""}` })),
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" },
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" },
335
101
  React.createElement("div", { className: "flex items-center" },
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 })))))),
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
+ } })),
342
117
  (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: {
343
118
  backgroundColor: isSoldOut ? "#ccc" : colors === null || colors === void 0 ? void 0 : colors.bottomStripColor,
344
119
  zIndex: -1,
@@ -348,28 +123,6 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
348
123
  } },
349
124
  React.createElement(LottiePlayer, { animationData: serviceItem.icons.promoAnim, width: "18px", height: "18px" }),
350
125
  React.createElement("span", { className: "ml-[10px] text-[#fff] min-[380px]:text-[11px] text-[10px]" }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text))),
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")))))));
126
+ React.createElement("div", { className: "absolute -top-[14px] left-0 w-full flex items-center justify-end gap-[12px] pr-[20px] z-10 " }))));
374
127
  }
375
128
  export default ServiceItemMobile;
@@ -110,6 +110,9 @@ export interface MobileServiceItemProps {
110
110
  seatFallBackIcon: string;
111
111
  headPhoneIcon?: string;
112
112
  allowCancellationIcon?: string;
113
+ bombAnim?: string;
114
+ whiteBoardingIcon?: string;
115
+ downArrow?: string;
113
116
  [key: string]: string | Record<string, string | undefined> | undefined;
114
117
  };
115
118
  useLottieFor?: string[];
@@ -115,6 +115,9 @@ export interface ServiceItemProps {
115
115
  seatFallBackIcon: string;
116
116
  headPhoneIcon?: string;
117
117
  allowCancellationIcon?: string;
118
+ whiteBoardingIcon?: string;
119
+ bombJson?: string;
120
+ downArrow?: string;
118
121
  [key: string]: string | Record<string, string | undefined> | undefined;
119
122
  };
120
123
  useLottieFor?: string[];
@@ -190,7 +193,11 @@ export interface ServiceItemProps {
190
193
  petFriendlyAnim?: string;
191
194
  priorityStageAnim?: string;
192
195
  promoAnim?: string;
196
+ bombAnimation?: string;
193
197
  isPeru?: boolean;
194
198
  siteType?: "kupos" | "pullman" | "opsites" | "linatal";
195
199
  isAllinBus?: boolean;
200
+ isExpand?: any;
201
+ setIsExpand?: (value: any) => void;
202
+ coachKey?: number;
196
203
  }
package/dist/styles.css CHANGED
@@ -3,6 +3,9 @@
3
3
  .pointer-events-none {
4
4
  pointer-events: none;
5
5
  }
6
+ .visible {
7
+ visibility: visible;
8
+ }
6
9
  .absolute {
7
10
  position: absolute;
8
11
  }
@@ -27,6 +30,9 @@
27
30
  .-top-\[14px\] {
28
31
  top: calc(14px * -1);
29
32
  }
33
+ .-top-\[16px\] {
34
+ top: calc(16px * -1);
35
+ }
30
36
  .top-\[2px\] {
31
37
  top: 2px;
32
38
  }
@@ -42,6 +48,9 @@
42
48
  .top-\[88\%\] {
43
49
  top: 88%;
44
50
  }
51
+ .right-\[0\] {
52
+ right: 0;
53
+ }
45
54
  .-bottom-\[9\%\] {
46
55
  bottom: calc(9% * -1);
47
56
  }
@@ -78,6 +87,9 @@
78
87
  .left-\[80px\] {
79
88
  left: 80px;
80
89
  }
90
+ .-z-9 {
91
+ z-index: calc(9 * -1);
92
+ }
81
93
  .-z-10 {
82
94
  z-index: calc(10 * -1);
83
95
  }
@@ -117,18 +129,27 @@
117
129
  .-mt-\[5px\] {
118
130
  margin-top: calc(5px * -1);
119
131
  }
132
+ .-mt-\[16px\] {
133
+ margin-top: calc(16px * -1);
134
+ }
120
135
  .mt-\[2px\] {
121
136
  margin-top: 2px;
122
137
  }
123
138
  .mt-\[5px\] {
124
139
  margin-top: 5px;
125
140
  }
141
+ .mt-\[6px\] {
142
+ margin-top: 6px;
143
+ }
126
144
  .mt-\[10px\] {
127
145
  margin-top: 10px;
128
146
  }
129
147
  .mt-\[13px\] {
130
148
  margin-top: 13px;
131
149
  }
150
+ .mt-\[14px\] {
151
+ margin-top: 14px;
152
+ }
132
153
  .mt-\[15px\] {
133
154
  margin-top: 15px;
134
155
  }
@@ -171,9 +192,6 @@
171
192
  .mb-\[5px\] {
172
193
  margin-bottom: 5px;
173
194
  }
174
- .mb-\[8px\] {
175
- margin-bottom: 8px;
176
- }
177
195
  .mb-\[10px\] {
178
196
  margin-bottom: 10px;
179
197
  }
@@ -201,6 +219,9 @@
201
219
  .ml-\[3px\] {
202
220
  margin-left: 3px;
203
221
  }
222
+ .ml-\[4px\] {
223
+ margin-left: 4px;
224
+ }
204
225
  .ml-\[5px\] {
205
226
  margin-left: 5px;
206
227
  }
@@ -297,6 +318,9 @@
297
318
  .w-\[50\%\] {
298
319
  width: 50%;
299
320
  }
321
+ .w-\[55\%\] {
322
+ width: 55%;
323
+ }
300
324
  .w-\[60\%\] {
301
325
  width: 60%;
302
326
  }
@@ -318,6 +342,9 @@
318
342
  .w-\[130px\] {
319
343
  width: 130px;
320
344
  }
345
+ .w-\[150px\] {
346
+ width: 150px;
347
+ }
321
348
  .w-\[188px\] {
322
349
  width: 188px;
323
350
  }
@@ -342,6 +369,13 @@
342
369
  .w-full {
343
370
  width: 100%;
344
371
  }
372
+ .w-max {
373
+ width: -moz-max-content;
374
+ width: max-content;
375
+ }
376
+ .max-w-\[120px\] {
377
+ max-width: 120px;
378
+ }
345
379
  .max-w-\[165px\] {
346
380
  max-width: 165px;
347
381
  }
@@ -371,12 +405,15 @@
371
405
  .cursor-pointer {
372
406
  cursor: pointer;
373
407
  }
374
- .\[grid-template-columns\:14\%_30\%_2\.5\%_30\%_15\.5\%\] {
375
- grid-template-columns: 14% 30% 2.5% 30% 15.5%;
376
- }
377
408
  .\[grid-template-columns\:14\%_40\%_0\.5\%_24\%_13\.5\%\] {
378
409
  grid-template-columns: 14% 40% 0.5% 24% 13.5%;
379
410
  }
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
+ }
380
417
  .grid-cols-\[0\.8fr_auto_26\%_1fr\] {
381
418
  grid-template-columns: 0.8fr auto 26% 1fr;
382
419
  }
@@ -509,9 +546,6 @@
509
546
  --tw-border-style: none;
510
547
  border-style: none;
511
548
  }
512
- .border-\[\#E6E6E6\] {
513
- border-color: #E6E6E6;
514
- }
515
549
  .border-\[\#ccc\] {
516
550
  border-color: #ccc;
517
551
  }
@@ -570,9 +604,6 @@
570
604
  .p-\[10px_15px\] {
571
605
  padding: 10px 15px;
572
606
  }
573
- .p-\[12px\] {
574
- padding: 12px;
575
- }
576
607
  .p-\[15px\] {
577
608
  padding: 15px;
578
609
  }
@@ -588,6 +619,9 @@
588
619
  .px-\[14px\] {
589
620
  padding-inline: 14px;
590
621
  }
622
+ .px-\[15px\] {
623
+ padding-inline: 15px;
624
+ }
591
625
  .px-\[20px\] {
592
626
  padding-inline: 20px;
593
627
  }
@@ -600,6 +634,9 @@
600
634
  .py-\[6px\] {
601
635
  padding-block: 6px;
602
636
  }
637
+ .py-\[10px\] {
638
+ padding-block: 10px;
639
+ }
603
640
  .py-\[12px\] {
604
641
  padding-block: 12px;
605
642
  }
@@ -609,12 +646,18 @@
609
646
  .pt-\[5px\] {
610
647
  padding-top: 5px;
611
648
  }
649
+ .pt-\[6px\] {
650
+ padding-top: 6px;
651
+ }
612
652
  .pt-\[10px\] {
613
653
  padding-top: 10px;
614
654
  }
615
655
  .pt-\[20px\] {
616
656
  padding-top: 20px;
617
657
  }
658
+ .pt-\[26px\] {
659
+ padding-top: 26px;
660
+ }
618
661
  .pt-\[35px\] {
619
662
  padding-top: 35px;
620
663
  }
@@ -636,6 +679,12 @@
636
679
  .pb-\[10px\] {
637
680
  padding-bottom: 10px;
638
681
  }
682
+ .pb-\[14px\] {
683
+ padding-bottom: 14px;
684
+ }
685
+ .pl-\[6px\] {
686
+ padding-left: 6px;
687
+ }
639
688
  .pl-\[15px\] {
640
689
  padding-left: 15px;
641
690
  }
@@ -691,6 +740,9 @@
691
740
  overflow-wrap: normal;
692
741
  word-break: normal;
693
742
  }
743
+ .text-ellipsis {
744
+ text-overflow: ellipsis;
745
+ }
694
746
  .whitespace-normal {
695
747
  white-space: normal;
696
748
  }
@@ -724,6 +776,9 @@
724
776
  .uppercase {
725
777
  text-transform: uppercase;
726
778
  }
779
+ .line-through {
780
+ text-decoration-line: line-through;
781
+ }
727
782
  .opacity-0 {
728
783
  opacity: 0%;
729
784
  }