kupos-ui-components-lib 9.9.2 → 9.9.4

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 (43) hide show
  1. package/dist/KuposUIComponent.d.ts +0 -3
  2. package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +2 -2
  4. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemDesktop.js +31 -30
  6. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +17 -43
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +2 -48
  9. package/dist/components/ServiceItem/types.d.ts +9 -27
  10. package/dist/styles.css +6 -215
  11. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +2 -1
  12. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +5 -3
  13. package/dist/ui/OfferBanner.d.ts +0 -2
  14. package/dist/ui/OfferBanner.js +14 -19
  15. package/dist/ui/SeatSection/SeatSection.d.ts +7 -1
  16. package/dist/ui/SeatSection/SeatSection.js +41 -12
  17. package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +2 -1
  18. package/dist/ui/mobileweb/DateTimeSectionMobile.js +7 -5
  19. package/dist/ui/mobileweb/ExpandedDropdownMobile.js +1 -1
  20. package/dist/ui/mobileweb/SeatSectionMobile.d.ts +2 -1
  21. package/dist/ui/mobileweb/SeatSectionMobile.js +15 -10
  22. package/dist/utils/CommonService.d.ts +1 -4
  23. package/dist/utils/CommonService.js +6 -19
  24. package/package.json +1 -1
  25. package/src/KuposUIComponent.tsx +0 -3
  26. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +24 -35
  27. package/src/components/ServiceItem/ServiceItemDesktop.tsx +53 -65
  28. package/src/components/ServiceItem/ServiceItemMobile.tsx +290 -387
  29. package/src/components/ServiceItem/mobileTypes.ts +8 -50
  30. package/src/components/ServiceItem/types.ts +25 -39
  31. package/src/styles.css +0 -15
  32. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +5 -3
  33. package/src/ui/OfferBanner.tsx +10 -31
  34. package/src/ui/SeatSection/SeatSection.tsx +86 -21
  35. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +38 -33
  36. package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +1 -1
  37. package/src/ui/mobileweb/SeatSectionMobile.tsx +12 -7
  38. package/src/utils/CommonService.ts +8 -27
  39. package/src/assets/images/anims/service_list/flame_anim.json +0 -1
  40. package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
  41. package/src/assets/images/anims/service_list/users_anim.json +0 -1
  42. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -575
  43. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -610
@@ -27,8 +27,6 @@ import bombAnimation from "../../assets/images/anims/service_list/bomb.json";
27
27
  import dotAnimation from "../../assets/images/anims/service_list/dot_animation.json";
28
28
  import starAnimation from "../../assets/images/anims/service_list/star_anim.json";
29
29
  import femaleAnimation from "../../assets/images/anims/service_list/female_anim.json";
30
- import usersAnimation from "../../assets/images/anims/service_list/users_anim.json";
31
- import flameAnimation from "../../assets/images/anims/service_list/flame_anim.json";
32
30
 
33
31
  import RatingBlock from "../../ui/RatingBlock";
34
32
  import DurationBlock from "../../ui/DurationBlock";
@@ -39,9 +37,6 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
39
37
  import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
40
38
  import SeatSection from "../../ui/SeatSection/SeatSection";
41
39
  import DateTimeSection from "../../ui/DateTimeSection/DateTimeSection";
42
- import FeatureServiceUi from "../../ui/FeatureServiceUI/FeatureServiceUi";
43
-
44
- import thunderAnimation from "../../assets/images/anims/service_list/thunder_icon.json";
45
40
  import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
46
41
 
47
42
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
@@ -76,9 +71,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
76
71
  bombAnimation: {
77
72
  kupos: bombAnimation,
78
73
  },
79
- thunderAnimation: {
80
- kupos: thunderAnimation,
81
- },
82
74
  dotAnimation: {
83
75
  kupos: dotAnimation,
84
76
  },
@@ -88,12 +80,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
88
80
  femaaleAnimation: {
89
81
  kupos: femaleAnimation,
90
82
  },
91
- usersAnimation: {
92
- kupos: usersAnimation,
93
- },
94
- flameAnimation: {
95
- kupos: flameAnimation,
96
- },
97
83
  };
