kupos-ui-components-lib 9.0.6 → 9.0.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.
Files changed (38) hide show
  1. package/README copy.md +67 -223
  2. package/dist/assets/images/anims/service_list/directo.json +1 -1
  3. package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
  4. package/dist/components/ServiceItem/RatingHover.js +31 -31
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +263 -125
  7. package/dist/components/ServiceItem/ServiceItemMobile.js +291 -44
  8. package/dist/components/ServiceItem/mobileTypes.d.ts +0 -3
  9. package/dist/components/ServiceItem/types.d.ts +0 -7
  10. package/dist/styles.css +17 -66
  11. package/dist/ui/AmenitiesBlock.js +36 -25
  12. package/dist/ui/DurationBlock.js +2 -2
  13. package/dist/ui/FlexibleBlock.js +4 -2
  14. package/dist/ui/PetBlock.js +3 -1
  15. package/dist/ui/RatingBlock.js +2 -6
  16. package/package.json +1 -1
  17. package/src/assets/images/anims/service_list/directo.json +1 -1
  18. package/src/assets/images/anims/service_list/priority_stage.json +1 -1
  19. package/src/components/ServiceItem/RatingHover.tsx +51 -51
  20. package/src/components/ServiceItem/ServiceItemDesktop.tsx +466 -222
  21. package/src/components/ServiceItem/ServiceItemMobile.tsx +501 -120
  22. package/src/components/ServiceItem/mobileTypes.ts +0 -3
  23. package/src/components/ServiceItem/types.ts +0 -7
  24. package/src/ui/AmenitiesBlock.tsx +15 -34
  25. package/src/ui/DurationBlock.tsx +2 -2
  26. package/src/ui/FlexibleBlock.tsx +3 -3
  27. package/src/ui/PetBlock.tsx +2 -2
  28. package/src/ui/RatingBlock.tsx +4 -16
  29. package/src/assets/images/anims/service_list/bomb.json +0 -1
  30. package/src/ui/BottomAmenities/BottomAmenities.tsx +0 -109
  31. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +0 -85
  32. package/src/ui/KuposButton/KuposButton.tsx +0 -48
  33. package/src/ui/SeatSection/SeatSection.tsx +0 -187
  34. package/src/ui/TopAmenities/TopAmenities.tsx +0 -82
  35. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +0 -168
  36. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +0 -192
  37. package/src/ui/mobileweb/SeatSectionMobile.tsx +0 -256
  38. package/src/ui/mobileweb/TopAmenitieMobile.tsx +0 -82
