kupos-ui-components-lib 9.9.4 → 9.9.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 (42) hide show
  1. package/dist/KuposUIComponent.d.ts +3 -0
  2. package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +156 -176
  4. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemDesktop.js +29 -31
  6. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +43 -17
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +48 -2
  9. package/dist/components/ServiceItem/types.d.ts +27 -8
  10. package/dist/styles.css +219 -16
  11. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
  12. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
  13. package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +19 -4
  14. package/dist/ui/OfferBanner.d.ts +2 -0
  15. package/dist/ui/OfferBanner.js +22 -15
  16. package/dist/ui/SeatSection/SeatSection.d.ts +1 -7
  17. package/dist/ui/SeatSection/SeatSection.js +12 -41
  18. package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +1 -2
  19. package/dist/ui/mobileweb/DateTimeSectionMobile.js +5 -7
  20. package/dist/ui/mobileweb/SeatSectionMobile.d.ts +1 -2
  21. package/dist/ui/mobileweb/SeatSectionMobile.js +10 -15
  22. package/dist/utils/CommonService.d.ts +4 -1
  23. package/dist/utils/CommonService.js +19 -6
  24. package/package.json +1 -1
  25. package/src/KuposUIComponent.tsx +3 -0
  26. package/src/assets/images/anims/service_list/flame_anim.json +1 -0
  27. package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
  28. package/src/assets/images/anims/service_list/users_anim.json +1 -0
  29. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +404 -277
  30. package/src/components/ServiceItem/ServiceItemDesktop.tsx +71 -51
  31. package/src/components/ServiceItem/ServiceItemMobile.tsx +387 -290
  32. package/src/components/ServiceItem/mobileTypes.ts +50 -8
  33. package/src/components/ServiceItem/types.ts +32 -13
  34. package/src/styles.css +15 -0
  35. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
  36. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
  37. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +634 -0
  38. package/src/ui/OfferBanner.tsx +71 -43
  39. package/src/ui/SeatSection/SeatSection.tsx +21 -86
  40. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +33 -38
  41. package/src/ui/mobileweb/SeatSectionMobile.tsx +7 -12
  42. package/src/utils/CommonService.ts +27 -8
@@ -9,6 +9,7 @@ import SeatSectionMobile from "../../ui/mobileweb/SeatSectionMobile";
9
9
  import DateTimeSectionMobile from "../../ui/mobileweb/DateTimeSectionMobile";
10
10
  import ExpandedDropdownMobile from "../../ui/mobileweb/ExpandedDropdownMobile";
11
11
  import ServiceBadgesMobile from "../../ui/mobileweb/ServiceBadgesMobile";
12
+ import FeatureServiceUiMobile from "../../ui/FeaturServiceUiMobile/FeatureServiceUiMobile";
12
13
 
13
14
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
14
15
 