98
84
 
99
85
  function ServiceItemPB({
@@ -127,22 +113,28 @@ function ServiceItemPB({
127
113
  setIsExpand,
128
114
  coachKey,
129
115
  viewersConfig,
130
- isNewUi,
131
116
  showLoginModal,
132
117
  isLoggedIn,
133
118
  showLoginOption,
134
- isFeatureDropDownExpand,
135
- setIsFeatureDropDownExpand,
136
- ticketQuantity,
137
- onIncreaseTicketQuantity,
138
- onDecreaseTicketQuantity,
139
- onRemateUiButtonClick,
140
- selectedTimeSlot,
141
- onTimeSlotChange,
142
- isTimeDropdownOpen,
143
- onTimeDropdownToggle,
144
- wowDealData,
119
+ isTrain,
120
+ selectedSeatKey,
121
+ onSeatSelect,
122
+ onTrainButtonClick,
123
+ showSeatSelectionError,
124
+ onShowSeatSelectionError,
125
+ onClearSeatSelectionError,
126
+ isFlores,
127
+ operatorLabel,
145
128
  }: ServiceItemProps & { currencySign?: string }): React.ReactElement {
129
+ const handleSeatSelect = (
130
+ key: any,
131
+ price: number,
132
+ seatKey: string,
133
+ apiSeatType?: string,
134
+ ) => {
135
+ onClearSeatSelectionError?.();
136
+ onSeatSelect?.(key, price, seatKey, apiSeatType);
137
+ };
146
138
  const getAnimationIcon = (icon: string) => {
147
139
  const animation = ANIMATION_MAP[icon];
148
140
  if (!animation) return null;
@@ -204,7 +196,6 @@ function ServiceItemPB({
204
196
  const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
205
197
  const grayscaleClass = isSoldOut ? "grayscale" : "";
206
198
  const hasOfferText = Boolean(serviceItem?.offer_text);
207
- const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
208
199
 
209
200
  const seats = removeDuplicateSeats
210
201
  ? serviceItem.seat_types?.filter(
@@ -231,7 +222,7 @@ function ServiceItemPB({
231
222
  const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
232
223
  const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
233
224
  const serviceCardStyle: React.CSSProperties =
234
- (hasOfferText && isNewUiEnabled) || hasDpEnabled
225
+ hasOfferText || hasDpEnabled
235
226
  ? {
236
227
  borderColor: "transparent",
237
228
  borderStyle: "solid",
@@ -340,6 +331,17 @@ function ServiceItemPB({
340
331
  return;
341
332
  }
342
333
 
334
+ if (isTrain) {
335
+ if (!selectedSeatKey) {
336
+ onShowSeatSelectionError?.(serviceItem.id);
337
+ return;
338
+ }
339
+ if (onTrainButtonClick) {
340
+ onTrainButtonClick();
341
+ return;
342
+ }
343
+ }
344
+
343
345
  onBookButtonPress();
344
346
  };
345
347
 
@@ -441,37 +443,7 @@ function ServiceItemPB({
441
443
  isPeru={isPeru}
442
444
  siteType={siteType}
443
445
  isAllinBus={isAllinBus}
444
- isNewUiEnabled={isNewUiEnabled}
445
- />
446
- ) : isNewUi ? (
447
- <FeatureServiceUi
448
- serviceItem={serviceItem}
449
- showTopLabel={showTopLabel}
450
- isSoldOut={isSoldOut}
451
- getAnimationIcon={getAnimationIcon}
452
- cityOrigin={cityOrigin}
453
- cityDestination={cityDestination}
454
- renderIcon={renderIcon}
455
- viewersConfig={viewersConfig}
456
- isFeatureDropDownExpand={isFeatureDropDownExpand}
457
- ticketQuantity={ticketQuantity}
458
- onIncreaseTicketQuantity={onIncreaseTicketQuantity}
459
- onDecreaseTicketQuantity={onDecreaseTicketQuantity}
460
- onBookButtonPress={onRemateUiButtonClick}
461
- onToggleExpand={() =>
462
- setIsFeatureDropDownExpand &&
463
- setIsFeatureDropDownExpand(
464
- isFeatureDropDownExpand === serviceItem.id ||
465
- isFeatureDropDownExpand === true
466
- ? null
467
- : serviceItem.id,
468
- )
469
- }
470
- selectedTimeSlot={selectedTimeSlot}
471
- onTimeSlotChange={onTimeSlotChange}
472
- isTimeDropdownOpen={isTimeDropdownOpen}
473
- onTimeDropdownToggle={onTimeDropdownToggle}
474
- wowDealData={wowDealData}
446
+ isFlores={isFlores}
475
447
  />
476
448
  ) : (
477
449
  <div
@@ -494,15 +466,12 @@ function ServiceItemPB({
494
466
  viewersConfig={viewersConfig}
495
467
  getAnimationIcon={getAnimationIcon}
496
468
  showLoginOption={showLoginOption}
497
- isNewUiEnabled={isNewUiEnabled}
498
- colors={colors}
499
469
  />
500
470
  )}
501
471
  <div
502
472
  id={`service-card-${serviceItem.id}`}
503
473
  className={`bg-white mx-auto relative ${
504
- (hasOfferText && isNewUiEnabled) && !isSoldOut ||
505
- hasDpEnabled
474
+ (hasOfferText || hasDpEnabled) && !isSoldOut
506
475
  ? "z-[3] rounded-[18px]"
507
476
  : "rounded-[10px] border border-[#ccc]"
508
477
  }`}
@@ -586,6 +555,10 @@ function ServiceItemPB({
586
555
  isPeru={isPeru}
587
556
  renderIcon={renderIcon}
588
557
  discountSeatPriceColor={colors.discountSeatPriceColor}
558
+ isTrain={isTrain}
559
+ selectedSeatKey={selectedSeatKey}
560
+ onSeatSelect={handleSeatSelect}
561
+ topLabelColor={colors.topLabelColor}
589
562
  />
590
563
  </div>
591
564
 
@@ -601,6 +574,18 @@ function ServiceItemPB({
601
574
  soldOutIcon={renderIcon("soldOutIcon", "14px")}
602
575
  onClick={checkMidnight}
603
576
  />
577
+ {showSeatSelectionError === serviceItem.id && isTrain && (
578
+ <div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
579
+ <div
580
+ className="text-[9px] text-center whitespace-nowrap"
581
+ style={{
582
+ color: colors.seatPriceColor,
583
+ }}
584
+ >
585
+ Selecciona el tipo de servicio
586
+ </div>
587
+ </div>
588
+ )}
604
589
  {showLastSeats ? (
605
590
  <div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
606
591
  {serviceItem?.available_seats < 10 &&
@@ -647,7 +632,7 @@ function ServiceItemPB({
647
632
  "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
648
633
  position: "relative",
649
634
  zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
650
- marginTop: isItemExpanded ? "" : "-10px",
635
+ // marginTop: isItemExpanded ? "" : "-6px",
651
636
  }}
652
637
  >
653
638
  <div
@@ -655,7 +640,9 @@ function ServiceItemPB({
655
640
  overflow: "hidden",
656
641
  minHeight: 0,
657
642
  marginTop:
658
- hasDpEnabled || serviceItem?.offer_text ? "" : "-10px",
643
+ isItemExpanded && !(hasDpEnabled || serviceItem?.offer_text)
644
+ ? "-10px"
645
+ : "",
659
646
  ...(hasOfferText || hasDpEnabled
660
647
  ? {
661
648
  borderLeft: isSoldOut ? "" : "3px solid #ff5964",
@@ -676,6 +663,7 @@ function ServiceItemPB({
676
663
  ladiesBookedSeats={serviceItem.ladies_booked_seats}
677
664
  isDpEnabled={serviceItem.is_dp_enabled}
678
665
  renderIcon={renderIcon}
666
+ operatorLabel={operatorLabel}
679
667
  />
680
668
  </div>
681
669
  </div>