willba-component-library 0.3.2 → 0.3.3
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/lib/assets/IconsSvg.d.ts +2 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/FilterBar/FilterBar.d.ts +2 -1
- package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +2 -1
- package/lib/components/FilterBar/components/categories/Categories.d.ts +2 -1
- package/lib/components/FilterBar/components/divider/Divider.d.ts +2 -1
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +2 -1
- package/lib/components/FilterCalendar/components/Footer.d.ts +2 -1
- package/lib/core/components/buttons/close-button/CloseButton.d.ts +2 -1
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -2
- package/lib/index.d.ts +3 -4
- package/lib/index.esm.js +180 -98
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +180 -98
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +183 -101
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.mjs +3 -1
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
3
|
var React = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
|
|
6
6
|
/******************************************************************************
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
@@ -202,7 +202,7 @@ styleInject(css_248z$f);
|
|
|
202
202
|
var Button$1 = function (_a) {
|
|
203
203
|
var _b = _a.type, type = _b === void 0 ? "primary" : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? "medium" : _c, onClick = _a.onClick, label = _a.label;
|
|
204
204
|
var _d = __read(React.useState(4), 2), theState = _d[0]; _d[1];
|
|
205
|
-
return (
|
|
205
|
+
return (React.createElement("button", { type: "button", className: classNames("storybook-button", "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
|
|
206
206
|
};
|
|
207
207
|
|
|
208
208
|
function warn() {
|
|
@@ -3005,7 +3005,9 @@ styleInject(css_248z$d);
|
|
|
3005
3005
|
|
|
3006
3006
|
var SubmitButton = function (_a) {
|
|
3007
3007
|
var onClick = _a.onClick, startIcon = _a.startIcon, label = _a.label, disabled = _a.disabled, isLoading = _a.isLoading, variant = _a.variant;
|
|
3008
|
-
return (
|
|
3008
|
+
return (React.createElement("button", { className: "will-filter-bar-submit-button ".concat(variant || 'default'), onClick: onClick, disabled: disabled || isLoading },
|
|
3009
|
+
isLoading ? (React.createElement("span", null, React.createElement(FaSpinner, { style: { animation: 'spin 1s linear infinite' } }))) : (startIcon && React.createElement("span", null, startIcon)),
|
|
3010
|
+
label || 'Label'));
|
|
3009
3011
|
};
|
|
3010
3012
|
|
|
3011
3013
|
// THIS FILE IS AUTO GENERATED
|
|
@@ -3018,7 +3020,8 @@ styleInject(css_248z$c);
|
|
|
3018
3020
|
|
|
3019
3021
|
var CloseButton = function (_a) {
|
|
3020
3022
|
var handleClose = _a.handleClose;
|
|
3021
|
-
return (
|
|
3023
|
+
return (React.createElement("button", { className: "will-filter-bar-close-button", onClick: handleClose },
|
|
3024
|
+
React.createElement(IoIosCloseCircleOutline, null)));
|
|
3022
3025
|
};
|
|
3023
3026
|
|
|
3024
3027
|
/**
|
|
@@ -11262,15 +11265,19 @@ var IconsSvg = function (_a) {
|
|
|
11262
11265
|
var fill = _a.fill, size = _a.size, icon = _a.icon;
|
|
11263
11266
|
switch (icon) {
|
|
11264
11267
|
case 'spinner':
|
|
11265
|
-
return (
|
|
11268
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), viewBox: "0 0 24 24" },
|
|
11269
|
+
React.createElement("style", null, "\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n "),
|
|
11270
|
+
React.createElement("path", { d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z", opacity: ".25", fill: fill }),
|
|
11271
|
+
React.createElement("path", { d: "M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z", className: "spinner_z9k8", fill: fill })));
|
|
11266
11272
|
case 'warning':
|
|
11267
|
-
return (
|
|
11273
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "".concat(size || 25), height: "".concat(size || 25), className: "svg-icon", style: {
|
|
11268
11274
|
verticalAlign: 'middle',
|
|
11269
11275
|
fill: fill,
|
|
11270
11276
|
overflow: 'hidden',
|
|
11271
11277
|
minWidth: '25px',
|
|
11272
11278
|
minHeight: '25px',
|
|
11273
|
-
}, viewBox: "0 0 1024 1024", version: "1.1"
|
|
11279
|
+
}, viewBox: "0 0 1024 1024", version: "1.1" },
|
|
11280
|
+
React.createElement("path", { d: "M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z" })));
|
|
11274
11281
|
default:
|
|
11275
11282
|
return null;
|
|
11276
11283
|
}
|
|
@@ -11852,39 +11859,53 @@ var Calendar = React.forwardRef(function (_a, ref) {
|
|
|
11852
11859
|
: __spreadArray$1(__spreadArray$1(__spreadArray$1(__spreadArray$1([
|
|
11853
11860
|
lastPossibleCheckout
|
|
11854
11861
|
], __read(base), false), __read(firstPossibleRangeContextCheckIn), false), __read(lastPossibleRangeContextCheckOut), false), __read(disabledInsideSelectableRange()), false);
|
|
11855
|
-
return (
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11862
|
+
return (React.createElement("div", { className: "will-filter-bar-calendar", ref: ref },
|
|
11863
|
+
React.createElement("div", { className: "will-calendar-filter-container", ref: calendarContainerRef },
|
|
11864
|
+
React.createElement(DayPicker, { key: updateCalendarDefaultMonth, id: "will-calendar", mode: "range", locale: language === 'en' ? enUS : fi, numberOfMonths: !isTablet ? 2 : 1, weekStartsOn: 1, selected: calendarRange, onSelect: function (range) { return handleOnSelect(range); }, captionLayout: "dropdown-buttons", defaultMonth: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ||
|
|
11865
|
+
selectedStartDate ||
|
|
11866
|
+
rangeContextStartDate ||
|
|
11867
|
+
(((_b = newDisableCalendarDates === null || newDisableCalendarDates === void 0 ? void 0 : newDisableCalendarDates.disabledDates) === null || _b === void 0 ? void 0 : _b.length)
|
|
11868
|
+
? newDisableCalendarDates.disabledDates[0].from
|
|
11869
|
+
: today), disabled: disabled, fromMonth: today, onMonthChange: function (val) {
|
|
11870
|
+
requestDates === null || requestDates === void 0 ? void 0 : requestDates(val);
|
|
11871
|
+
setUpdateCalendarMonthNavigation === null || setUpdateCalendarMonthNavigation === void 0 ? void 0 : setUpdateCalendarMonthNavigation(function (prev) { return !prev; });
|
|
11872
|
+
}, classNames: {
|
|
11873
|
+
day_range_start: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from) ? 'rdp-day_range_start' : '',
|
|
11874
|
+
day_range_end: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) ? 'rdp-day_range_end' : '',
|
|
11875
|
+
}, modifiersClassNames: {
|
|
11876
|
+
today: 'my-today',
|
|
11877
|
+
booked: 'booked',
|
|
11878
|
+
disabledAfterCheckIn: 'disabled-after-check-in',
|
|
11879
|
+
overlappingDate: 'overlapping-date',
|
|
11880
|
+
noActiveSelectionStart: 'no-active-selection-start',
|
|
11881
|
+
noActiveSelectionMid: 'no-active-selection-mid',
|
|
11882
|
+
noActiveSelectionEnd: 'no-active-selection-end',
|
|
11883
|
+
checkoutOptionsMid: 'rdp-day_selected rdp-day_range_middle checkout-option',
|
|
11884
|
+
checkInOnly: 'check-in-only',
|
|
11885
|
+
checkOutOnly: 'check-out-only',
|
|
11886
|
+
}, modifiers:
|
|
11887
|
+
// This function handles conditions for applying the modifiersClassNames
|
|
11888
|
+
handleCalendarModifiers({
|
|
11889
|
+
calendarRange: calendarRange,
|
|
11890
|
+
disabledDates: disabled,
|
|
11891
|
+
overlappingDate: overlappingDate,
|
|
11892
|
+
rangeContext: rangeContext,
|
|
11893
|
+
findFirstPossibleRangeContextCheckIn: findFirstPossibleRangeContextCheckIn,
|
|
11894
|
+
findLastPossibleRangeContextCheckOut: findLastPossibleRangeContextCheckOut,
|
|
11895
|
+
currentSelectionLastCheckoutDate: currentSelectionAvailability,
|
|
11896
|
+
}) }),
|
|
11897
|
+
React.createElement("div", { className: 'will-calendar-tooltip' },
|
|
11898
|
+
React.createElement("div", null, t('noCheckIn'))),
|
|
11899
|
+
React.createElement("div", { className: 'will-calendar-tooltip-check-out' },
|
|
11900
|
+
React.createElement("div", null, t('noCheckOut'))),
|
|
11901
|
+
React.createElement("div", { className: 'will-calendar-tooltip-overlapping-date' },
|
|
11902
|
+
React.createElement("div", null, t('checkOutOnly'))),
|
|
11903
|
+
React.createElement("div", { className: 'will-calendar-tooltip-check-in-only' },
|
|
11904
|
+
React.createElement("div", null, t('checkInOnly'))),
|
|
11905
|
+
React.createElement("div", { className: 'will-calendar-tooltip-check-out-only' },
|
|
11906
|
+
React.createElement("div", null, t('checkOutOnly'))),
|
|
11907
|
+
React.createElement("div", { className: 'will-calendar-spinner' },
|
|
11908
|
+
React.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.primary) || 'inherit', size: 50, icon: "spinner" })))));
|
|
11888
11909
|
});
|
|
11889
11910
|
|
|
11890
11911
|
var parseGuests = function (_a) {
|
|
@@ -12134,7 +12155,11 @@ styleInject(css_248z$9);
|
|
|
12134
12155
|
|
|
12135
12156
|
var SelectButton = React.forwardRef(function (_a, ref) {
|
|
12136
12157
|
var active = _a.active, label = _a.label, onClick = _a.onClick, description = _a.description, ariaExpanded = _a.ariaExpanded, ariaControls = _a.ariaControls;
|
|
12137
|
-
return (
|
|
12158
|
+
return (React.createElement("button", { ref: ref, className: "will-filter-bar-select-button", onClick: onClick, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": "true" },
|
|
12159
|
+
React.createElement("span", { className: "select-button-wrapper" },
|
|
12160
|
+
React.createElement("div", null,
|
|
12161
|
+
React.createElement("p", { className: "select-button-label" }, label),
|
|
12162
|
+
React.createElement("p", { className: "select-button-description ".concat(active ? 'active' : ''), dangerouslySetInnerHTML: { __html: description } })))));
|
|
12138
12163
|
});
|
|
12139
12164
|
SelectButton.displayName = 'SelectButton';
|
|
12140
12165
|
|
|
@@ -12143,7 +12168,7 @@ styleInject(css_248z$8);
|
|
|
12143
12168
|
|
|
12144
12169
|
var TabButton = function (_a) {
|
|
12145
12170
|
var onClick = _a.onClick, label = _a.label, active = _a.active, mode = _a.mode;
|
|
12146
|
-
return (
|
|
12171
|
+
return (React.createElement("button", { className: "will-filter-bar-tab-button ".concat(mode || 'light', " ").concat(active && 'active', " "), onClick: onClick }, label));
|
|
12147
12172
|
};
|
|
12148
12173
|
|
|
12149
12174
|
var css_248z$7 = ".will-guests-filter-label, .will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text)\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-top: 30px;\n}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\n \n}\n\n.will-guests-filter-inner .will-guests-filter-counter {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 10px;\n min-width: 30px;\n text-align: center;\n}\n\n.will-guests-filter-counter-button {\n \n border-radius: 50%;\n background-color: transparent;\n border: 1px solid var(--will-grey);\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n color: var(--will-black);\n\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.will-guests-filter-counter-button:hover {\n background-color: var(--will-onahau);\n}\n\n@media (max-width: 960px) {\n\n .will-guests-filter-inner {\n width: 100%;\n margin: 15px 0;\n justify-content: space-between;\n }\n}";
|
|
@@ -12164,11 +12189,20 @@ var GuestCount = function (_a) {
|
|
|
12164
12189
|
var handleIncrement = function () {
|
|
12165
12190
|
updateGuestsCount("guests-".concat(id), count + 1);
|
|
12166
12191
|
};
|
|
12167
|
-
return (
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12171
|
-
|
|
12192
|
+
return (React.createElement("div", { className: "will-guests-filter-inner", style: { order: "".concat(sortOrder) } },
|
|
12193
|
+
React.createElement("p", { className: "will-guests-filter-label" }, label),
|
|
12194
|
+
React.createElement("div", { className: "will-guests-filter-counter" },
|
|
12195
|
+
React.createElement("button", { className: "will-guests-filter-counter-button", onClick: handleDecrement, disabled: (minVal && count <= minVal) || !count, style: {
|
|
12196
|
+
cursor: (minVal && count <= minVal) || !count ? 'initial' : 'pointer',
|
|
12197
|
+
paddingBottom: '4px',
|
|
12198
|
+
opacity: (minVal && count <= minVal) || !count ? 0.4 : 1,
|
|
12199
|
+
} },
|
|
12200
|
+
React.createElement("svg", { width: "10", height: "10", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12201
|
+
React.createElement("path", { d: "M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))),
|
|
12202
|
+
React.createElement("span", { className: "will-guests-filter-count" }, count),
|
|
12203
|
+
React.createElement("button", { className: "will-guests-filter-counter-button", onClick: handleIncrement },
|
|
12204
|
+
React.createElement("svg", { width: "15", height: "15", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
12205
|
+
React.createElement("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))))));
|
|
12172
12206
|
};
|
|
12173
12207
|
|
|
12174
12208
|
var css_248z$6 = ".will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-title {\n font-size: 22px;\n margin: 10px 0;\n}\n\n.will-guests-filter-subtitle {\n font-size: 15px;\n font-weight: 500;\n color:var(--will-text)\n}\n\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n}\n\n\n@media (max-width: 960px) {\n .will-guests-filter-title {\n font-size: 18px;\n }\n\n .will-guests-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}";
|
|
@@ -12178,7 +12212,9 @@ var Guests = React.forwardRef(function (_a, ref) {
|
|
|
12178
12212
|
var ageCategories = _a.ageCategories, updateGuestsCount = _a.updateGuestsCount, ageCategoryCounts = _a.ageCategoryCounts, autoFocus = _a.autoFocus;
|
|
12179
12213
|
var t = useTranslation('filterBar').t;
|
|
12180
12214
|
var containerRef = useAutoFocus(autoFocus);
|
|
12181
|
-
return (
|
|
12215
|
+
return (React.createElement("div", { className: "will-filter-bar-guests", ref: ref },
|
|
12216
|
+
React.createElement("h3", { className: "will-guests-filter-title" }, t('guests.title')),
|
|
12217
|
+
React.createElement("div", { className: "will-guests-filter-container", ref: containerRef }, ageCategories === null || ageCategories === void 0 ? void 0 : ageCategories.map(function (category) { return (React.createElement(GuestCount, { key: category.id, id: category.id, label: category.name, minVal: category.minVal, sortOrder: category.sortOrder, updateGuestsCount: updateGuestsCount, count: ageCategoryCounts["guests-".concat(category.id)] || 0 })); }))));
|
|
12182
12218
|
});
|
|
12183
12219
|
Guests.displayName = 'Guests';
|
|
12184
12220
|
|
|
@@ -12186,7 +12222,7 @@ var css_248z$5 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n
|
|
|
12186
12222
|
styleInject(css_248z$5);
|
|
12187
12223
|
|
|
12188
12224
|
var Divider = function () {
|
|
12189
|
-
return
|
|
12225
|
+
return React.createElement("div", { className: "will-filter-bar-divider" });
|
|
12190
12226
|
};
|
|
12191
12227
|
|
|
12192
12228
|
var css_248z$4 = ".will-filter-bar-categories {\n text-align: center;\n}\n\n.will-categories-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0 30px 0;\n}\n\n.will-categories-filter-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 20px;\n}\n\n.will-categories-filter-inner input {\n cursor: pointer;\n margin-right: 10px;\n}\n";
|
|
@@ -12206,7 +12242,11 @@ var Categories = function (_a) {
|
|
|
12206
12242
|
setSelectedCategory(selectedCategory);
|
|
12207
12243
|
setCategories(selectedCategory);
|
|
12208
12244
|
};
|
|
12209
|
-
return (
|
|
12245
|
+
return (React.createElement("div", { className: "will-filter-bar-categories" },
|
|
12246
|
+
React.createElement("h3", { className: "will-categories-filter-title" }, t('categories.label')),
|
|
12247
|
+
React.createElement("div", { className: "will-categories-filter-inner" }, categoriesPlaceholder.map(function (itm, idx) { return (React.createElement("div", { key: idx },
|
|
12248
|
+
React.createElement("input", { type: "radio", value: itm, checked: selectedCategory === itm, onChange: function () { return handleCategoryChange(itm); } }),
|
|
12249
|
+
React.createElement("span", null, itm))); }))));
|
|
12210
12250
|
};
|
|
12211
12251
|
|
|
12212
12252
|
var css_248z$3 = ".will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-title {\n font-size: 22px;\n margin: 10px 0;\n}\n\n.will-locations-filter-subtitle {\n font-size: 15px;\n font-weight: 500;\n color: var(--will-text);\n}\n\n.will-locations-filter-container {\n display: flex;\n gap: 10px;\n flex-direction: column;\n min-width: 400px;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-title {\n font-size: 18px;\n }\n\n .will-locations-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
|
|
@@ -12218,12 +12258,16 @@ styleInject(css_248z$2);
|
|
|
12218
12258
|
var ImageCard = React.forwardRef(function (_a, ref) {
|
|
12219
12259
|
var title = _a.title, description = _a.description, imageUrl = _a.imageUrl, isSelected = _a.isSelected, onClick = _a.onClick;
|
|
12220
12260
|
var ariaLabel = "".concat(title).concat(description ? ", ".concat(description) : '');
|
|
12221
|
-
return (
|
|
12261
|
+
return (React.createElement("div", { ref: ref, className: "will-image-card ".concat(isSelected ? 'is-selected' : ''), onClick: onClick, onKeyDown: function (e) {
|
|
12222
12262
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
12223
12263
|
e.preventDefault();
|
|
12224
12264
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
12225
12265
|
}
|
|
12226
|
-
}, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel
|
|
12266
|
+
}, role: "button", tabIndex: 0, "aria-pressed": isSelected, "aria-label": ariaLabel },
|
|
12267
|
+
React.createElement("div", { className: "will-image-card-content" },
|
|
12268
|
+
React.createElement("h3", null, title),
|
|
12269
|
+
description && React.createElement("p", null, description)),
|
|
12270
|
+
React.createElement("div", { className: "will-image-card-image" }, imageUrl && React.createElement("img", { src: imageUrl, alt: title || 'Location image' }))));
|
|
12227
12271
|
});
|
|
12228
12272
|
ImageCard.displayName = 'ImageCard';
|
|
12229
12273
|
|
|
@@ -12255,13 +12299,15 @@ var Locations = React.forwardRef(function (_a, ref) {
|
|
|
12255
12299
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
12256
12300
|
}
|
|
12257
12301
|
};
|
|
12258
|
-
return (
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12302
|
+
return (React.createElement("div", { className: "will-filter-bar-locations", ref: ref },
|
|
12303
|
+
React.createElement("h3", { className: "will-locations-filter-title" }, t('locations.title')),
|
|
12304
|
+
React.createElement("div", { className: "will-locations-filter-container" }, !!((locations === null || locations === void 0 ? void 0 : locations.length) && language) &&
|
|
12305
|
+
locations
|
|
12306
|
+
.filter(function (location) { var _a; return (_a = location === null || location === void 0 ? void 0 : location.label) === null || _a === void 0 ? void 0 : _a[language]; })
|
|
12307
|
+
.map(function (location, index) {
|
|
12308
|
+
var _a;
|
|
12309
|
+
return (React.createElement(ImageCard, { key: location.id, ref: index === 0 ? firstCardRef : null, title: location.label[language], description: (_a = location.description) === null || _a === void 0 ? void 0 : _a[language], imageUrl: location.imageUrl, isSelected: selectedLocations.some(function (loc) { return loc.id === location.id; }), onClick: function () { return handleLocationClick(location); } }));
|
|
12310
|
+
}))));
|
|
12265
12311
|
});
|
|
12266
12312
|
Locations.displayName = 'Locations';
|
|
12267
12313
|
|
|
@@ -12316,28 +12362,47 @@ function FilterBar(_a) {
|
|
|
12316
12362
|
locationsPlaceholder: t('locations.placeholder'),
|
|
12317
12363
|
locationsSelectedLabel: t('locations.selected'),
|
|
12318
12364
|
});
|
|
12319
|
-
return (
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
|
|
12325
|
-
|
|
12326
|
-
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
12333
|
-
|
|
12334
|
-
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12365
|
+
return (React.createElement("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette },
|
|
12366
|
+
tabs && tabs.length > 1 && (React.createElement("div", { className: "will-filter-bar-tabs", ref: targetFilterBarRef }, tabs
|
|
12367
|
+
.sort(function (a, b) { return a.order - b.order; })
|
|
12368
|
+
.map(function (tab, idx) { return (React.createElement(TabButton, { key: "tab-".concat(idx), label: tab.label && language
|
|
12369
|
+
? tab.label[language]
|
|
12370
|
+
: t("tabs.".concat(tab.path.substring(1))), onClick: function () {
|
|
12371
|
+
setSelectedPath(tab.path);
|
|
12372
|
+
handleResetFilters();
|
|
12373
|
+
handleSelectedFilter(false);
|
|
12374
|
+
}, active: selectedPath === tab.path, mode: mode })); }))),
|
|
12375
|
+
React.createElement("div", { className: "will-filter-bar-header ".concat(mode || 'light'), ref: (tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 ? targetFilterBarRef : null },
|
|
12376
|
+
!!((_b = locations === null || locations === void 0 ? void 0 : locations.data) === null || _b === void 0 ? void 0 : _b.length) && (React.createElement(React.Fragment, null,
|
|
12377
|
+
React.createElement(SelectButton, { ref: locationsButtonRef, label: t('locations.label'), description: parsedLocations, onClick: function () {
|
|
12378
|
+
previouslyFocusedButtonRef.current = locationsButtonRef.current;
|
|
12379
|
+
handleSelectedFilter(FilterSections.LOCATIONS);
|
|
12380
|
+
}, active: !!selectedLocations.length, ariaExpanded: selectedFilter === FilterSections.LOCATIONS, ariaControls: "will-locations-filter" }),
|
|
12381
|
+
React.createElement(Divider, null))),
|
|
12382
|
+
React.createElement(SelectButton, { ref: calendarButtonRef, label: t('calendar.label'), description: parsedDates
|
|
12383
|
+
? parsedDates
|
|
12384
|
+
: selectedPath === Pages.ROOMS
|
|
12385
|
+
? t('calendar.roomsLabelPlaceholder')
|
|
12386
|
+
: t('calendar.eventsLabelPlaceholder'), onClick: function () {
|
|
12387
|
+
previouslyFocusedButtonRef.current = calendarButtonRef.current;
|
|
12388
|
+
handleSelectedFilter(FilterSections.CALENDAR);
|
|
12389
|
+
}, active: !!parsedDates, ariaExpanded: selectedFilter === FilterSections.CALENDAR, ariaControls: "will-calendar-filter" }),
|
|
12390
|
+
selectedPath !== Pages.EVENTS && (React.createElement(React.Fragment, null,
|
|
12391
|
+
React.createElement(Divider, null),
|
|
12392
|
+
React.createElement(SelectButton, { ref: guestsButtonRef, label: t('guests.label'), description: parsedGuests.content, onClick: function () {
|
|
12393
|
+
previouslyFocusedButtonRef.current = guestsButtonRef.current;
|
|
12394
|
+
handleSelectedFilter(FilterSections.GUESTS);
|
|
12395
|
+
}, active: !!parsedGuests.data.total, ariaExpanded: selectedFilter === FilterSections.GUESTS, ariaControls: "will-guests-filter" }))),
|
|
12396
|
+
React.createElement(SubmitButton, { onClick: handleSubmit, startIcon: React.createElement(FaSearch, null), label: t('common:search'), isLoading: innerLoading || outerLoading })),
|
|
12397
|
+
selectedFilter && (React.createElement("div", { className: "will-filter-bar-container ".concat(mode || 'light'), style: (!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {} },
|
|
12398
|
+
React.createElement(CloseButton, { handleClose: function () { return handleSelectedFilter(false); } }),
|
|
12399
|
+
selectedFilter === FilterSections.CALENDAR && (React.createElement("div", { id: "will-calendar-filter" },
|
|
12400
|
+
React.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, disableCalendarDates: disableCalendarDates, selectedPath: selectedPath, language: language, ref: filtersRef, autoFocus: true }))),
|
|
12401
|
+
selectedFilter === FilterSections.GUESTS && (React.createElement("div", { id: "will-guests-filter" },
|
|
12402
|
+
React.createElement(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef, autoFocus: true }))),
|
|
12403
|
+
selectedFilter === FilterSections.CATEGORIES && (React.createElement(Categories, { categories: categories, setCategories: setCategories })),
|
|
12404
|
+
selectedFilter === FilterSections.LOCATIONS && (React.createElement("div", { id: "will-locations-filter" },
|
|
12405
|
+
React.createElement(Locations, { locations: locations === null || locations === void 0 ? void 0 : locations.data, ref: filtersRef, language: language, selectedLocations: selectedLocations, setSelectedLocations: setSelectedLocations, multiSelect: locations === null || locations === void 0 ? void 0 : locations.multiSelect, autoFocus: true, onClose: function () { return handleSelectedFilter(false); } })))))));
|
|
12341
12406
|
}
|
|
12342
12407
|
////////////
|
|
12343
12408
|
var AGE_CATEGORIES_FALLBACK = [
|
|
@@ -12478,26 +12543,36 @@ var Footer = function (_a) {
|
|
|
12478
12543
|
var nights = nightsCount({
|
|
12479
12544
|
calendarRange: calendarRange,
|
|
12480
12545
|
});
|
|
12481
|
-
return (
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12546
|
+
return (React.createElement("div", { className: "will-calendar-footer-actions-wrapper" },
|
|
12547
|
+
React.createElement("div", { className: "will-calendar-footer-dates" },
|
|
12548
|
+
calendarHasError ? (React.createElement("div", { className: "will-calendar-footer-error" }, calendarHasError &&
|
|
12549
|
+
renderCalendarErrorMessage({
|
|
12550
|
+
palette: palette,
|
|
12551
|
+
message: t("common:errors.calendarErrors.checkInAvailabilityError"),
|
|
12552
|
+
}))) : (React.createElement("div", null,
|
|
12553
|
+
React.createElement("span", null, parseDate({
|
|
12554
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from,
|
|
12555
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12556
|
+
language: language,
|
|
12557
|
+
}) || t('common:checkIn')),
|
|
12558
|
+
React.createElement("span", { className: "will-calendar-footer-dates-separator" }, "-"),
|
|
12559
|
+
React.createElement("span", null, parseDate({
|
|
12560
|
+
date: calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to,
|
|
12561
|
+
dateFormat: 'EEEEEE d.M.yyyy',
|
|
12562
|
+
language: language,
|
|
12563
|
+
}) || t('common:checkOut')))),
|
|
12564
|
+
React.createElement("span", { className: "will-calendar-footer-booked" }, !calendarHasError && nights
|
|
12565
|
+
? "".concat(nights, " ").concat(t("common:".concat(nights === 1 ? 'night' : 'nights')))
|
|
12566
|
+
: '')),
|
|
12567
|
+
React.createElement("div", { className: "will-calendar-footer-actions" },
|
|
12568
|
+
React.createElement(SubmitButton, { onClick: handleClearDates, disabled: !(calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from), label: t("common:clearDates"), variant: "text" }))));
|
|
12496
12569
|
};
|
|
12497
12570
|
/////////
|
|
12498
12571
|
var renderCalendarErrorMessage = function (_a) {
|
|
12499
12572
|
var message = _a.message, palette = _a.palette;
|
|
12500
|
-
return (
|
|
12573
|
+
return (React.createElement(React.Fragment, null,
|
|
12574
|
+
React.createElement(IconsSvg, { fill: (palette === null || palette === void 0 ? void 0 : palette.error) || 'inherit', size: 25, icon: "warning" }),
|
|
12575
|
+
React.createElement("span", null, message || '')));
|
|
12501
12576
|
};
|
|
12502
12577
|
|
|
12503
12578
|
var css_248z = ".will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n max-width: 80%;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error span {\n display: inline-block;\n margin-left: 10px;\n}\n\n@media (max-width: 960px) {\n .will-root .will-calendar-wrapper {\n width: -webkit-fill-available;\n margin: 0 -6%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-header,\n .will-root .will-calendar-wrapper .will-calendar-main,\n .will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n flex-direction: column;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates {\n text-align: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n justify-content: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions {\n flex-direction: column;\n width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions button{\n width: 100%;\n margin-top: 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error {\n max-width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error span {\n text-align: center;\n margin-left: 5px;\n }\n }\n\n.will-root .will-calendar-wrapper .will-calendar-header .will-filter-bar-close-button {\n position: initial;\n}";
|
|
@@ -12523,7 +12598,14 @@ function FilterCalendar(_a) {
|
|
|
12523
12598
|
var filtersRef = useCloseFilterSection({
|
|
12524
12599
|
handleSelectedFilter: setToggleCalendar,
|
|
12525
12600
|
}).filtersRef;
|
|
12526
|
-
return (
|
|
12601
|
+
return (React.createElement("div", { className: "will-root", style: themePalette }, toggleCalendar && (React.createElement("div", { className: "will-calendar-wrapper", ref: filtersRef },
|
|
12602
|
+
React.createElement("div", { className: "will-calendar-header" },
|
|
12603
|
+
React.createElement("h2", null, t('filterBar:calendar.title')),
|
|
12604
|
+
React.createElement(CloseButton, { handleClose: function () { return setToggleCalendar(false); } })),
|
|
12605
|
+
React.createElement("div", { className: "will-calendar-main" },
|
|
12606
|
+
React.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, calendarOffset: calendarOffset, selectedPath: '/rooms', language: language, disableCalendarDates: disableCalendarDates, requestDates: requestDates, disabledDates: disabledDates, updateCalendarMonthNavigation: updateCalendarMonthNavigation, setUpdateCalendarMonthNavigation: setUpdateCalendarMonthNavigation, updateCalendarDefaultMonth: updateCalendarDefaultMonth, loadingData: loadingData, showFeedback: showFeedback, noActiveSelection: noActiveSelection, palette: palette, setCalendarHasError: setCalendarHasError, setUpdatedForSubmit: setUpdatedForSubmit, rangeContext: rangeContext, calendarHasError: calendarHasError })),
|
|
12607
|
+
React.createElement("div", { className: "will-calendar-footer" },
|
|
12608
|
+
React.createElement(Footer, { calendarHasError: calendarHasError, calendarRange: calendarRange, handleClearDates: handleClearDates, language: language, palette: palette }))))));
|
|
12527
12609
|
}
|
|
12528
12610
|
|
|
12529
12611
|
exports.Button = Button$1;
|