@zonos/amino 5.1.96 → 5.1.97
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,15 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { type BaseDialogProps } from "../dialog/BaseDialog";
|
|
3
|
+
export type CoverSheetProps = BaseDialogProps & {
|
|
4
|
+
/**
|
|
5
|
+
* used for setting id of the wrapper of where the action will be located */
|
|
6
6
|
actionWrapperId?: string;
|
|
7
7
|
actions?: ReactNode;
|
|
8
|
-
children: ReactNode;
|
|
9
8
|
headerComponent?: ReactNode;
|
|
10
9
|
label: string;
|
|
11
|
-
open: boolean;
|
|
12
|
-
themeOverride?: Theme;
|
|
13
|
-
onClose: () => void;
|
|
14
10
|
};
|
|
15
|
-
export declare const CoverSheet: ({ actions, actionWrapperId, children, className, headerComponent, label, onClose, open,
|
|
11
|
+
export declare const CoverSheet: ({ actions, actionWrapperId, children, className, headerComponent, label, onClose, open, ...props }: CoverSheetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),r=require("react"),t=require("clsx"),n=require("../button/Button.js"),i=require("./CoverSheetActions.js"),a=require("../dialog/BaseDialog.js"),s=require("../text/Text.js"),c=require("../../icons/RemoveIcon.js"),d=require("../../style-inject.es-d4ddeae4.js");function l(e){return e&&e.__esModule?e:{default:e}}require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../stack/HStack.js"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js");var u=l(t),m="Amino_CoverSheet-module__coverSheet--nZP66",h="Amino_CoverSheet-module__headerContainer--SCAgD",p="Amino_CoverSheet-module__header--praFM",v="Amino_CoverSheet-module__headerComponent--fgFRV",_="Amino_CoverSheet-module__content--Zht4F";d.styleInject(".Amino_CoverSheet-module__coverSheet--nZP66{background:var(--amino-page-background);border:var(--amino-border);border-radius:0;box-sizing:border-box;color:var(--amino-text-color);height:100vh;left:0;max-height:100vh;outline:none;overscroll-behavior:contain;position:fixed;top:0;width:100vw}@media print{.Amino_CoverSheet-module__coverSheet--nZP66{height:auto;min-height:100vh;position:absolute}}.Amino_CoverSheet-module__headerContainer--SCAgD{align-items:center;background-color:var(--amino-page-background);border-bottom:var(--amino-border);display:flex;height:64px;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-32);position:-webkit-sticky;position:sticky;top:0;z-index:99}@media print{.Amino_CoverSheet-module__headerContainer--SCAgD{display:none}}.Amino_CoverSheet-module__header--praFM{align-items:center;display:flex;gap:var(--amino-space-16)}.Amino_CoverSheet-module__headerComponent--fgFRV{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.Amino_CoverSheet-module__content--Zht4F{overflow:auto;padding:var(--amino-space-56)}");exports.CoverSheet=function(t){var d=t.actions,l=t.actionWrapperId,C=void 0===l?"__cover-sheet-actions":l,j=t.children,b=t.className,g=t.headerComponent,S=t.label,x=t.onClose,f=t.open,q=e.__rest(t,["actions","actionWrapperId","children","className","headerComponent","label","onClose","open"]);return r.useEffect((function(){"undefined"!=typeof document&&document.querySelectorAll("[id='".concat(C,"']")).length>1&&console.error('Duplicate id "'.concat(C,'" detected in "CoverSheet" component. Please set "actionWrapperId" to a unique id.'))}),[C]),r.useEffect((function(){(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=f?"hidden":"auto")}),[f]),o.jsxs(a.BaseDialog,e.__assign({className:u.default(m,b),onClose:x,open:f,popupMotionProps:{animate:{translateY:0},exit:{translateY:"100vh"},initial:{translateY:"100vh"},transition:{duration:.5,ease:[0,0,0,1]}}},q,{children:[o.jsxs("header",{className:h,children:[o.jsxs("div",{className:p,children:[o.jsx(n.Button,{icon:o.jsx(c.RemoveIcon,{size:20}),onClick:x}),o.jsx(s.Text,{type:"subheader",children:S})]}),o.jsx("div",{className:v,children:g}),o.jsx("div",{id:C,children:d&&o.jsx(i.CoverSheetActions,{coverSheetActionId:C,children:d})})]}),o.jsx("div",{className:_,children:j})]}))};
|
|
@@ -3,7 +3,7 @@ import type { BaseProps } from "../../types/BaseProps";
|
|
|
3
3
|
export type CoverSheetProps = BaseProps & {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/**
|
|
6
|
-
* Determine where to put
|
|
6
|
+
* Determine where to put these actions in the coversheet
|
|
7
7
|
* @default id for coversheet component is `__cover-sheet-actions`
|
|
8
8
|
* */
|
|
9
9
|
coverSheetActionId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),
|
|
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};
|