kupos-ui-components-lib 9.7.4 → 9.7.6

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 (31) hide show
  1. package/dist/KuposUIComponent.d.ts +0 -3
  2. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/ServiceItemDesktop.js +2 -15
  4. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemMobile.js +7 -16
  6. package/dist/components/ServiceItem/mobileTypes.d.ts +3 -28
  7. package/dist/components/ServiceItem/types.d.ts +0 -18
  8. package/dist/styles.css +9 -165
  9. package/dist/types.d.ts +3 -0
  10. package/dist/ui/BottomAmenities/BottomAmenities.js +1 -1
  11. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +7 -14
  12. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +101 -31
  13. package/dist/ui/SeatSection/SeatSection.js +1 -1
  14. package/dist/ui/mobileweb/ExpandedDropdownMobile.js +6 -15
  15. package/dist/utils/CommonService.js +1 -11
  16. package/package.json +1 -1
  17. package/src/KuposUIComponent.tsx +0 -3
  18. package/src/components/ServiceItem/ServiceItemDesktop.tsx +0 -42
  19. package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -332
  20. package/src/components/ServiceItem/mobileTypes.ts +4 -24
  21. package/src/components/ServiceItem/types.ts +0 -19
  22. package/src/types.ts +3 -0
  23. package/src/ui/BottomAmenities/BottomAmenities.tsx +1 -1
  24. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +12 -26
  25. package/src/ui/SeatSection/SeatSection.tsx +1 -1
  26. package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +14 -34
  27. package/src/utils/CommonService.ts +1 -13
  28. package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
  29. package/src/assets/images/anims/service_list/users_anim.json +0 -1
  30. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -1021
  31. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -480
