@hotelcard/ui 0.0.16 → 0.0.18
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 +494 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +502 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +93 -1
- package/dist/index.d.ts +93 -1
- package/dist/index.js +492 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -49,6 +49,8 @@ __export(index_exports, {
|
|
|
49
49
|
ExperienceFilter: () => ExperienceFilter,
|
|
50
50
|
FAQ: () => FAQ,
|
|
51
51
|
FilterCheckboxItem: () => FilterCheckboxItem,
|
|
52
|
+
FilterModal: () => FilterModal,
|
|
53
|
+
FilterPanel: () => FilterPanel,
|
|
52
54
|
GuestContent: () => GuestContent,
|
|
53
55
|
HeartIcon: () => HeartIcon3,
|
|
54
56
|
HotelCard: () => HotelCard,
|
|
@@ -3848,9 +3850,482 @@ var SelectedFiltersRow = ({
|
|
|
3848
3850
|
] }) });
|
|
3849
3851
|
};
|
|
3850
3852
|
|
|
3851
|
-
// src/components/
|
|
3853
|
+
// src/components/Filters/FilterPanel.tsx
|
|
3854
|
+
var import_react19 = require("react");
|
|
3855
|
+
|
|
3856
|
+
// src/components/Filters/FilterPanel.module.css
|
|
3857
|
+
var FilterPanel_default = {};
|
|
3858
|
+
|
|
3859
|
+
// src/components/Filters/FilterPanel.tsx
|
|
3852
3860
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3853
|
-
var
|
|
3861
|
+
var DISCOUNT_OPTIONS = [
|
|
3862
|
+
{ value: "50", label: "50%" },
|
|
3863
|
+
{ value: "30", label: "30%" },
|
|
3864
|
+
{ value: "10", label: "10%" }
|
|
3865
|
+
];
|
|
3866
|
+
var OPTIONS_FILTER = [
|
|
3867
|
+
{ value: "instant_booking", labelKey: "filter.instant-booking" }
|
|
3868
|
+
];
|
|
3869
|
+
var FilterPanel = ({
|
|
3870
|
+
onFilterChange,
|
|
3871
|
+
className = "",
|
|
3872
|
+
isLoading = false,
|
|
3873
|
+
priceHistogram,
|
|
3874
|
+
minPrice = 50,
|
|
3875
|
+
maxPrice = 500,
|
|
3876
|
+
regions = [],
|
|
3877
|
+
discountCounts = {},
|
|
3878
|
+
optionsCounts = {},
|
|
3879
|
+
categoryCounts = {},
|
|
3880
|
+
themes = [],
|
|
3881
|
+
mealsCounts = {},
|
|
3882
|
+
reviewsCounts = {},
|
|
3883
|
+
transportCounts = {},
|
|
3884
|
+
wellnessCounts = {},
|
|
3885
|
+
servicesCounts = {},
|
|
3886
|
+
filterOptions,
|
|
3887
|
+
selectedDiscounts: externalDiscounts,
|
|
3888
|
+
selectedOptions: externalOptions,
|
|
3889
|
+
selectedExperiences: externalExperiences,
|
|
3890
|
+
selectedRegions: externalRegions,
|
|
3891
|
+
selectedCategories: externalCategories,
|
|
3892
|
+
selectedMeals: externalMeals,
|
|
3893
|
+
selectedReviews: externalReviews,
|
|
3894
|
+
selectedTransport: externalTransport,
|
|
3895
|
+
selectedWellness: externalWellness,
|
|
3896
|
+
selectedServices: externalServices,
|
|
3897
|
+
selectedPriceRange: externalPriceRange
|
|
3898
|
+
}) => {
|
|
3899
|
+
const { t, currency } = useUIContext();
|
|
3900
|
+
const hasInitialLoadRef = (0, import_react19.useRef)(false);
|
|
3901
|
+
if (!hasInitialLoadRef.current) {
|
|
3902
|
+
if (regions.length > 0 || priceHistogram && priceHistogram.length > 0 || Object.keys(discountCounts).length > 0 || Object.keys(categoryCounts).length > 0) {
|
|
3903
|
+
hasInitialLoadRef.current = true;
|
|
3904
|
+
}
|
|
3905
|
+
}
|
|
3906
|
+
const [priceMin, setPriceMin] = (0, import_react19.useState)(externalPriceRange?.min ?? minPrice);
|
|
3907
|
+
const [priceMax, setPriceMax] = (0, import_react19.useState)(externalPriceRange?.max ?? maxPrice);
|
|
3908
|
+
const [selectedRegions, setSelectedRegions] = (0, import_react19.useState)(externalRegions ?? []);
|
|
3909
|
+
const [selectedDiscounts, setSelectedDiscounts] = (0, import_react19.useState)(externalDiscounts ?? []);
|
|
3910
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react19.useState)(externalOptions ?? []);
|
|
3911
|
+
const [selectedCategories, setSelectedCategories] = (0, import_react19.useState)(externalCategories ?? []);
|
|
3912
|
+
const [selectedExperiences, setSelectedExperiences] = (0, import_react19.useState)(externalExperiences ?? []);
|
|
3913
|
+
const [selectedMeals, setSelectedMeals] = (0, import_react19.useState)(externalMeals ?? []);
|
|
3914
|
+
const [selectedReviews, setSelectedReviews] = (0, import_react19.useState)(externalReviews ?? []);
|
|
3915
|
+
const [selectedTransport, setSelectedTransport] = (0, import_react19.useState)(externalTransport ?? []);
|
|
3916
|
+
const [selectedWellness, setSelectedWellness] = (0, import_react19.useState)(externalWellness ?? []);
|
|
3917
|
+
const [selectedServices, setSelectedServices] = (0, import_react19.useState)(externalServices ?? []);
|
|
3918
|
+
(0, import_react19.useEffect)(() => {
|
|
3919
|
+
if (externalPriceRange) {
|
|
3920
|
+
setPriceMin(externalPriceRange.min);
|
|
3921
|
+
setPriceMax(externalPriceRange.max);
|
|
3922
|
+
} else {
|
|
3923
|
+
setPriceMin(minPrice);
|
|
3924
|
+
setPriceMax(maxPrice);
|
|
3925
|
+
}
|
|
3926
|
+
}, [externalPriceRange, minPrice, maxPrice]);
|
|
3927
|
+
(0, import_react19.useEffect)(() => {
|
|
3928
|
+
if (externalDiscounts !== void 0) setSelectedDiscounts(externalDiscounts);
|
|
3929
|
+
}, [externalDiscounts]);
|
|
3930
|
+
(0, import_react19.useEffect)(() => {
|
|
3931
|
+
if (externalOptions !== void 0) setSelectedOptions(externalOptions);
|
|
3932
|
+
}, [externalOptions]);
|
|
3933
|
+
(0, import_react19.useEffect)(() => {
|
|
3934
|
+
if (externalExperiences !== void 0) setSelectedExperiences(externalExperiences);
|
|
3935
|
+
}, [externalExperiences]);
|
|
3936
|
+
(0, import_react19.useEffect)(() => {
|
|
3937
|
+
if (externalRegions !== void 0) setSelectedRegions(externalRegions);
|
|
3938
|
+
}, [externalRegions]);
|
|
3939
|
+
(0, import_react19.useEffect)(() => {
|
|
3940
|
+
if (externalCategories !== void 0) setSelectedCategories(externalCategories);
|
|
3941
|
+
}, [externalCategories]);
|
|
3942
|
+
(0, import_react19.useEffect)(() => {
|
|
3943
|
+
if (externalMeals !== void 0) setSelectedMeals(externalMeals);
|
|
3944
|
+
}, [externalMeals]);
|
|
3945
|
+
(0, import_react19.useEffect)(() => {
|
|
3946
|
+
if (externalReviews !== void 0) setSelectedReviews(externalReviews);
|
|
3947
|
+
}, [externalReviews]);
|
|
3948
|
+
(0, import_react19.useEffect)(() => {
|
|
3949
|
+
if (externalTransport !== void 0) setSelectedTransport(externalTransport);
|
|
3950
|
+
}, [externalTransport]);
|
|
3951
|
+
(0, import_react19.useEffect)(() => {
|
|
3952
|
+
if (externalWellness !== void 0) setSelectedWellness(externalWellness);
|
|
3953
|
+
}, [externalWellness]);
|
|
3954
|
+
(0, import_react19.useEffect)(() => {
|
|
3955
|
+
if (externalServices !== void 0) setSelectedServices(externalServices);
|
|
3956
|
+
}, [externalServices]);
|
|
3957
|
+
const handlePriceChange = (value) => {
|
|
3958
|
+
setPriceMin(value.min);
|
|
3959
|
+
setPriceMax(value.max);
|
|
3960
|
+
};
|
|
3961
|
+
const handlePriceSearch = (0, import_react19.useCallback)(async (range) => {
|
|
3962
|
+
await onFilterChange?.({ priceRange: range });
|
|
3963
|
+
}, [onFilterChange]);
|
|
3964
|
+
const debouncedFetch = useDebounce(handlePriceSearch, 500);
|
|
3965
|
+
const handlePriceApply = (range) => {
|
|
3966
|
+
debouncedFetch(range);
|
|
3967
|
+
};
|
|
3968
|
+
const handleDiscountToggle = (discountValue) => {
|
|
3969
|
+
setSelectedDiscounts((prev) => {
|
|
3970
|
+
const newDiscounts = prev.includes(discountValue) ? prev.filter((d) => d !== discountValue) : [...prev, discountValue];
|
|
3971
|
+
onFilterChange?.({ discounts: newDiscounts });
|
|
3972
|
+
return newDiscounts;
|
|
3973
|
+
});
|
|
3974
|
+
};
|
|
3975
|
+
const handleOptionToggle = (optionValue) => {
|
|
3976
|
+
setSelectedOptions((prev) => {
|
|
3977
|
+
const newOptions = prev.includes(optionValue) ? prev.filter((o) => o !== optionValue) : [...prev, optionValue];
|
|
3978
|
+
onFilterChange?.({ options: newOptions });
|
|
3979
|
+
return newOptions;
|
|
3980
|
+
});
|
|
3981
|
+
};
|
|
3982
|
+
const handleServicesChange = (values) => {
|
|
3983
|
+
setSelectedServices(values);
|
|
3984
|
+
onFilterChange?.({ services: values });
|
|
3985
|
+
};
|
|
3986
|
+
const handleRegionsChange = (values) => {
|
|
3987
|
+
setSelectedRegions(values);
|
|
3988
|
+
onFilterChange?.({ regions: values });
|
|
3989
|
+
};
|
|
3990
|
+
const handleExperienceChange = (values) => {
|
|
3991
|
+
setSelectedExperiences(values);
|
|
3992
|
+
onFilterChange?.({ experiences: values });
|
|
3993
|
+
};
|
|
3994
|
+
const handleCategoriesChange = (values) => {
|
|
3995
|
+
setSelectedCategories(values);
|
|
3996
|
+
onFilterChange?.({ categories: values });
|
|
3997
|
+
};
|
|
3998
|
+
const handleMealsChange = (values) => {
|
|
3999
|
+
setSelectedMeals(values);
|
|
4000
|
+
onFilterChange?.({ meals: values });
|
|
4001
|
+
};
|
|
4002
|
+
const handleReviewsChange = (values) => {
|
|
4003
|
+
setSelectedReviews(values);
|
|
4004
|
+
onFilterChange?.({ ratings: values });
|
|
4005
|
+
};
|
|
4006
|
+
const handleTransportChange = (values) => {
|
|
4007
|
+
setSelectedTransport(values);
|
|
4008
|
+
onFilterChange?.({ transport: values });
|
|
4009
|
+
};
|
|
4010
|
+
const handleWellnessChange = (values) => {
|
|
4011
|
+
setSelectedWellness(values);
|
|
4012
|
+
onFilterChange?.({ wellness: values });
|
|
4013
|
+
};
|
|
4014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("aside", { className: `${FilterPanel_default.filterPanel} ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: FilterPanel_default.content, children: [
|
|
4015
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4016
|
+
CollapsibleFilterSection,
|
|
4017
|
+
{
|
|
4018
|
+
title: t("filter.destination", "Destination"),
|
|
4019
|
+
defaultExpanded: true,
|
|
4020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4021
|
+
RegionsFilter,
|
|
4022
|
+
{
|
|
4023
|
+
regions,
|
|
4024
|
+
selected: selectedRegions,
|
|
4025
|
+
onChange: handleRegionsChange
|
|
4026
|
+
}
|
|
4027
|
+
)
|
|
4028
|
+
}
|
|
4029
|
+
),
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4031
|
+
CollapsibleFilterSection,
|
|
4032
|
+
{
|
|
4033
|
+
title: t("filter.experience", "Experience"),
|
|
4034
|
+
defaultExpanded: selectedExperiences.length > 0,
|
|
4035
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4036
|
+
ExperienceFilter,
|
|
4037
|
+
{
|
|
4038
|
+
selected: selectedExperiences,
|
|
4039
|
+
themes,
|
|
4040
|
+
onChange: handleExperienceChange
|
|
4041
|
+
}
|
|
4042
|
+
)
|
|
4043
|
+
}
|
|
4044
|
+
),
|
|
4045
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4046
|
+
CollapsibleFilterSection,
|
|
4047
|
+
{
|
|
4048
|
+
title: t("filter.price", "Price"),
|
|
4049
|
+
defaultExpanded: true,
|
|
4050
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4051
|
+
PriceRangeFilter,
|
|
4052
|
+
{
|
|
4053
|
+
minPrice,
|
|
4054
|
+
maxPrice,
|
|
4055
|
+
value: { min: priceMin, max: priceMax },
|
|
4056
|
+
onChange: handlePriceChange,
|
|
4057
|
+
onApply: handlePriceApply,
|
|
4058
|
+
histogram: priceHistogram,
|
|
4059
|
+
currency
|
|
4060
|
+
}
|
|
4061
|
+
)
|
|
4062
|
+
}
|
|
4063
|
+
),
|
|
4064
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4065
|
+
CollapsibleFilterSection,
|
|
4066
|
+
{
|
|
4067
|
+
title: t("filter.discount", "Discount"),
|
|
4068
|
+
defaultExpanded: true,
|
|
4069
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: FilterPanel_default.discountList, children: DISCOUNT_OPTIONS.map((option) => {
|
|
4070
|
+
const count = discountCounts[option.value];
|
|
4071
|
+
const isDisabled = count === 0 && !selectedDiscounts.includes(option.value);
|
|
4072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4073
|
+
FilterCheckboxItem,
|
|
4074
|
+
{
|
|
4075
|
+
id: `discount-${option.value}`,
|
|
4076
|
+
label: option.label,
|
|
4077
|
+
count,
|
|
4078
|
+
checked: selectedDiscounts.includes(option.value),
|
|
4079
|
+
disabled: isDisabled,
|
|
4080
|
+
onChange: () => handleDiscountToggle(option.value)
|
|
4081
|
+
},
|
|
4082
|
+
option.value
|
|
4083
|
+
);
|
|
4084
|
+
}) })
|
|
4085
|
+
}
|
|
4086
|
+
),
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4088
|
+
CollapsibleFilterSection,
|
|
4089
|
+
{
|
|
4090
|
+
title: t("filter.options", "Options"),
|
|
4091
|
+
defaultExpanded: selectedOptions.length > 0 || selectedServices.length > 0,
|
|
4092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: FilterPanel_default.discountList, children: [
|
|
4093
|
+
OPTIONS_FILTER.map((option) => {
|
|
4094
|
+
const count = optionsCounts[option.value];
|
|
4095
|
+
const isDisabled = count === 0 && !selectedOptions.includes(option.value);
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4097
|
+
FilterCheckboxItem,
|
|
4098
|
+
{
|
|
4099
|
+
id: `option-${option.value}`,
|
|
4100
|
+
label: t(option.labelKey, "Instantly bookable"),
|
|
4101
|
+
count,
|
|
4102
|
+
checked: selectedOptions.includes(option.value),
|
|
4103
|
+
disabled: isDisabled,
|
|
4104
|
+
onChange: () => handleOptionToggle(option.value)
|
|
4105
|
+
},
|
|
4106
|
+
option.value
|
|
4107
|
+
);
|
|
4108
|
+
}),
|
|
4109
|
+
filterOptions?.services?.map((option) => {
|
|
4110
|
+
const count = servicesCounts[option.key];
|
|
4111
|
+
const isDisabled = count === 0 && !selectedServices.includes(option.key);
|
|
4112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4113
|
+
FilterCheckboxItem,
|
|
4114
|
+
{
|
|
4115
|
+
id: `service-${option.key}`,
|
|
4116
|
+
label: option.name,
|
|
4117
|
+
count,
|
|
4118
|
+
checked: selectedServices.includes(option.key),
|
|
4119
|
+
disabled: isDisabled,
|
|
4120
|
+
onChange: () => handleServicesChange(
|
|
4121
|
+
selectedServices.includes(option.key) ? selectedServices.filter((v) => v !== option.key) : [...selectedServices, option.key]
|
|
4122
|
+
)
|
|
4123
|
+
},
|
|
4124
|
+
option.key
|
|
4125
|
+
);
|
|
4126
|
+
})
|
|
4127
|
+
] })
|
|
4128
|
+
}
|
|
4129
|
+
),
|
|
4130
|
+
filterOptions?.meals && filterOptions.meals.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4131
|
+
CollapsibleFilterSection,
|
|
4132
|
+
{
|
|
4133
|
+
title: t("filter.meals", "Meals"),
|
|
4134
|
+
defaultExpanded: selectedMeals.length > 0,
|
|
4135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4136
|
+
MealsFilter,
|
|
4137
|
+
{
|
|
4138
|
+
selected: selectedMeals,
|
|
4139
|
+
counts: mealsCounts,
|
|
4140
|
+
options: filterOptions.meals,
|
|
4141
|
+
onChange: handleMealsChange
|
|
4142
|
+
}
|
|
4143
|
+
)
|
|
4144
|
+
}
|
|
4145
|
+
),
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4147
|
+
CollapsibleFilterSection,
|
|
4148
|
+
{
|
|
4149
|
+
title: t("filter.hotel-category", "Hotel category"),
|
|
4150
|
+
defaultExpanded: true,
|
|
4151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4152
|
+
HotelCategoryFilter,
|
|
4153
|
+
{
|
|
4154
|
+
selected: selectedCategories,
|
|
4155
|
+
counts: categoryCounts,
|
|
4156
|
+
onChange: handleCategoriesChange
|
|
4157
|
+
}
|
|
4158
|
+
)
|
|
4159
|
+
}
|
|
4160
|
+
),
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4162
|
+
CollapsibleFilterSection,
|
|
4163
|
+
{
|
|
4164
|
+
title: t("filter.reviews", "Reviews"),
|
|
4165
|
+
defaultExpanded: selectedReviews.length > 0,
|
|
4166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4167
|
+
ReviewsFilter,
|
|
4168
|
+
{
|
|
4169
|
+
selected: selectedReviews,
|
|
4170
|
+
counts: reviewsCounts,
|
|
4171
|
+
onChange: handleReviewsChange
|
|
4172
|
+
}
|
|
4173
|
+
)
|
|
4174
|
+
}
|
|
4175
|
+
),
|
|
4176
|
+
filterOptions?.transport && filterOptions.transport.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4177
|
+
CollapsibleFilterSection,
|
|
4178
|
+
{
|
|
4179
|
+
title: t("filter.mobility", "Mobility"),
|
|
4180
|
+
defaultExpanded: selectedTransport.length > 0,
|
|
4181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4182
|
+
TransportFilter,
|
|
4183
|
+
{
|
|
4184
|
+
selected: selectedTransport,
|
|
4185
|
+
counts: transportCounts,
|
|
4186
|
+
options: filterOptions.transport,
|
|
4187
|
+
onChange: handleTransportChange
|
|
4188
|
+
}
|
|
4189
|
+
)
|
|
4190
|
+
}
|
|
4191
|
+
),
|
|
4192
|
+
filterOptions?.wellness && filterOptions.wellness.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4193
|
+
CollapsibleFilterSection,
|
|
4194
|
+
{
|
|
4195
|
+
title: t("filter.wellness-spa", "Wellness & Spa"),
|
|
4196
|
+
defaultExpanded: selectedWellness.length > 0,
|
|
4197
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4198
|
+
WellnessFilter,
|
|
4199
|
+
{
|
|
4200
|
+
selected: selectedWellness,
|
|
4201
|
+
counts: wellnessCounts,
|
|
4202
|
+
options: filterOptions.wellness,
|
|
4203
|
+
onChange: handleWellnessChange
|
|
4204
|
+
}
|
|
4205
|
+
)
|
|
4206
|
+
}
|
|
4207
|
+
)
|
|
4208
|
+
] }) });
|
|
4209
|
+
};
|
|
4210
|
+
|
|
4211
|
+
// src/components/Filters/FilterModal.tsx
|
|
4212
|
+
var import_react20 = require("react");
|
|
4213
|
+
|
|
4214
|
+
// src/components/Filters/FilterModal.module.css
|
|
4215
|
+
var FilterModal_default = {};
|
|
4216
|
+
|
|
4217
|
+
// src/components/Filters/FilterModal.tsx
|
|
4218
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4219
|
+
var CloseIcon3 = () => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M0.275391 1.59961C-0.0917969 1.23242 -0.0917969 0.638672 0.275391 0.275391C0.642578 -0.0878906 1.23633 -0.0917969 1.59961 0.275391L7.49805 6.17383L13.3965 0.275391C13.7637 -0.0917969 14.3574 -0.0917969 14.7207 0.275391C15.084 0.642578 15.0879 1.23633 14.7207 1.59961L8.82226 7.49805L14.7207 13.3965C15.0879 13.7637 15.0879 14.3574 14.7207 14.7207C14.3535 15.084 13.7598 15.0879 13.3965 14.7207L7.49805 8.82226L1.59961 14.7207C1.23242 15.0879 0.638672 15.0879 0.275391 14.7207C-0.0878906 14.3535 -0.0917969 13.7598 0.275391 13.3965L6.17383 7.49805L0.275391 1.59961Z", fill: "#1F2937" }) });
|
|
4220
|
+
var FilterModal = ({
|
|
4221
|
+
isOpen,
|
|
4222
|
+
onClose,
|
|
4223
|
+
resultCount = 0,
|
|
4224
|
+
selectedFilters = [],
|
|
4225
|
+
onRemoveFilter,
|
|
4226
|
+
onClearAllFilters,
|
|
4227
|
+
onFilterChange,
|
|
4228
|
+
selectedDiscounts = [],
|
|
4229
|
+
selectedOptions = [],
|
|
4230
|
+
selectedCategories = [],
|
|
4231
|
+
selectedExperiences = [],
|
|
4232
|
+
selectedRegions = [],
|
|
4233
|
+
selectedMeals = [],
|
|
4234
|
+
selectedWellness = [],
|
|
4235
|
+
selectedServices = [],
|
|
4236
|
+
selectedTransport = [],
|
|
4237
|
+
selectedReviews = [],
|
|
4238
|
+
selectedPriceRange,
|
|
4239
|
+
minPrice = 0,
|
|
4240
|
+
maxPrice = 500,
|
|
4241
|
+
regions = [],
|
|
4242
|
+
...filterPanelProps
|
|
4243
|
+
}) => {
|
|
4244
|
+
const { t } = useUIContext();
|
|
4245
|
+
const hasSelectedFilters = selectedFilters.length > 0;
|
|
4246
|
+
(0, import_react20.useEffect)(() => {
|
|
4247
|
+
if (isOpen) {
|
|
4248
|
+
document.body.style.overflow = "hidden";
|
|
4249
|
+
return () => {
|
|
4250
|
+
document.body.style.overflow = "";
|
|
4251
|
+
};
|
|
4252
|
+
}
|
|
4253
|
+
}, [isOpen]);
|
|
4254
|
+
if (!isOpen) return null;
|
|
4255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: FilterModal_default.overlay, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: FilterModal_default.modal, children: [
|
|
4256
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: FilterModal_default.header, children: [
|
|
4257
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h2", { className: FilterModal_default.title, children: t("filter.filters", "Filters") }),
|
|
4258
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4259
|
+
Button,
|
|
4260
|
+
{
|
|
4261
|
+
variant: "secondary",
|
|
4262
|
+
size: "small",
|
|
4263
|
+
iconOnly: true,
|
|
4264
|
+
onClick: onClose,
|
|
4265
|
+
"aria-label": t("filter.close", "Close"),
|
|
4266
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CloseIcon3, {})
|
|
4267
|
+
}
|
|
4268
|
+
)
|
|
4269
|
+
] }),
|
|
4270
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: FilterModal_default.content, children: [
|
|
4271
|
+
selectedFilters.length > 0 && onRemoveFilter && onClearAllFilters && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: FilterModal_default.selectedFilters, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4272
|
+
SelectedFiltersRow,
|
|
4273
|
+
{
|
|
4274
|
+
filters: selectedFilters,
|
|
4275
|
+
onRemove: onRemoveFilter,
|
|
4276
|
+
onClearAll: onClearAllFilters
|
|
4277
|
+
}
|
|
4278
|
+
) }),
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4280
|
+
FilterPanel,
|
|
4281
|
+
{
|
|
4282
|
+
...filterPanelProps,
|
|
4283
|
+
onFilterChange,
|
|
4284
|
+
selectedDiscounts,
|
|
4285
|
+
selectedOptions,
|
|
4286
|
+
selectedCategories,
|
|
4287
|
+
selectedExperiences,
|
|
4288
|
+
selectedRegions,
|
|
4289
|
+
selectedMeals,
|
|
4290
|
+
selectedWellness,
|
|
4291
|
+
selectedServices,
|
|
4292
|
+
selectedTransport,
|
|
4293
|
+
selectedReviews,
|
|
4294
|
+
selectedPriceRange,
|
|
4295
|
+
minPrice,
|
|
4296
|
+
maxPrice,
|
|
4297
|
+
regions,
|
|
4298
|
+
className: FilterModal_default.filterPanel
|
|
4299
|
+
}
|
|
4300
|
+
)
|
|
4301
|
+
] }),
|
|
4302
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: FilterModal_default.footer, children: [
|
|
4303
|
+
onClearAllFilters && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4304
|
+
Button,
|
|
4305
|
+
{
|
|
4306
|
+
variant: "link",
|
|
4307
|
+
className: FilterModal_default.footerLink,
|
|
4308
|
+
onClick: onClearAllFilters,
|
|
4309
|
+
disabled: !hasSelectedFilters,
|
|
4310
|
+
children: t("filter.clear-all", "Clear all")
|
|
4311
|
+
}
|
|
4312
|
+
),
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4314
|
+
Button,
|
|
4315
|
+
{
|
|
4316
|
+
variant: "primary",
|
|
4317
|
+
size: "medium",
|
|
4318
|
+
onClick: onClose,
|
|
4319
|
+
children: t("filter.show-results", "Show {count} results").replace("{count}", String(resultCount))
|
|
4320
|
+
}
|
|
4321
|
+
)
|
|
4322
|
+
] })
|
|
4323
|
+
] }) });
|
|
4324
|
+
};
|
|
4325
|
+
|
|
4326
|
+
// src/components/icons/HeartIcon.tsx
|
|
4327
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4328
|
+
var HeartIcon3 = ({ filled = false, className = "", size = 24 }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3854
4329
|
"svg",
|
|
3855
4330
|
{
|
|
3856
4331
|
width: size,
|
|
@@ -3862,14 +4337,14 @@ var HeartIcon3 = ({ filled = false, className = "", size = 24 }) => /* @__PURE__
|
|
|
3862
4337
|
strokeWidth: 2,
|
|
3863
4338
|
strokeLinecap: "round",
|
|
3864
4339
|
strokeLinejoin: "round",
|
|
3865
|
-
children: /* @__PURE__ */ (0,
|
|
4340
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("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" })
|
|
3866
4341
|
}
|
|
3867
4342
|
);
|
|
3868
4343
|
HeartIcon3.displayName = "HeartIcon";
|
|
3869
4344
|
|
|
3870
4345
|
// src/components/icons/StarIcon.tsx
|
|
3871
|
-
var
|
|
3872
|
-
var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */ (0,
|
|
4346
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4347
|
+
var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3873
4348
|
"svg",
|
|
3874
4349
|
{
|
|
3875
4350
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3879,22 +4354,22 @@ var StarIcon4 = ({ filled = true, className = "", size = 9 }) => /* @__PURE__ */
|
|
|
3879
4354
|
fill: "none",
|
|
3880
4355
|
className,
|
|
3881
4356
|
children: [
|
|
3882
|
-
/* @__PURE__ */ (0,
|
|
4357
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("g", { clipPath: "url(#clip0_star_icon)", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3883
4358
|
"path",
|
|
3884
4359
|
{
|
|
3885
4360
|
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",
|
|
3886
4361
|
fill: filled ? "#1F2937" : "#D1D5DB"
|
|
3887
4362
|
}
|
|
3888
4363
|
) }),
|
|
3889
|
-
/* @__PURE__ */ (0,
|
|
4364
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("clipPath", { id: "clip0_star_icon", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("rect", { width: "8", height: "8", fill: "white", transform: "translate(0.800049 0.199951)" }) }) })
|
|
3890
4365
|
]
|
|
3891
4366
|
}
|
|
3892
4367
|
);
|
|
3893
4368
|
StarIcon4.displayName = "StarIcon";
|
|
3894
4369
|
|
|
3895
4370
|
// src/components/icons/ChevronLeftIcon.tsx
|
|
3896
|
-
var
|
|
3897
|
-
var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */ (0,
|
|
4371
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4372
|
+
var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3898
4373
|
"svg",
|
|
3899
4374
|
{
|
|
3900
4375
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3907,14 +4382,14 @@ var ChevronLeftIcon = ({ className = "", size = 20 }) => /* @__PURE__ */ (0, imp
|
|
|
3907
4382
|
strokeLinecap: "round",
|
|
3908
4383
|
strokeLinejoin: "round",
|
|
3909
4384
|
className,
|
|
3910
|
-
children: /* @__PURE__ */ (0,
|
|
4385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("polyline", { points: "15 18 9 12 15 6" })
|
|
3911
4386
|
}
|
|
3912
4387
|
);
|
|
3913
4388
|
ChevronLeftIcon.displayName = "ChevronLeftIcon";
|
|
3914
4389
|
|
|
3915
4390
|
// src/components/icons/ChevronRightIcon.tsx
|
|
3916
|
-
var
|
|
3917
|
-
var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */ (0,
|
|
4391
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4392
|
+
var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3918
4393
|
"svg",
|
|
3919
4394
|
{
|
|
3920
4395
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3927,14 +4402,14 @@ var ChevronRightIcon2 = ({ className = "", size = 20 }) => /* @__PURE__ */ (0, i
|
|
|
3927
4402
|
strokeLinecap: "round",
|
|
3928
4403
|
strokeLinejoin: "round",
|
|
3929
4404
|
className,
|
|
3930
|
-
children: /* @__PURE__ */ (0,
|
|
4405
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("polyline", { points: "9 18 15 12 9 6" })
|
|
3931
4406
|
}
|
|
3932
4407
|
);
|
|
3933
4408
|
ChevronRightIcon2.displayName = "ChevronRightIcon";
|
|
3934
4409
|
|
|
3935
4410
|
// src/components/icons/PinIcon.tsx
|
|
3936
|
-
var
|
|
3937
|
-
var PinIcon2 = ({ className = "", size = 16 }) => /* @__PURE__ */ (0,
|
|
4411
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4412
|
+
var PinIcon2 = ({ className = "", size = 16 }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
3938
4413
|
"svg",
|
|
3939
4414
|
{
|
|
3940
4415
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3944,7 +4419,7 @@ var PinIcon2 = ({ className = "", size = 16 }) => /* @__PURE__ */ (0, import_jsx
|
|
|
3944
4419
|
fill: "none",
|
|
3945
4420
|
className,
|
|
3946
4421
|
children: [
|
|
3947
|
-
/* @__PURE__ */ (0,
|
|
4422
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3948
4423
|
"path",
|
|
3949
4424
|
{
|
|
3950
4425
|
fillRule: "evenodd",
|
|
@@ -3953,7 +4428,7 @@ var PinIcon2 = ({ className = "", size = 16 }) => /* @__PURE__ */ (0, import_jsx
|
|
|
3953
4428
|
fill: "currentColor"
|
|
3954
4429
|
}
|
|
3955
4430
|
),
|
|
3956
|
-
/* @__PURE__ */ (0,
|
|
4431
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3957
4432
|
"path",
|
|
3958
4433
|
{
|
|
3959
4434
|
fillRule: "evenodd",
|
|
@@ -4017,6 +4492,8 @@ var calculateDiscount = (originalPrice, discountedPrice) => {
|
|
|
4017
4492
|
ExperienceFilter,
|
|
4018
4493
|
FAQ,
|
|
4019
4494
|
FilterCheckboxItem,
|
|
4495
|
+
FilterModal,
|
|
4496
|
+
FilterPanel,
|
|
4020
4497
|
GuestContent,
|
|
4021
4498
|
HeartIcon,
|
|
4022
4499
|
HotelCard,
|