@@ -1,256 +0,0 @@
1
- import React from "react";
2
- import commonService from "../../utils/CommonService";
3
-
4
- const EXCEPTIONS = [
5
- "gy",
6
- ".gy",
7
- "GY",
8
- ".GY",
9
- "Gy",
10
- ".Gy",
11
- "BLANCO",
12
- "blanco",
13
- "asiento_mascota",
14
- ];
15
-
16
- interface SeatType {
17
- label: string;
18
- key?: string;
19
- fare: number;
20
- }
21
-
22
- interface SeatSectionMobileProps {
23
- seatTypes: SeatType[];
24
- isSoldOut: boolean;
25
- isPeru: boolean;
26
- seatPriceColor: string;
27
- currencySign: string;
28
- availableSeats: number;
29
- removeDuplicateSeats?: boolean;
30
- }
31
-
32
- interface SeatRowProps {
33
- type: SeatType;
34
- index: number;
35
- displayLabel: string;
36
- fare: string;
37
- isSoldOut: boolean;
38
- seatPriceColor: string;
39
- hasMultipleTypes: boolean;
40
- textSize: string;
41
- }
42
-
43
- const SeatRow: React.FC<SeatRowProps> = ({
44
- type,
45
- index,
46
- displayLabel,
47
- fare,
48
- isSoldOut,
49
- seatPriceColor,
50
- hasMultipleTypes,
51
- textSize,
52
- }) => {
53
- if (EXCEPTIONS.includes(type.label)) return null;
54
-
55
- const rowClass = hasMultipleTypes
56
- ? "w-[100%] flex flex-row justify-between "
57
- : "w-[100%] flex flex-row justify-between items-center";
58
-
59
- const labelColor = isSoldOut ? "#bbb" : "#464647";
60
- const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
61
-
62
- return (
63
- <div className={rowClass} key={index}>
64
- <span
65
- className={`min-[420]:text-[13px] ${textSize} `}
66
- style={{ color: labelColor }}
67
- >
68
- {displayLabel}
69
- </span>
70
- <span
71
- className={`min-[420]:text-[13px] ${textSize} bold-text`}
72
- style={{ color: priceColor }}
73
- >
74
- {fare}
75
- </span>
76
- </div>
77
- );
78
- };
79
-
80
- const getFilteredSeats = (item: string) => {
81
- return item;
82
- };
83
-
84
- const getUniqueSeats = (data: SeatType[], limit: number): SeatType[] => {
85
- const seatMap = new Map<string, SeatType>();
86
-
87
- data
88
- ?.filter((item) => getFilteredSeats(item.label))
89
- ?.forEach((item) => {
90
- if (EXCEPTIONS.includes(item.key as any)) return;
91
- const existing = seatMap.get(item.label);
92
- if (
93
- !existing ||
94
- parseFloat(item.fare as any) < parseFloat(existing.fare as any)
95
- ) {
96
- seatMap.set(item.label, item);
97
- }
98
- });
99
-
100
- return Array.from(seatMap.values())
101
- .sort((a, b) => a.fare - b.fare)
102
- .slice(0, limit);
103
- };
104
-
105
- function SeatSectionMobile({
106
- seatTypes: seatTypesData,
107
- isSoldOut,
108
- isPeru,
109
- seatPriceColor,
110
- currencySign,
111
- availableSeats,
112
- removeDuplicateSeats,
113
- }: SeatSectionMobileProps): React.ReactElement {
114
- const hasMultipleTypes = (seatTypesData?.length ?? 0) > 2;
115
-
116
- const getFare = (fare: number) => {
117
- if (removeDuplicateSeats && availableSeats <= 0 && !isPeru) {
118
- return commonService.currency(0, currencySign);
119
- }
120
- return commonService.currency(fare, currencySign);
121
- };
122
-
123
- const getLowestFare = (): number | null => {
124
- const filtered = seatTypesData
125
- ?.filter((item) => getFilteredSeats(item.label))
126
- ?.filter((item) => !EXCEPTIONS.includes(item.label));
127
- if (!filtered || filtered.length === 0) return null;
128
- return filtered.reduce(
129
- (min, item) => (item.fare < min ? item.fare : min),
130
- filtered[0].fare,
131
- );
132
- };
133
-
134
- const getHighestFare = (): number => {
135
- return (
136
- seatTypesData
137
- ?.filter((item) => !EXCEPTIONS.includes(item.label))
138
- ?.reduce((max, item) => (item.fare > max ? item.fare : max), 0) || 0
139
- );
140
- };
141
-
142
- const renderPeruSeats = () => {
143
- const lowestFare = getLowestFare();
144
- if (lowestFare === null) return null;
145
-
146
- const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
147
-
148
- return (
149
- <>
150
- <div className="w-[100%] flex flex-row justify-between items-center">
151
- <span
152
- className="min-[420]:text-[13px] text-[12px]"
153
- style={{ color: "#bbb" }}
154
- >
155
- Antes
156
- </span>
157
- <span
158
- className="min-[420]:text-[13px] text-[12px] line-through"
159
- style={{ color: "#bbb" }}
160
- >
161
- {commonService.currency(getHighestFare(), currencySign)}
162
- </span>
163
- </div>
164
- <div className="w-[100%] flex flex-row justify-between items-center">
165
- <span
166
- className="min-[420]:text-[13px] text-[12px] bold-text"
167
- style={{ color: isSoldOut ? "#bbb" : "#464647" }}
168
- >
169
- Desde
170
- </span>
171
- <span
172
- className="min-[420]:text-[13px] text-[12px] bold-text"
173
- style={{ color: priceColor }}
174
- >
175
- {commonService.currency(lowestFare, currencySign)}
176
- </span>
177
- </div>
178
- </>
179
- );
180
- };
181
-
182
- const renderSeats = () => {
183
- if (isPeru) {
184
- return renderPeruSeats();
185
- }
186
-
187
- if (removeDuplicateSeats) {
188
- const uniqueSeats = getUniqueSeats(seatTypesData, 3);
189
- return uniqueSeats.map((type, i) => (
190
- <SeatRow
191
- key={i}
192
- type={type}
193
- index={i}
194
- displayLabel={commonService.truncateSeatLabel(type.label)}
195
- fare={getFare(type.fare)}
196
- isSoldOut={isSoldOut}
197
- seatPriceColor={seatPriceColor}
198
- hasMultipleTypes={hasMultipleTypes}
199
- textSize="text-[11px]"
200
- />
201
- ));
202
- }
203
-
204
- return seatTypesData
205
- ?.filter((item) => getFilteredSeats(item.label))
206
- ?.sort((a, b) => a.fare - b.fare)
207
- ?.slice(0, 2)
208
- ?.map((type, i) => (
209
- <SeatRow
210
- key={i}
211
- type={type}
212
- index={i}
213
- displayLabel={type.label}
214
- fare={commonService.currency(type.fare, currencySign)}
215
- isSoldOut={isSoldOut}
216
- seatPriceColor={seatPriceColor}
217
- hasMultipleTypes={hasMultipleTypes}
218
- textSize="text-[12px]"
219
- />
220
- ));
221
- };
222
-
223
- return (
224
- <div className="content-center relative" style={{ width: "40%" }}>
225
- {!isPeru && (
226
- <div className="absolute -top-[16px] right-[0] flex justify-end">
227
- <span
228
- className="min-[420]:text-[13px] text-[12px] line-through"
229
- style={{ color: "#bbb" }}
230
- >
231
- $7.000
232
- </span>
233
- </div>
234
- )}
235
- <div
236
- className="flex flex-col justify-between h-[2.5rem] "
237
- style={{
238
- gap: isSoldOut ? "0px" : "5px",
239
- justifyContent: hasMultipleTypes ? "space-between" : "center",
240
- }}
241
- >
242
- {renderSeats()}
243
-
244
- {isSoldOut ? (
245
- <div className="flex justify-end">
246
- <span className="min-[420]:text-[13px] text-[12px] text-[#ccc]">
247
- Agotado
248
- </span>
249
- </div>
250
- ) : null}
251
- </div>
252
- </div>
253
- );
254
- }
255
-
256
- export default SeatSectionMobile;
@@ -1,82 +0,0 @@
1
- import React from "react";
2
- import LottiePlayer from "../../assets/LottiePlayer";
3
-
4
- interface TopAmenitieMobileProps {
5
- showTopLabel: string | boolean;
6
- isSoldOut: boolean;
7
- seatPriceColor?: string;
8
- bombAnim?: any;
9
- priorityStageAnim?: any;
10
- }
11
-
12
- function TopAmenitieMobile({
13
- showTopLabel,
14
- isSoldOut,
15
- seatPriceColor,
16
- bombAnim,
17
- priorityStageAnim,
18
- }: TopAmenitieMobileProps): React.ReactElement {
19
- return (
20
- <div
21
- style={{
22
- display: "flex",
23
- justifyContent: "flex-end",
24
- position: "relative",
25
- zIndex: "-1",
26
- }}
27
- >
28
- <div
29
- style={{
30
- backgroundColor: seatPriceColor,
31
-
32
- position: "relative",
33
- right: showTopLabel ? "-21px" : "",
34
- padding: "0 14px",
35
- borderTopRightRadius: "14px",
36
- borderTopLeftRadius: "14px",
37
- }}
38
- >
39
- <div style={{ display: "flex", alignItems: "center", color: "#fff" }}>
40
- <LottiePlayer animationData={bombAnim} width="12px" height="12px" />
41
- <span
42
- className="flex items-center gap-[5px] py-[6px] pl-[6px] text-[12px] z-20"
43
- style={{ paddingRight: showTopLabel ? "20px" : "0" }}
44
- >
45
- <span className="bold-text">kuponazo 20% </span> | 02:10:30
46
- </span>
47
- </div>
48
- </div>
49
-
50
- {showTopLabel && (
51
- <div
52
- className={`flex items-center gap-[5px] py-[6px] px-[10px] text-[12px] z-20`}
53
- style={{
54
- backgroundColor: isSoldOut ? "#ddd" : "#ff8f45",
55
- borderTopRightRadius: "10px",
56
- borderTopLeftRadius: "10px",
57
- }}
58
- >
59
- {/* {renderIcon("whiteBoardingIcon", "12px")} */}
60
- <LottiePlayer
61
- animationData={priorityStageAnim}
62
- width="12px"
63
- height="12px"
64
- />
65
- <div
66
- className={
67
- // isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]`
68
- `text-white`
69
- }
70
- style={{
71
- color: "#fff",
72
- }}
73
- >
74
- {showTopLabel}
75
- </div>
76
- </div>
77
- )}
78
- </div>
79
- );
80
- }
81
-
82
- export default TopAmenitieMobile;