@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.js
CHANGED
|
@@ -4098,23 +4098,52 @@ Logo.displayName = "Logo";
|
|
|
4098
4098
|
//#region src/components/pageRating/index.tsx
|
|
4099
4099
|
const RATING_COLORS = [
|
|
4100
4100
|
"#FB3C00",
|
|
4101
|
+
"#FB3C00",
|
|
4102
|
+
"#FB7800",
|
|
4101
4103
|
"#FB7800",
|
|
4102
4104
|
"#FBD300",
|
|
4105
|
+
"#FBD300",
|
|
4103
4106
|
"#73CF11",
|
|
4107
|
+
"#00B845",
|
|
4104
4108
|
"#00B845"
|
|
4105
4109
|
];
|
|
4106
4110
|
const PageRating = ({ rating, ratingsCount, text, className }) => {
|
|
4107
4111
|
const RatingBox = ({ rating: boxRating, ratingsCount: ratingsCount$1 }) => {
|
|
4108
|
-
const
|
|
4112
|
+
const roundedRating = Math.round(boxRating * 2) / 2;
|
|
4113
|
+
let ratingColor = "rgba(0,0,0,0.25)";
|
|
4114
|
+
if (boxRating > 0) {
|
|
4115
|
+
if (roundedRating % 1 !== 0) {
|
|
4116
|
+
const halfColorIndex = Math.floor(roundedRating) * 2 - 1;
|
|
4117
|
+
ratingColor = RATING_COLORS[Math.min(halfColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
|
|
4118
|
+
} else {
|
|
4119
|
+
const fullColorIndex = Math.floor(boxRating) * 2 - 2;
|
|
4120
|
+
ratingColor = RATING_COLORS[Math.min(fullColorIndex, RATING_COLORS.length - 1)] || "#FB3C00";
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4109
4123
|
return /* @__PURE__ */ jsx("div", {
|
|
4110
4124
|
className: "flex gap-1",
|
|
4111
4125
|
children: Array.from({ length: ratingsCount$1 }, (_, i) => {
|
|
4112
|
-
const
|
|
4113
|
-
const
|
|
4126
|
+
const starIndex = i + 1;
|
|
4127
|
+
const isFullyFilled = starIndex <= Math.floor(roundedRating);
|
|
4128
|
+
const isHalfFilled = starIndex === Math.ceil(roundedRating) && roundedRating % 1 !== 0;
|
|
4114
4129
|
return /* @__PURE__ */ jsx("div", {
|
|
4115
|
-
className: "w-6 h-6 rounded flex items-center justify-center",
|
|
4116
|
-
style: { backgroundColor:
|
|
4117
|
-
children: /* @__PURE__ */
|
|
4130
|
+
className: "w-6 h-6 rounded flex items-center justify-center relative overflow-hidden",
|
|
4131
|
+
style: { backgroundColor: isFullyFilled ? ratingColor : "rgba(0,0,0,0.25)" },
|
|
4132
|
+
children: isHalfFilled ? /* @__PURE__ */ jsxs("div", {
|
|
4133
|
+
className: "relative w-6 h-6 flex items-center justify-center",
|
|
4134
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
4135
|
+
className: "absolute inset-0 z-0",
|
|
4136
|
+
style: {
|
|
4137
|
+
backgroundColor: ratingColor,
|
|
4138
|
+
clipPath: "inset(0 50% 0 0)"
|
|
4139
|
+
}
|
|
4140
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
4141
|
+
viewBox: "0 0 24 24",
|
|
4142
|
+
fill: "white",
|
|
4143
|
+
className: "w-5 h-5 absolute top-[2px] left-[2px] inset-0 z-10",
|
|
4144
|
+
children: /* @__PURE__ */ 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" })
|
|
4145
|
+
})]
|
|
4146
|
+
}) : /* @__PURE__ */ jsx("svg", {
|
|
4118
4147
|
viewBox: "0 0 24 24",
|
|
4119
4148
|
fill: "white",
|
|
4120
4149
|
className: "w-5 h-5",
|
|
@@ -4158,7 +4187,7 @@ const PriceCheck = ({ className, price, text, disabled = false, "data-testid": t
|
|
|
4158
4187
|
children: text
|
|
4159
4188
|
}),
|
|
4160
4189
|
/* @__PURE__ */ jsxs("span", {
|
|
4161
|
-
className: "price-check-price-padding text-start price-check-color-price price-check-fontFamily-price font-bold text-
|
|
4190
|
+
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",
|
|
4162
4191
|
children: [
|
|
4163
4192
|
price,
|
|
4164
4193
|
",",
|