kupos-ui-components-lib 10.0.0 → 10.0.1

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.
@@ -177,7 +177,7 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
177
177
  duration,
178
178
  " horas")))))));
179
179
  };
180
- const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, isLinatal, insuranceData, isPeru, }) => {
180
+ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, isLinatal, insuranceData, isPeru, serviceFeeDataStateValue, }) => {
181
181
  var _a, _b, _c, _d, _e;
182
182
  // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
183
183
  const depTime = droppingTimeOnward || "";
@@ -427,6 +427,16 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
427
427
  React.createElement("div", null, promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCode),
428
428
  React.createElement("span", { className: "promo-remove", onClick: onPromoRemove },
429
429
  React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.closeIcon, alt: "close", className: "w-[16px] h-[16px]" })))) : null,
430
+ (serviceFeeDataStateValue === null || serviceFeeDataStateValue === void 0 ? void 0 : serviceFeeDataStateValue.total_convenience_fee_amount) && (React.createElement(PaymentItem, { label: React.createElement("div", { style: { display: "flex", alignItems: "center" } },
431
+ React.createElement("div", { className: "font10" }, translation === null || translation === void 0 ? void 0 : translation.serviceFeeLabel),
432
+ React.createElement("div", { className: "img-hover" },
433
+ React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.whatsappInfoIcon, alt: "", style: {
434
+ marginLeft: "5px",
435
+ marginBottom: "3px",
436
+ width: "15px",
437
+ } }),
438
+ React.createElement("div", { className: "duration-mouseover font9", style: { lineHeight: "1.3" } },
439
+ React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.serviceFeeHoverLabel)))), amount: CommonService.currency(serviceFeeDataStateValue === null || serviceFeeDataStateValue === void 0 ? void 0 : serviceFeeDataStateValue.total_convenience_fee_amount, currencySign), className: "font10", currency: currency, customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor } })),
430
440
  isAgency && (React.createElement(PaymentItem, { label: translation === null || translation === void 0 ? void 0 : translation.agencyFee, amount: CommonService.currency(agencyFee ? agencyFee : 0, currencySign), currency: "", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.agencyFeePriceColor } })),
431
441
  walletMoney ? (React.createElement(PaymentItem, { label: walletLabel, amount: CommonService.currency(walletMoney, currencySign), currency: "" })) : null,
432
442
  virtualMoney ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text " }, `${creditosLabel}(${virtualLimit}%)`), amount: CommonService.currency(virtualMoney, currencySign), customStyle: { color: "var(--secondary-color)" }, currency: "" })) : null,
@@ -73,7 +73,7 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
73
73
  ? `${getRoundedHour(duration)}hrs aprox`
74
74
  : `${duration} horas`)))))));
75
75
  };
76
- const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, currency, showWhatsappChargesInfo, setShowWhatsappChargesInfo, t, countdown, walletLabel, creditosLabel, isTacna, isLinatal, insuranceData, isPeru, }) => {
76
+ const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, currency, showWhatsappChargesInfo, setShowWhatsappChargesInfo, t, countdown, walletLabel, creditosLabel, isTacna, isLinatal, insuranceData, isPeru, setShowServicefeeModal, serviceFeeDataStateValue, }) => {
77
77
  var _a, _b, _c, _d, _e;
78
78
  return (React.createElement("div", { className: "pb-[10px]" },
79
79
  React.createElement("div", { className: "border border-[#ccc] m-[20px] rounded-[20px] relative" },
@@ -211,6 +211,13 @@ const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData,
211
211
  React.createElement("div", null, promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCode),
212
212
  React.createElement("span", { className: "promo-remove", onClick: onPromoRemove },
213
213
  React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.closeIcon, alt: "close", className: "w-[16px] h-[16px]" })))) : null,