@@ -1,480 +0,0 @@
1
- import React from "react";
2
- import LottiePlayer from "../../assets/LottiePlayer";
3
- import commonService from "../../utils/CommonService";
4
-
5
- const HARDCODED_OPERATORS = [
6
- {
7
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
8
- name: "Turbus",
9
- time: "7:00 am",
10
- seatsAvailable: "3 disponibles",
11
- },
12
- {
13
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Pullman_Bus_logo.svg/320px-Pullman_Bus_logo.svg.png",
14
- name: "Pullmanbus",
15
- time: "8:00 am",
16
- seatsAvailable: "5 disponibles",
17
- },
18
- {
19
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
20
- name: "Expreso Santa C...",
21
- time: "9:00 am",
22
- seatsAvailable: "3 disponibles",
23
- },
24
- ];
25
-
26
- const FeatureServiceUi = ({
27
- serviceItem,
28
- showTopLabel,
29
- isSoldOut,
30
- getAnimationIcon,
31
- cityOrigin,
32
- cityDestination,
33
- renderIcon,
34
- viewersConfig,
35
- isFeatureDropDownExpand,
36
- onToggleExpand,
37
- ticketQuantity = 1,
38
- onIncreaseTicketQuantity,
39
- onDecreaseTicketQuantity,
40
- onBookButtonPress,
41
- }) => {
42
- const operators =
43
- serviceItem?.operators?.length > 0
44
- ? serviceItem.operators
45
- : HARDCODED_OPERATORS;
46
-
47
- const isItemExpanded =
48
- serviceItem.id === isFeatureDropDownExpand ||
49
- isFeatureDropDownExpand === true;
50
- const canDecreaseTicketQuantity = ticketQuantity > 1;
51
-
52
- const HOW_IT_WORKS_STEPS = [
53
- {
54
- icon: "flexible",
55
- name: "1. Salida flexible",
56
- text: "Viajas en un horario entre las 07:00 y las 10:00 AM del día elegido.",
57
- },
58
- {
59
- icon: "bus",
60
- name: "2. Empresa asignada",
61
- text: "Una de las empresas confirmará tu viaje al instante tras el pago.",
62
- },
63
- {
64
- icon: "price",
65
- name: "3. Precio garantizado",
66
- text: "Mejor precio garantizado. Sin cambios ni cancelación.",
67
- },
68
- {
69
- icon: "ticket",
70
- name: "4. ¡Listo!",
71
- text: "Recibe todos los detalles de tu viaje al instante tras la compra.",
72
- },
73
- ];
74
-
75
- const FeatureStepIcon = ({ icon }) => {
76
- switch (icon) {
77
- case "flexible":
78
- return renderIcon("flexibleIcon", "24px");
79
- case "bus":
80
- return renderIcon("empressaIcon", "24px");
81
- case "price":
82
- return renderIcon("precioIcon", "24px");
83
- default:
84
- return renderIcon("listoIcon", "24px");
85
- }
86
- };
87
-
88
- return (
89
- <div
90
- // ${
91
- // serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"
92
- // }
93
- className={`relative mb-[10px]
94
- ${
95
- serviceItem?.is_direct_trip ||
96
- serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
97
- showTopLabel
98
- ? "mt-[24px]"
99
- : "mt-[20px]"
100
- }`}
101
- >
102
- <div
103
- className="shadow-service"
104
- style={{
105
- // border: "1px solid #c0c0c0",
106
- padding: "14px",
107
- borderRadius: "14px",
108
- }}
109
- >
110
- <div className="flex justify-between items-center px-[14px] pb-[10px] text-[13.33px]">
111
- <div className="flex items-center gap-[10px]">
112
- <span>Salida flexible</span>
113
- <div
114
- className="bold-text font-[9px]"
115
- style={{
116
- backgroundColor: "#FF5C60",
117
- padding: "1px 8px",
118
- borderRadius: "4px",
119
- color: "#fff",
120
- animation: "pulse-zoom 2s ease-in-out infinite",
121
- whiteSpace: "nowrap",
122
- }}
123
- >
124
- <span>AHORRAS 60%</span>
125
- </div>
126
- </div>
127
- <span>
128
- {/* {renderIcon("fireIcon", "14px")}{" "} */}
129
- <img
130
- src={serviceItem.icons?.fireIcon}
131
- alt="fire"
132
- className="w-[14px] h-[14px] mb-[4px] mr-[4px]"
133
- />
134
- <span className="bold-text">Remate</span> términa en{" "}
135
- <span
136
- className="bold-text text-end"
137
- ref={(node) => commonService.startCountdown(node, 599)}
138
- style={{
139
- fontVariantNumeric: "tabular-nums",
140
- display: "inline-block",
141
- color: "#FF5C60",
142
- minWidth: "40px",
143
- }}
144
- />
145
- </span>
146
- </div>
147
- <div
148
- id={`service-card-${serviceItem.id}`}
149
- className="bg-[#0C1421] text-white mx-auto relative rounded-[14px] p-[14px] text-[13.33px]"
150
- >
151
- <div className="grid grid-cols-[23%_50%_27%] items-stretch">
152
- {/* LEFT: origin, destination, flexible, time, confirmed seat */}
153
- <div className="flex flex-col justify-between gap-[20px] my-[14px] pr-[22px]">
154
- <div className="flex flex-col gap-[8px]">
155
- <div className="flex items-center gap-[8px]">
156
- <img
157
- src={serviceItem.icons?.whiteOrigin}
158
- alt="origin"
159
- className={`w-[14px] h-[14px] shrink-0 ${
160
- isSoldOut ? "grayscale" : ""
161
- }`}
162
- />
163
- <span className="text-[13px] bold-text">
164
- {cityOrigin?.label.split(",")[0]}
165
- </span>
166
- </div>
167
- <div className="flex items-center gap-[8px]">
168
- <img
169
- src={serviceItem.icons?.whiteDestination}
170
- alt="destination"
171
- className={`w-[14px] h-[14px] shrink-0 ${
172
- isSoldOut ? "grayscale" : ""
173
- }`}
174
- style={{ opacity: isSoldOut ? 0.5 : 1 }}
175
- />
176
- <span className="text-[13px] bold-text">
177
- {cityDestination?.label.split(",")[0]}
178
- </span>
179
- </div>
180
- </div>
181
-
182
- <div className="flex flex-col gap-[8px]">
183
- <div className="text-[12px] bold-text whitespace-nowrap">
184
- Entre 07:00 AM y 10:00 AM
185
- </div>
186
- <div className="text-[11px] bold-text">Viernes 23 de mayo</div>
187
- </div>
188
-
189
- <div className="flex flex-col items-start gap-[10px] text-[12px] ">
190
- <div className="flex items-justify gap-[8px]">
191
- {renderIcon("sheildIcon", "16px")}
192
-
193
- <span
194
- className="text-[11px]"
195
- style={{
196
- lineHeight: 1.3,
197
- }}
198
- >
199
- Empresa y hora a confirmar luego del pago.
200
- </span>
201
- </div>
202
- <div className="flex items-justify gap-[8px]">
203
- {renderIcon("confirmarIcon", "16px")}
204
-
205
- <span
206
- className="text-[11px]"
207
- style={{
208
- lineHeight: 1.3,
209
- }}
210
- >
211
- Tu compra está 100% asegurada.
212
- </span>
213
- </div>
214
- </div>
215
- </div>
216
-
217
- {/* MIDDLE: competing operators + viewers */}
218
- <div className="min-w-0 px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]">
219
- <div className="text-center">
220
- <div className="bold-text text-[14px]">
221
- 3 operadores compitiendo por tu compra
222
- </div>
223
- {/* <div className="text-[12px] mt-[8px]">
224
- Empresa a confirmar después de tu pago
225
- </div> */}
226
- </div>
227
-
228
- <div className="grid w-full grid-cols-3 items-stretch gap-[14px] mb-[12px]">
229
- {operators.map((op, idx) => (
230
- <div
231
- key={idx}
232
- className="flex min-w-0 flex-col items-center justify-center gap-[8px] rounded-[8px]"
233
- style={{
234
- // height: "80px",
235
- border: "1px solid #363c48",
236
- backgroundColor: "#1a202e",
237
- padding: "14px 10px",
238
- }}
239
- >
240
- <img
241
- src={serviceItem.operator_details[0]}
242
- alt={op.name}
243
- className={`h-[24px] max-w-full object-contain ${
244
- isSoldOut ? "grayscale" : ""
245
- }`}
246
- />
247
- <span className="text-[11px] truncate max-w-full text-center">
248
- {serviceItem.operator_details[2]}
249
- </span>
250
- <div className="bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap">
251
- <span>{op?.time}</span>
252
- </div>
253
- <span className="text-[10px] mt-[6px]">
254
- {op?.seatsAvailable}
255
- </span>
256
- </div>
257
- ))}
258
- </div>
259
-
260
- <div
261
- className="flex w-full items-center justify-center gap-[6px] text-[12px]"
262
- style={{
263
- border: "1px solid #363c48",
264
- backgroundColor: "#1a202e",
265
- padding: "8px 14px",
266
- borderRadius: "24px",
267
- }}
268
- >
269
- <LottiePlayer
270
- // animationData={serviceItem.icons.flexibleAnim}
271
- animationData={getAnimationIcon("usersAnimation")}
272
- width="18px"
273
- height="18px"
274
- />
275
- <span className="text-[13px]">
276
- <span className="bold-text text-white">
277
- {" "}
278
- <span
279
- className="bold-text"
280
- ref={(node) =>
281
- commonService.startViewerCount(node, viewersConfig)
282
- }
283
- style={{
284
- fontVariantNumeric: "tabular-nums",
285
- color: "#FF5C60",
286
- }}
287
- />{" "}
288
- </span>{" "}
289
- viendo |{" "}
290
- <span
291
- className="bold-text"
292
- ref={(node) =>
293
- commonService.startComprandoCount(node, 4, 16)
294
- }
295
- style={{ fontVariantNumeric: "tabular-nums" }}
296
- />{" "}
297
- han comprado
298
- </span>
299
- </div>
300
- </div>
301
-
302
- {/* RIGHT: price + button */}
303
- <div className="flex flex-col justify-center gap-[12px] py-[2px] pl-[22px] pr-[10px] relative mb-[16px]">
304
- <div
305
- className="flex flex-col gap-[6px] "
306
- style={{
307
- alignItems: "center",
308
- }}
309
- >
310
- <span
311
- className="text-[#FF8F45] bold-text text-[26px] leading-tight"
312
- style={{
313
- animation: "pulse-zoom 2s ease-in-out infinite",
314
- whiteSpace: "nowrap",
315
- }}
316
- >
317
- 60% OFF
318
- </span>
319
- {/* <span className="text-[#666] text-[14px] line-through">
320
- $10.000
321
- </span> */}
322
- <span
323
- className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
324
- style={{ position: "relative" }}
325
- >
326
- $10.000
327
- <span
328
- style={{
329
- position: "absolute",
330
- left: "-2px",
331
- top: "50%",
332
- width: "calc(100% + 4px)",
333
- height: "1px",
334
-
335
- backgroundColor: "#FF5C60",
336
-
337
- transform: "rotate(-10deg)",
338
- transformOrigin: "center",
339
- }}
340
- />
341
- </span>
342
- <span className="text-white bold-text text-[28px] leading-none">
343
- {`$${(4000 * ticketQuantity).toLocaleString()}`}
344
- </span>
345
- </div>
346
-
347
- <div className="mt-[4px] flex flex-col items-center gap-[8px]">
348
- <span className="text-[12px] text-white">
349
- ¿Cuántos pasajes quieres?
350
- </span>
351
- <div
352
- className="flex w-full items-center justify-between"
353
- style={{
354
- border: "1px solid #363c48",
355
- backgroundColor: "#1a202e",
356
- padding: "6px 14px",
357
- borderRadius: "14px",
358
- }}
359
- >
360
- <button
361
- type="button"
362
- aria-label="Disminuir pasajes"
363
- disabled={!canDecreaseTicketQuantity}
364
- onClick={() => onDecreaseTicketQuantity?.(serviceItem)}
365
- className={`flex h-[34px] w-[34px] items-center justify-center rounded-full border-none text-[25px] leading-none text-white ${
366
- canDecreaseTicketQuantity
367
- ? "cursor-pointer bg-[#2d374d]"
368
- : "cursor-not-allowed bg-[#222b3d] opacity-50"
369
- }`}
370
- >
371
- -
372
- </button>
373
- <span className="bold-text text-[20px] text-white">
374
- {ticketQuantity}
375
- </span>
376
- <button
377
- type="button"
378
- aria-label="Aumentar pasajes"
379
- onClick={() => onIncreaseTicketQuantity?.(serviceItem)}
380
- className="flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full border-none bg-[#2d374d] text-[25px] leading-none text-white"
381
- >
382
- +
383
- </button>
384
- </div>
385
- </div>
386
-
387
- <button
388
- type="button"
389
- onClick={onBookButtonPress}
390
- className="flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer"
391
- style={{
392
- backgroundColor: "#FF5C60",
393
- animation: "pulse-zoom 2s ease-in-out infinite",
394
- whiteSpace: "nowrap",
395
- }}
396
- >
397
- <LottiePlayer
398
- // animationData={serviceItem.icons.flexibleAnim}
399
- animationData={getAnimationIcon("thunderAnimation")}
400
- width="18px"
401
- height="18px"
402
- />
403
- <span className="whitespace-nowrap">¡Lo quiero!</span>
404
- </button>
405
- </div>
406
-
407
- <div
408
- className={`absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`}
409
- onClick={onToggleExpand}
410
- >
411
- <img
412
- src={serviceItem.icons?.downArrow}
413
- alt="down arrow"
414
- style={{
415
- width: "14px",
416
- height: "8px",
417
- filter: "brightness(0) invert(1)",
418
- }}
419
- />
420
- </div>
421
- </div>
422
- </div>
423
- <div
424
- className="grid"
425
- style={{
426
- gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
427
- opacity: isItemExpanded ? 1 : 0,
428
- transition:
429
- "grid-template-rows 300ms ease-in-out, opacity 250ms ease-in-out",
430
- }}
431
- >
432
- <div
433
- className={`min-h-0 overflow-hidden px-[16px] text-[13.33px] ${
434
- isItemExpanded ? "pt-[14px] pb-[6px]" : "py-0"
435
- }`}
436
- style={{ transition: "padding 300ms ease-in-out" }}
437
- >
438
- <span className="bold-text">¿Cómo funciona?</span>
439
-
440
- <div className="mt-[14px] grid grid-cols-4 gap-[20px] px-[16px] ">
441
- {HOW_IT_WORKS_STEPS.map((step) => (
442
- <div
443
- key={step.name}
444
- className="flex flex-col items-center text-center text-[#272727]"
445
- >
446
- <FeatureStepIcon icon={step.icon} />
447
- <span className="bold-text mt-[10px] text-[12px] leading-[14px]">
448
- {step.name}
449
- </span>
450
- <span className="mt-[2px] max-w-[220px] text-[12px] leading-[14px] text-[#4a4a4a]">
451
- {step.text}
452
- </span>
453
- </div>
454
- ))}
455
- </div>
456
- </div>
457
- </div>
458
- </div>
459
-
460
- {/* TOP BADGE — "Remate | Termina en 09:55 min" hardcoded, no countdown hook */}
461
- {/* {showTopLabel && (
462
- <div className="absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 ">
463
- <div className="flex items-center gap-[6px] py-[5px] px-[14px] rounded-[38px] text-[12.5px] bg-[#FF8F45] text-white whitespace-nowrap">
464
- <LottiePlayer
465
- animationData={getAnimationIcon("bombAnimation")}
466
- width="14px"
467
- height="14px"
468
- />
469
- <span>
470
- <strong>Remate</strong> | Termina en{" "}
471
- <strong>{HARDCODED_COUNTDOWN}</strong> min
472
- </span>
473
- </div>
474
- </div>
475
- )} */}
476
- </div>
477
- );
478
- };
479
-
480
- export default FeatureServiceUi;