kupos-ui-components-lib 9.9.7 → 9.9.9
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.
- package/dist/KuposUIComponent.d.ts +3 -0
- package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +156 -176
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +28 -12
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +45 -17
- package/dist/components/ServiceItem/mobileTypes.d.ts +48 -0
- package/dist/components/ServiceItem/types.d.ts +27 -1
- package/dist/styles.css +219 -13
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +1 -2
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +2 -4
- package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +3 -10
- package/dist/ui/OfferBanner.d.ts +2 -0
- package/dist/ui/OfferBanner.js +22 -15
- package/dist/ui/SeatSection/SeatSection.js +3 -3
- package/dist/utils/CommonService.d.ts +3 -0
- package/dist/utils/CommonService.js +18 -1
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +3 -0
- package/src/assets/images/anims/service_list/flame_anim.json +1 -0
- package/src/assets/images/anims/service_list/thunder_icon.json +1 -0
- package/src/assets/images/anims/service_list/users_anim.json +1 -0
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +404 -277
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +71 -8
- package/src/components/ServiceItem/ServiceItemMobile.tsx +374 -271
- package/src/components/ServiceItem/mobileTypes.ts +48 -0
- package/src/components/ServiceItem/types.ts +32 -1
- package/src/styles.css +15 -0
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +2 -4
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +575 -0
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +634 -0
- package/src/ui/OfferBanner.tsx +71 -43
- package/src/ui/SeatSection/SeatSection.tsx +3 -3
- 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,6 +127,7 @@ function ServiceItemPB({
|
|
|
113
127
|
setIsExpand,
|
|
114
128
|
coachKey,
|
|
115
129
|
viewersConfig,
|
|
130
|
+
isNewUi,
|
|
116
131
|
showLoginModal,
|
|
117
132
|
isLoggedIn,
|
|
118
133
|
showLoginOption,
|
|
@@ -123,8 +138,18 @@ function ServiceItemPB({
|
|
|
123
138
|
showSeatSelectionError,
|
|
124
139
|
onShowSeatSelectionError,
|
|
125
140
|
onClearSeatSelectionError,
|
|
141
|
+
isFeatureDropDownExpand,
|
|
142
|
+
setIsFeatureDropDownExpand,
|
|
143
|
+
ticketQuantity,
|
|
144
|
+
onIncreaseTicketQuantity,
|
|
145
|
+
onDecreaseTicketQuantity,
|
|
146
|
+
onRemateUiButtonClick,
|
|
147
|
+
selectedTimeSlot,
|
|
148
|
+
onTimeSlotChange,
|
|
149
|
+
isTimeDropdownOpen,
|
|
150
|
+
onTimeDropdownToggle,
|
|
151
|
+
wowDealData,
|
|
126
152
|
isFlores,
|
|
127
|
-
operatorLabel,
|
|
128
153
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
129
154
|
const handleSeatSelect = (
|
|
130
155
|
key: any,
|
|
@@ -196,6 +221,7 @@ function ServiceItemPB({
|
|
|
196
221
|
const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
|
|
197
222
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
198
223
|
const hasOfferText = Boolean(serviceItem?.offer_text);
|
|
224
|
+
const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
|
|
199
225
|
|
|
200
226
|
const seats = removeDuplicateSeats
|
|
201
227
|
? serviceItem.seat_types?.filter(
|
|
@@ -222,7 +248,7 @@ function ServiceItemPB({
|
|
|
222
248
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
223
249
|
const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
|
|
224
250
|
const serviceCardStyle: React.CSSProperties =
|
|
225
|
-
hasOfferText || hasDpEnabled
|
|
251
|
+
(hasOfferText && isNewUiEnabled) || hasDpEnabled
|
|
226
252
|
? {
|
|
227
253
|
borderColor: "transparent",
|
|
228
254
|
borderStyle: "solid",
|
|
@@ -443,7 +469,45 @@ function ServiceItemPB({
|
|
|
443
469
|
isPeru={isPeru}
|
|
444
470
|
siteType={siteType}
|
|
445
471
|
isAllinBus={isAllinBus}
|
|
472
|
+
viewersConfig={viewersConfig}
|
|
473
|
+
isLoggedIn={isLoggedIn}
|
|
474
|
+
showLoginModal={showLoginModal}
|
|
475
|
+
isExpand={isExpand}
|
|
476
|
+
setIsExpand={setIsExpand}
|
|
477
|
+
coachKey={coachKey}
|
|
446
478
|
isFlores={isFlores}
|
|
479
|
+
isNewUiEnabled={isNewUiEnabled}
|
|
480
|
+
showLoginOption={showLoginOption}
|
|
481
|
+
/>
|
|
482
|
+
) : isNewUi ? (
|
|
483
|
+
<FeatureServiceUi
|
|
484
|
+
serviceItem={serviceItem}
|
|
485
|
+
showTopLabel={showTopLabel}
|
|
486
|
+
isSoldOut={isSoldOut}
|
|
487
|
+
getAnimationIcon={getAnimationIcon}
|
|
488
|
+
cityOrigin={cityOrigin}
|
|
489
|
+
cityDestination={cityDestination}
|
|
490
|
+
renderIcon={renderIcon}
|
|
491
|
+
viewersConfig={viewersConfig}
|
|
492
|
+
isFeatureDropDownExpand={isFeatureDropDownExpand}
|
|
493
|
+
ticketQuantity={ticketQuantity}
|
|
494
|
+
onIncreaseTicketQuantity={onIncreaseTicketQuantity}
|
|
495
|
+
onDecreaseTicketQuantity={onDecreaseTicketQuantity}
|
|
496
|
+
onBookButtonPress={onRemateUiButtonClick}
|
|
497
|
+
onToggleExpand={() =>
|
|
498
|
+
setIsFeatureDropDownExpand &&
|
|
499
|
+
setIsFeatureDropDownExpand(
|
|
500
|
+
isFeatureDropDownExpand === serviceItem.id ||
|
|
501
|
+
isFeatureDropDownExpand === true
|
|
502
|
+
? null
|
|
503
|
+
: serviceItem.id,
|
|
504
|
+
)
|
|
505
|
+
}
|
|
506
|
+
selectedTimeSlot={selectedTimeSlot}
|
|
507
|
+
onTimeSlotChange={onTimeSlotChange}
|
|
508
|
+
isTimeDropdownOpen={isTimeDropdownOpen}
|
|
509
|
+
onTimeDropdownToggle={onTimeDropdownToggle}
|
|
510
|
+
wowDealData={wowDealData}
|
|
447
511
|
/>
|
|
448
512
|
) : (
|
|
449
513
|
<div
|
|
@@ -466,12 +530,14 @@ function ServiceItemPB({
|
|
|
466
530
|
viewersConfig={viewersConfig}
|
|
467
531
|
getAnimationIcon={getAnimationIcon}
|
|
468
532
|
showLoginOption={showLoginOption}
|
|
533
|
+
isNewUiEnabled={isNewUiEnabled}
|
|
534
|
+
colors={colors}
|
|
469
535
|
/>
|
|
470
536
|
)}
|
|
471
537
|
<div
|
|
472
538
|
id={`service-card-${serviceItem.id}`}
|
|
473
539
|
className={`bg-white mx-auto relative ${
|
|
474
|
-
(hasOfferText
|
|
540
|
+
(hasOfferText && isNewUiEnabled && !isSoldOut) || hasDpEnabled
|
|
475
541
|
? "z-[3] rounded-[18px]"
|
|
476
542
|
: "rounded-[10px] border border-[#ccc]"
|
|
477
543
|
}`}
|
|
@@ -632,7 +698,7 @@ function ServiceItemPB({
|
|
|
632
698
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
633
699
|
position: "relative",
|
|
634
700
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
635
|
-
|
|
701
|
+
marginTop: isItemExpanded ? "" : "-10px",
|
|
636
702
|
}}
|
|
637
703
|
>
|
|
638
704
|
<div
|
|
@@ -640,9 +706,7 @@ function ServiceItemPB({
|
|
|
640
706
|
overflow: "hidden",
|
|
641
707
|
minHeight: 0,
|
|
642
708
|
marginTop:
|
|
643
|
-
|
|
644
|
-
? "-10px"
|
|
645
|
-
: "",
|
|
709
|
+
hasDpEnabled || serviceItem?.offer_text ? "" : "-10px",
|
|
646
710
|
...(hasOfferText || hasDpEnabled
|
|
647
711
|
? {
|
|
648
712
|
borderLeft: isSoldOut ? "" : "3px solid #ff5964",
|
|
@@ -663,7 +727,6 @@ function ServiceItemPB({
|
|
|
663
727
|
ladiesBookedSeats={serviceItem.ladies_booked_seats}
|
|
664
728
|
isDpEnabled={serviceItem.is_dp_enabled}
|
|
665
729
|
renderIcon={renderIcon}
|
|
666
|
-
operatorLabel={operatorLabel}
|
|
667
730
|
/>
|
|
668
731
|
</div>
|
|
669
732
|
</div>
|