kupos-ui-components-lib 9.8.5 → 9.8.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/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +3 -2
- package/dist/components/ServiceItem/types.d.ts +1 -0
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +2 -1
- package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +4 -2
- package/dist/ui/OfferBanner.js +7 -5
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +3 -0
- package/src/components/ServiceItem/types.ts +13 -12
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +4 -2
- package/src/ui/OfferBanner.tsx +7 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ServiceItemProps } from "./types";
|
|
3
|
-
declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, showLoginModal, isLoggedIn, showLoginOption, isFlores, }: ServiceItemProps & {
|
|
3
|
+
declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, showLoginModal, isLoggedIn, showLoginOption, isFlores, operatorLabel, }: ServiceItemProps & {
|
|
4
4
|
currencySign?: string;
|
|
5
5
|
}): React.ReactElement;
|
|
6
6
|
export default ServiceItemPB;
|
|
@@ -74,7 +74,7 @@ const ANIMATION_MAP = {
|
|
|
74
74
|
kupos: femaleAnimation,
|
|
75
75
|
},
|
|
76
76
|
};
|
|
77
|
-
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t = (key) => key, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, showLoginModal, isLoggedIn, showLoginOption, isFlores, }) {
|
|
77
|
+
function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, isPeru, t = (key) => key, siteType, isAllinBus, isExpand, setIsExpand, coachKey, viewersConfig, showLoginModal, isLoggedIn, showLoginOption, isFlores, operatorLabel, }) {
|
|
78
78
|
var _a;
|
|
79
79
|
const getAnimationIcon = (icon) => {
|
|
80
80
|
var _a;
|
|
@@ -290,6 +290,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
290
290
|
transition: "grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
291
291
|
position: "relative",
|
|
292
292
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
293
|
+
marginTop: isItemExpanded ? "" : "-6px",
|
|
293
294
|
} },
|
|
294
295
|
React.createElement("div", { style: Object.assign({ overflow: "hidden", minHeight: 0, marginTop: hasDpEnabled || (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) ? "" : "-10px" }, (hasOfferText || hasDpEnabled
|
|
295
296
|
? {
|
|
@@ -299,7 +300,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
299
300
|
boxSizing: "border-box",
|
|
300
301
|
}
|
|
301
302
|
: {})) },
|
|
302
|
-
React.createElement(ExpandedDropdown, { serviceItem: serviceItem, isPeru: isPeru, translation: translation, getAnimationIcon: getAnimationIcon, isChangeTicket: serviceItem.is_change_ticket === true, isSoldOut: isSoldOut, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, renderIcon: renderIcon })))),
|
|
303
|
+
React.createElement(ExpandedDropdown, { serviceItem: serviceItem, isPeru: isPeru, translation: translation, getAnimationIcon: getAnimationIcon, isChangeTicket: serviceItem.is_change_ticket === true, isSoldOut: isSoldOut, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, renderIcon: renderIcon, operatorLabel: operatorLabel })))),
|
|
303
304
|
children,
|
|
304
305
|
React.createElement(ServiceBadges, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem })))));
|
|
305
306
|
}
|
|
@@ -14,6 +14,7 @@ interface ExpandedDropdownProps {
|
|
|
14
14
|
ladiesBookedSeats?: string;
|
|
15
15
|
isDpEnabled?: boolean;
|
|
16
16
|
renderIcon?: any;
|
|
17
|
+
operatorLabel?: string;
|
|
17
18
|
}
|
|
18
|
-
declare function ExpandedDropdown({ serviceItem, isPeru, translation, getAnimationIcon, isChangeTicket, isSoldOut, ladiesBookedSeats, isDpEnabled, renderIcon, }: ExpandedDropdownProps): React.ReactElement;
|
|
19
|
+
declare function ExpandedDropdown({ serviceItem, isPeru, translation, getAnimationIcon, isChangeTicket, isSoldOut, ladiesBookedSeats, isDpEnabled, renderIcon, operatorLabel, }: ExpandedDropdownProps): React.ReactElement;
|
|
19
20
|
export default ExpandedDropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAnimationIcon, isChangeTicket = false, isSoldOut, ladiesBookedSeats, isDpEnabled, renderIcon, }) {
|
|
2
|
+
function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAnimationIcon, isChangeTicket = false, isSoldOut, ladiesBookedSeats, isDpEnabled, renderIcon, operatorLabel, }) {
|
|
3
3
|
const hasPetInfo = serviceItem.pet_seat_info &&
|
|
4
4
|
Object.keys(serviceItem.pet_seat_info).length > 0;
|
|
5
5
|
return (React.createElement("div", { className: "px-[15px] pt-[26px] pb-[14px] -mt-[16px] pt-[35px] relative -z-9", style: {
|
|
@@ -18,7 +18,9 @@ function ExpandedDropdown({ serviceItem, isPeru = false, translation = {}, getAn
|
|
|
18
18
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.change_ticket_hours) || 6,
|
|
19
19
|
" horas antes"),
|
|
20
20
|
" ",
|
|
21
|
-
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera
|
|
21
|
+
"de la salida del bus. El monto ser\u00E1 reembolsado a tu billetera",
|
|
22
|
+
" ", operatorLabel !== null && operatorLabel !== void 0 ? operatorLabel : "kupospay",
|
|
23
|
+
"."))) : (React.createElement("div", { className: "flex gap-[8px] text-[13.33px]" },
|
|
22
24
|
React.createElement("span", null, renderIcon("changeTicketIcon", "16px")),
|
|
23
25
|
React.createElement("span", null,
|
|
24
26
|
React.createElement("span", null,
|
package/dist/ui/OfferBanner.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../assets/LottiePlayer";
|
|
3
3
|
import CommonService from "../utils/CommonService";
|
|
4
|
-
const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, renderIcon, isLoggedIn, showLoginModal, viewersConfig, getAnimationIcon, showLoginOption }) => {
|
|
5
|
-
var _a, _b, _c, _d;
|
|
4
|
+
const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, renderIcon, isLoggedIn, showLoginModal, viewersConfig, getAnimationIcon, showLoginOption, }) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6
6
|
return (React.createElement("div", { className: "text-white p-[10px_15px] text-left w-full flex items-center absolute -bottom-[36px] pt-[50px] rounded-b-[14px] text-[14px]", style: {
|
|
7
7
|
background: offerGradient,
|
|
8
8
|
opacity: isSoldOut ? 0.5 : 1,
|
|
@@ -23,7 +23,9 @@ const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, renderIcon, isLogg
|
|
|
23
23
|
? ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || "").slice(0, 30) + "..."
|
|
24
24
|
: (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.offer_text) || "",
|
|
25
25
|
" ",
|
|
26
|
-
isLoggedIn && showLoginOption ? null :
|
|
26
|
+
isLoggedIn && showLoginOption ? null : Object.keys((_c = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) !== null && _c !== void 0 ? _c : {}).length > 0 ||
|
|
27
|
+
((_d = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) !== null && _d !== void 0 ? _d : []).length >
|
|
28
|
+
0 ? null : (React.createElement("span", { onClick: showLoginModal, className: "cursor-pointer" }, "- registro")),
|
|
27
29
|
" ",
|
|
28
30
|
"\u00A0"),
|
|
29
31
|
" ",
|
|
@@ -45,9 +47,9 @@ const OfferBanner = ({ offerGradient, isSoldOut, serviceItem, renderIcon, isLogg
|
|
|
45
47
|
" ",
|
|
46
48
|
React.createElement("span", { className: "" },
|
|
47
49
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
|
|
48
|
-
Object.keys((
|
|
50
|
+
Object.keys((_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) !== null && _e !== void 0 ? _e : {}).length ===
|
|
49
51
|
0 &&
|
|
50
|
-
((
|
|
52
|
+
((_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) !== null && _f !== void 0 ? _f : []).length === 0
|
|
51
53
|
? null
|
|
52
54
|
: "Quedan pocos • ",
|
|
53
55
|
React.createElement("span", { className: "bold-text", ref: (node) => CommonService.startComprandoCount(node, 4, 16), style: { fontVariantNumeric: "tabular-nums" } }),
|
package/package.json
CHANGED
|
@@ -117,6 +117,7 @@ function ServiceItemPB({
|
|
|
117
117
|
isLoggedIn,
|
|
118
118
|
showLoginOption,
|
|
119
119
|
isFlores,
|
|
120
|
+
operatorLabel,
|
|
120
121
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
121
122
|
const getAnimationIcon = (icon: string) => {
|
|
122
123
|
const animation = ANIMATION_MAP[icon];
|
|
@@ -588,6 +589,7 @@ function ServiceItemPB({
|
|
|
588
589
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
589
590
|
position: "relative",
|
|
590
591
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
592
|
+
marginTop: isItemExpanded ? "" : "-6px",
|
|
591
593
|
}}
|
|
592
594
|
>
|
|
593
595
|
<div
|
|
@@ -616,6 +618,7 @@ function ServiceItemPB({
|
|
|
616
618
|
ladiesBookedSeats={serviceItem.ladies_booked_seats}
|
|
617
619
|
isDpEnabled={serviceItem.is_dp_enabled}
|
|
618
620
|
renderIcon={renderIcon}
|
|
621
|
+
operatorLabel={operatorLabel}
|
|
619
622
|
/>
|
|
620
623
|
</div>
|
|
621
624
|
</div>
|
|
@@ -125,12 +125,12 @@ export interface ServiceItemProps {
|
|
|
125
125
|
seatFallBackIcon: string;
|
|
126
126
|
headPhoneIcon?: string;
|
|
127
127
|
allowCancellationIcon?: string;
|
|
128
|
-
whiteBoardingIcon?: string
|
|
129
|
-
bombJson?:string
|
|
130
|
-
downArrow?:string
|
|
131
|
-
personIcon?: string
|
|
132
|
-
whiteFireIcon?: string
|
|
133
|
-
fireIcon?: string
|
|
128
|
+
whiteBoardingIcon?: string;
|
|
129
|
+
bombJson?: string;
|
|
130
|
+
downArrow?: string;
|
|
131
|
+
personIcon?: string;
|
|
132
|
+
whiteFireIcon?: string;
|
|
133
|
+
fireIcon?: string;
|
|
134
134
|
|
|
135
135
|
[key: string]: string | Record<string, string | undefined> | undefined;
|
|
136
136
|
};
|
|
@@ -161,7 +161,7 @@ export interface ServiceItemProps {
|
|
|
161
161
|
seatPriceColor?: string;
|
|
162
162
|
rightGradiantColor?: string;
|
|
163
163
|
leftGradiantColor?: string;
|
|
164
|
-
discountSeatPriceColor?: string
|
|
164
|
+
discountSeatPriceColor?: string;
|
|
165
165
|
};
|
|
166
166
|
cityOrigin?: { value: number; label: string };
|
|
167
167
|
cityDestination?: { value: number; label: string };
|
|
@@ -215,7 +215,7 @@ export interface ServiceItemProps {
|
|
|
215
215
|
isAllinBus?: boolean;
|
|
216
216
|
isExpand?: any;
|
|
217
217
|
setIsExpand?: (value: any) => void;
|
|
218
|
-
coachKey?: number
|
|
218
|
+
coachKey?: number;
|
|
219
219
|
viewersConfig?: {
|
|
220
220
|
min: number;
|
|
221
221
|
max: number;
|
|
@@ -223,8 +223,9 @@ export interface ServiceItemProps {
|
|
|
223
223
|
label?: string; // e.g. "personas están viendo este viaje"
|
|
224
224
|
icon?: string; // optional icon URL
|
|
225
225
|
};
|
|
226
|
-
showLoginModal?: any
|
|
227
|
-
isLoggedIn?: any
|
|
228
|
-
showLoginOption?: boolean
|
|
229
|
-
isFlores?: boolean
|
|
226
|
+
showLoginModal?: any;
|
|
227
|
+
isLoggedIn?: any;
|
|
228
|
+
showLoginOption?: boolean;
|
|
229
|
+
isFlores?: boolean;
|
|
230
|
+
operatorLabel?: string;
|
|
230
231
|
}
|
|
@@ -16,6 +16,7 @@ interface ExpandedDropdownProps {
|
|
|
16
16
|
ladiesBookedSeats?: string;
|
|
17
17
|
isDpEnabled?: boolean;
|
|
18
18
|
renderIcon?: any;
|
|
19
|
+
operatorLabel?: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
function ExpandedDropdown({
|
|
@@ -28,6 +29,7 @@ function ExpandedDropdown({
|
|
|
28
29
|
ladiesBookedSeats,
|
|
29
30
|
isDpEnabled,
|
|
30
31
|
renderIcon,
|
|
32
|
+
operatorLabel,
|
|
31
33
|
}: ExpandedDropdownProps): React.ReactElement {
|
|
32
34
|
const hasPetInfo =
|
|
33
35
|
serviceItem.pet_seat_info &&
|
|
@@ -62,8 +64,8 @@ function ExpandedDropdown({
|
|
|
62
64
|
<span className="bold-text">
|
|
63
65
|
hasta {serviceItem?.change_ticket_hours || 6} horas antes
|
|
64
66
|
</span>{" "}
|
|
65
|
-
de la salida del bus. El monto será reembolsado a tu billetera
|
|
66
|
-
kupospay.
|
|
67
|
+
de la salida del bus. El monto será reembolsado a tu billetera{" "}
|
|
68
|
+
{operatorLabel ?? "kupospay"}.
|
|
67
69
|
</span>
|
|
68
70
|
</div>
|
|
69
71
|
) : (
|
package/src/ui/OfferBanner.tsx
CHANGED
|
@@ -18,7 +18,7 @@ interface OfferBannerProps {
|
|
|
18
18
|
showLoginModal: any;
|
|
19
19
|
viewersConfig: ServiceItemProps["viewersConfig"];
|
|
20
20
|
getAnimationIcon: (name: string) => any;
|
|
21
|
-
showLoginOption?: boolean
|
|
21
|
+
showLoginOption?: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
@@ -30,7 +30,7 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
30
30
|
showLoginModal,
|
|
31
31
|
viewersConfig,
|
|
32
32
|
getAnimationIcon,
|
|
33
|
-
showLoginOption
|
|
33
|
+
showLoginOption,
|
|
34
34
|
}) => {
|
|
35
35
|
return (
|
|
36
36
|
<div
|
|
@@ -73,7 +73,11 @@ const OfferBanner: React.FC<OfferBannerProps> = ({
|
|
|
73
73
|
{(serviceItem?.offer_text || "").length > 30
|
|
74
74
|
? (serviceItem?.offer_text || "").slice(0, 30) + "..."
|
|
75
75
|
: serviceItem?.offer_text || ""}{" "}
|
|
76
|
-
{isLoggedIn && showLoginOption ? null : (
|
|
76
|
+
{isLoggedIn && showLoginOption ? null : Object.keys(
|
|
77
|
+
serviceItem?.dp_discount_percents ?? {},
|
|
78
|
+
).length > 0 ||
|
|
79
|
+
(serviceItem?.dp_discounted_seats ?? []).length >
|
|
80
|
+
0 ? null : (
|
|
77
81
|
<span onClick={showLoginModal} className="cursor-pointer">
|
|
78
82
|
- registro
|
|
79
83
|
</span>
|