kupos-ui-components-lib 9.9.7 → 9.9.8
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 +29 -31
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +43 -17
- package/dist/components/ServiceItem/mobileTypes.d.ts +48 -2
- package/dist/components/ServiceItem/types.d.ts +27 -8
- package/dist/styles.css +219 -16
- 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.d.ts +1 -7
- package/dist/ui/SeatSection/SeatSection.js +12 -41
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +6 -12
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +1 -2
- package/dist/ui/mobileweb/SeatSectionMobile.js +14 -21
- package/dist/utils/CommonService.d.ts +4 -1
- package/dist/utils/CommonService.js +19 -6
- 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 -51
- package/src/components/ServiceItem/ServiceItemMobile.tsx +387 -290
- package/src/components/ServiceItem/mobileTypes.ts +50 -8
- package/src/components/ServiceItem/types.ts +32 -13
- 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 +21 -86
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +35 -44
- package/src/ui/mobileweb/SeatSectionMobile.tsx +11 -23
- package/src/utils/CommonService.ts +27 -8
|
@@ -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,28 +127,23 @@ function ServiceItemPB({
|
|
|
113
127
|
setIsExpand,
|
|
114
128
|
coachKey,
|
|
115
129
|
viewersConfig,
|
|
130
|
+
isNewUi,
|
|
116
131
|
showLoginModal,
|
|
117
132
|
isLoggedIn,
|
|
118
133
|
showLoginOption,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
134
|
+
isFeatureDropDownExpand,
|
|
135
|
+
setIsFeatureDropDownExpand,
|
|
136
|
+
ticketQuantity,
|
|
137
|
+
onIncreaseTicketQuantity,
|
|
138
|
+
onDecreaseTicketQuantity,
|
|
139
|
+
onRemateUiButtonClick,
|
|
140
|
+
selectedTimeSlot,
|
|
141
|
+
onTimeSlotChange,
|
|
142
|
+
isTimeDropdownOpen,
|
|
143
|
+
onTimeDropdownToggle,
|
|
144
|
+
wowDealData,
|
|
126
145
|
isFlores,
|
|
127
|
-
operatorLabel,
|
|
128
146
|
}: 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
|
-
};
|
|
138
147
|
const getAnimationIcon = (icon: string) => {
|
|
139
148
|
const animation = ANIMATION_MAP[icon];
|
|
140
149
|
if (!animation) return null;
|
|
@@ -196,6 +205,7 @@ function ServiceItemPB({
|
|
|
196
205
|
const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
|
|
197
206
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
198
207
|
const hasOfferText = Boolean(serviceItem?.offer_text);
|
|
208
|
+
const isNewUiEnabled = serviceItem?.discounts?.[0]?.new_ui_enabled === true;
|
|
199
209
|
|
|
200
210
|
const seats = removeDuplicateSeats
|
|
201
211
|
? serviceItem.seat_types?.filter(
|
|
@@ -222,7 +232,7 @@ function ServiceItemPB({
|
|
|
222
232
|
const offerGradient = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"} 0%, ${colors.leftGradiantColor || "#ff8842"} 100%)`;
|
|
223
233
|
const offerGradientWithOpacity = `linear-gradient(90deg, ${colors.rightGradiantColor || "#ff5964"}80 0%, ${colors.leftGradiantColor || "#ff8842"}80 100%)`;
|
|
224
234
|
const serviceCardStyle: React.CSSProperties =
|
|
225
|
-
hasOfferText || hasDpEnabled
|
|
235
|
+
(hasOfferText && isNewUiEnabled) || hasDpEnabled
|
|
226
236
|
? {
|
|
227
237
|
borderColor: "transparent",
|
|
228
238
|
borderStyle: "solid",
|
|
@@ -331,17 +341,6 @@ function ServiceItemPB({
|
|
|
331
341
|
return;
|
|
332
342
|
}
|
|
333
343
|
|
|
334
|
-
if (isTrain) {
|
|
335
|
-
if (!selectedSeatKey) {
|
|
336
|
-
onShowSeatSelectionError?.(serviceItem.id);
|
|
337
|
-
return;
|
|
338
|
-
}
|
|
339
|
-
if (onTrainButtonClick) {
|
|
340
|
-
onTrainButtonClick();
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
344
|
onBookButtonPress();
|
|
346
345
|
};
|
|
347
346
|
|
|
@@ -443,7 +442,45 @@ function ServiceItemPB({
|
|
|
443
442
|
isPeru={isPeru}
|
|
444
443
|
siteType={siteType}
|
|
445
444
|
isAllinBus={isAllinBus}
|
|
445
|
+
viewersConfig={viewersConfig}
|
|
446
|
+
isLoggedIn={isLoggedIn}
|
|
447
|
+
showLoginModal={showLoginModal}
|
|
448
|
+
isExpand={isExpand}
|
|
449
|
+
setIsExpand={setIsExpand}
|
|
450
|
+
coachKey={coachKey}
|
|
446
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}
|
|
447
484
|
/>
|
|
448
485
|
) : (
|
|
449
486
|
<div
|
|
@@ -466,12 +503,14 @@ function ServiceItemPB({
|
|
|
466
503
|
viewersConfig={viewersConfig}
|
|
467
504
|
getAnimationIcon={getAnimationIcon}
|
|
468
505
|
showLoginOption={showLoginOption}
|
|
506
|
+
isNewUiEnabled={isNewUiEnabled}
|
|
507
|
+
colors={colors}
|
|
469
508
|
/>
|
|
470
509
|
)}
|
|
471
510
|
<div
|
|
472
511
|
id={`service-card-${serviceItem.id}`}
|
|
473
512
|
className={`bg-white mx-auto relative ${
|
|
474
|
-
(hasOfferText
|
|
513
|
+
(hasOfferText && isNewUiEnabled && !isSoldOut) || hasDpEnabled
|
|
475
514
|
? "z-[3] rounded-[18px]"
|
|
476
515
|
: "rounded-[10px] border border-[#ccc]"
|
|
477
516
|
}`}
|
|
@@ -555,10 +594,6 @@ function ServiceItemPB({
|
|
|
555
594
|
isPeru={isPeru}
|
|
556
595
|
renderIcon={renderIcon}
|
|
557
596
|
discountSeatPriceColor={colors.discountSeatPriceColor}
|
|
558
|
-
isTrain={isTrain}
|
|
559
|
-
selectedSeatKey={selectedSeatKey}
|
|
560
|
-
onSeatSelect={handleSeatSelect}
|
|
561
|
-
topLabelColor={colors.topLabelColor}
|
|
562
597
|
/>
|
|
563
598
|
</div>
|
|
564
599
|
|
|
@@ -574,18 +609,6 @@ function ServiceItemPB({
|
|
|
574
609
|
soldOutIcon={renderIcon("soldOutIcon", "14px")}
|
|
575
610
|
onClick={checkMidnight}
|
|
576
611
|
/>
|
|
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
|
-
)}
|
|
589
612
|
{showLastSeats ? (
|
|
590
613
|
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
591
614
|
{serviceItem?.available_seats < 10 &&
|
|
@@ -632,7 +655,7 @@ function ServiceItemPB({
|
|
|
632
655
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
633
656
|
position: "relative",
|
|
634
657
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
635
|
-
|
|
658
|
+
marginTop: isItemExpanded ? "" : "-10px",
|
|
636
659
|
}}
|
|
637
660
|
>
|
|
638
661
|
<div
|
|
@@ -640,9 +663,7 @@ function ServiceItemPB({
|
|
|
640
663
|
overflow: "hidden",
|
|
641
664
|
minHeight: 0,
|
|
642
665
|
marginTop:
|
|
643
|
-
|
|
644
|
-
? "-10px"
|
|
645
|
-
: "",
|
|
666
|
+
hasDpEnabled || serviceItem?.offer_text ? "" : "-10px",
|
|
646
667
|
...(hasOfferText || hasDpEnabled
|
|
647
668
|
? {
|
|
648
669
|
borderLeft: isSoldOut ? "" : "3px solid #ff5964",
|
|
@@ -663,7 +684,6 @@ function ServiceItemPB({
|
|
|
663
684
|
ladiesBookedSeats={serviceItem.ladies_booked_seats}
|
|
664
685
|
isDpEnabled={serviceItem.is_dp_enabled}
|
|
665
686
|
renderIcon={renderIcon}
|
|
666
|
-
operatorLabel={operatorLabel}
|
|
667
687
|
/>
|
|
668
688
|
</div>
|
|
669
689
|
</div>
|