kupos-ui-components-lib 10.4.16 → 10.4.17

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.
Files changed (59) hide show
  1. package/dist/components/PaymentSideBar/PaymentSideBarMobile.js +9 -16
  2. package/dist/components/PaymentSideBar/types.d.ts +0 -3
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
  4. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +17 -6
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +17 -6
  7. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  8. package/dist/components/ServiceItem/ServiceItemMobile.js +18 -7
  9. package/dist/components/ServiceItem/mobileTypes.d.ts +1 -0
  10. package/dist/components/ServiceItem/types.d.ts +1 -0
  11. package/dist/index.d.ts +1 -4
  12. package/dist/index.js +0 -5
  13. package/dist/styles.css +0 -297
  14. package/dist/ui/BottomSheet/BottomSheet.d.ts +1 -2
  15. package/dist/ui/BottomSheet/BottomSheet.js +1 -2
  16. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +16 -0
  17. package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +2 -0
  18. package/dist/ui/PaymentCardMobile/PaymentCardMobile.js +4 -1
  19. package/package.json +2 -2
  20. package/src/components/PaymentSideBar/PaymentSideBarMobile.tsx +526 -556
  21. package/src/components/PaymentSideBar/types.ts +0 -3
  22. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +15 -6
  23. package/src/components/ServiceItem/ServiceItemDesktop.tsx +15 -6
  24. package/src/components/ServiceItem/ServiceItemMobile.tsx +16 -7
  25. package/src/components/ServiceItem/mobileTypes.ts +1 -0
  26. package/src/components/ServiceItem/types.ts +1 -0
  27. package/src/index.ts +0 -20
  28. package/src/ui/BottomSheet/BottomSheet.tsx +1 -4
  29. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +16 -0
  30. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +2 -0
  31. package/patch.py +0 -35
  32. package/src/assets/images/filter/arrow-down.png +0 -0
  33. package/src/assets/images/filter/bus.svg +0 -19
  34. package/src/assets/images/filter/clock.svg +0 -4
  35. package/src/assets/images/filter/filter.svg +0 -3
  36. package/src/assets/images/filter/money.svg +0 -12
  37. package/src/assets/images/filter/night.svg +0 -5
  38. package/src/assets/images/filter/rapido.svg +0 -14
  39. package/src/assets/images/filter/rise.svg +0 -20
  40. package/src/assets/images/filter/search.svg +0 -4
  41. package/src/assets/images/filter/seat.svg +0 -4
  42. package/src/assets/images/filter/star.svg +0 -10
  43. package/src/assets/images/filter/sun.svg +0 -20
  44. package/src/assets/images/filter/sunset.svg +0 -15
  45. package/src/assets/images/filter/track.svg +0 -4
  46. package/src/components/FilterSortBar/FilterChip.tsx +0 -109
  47. package/src/components/FilterSortBar/FilterSortBarMobile.tsx +0 -292
  48. package/src/components/FilterSortBar/FiltersMasterSheet.tsx +0 -124
  49. package/src/components/FilterSortBar/OptionCheckboxList.tsx +0 -76
  50. package/src/components/FilterSortBar/PriceRangeSlider.tsx +0 -143
  51. package/src/components/FilterSortBar/SheetFooter.tsx +0 -33
  52. package/src/components/FilterSortBar/defaultIcons.ts +0 -40
  53. package/src/components/FilterSortBar/icons.tsx +0 -273
  54. package/src/components/FilterSortBar/index.ts +0 -17
  55. package/src/components/FilterSortBar/types.ts +0 -115
  56. package/src/ui/PaymentCardMobile/PaymentCardMobile.tsx +0 -1020
  57. package/src/ui/PaymentCardMobile/index.ts +0 -1
  58. package/src/ui/SlidingModal/SlidingModal.tsx +0 -145
  59. package/src/ui/SlidingModal/index.ts +0 -2
@@ -73,11 +73,9 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
73
73
  ? `${getRoundedHour(duration)}hrs aprox`
74
74
  : `${DateService.formatDuration(duration)} horas`)))))));
