willba-component-library 0.3.15 → 0.3.16
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 +17 -29
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +16 -28
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +16 -28
- 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/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.umd.js
CHANGED
|
@@ -6850,35 +6850,23 @@
|
|
|
6850
6850
|
var usePanelPosition = function (_a) {
|
|
6851
6851
|
var selectedFilter = _a.selectedFilter, panelRef = _a.panelRef, targetFilterBarRef = _a.targetFilterBarRef, buttonRefs = _a.buttonRefs, isMobile = _a.isMobile;
|
|
6852
6852
|
var _b = __read(React.useState({}), 2), localStyles = _b[0], setLocalStyles = _b[1];
|
|
6853
|
-
React.
|
|
6853
|
+
React.useLayoutEffect(function () {
|
|
6854
6854
|
if (!selectedFilter || typeof selectedFilter !== 'string' || isMobile) {
|
|
6855
6855
|
setLocalStyles({});
|
|
6856
6856
|
return;
|
|
6857
6857
|
}
|
|
6858
|
-
var
|
|
6859
|
-
var
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
var containerRect = container.getBoundingClientRect();
|
|
6871
|
-
var buttonRect = button.getBoundingClientRect();
|
|
6872
|
-
var buttonLeft = buttonRect.left - containerRect.left;
|
|
6873
|
-
var left = Math.min(buttonLeft, Math.max(containerRect.width - panelRect.width, 0));
|
|
6874
|
-
setLocalStyles({ left: left });
|
|
6875
|
-
};
|
|
6876
|
-
calculate();
|
|
6877
|
-
return function () {
|
|
6878
|
-
if (timeoutId)
|
|
6879
|
-
clearTimeout(timeoutId);
|
|
6880
|
-
};
|
|
6881
|
-
}, [selectedFilter, panelRef, targetFilterBarRef, buttonRefs, isMobile]);
|
|
6858
|
+
var panel = panelRef.current;
|
|
6859
|
+
var container = targetFilterBarRef.current;
|
|
6860
|
+
var button = buttonRefs.current[selectedFilter];
|
|
6861
|
+
if (!panel || !container || !button)
|
|
6862
|
+
return;
|
|
6863
|
+
var panelRect = panel.getBoundingClientRect();
|
|
6864
|
+
var containerRect = container.getBoundingClientRect();
|
|
6865
|
+
var buttonRect = button.getBoundingClientRect();
|
|
6866
|
+
var buttonLeft = buttonRect.left - containerRect.left;
|
|
6867
|
+
var left = Math.max(0, Math.min(buttonLeft, containerRect.width - panelRect.width));
|
|
6868
|
+
setLocalStyles({ left: left });
|
|
6869
|
+
}, [selectedFilter, isMobile]);
|
|
6882
6870
|
return { localStyles: localStyles };
|
|
6883
6871
|
};
|
|
6884
6872
|
|
|
@@ -12030,7 +12018,7 @@
|
|
|
12030
12018
|
action && React.createElement("div", { className: "will-filter-section-action" }, action)));
|
|
12031
12019
|
};
|
|
12032
12020
|
|
|
12033
|
-
var css_248z$b = ".will-dates-filter-container {\n padding: 0 16px;\n}\n";
|
|
12021
|
+
var css_248z$b = ".will-dates-filter-container {\n padding: 0 16px 16px 16px;\n}\n";
|
|
12034
12022
|
styleInject(css_248z$b);
|
|
12035
12023
|
|
|
12036
12024
|
var Dates = React.forwardRef(function (_a, ref) {
|
|
@@ -12076,7 +12064,7 @@
|
|
|
12076
12064
|
React.createElement("path", { d: "M10 4V16M4 10H16", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }))))));
|
|
12077
12065
|
};
|
|
12078
12066
|
|
|
12079
|
-
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";
|
|
12067
|
+
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";
|
|
12080
12068
|
styleInject(css_248z$9);
|
|
12081
12069
|
|
|
12082
12070
|
var Guests = React.forwardRef(function (_a, ref) {
|
|
@@ -12108,7 +12096,7 @@
|
|
|
12108
12096
|
});
|
|
12109
12097
|
ImageCard.displayName = 'ImageCard';
|
|
12110
12098
|
|
|
12111
|
-
var css_248z$7 = "#will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n
|
|
12099
|
+
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";
|
|
12112
12100
|
styleInject(css_248z$7);
|
|
12113
12101
|
|
|
12114
12102
|
var Locations = React.forwardRef(function (_a, ref) {
|