kupos-ui-components-lib 9.9.3 → 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 (35) 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 +28 -12
  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 -1
  9. package/dist/components/ServiceItem/types.d.ts +27 -1
  10. package/dist/styles.css +219 -13
  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.js +3 -3
  17. package/dist/utils/CommonService.d.ts +3 -0
  18. package/dist/utils/CommonService.js +18 -1
  19. package/package.json +1 -1
  20. package/src/KuposUIComponent.tsx +3 -0
  21. package/src/assets/images/anims/service_list/flame_anim.json +1 -0
  22. package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
  23. package/src/assets/images/anims/service_list/users_anim.json +1 -0
  24. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +404 -277
  25. package/src/components/ServiceItem/ServiceItemDesktop.tsx +71 -8
  26. package/src/components/ServiceItem/ServiceItemMobile.tsx +387 -288
  27. package/src/components/ServiceItem/mobileTypes.ts +50 -7
  28. package/src/components/ServiceItem/types.ts +32 -1
  29. package/src/styles.css +15 -0
  30. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
  31. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
  32. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +634 -0
  33. package/src/ui/OfferBanner.tsx +71 -43
  34. package/src/ui/SeatSection/SeatSection.tsx +3 -3
  35. package/src/utils/CommonService.ts +26 -1
@@ -27,6 +27,8 @@ 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";
30
32
 
31
33
  import RatingBlock from "../../ui/RatingBlock";
32
34
  import DurationBlock from "../../ui/DurationBlock";
@@ -37,6 +39,9 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
37
39
  import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
38
40
  import SeatSection from "../../ui/SeatSection/SeatSection";
39
41
  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";
40
45
  import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
41
46
 
42
47
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
@@ -71,6 +76,9 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
71
76
  bombAnimation: {
72
77
  kupos: bombAnimation,
73
78
  },
79
+ thunderAnimation: {
80
+ kupos: thunderAnimation,
81
+ },
74
82
  dotAnimation: {
75
83
  kupos: dotAnimation,
76
84
  },
@@ -80,6 +88,12 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
80
88
  femaaleAnimation: {
81
89
  kupos: femaleAnimation,
82
90
  },
91
+ usersAnimation: {
92
+ kupos: usersAnimation,
93
+ },
94
+ flameAnimation: {
95
+ kupos: flameAnimation,
96
+ },
83
97
  };
84
98
 
