willba-component-library 0.3.15 → 0.3.17
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/README.md +1 -1
- package/lib/index.esm.js +18 -30
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +17 -29
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +17 -29
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/components/FilterPanels/Dates/Dates.css +1 -1
- package/src/components/FilterBar/components/FilterPanels/Guests/GuestCount/GuestCount.css +0 -1
- package/src/components/FilterBar/components/FilterPanels/Guests/Guests.css +7 -1
- package/src/components/FilterBar/components/FilterPanels/Locations/Locations.css +1 -2
- package/src/components/FilterBar/hooks/usePanelPosition.tsx +16 -29
package/lib/index.js
CHANGED
|
@@ -6848,35 +6848,23 @@ var useFilterUi = function (selectedFilter) {
|
|
|
6848
6848
|
var usePanelPosition = function (_a) {
|
|
6849
6849
|
var selectedFilter = _a.selectedFilter, panelRef = _a.panelRef, targetFilterBarRef = _a.targetFilterBarRef, buttonRefs = _a.buttonRefs, isMobile = _a.isMobile;
|
|
6850
6850
|
var _b = __read(React.useState({}), 2), localStyles = _b[0], setLocalStyles = _b[1];
|
|
6851
|
-
React.
|
|
6851
|
+
React.useLayoutEffect(function () {
|
|
6852
6852
|
if (!selectedFilter || typeof selectedFilter !== 'string' || isMobile) {
|
|
6853
6853
|
setLocalStyles({});
|
|
6854
6854
|
return;
|
|
6855
6855
|
}
|
|
6856
|
-
var
|
|
6857
|
-
var
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
var containerRect = container.getBoundingClientRect();
|
|
6869
|
-
var buttonRect = button.getBoundingClientRect();
|
|
6870
|
-
var buttonLeft = buttonRect.left - containerRect.left;
|
|
6871
|
-
var left = Math.min(buttonLeft, Math.max(containerRect.width - panelRect.width, 0));
|
|
6872
|
-
setLocalStyles({ left: left });
|
|
6873
|
-
};
|
|
6874
|
-
calculate();
|
|
6875
|
-
return function () {
|
|
6876
|
-
if (timeoutId)
|
|
6877
|
-
clearTimeout(timeoutId);
|
|
6878
|
-
};
|
|
6879
|
-
}, [selectedFilter, panelRef, targetFilterBarRef, buttonRefs, isMobile]);
|
|
6856
|
+
var panel = panelRef.current;
|
|
6857
|
+
var container = targetFilterBarRef.current;
|
|
6858
|
+
var button = buttonRefs.current[selectedFilter];
|
|
6859
|
+
if (!panel || !container || !button)
|
|
6860
|
+
return;
|
|
6861
|
+
var panelRect = panel.getBoundingClientRect();
|
|
6862
|
+
var containerRect = container.getBoundingClientRect();
|
|
6863
|
+
var buttonRect = button.getBoundingClientRect();
|
|
6864
|
+
var buttonLeft = buttonRect.left - containerRect.left;
|
|
6865
|
+
var left = Math.max(0, Math.min(buttonLeft, containerRect.width - panelRect.width));
|
|
6866
|
+
setLocalStyles({ left: left });
|
|
6867
|
+
}, [selectedFilter, isMobile]);
|
|
6880
6868
|
return { localStyles: localStyles };
|
|
6881
6869
|
};
|
|
6882
6870
|
|
|
@@ -12028,7 +12016,7 @@ var SectionHeader = function (_a) {
|
|
|
12028
12016
|
action && React.createElement("div", { className: "will-filter-section-action" }, action)));
|
|
12029
12017
|
};
|
|
12030
12018
|
|
|
12031
|
-
var css_248z$b = ".will-dates-filter-container {\n padding: 0 16px;\n}\n";
|
|
12019
|
+
var css_248z$b = ".will-dates-filter-container {\n padding: 0 16px 16px 16px;\n}\n";
|
|
12032
12020
|
styleInject(css_248z$b);
|
|
12033
12021
|
|
|
12034
12022
|
var Dates = React.forwardRef(function (_a, ref) {
|
|
@@ -12040,7 +12028,7 @@ var Dates = React.forwardRef(function (_a, ref) {
|
|
|
12040
12028
|
});
|
|
12041
12029
|
Dates.displayName = 'Dates';
|
|
12042
12030
|
|
|
12043
|
-
var css_248z$a = ".will-guests-filter-label,\n.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}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\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 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 .will-guests-filter-inner {\n width: 100%;\n
|
|
12031
|
+
var css_248z$a = ".will-guests-filter-label,\n.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}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\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 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 .will-guests-filter-inner {\n width: 100%;\n justify-content: space-between;\n }\n}\n";
|
|
12044
12032
|
styleInject(css_248z$a);
|
|
12045
12033
|
|
|
12046
12034
|
var GuestCount = function (_a) {
|
|
@@ -12074,7 +12062,7 @@ var GuestCount = function (_a) {
|
|
|
12074
12062
|
React.createElement("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))))));
|
|
12075
12063
|
};
|
|
12076
12064
|
|
|
12077
|
-
var css_248z$9 = "#will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 16px;\n}\n\n/**/\n.will-guest-count {\n display: inline-block;\n min-width: 10px;\n}\n";
|
|
12065
|
+
var css_248z$9 = "#will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 0 16px 16px 16px;\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-container {\n min-width: auto;\n }\n}\n\n/**/\n.will-guest-count {\n display: inline-block;\n min-width: 10px;\n}\n";
|
|
12078
12066
|
styleInject(css_248z$9);
|
|
12079
12067
|
|
|
12080
12068
|
var Guests = React.forwardRef(function (_a, ref) {
|
|
@@ -12106,7 +12094,7 @@ var ImageCard = React.forwardRef(function (_a, ref) {
|
|
|
12106
12094
|
});
|
|
12107
12095
|
ImageCard.displayName = 'ImageCard';
|
|
12108
12096
|
|
|
12109
|
-
var css_248z$7 = "#will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n
|
|
12097
|
+
var css_248z$7 = "#will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n padding-bottom: 16px;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-container {\n margin-top: 15px;\n min-width: 100%;\n }\n}\n";
|
|
12110
12098
|
styleInject(css_248z$7);
|
|
12111
12099
|
|
|
12112
12100
|
var Locations = React.forwardRef(function (_a, ref) {
|