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