75
75
  };
76
- import { PaymentCardMobile } from "../../ui/PaymentCardMobile";
77
- const PaymentSideBarMobile = (props) => {
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, isOpsite, }) => {
78
77
  var _a, _b, _c, _d, _e;
79
- const { 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, isOpsite, isNewUi = false, showDetails = false, setShowDetails, } = props;
80
- return (React.createElement(React.Fragment, null, isNewUi ? (React.createElement(PaymentCardMobile, Object.assign({}, props))) : (React.createElement("div", { className: "pb-[15px]" },
78
+ return (React.createElement("div", { className: "pb-[15px]" },
81
79
  React.createElement("div", { className: "border border-[#ccc] rounded-[20px] relative", style: { margin: "0px 20px 20px" } },
82
80
  React.createElement("div", { style: {
83
81
  position: "absolute",
@@ -185,9 +183,7 @@ const PaymentSideBarMobile = (props) => {
185
183
  : val.fare * selectedReturn[1][key], currencySign))));
186
184
  })
187
185
  : null),
188
- (insuranceData === null || insuranceData === void 0 ? void 0 : insuranceData.insurance_enabled) ? (React.createElement("div", { className: "flex justify-between items-center w-[100%] text-[13.33px]", style: {
189
- margin: checkWhatsappEligibility ? "0" : "6px 0",
190
- } },
186
+ (insuranceData === null || insuranceData === void 0 ? void 0 : insuranceData.insurance_enabled) ? (React.createElement("div", { className: "flex justify-between items-center w-[100%] text-[13.33px]", style: { margin: checkWhatsappEligibility ? "0" : "6px 0" } },
191
187
  React.createElement("div", null,
192
188
  React.createElement("span", null, ((_b = (_a = selectedOnward === null || selectedOnward === void 0 ? void 0 : selectedOnward[1]) === null || _a === void 0 ? void 0 : _a.reduce((acc, qty) => acc + qty, 0)) !== null && _b !== void 0 ? _b : 0) +
193
189
  ((_d = (_c = selectedReturn === null || selectedReturn === void 0 ? void 0 : selectedReturn[1]) === null || _c === void 0 ? void 0 : _c.reduce((acc, qty) => acc + qty, 0)) !== null && _d !== void 0 ? _d : 0)),
@@ -210,9 +206,7 @@ const PaymentSideBarMobile = (props) => {
210
206
  lineHeight: "1.3",
211
207
  backgroundColor: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesBgColor,
212
208
  color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesTextColor,
213
- } }, translation === null || translation === void 0 ? void 0 : translation.whatsappInfoIcon)))), amount: metaData.whatsapp_delivery_charges, className: "text-[14px]", customStyle: {
214
- color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor,
215
- }, currency: currency })) : null,
209
+ } }, translation === null || translation === void 0 ? void 0 : translation.whatsappInfoIcon)))), amount: metaData.whatsapp_delivery_charges, className: "text-[14px]", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor }, currency: currency })) : null,
216
210
  metaData &&
217
211
  isOpsite &&
218
212
  metaData.opsite_whatsapp_delivery_charges &&
