@prijsvrijtechsupport/ui 0.0.42 → 0.0.43
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/index.cjs +36 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4120,23 +4120,52 @@ Logo.displayName = "Logo";
|
|
|
4120
4120
|
//#region src/components/pageRating/index.tsx
|
|
4121
4121
|
const RATING_COLORS = [
|
|
4122
4122
|
"#FB3C00",
|
|
4123
|
+
"#FB3C00",
|
|
4124
|
+
"#FB7800",
|
|
4123
4125
|
"#FB7800",
|
|
4124
4126
|
"#FBD300",
|
|
4127
|
+
"#FBD300",
|
|
4125
4128
|
"#73CF11",
|
|
4129
|
+
"#00B845",
|
|
4126
4130
|
"#00B845"
|
|
4127
4131
|
];
|
|
4128
4132
|
const PageRating = ({ rating, ratingsCount, text, className }) => {
|
|
4129
4133
|
const RatingBox = ({ rating: boxRating, ratingsCount: ratingsCount$1 }) => {
|
|
4130
|
-
const
|
|
4134
|
+
const roundedRating = Math.round(boxRating * 2) / 2;
|
|
4135
|
+
let ratingColor = "rgba(0,0,0,0.25)";
|
|
4136
|
+
if (boxRating > 0) {
|
|
4137
|
+
if (roundedRating % 1 !== 0) {
|
|
4138
|
+
const halfColorIndex = Math.floor(roundedRating) * 2 - 1;
|
|
4139
|
+
ratingColor = RATING_COLORS[Math.min(halfColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
|
|
4140
|
+
} else {
|
|
4141
|
+
const fullColorIndex = Math.floor(boxRating) * 2 - 2;
|
|
4142
|
+
ratingColor = RATING_COLORS[Math.min(fullColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
|
|
4143
|
+
}
|
|
4144
|
+
}
|
|
4131
4145
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4132
4146
|
className: "flex gap-1",
|
|
4133
4147
|
children: Array.from({ length: ratingsCount$1 }, (_, i) => {
|
|
4134
|
-
const
|
|
4135
|
-
const
|
|
4148
|
+
const starIndex = i + 1;
|
|
4149
|
+
const isFullyFilled = starIndex <= Math.floor(roundedRating);
|
|
4150
|
+
const isHalfFilled = starIndex === Math.ceil(roundedRating) && roundedRating % 1 !== 0;
|
|
4136
4151
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4137
|
-
className: "w-6 h-6 rounded flex items-center justify-center",
|
|
4138
|
-
style: { backgroundColor:
|
|
4139
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.
|
|
4152
|
+
className: "w-6 h-6 rounded flex items-center justify-center relative overflow-hidden",
|
|
4153
|
+
style: { backgroundColor: isFullyFilled ? ratingColor : "rgba(0,0,0,0.25)" },
|
|
4154
|
+
children: isHalfFilled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4155
|
+
className: "relative w-6 h-6 flex items-center justify-center",
|
|
4156
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
4157
|
+
className: "absolute inset-0 z-0",
|
|
4158
|
+
style: {
|
|
4159
|
+
backgroundColor: ratingColor,
|
|
4160
|
+
clipPath: "inset(0 50% 0 0)"
|
|
4161
|
+
}
|
|
4162
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
4163
|
+
viewBox: "0 0 24 24",
|
|
4164
|
+
fill: "white",
|
|
4165
|
+
className: "w-5 h-5 absolute top-[2px] left-[2px] inset-0 z-10",
|
|
4166
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 16.1748L15.65 15.2498L17.175 19.9498L12 16.1748ZM20.4 10.0998H13.975L12 4.0498L10.025 10.0998H3.59998L8.79998 13.8498L6.82498 19.8998L12.025 16.1498L15.225 13.8498L20.4 10.0998Z" })
|
|
4167
|
+
})]
|
|
4168
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
4140
4169
|
viewBox: "0 0 24 24",
|
|
4141
4170
|
fill: "white",
|
|
4142
4171
|
className: "w-5 h-5",
|
|
@@ -4180,7 +4209,7 @@ const PriceCheck = ({ className, price, text, disabled = false, "data-testid": t
|
|
|
4180
4209
|
children: text
|
|
4181
4210
|
}),
|
|
4182
4211
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
4183
|
-
className: "price-check-price-padding text-start price-check-color-price price-check-fontFamily-price font-bold text-
|
|
4212
|
+
className: "price-check-price-padding text-start price-check-color-price price-check-fontFamily-price font-bold text-2xl whitespace-nowrap price-check-price-margin-top",
|
|
4184
4213
|
children: [
|
|
4185
4214
|
price,
|
|
4186
4215
|
",",
|