85
99
  function ServiceItemPB({
@@ -113,11 +127,22 @@ function ServiceItemPB({
113
127
  setIsExpand,
114
128
  coachKey,
115
129
  viewersConfig,
130
+ isNewUi,
116
131
  showLoginModal,
117
132
  isLoggedIn,
118
133
  showLoginOption,
134
+ isFeatureDropDownExpand,
135
+ setIsFeatureDropDownExpand,
136
+ ticketQuantity,
137
+ onIncreaseTicketQuantity,
138
+ onDecreaseTicketQuantity,
139
+ onRemateUiButtonClick,
140
+ selectedTimeSlot,
141
+ onTimeSlotChange,
142
+ isTimeDropdownOpen,
143
+ onTimeDropdownToggle,
144
+ wowDealData,
119
145
  isFlores,
120
- operatorLabel,
121
146
  }: ServiceItemProps & { currencySign?: string }): React.ReactElement {
122
147
  const getAnimationIcon = (icon: string) => {
123
148
  const animation = ANIMATION_MAP[icon];
@@ -180,6 +205,7 @@ function ServiceItemPB({
180
205
  const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
181
206
  const grayscaleClass = isSoldOut ? "grayscale" : "";
182
207
  const hasOfferText = Boolean(serviceItem?.offer_text);
208
+ const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
183
209
 
184
210
  const seats = removeDuplicateSeats
185
211
  ? serviceItem.seat_types?.filter(
@@ -206,7 +232,7 @@ function ServiceItemPB({
206
232
  const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
207
233
  const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
208
234
  const serviceCardStyle: React.CSSProperties =
209
- hasOfferText || hasDpEnabled
235
+ (hasOfferText && isNewUiEnabled) || hasDpEnabled
210
236
  ? {
211
237
  borderColor: "transparent",
212
238
  borderStyle: "solid",
@@ -416,7 +442,45 @@ function ServiceItemPB({
416
442
  isPeru={isPeru}
417
443
  siteType={siteType}
418
444
  isAllinBus={isAllinBus}
445
+ viewersConfig={viewersConfig}
446
+ isLoggedIn={isLoggedIn}
447
+ showLoginModal={showLoginModal}
448
+ isExpand={isExpand}
449
+ setIsExpand={setIsExpand}
450
+ coachKey={coachKey}
419
451
  isFlores={isFlores}
452
+ isNewUiEnabled={isNewUiEnabled}
453
+ showLoginOption={showLoginOption}
454
+ />
455
+ ) : isNewUi ? (
456
+ <FeatureServiceUi
457
+ serviceItem={serviceItem}
458
+ showTopLabel={showTopLabel}
459
+ isSoldOut={isSoldOut}
460
+ getAnimationIcon={getAnimationIcon}
461
+ cityOrigin={cityOrigin}
462
+ cityDestination={cityDestination}
463
+ renderIcon={renderIcon}
464
+ viewersConfig={viewersConfig}
465
+ isFeatureDropDownExpand={isFeatureDropDownExpand}
466
+ ticketQuantity={ticketQuantity}
467
+ onIncreaseTicketQuantity={onIncreaseTicketQuantity}
468
+ onDecreaseTicketQuantity={onDecreaseTicketQuantity}
469
+ onBookButtonPress={onRemateUiButtonClick}
470
+ onToggleExpand={() =>
471
+ setIsFeatureDropDownExpand &&
472
+ setIsFeatureDropDownExpand(
473
+ isFeatureDropDownExpand === serviceItem.id ||
474
+ isFeatureDropDownExpand === true
475
+ ? null
476
+ : serviceItem.id,
477
+ )
478
+ }
479
+ selectedTimeSlot={selectedTimeSlot}
480
+ onTimeSlotChange={onTimeSlotChange}
481
+ isTimeDropdownOpen={isTimeDropdownOpen}
482
+ onTimeDropdownToggle={onTimeDropdownToggle}
483
+ wowDealData={wowDealData}
420
484
  />
421
485
  ) : (
422
486
  <div
@@ -439,12 +503,14 @@ function ServiceItemPB({
439
503
  viewersConfig={viewersConfig}
440
504
  getAnimationIcon={getAnimationIcon}
441
505
  showLoginOption={showLoginOption}
506
+ isNewUiEnabled={isNewUiEnabled}
507
+ colors={colors}
442
508
  />
443
509
  )}
444
510
  <div
445
511
  id={`service-card-${serviceItem.id}`}
446
512
  className={`bg-white mx-auto relative ${
447
- (hasOfferText || hasDpEnabled) && !isSoldOut
513
+ (hasOfferText && isNewUiEnabled && !isSoldOut) || hasDpEnabled
448
514
  ? "z-[3] rounded-[18px]"
449
515
  : "rounded-[10px] border border-[#ccc]"
450
516
  }`}
@@ -589,7 +655,7 @@ function ServiceItemPB({
589
655
  "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
590
656
  position: "relative",
591
657
  zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
592
- // marginTop: isItemExpanded ? "" : "-6px",
658
+ marginTop: isItemExpanded ? "" : "-10px",
593
659
  }}
594
660
  >
595
661
  <div
@@ -597,9 +663,7 @@ function ServiceItemPB({
597
663
  overflow: "hidden",
598
664
  minHeight: 0,
599
665
  marginTop:
600
- isItemExpanded && !(hasDpEnabled || serviceItem?.offer_text)
601
- ? "-10px"
602
- : "",
666
+ hasDpEnabled || serviceItem?.offer_text ? "" : "-10px",
603
667
  ...(hasOfferText || hasDpEnabled
604
668
  ? {
605
669
  borderLeft: isSoldOut ? "" : "3px solid #ff5964",
@@ -620,7 +684,6 @@ function ServiceItemPB({
620
684
  ladiesBookedSeats={serviceItem.ladies_booked_seats}
621
685
  isDpEnabled={serviceItem.is_dp_enabled}
622
686
  renderIcon={renderIcon}
623
- operatorLabel={operatorLabel}
624
687
  />
625
688
  </div>
626
689
  </div>