@@ -228,9 +222,7 @@ const PaymentSideBarMobile = (props) => {
228
222
  lineHeight: "1.3",
229
223
  backgroundColor: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesBgColor,
230
224
  color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesTextColor,
231
- } }, translation === null || translation === void 0 ? void 0 : translation.whatsappInfoIcon)))), amount: metaData.opsite_whatsapp_delivery_charges, className: "text-[14px]", customStyle: {
232
- color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor,
233
- }, isBoldText: true, currency: currency })) : null,
225
+ } }, translation === null || translation === void 0 ? void 0 : translation.whatsappInfoIcon)))), amount: metaData.opsite_whatsapp_delivery_charges, className: "text-[14px]", customStyle: { color: colors === null || colors === void 0 ? void 0 : colors.whatsappDeliveryChargesColor }, isBoldText: true, currency: currency })) : null,
234
226
  (promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCodeApplied) && (React.createElement(React.Fragment, null,
235
227
  React.createElement(PaymentItem, { label: `${translation === null || translation === void 0 ? void 0 : translation.promotionalCode}:`, amount: CommonService.currency((promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount)
236
228
  ? promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount
@@ -254,7 +246,7 @@ const PaymentSideBarMobile = (props) => {
254
246
  walletMoney ? (React.createElement(PaymentItem, { label: walletLabel, amount: isPeru
255
247
  ? CommonService.currencyFixed(walletMoney, currencySign)
256
248
  : CommonService.currency(walletMoney, currencySign), className: "text-[14px]", customStyle: { color: "var(--secondary-color)" }, currency: "", isBoldText: true })) : null,
257
- virtualMoney ? (React.createElement(PaymentItem, { label: React.createElement("span", { className: "secondary-text", style: { color: "var(--secondary-color)" } }, `${creditosLabel}(${virtualLimit}%)`), amount: CommonService.currency(((virtualLimit !== null && virtualLimit !== void 0 ? virtualLimit : 0) / 100) * Number(virtualMoney !== null && virtualMoney !== void 0 ? virtualMoney : 0), currencySign), customStyle: { color: "var(--secondary-color)" }, className: "text-[14px]", currency: "", isBoldText: true })) : null,
249
+ 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: "", isBoldText: true })) : null,
258
250
  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]", isBoldText: true })) : null)),
259
251
  React.createElement("div", { className: ` text-[#fff] p-[10px_15px] text-left w-full flex items-center absolute -bottom-[35px] pt-[50px] rounded-b-[14px] text-[14px]`, style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.bottomStripColor } },
260
252
  React.createElement("div", { className: "flex justify-between items-center w-full text-[#fff]" },
@@ -267,9 +259,10 @@ const PaymentSideBarMobile = (props) => {
267
259
  currency ? currency : "",
268
260
  " ",
269
261
  CommonService.currency(isPeru
270
- ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) / 100
262
+ ? Math.round((removeDiscountAtomValue ? 0 : netFare) * 100) /
263
+ 100
271
264
  : removeDiscountAtomValue
272
265
  ? 0
273
- : netFare, currencySign)))))))));
266
+ : netFare, currencySign)))))));
274
267
  };
275
268
  export default PaymentSideBarMobile;
@@ -107,7 +107,4 @@ export interface PaymentSideBarProps {
107
107
  isPeru?: boolean;
108
108
  serviceFeeDataStateValue?: any;
109
109
  isOpsite?: boolean;
110
- isNewUi?: boolean;
111
- showDetails?: boolean;
112
- setShowDetails?: (value: boolean) => void;
113
110
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { ServiceItemProps } from "./types";
3
- declare function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isSeatIcon, showAvailableSeats, isPeru, siteType, isAllinBus, viewersConfig, isExpand, setIsExpand, coachKey, isLoggedIn, showLoginModal, isFlores, isNewUiEnabled, showLoginOption, t, }: ServiceItemProps & {
3
+ declare function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isSeatIcon, showAvailableSeats, isPeru, siteType, isAllinBus, viewersConfig, isExpand, setIsExpand, coachKey, isLoggedIn, showLoginModal, isFlores, isNewUiEnabled, showLoginOption, priority_stage_ids, t, }: ServiceItemProps & {
4
4
  currencySign?: string;
5
5
  }): React.ReactElement;
6
6
  export default PeruServiceItemDesktop;
@@ -66,7 +66,7 @@ const ANIMATION_MAP = {
66
66
  opsites: dotAnimation,
67
67
  },
68
68
  };
