@autoguru/overdrive 4.26.5 → 4.28.0
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/components/Box/useBoxStyles.css.d.ts +1 -1
- package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.css.js +1 -0
- package/dist/components/FillHeightBox/FillHeightBox.d.ts.map +1 -1
- package/dist/components/FillHeightBox/FillHeightBox.js +5 -3
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts +2 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts.map +1 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +4 -3
- package/package.json +1 -1
|
@@ -34,7 +34,7 @@ export declare const height: Record<"full", string>;
|
|
|
34
34
|
export declare const position: Record<"fixed" | "absolute" | "relative", string>;
|
|
35
35
|
export declare const textAlign: Record<"left" | "right" | "center", string>;
|
|
36
36
|
export declare const overflow: Record<"auto" | "hidden" | "visible" | "scroll", string>;
|
|
37
|
-
export declare const display: Record<"none" | "flex" | "contents" | "block" | "inline" | "inlineFlex" | "inlineBlock", string>;
|
|
37
|
+
export declare const display: Record<"none" | "flex" | "grid" | "contents" | "block" | "inline" | "inlineFlex" | "inlineBlock", string>;
|
|
38
38
|
export declare const opacity: Record<0 | 1, string>;
|
|
39
39
|
export declare const userSelect: Record<"none", string>;
|
|
40
40
|
export declare const order: Record<string | number, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBoxStyles.css.d.ts","sourceRoot":"","sources":["../../../lib/components/Box/useBoxStyles.css.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AAEF,eAAO,MAAM,SAAS,8BAAmD,CAAC;AA2C1E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAsBlB,CAAC;AAEF,eAAO,MAA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AAM,QAAQ,mCAQpB,CAAC;AAEF,eAAO,MAAM,cAAc,8BAS1B,CAAC;AAEF,eAAO,MAAM,aAAa,wBAExB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FillHeightBox.d.ts","sourceRoot":"","sources":["../../../lib/components/FillHeightBox/FillHeightBox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1D,OAA4B,EAC3B,wBAAwB,EACxB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,KAAK,GAAG,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC,GAC1D,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnC,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"FillHeightBox.d.ts","sourceRoot":"","sources":["../../../lib/components/FillHeightBox/FillHeightBox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1D,OAA4B,EAC3B,wBAAwB,EACxB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,KAAK,GAAG,IAAI,CAAC,wBAAwB,EAAE,cAAc,CAAC,GAC1D,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnC,eAAO,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAK,CA0BlD,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["includeMobile", "bottomGap", "serverVhFallback", "observedElementRef", "style"];
|
|
5
|
+
const _excluded = ["includeMobile", "bottomGap", "serverVhFallback", "observedElementRef", "style", "maxHeight"];
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
8
|
import * as React from 'react';
|
|
@@ -15,7 +15,8 @@ export const FillHeightBox = _ref => {
|
|
|
15
15
|
bottomGap,
|
|
16
16
|
serverVhFallback,
|
|
17
17
|
observedElementRef,
|
|
18
|
-
style
|
|
18
|
+
style,
|
|
19
|
+
maxHeight
|
|
19
20
|
} = _ref,
|
|
20
21
|
scrollPaneProps = _objectWithoutProperties(_ref, _excluded);
|
|
21
22
|
const containerRef = React.useRef(null);
|
|
@@ -24,7 +25,8 @@ export const FillHeightBox = _ref => {
|
|
|
24
25
|
includeMobile,
|
|
25
26
|
observedElementRef,
|
|
26
27
|
bottomGap,
|
|
27
|
-
serverVhFallback
|
|
28
|
+
serverVhFallback,
|
|
29
|
+
maxHeight
|
|
28
30
|
});
|
|
29
31
|
return _jsx(ScrollPane, _objectSpread(_objectSpread({}, scrollPaneProps), {}, {
|
|
30
32
|
ref: containerRef,
|
|
@@ -5,9 +5,10 @@ export interface UseWindowHeightFillProps {
|
|
|
5
5
|
serverVhFallback?: number;
|
|
6
6
|
includeMobile?: boolean;
|
|
7
7
|
observeDomChanges?: boolean;
|
|
8
|
+
maxHeight?: number;
|
|
8
9
|
containerRef: RefObject<HTMLDivElement>;
|
|
9
10
|
observedElementRef?: RefObject<HTMLDivElement>;
|
|
10
11
|
}
|
|
11
|
-
export declare const useWindowHeightFill: ({ bottomGap, includeMobile, serverVhFallback, containerRef, observedElementRef, }: UseWindowHeightFillProps) => string;
|
|
12
|
+
export declare const useWindowHeightFill: ({ bottomGap, includeMobile, serverVhFallback, containerRef, observedElementRef, maxHeight, }: UseWindowHeightFillProps) => string;
|
|
12
13
|
export default useWindowHeightFill;
|
|
13
14
|
//# sourceMappingURL=useWindowHeightFill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowHeightFill.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useWindowHeightFill/useWindowHeightFill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqC,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,kBAAkB,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useWindowHeightFill.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useWindowHeightFill/useWindowHeightFill.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqC,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,kBAAkB,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CAC/C;AAED,eAAO,MAAM,mBAAmB,iGAO7B,wBAAwB,KAAG,MAiE7B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -11,7 +11,8 @@ export const useWindowHeightFill = _ref => {
|
|
|
11
11
|
includeMobile = false,
|
|
12
12
|
serverVhFallback = 100,
|
|
13
13
|
containerRef,
|
|
14
|
-
observedElementRef
|
|
14
|
+
observedElementRef,
|
|
15
|
+
maxHeight
|
|
15
16
|
} = _ref;
|
|
16
17
|
const cappedHeight = useResponsiveValue([includeMobile,, true]);
|
|
17
18
|
const {
|
|
@@ -24,7 +25,7 @@ export const useWindowHeightFill = _ref => {
|
|
|
24
25
|
if (!(containerRef !== null && containerRef !== void 0 && containerRef.current) || !((_window = window) !== null && _window !== void 0 && _window.innerHeight) || !((_document = document) !== null && _document !== void 0 && _document.body)) return void 0;
|
|
25
26
|
const resize = () => {
|
|
26
27
|
const gap = getThemeTokenValue(themeClass, themeContractVars.space[bottomGap]) || '0px';
|
|
27
|
-
const availableHeight = window.innerHeight - containerRef.current.getBoundingClientRect().top;
|
|
28
|
+
const availableHeight = Math.min(maxHeight !== null && maxHeight !== void 0 ? maxHeight : Number.POSITIVE_INFINITY, window.innerHeight - containerRef.current.getBoundingClientRect().top);
|
|
28
29
|
const newHeight = gap ? "calc(".concat(availableHeight, "px - ").concat(gap, ")") : "".concat(availableHeight, "px");
|
|
29
30
|
if (containerHeightRef.current !== newHeight) {
|
|
30
31
|
setContainerHeight(newHeight);
|
|
@@ -50,7 +51,7 @@ export const useWindowHeightFill = _ref => {
|
|
|
50
51
|
mutationObserver.disconnect();
|
|
51
52
|
resizeObserver.disconnect();
|
|
52
53
|
};
|
|
53
|
-
}, [containerRef === null || containerRef === void 0 ? void 0 : containerRef.current, (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.innerHeight, (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.body, themeClass, bottomGap]);
|
|
54
|
+
}, [containerRef === null || containerRef === void 0 ? void 0 : containerRef.current, (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.innerHeight, (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.body, themeClass, bottomGap, maxHeight]);
|
|
54
55
|
return cappedHeight ? containerHeight : 'auto';
|
|
55
56
|
};
|
|
56
57
|
export default useWindowHeightFill;
|