kupos-ui-components-lib 9.2.4 → 9.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/AmenitiesBlock.js +27 -20
- package/package.json +1 -1
- package/src/ui/AmenitiesBlock.tsx +23 -37
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
const DEFAULT_PRIORITY_IDS = ["2", "3", "13"];
|
|
3
|
-
const TOOLTIP_CLASS = "hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[
|
|
3
|
+
const TOOLTIP_CLASS = "hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[8px] whitespace-nowrap mt-2.5 text-center shadow-service text-[12px]";
|
|
4
4
|
const getAmenityBaseName = (amenityStr) => {
|
|
5
5
|
var _a;
|
|
6
6
|
return (_a = amenityStr === null || amenityStr === void 0 ? void 0 : amenityStr.split(".")[0]) !== null && _a !== void 0 ? _a : "";
|
|
@@ -29,7 +29,7 @@ const getAmenitySplit = ({ isPeru, amenities, priorityIds }) => {
|
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
const AmenitiesBlock = ({ serviceItem, metaData, isSoldOut, colors, isPeru, getAnimationIcon, getAmenityName, SvgAmenities, }) => {
|
|
32
|
-
var _a, _b;
|
|
32
|
+
var _a, _b, _c;
|
|
33
33
|
if (!metaData ||
|
|
34
34
|
!((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[4]) ||
|
|
35
35
|
!serviceItem.operator_details[4].length) {
|
|
@@ -47,30 +47,37 @@ const AmenitiesBlock = ({ serviceItem, metaData, isSoldOut, colors, isPeru, getA
|
|
|
47
47
|
});
|
|
48
48
|
const shouldShowPlus = plusAmenities.length > 0;
|
|
49
49
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
50
|
-
return (React.createElement("div", { className: "relative flex items-center gap-[6px]
|
|
50
|
+
return (React.createElement("div", { className: "relative flex items-center gap-[6px]" },
|
|
51
51
|
visibleAmenities.map((val, key) => {
|
|
52
52
|
const raw = metaData.amenities[val];
|
|
53
53
|
if (isWater(raw))
|
|
54
54
|
return null;
|
|
55
55
|
const baseName = getAmenityBaseName(raw);
|
|
56
|
-
return (React.createElement("div", { key: key, style: { opacity: isSoldOut ? 0.5 : 1 } },
|
|
56
|
+
return (React.createElement("div", { key: key, className: "relative group cursor-pointer", style: { opacity: isSoldOut ? 0.5 : 1 } },
|
|
57
57
|
React.createElement("div", { className: grayscaleClass },
|
|
58
|
-
React.createElement(SvgAmenities, { moreAnemities: false, name: baseName.toLowerCase() }))
|
|
58
|
+
React.createElement(SvgAmenities, { moreAnemities: false, name: baseName.toLowerCase() })),
|
|
59
|
+
React.createElement("div", { className: TOOLTIP_CLASS, style: {
|
|
60
|
+
backgroundColor: colors.bottomStripColor,
|
|
61
|
+
zIndex: 21,
|
|
62
|
+
padding: "16px",
|
|
63
|
+
} },
|
|
64
|
+
React.createElement(TooltipArrow, { color: colors.tooltipColor }),
|
|
65
|
+
React.createElement("div", { className: "text-xs whitespace-nowrap" }, getAmenityName(baseName.split("_").join(" "))))));
|
|
59
66
|
}),
|
|
60
|
-
React.createElement("div", { className:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
shouldShowPlus && (React.createElement("div", { className: "relative ml-1 cursor-pointer" },
|
|
68
|
+
React.createElement("div", { className: "group" },
|
|
69
|
+
React.createElement("img", { src: ((_c = serviceItem.icons) === null || _c === void 0 ? void 0 : _c.plus) ||
|
|
70
|
+
"/images/icons/amenities/icon_plus.svg", className: "w-[16px] h-[16px]", alt: "plus" }),
|
|
71
|
+
React.createElement("div", { style: { zIndex: 100 }, className: TOOLTIP_CLASS },
|
|
72
|
+
React.createElement(TooltipArrow, { color: colors.tooltipColor }),
|
|
73
|
+
React.createElement("div", { className: "flex flex-col gap-[10px] p-3 rounded-[8px] shadow-md", style: { backgroundColor: colors.tooltipColor } }, plusAmenities.map((val, key) => {
|
|
74
|
+
const raw = metaData.amenities[val];
|
|
75
|
+
if (isWater(raw))
|
|
76
|
+
return null;
|
|
77
|
+
const baseName = getAmenityBaseName(raw);
|
|
78
|
+
return (React.createElement("div", { key: key, className: "flex items-center gap-[5px] text-xs whitespace-nowrap" },
|
|
79
|
+
React.createElement(SvgAmenities, { moreAnemities: true, name: baseName.toUpperCase(), color: "white" }),
|
|
80
|
+
getAmenityName(baseName.split("_").join(" "))));
|
|
81
|
+
}))))))));
|
|
75
82
|
};
|
|
76
83
|
export default AmenitiesBlock;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import LottiePlayer from "../assets/LottiePlayer";
|
|
|
4
4
|
const DEFAULT_PRIORITY_IDS = ["2", "3", "13"];
|
|
5
5
|
|
|
6
6
|
const TOOLTIP_CLASS =
|
|
7
|
-
"hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[
|
|
7
|
+
"hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[8px] whitespace-nowrap mt-2.5 text-center shadow-service text-[12px]";
|
|
8
8
|
|
|
9
9
|
const getAmenityBaseName = (amenityStr) => {
|
|
10
10
|
return amenityStr?.split(".")[0] ?? "";
|
|
@@ -83,7 +83,7 @@ const AmenitiesBlock = ({
|
|
|
83
83
|
const grayscaleClass = isSoldOut ? "grayscale" : "";
|
|
84
84
|
|
|
85
85
|
return (
|
|
86
|
-
<div className="relative flex items-center gap-[6px]
|
|
86
|
+
<div className="relative flex items-center gap-[6px]">
|
|
87
87
|
{/* AMENITIES */}
|
|
88
88
|
{visibleAmenities.map((val, key) => {
|
|
89
89
|
const raw = metaData.amenities[val];
|
|
@@ -91,51 +91,37 @@ const AmenitiesBlock = ({
|
|
|
91
91
|
const baseName = getAmenityBaseName(raw);
|
|
92
92
|
|
|
93
93
|
return (
|
|
94
|
-
<div
|
|
94
|
+
<div
|
|
95
|
+
key={key}
|
|
96
|
+
className="relative group cursor-pointer"
|
|
97
|
+
style={{ opacity: isSoldOut ? 0.5 : 1 }}
|
|
98
|
+
>
|
|
95
99
|
<div className={grayscaleClass}>
|
|
96
100
|
<SvgAmenities
|
|
97
101
|
moreAnemities={false}
|
|
98
102
|
name={baseName.toLowerCase()}
|
|
99
103
|
/>
|
|
100
104
|
</div>
|
|
105
|
+
{/* Tooltip – show individual amenity label on hover */}
|
|
106
|
+
<div
|
|
107
|
+
className={TOOLTIP_CLASS}
|
|
108
|
+
style={{
|
|
109
|
+
backgroundColor: colors.bottomStripColor,
|
|
110
|
+
zIndex: 21,
|
|
111
|
+
padding: "16px",
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<TooltipArrow color={colors.tooltipColor} />
|
|
115
|
+
<div className="text-xs whitespace-nowrap">
|
|
116
|
+
{getAmenityName(baseName.split("_").join(" "))}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
101
119
|
</div>
|
|
102
120
|
);
|
|
103
121
|
})}
|
|
104
122
|
|
|
105
|
-
{/* Tooltip – show ALL amenities on container hover */}
|
|
106
|
-
<div
|
|
107
|
-
className={TOOLTIP_CLASS}
|
|
108
|
-
style={{
|
|
109
|
-
backgroundColor: colors.bottomStripColor,
|
|
110
|
-
zIndex: 21,
|
|
111
|
-
padding: "12px",
|
|
112
|
-
}}
|
|
113
|
-
>
|
|
114
|
-
<TooltipArrow color={colors.tooltipColor} />
|
|
115
|
-
<div className="flex flex-col gap-[10px]">
|
|
116
|
-
{amenities.map((id, i) => {
|
|
117
|
-
const rawItem = metaData.amenities[id];
|
|
118
|
-
if (isWater(rawItem)) return null;
|
|
119
|
-
const name = getAmenityBaseName(rawItem);
|
|
120
|
-
return (
|
|
121
|
-
<div
|
|
122
|
-
key={i}
|
|
123
|
-
className="flex items-center gap-[5px] text-xs whitespace-nowrap"
|
|
124
|
-
>
|
|
125
|
-
<SvgAmenities
|
|
126
|
-
moreAnemities={true}
|
|
127
|
-
name={name.toUpperCase()}
|
|
128
|
-
color="white"
|
|
129
|
-
/>
|
|
130
|
-
{getAmenityName(name.split("_").join(" "))}
|
|
131
|
-
</div>
|
|
132
|
-
);
|
|
133
|
-
})}
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
|
|
137
123
|
{/* PLUS ICON */}
|
|
138
|
-
{
|
|
124
|
+
{shouldShowPlus && (
|
|
139
125
|
<div className="relative ml-1 cursor-pointer">
|
|
140
126
|
<div className="group">
|
|
141
127
|
<img
|
|
@@ -177,7 +163,7 @@ const AmenitiesBlock = ({
|
|
|
177
163
|
</div>
|
|
178
164
|
</div>
|
|
179
165
|
</div>
|
|
180
|
-
)}
|
|
166
|
+
)}
|
|
181
167
|
|
|
182
168
|
{/* GPS */}
|
|
183
169
|
{/* {serviceItem?.is_tracking_enabled && (
|