69
- function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isSeatIcon, showAvailableSeats, isPeru, siteType, isAllinBus, viewersConfig, isExpand, setIsExpand, coachKey, isLoggedIn, showLoginModal, isFlores, isNewUiEnabled, showLoginOption, t = (key) => key, }) {
69
+ function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isSeatIcon, showAvailableSeats, isPeru, siteType, isAllinBus, viewersConfig, isExpand, setIsExpand, coachKey, isLoggedIn, showLoginModal, isFlores, isNewUiEnabled, showLoginOption, priority_stage_ids, t = (key) => key, }) {
70
70
  var _a, _b, _c, _d, _e;
71
71
  const getAnimationIcon = (icon) => {
72
72
  var _a;
@@ -94,10 +94,21 @@ function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaDa
94
94
  const labelId = typeof serviceItem.boarding_stages === "string"
95
95
  ? serviceItem.boarding_stages.split("|")[0]
96
96
  : "";
97
- const showTopLabel = busStage &&
98
- busStage[labelId] &&
99
- busStage[labelId].split("|")[1] === "true" &&
100
- busStage[labelId].split("|")[0];
97
+ const showTopLabel = (() => {
98
+ if (!busStage || !busStage[labelId])
99
+ return false;
100
+ const stageValue = busStage[labelId];
101
+ const isVisible = stageValue.split("|")[1] === "true";
102
+ const label = stageValue.split("|")[0];
103
+ if (!isVisible || !label)
104
+ return false;
105
+ // If priority_stage_ids is provided and non-empty, only show the label
106
+ // when the current labelId is included in that list.
107
+ if (priority_stage_ids && priority_stage_ids.length > 0) {
108
+ return priority_stage_ids.includes(labelId) ? label : false;
109
+ }
110
+ return label;
111
+ })();
101
112
  let isSoldOut = serviceItem.available_seats <= 0;
102
113
  const hasDpEnabled = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) === true;
103
114
  const renderIcon = (iconKey, size = "14px") => {
@@ -473,6 +484,6 @@ function PeruServiceItemDesktop({ serviceItem, onBookButtonPress, colors, metaDa
473
484
  } }, "\u00A1\u00DAltimos Asientos!")))) : null)),
474
485
  React.createElement(BottomAmenities, { otherItems: otherItems, serviceItem: serviceItem, grayscaleClass: grayscaleClass, isSoldOut: isSoldOut, isItemExpanded: isItemExpanded, colors: colors, translation: translation, getAnimationIcon: getAnimationIcon, downArrowIcon: renderIcon("downArrow", "10px"), onToggleExpand: () => setIsExpand && setIsExpand(isItemExpanded ? null : serviceItem.id), isPeru: isPeru }))),
475
486
  children,
476
- React.createElement(ServiceBadges, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem, isAllinBus: isAllinBus, boardingName: boardingName, getAnimationIcon: getAnimationIcon })));
487
+ React.createElement(ServiceBadges, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem, isAllinBus: isAllinBus, boardingName: boardingName, getAnimationIcon: getAnimationIcon })));
477
488
  }
478
489
  export default PeruServiceItemDesktop;
@@ -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, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, }: 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, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, }: ServiceItemProps & {
4
4
  currencySign?: string;
5
5
  }): React.ReactElement;
6
6
  export default ServiceItemPB;
@@ -87,7 +87,7 @@ const ANIMATION_MAP = {
87
87
  kupos: flameAnimation,
88
88
  },
89
89
  };
90
- 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, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, }) {
90
+ 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, isNewUi, showLoginModal, isLoggedIn, showLoginOption, isTrain, selectedSeatKey, onSeatSelect, onTrainButtonClick, showSeatSelectionError, onShowSeatSelectionError, onClearSeatSelectionError, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, operatorLabel, priority_stage_ids, }) {
91
91
  var _a, _b, _c;
92
92
  const handleSeatSelect = (key, price, seatKey, apiSeatType) => {
93
93
  onClearSeatSelectionError === null || onClearSeatSelectionError === void 0 ? void 0 : onClearSeatSelectionError();
@@ -119,10 +119,21 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
119
119
  const labelId = typeof serviceItem.boarding_stages === "string"
120
120
  ? serviceItem.boarding_stages.split("|")[0]
121
121
  : "";
122
- const showTopLabel = busStage &&
123
- busStage[labelId] &&
124
- busStage[labelId].split("|")[1] === "true" &&
125
- busStage[labelId].split("|")[0];
122
+ const showTopLabel = (() => {
123
+ if (!busStage || !busStage[labelId])
124
+ return false;
125
+ const stageValue = busStage[labelId];
126
+ const isVisible = stageValue.split("|")[1] === "true";
127
+ const label = stageValue.split("|")[0];
128
+ if (!isVisible || !label)
129
+ return false;
130
+ // If priority_stage_ids is provided and non-empty, only show the label
131
+ // when the current labelId is included in that list.
132
+ if (priority_stage_ids && priority_stage_ids.length > 0) {
133
+ return priority_stage_ids.includes(labelId) ? label : false;
134
+ }
135
+ return label;
136
+ })();
126
137
  let isSoldOut = serviceItem.available_seats <= 0;
127
138
  const isItemExpanded = serviceItem.id === isExpand || isExpand === true;
128
139
  const grayscaleClass = isSoldOut ? "grayscale" : "";
@@ -377,6 +388,6 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
377
388
  : {})) },
