@zonos/amino 5.1.113 → 5.1.114

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.
@@ -28,6 +28,11 @@ export type BaseDialogProps = BaseProps & {
28
28
  * }
29
29
  */
30
30
  popupMotionProps?: MotionProps;
31
+ /**
32
+ * the selector for the root element to append the dialog to
33
+ * @default 'body'
34
+ */
35
+ rootSelector?: string;
31
36
  themeOverride?: Theme;
32
37
  /**
33
38
  * @default 444
@@ -40,4 +45,4 @@ export type BaseDialogProps = BaseProps & {
40
45
  withBackdrop?: boolean;
41
46
  onClose?: () => void;
42
47
  };
43
- export declare const BaseDialog: ({ children, className, closeOnBlur, closeOnEsc, onClose, open, popupMotionProps, style, themeOverride, width, withBackdrop, }: BaseDialogProps) => React.ReactPortal | null;
48
+ export declare const BaseDialog: ({ children, className, closeOnBlur, closeOnEsc, onClose, open, popupMotionProps, rootSelector, style, themeOverride, width, withBackdrop, }: BaseDialogProps) => React.ReactPortal | null;
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),i=require("react"),n=require("react-dom"),t=require("clsx"),a=require("framer-motion"),r=require("../../style-inject.es-d4ddeae4.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=l(t),d="Amino_BaseDialog-module__backdrop--Tykyp",s="Amino_BaseDialog-module__popup--1AFN-";r.styleInject(".Amino_BaseDialog-module__backdrop--Tykyp{align-items:center;color:var(--amino-text-color);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100vw;z-index:1000}.Amino_BaseDialog-module__popup--1AFN-{background:var(--amino-surface-color);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-xxl);display:flex;flex-direction:column;max-height:90vh;outline:none;overflow:hidden;width:var(--amino-base-dialog-width);z-index:1001}");exports.BaseDialog=function(t){var r=t.children,l=t.className,u=t.closeOnBlur,m=void 0===u||u,p=t.closeOnEsc,v=void 0===p||p,f=t.onClose,g=t.open,_=t.popupMotionProps,y=t.style,h=t.themeOverride,b=t.width,x=void 0===b?444:b,k=t.withBackdrop,w=void 0===k||k,q=i.useRef(null),j=i.useRef(null);i.useEffect((function(){var e,o;(null===(e=j.current)||void 0===e?void 0:e.contains(document.activeElement))||null===(o=j.current)||void 0===o||o.focus(),(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=g?"hidden":"auto")}),[g]);var A=w?{animate:{backgroundColor:"rgba(16, 17, 22, 0.65)"},exit:{backgroundColor:"rgba(16, 17, 22, 0)"},initial:{backgroundColor:"rgba(16, 17, 22, 0)"}}:{},B=e.__assign({animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},initial:{opacity:0,scale:.95},transition:{duration:.3,ease:[.4,0,.2,1]}},_);if("undefined"!=typeof document){var D=document.querySelector("body");if(D)return n.createPortal(o.jsx(a.AnimatePresence,{children:g&&i.createElement(a.motion.div,e.__assign({className:d},A,{key:"dialog-backdrop",ref:j,"data-theme":h,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),f&&v&&f())},onMouseDown:function(e){q.current=e.target},onMouseUp:function(e){var o=e.target===q.current,i=f&&m&&e.target===j.current;o&&i&&f(),q.current=null},style:e.__assign(e.__assign({},y),{"--amino-base-dialog-width":"".concat(x,"px")}),tabIndex:-1,transition:{duration:.3}}),i.createElement(a.motion.div,e.__assign({},B,{key:"dialog",className:c.default(l,s,"elevated"),onClick:function(e){e.stopPropagation()}}),r))}),D)}return null};
1
+ "use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),i=require("react"),n=require("react-dom"),t=require("clsx"),a=require("framer-motion"),r=require("../../style-inject.es-d4ddeae4.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=l(t),d="Amino_BaseDialog-module__backdrop--Tykyp",s="Amino_BaseDialog-module__popup--1AFN-";r.styleInject(".Amino_BaseDialog-module__backdrop--Tykyp{align-items:center;color:var(--amino-text-color);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100vw;z-index:1000}.Amino_BaseDialog-module__popup--1AFN-{background:var(--amino-surface-color);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-xxl);display:flex;flex-direction:column;max-height:90vh;outline:none;overflow:hidden;width:var(--amino-base-dialog-width);z-index:1001}");exports.BaseDialog=function(t){var r=t.children,l=t.className,u=t.closeOnBlur,m=void 0===u||u,p=t.closeOnEsc,v=void 0===p||p,f=t.onClose,g=t.open,_=t.popupMotionProps,y=t.rootSelector,h=t.style,b=t.themeOverride,x=t.width,k=void 0===x?444:x,w=t.withBackdrop,q=void 0===w||w,j=i.useRef(null),A=i.useRef(null);i.useEffect((function(){var e,o;(null===(e=A.current)||void 0===e?void 0:e.contains(document.activeElement))||null===(o=A.current)||void 0===o||o.focus(),(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=g?"hidden":"auto")}),[g]);var B=q?{animate:{backgroundColor:"rgba(16, 17, 22, 0.65)"},exit:{backgroundColor:"rgba(16, 17, 22, 0)"},initial:{backgroundColor:"rgba(16, 17, 22, 0)"}}:{},D=e.__assign({animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},initial:{opacity:0,scale:.95},transition:{duration:.3,ease:[.4,0,.2,1]}},_);if("undefined"!=typeof document){var E=document.querySelector(y||"body");if(E)return n.createPortal(o.jsx(a.AnimatePresence,{children:g&&i.createElement(a.motion.div,e.__assign({className:d},B,{key:"dialog-backdrop",ref:A,"data-theme":b,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),f&&v&&f())},onMouseDown:function(e){j.current=e.target},onMouseUp:function(e){var o=e.target===j.current,i=f&&m&&e.target===A.current;o&&i&&f(),j.current=null},style:e.__assign(e.__assign({},h),{"--amino-base-dialog-width":"".concat(k,"px")}),tabIndex:-1,transition:{duration:.3}}),i.createElement(a.motion.div,e.__assign({},D,{key:"dialog",className:c.default(l,s,"elevated"),onClick:function(e){e.stopPropagation()}}),r))}),E)}return null};
@@ -13,6 +13,7 @@ export declare const Dialog: import("react").ForwardRefExoticComponent<import(".
13
13
  closeOnEsc?: boolean | undefined;
14
14
  open: boolean;
15
15
  popupMotionProps?: import("framer-motion").MotionProps | undefined;
16
+ rootSelector?: string | undefined;
16
17
  themeOverride?: "day" | "night" | "midnight" | undefined;
17
18
  width?: number | undefined;
18
19
  withBackdrop?: boolean | undefined;
@@ -13,6 +13,7 @@ export declare const AnnouncementDialog: import("react").ForwardRefExoticCompone
13
13
  closeOnEsc?: boolean | undefined;
14
14
  open: boolean;
15
15
  popupMotionProps?: import("framer-motion").MotionProps | undefined;
16
+ rootSelector?: string | undefined;
16
17
  themeOverride?: "day" | "night" | "midnight" | undefined;
17
18
  width?: number | undefined;
18
19
  withBackdrop?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.1.113",
3
+ "version": "5.1.114",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",