214
+ (serviceFeeDataStateValue === null || serviceFeeDataStateValue === void 0 ? void 0 : serviceFeeDataStateValue.total_convenience_fee_amount) && (React.createElement(PaymentItem, { label: React.createElement("div", { style: { display: "flex", alignItems: "center" } },
215
+ React.createElement("div", { className: " font14 flex items-center gap-[5px]" }, translation === null || translation === void 0 ? void 0 : translation.serviceFeeLabel),
216
+ React.createElement("div", { className: "img-hover", onClick: () => setShowServicefeeModal(true) },
217
+ React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.whatsappInfoIcon, alt: "", style: {
218
+ marginLeft: "5px",
219
+ width: "15px",
220
+ } }))), amount: CommonService.currency(serviceFeeDataStateValue === null || serviceFeeDataStateValue === void 0 ? void 0 : serviceFeeDataStateValue.total_convenience_fee_amount, currencySign), className: "font14", currency: currency, customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor } })),
214
221
  conexionChecked && conexionFare && returnConexionFare ? (React.createElement(PaymentItem, { label: "Conexi\u00F3n Aeropuerto:", amount: CommonService.currency(dateReturn
215
222
  ? returnConexionFare * conexionPassengers
216
223
  : conexionFare, currencySign), className: "subtotal-row text-[14px]", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.seatPriceColor } })) : null,
@@ -219,7 +226,7 @@ const PaymentSideBarMobile = ({ serviceNameOnward, serviceNameReturn, metaData,
219
226
  walletMoney ? (React.createElement(PaymentItem, { label: walletLabel, amount: CommonService.currency(walletMoney, currencySign), className: "text-[14px]", customStyle: { color: "var(--secondary-color)" }, currency: "" })) : null,
220
227
  virtualMoney ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text", style: { color: "var(--secondary-color)" } }, `${creditosLabel}(${virtualLimit}%)`), amount: CommonService.currency(virtualMoney, currencySign), customStyle: { color: "var(--secondary-color)" }, className: "text-[14px]", currency: "" })) : null,
221
228
  showUsd ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "primary-text" }, translation === null || translation === void 0 ? void 0 : translation.showUsd), amount: CommonService.currency(isAgency ? netFareInUsd + agencyFee : netFareInUsd, currencySign), currency: "USD", customStyle: { color: "var(--primary-color)" }, className: "text-[14px]" })) : null)),
