kupos-ui-components-lib 9.9.0 → 9.9.2

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 (36) 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 +2 -2
  4. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemDesktop.js +29 -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 -2
  10. package/dist/styles.css +215 -3
  11. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
  12. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
  13. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +22 -41
  14. package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +24 -44
  15. package/dist/ui/OfferBanner.d.ts +2 -0
  16. package/dist/ui/OfferBanner.js +19 -14
  17. package/dist/ui/SeatSection/SeatSection.js +3 -3
  18. package/dist/utils/CommonService.d.ts +3 -0
  19. package/dist/utils/CommonService.js +18 -1
  20. package/package.json +1 -1
  21. package/src/KuposUIComponent.tsx +3 -0
  22. package/src/assets/images/anims/service_list/flame_anim.json +1 -0
  23. package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
  24. package/src/assets/images/anims/service_list/users_anim.json +1 -0
  25. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +35 -24
  26. package/src/components/ServiceItem/ServiceItemDesktop.tsx +65 -10
  27. package/src/components/ServiceItem/ServiceItemMobile.tsx +387 -288
  28. package/src/components/ServiceItem/mobileTypes.ts +50 -7
  29. package/src/components/ServiceItem/types.ts +39 -13
  30. package/src/styles.css +15 -0
  31. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
  32. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
  33. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +610 -0
  34. package/src/ui/OfferBanner.tsx +31 -10
  35. package/src/ui/SeatSection/SeatSection.tsx +3 -3
  36. 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,21 @@ function ServiceItemPB({
113
127
  setIsExpand,
114
128
  coachKey,
115
129
  viewersConfig,
130
+ isNewUi,
116
131
  showLoginModal,
117
132
  isLoggedIn,
118
133
  showLoginOption,
119
- isFlores,
120
- operatorLabel,
134
+ isFeatureDropDownExpand,
135
+ setIsFeatureDropDownExpand,
136
+ ticketQuantity,
137
+ onIncreaseTicketQuantity,
138
+ onDecreaseTicketQuantity,
139
+ onRemateUiButtonClick,
140
+ selectedTimeSlot,
141
+ onTimeSlotChange,
142
+ isTimeDropdownOpen,
143
+ onTimeDropdownToggle,
144
+ wowDealData,
121
145
  }: ServiceItemProps & { currencySign?: string }): React.ReactElement {
122
146
  const getAnimationIcon = (icon: string) => {
123
147
  const animation = ANIMATION_MAP[icon];
@@ -180,6 +204,7 @@ function ServiceItemPB({
180
204
  const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
181
205
  const grayscaleClass = isSoldOut ? "grayscale" : "";
182
206
  const hasOfferText = Boolean(serviceItem?.offer_text);
207
+ const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
183
208
 
184
209
  const seats = removeDuplicateSeats
185
210
  ? serviceItem.seat_types?.filter(
@@ -206,7 +231,7 @@ function ServiceItemPB({
206
231
  const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
207
232
  const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
208
233
  const serviceCardStyle: React.CSSProperties =
209
- hasOfferText || hasDpEnabled
234
+ (hasOfferText && isNewUiEnabled) || hasDpEnabled
210
235
  ? {
211
236
  borderColor: "transparent",
212
237
  borderStyle: "solid",
@@ -416,7 +441,37 @@ function ServiceItemPB({
416
441
  isPeru={isPeru}
417
442
  siteType={siteType}
418
443
  isAllinBus={isAllinBus}
419
- isFlores={isFlores}
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}
420
475
  />
421
476
  ) : (
422
477
  <div
@@ -439,12 +494,15 @@ function ServiceItemPB({
439
494
  viewersConfig={viewersConfig}
440
495
  getAnimationIcon={getAnimationIcon}
441
496
  showLoginOption={showLoginOption}
497
+ isNewUiEnabled={isNewUiEnabled}
498
+ colors={colors}
442
499
  />
443
500
  )}
444
501
  <div
445
502
  id={`service-card-${serviceItem.id}`}
446
503
  className={`bg-white mx-auto relative ${
447
- (hasOfferText || hasDpEnabled) && !isSoldOut
504
+ (hasOfferText && isNewUiEnabled) && !isSoldOut ||
505
+ hasDpEnabled
448
506
  ? "z-[3] rounded-[18px]"
449
507
  : "rounded-[10px] border border-[#ccc]"
450
508
  }`}
@@ -589,7 +647,7 @@ function ServiceItemPB({
589
647
  "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
590
648
  position: "relative",
591
649
  zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
592
- // marginTop: isItemExpanded ? "" : "-6px",
650
+ marginTop: isItemExpanded ? "" : "-10px",
593
651
  }}
594
652
  >
595
653
  <div
@@ -597,9 +655,7 @@ function ServiceItemPB({
597
655
  overflow: "hidden",
598
656
  minHeight: 0,
599
657
  marginTop:
600
- isItemExpanded && !(hasDpEnabled || serviceItem?.offer_text)
601
- ? "-10px"
602
- : "",
658
+ hasDpEnabled || serviceItem?.offer_text ? "" : "-10px",
603
659
  ...(hasOfferText || hasDpEnabled
604
660
  ? {
605
661
  borderLeft: isSoldOut ? "" : "3px solid #ff5964",
@@ -620,7 +676,6 @@ function ServiceItemPB({
620
676
  ladiesBookedSeats={serviceItem.ladies_booked_seats}
621
677
  isDpEnabled={serviceItem.is_dp_enabled}
622
678
  renderIcon={renderIcon}
623
- operatorLabel={operatorLabel}
624
679
  />
625
680
  </div>
626
681
  </div>