@hotelcard/ui 0.0.5 → 0.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.
Potentially problematic release.
This version of @hotelcard/ui might be problematic. Click here for more details.
- package/dist/index.cjs +370 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +630 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +192 -1
- package/dist/index.d.ts +192 -1
- package/dist/index.js +359 -20
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -1028,9 +1028,297 @@ var Input = ({
|
|
|
1028
1028
|
};
|
|
1029
1029
|
Input.displayName = "Input";
|
|
1030
1030
|
|
|
1031
|
+
// src/components/Block/Block.tsx
|
|
1032
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1033
|
+
var cx14 = (className) => `hc-block-${className}`;
|
|
1034
|
+
var Block = ({
|
|
1035
|
+
variant = "icon",
|
|
1036
|
+
visual,
|
|
1037
|
+
label,
|
|
1038
|
+
description,
|
|
1039
|
+
style = "primary",
|
|
1040
|
+
onClick,
|
|
1041
|
+
showArrow = true,
|
|
1042
|
+
className = ""
|
|
1043
|
+
}) => {
|
|
1044
|
+
if (variant === "icon") {
|
|
1045
|
+
const containerClasses2 = [
|
|
1046
|
+
cx14("icon"),
|
|
1047
|
+
onClick && cx14("icon--clickable"),
|
|
1048
|
+
className
|
|
1049
|
+
].filter(Boolean).join(" ");
|
|
1050
|
+
const iconContainerClass = style === "primary" ? cx14("icon-container--primary") : cx14("icon-container--secondary");
|
|
1051
|
+
return /* @__PURE__ */ jsxs14(
|
|
1052
|
+
"div",
|
|
1053
|
+
{
|
|
1054
|
+
className: containerClasses2,
|
|
1055
|
+
onClick,
|
|
1056
|
+
role: onClick ? "button" : void 0,
|
|
1057
|
+
tabIndex: onClick ? 0 : void 0,
|
|
1058
|
+
children: [
|
|
1059
|
+
/* @__PURE__ */ jsx14("div", { className: iconContainerClass, children: visual }),
|
|
1060
|
+
/* @__PURE__ */ jsxs14("div", { className: cx14("text-container"), children: [
|
|
1061
|
+
/* @__PURE__ */ jsx14("div", { className: cx14("icon-label"), children: label }),
|
|
1062
|
+
description && /* @__PURE__ */ jsx14("div", { className: cx14("icon-description"), children: description })
|
|
1063
|
+
] })
|
|
1064
|
+
]
|
|
1065
|
+
}
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
const containerClasses = [
|
|
1069
|
+
cx14("image"),
|
|
1070
|
+
onClick && cx14("image--clickable"),
|
|
1071
|
+
className
|
|
1072
|
+
].filter(Boolean).join(" ");
|
|
1073
|
+
return /* @__PURE__ */ jsxs14(
|
|
1074
|
+
"div",
|
|
1075
|
+
{
|
|
1076
|
+
className: containerClasses,
|
|
1077
|
+
onClick,
|
|
1078
|
+
role: onClick ? "button" : void 0,
|
|
1079
|
+
tabIndex: onClick ? 0 : void 0,
|
|
1080
|
+
children: [
|
|
1081
|
+
/* @__PURE__ */ jsx14("div", { className: cx14("image-container"), children: visual }),
|
|
1082
|
+
/* @__PURE__ */ jsxs14("div", { className: cx14("footer"), children: [
|
|
1083
|
+
/* @__PURE__ */ jsx14("span", { className: cx14("image-label"), children: label }),
|
|
1084
|
+
showArrow && /* @__PURE__ */ jsx14("span", { className: cx14("arrow"), children: "\u2192" })
|
|
1085
|
+
] })
|
|
1086
|
+
]
|
|
1087
|
+
}
|
|
1088
|
+
);
|
|
1089
|
+
};
|
|
1090
|
+
Block.displayName = "Block";
|
|
1091
|
+
|
|
1092
|
+
// src/components/ReviewCard/ReviewCard.tsx
|
|
1093
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1094
|
+
var cx15 = (className) => `hc-review-${className}`;
|
|
1095
|
+
var ReviewCard = ({
|
|
1096
|
+
name,
|
|
1097
|
+
date,
|
|
1098
|
+
rating,
|
|
1099
|
+
quote,
|
|
1100
|
+
className
|
|
1101
|
+
}) => {
|
|
1102
|
+
const containerClasses = [cx15("container"), className].filter(Boolean).join(" ");
|
|
1103
|
+
return /* @__PURE__ */ jsxs15("div", { className: containerClasses, children: [
|
|
1104
|
+
/* @__PURE__ */ jsx15("div", { className: cx15("name"), children: name }),
|
|
1105
|
+
/* @__PURE__ */ jsxs15("div", { className: cx15("frame"), children: [
|
|
1106
|
+
/* @__PURE__ */ jsx15("div", { className: cx15("stars"), children: /* @__PURE__ */ jsx15(Rating, { variant: "stars", value: rating, size: "medium" }) }),
|
|
1107
|
+
/* @__PURE__ */ jsx15("div", { className: cx15("quote"), children: quote })
|
|
1108
|
+
] }),
|
|
1109
|
+
/* @__PURE__ */ jsx15("div", { className: cx15("date"), children: date })
|
|
1110
|
+
] });
|
|
1111
|
+
};
|
|
1112
|
+
ReviewCard.displayName = "ReviewCard";
|
|
1113
|
+
|
|
1114
|
+
// src/components/FAQ/FAQ.tsx
|
|
1115
|
+
import { useState as useState4 } from "react";
|
|
1116
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1117
|
+
var cx16 = (className) => `hc-faq-${className}`;
|
|
1118
|
+
var ChevronIcon2 = ({ isOpen }) => {
|
|
1119
|
+
const iconClasses = [
|
|
1120
|
+
cx16("chevron"),
|
|
1121
|
+
isOpen && cx16("chevron--open")
|
|
1122
|
+
].filter(Boolean).join(" ");
|
|
1123
|
+
return /* @__PURE__ */ jsx16(
|
|
1124
|
+
"svg",
|
|
1125
|
+
{
|
|
1126
|
+
width: "24",
|
|
1127
|
+
height: "24",
|
|
1128
|
+
viewBox: "0 0 24 24",
|
|
1129
|
+
fill: "none",
|
|
1130
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1131
|
+
className: iconClasses,
|
|
1132
|
+
children: /* @__PURE__ */ jsx16(
|
|
1133
|
+
"path",
|
|
1134
|
+
{
|
|
1135
|
+
d: "M6 9L12 15L18 9",
|
|
1136
|
+
stroke: "currentColor",
|
|
1137
|
+
strokeWidth: "2",
|
|
1138
|
+
strokeLinecap: "round",
|
|
1139
|
+
strokeLinejoin: "round"
|
|
1140
|
+
}
|
|
1141
|
+
)
|
|
1142
|
+
}
|
|
1143
|
+
);
|
|
1144
|
+
};
|
|
1145
|
+
var FAQ = ({
|
|
1146
|
+
items,
|
|
1147
|
+
defaultOpenIndex = null,
|
|
1148
|
+
allowMultiple = false,
|
|
1149
|
+
className
|
|
1150
|
+
}) => {
|
|
1151
|
+
const [openIndices, setOpenIndices] = useState4(
|
|
1152
|
+
defaultOpenIndex !== null ? /* @__PURE__ */ new Set([defaultOpenIndex]) : /* @__PURE__ */ new Set()
|
|
1153
|
+
);
|
|
1154
|
+
const toggleItem = (index) => {
|
|
1155
|
+
setOpenIndices((prev) => {
|
|
1156
|
+
const newSet = new Set(prev);
|
|
1157
|
+
if (newSet.has(index)) {
|
|
1158
|
+
newSet.delete(index);
|
|
1159
|
+
} else {
|
|
1160
|
+
if (!allowMultiple) {
|
|
1161
|
+
newSet.clear();
|
|
1162
|
+
}
|
|
1163
|
+
newSet.add(index);
|
|
1164
|
+
}
|
|
1165
|
+
return newSet;
|
|
1166
|
+
});
|
|
1167
|
+
};
|
|
1168
|
+
const containerClasses = [cx16("container"), className].filter(Boolean).join(" ");
|
|
1169
|
+
return /* @__PURE__ */ jsx16("div", { className: containerClasses, children: items.map((item, index) => {
|
|
1170
|
+
const isOpen = openIndices.has(index);
|
|
1171
|
+
const answerClasses = isOpen ? cx16("answer--open") : cx16("answer");
|
|
1172
|
+
return /* @__PURE__ */ jsxs16("div", { className: cx16("item"), children: [
|
|
1173
|
+
/* @__PURE__ */ jsx16(
|
|
1174
|
+
Button,
|
|
1175
|
+
{
|
|
1176
|
+
variant: "link",
|
|
1177
|
+
size: "medium",
|
|
1178
|
+
className: cx16("question-btn"),
|
|
1179
|
+
onClick: () => toggleItem(index),
|
|
1180
|
+
"aria-expanded": isOpen,
|
|
1181
|
+
"aria-controls": `faq-answer-${index}`,
|
|
1182
|
+
rightIcon: /* @__PURE__ */ jsx16("div", { className: cx16("icon-container"), children: /* @__PURE__ */ jsx16(ChevronIcon2, { isOpen }) }),
|
|
1183
|
+
children: /* @__PURE__ */ jsx16("span", { className: cx16("question-text"), children: item.question })
|
|
1184
|
+
}
|
|
1185
|
+
),
|
|
1186
|
+
/* @__PURE__ */ jsx16("div", { id: `faq-answer-${index}`, className: answerClasses, children: /* @__PURE__ */ jsx16("p", { className: cx16("answer-text"), children: item.answer }) })
|
|
1187
|
+
] }, index);
|
|
1188
|
+
}) });
|
|
1189
|
+
};
|
|
1190
|
+
FAQ.displayName = "FAQ";
|
|
1191
|
+
|
|
1192
|
+
// src/components/Benefits/Benefits.tsx
|
|
1193
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1194
|
+
var cx17 = (className) => `hc-benefits-${className}`;
|
|
1195
|
+
var Benefits = ({
|
|
1196
|
+
title = "Ihre Vorteile mit HotelCard",
|
|
1197
|
+
subtitle = "Mit HotelCard sparen Sie bei jedem Aufenthalt",
|
|
1198
|
+
benefits = [
|
|
1199
|
+
{
|
|
1200
|
+
title: "\xDCber 500 Hotels",
|
|
1201
|
+
description: "Grosse Auswahl in der ganzen Schweiz"
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
title: "Bis zu 50% Rabatt",
|
|
1205
|
+
description: "Exklusive Mitglieder-Preise"
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
title: "Kein Buchungszwang",
|
|
1209
|
+
description: "Buchen Sie, wann Sie m\xF6chten"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
title: "Kostenlose Stornierung",
|
|
1213
|
+
description: "Flexible Buchungsbedingungen"
|
|
1214
|
+
}
|
|
1215
|
+
],
|
|
1216
|
+
contactTitle = "Haben Sie Fragen?",
|
|
1217
|
+
contactDescription = "Unser Kundenservice hilft Ihnen gerne weiter",
|
|
1218
|
+
contactButtonText = "Kontakt aufnehmen",
|
|
1219
|
+
onContactClick,
|
|
1220
|
+
className
|
|
1221
|
+
}) => {
|
|
1222
|
+
const sectionClasses = [cx17("section"), className].filter(Boolean).join(" ");
|
|
1223
|
+
return /* @__PURE__ */ jsx17("section", { className: sectionClasses, children: /* @__PURE__ */ jsxs17("div", { className: cx17("container"), children: [
|
|
1224
|
+
/* @__PURE__ */ jsxs17("div", { className: cx17("header"), children: [
|
|
1225
|
+
/* @__PURE__ */ jsx17("h2", { className: cx17("title"), children: title }),
|
|
1226
|
+
subtitle && /* @__PURE__ */ jsx17("p", { className: cx17("subtitle"), children: subtitle })
|
|
1227
|
+
] }),
|
|
1228
|
+
/* @__PURE__ */ jsx17("div", { className: cx17("grid"), children: benefits.map((benefit, index) => /* @__PURE__ */ jsxs17("div", { className: cx17("item"), children: [
|
|
1229
|
+
/* @__PURE__ */ jsx17("h3", { className: cx17("item-title"), children: benefit.title }),
|
|
1230
|
+
benefit.description && /* @__PURE__ */ jsx17("p", { className: cx17("item-description"), children: benefit.description })
|
|
1231
|
+
] }, index)) }),
|
|
1232
|
+
contactTitle && /* @__PURE__ */ jsxs17("div", { className: cx17("contact-card"), children: [
|
|
1233
|
+
/* @__PURE__ */ jsx17("h3", { className: cx17("contact-title"), children: contactTitle }),
|
|
1234
|
+
contactDescription && /* @__PURE__ */ jsx17("p", { className: cx17("contact-description"), children: contactDescription }),
|
|
1235
|
+
contactButtonText && /* @__PURE__ */ jsx17(
|
|
1236
|
+
Button,
|
|
1237
|
+
{
|
|
1238
|
+
variant: "secondary",
|
|
1239
|
+
size: "medium",
|
|
1240
|
+
onClick: onContactClick,
|
|
1241
|
+
className: cx17("contact-btn"),
|
|
1242
|
+
children: contactButtonText
|
|
1243
|
+
}
|
|
1244
|
+
)
|
|
1245
|
+
] })
|
|
1246
|
+
] }) });
|
|
1247
|
+
};
|
|
1248
|
+
Benefits.displayName = "Benefits";
|
|
1249
|
+
|
|
1250
|
+
// src/components/Pin/Pin.tsx
|
|
1251
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1252
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1253
|
+
var cx18 = (className) => `hc-pin-${className}`;
|
|
1254
|
+
var HeartIcon = ({ className }) => /* @__PURE__ */ jsx18(
|
|
1255
|
+
"svg",
|
|
1256
|
+
{
|
|
1257
|
+
className,
|
|
1258
|
+
width: "16",
|
|
1259
|
+
height: "16",
|
|
1260
|
+
viewBox: "0 0 16 16",
|
|
1261
|
+
fill: "currentColor",
|
|
1262
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1263
|
+
children: /* @__PURE__ */ jsx18("path", { d: "M8 14.2333L6.96667 13.2933C3.6 10.24 1.33333 8.18667 1.33333 5.66667C1.33333 3.61333 2.94667 2 5 2C6.16 2 7.27333 2.54 8 3.39333C8.72667 2.54 9.84 2 11 2C13.0533 2 14.6667 3.61333 14.6667 5.66667C14.6667 8.18667 12.4 10.24 9.03333 13.2933L8 14.2333Z" })
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1266
|
+
var HomeIcon = ({ className }) => /* @__PURE__ */ jsx18(
|
|
1267
|
+
"svg",
|
|
1268
|
+
{
|
|
1269
|
+
className,
|
|
1270
|
+
width: "16",
|
|
1271
|
+
height: "16",
|
|
1272
|
+
viewBox: "0 0 16 16",
|
|
1273
|
+
fill: "currentColor",
|
|
1274
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1275
|
+
children: /* @__PURE__ */ jsx18("path", { d: "M6.66667 13.3333V9.33333H9.33333V13.3333H12.6667V8H14.6667L8 2L1.33333 8H3.33333V13.3333H6.66667Z" })
|
|
1276
|
+
}
|
|
1277
|
+
);
|
|
1278
|
+
var Pin = forwardRef2(
|
|
1279
|
+
({
|
|
1280
|
+
variant = "price",
|
|
1281
|
+
viewed = false,
|
|
1282
|
+
currency = "CHF",
|
|
1283
|
+
price = 0,
|
|
1284
|
+
showFavorite = false,
|
|
1285
|
+
disabled = false,
|
|
1286
|
+
onClick,
|
|
1287
|
+
className = ""
|
|
1288
|
+
}, ref) => {
|
|
1289
|
+
const styleVariant = viewed ? "secondary" : "primary";
|
|
1290
|
+
const pinClasses = [
|
|
1291
|
+
cx18("pin"),
|
|
1292
|
+
cx18(styleVariant),
|
|
1293
|
+
variant === "hotel" && cx18("hotel"),
|
|
1294
|
+
className
|
|
1295
|
+
].filter(Boolean).join(" ");
|
|
1296
|
+
const formattedPrice = typeof price === "number" ? Math.round(price).toString() : price;
|
|
1297
|
+
return /* @__PURE__ */ jsxs18(
|
|
1298
|
+
"button",
|
|
1299
|
+
{
|
|
1300
|
+
ref,
|
|
1301
|
+
type: "button",
|
|
1302
|
+
className: pinClasses,
|
|
1303
|
+
disabled,
|
|
1304
|
+
onClick,
|
|
1305
|
+
children: [
|
|
1306
|
+
/* @__PURE__ */ jsx18("div", { className: cx18("body"), children: variant === "price" ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
1307
|
+
/* @__PURE__ */ jsx18("span", { className: cx18("currency"), children: currency }),
|
|
1308
|
+
/* @__PURE__ */ jsx18("span", { className: cx18("price"), children: formattedPrice }),
|
|
1309
|
+
showFavorite && /* @__PURE__ */ jsx18("div", { className: cx18("favorite-container"), children: /* @__PURE__ */ jsx18(HeartIcon, { className: cx18("favorite-icon") }) })
|
|
1310
|
+
] }) : /* @__PURE__ */ jsx18(HomeIcon, { className: cx18("hotel-icon") }) }),
|
|
1311
|
+
/* @__PURE__ */ jsx18("div", { className: cx18("pointer"), children: /* @__PURE__ */ jsx18("div", { className: cx18("pointer-inner") }) })
|
|
1312
|
+
]
|
|
1313
|
+
}
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
);
|
|
1317
|
+
Pin.displayName = "Pin";
|
|
1318
|
+
|
|
1031
1319
|
// src/components/icons/HeartIcon.tsx
|
|
1032
|
-
import { jsx as
|
|
1033
|
-
var
|
|
1320
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1321
|
+
var HeartIcon2 = ({ filled = false, className = "", size = 24 }) => /* @__PURE__ */ jsx19(
|
|
1034
1322
|
"svg",
|
|
1035
1323
|
{
|
|
1036
1324
|
width: size,
|
|
@@ -1042,14 +1330,14 @@ var HeartIcon = ({ filled = false, className = "", size = 24 }) => /* @__PURE__
|
|
|
1042
1330
|
strokeWidth: 2,
|
|
1043
1331
|
strokeLinecap: "round",
|
|
1044
1332
|
strokeLinejoin: "round",
|
|
1045
|
-
children: /* @__PURE__ */
|
|
1333
|
+
children: /* @__PURE__ */ jsx19("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" })
|
|
1046
1334
|
}
|
|
1047
1335
|
);
|
|
1048
|
-
|
|
1336
|
+
HeartIcon2.displayName = "HeartIcon";
|
|
1049
1337
|
|
|
1050
1338
|
// src/components/icons/StarIcon.tsx
|
|
1051
|
-
import { jsx as
|
|
1052
|
-
var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */
|
|
1339
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1340
|
+
var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */ jsxs19(
|
|
1053
1341
|
"svg",
|
|
1054
1342
|
{
|
|
1055
1343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1059,22 +1347,22 @@ var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */
|
|
|
1059
1347
|
fill: "none",
|
|
1060
1348
|
className,
|
|
1061
1349
|
children: [
|
|
1062
|
-
/* @__PURE__ */
|
|
1350
|
+
/* @__PURE__ */ jsx20("g", { clipPath: "url(#clip0_star_icon)", children: /* @__PURE__ */ jsx20(
|
|
1063
1351
|
"path",
|
|
1064
1352
|
{
|
|
1065
1353
|
d: "M4.80018 0.366577C4.93104 0.366577 5.05173 0.440968 5.11135 0.557659L6.18011 2.66102L8.50521 3.03152C8.63462 3.05194 8.74222 3.14383 8.78294 3.26927C8.82365 3.39472 8.79021 3.53183 8.6986 3.62518L7.03366 5.29533L7.40155 7.6277C7.42191 7.75752 7.3681 7.88879 7.26195 7.9661C7.15581 8.04341 7.01476 8.05508 6.89843 7.99528L4.80018 6.92463L2.70192 7.99528C2.58559 8.05508 2.44454 8.04341 2.33839 7.9661C2.23225 7.88879 2.17844 7.75898 2.1988 7.6277L2.56523 5.29533L0.901751 3.62518C0.808689 3.53183 0.776699 3.39472 0.817413 3.26927C0.858128 3.14383 0.964277 3.05194 1.09515 3.03152L3.42024 2.66102L4.49045 0.557659C4.55007 0.440968 4.67076 0.366577 4.80163 0.366577H4.80018Z",
|
|
1066
1354
|
fill: filled ? "#1F2937" : "#D1D5DB"
|
|
1067
1355
|
}
|
|
1068
1356
|
) }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1357
|
+
/* @__PURE__ */ jsx20("defs", { children: /* @__PURE__ */ jsx20("clipPath", { id: "clip0_star_icon", children: /* @__PURE__ */ jsx20("rect", { width: "8", height: "8", fill: "white", transform: "translate(0.800049 0.199951)" }) }) })
|
|
1070
1358
|
]
|
|
1071
1359
|
}
|
|
1072
1360
|
);
|
|
1073
1361
|
StarIcon4.displayName = "StarIcon";
|
|
1074
1362
|
|
|
1075
1363
|
// src/components/icons/ChevronLeftIcon.tsx
|
|
1076
|
-
import { jsx as
|
|
1077
|
-
var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */
|
|
1364
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1365
|
+
var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */ jsx21(
|
|
1078
1366
|
"svg",
|
|
1079
1367
|
{
|
|
1080
1368
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1087,14 +1375,14 @@ var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */ jsx16(
|
|
|
1087
1375
|
strokeLinecap: "round",
|
|
1088
1376
|
strokeLinejoin: "round",
|
|
1089
1377
|
className,
|
|
1090
|
-
children: /* @__PURE__ */
|
|
1378
|
+
children: /* @__PURE__ */ jsx21("polyline", { points: "15 18 9 12 15 6" })
|
|
1091
1379
|
}
|
|
1092
1380
|
);
|
|
1093
1381
|
ChevronLeftIcon.displayName = "ChevronLeftIcon";
|
|
1094
1382
|
|
|
1095
1383
|
// src/components/icons/ChevronRightIcon.tsx
|
|
1096
|
-
import { jsx as
|
|
1097
|
-
var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */
|
|
1384
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1385
|
+
var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */ jsx22(
|
|
1098
1386
|
"svg",
|
|
1099
1387
|
{
|
|
1100
1388
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1107,14 +1395,14 @@ var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */ jsx17
|
|
|
1107
1395
|
strokeLinecap: "round",
|
|
1108
1396
|
strokeLinejoin: "round",
|
|
1109
1397
|
className,
|
|
1110
|
-
children: /* @__PURE__ */
|
|
1398
|
+
children: /* @__PURE__ */ jsx22("polyline", { points: "9 18 15 12 9 6" })
|
|
1111
1399
|
}
|
|
1112
1400
|
);
|
|
1113
1401
|
ChevronRightIcon2.displayName = "ChevronRightIcon";
|
|
1114
1402
|
|
|
1115
1403
|
// src/components/icons/PinIcon.tsx
|
|
1116
|
-
import { jsx as
|
|
1117
|
-
var PinIcon = ({ className = "", size = 16 }) => /* @__PURE__ */
|
|
1404
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1405
|
+
var PinIcon = ({ className = "", size = 16 }) => /* @__PURE__ */ jsxs20(
|
|
1118
1406
|
"svg",
|
|
1119
1407
|
{
|
|
1120
1408
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1124,7 +1412,7 @@ var PinIcon = ({ className = "", size = 16 }) => /* @__PURE__ */ jsxs15(
|
|
|
1124
1412
|
fill: "none",
|
|
1125
1413
|
className,
|
|
1126
1414
|
children: [
|
|
1127
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ jsx23(
|
|
1128
1416
|
"path",
|
|
1129
1417
|
{
|
|
1130
1418
|
fillRule: "evenodd",
|
|
@@ -1133,7 +1421,7 @@ var PinIcon = ({ className = "", size = 16 }) => /* @__PURE__ */ jsxs15(
|
|
|
1133
1421
|
fill: "currentColor"
|
|
1134
1422
|
}
|
|
1135
1423
|
),
|
|
1136
|
-
/* @__PURE__ */
|
|
1424
|
+
/* @__PURE__ */ jsx23(
|
|
1137
1425
|
"path",
|
|
1138
1426
|
{
|
|
1139
1427
|
fillRule: "evenodd",
|
|
@@ -1146,8 +1434,51 @@ var PinIcon = ({ className = "", size = 16 }) => /* @__PURE__ */ jsxs15(
|
|
|
1146
1434
|
}
|
|
1147
1435
|
);
|
|
1148
1436
|
PinIcon.displayName = "PinIcon";
|
|
1437
|
+
|
|
1438
|
+
// src/hooks/useDebounce.ts
|
|
1439
|
+
import { useState as useState5, useEffect as useEffect3 } from "react";
|
|
1440
|
+
var useDebounce = (value, delay) => {
|
|
1441
|
+
const [debouncedValue, setDebouncedValue] = useState5(value);
|
|
1442
|
+
useEffect3(() => {
|
|
1443
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay);
|
|
1444
|
+
return () => clearTimeout(timer);
|
|
1445
|
+
}, [value, delay]);
|
|
1446
|
+
return debouncedValue;
|
|
1447
|
+
};
|
|
1448
|
+
|
|
1449
|
+
// src/utils/formatPrice.ts
|
|
1450
|
+
var formatPrice = (amount, currency = "CHF", locale = "de-CH") => {
|
|
1451
|
+
return new Intl.NumberFormat(locale, {
|
|
1452
|
+
style: "currency",
|
|
1453
|
+
currency,
|
|
1454
|
+
minimumFractionDigits: 0,
|
|
1455
|
+
maximumFractionDigits: 0
|
|
1456
|
+
}).format(amount);
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
// src/utils/formatDate.ts
|
|
1460
|
+
import { format, parseISO } from "date-fns";
|
|
1461
|
+
import { de, enUS, fr, it } from "date-fns/locale";
|
|
1462
|
+
var locales = { de, en: enUS, fr, it };
|
|
1463
|
+
var formatDate = (date, formatStr = "dd. MMM yyyy", locale = "de") => {
|
|
1464
|
+
const d = typeof date === "string" ? parseISO(date) : date;
|
|
1465
|
+
return format(d, formatStr, { locale: locales[locale] || de });
|
|
1466
|
+
};
|
|
1467
|
+
var formatDateRange = (checkIn, checkOut, locale = "de") => {
|
|
1468
|
+
const start = formatDate(checkIn, "dd.", locale);
|
|
1469
|
+
const end = formatDate(checkOut, "dd. MMM yyyy", locale);
|
|
1470
|
+
return `${start} - ${end}`;
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// src/utils/calculateDiscount.ts
|
|
1474
|
+
var calculateDiscount = (originalPrice, discountedPrice) => {
|
|
1475
|
+
if (originalPrice <= 0) return 0;
|
|
1476
|
+
return Math.round((originalPrice - discountedPrice) / originalPrice * 100);
|
|
1477
|
+
};
|
|
1149
1478
|
export {
|
|
1150
1479
|
Badge,
|
|
1480
|
+
Benefits,
|
|
1481
|
+
Block,
|
|
1151
1482
|
Button,
|
|
1152
1483
|
Card,
|
|
1153
1484
|
Checkbox,
|
|
@@ -1157,13 +1488,21 @@ export {
|
|
|
1157
1488
|
CompactCard,
|
|
1158
1489
|
Divider,
|
|
1159
1490
|
Dropdown,
|
|
1160
|
-
|
|
1491
|
+
FAQ,
|
|
1492
|
+
HeartIcon2 as HeartIcon,
|
|
1161
1493
|
Input,
|
|
1162
1494
|
Modal,
|
|
1495
|
+
Pin,
|
|
1163
1496
|
PinIcon,
|
|
1164
1497
|
RadioButton,
|
|
1165
1498
|
Rating,
|
|
1499
|
+
ReviewCard,
|
|
1166
1500
|
SectionHeader,
|
|
1167
|
-
StarIcon4 as StarIcon
|
|
1501
|
+
StarIcon4 as StarIcon,
|
|
1502
|
+
calculateDiscount,
|
|
1503
|
+
formatDate,
|
|
1504
|
+
formatDateRange,
|
|
1505
|
+
formatPrice,
|
|
1506
|
+
useDebounce
|
|
1168
1507
|
};
|
|
1169
1508
|
//# sourceMappingURL=index.js.map
|