@autoguru/overdrive 4.23.6 → 4.24.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.
@@ -1 +1 @@
1
- {"version":3,"file":"MinimalModal.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,MAAM,WAAW,KAChB,SAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,EACnC,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,CA8EjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"MinimalModal.d.ts","sourceRoot":"","sources":["../../../lib/components/MinimalModal/MinimalModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,SAAS,EAA2B,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,MAAM,WAAW,KAChB,SAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,EACnC,IAAI,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,YAAY,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,KAAK,CA0EjD,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
2
 
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
+ const _excluded = ["isOpen", "alignItems", "className", "children", "onRequestClose"];
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
+ 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; }
3
8
  import * as React from 'react';
4
9
  import { useLayoutEffect, useRef } from 'react';
5
10
  import { isBrowser, useEventCallback, useId } from "../../utils/index.js";
@@ -9,15 +14,13 @@ import * as styles from "./MinimalModal.css.js";
9
14
  import { jsx as _jsx } from "react/jsx-runtime";
10
15
  export const MinimalModal = _ref => {
11
16
  let {
12
- isOpen,
13
- alignItems = 'center',
14
- className = '',
15
- container,
16
- noThemedWrapper,
17
- ref,
18
- onRequestClose,
19
- children
20
- } = _ref;
17
+ isOpen,
18
+ alignItems = 'center',
19
+ className = '',
20
+ children,
21
+ onRequestClose
22
+ } = _ref,
23
+ modalProps = _objectWithoutProperties(_ref, _excluded);
21
24
  const titleId = useId();
22
25
  const locked = useRef(true);
23
26
  const unlockModal = useEventCallback(event => {
@@ -35,12 +38,10 @@ export const MinimalModal = _ref => {
35
38
  };
36
39
  }, [isOpen]);
37
40
  }
38
- return _jsx(Modal, {
41
+ return _jsx(Modal, _objectSpread(_objectSpread({
39
42
  isOpen: isOpen,
40
- onRequestClose: onRequestClose,
41
- ref: ref,
42
- noThemedWrapper: noThemedWrapper,
43
- container: container,
43
+ onRequestClose: onRequestClose
44
+ }, modalProps), {}, {
44
45
  children: _jsx(Box, {
45
46
  className: [styles.container, className],
46
47
  height: "full",
@@ -69,6 +70,6 @@ export const MinimalModal = _ref => {
69
70
  })
70
71
  })
71
72
  })
72
- });
73
+ }));
73
74
  };
74
75
  export default MinimalModal;
@@ -4,6 +4,7 @@ import { Portal } from '../Portal';
4
4
  export interface Props extends ComponentProps<typeof Portal> {
5
5
  isOpen: boolean;
6
6
  hideBackdrop?: boolean;
7
+ disableBackdropClick?: boolean;
7
8
  children?: ReactNode;
8
9
  onRequestClose?(e: 'backdrop' | 'escapeKeyDown' | string): void;
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,cAAc,EACd,aAAa,EACb,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,OAAO,MAAM,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAqDD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CA8E1C,CAAC;AAEF,eAAO,MAAM,SAAS,wIAmBpB,CAAC;AAEH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../lib/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,cAAc,EACd,aAAa,EACb,iBAAiB,EAEjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAInC,MAAM,WAAW,KAAM,SAAQ,cAAc,CAAC,OAAO,MAAM,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;CAChE;AAqDD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,KAAK,CA+E1C,CAAC;AAEF,eAAO,MAAM,SAAS,wIAmBpB,CAAC;AAEH,eAAe,KAAK,CAAC"}
@@ -65,6 +65,7 @@ export const Modal = _ref => {
65
65
  let {
66
66
  isOpen,
67
67
  hideBackdrop = false,
68
+ disableBackdropClick = false,
68
69
  ref,
69
70
  noThemedWrapper,
70
71
  container,
@@ -101,7 +102,7 @@ export const Modal = _ref => {
101
102
  children: [_jsx(Box, {
102
103
  "aria-hidden": "true",
103
104
  position: "fixed",
104
- pointerEvents: state === 'CLOSING' ? 'none' : undefined,
105
+ pointerEvents: disableBackdropClick || state === 'CLOSING' ? 'none' : undefined,
105
106
  opacity: state === 'OPEN' ? undefined : 0,
106
107
  backgroundColour: hideBackdrop ? 'transparent' : 'neutral',
107
108
  className: [styles.backdrop.root, styles.transition, hideBackdrop && styles.backdrop.invisible],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoguru/overdrive",
3
- "version": "4.23.6",
3
+ "version": "4.24.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",