willba-component-library 0.1.55 → 0.1.57
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/components/FilterBar/FilterBar.d.ts +2 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.esm.js +14 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +14 -6
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +14 -6
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.css +5 -0
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -0
- package/src/components/FilterBar/FilterBar.tsx +18 -2
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.css +6 -2
- package/src/components/FilterBar/hooks/useFilterBar.tsx +1 -1
- package/src/components/FilterBar/utils/parseGuests.tsx +1 -1
|
@@ -11,5 +11,6 @@ export type FilterBarProps = {
|
|
|
11
11
|
palette?: Palette;
|
|
12
12
|
currentViewApply?: string;
|
|
13
13
|
onSubmit?: ((val: Filters) => void) | null;
|
|
14
|
+
fullWidth?: boolean;
|
|
14
15
|
};
|
|
15
|
-
export default function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, }: FilterBarProps): React.JSX.Element;
|
|
16
|
+
export default function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, fullWidth, }: FilterBarProps): React.JSX.Element | undefined;
|
package/lib/index.d.ts
CHANGED
|
@@ -50,7 +50,8 @@ type FilterBarProps = {
|
|
|
50
50
|
palette?: Palette;
|
|
51
51
|
currentViewApply?: string;
|
|
52
52
|
onSubmit?: ((val: Filters) => void) | null;
|
|
53
|
+
fullWidth?: boolean;
|
|
53
54
|
};
|
|
54
|
-
declare function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, }: FilterBarProps): React.JSX.Element;
|
|
55
|
+
declare function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, fullWidth, }: FilterBarProps): React.JSX.Element | undefined;
|
|
55
56
|
|
|
56
57
|
export { Button, FilterBar };
|
package/lib/index.esm.js
CHANGED
|
@@ -3894,7 +3894,7 @@ var parseGuests = function (_a) {
|
|
|
3894
3894
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
3895
3895
|
var ageCategory = ageCategories.find(function (c) { return c.id === key[key.length - 1]; });
|
|
3896
3896
|
if (ageCategory && value) {
|
|
3897
|
-
acc += "".concat(acc ? '
|
|
3897
|
+
acc += "".concat(acc ? ' |' : '', " ").concat(ageCategory.name, ": <span style=\"display: inline-block; width: 21px\">").concat(value, "</span>");
|
|
3898
3898
|
}
|
|
3899
3899
|
return acc;
|
|
3900
3900
|
}, '');
|
|
@@ -3970,7 +3970,7 @@ var useFilterBar = function (_a) {
|
|
|
3970
3970
|
? format(calendarRange.from, 'yyyy-MM-dd')
|
|
3971
3971
|
: '',
|
|
3972
3972
|
endDate: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.to) ? format(calendarRange.to, 'yyyy-MM-dd') : '',
|
|
3973
|
-
categories: categories.toString(),
|
|
3973
|
+
//categories: categories.toString(),
|
|
3974
3974
|
ageCategoryCounts: handleAgeCategoryRules({
|
|
3975
3975
|
ageCategoryCounts: ageCategoryCounts,
|
|
3976
3976
|
ageCategories: ageCategories,
|
|
@@ -6576,7 +6576,7 @@ var CloseButton = function (_a) {
|
|
|
6576
6576
|
React__default__default.createElement(IoIosCloseCircleOutline, null)));
|
|
6577
6577
|
};
|
|
6578
6578
|
|
|
6579
|
-
var css_248z$9 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n \n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid\n}\n\n.will-filter-bar-select-button .select-button-label {\n font-weight: 500;\n}\n\n.will-filter-bar-select-button .select-button-description {\n font-weight: 400;\n opacity: 0.8;\n \n white-space: nowrap;\n
|
|
6579
|
+
var css_248z$9 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n \n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid\n}\n\n.will-filter-bar-select-button .select-button-label {\n font-weight: 500;\n}\n\n.will-filter-bar-select-button .select-button-description {\n font-weight: 400;\n opacity: 0.8;\n \n white-space: nowrap;\n \n }\n\n .will-root.is-full-width .will-filter-bar-select-button .select-button-description {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .will-filter-bar-select-button .select-button-label.active,\n .will-filter-bar-select-button .select-button-description.active {\n font-weight: 600;\n }\n\n@media (max-width: 960px) {\n .will-filter-bar-select-button {\n padding: 15px 0;\n }\n\n .will-filter-bar-select-button:first-child {\n padding: 0 0 15px 0;\n }\n\n .will-filter-bar-select-button .select-button-wrapper {\n justify-content: center;\n text-align: center;\n }\n\n .will-filter-bar-select-button .select-button-description {\n white-space: wrap;\n }\n\n .will-filter-bar-select-button .select-button-divider {\n display: none\n }\n}\n\n\n";
|
|
6580
6580
|
styleInject(css_248z$9);
|
|
6581
6581
|
|
|
6582
6582
|
var SelectButton = function (_a) {
|
|
@@ -10683,11 +10683,11 @@ var Categories = function (_a) {
|
|
|
10683
10683
|
React__default__default.createElement("span", null, itm))); }))));
|
|
10684
10684
|
};
|
|
10685
10685
|
|
|
10686
|
-
var css_248z = ".will-root {\n z-index: 999;\n width: fit-content;\n min-width: 796px;\n max-height: 100vh;\n position: relative;\n}\n\n.will-filter-bar {\n box-sizing: border-box;\n position: relative;\n}\n\n/* Tabs */\n\n.will-filter-bar-tabs {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 222;\n background: transparent;\n padding: 10px;\n gap: 10px\n}\n\n/* Header */\n.will-filter-bar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n position: relative;\n z-index: 222;\n border-radius: 40px;\n background-color: var(--will-white);\n box-shadow: 0px 3px 10px 0px lightgrey; \n}\n\n@media (max-width: 960px) {\n .will-filter-bar-header {\n flex-direction: column;\n padding: 20px;\n border-radius: 25px;\n }\n}\n\n/* Container */\n\n.will-filter-bar-container {\n background-color: var(--will-white);\n min-height: 100px;\n padding: 40px 20px ;\n position: absolute;\n top: 125px;\n z-index: 111;\n border-radius: 25px;\n box-shadow: var(--will-box-shadow);\n}\n\n@media (max-width: 960px) {\n .will-root { \n width: 100%;\n min-width: auto;\n max-height: 100vh; \n z-index: 3;\n }\n\n .will-filter-bar-container {\n margin-top: 10px;\n top:0;\n padding: 30px 20px;\n position: relative;\n }\n}\n\n";
|
|
10686
|
+
var css_248z = ".will-root {\n z-index: 999;\n width: fit-content;\n min-width: 796px;\n max-height: 100vh;\n position: relative;\n}\n\n.will-root.is-full-width {\n width: 100%;\n min-width: auto;\n}\n\n.will-filter-bar {\n box-sizing: border-box;\n position: relative;\n}\n\n/* Tabs */\n\n.will-filter-bar-tabs {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 222;\n background: transparent;\n padding: 10px;\n gap: 10px\n}\n\n/* Header */\n.will-filter-bar-header {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n position: relative;\n z-index: 222;\n border-radius: 40px;\n background-color: var(--will-white);\n box-shadow: 0px 3px 10px 0px lightgrey; \n}\n\n@media (max-width: 960px) {\n .will-filter-bar-header {\n flex-direction: column;\n padding: 20px;\n border-radius: 25px;\n }\n}\n\n/* Container */\n\n.will-filter-bar-container {\n background-color: var(--will-white);\n min-height: 100px;\n padding: 40px 20px ;\n position: absolute;\n top: 125px;\n z-index: 111;\n border-radius: 25px;\n box-shadow: var(--will-box-shadow);\n}\n\n@media (max-width: 960px) {\n .will-root { \n width: 100%;\n min-width: auto;\n max-height: 100vh; \n z-index: 3;\n }\n\n .will-filter-bar-container {\n margin-top: 10px;\n top:0;\n padding: 30px 20px;\n position: relative;\n }\n}\n\n";
|
|
10687
10687
|
styleInject(css_248z);
|
|
10688
10688
|
|
|
10689
10689
|
function FilterBar(_a) {
|
|
10690
|
-
var language = _a.language, _b = _a.ageCategories, ageCategories = _b === void 0 ? AGE_CATEGORIES_FALLBACK : _b, _c = _a.redirectUrl, redirectUrl = _c === void 0 ? REDIRECT_URL_FALLBACK : _c, palette = _a.palette, currentViewApply = _a.currentViewApply, onSubmit = _a.onSubmit;
|
|
10690
|
+
var language = _a.language, _b = _a.ageCategories, ageCategories = _b === void 0 ? AGE_CATEGORIES_FALLBACK : _b, _c = _a.redirectUrl, redirectUrl = _c === void 0 ? REDIRECT_URL_FALLBACK : _c, palette = _a.palette, currentViewApply = _a.currentViewApply, onSubmit = _a.onSubmit, fullWidth = _a.fullWidth;
|
|
10691
10691
|
var themePalette = useTheme({ palette: palette });
|
|
10692
10692
|
// Translations
|
|
10693
10693
|
useUpdateTranslations({ language: language });
|
|
@@ -10709,10 +10709,18 @@ function FilterBar(_a) {
|
|
|
10709
10709
|
var _e = useScrollInToView({ selectedFilter: selectedFilter }), isMobile = _e.isMobile, targetFilterBarRef = _e.targetFilterBarRef;
|
|
10710
10710
|
// Handle close filter section
|
|
10711
10711
|
var filtersRef = useCloseFilterSection({ handleSelectedFilter: handleSelectedFilter }).filtersRef;
|
|
10712
|
+
// Display component after fully loaded
|
|
10713
|
+
var _f = __read(useState(false), 2), initialRenderComplete = _f[0], setInitialRenderComplete = _f[1];
|
|
10714
|
+
useEffect(function () {
|
|
10715
|
+
setInitialRenderComplete(true);
|
|
10716
|
+
}, []);
|
|
10717
|
+
if (!initialRenderComplete)
|
|
10718
|
+
return;
|
|
10719
|
+
//----/----
|
|
10712
10720
|
// Parsed data for filter section description
|
|
10713
10721
|
var parsedDates = parseDates({ calendarRange: calendarRange });
|
|
10714
10722
|
var parsedGuests = parseGuests({ ageCategoryCounts: ageCategoryCounts, ageCategories: ageCategories });
|
|
10715
|
-
return (React__default__default.createElement("div", { className: "will-root", style: themePalette },
|
|
10723
|
+
return (React__default__default.createElement("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette },
|
|
10716
10724
|
!currentViewApply && (React__default__default.createElement("div", { className: "will-filter-bar-tabs", ref: !currentViewApply ? targetFilterBarRef : null },
|
|
10717
10725
|
React__default__default.createElement(TabButton, { label: t('tabs.events'), onClick: function () { return setSelectedPath('/events'); }, active: selectedPath === '/events' }),
|
|
10718
10726
|
React__default__default.createElement(TabButton, { label: t('tabs.rooms'), onClick: function () { return setSelectedPath('/rooms'); }, active: selectedPath === '/rooms' }))),
|