@@ -45,11 +46,25 @@ function ServiceItemMobile({
45
46
  removeDuplicateSeats,
46
47
  isLinatal,
47
48
  viewersConfig,
48
- operatorLabel,
49
- isTrain,
49
+ isFeatureDropDownExpand,
50
+ setIsFeatureDropDownExpand,
51
+ ticketQuantity,
52
+ onIncreaseTicketQuantity,
53
+ onDecreaseTicketQuantity,
54
+ cityOrigin,
55
+ cityDestination,
56
+ isNewUi,
57
+ onRemateUiButtonClick,
58
+ selectedTimeSlot,
59
+ onTimeSlotChange,
60
+ isTimeDropdownOpen,
61
+ onTimeDropdownToggle,
62
+ wowDealData,
63
+ isFlores,
50
64
  }: MobileServiceItemProps): React.ReactElement {
51
65
  const isItemExpanded = serviceItem.id === isExpanded;
52
66
  const isPetSeat = (Object.keys(serviceItem?.pet_seat_info) || []).length > 0;
67
+ const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
53
68
  let isSoldOut = serviceItem.available_seats <= 0;
54
69
 
55
70
  const seats = removeDuplicateSeats
@@ -74,7 +89,7 @@ function ServiceItemMobile({
74
89
  const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
75
90
  const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
76
91
  const serviceCardStyle: React.CSSProperties =
77
- hasOfferText || serviceItem?.is_dp_enabled
92
+ (hasOfferText && isNewUiEnabled) || serviceItem?.is_dp_enabled
78
93
  ? {
79
94
  borderColor: isSoldOut ? "#ccc" : "transparent",
80
95
  borderStyle: "solid",
@@ -155,318 +170,400 @@ function ServiceItemMobile({
155
170
  }
156
171
 
157
172
  return (
158
- <div
159
- className={`relative ${!serviceItem.offer_text || !serviceItem?.is_dp_enabled ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
160
- serviceItem?.is_direct_trip ||
161
- isConexion ||
162
- serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
163
- showTopLabel
164
- ? "mt-[20px]"
165
- : "mt-[10px]"
166
- } `}
167
- style={{ zIndex: 1 }}
168
- >
169
- <div
170
- className={`z-1 ${
171
- (hasOfferText || serviceItem?.is_dp_enabled) && !isSoldOut
172
- ? "rounded-[18px]"
173
- : "rounded-[10px] border border-[#ccc]"
174
- }`}
175
- style={{ ...serviceCardStyle, backgroundColor: "#fff" }}
176
- >
177
- <div style={{ padding: "12px 12px 8px 12px" }}>
178
- {/* Header with operator info and favorite */}
179
- <div className="flex justify-between items-center mb-[10px]">
180
- <div
181
- className="flex items-center justify-center gap-x-4"
182
- style={{
183
- marginBottom:
184
- serviceItem?.offer_text || hasDiscount ? "10px" : "",
185
- }}
186
- >
187
- <div className="w-[115px] overflow-y-hidden h-[22px]">
188
- <img
189
- src={serviceItem.operator_details[0]}
190
- alt="service logo"
191
- className={`w-[100px] h-auto object-contain ${
192
- isSoldOut ? "grayscale" : ""
193
- }`}
194
- />
195
- </div>
196
- {isCiva ? (
197
- <div className="black-text min-[420]:text-[12px] text-[12px]">
198
- {serviceItem?.operator_details[2]}
199
- </div>
200
- ) : showRating ? (
201
- <div className="flex min-[420]:text-[13px] text-[12px] h-[22px] items-center">
202
- <div className="flex items-center">
203
- <div className="flex items-center">
204
- <img
205
- src={serviceItem.icons.rating}
206
- alt="origin"
207
- className={`w-[12px] h-[12px] mr-[4px] object-contain ${
208
- isSoldOut ? "grayscale" : ""
209
- }`}
210
- />
211
- <span style={{ lineHeight: "normal" }}>
212
- {getServiceStars(serviceItem)}
213
- </span>
173
+ <>
174
+ {isNewUi ? (
175
+ <FeatureServiceUiMobile
176
+ serviceItem={serviceItem}
177
+ showTopLabel={showTopLabel}
178
+ colors={colors}
179
+ isSoldOut={isSoldOut}
180
+ cityOrigin={cityOrigin}
181
+ cityDestination={cityDestination}
182
+ renderIcon={renderIcon}
183
+ viewersConfig={viewersConfig}
184
+ isFeatureDropDownExpand={isFeatureDropDownExpand}
185
+ ticketQuantity={ticketQuantity}
186
+ onIncreaseTicketQuantity={onIncreaseTicketQuantity}
187
+ onDecreaseTicketQuantity={onDecreaseTicketQuantity}
188
+ onBookButtonPress={onRemateUiButtonClick}
189
+ onToggleExpand={() =>
190
+ setIsFeatureDropDownExpand &&
191
+ setIsFeatureDropDownExpand(
192
+ isFeatureDropDownExpand === serviceItem.id ||
193
+ isFeatureDropDownExpand === true
194
+ ? null
195
+ : serviceItem.id,
196
+ )
197
+ }
198
+ selectedTimeSlot={selectedTimeSlot}
199
+ onTimeSlotChange={onTimeSlotChange}
200
+ isTimeDropdownOpen={isTimeDropdownOpen}
201
+ onTimeDropdownToggle={onTimeDropdownToggle}
202
+ wowDealData={wowDealData}
203
+ />
204
+ ) : (
205
+ <div
206
+ className={`relative ${!serviceItem.offer_text || !serviceItem?.is_dp_enabled ? "mb-[14px]" : showTopLabel || serviceItem?.is_direct_trip ? "mb-[20px]" : "mb-[12px]"} ${
207
+ serviceItem?.is_direct_trip ||
208
+ isConexion ||
209
+ serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
210
+ showTopLabel
211
+ ? "mt-[20px]"
212
+ : "mt-[10px]"
213
+ } `}
214
+ style={{ zIndex: 1 }}
215
+ >
216
+ <div
217
+ className={`z-1 ${
218
+ ((hasOfferText && isNewUiEnabled) || serviceItem?.is_dp_enabled) && !isSoldOut
219
+ ? "rounded-[18px]"
220
+ : "rounded-[10px] border border-[#ccc]"
221
+ }`}
222
+ style={{ ...serviceCardStyle, backgroundColor: "#fff" }}
223
+ >
224
+ <div style={{ padding: "12px 12px 8px 12px" }}>
225
+ {/* Header with operator info and favorite */}
226
+ <div className="flex justify-between items-center mb-[10px]">
227
+ <div
228
+ className="flex items-center justify-center gap-x-4"
229
+ style={{
230
+ marginBottom:
231
+ serviceItem?.offer_text || hasDiscount ? "10px" : "",
232
+ }}
233
+ >
234
+ <div className={`w-[115px] ${isFlores ? "" : "overflow-y-hidden"} h-[22px]`}>
235
+ <img
236
+ src={serviceItem.operator_details[0]}
237
+ alt="service logo"
238
+ className={`w-[100px] h-auto object-contain ${
239
+ isSoldOut ? "grayscale" : ""
240
+ }`}
241
+ />
242
+ </div>
243
+ {isCiva ? (
244
+ <div className="black-text min-[420]:text-[12px] text-[12px]">
245
+ {serviceItem?.operator_details[2]}
214
246
  </div>
247
+ ) : showRating ? (
248
+ <div className="flex min-[420]:text-[13px] text-[12px] h-[22px] items-center">
249
+ <div className="flex items-center">
250
+ <div className="flex items-center">
251
+ <img
252
+ src={serviceItem.icons.rating}
253
+ alt="origin"
254
+ className={`w-[12px] h-[12px] mr-[4px] object-contain ${
255
+ isSoldOut ? "grayscale" : ""
256
+ }`}
257
+ />
258
+ <span style={{ lineHeight: "normal" }}>
259
+ {getServiceStars(serviceItem)}
260
+ </span>
261
+ </div>
215
262
 
216
- <div
217
- className="flex items-center cursor-pointer "
218
- style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
219
- >
220
- <span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]">
221
- {serviceItem.operator_details[2]}
222
- </span>
263
+ <div
264
+ className="flex items-center cursor-pointer "
265
+ style={{
266
+ color: isSoldOut ? "#bbb" : "text-[#464647]",
267
+ }}
268
+ >
269
+ <span className="ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]">
270
+ {serviceItem.operator_details[2]}
271
+ </span>
272
+ </div>
273
+ </div>
223
274
  </div>
224
- </div>
275
+ ) : null}
225
276
  </div>
226
- ) : null}
227
- </div>
228
- </div>
277
+ </div>
229
278
 
230
- <DateTimeSectionMobile
231
- onBookButtonPress={onBookButtonPress}
232
- isCiva={isCiva}
233
- isSoldOut={isSoldOut}
234
- isLinatal={isLinatal}
235
- isPeru={isPeru}
236
- orignLabel={orignLabel}
237
- destinationLabel={destinationLabel}
238
- originIcon={serviceItem.icons?.origin}
239
- destinationIcon={serviceItem.icons?.destination}
240
- travelDate={serviceItem.travel_date}
241
- arrivalDate={serviceItem.arrival_date}
242
- depTime={serviceItem.dep_time}
243
- arrTime={serviceItem.arr_time}
244
- seatTypes={serviceItem.seat_types}
245
- seatPriceColor={colors.seatPriceColor}
246
- tooltipBgColor={colors.tooltipBgColor}
247
- currencySign={currencySign}
248
- availableSeats={serviceItem.available_seats}
249
- removeDuplicateSeats={removeDuplicateSeats}
250
- serviceItem={serviceItem}
251
- showLastSeats={showLastSeats}
252
- discountSeatPriceColor={colors.discountSeatPriceColor}
253
- isTrain={isTrain}
254
- />
279
+ <DateTimeSectionMobile
280
+ onBookButtonPress={onBookButtonPress}
281
+ isCiva={isCiva}
282
+ isSoldOut={isSoldOut}
283
+ isLinatal={isLinatal}
284
+ isPeru={isPeru}
285
+ orignLabel={orignLabel}
286
+ destinationLabel={destinationLabel}
287
+ originIcon={serviceItem.icons?.origin}
288
+ destinationIcon={serviceItem.icons?.destination}
289
+ travelDate={serviceItem.travel_date}
290
+ arrivalDate={serviceItem.arrival_date}
291
+ depTime={serviceItem.dep_time}
292
+ arrTime={serviceItem.arr_time}
293
+ seatTypes={serviceItem.seat_types}
294
+ seatPriceColor={colors.seatPriceColor}
295
+ tooltipBgColor={colors.tooltipBgColor}
296
+ currencySign={currencySign}
297
+ availableSeats={serviceItem.available_seats}
298
+ removeDuplicateSeats={removeDuplicateSeats}
299
+ serviceItem={serviceItem}
300
+ showLastSeats={showLastSeats}
301
+ discountSeatPriceColor={colors.discountSeatPriceColor}
302
+ />
303
+
304
+ {hasDiscount && (
305
+ <div className="flex justify-end">
306
+ {isSoldOut ? (
307
+ <span className="col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]">
308
+ Agotado
309
+ </span>
310
+ ) : null}
311
+ </div>
312
+ )}
255
313
 
256
- {hasDiscount && (
257
- <div className="flex justify-end">
258
- {isSoldOut ? (
259
- <span className="col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]">
260
- Agotado
261
- </span>
314
+ {showLastSeats ? (
315
+ <div className="flex justify-end ">
316
+ {serviceItem?.available_seats < 10 &&
317
+ serviceItem?.available_seats > 0 && (
318
+ <div
319
+ className="text-[10px] text-center"
320
+ style={{
321
+ color: colors.tooltipBgColor,
322
+ }}
323
+ >
324
+ ¡Últimos Asientos!
325
+ </div>
326
+ )}
327
+ </div>
262
328
  ) : null}
263
- </div>
264
- )}
265
329
 
266
- {showLastSeats ? (
267
- <div className="flex justify-end ">
268
- {serviceItem?.available_seats < 10 &&
269
- serviceItem?.available_seats > 0 && (
270
- <div
271
- className="text-[10px] text-center"
272
- style={{
273
- color: colors.tooltipBgColor,
274
- }}
275
- >
276
- ¡Últimos Asientos!
277
- </div>
278
- )}
279
- </div>
280
- ) : null}
330
+ {/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
331
+ <div className="bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]"></div>
281
332
 
282
- {/* <div className="bg-[#E6E6E6] -ml-[12px] -mr-[12px] mt-[10px] mb-[10px] h-[1px]"></div> */}
283
- <div className="bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]"></div>
333
+ <BottomAmenitiesMobile
334
+ isSoldOut={isSoldOut}
335
+ amenitiesNodes={amenities()}
336
+ hoursIcon={renderIcon("hours", "14px")}
337
+ duration={serviceItem.duration?.toString()}
338
+ isDirectTrip={serviceItem?.is_direct_trip}
339
+ directoColor={colors.directoColor}
340
+ directoAnim={serviceItem.icons.directoAnim}
341
+ isChangeTicket={serviceItem.is_change_ticket}
342
+ isPetSeat={isPetSeat}
343
+ petSeatInfo={serviceItem.pet_seat_info}
344
+ petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
345
+ flexibleAnim={serviceItem.icons.flexibleAnim}
346
+ isTrackingEnabled={serviceItem?.is_tracking_enabled}
347
+ locationAnim={serviceItem.icons.locationAnim}
348
+ downArrowIcon={serviceItem.icons.downArrow}
349
+ showDropdown={isItemExpanded}
350
+ setShowDropdown={() =>
351
+ setIsExpanded(isItemExpanded ? null : serviceItem.id)
352
+ }
353
+ onDropdownToggle={() => {
354
+ setIsExpanded(isItemExpanded ? null : serviceItem.id);
355
+ }}
356
+ isPeru={isPeru}
357
+ femaleAnim={serviceItem.icons.femaleAnim}
358
+ ladiesBookedSeats={serviceItem.ladies_booked_seats}
359
+ isDpEnabled={serviceItem.is_dp_enabled}
360
+ />
361
+ </div>
284
362
 
285
- <BottomAmenitiesMobile
286
- isSoldOut={isSoldOut}
287
- amenitiesNodes={amenities()}
288
- hoursIcon={renderIcon("hours", "14px")}
289
- duration={serviceItem.duration?.toString()}
290
- isDirectTrip={serviceItem?.is_direct_trip}
291
- directoColor={colors.directoColor}
292
- directoAnim={serviceItem.icons.directoAnim}
293
- isChangeTicket={serviceItem.is_change_ticket}
294
- isPetSeat={isPetSeat}
295
- petSeatInfo={serviceItem.pet_seat_info}
296
- petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
297
- flexibleAnim={serviceItem.icons.flexibleAnim}
298
- isTrackingEnabled={serviceItem?.is_tracking_enabled}
299
- locationAnim={serviceItem.icons.locationAnim}
300
- downArrowIcon={serviceItem.icons.downArrow}
301
- showDropdown={isItemExpanded}
302
- setShowDropdown={() =>
303
- setIsExpanded(isItemExpanded ? null : serviceItem.id)
304
- }
305
- onDropdownToggle={() => {
306
- setIsExpanded(isItemExpanded ? null : serviceItem.id);
307
- }}
308
- isPeru={isPeru}
309
- femaleAnim={serviceItem.icons.femaleAnim}
310
- ladiesBookedSeats={serviceItem.ladies_booked_seats}
311
- isDpEnabled={serviceItem.is_dp_enabled}
312
- />
313
- </div>
363
+ <ServiceBadgesMobile
364
+ showTopLabel={showTopLabel}
365
+ isSoldOut={isSoldOut}
366
+ colors={colors}
367
+ renderIcon={renderIcon}
368
+ serviceItem={serviceItem}
369
+ isConexion={isConexion}
370
+ />
371
+ </div>
314
372
 
315
- <ServiceBadgesMobile
316
- showTopLabel={showTopLabel}
317
- isSoldOut={isSoldOut}
318
- colors={colors}
319
- renderIcon={renderIcon}
320
- serviceItem={serviceItem}
321
- isConexion={isConexion}
322
- />
323
- </div>
373
+ {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
374
+ {((serviceItem?.offer_text && !isNewUiEnabled)) &&
375
+ !isSoldOut && (
376
+ <div
377
+ className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
378
+ style={{
379
+ background: colors?.bottomStripColor,
380
+ borderRadius: "0 0 14px 14px",
381
+ zIndex: -1,
382
+ }}
383
+ >
384
+ <div
385
+ className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
386
+ style={{ lineHeight: 1.6 }}
387
+ >
388
+ <div className="flex justify-between items-center">
389
+ <div
390
+ className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
391
+ >
392
+ <div className={isLongOfferText ? "mt-[2px]" : ""}>
393
+ <LottiePlayer
394
+ animationData={serviceItem.icons.promoAnim}
395
+ width="14px"
396
+ height="14px"
397
+ />
398
+ </div>
399
+ <div
400
+ className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
401
+ style={{
402
+ color: "#fff",
403
+ lineHeight: 1.4,
404
+ }}
405
+ >
406
+ <span className="whitespace-nowrap min-[380px]:text-[12px]">
407
+ {serviceItem?.offer_text}
408
+ </span>
409
+ </div>
410
+ </div>
411
+ </div>
412
+ </div>
413
+ </div>
414
+ )}
324
415
 
325
- {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
326
- {(serviceItem?.offer_text || serviceItem?.is_dp_enabled) &&
327
- !isSoldOut && (
328
- <div
329
- className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
330
- style={{
331
- background: isSoldOut ? offerGradientWithOpacity : offerGradient,
332
- // opacity: isSoldOut ? 0.5 : 1,
333
- borderRadius: "0 0 14px 14px",
334
- zIndex: -1,
335
- }}
336
- >
337
- <div
338
- className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
339
- style={{ lineHeight: 1.6 }}
340
- >
341
- <div className="flex justify-between items-center">
342
- {serviceItem?.is_dp_enabled &&
343
- Object.keys(serviceItem?.dp_discount_percents ?? {}).length ===
344
- 0 &&
345
- (serviceItem?.dp_discounted_seats ?? []).length === 0 ? (
346
- <div className="flex items-center gap-[6px]">
347
- {/* {renderIcon("whiteFireIcon", "14px")} */}
348
- <LottiePlayer
349
- animationData={serviceItem.icons.starAnimation}
350
- width="14px"
351
- height="14px"
352
- />
416
+ {/* 🔹 EXPANDABLE DROPDOWN (below the card) */}
417
+ {((serviceItem?.offer_text && isNewUiEnabled) || serviceItem?.is_dp_enabled) &&
418
+ !isSoldOut && (
419
+ <div
420
+ className="px-[12px] pt-[22px] pb-[8px] relative -z-9 -mt-[15px]"
421
+ style={{
422
+ background: isSoldOut
423
+ ? offerGradientWithOpacity
424
+ : offerGradient,
425
+ // opacity: isSoldOut ? 0.5 : 1,
426
+ borderRadius: "0 0 14px 14px",
427
+ zIndex: -1,
428
+ }}
429
+ >
430
+ <div
431
+ className="flex flex-col gap-[8px] text-[12px] min-[420px]:text-[12px] text-[#464647]"
432
+ style={{ lineHeight: 1.6 }}
433
+ >
434
+ <div className="flex justify-between items-center">
435
+ {serviceItem?.is_dp_enabled &&
436
+ Object.keys(serviceItem?.dp_discount_percents ?? {})
437
+ .length === 0 &&
438
+ (serviceItem?.dp_discounted_seats ?? []).length === 0 ? (
439
+ <div className="flex items-center gap-[6px]">
440
+ {/* {renderIcon("whiteFireIcon", "14px")} */}
441
+ <LottiePlayer
442
+ animationData={serviceItem.icons.starAnimation}
443
+ width="14px"
444
+ height="14px"
445
+ />
353
446
 
354
- <span className="text-[#fff]">Más elegido</span>
355
- </div>
356
- ) : (
357
- <div
358
- className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
359
- >
360
- <div className={isLongOfferText ? "mt-[2px]" : ""}>
361
- <LottiePlayer
362
- animationData={serviceItem.icons.bombAnim}
363
- width="14px"
364
- height="14px"
365
- />
366
- </div>
447
+ <span className="text-[#fff]">Más elegido</span>
448
+ </div>
449
+ ) : (
450
+ <div
451
+ className={`flex ${(serviceItem?.offer_text || "").length > 10 ? "items-start" : "items-center"}`}
452
+ >
453
+ <div className={isLongOfferText ? "mt-[2px]" : ""}>
454
+ <LottiePlayer
455
+ animationData={serviceItem.icons.bombAnim}
456
+ width="14px"
457
+ height="14px"
458
+ />
459
+ </div>
460
+ <div
461
+ className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
462
+ style={{
463
+ color: "#fff",
464
+ lineHeight: 1.4,
465
+ }}
466
+ >
467
+ <span className="whitespace-nowrap min-[380px]:text-[12px]">
468
+ Termina en&nbsp;
469
+ <span
470
+ className="bold-text"
471
+ ref={(node) =>
472
+ commonService.startCountdown(node, 599)
473
+ }
474
+ style={{
475
+ fontVariantNumeric: "tabular-nums",
476
+ display: "inline-block",
477
+ }}
478
+ />
479
+ </span>
480
+ </div>
481
+ </div>
482
+ )}
367
483
  <div
368
- className={`ml-[4px] flex-1 outline-none ${isLongOfferText ? "mt-[2px]" : ""}`}
484
+ className="flex flex-col items-end"
369
485
  style={{
370
486
  color: "#fff",
371
- lineHeight: 1.4,
372
487
  }}
373
488
  >
374
- <span className="whitespace-nowrap min-[380px]:text-[12px]">
375
- Termina en&nbsp;
376
- <span
377
- className="bold-text"
378
- ref={(node) =>
379
- commonService.startCountdown(node, 599)
380
- }
381
- style={{
382
- fontVariantNumeric: "tabular-nums",
383
- display: "inline-block",
384
- }}
385
- />
386
- </span>
387
- </div>
388
- </div>
389
- )}
390
- <div
391
- className="flex flex-col items-end"
392
- style={{
393
- color: "#fff",
394
- }}
395
- >
396
- <div className="flex items-center">
397
- <div className="mr-[4px]">
398
- {" "}
399
- <LottiePlayer
400
- animationData={serviceItem.icons.dotAnimation}
401
- width="12px"
402
- height="12px"
403
- />
489
+ <div className="flex items-center">
490
+ <div className="mr-[4px]">
491
+ {" "}
492
+ <LottiePlayer
493
+ animationData={serviceItem.icons.dotAnimation}
494
+ width="12px"
495
+ height="12px"
496
+ />
497
+ </div>
498
+ <span className="flex-1" style={{ lineHeight: 1.4 }}>
499
+ <span
500
+ className="bold-text"
501
+ ref={(node) =>
502
+ commonService.startViewerCount(
503
+ node,
504
+ viewersConfig,
505
+ )
506
+ }
507
+ style={{ fontVariantNumeric: "tabular-nums" }}
508
+ />{" "}
509
+ <span> viendo</span> |{" "}
510
+ <span className="whitespace-nowrap">
511
+ {/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
512
+ <span
513
+ className="bold-text"
514
+ ref={(node) =>
515
+ commonService.startComprandoCount(node, 4, 16)
516
+ }
517
+ style={{ fontVariantNumeric: "tabular-nums" }}
518
+ />{" "}
519
+ comprando
520
+ </span>
521
+ </span>
522
+ </div>
404
523
  </div>
405
- <span className="flex-1" style={{ lineHeight: 1.4 }}>
406
- <span
407
- className="bold-text"
408
- ref={(node) =>
409
- commonService.startViewerCount(node, viewersConfig)
410
- }
411
- style={{ fontVariantNumeric: "tabular-nums" }}
412
- />{" "}
413
- <span> viendo</span> |{" "}
414
- <span className="whitespace-nowrap">
415
- {/* {serviceItem?.is_dp_enabled ? null : "Quedan pocos • "} */}
416
- <span
417
- className="bold-text"
418
- ref={(node) =>
419
- commonService.startComprandoCount(node, 4, 16)
420
- }
421
- style={{ fontVariantNumeric: "tabular-nums" }}
422
- />{" "}
423
- comprando
424
- </span>
425
- </span>
426
524
  </div>
427
525
  </div>
428
526
  </div>
527
+ )}
528
+ <div
529
+ style={{
530
+ display: "grid",
531
+ gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
532
+ opacity: isItemExpanded ? 1 : 0,
533
+ transition:
534
+ "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
535
+ position: "relative",
536
+ zIndex:
537
+ serviceItem?.offer_text || serviceItem?.is_dp_enabled ? -2 : -1,
538
+ }}
539
+ >
540
+ <div
541
+ style={{
542
+ overflow: "hidden",
543
+ minHeight: 0,
544
+ position: serviceItem?.offer_text ? "relative" : undefined,
545
+ zIndex: serviceItem?.offer_text ? -3 : undefined,
546
+ marginTop: serviceItem?.offer_text ? "-15px" : "-10px",
547
+ }}
548
+ >
549
+ <ExpandedDropdownMobile
550
+ serviceItem={serviceItem}
551
+ isPeru={isPeru}
552
+ petSeatInfo={serviceItem.pet_seat_info}
553
+ petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
554
+ isSoldOut={isSoldOut}
555
+ isChangeTicket={serviceItem.is_change_ticket === true}
556
+ ladiesBookedSeats={serviceItem.ladies_booked_seats}
557
+ isDpEnabled={serviceItem.is_dp_enabled}
558
+ femaleAnim={serviceItem.icons.femaleAnim}
559
+ flexibleAnim={serviceItem.icons.flexibleAnim}
560
+ renderIcon={renderIcon}
561
+ />
429
562
  </div>
430
563
  </div>
431
- )}
432
- <div
433
- style={{
434
- display: "grid",
435
- gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
436
- opacity: isItemExpanded ? 1 : 0,
437
- transition:
438
- "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
439
- position: "relative",
440
- zIndex:
441
- serviceItem?.offer_text || serviceItem?.is_dp_enabled ? -2 : -1,
442
- }}
443
- >
444
- <div
445
- style={{
446
- overflow: "hidden",
447
- minHeight: 0,
448
- position: serviceItem?.offer_text ? "relative" : undefined,
449
- zIndex: serviceItem?.offer_text ? -3 : undefined,
450
- marginTop: serviceItem?.offer_text ? "-15px" : "-10px",
451
- }}
452
- >
453
- <ExpandedDropdownMobile
454
- serviceItem={serviceItem}
455
- isPeru={isPeru}
456
- petSeatInfo={serviceItem.pet_seat_info}
457
- petFriendlyAnim={serviceItem.icons.petFriendlyAnim}
458
- isSoldOut={isSoldOut}
459
- isChangeTicket={serviceItem.is_change_ticket === true}
460
- ladiesBookedSeats={serviceItem.ladies_booked_seats}
461
- isDpEnabled={serviceItem.is_dp_enabled}
462
- femaleAnim={serviceItem.icons.femaleAnim}
463
- flexibleAnim={serviceItem.icons.flexibleAnim}
464
- renderIcon={renderIcon}
465
- operatorLabel={operatorLabel}
466
- />
467
564
  </div>
468
- </div>
469
- </div>
565
+ )}
566
+ </>
470
567
  );
471
568
  }
472
569