222
- React.createElement("div", { className: ` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[10%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`, style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor } },
229
+ React.createElement("div", { className: ` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[7%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`, style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor } },
223
230
  React.createElement("div", { className: "flex justify-between items-center w-full text-[#fff]" },
224
231
  React.createElement("div", { className: "bold-text" }, "Total"),
225
232
  React.createElement("div", { className: "bold-text text-[14px] text-[#fff]", style: {
@@ -91,6 +91,7 @@ export interface PaymentSideBarProps {
91
91
  currency?: string;
92
92
  t?: (key: string) => string;
93
93
  setShowWhatsappChargesInfo?: (value: boolean) => void;
94
+ setShowServicefeeModal?: (value: boolean) => void;
94
95
  showWhatsappChargesInfo?: boolean;
95
96
  onButtonOneClick?: any;
96
97
  onHide?: any;
@@ -103,4 +104,5 @@ export interface PaymentSideBarProps {
103
104
  isTacna?: boolean;
104
105
  insuranceData?: any;
105
106
  isPeru?: boolean;
107
+ serviceFeeDataStateValue?: any;
106
108
  }
@@ -289,7 +289,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
289
289
  },
290
290
  ];
291
291
  const otherItems = items.filter((i) => i.key !== "pet" && i.key !== "flexible" && !!i.condition);
292
- return (React.createElement(React.Fragment, null, isPeruSites ? (React.createElement(PeruServiceItemDesktop, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, metaData: metaData, children: children, busStage: busStage, serviceDetailsLoading: serviceDetailsLoading, cityOrigin: cityOrigin, cityDestination: cityDestination, translation: translation, orignLabel: orignLabel, destinationLabel: destinationLabel, currencySign: currencySign, isCiva: isCiva, showRating: showRating, showLastSeats: showLastSeats, removeArrivalTime: removeArrivalTime, removeDuplicateSeats: removeDuplicateSeats, isPeruSites: isPeruSites, t: (key) => t(key), showAvailableSeats: showAvailableSeats, isSeatIcon: isSeatIcon, isPeru: isPeru, siteType: siteType, isAllinBus: isAllinBus, viewersConfig: viewersConfig, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, isExpand: isExpand, setIsExpand: setIsExpand, coachKey: coachKey, isFlores: isFlores, isNewUiEnabled: isNewUiEnabled, showLoginOption: showLoginOption })) : isNewUi ? (React.createElement(FeatureServiceUi, { serviceItem: serviceItem, showTopLabel: showTopLabel, isSoldOut: isSoldOut, getAnimationIcon: getAnimationIcon, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
292
+ return (React.createElement(React.Fragment, null, isPeruSites ? (React.createElement(PeruServiceItemDesktop, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, metaData: metaData, children: children, busStage: busStage, serviceDetailsLoading: serviceDetailsLoading, cityOrigin: cityOrigin, cityDestination: cityDestination, translation: translation, orignLabel: orignLabel, destinationLabel: destinationLabel, currencySign: currencySign, isCiva: isCiva, showRating: showRating, showLastSeats: showLastSeats, removeArrivalTime: removeArrivalTime, removeDuplicateSeats: removeDuplicateSeats, isPeruSites: isPeruSites, t: (key) => t(key), showAvailableSeats: showAvailableSeats, isSeatIcon: isSeatIcon, isPeru: isPeru, siteType: siteType, isAllinBus: isAllinBus, viewersConfig: viewersConfig, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, isExpand: isExpand, setIsExpand: setIsExpand, coachKey: coachKey, isFlores: isFlores, isNewUiEnabled: isNewUiEnabled, showLoginOption: showLoginOption })) : isNewUi ? (React.createElement(FeatureServiceUi, { serviceItem: serviceItem, showTopLabel: showTopLabel, getAnimationIcon: getAnimationIcon, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
293
293
  setIsFeatureDropDownExpand(isFeatureDropDownExpand === serviceItem.id ||
294
294
  isFeatureDropDownExpand === true
295
295
  ? null
package/dist/styles.css CHANGED
@@ -81,12 +81,12 @@
81
81
  .right-\[25px\] {
82
82
  right: 25px;
83
83
  }
84
+ .-bottom-\[7\%\] {
85
+ bottom: calc(7% * -1);
86
+ }
84
87
  .-bottom-\[9\%\] {
85
88
  bottom: calc(9% * -1);
86
89
  }
87
- .-bottom-\[10\%\] {
88
- bottom: calc(10% * -1);
89
- }
90
90
  .-bottom-\[30px\] {
91
91
  bottom: calc(30px * -1);
92
92
  }
@@ -1218,18 +1218,10 @@
1218
1218
  outline-style: var(--tw-outline-style);
1219
1219
  outline-width: 1px;
1220
1220
  }
1221
- .brightness-0 {
1222
- --tw-brightness: brightness(0%);
1223
- filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1224
- }
1225
1221
  .grayscale {
1226
1222
  --tw-grayscale: grayscale(100%);
1227
1223
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1228
1224
  }
1229
- .invert {
1230
- --tw-invert: invert(100%);
1231
- filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1232
- }
1233
1225
  .filter {
1234
1226
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
1235
1227
  }
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
- declare const FeatureServiceUi: ({ serviceItem, showTopLabel, isSoldOut, getAnimationIcon, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, }: {
2
+ declare const FeatureServiceUi: ({ serviceItem, showTopLabel, getAnimationIcon, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, }: {
3
3
  serviceItem: any;
4
4
  showTopLabel: any;
5
- isSoldOut: any;
6
5
  getAnimationIcon: any;
7
6
  cityOrigin: any;
8
7
  cityDestination: any;
@@ -30,8 +30,8 @@ const HARDCODED_OPERATORS = [
30
30
  seatsAvailable: "3 disponibles",
31
31
  },
32
32
  ];
33
- const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIcon, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity = 1, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData = undefined, }) => {
34
- var _a, _b, _c, _d, _e, _f;
33
+ const FeatureServiceUi = ({ serviceItem, showTopLabel, getAnimationIcon, cityOrigin, cityDestination, renderIcon, viewersConfig, isFeatureDropDownExpand, onToggleExpand, ticketQuantity = 1, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onBookButtonPress, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData = undefined, }) => {
34
+ var _a, _b, _c, _d, _e, _f, _g;
35
35
  // Use wow_deal services if available, otherwise fall back to serviceItem operators or hardcoded
36
36
  const operators = ((_a = wowDealData === null || wowDealData === void 0 ? void 0 : wowDealData.services) === null || _a === void 0 ? void 0 : _a.length) > 0
37
37
  ? wowDealData.services.slice(0, 3).map((service) => ({
@@ -106,7 +106,8 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
106
106
  isFeatureDropDownExpand === true;
107
107
  const isThisTimeDropdownOpen = isTimeDropdownOpen === serviceItem.id;
108
108
  const canDecreaseTicketQuantity = ticketQuantity > 1;
109
- const canIncreaseTicketQuantity = ticketQuantity < maxSeatsPerBooking;
109
+ const availableSeats = (_c = selectedSlotService === null || selectedSlotService === void 0 ? void 0 : selectedSlotService.available_seats) !== null && _c !== void 0 ? _c : maxSeatsPerBooking;
110
+ const canIncreaseTicketQuantity = ticketQuantity < availableSeats;
110
111
  const HOW_IT_WORKS_STEPS = [
111
112
  {
112
113
  icon: "flexible",
@@ -194,10 +195,10 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
194
195
  React.createElement("div", { className: "flex flex-col justify-between gap-[20px] mb-[16px] pr-[22px]" },
195
196
  React.createElement("div", { className: "flex flex-col gap-[8px]" },
196
197
  React.createElement("div", { className: "flex items-center gap-[8px]" },
197
- React.createElement("img", { src: (_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.whiteOrigin, alt: "origin", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}` }),
198
+ React.createElement("img", { src: (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.whiteOrigin, alt: "origin", className: `w-[14px] h-[14px] shrink-0` }),
198
199
  React.createElement("span", { className: "text-[13px] bold-text" }, cityOrigin === null || cityOrigin === void 0 ? void 0 : cityOrigin.label.split(",")[0])),
199
200
  React.createElement("div", { className: "flex items-center gap-[8px]" },
200
- React.createElement("img", { src: (_d = serviceItem.icons) === null || _d === void 0 ? void 0 : _d.whiteDestination, alt: "destination", className: `w-[14px] h-[14px] shrink-0 ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
201
+ React.createElement("img", { src: (_e = serviceItem.icons) === null || _e === void 0 ? void 0 : _e.whiteDestination, alt: "destination", className: `w-[14px] h-[14px] shrink-0` }),
201
202
  React.createElement("span", { className: "text-[13px] bold-text" }, cityDestination === null || cityDestination === void 0 ? void 0 : cityDestination.label.split(",")[0]))),
202
203
  React.createElement("div", { className: "flex flex-col gap-[10px]" },
203
204
  React.createElement("div", { className: "text-[12px] bold-text" }, travelDate
@@ -214,7 +215,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
214
215
  }, style: { outline: "none" } },
215
216
  React.createElement("button", { type: "button", onClick: () => onTimeDropdownToggle === null || onTimeDropdownToggle === void 0 ? void 0 : onTimeDropdownToggle(isThisTimeDropdownOpen ? null : serviceItem.id), className: "flex whitespace-nowrap cursor-pointer select-none items-center gap-[6px] border-none bg-transparent p-0 bold-text text-[12px] text-[white]" },
216
217
  React.createElement("span", null, departureRange),
217
- React.createElement("img", { src: (_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.downArrow, alt: "down arrow", className: `kupos-time-chevron transition-transform duration-200 ${isThisTimeDropdownOpen ? "rotate-180" : "rotate-0"}`, style: {
218
+ React.createElement("img", { src: (_f = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _f === void 0 ? void 0 : _f.downArrow, alt: "down arrow", className: `kupos-time-chevron transition-transform duration-200 ${isThisTimeDropdownOpen ? "rotate-180" : "rotate-0"}`, style: {
218
219
  width: "12px",
219
220
  height: "8px",
220
221
  filter: "brightness(0) invert(1)",
@@ -291,7 +292,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
291
292
  e.currentTarget.src =
292
293
  ((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[0]) ||
293
294
  "/images/service-list/bus-icon.svg";
294
- }, className: `h-[24px] max-w-full object-contain ${isSoldOut ? "grayscale" : ""}` }),
295
+ }, className: `h-[24px] max-w-full object-contain` }),
295
296
  React.createElement("span", { className: "text-[11px] truncate w-full text-center text-[white] overflow-hidden" }, op.name),
296
297
  React.createElement("div", { className: "bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap" },
297
298
  React.createElement("span", null, op === null || op === void 0 ? void 0 : op.time)),
@@ -360,7 +361,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
360
361
  : "cursor-not-allowed bg-[#222b3d] opacity-50"}` }, "+")),
361
362
  !canIncreaseTicketQuantity && (React.createElement("span", { className: "text-[10px] text-[#FF5C60]" },
362
363
  "m\u00E1x. ",
363
- maxSeatsPerBooking,
364
+ availableSeats,
364
365
  " pasajes"))),
365
366
  React.createElement("button", { type: "button", ref: (btn) => {
366
367
  if (!btn)
@@ -399,7 +400,7 @@ const FeatureServiceUi = ({ serviceItem, showTopLabel, isSoldOut, getAnimationIc
399
400
  flexShrink: 0,
400
401
  } })))),
401
402
  React.createElement("div", { className: `absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`, onClick: onToggleExpand },
402
- React.createElement("img", { src: (_f = serviceItem.icons) === null || _f === void 0 ? void 0 : _f.downArrow, alt: "down arrow", style: {
403
+ React.createElement("img", { src: (_g = serviceItem.icons) === null || _g === void 0 ? void 0 : _g.downArrow, alt: "down arrow", style: {
403
404
  width: "14px",
404
405
  height: "8px",
405
406
  filter: "brightness(0) invert(1)",
@@ -23,6 +23,9 @@ function getSortedSeatTypes(seatTypes, isTrain) {
23
23
  if (premiumIndex >= 3) {
24
24
  seatTypesWithPrices[2] = seatTypesWithPrices[premiumIndex];
25
25
  }
26
+ if (isTrain) {
27
+ return seatTypesWithPrices;
28
+ }
26
29
  if (!isTrain) {
27
30
  seatTypesWithPrices = seatTypesWithPrices.slice(0, 2);
28
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -334,6 +334,7 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
334
334
  isLinatal,
335
335
  insuranceData,
336
336
  isPeru,
337
+ serviceFeeDataStateValue,
337
338
  }) => {
338
339
  // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
339
340
  const depTime = droppingTimeOnward || "";
@@ -757,6 +758,39 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
757
758
  </span>
758
759
  </div>
759
760
  ) : null}
761
+ {serviceFeeDataStateValue?.total_convenience_fee_amount && (
762
+ <PaymentItem
763
+ label={
764
+ <div style={{ display: "flex", alignItems: "center" }}>
765
+ <div className="font10">{translation?.serviceFeeLabel}</div>
766
+ <div className="img-hover">
767
+ <img
768
+ src={icons?.whatsappInfoIcon}
769
+ alt=""
770
+ style={{
771
+ marginLeft: "5px",
772
+ marginBottom: "3px",
773
+ width: "15px",
774
+ }}
775
+ />
776
+ <div
777
+ className="duration-mouseover font9"
778
+ style={{ lineHeight: "1.3" }}
779
+ >
780
+ <span>{translation?.serviceFeeHoverLabel}</span>
781
+ </div>
782
+ </div>
783
+ </div>
784
+ }
785
+ amount={CommonService.currency(
786
+ serviceFeeDataStateValue?.total_convenience_fee_amount,
787
+ currencySign,
788
+ )}
789
+ className="font10"
790
+ currency={currency}
791
+ customStyle={{ color: colors?.whatsappDeliveryChargesColor }}
792
+ />
793
+ )}
760
794
 
761
795
  {isAgency && (
762
796
  <PaymentItem
@@ -240,6 +240,8 @@ const PaymentSideBarMobile: React.FC<PaymentSideBarProps> = ({
240
240
  isLinatal,
241
241
  insuranceData,
242
242
  isPeru,
243
+ setShowServicefeeModal,
244
+ serviceFeeDataStateValue,
243
245
  }) => {
244
246
  return (
245
247
  <div className="pb-[10px]">
@@ -526,6 +528,44 @@ const PaymentSideBarMobile: React.FC<PaymentSideBarProps> = ({
526
528
  </div>
527
529
  ) : null}
528
530
 
531
+ {serviceFeeDataStateValue?.total_convenience_fee_amount && (
532
+ <PaymentItem
533
+ label={
534
+ <div style={{ display: "flex", alignItems: "center" }}>
535
+ <div className=" font14 flex items-center gap-[5px]">
536
+ {translation?.serviceFeeLabel}
537
+ </div>
538
+ <div
539
+ className="img-hover"
540
+ onClick={() => setShowServicefeeModal(true)}
541
+ >
542
+ <img
543
+ src={icons?.whatsappInfoIcon}
544
+ alt=""
545
+ style={{
546
+ marginLeft: "5px",
547
+ width: "15px",
548
+ }}
549
+ />
550
+ {/* <div
551
+ className="duration-mouseover font9"
552
+ style={{ lineHeight: "1.3" }}
553
+ >
554
+ <span>{translation?.serviceFeeHoverLabel}</span>
555
+ </div> */}
556
+ </div>
557
+ </div>
558
+ }
559
+ amount={CommonService.currency(
560
+ serviceFeeDataStateValue?.total_convenience_fee_amount,
561
+ currencySign,
562
+ )}
563
+ className="font14"
564
+ currency={currency}
565
+ customStyle={{ color: colors?.whatsappDeliveryChargesColor }}
566
+ />
567
+ )}
568
+
529
569
  {conexionChecked && conexionFare && returnConexionFare ? (
530
570
  <PaymentItem
531
571
  label="Conexión Aeropuerto:"
@@ -604,7 +644,7 @@ const PaymentSideBarMobile: React.FC<PaymentSideBarProps> = ({
604
644
  </div>
605
645
  </div>
606
646
  <div
607
- className={` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[10%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`}
647
+ className={` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[7%] pt-[50px] z-1 rounded-b-[14px] text-[14px]`}
608
648
  style={{ backgroundColor: colors?.bottomStripColor }}
609
649
  >
610
650
  <div className="flex justify-between items-center w-full text-[#fff]">
@@ -90,6 +90,7 @@ export interface PaymentSideBarProps {
90
90
  currency?: string;
91
91
  t?: (key: string) => string;
92
92
  setShowWhatsappChargesInfo?: (value: boolean) => void;
93
+ setShowServicefeeModal?: (value: boolean) => void;
93
94
  showWhatsappChargesInfo?: boolean;
94
95
  onButtonOneClick?: any;
95
96
  onHide?: any;
@@ -102,5 +103,5 @@ export interface PaymentSideBarProps {
102
103
  isTacna?: boolean;
103
104
  insuranceData?: any;
104
105
  isPeru?: boolean;
106
+ serviceFeeDataStateValue?: any;
105
107
  }
106
-
@@ -508,7 +508,6 @@ function ServiceItemPB({
508
508
  <FeatureServiceUi
509
509
  serviceItem={serviceItem}
510
510
  showTopLabel={showTopLabel}
511
- isSoldOut={isSoldOut}
512
511
  getAnimationIcon={getAnimationIcon}
513
512
  cityOrigin={cityOrigin}
514
513
  cityDestination={cityDestination}
@@ -36,7 +36,6 @@ const HARDCODED_OPERATORS = [
36
36
  const FeatureServiceUi = ({
37
37
  serviceItem,
38
38
  showTopLabel,
39
- isSoldOut,
40
39
  getAnimationIcon,
41
40
  cityOrigin,
42
41
  cityDestination,
@@ -149,7 +148,9 @@ const FeatureServiceUi = ({
149
148
  isFeatureDropDownExpand === true;
150
149
  const isThisTimeDropdownOpen = isTimeDropdownOpen === serviceItem.id;
151
150
  const canDecreaseTicketQuantity = ticketQuantity > 1;
152
- const canIncreaseTicketQuantity = ticketQuantity < maxSeatsPerBooking;
151
+ const availableSeats =
152
+ selectedSlotService?.available_seats ?? maxSeatsPerBooking;
153
+ const canIncreaseTicketQuantity = ticketQuantity < availableSeats;
153
154
 
154
155
  const HOW_IT_WORKS_STEPS = [
155
156
  {
@@ -266,9 +267,7 @@ const FeatureServiceUi = ({
266
267
  <img
267
268
  src={serviceItem.icons?.whiteOrigin}
268
269
  alt="origin"
269
- className={`w-[14px] h-[14px] shrink-0 ${
270
- isSoldOut ? "grayscale" : ""
271
- }`}
270
+ className={`w-[14px] h-[14px] shrink-0`}
272
271
  />
273
272
  <span className="text-[13px] bold-text">
274
273
  {cityOrigin?.label.split(",")[0]}
@@ -278,10 +277,7 @@ const FeatureServiceUi = ({
278
277
  <img
279
278
  src={serviceItem.icons?.whiteDestination}
280
279
  alt="destination"
281
- className={`w-[14px] h-[14px] shrink-0 ${
282
- isSoldOut ? "grayscale" : ""
283
- }`}
284
- style={{ opacity: isSoldOut ? 0.5 : 1 }}
280
+ className={`w-[14px] h-[14px] shrink-0`}
285
281
  />
286
282
  <span className="text-[13px] bold-text">
287
283
  {cityDestination?.label.split(",")[0]}
@@ -480,12 +476,7 @@ const FeatureServiceUi = ({
480
476
  serviceItem?.operator_details?.[0] ||
481
477
  "/images/service-list/bus-icon.svg";
482
478
  }}
483
- className={`h-[24px] max-w-full object-contain ${
484
- isSoldOut ? "grayscale" : ""
485
- }`}
486
- // className={`h-[24px] max-w-full object-contain brightness-0 invert ${
487
- // isSoldOut ? "grayscale" : ""
488
- // }`}
479
+ className={`h-[24px] max-w-full object-contain`}
489
480
  />
490
481
  <span className="text-[11px] truncate w-full text-center text-[white] overflow-hidden">
491
482
  {op.name}
@@ -631,7 +622,7 @@ const FeatureServiceUi = ({
631
622
  </div>
632
623
  {!canIncreaseTicketQuantity && (
633
624
  <span className="text-[10px] text-[#FF5C60]">
634
- máx. {maxSeatsPerBooking} pasajes
625
+ máx. {availableSeats} pasajes
635
626
  </span>
636
627
  )}
637
628
  </div>
@@ -58,6 +58,7 @@ function getSortedSeatTypes(seatTypes: SeatType[], isTrain: any) {
58
58
  }
59
59
 
60
60
  let seatTypesWithPrices = getAllSeatTypes(seatTypes);
61
+
61
62
  const premiumIndex = seatTypesWithPrices.findIndex(
62
63
  (item) => item.label === "Premium",
63
64
  );
@@ -66,6 +67,10 @@ function getSortedSeatTypes(seatTypes: SeatType[], isTrain: any) {
66
67
  seatTypesWithPrices[2] = seatTypesWithPrices[premiumIndex];
67
68
  }
68
69
 
70
+ if (isTrain) {
71
+ return seatTypesWithPrices;
72
+ }
73
+
69
74
  if (!isTrain) {
70
75
  seatTypesWithPrices = seatTypesWithPrices.slice(0, 2);
71
76
  }