378
389
  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 })))),
379
390
  children,
380
- React.createElement(ServiceBadges, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem })))));
391
+ React.createElement(ServiceBadges, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, translation: translation, serviceItem: serviceItem })))));
381
392
  }
382
393
  export default ServiceItemPB;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { MobileServiceItemProps } from "./mobileTypes";
3
- declare function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, }: MobileServiceItemProps): React.ReactElement;
3
+ declare function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, }: MobileServiceItemProps): React.ReactElement;
4
4
  export default ServiceItemMobile;
@@ -19,7 +19,7 @@ const exceptions = [
19
19
  "blanco",
20
20
  "asiento_mascota",
21
21
  ];
22
- function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, }) {
22
+ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, orignLabel, destinationLabel, amenitiesData, setShowDropdown, showDropdown, isExpanded, setIsExpanded, setAmenetiesAtomValue, isCiva, currencySign, isPeru, showRating, showLastSeats, removeDuplicateSeats, isLinatal, viewersConfig, operatorLabel, isTrain, isFeatureDropDownExpand, setIsFeatureDropDownExpand, ticketQuantity, onIncreaseTicketQuantity, onDecreaseTicketQuantity, cityOrigin, cityDestination, isNewUi, onRemateUiButtonClick, selectedTimeSlot, onTimeSlotChange, isTimeDropdownOpen, onTimeDropdownToggle, wowDealData, isFlores, isAllinBus, isPeruSite, priority_stage_ids, }) {
23
23
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
24
24
  const isItemExpanded = serviceItem.id === isExpanded;
25
25
  const isPetSeat = (Object.keys(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.pet_seat_info) || []).length > 0;
@@ -48,10 +48,21 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
48
48
  const labelId = typeof serviceItem.boarding_stages === "string"
49
49
  ? serviceItem.boarding_stages.split("|")[0]
50
50
  : "";
51
- const showTopLabel = busStage &&
52
- busStage[labelId] &&
53
- busStage[labelId].split("|")[1] === "true" &&
54
- busStage[labelId].split("|")[0];
51
+ const showTopLabel = (() => {
52
+ if (!busStage || !busStage[labelId])
53
+ return false;
54
+ const stageValue = busStage[labelId];
55
+ const isVisible = stageValue.split("|")[1] === "true";
56
+ const label = stageValue.split("|")[0];
57
+ if (!isVisible || !label)
58
+ return false;
59
+ // If priority_stage_ids is provided and non-empty, only show the label
60
+ // when the current labelId is included in that list.
61
+ if (priority_stage_ids && priority_stage_ids.length > 0) {
62
+ return priority_stage_ids.includes(labelId) ? label : false;
63
+ }
64
+ return label;
65
+ })();
55
66
  const getServiceStars = (serviceItem) => {
56
67
  try {
57
68
  return serviceItem.operator_details && serviceItem.operator_details[1]
@@ -103,7 +114,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
103
114
  const dropoffName = ((_f = serviceItem.stage_details_arr) === null || _f === void 0 ? void 0 : _f.length)
104
115
  ? extractStage(serviceItem.stage_details_arr, 1)
105
116
  : null;
106
- return (React.createElement(React.Fragment, null, isPeruSite ? (React.createElement(PeruServiceItemMobile, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, busStage: busStage, orignLabel: orignLabel, destinationLabel: destinationLabel, amenitiesData: amenitiesData, setShowDropdown: setShowDropdown, showDropdown: showDropdown, isExpanded: isExpanded, setIsExpanded: setIsExpanded, setAmenetiesAtomValue: setAmenetiesAtomValue, isCiva: isCiva, currencySign: currencySign, isPeru: isPeru, showRating: showRating, showLastSeats: showLastSeats, removeDuplicateSeats: removeDuplicateSeats, isLinatal: isLinatal, viewersConfig: viewersConfig, operatorLabel: operatorLabel, isTrain: isTrain, isFeatureDropDownExpand: isFeatureDropDownExpand, setIsFeatureDropDownExpand: setIsFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, cityOrigin: cityOrigin, cityDestination: cityDestination, isNewUiEnabled: isNewUiEnabled, onRemateUiButtonClick: onRemateUiButtonClick, selectedTimeSlot: selectedTimeSlot, onTimeSlotChange: onTimeSlotChange, isTimeDropdownOpen: isTimeDropdownOpen, onTimeDropdownToggle: onTimeDropdownToggle, wowDealData: wowDealData, isFlores: isFlores, isAllinBus: isAllinBus })) : isNewUi && !isTrain ? (React.createElement(FeatureServiceUiMobile, { serviceItem: serviceItem, showTopLabel: showTopLabel, colors: colors, isSoldOut: isSoldOut, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
117
+ return (React.createElement(React.Fragment, null, isPeruSite ? (React.createElement(PeruServiceItemMobile, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, busStage: busStage, orignLabel: orignLabel, destinationLabel: destinationLabel, amenitiesData: amenitiesData, setShowDropdown: setShowDropdown, showDropdown: showDropdown, isExpanded: isExpanded, setIsExpanded: setIsExpanded, setAmenetiesAtomValue: setAmenetiesAtomValue, isCiva: isCiva, currencySign: currencySign, isPeru: isPeru, showRating: showRating, showLastSeats: showLastSeats, removeDuplicateSeats: removeDuplicateSeats, isLinatal: isLinatal, viewersConfig: viewersConfig, operatorLabel: operatorLabel, isTrain: isTrain, isFeatureDropDownExpand: isFeatureDropDownExpand, setIsFeatureDropDownExpand: setIsFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, cityOrigin: cityOrigin, cityDestination: cityDestination, isNewUiEnabled: isNewUiEnabled, onRemateUiButtonClick: onRemateUiButtonClick, selectedTimeSlot: selectedTimeSlot, onTimeSlotChange: onTimeSlotChange, isTimeDropdownOpen: isTimeDropdownOpen, onTimeDropdownToggle: onTimeDropdownToggle, wowDealData: wowDealData, isFlores: isFlores, isAllinBus: isAllinBus })) : isNewUi && !isTrain ? (React.createElement(FeatureServiceUiMobile, { serviceItem: serviceItem, showTopLabel: showTopLabel || undefined, colors: colors, isSoldOut: isSoldOut, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
107
118
  setIsFeatureDropDownExpand(isFeatureDropDownExpand === serviceItem.id ||
108
119
  isFeatureDropDownExpand === true
109
120
  ? null
@@ -150,7 +161,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
150
161
  React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_j = serviceItem.duration) === null || _j === void 0 ? void 0 : _j.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
151
162
  setIsExpanded(isItemExpanded ? null : serviceItem.id);
152
163
  }, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain })),
153
- React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion, isAllinBus: isAllinBus, boardingName: boardingName })),
164
+ React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion, isAllinBus: isAllinBus, boardingName: boardingName })),
154
165
  hasOfferText &&
155
166
  (isNewUiEnabled && (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 1) &&
156
167
  !isSoldOut &&
@@ -244,4 +244,5 @@ export interface MobileServiceItemProps {
244
244
  operatorLabel?: string;
245
245
  isAllinBus?: any;
246
246
  isPeruSite?: boolean;
247
+ priority_stage_ids?: string[];
247
248
  }
@@ -265,4 +265,5 @@ export interface ServiceItemProps {
265
265
  isNewUiEnabled?: boolean;
266
266
  isFlores?: boolean;
267
267
  operatorLabel?: string;
268
+ priority_stage_ids?: string[];
268
269
  }
package/dist/index.d.ts CHANGED
@@ -6,16 +6,13 @@ import KuposUIComponent from "./KuposUIComponent";
6
6
  import { PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar } from "./components/PaymentSideBar";
7
7
  import { ServiceListDesktop, ServiceListMobile, ResponsiveServiceList } from "./components/ServiceList";
8
8
  import { FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar } from "./components/FilterBar";
9
- import { FilterSortBarMobile } from "./components/FilterSortBar";
10
9
  import { SurveyDesktop, SurveyMobile, ResponsiveSurvey } from "./components/Survey";
11
10
  import { Modal, ModalHeader } from "./ui/Modal";
12
- export { ServiceItemDesktop, ServiceItemMobile, ResponsiveServiceItem, ServiceItemPBMobile, KuposUIComponent, PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar, ServiceListDesktop, ServiceListMobile, ResponsiveServiceList, FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar, FilterSortBarMobile, SurveyDesktop, SurveyMobile, ResponsiveSurvey, Modal, ModalHeader, };
11
+ export { ServiceItemDesktop, ServiceItemMobile, ResponsiveServiceItem, ServiceItemPBMobile, KuposUIComponent, PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar, ServiceListDesktop, ServiceListMobile, ResponsiveServiceList, FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar, SurveyDesktop, SurveyMobile, ResponsiveSurvey, Modal, ModalHeader, };
13
12
  export type { ServiceItemProps } from "./types";
14
13
  export type { MobileServiceItemProps } from "./components/ServiceItem/mobileTypes";
15
14
  export type { PaymentSideBarProps } from "./components/PaymentSideBar/types";
16
15
  export type { ServiceListProps } from "./components/ServiceList/types";
17
16
  export type { FilterBarProps } from "./components/FilterBar/tyoes";
18
- export type { FilterCategory, FilterCategoryKey, FilterCategoryKind, FilterOptionItem, PriceRangeValue, FilterSortBarColors, FilterSortBarIcons, FilterSortBarMobileProps, TimeOfDayVariant, SortDirection, SortOption, } from "./components/FilterSortBar";
19
- export { DEFAULT_CATEGORY_LABELS } from "./components/FilterSortBar";
20
17
  export type { SurveyProps } from "./components/Survey/types";
21
18
  export type { ModalProps, ModalVariant, ModalSize, ModalHeaderProps } from "./ui/Modal";
package/dist/index.js CHANGED
@@ -9,8 +9,6 @@ import { PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar,
9
9
  import { ServiceListDesktop, ServiceListMobile, ResponsiveServiceList, } from "./components/ServiceList";
10
10
  // Import FilterBar components
11
11
  import { FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar, } from "./components/FilterBar";
12
- // Import FilterSortBar components
13
- import { FilterSortBarMobile } from "./components/FilterSortBar";
14
12
  // Import Survey components
15
13
  import { SurveyDesktop, SurveyMobile, ResponsiveSurvey, } from "./components/Survey";
16
14
  // Import Modal components
@@ -22,10 +20,7 @@ PaymentSideBarDesktop, PaymentSideBarMobile, ResponsivePaymentSideBar,
22
20
  ServiceListDesktop, ServiceListMobile, ResponsiveServiceList,
23
21
  // FilterBar components
24
22
  FilterBarDesktop, FilterBarMobile, ResponsiveFilterBar,
25
- // FilterSortBar components
26
- FilterSortBarMobile,
27
23
  //Survey components
28
24
  SurveyDesktop, SurveyMobile, ResponsiveSurvey,
29
25
  // Modal components
30
26
  Modal, ModalHeader, };
31
- export { DEFAULT_CATEGORY_LABELS } from "./components/FilterSortBar";