@autoguru/overdrive 4.26.4 → 4.27.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.
@@ -52,7 +52,7 @@ export const EditableText = forwardRef((_ref, ref) => {
52
52
  setInputValue(changeValue);
53
53
  }
54
54
  if (typeof incomingOnChange === 'function') incomingOnChange(e);
55
- }, [incomingOnChange, type]);
55
+ }, [incomingOnChange, type, mode]);
56
56
  const textStyles = useTextStyles({
57
57
  is,
58
58
  colour,
@@ -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,CAwBlD,CAAC"}
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,
@@ -0,0 +1,9 @@
1
+ export * from './useAnimationEvents';
2
+ export * from './useAttachedBoxes';
3
+ export * from './useDocumentBodyStyles';
4
+ export * from './useNegativeMargin';
5
+ export * from './useResponsiveValue';
6
+ export * from './useWindowHeightFill';
7
+ export * from './useWindowScrollLock';
8
+ export * from './useMedia';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ export * from "./useAnimationEvents/index.js";
4
+ export * from "./useAttachedBoxes/index.js";
5
+ export * from "./useDocumentBodyStyles/index.js";
6
+ export * from "./useNegativeMargin/index.js";
7
+ export * from "./useResponsiveValue/index.js";
8
+ export * from "./useWindowHeightFill/index.js";
9
+ export * from "./useWindowScrollLock/index.js";
10
+ export * from "./useMedia/index.js";
@@ -0,0 +1,2 @@
1
+ export { useNegativeMarginTop, useNegativeMarginLeft, } from './useNegativeMargin';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/hooks/useNegativeMargin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ export { useNegativeMarginTop, useNegativeMarginLeft } from "./useNegativeMargin.js";
@@ -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,sFAM7B,wBAAwB,KAAG,MA8D7B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
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;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
- export * from './components/index';
2
- export { useMedia } from './hooks/useMedia/useMedia';
3
- export { useResponsiveValue } from './hooks/useResponsiveValue/useResponsiveValue';
4
- export { useAttachedBoxes } from './hooks/useAttachedBoxes/useAttachedBoxes';
1
+ export * from './components';
2
+ export * from './hooks';
5
3
  export { useId, arrayRingLookup } from './utils/index';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  export * from "./components/index.js";
4
- export { useMedia } from "./hooks/useMedia/useMedia.js";
5
- export { useResponsiveValue } from "./hooks/useResponsiveValue/useResponsiveValue.js";
6
- export { useAttachedBoxes } from "./hooks/useAttachedBoxes/useAttachedBoxes.js";
4
+ export * from "./hooks/index.js";
7
5
  export { useId, arrayRingLookup } from "./utils/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.26.4",
3
+ "version": "4.27.0",
4
4
  "description": "Overdrive is a product component library, and design system for AutoGuru.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",