@ape.swap/bonds-sdk 6.2.22 → 6.2.24
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.
|
@@ -15,16 +15,7 @@ const resolveZIndex = (zIndex) => namedZIndex[zIndex] ?? zIndex;
|
|
|
15
15
|
const Modal = ({ children, onDismiss, open = true, title, zIndex = 'modal', onAnimationComplete, backdrop, hideDivider, className, style, ...props }) => {
|
|
16
16
|
const { handleClose } = useContext(Context);
|
|
17
17
|
const onClose = onDismiss || handleClose;
|
|
18
|
-
return (jsxs("div", { id: title, style: { zIndex: resolveZIndex(zIndex) }, children: [jsx(AnimatePresence, { children: open && (jsxs(motion.div, { initial: {
|
|
19
|
-
opacity: 0,
|
|
20
|
-
transform: 'translate(-50%, -50%) scale(0.1)',
|
|
21
|
-
}, animate: {
|
|
22
|
-
opacity: 1,
|
|
23
|
-
transform: 'translate(-50%, -50%) scale(1.0)',
|
|
24
|
-
}, transition: {
|
|
25
|
-
opacity: { duration: 0.2 },
|
|
26
|
-
transform: { duration: 0.2 },
|
|
27
|
-
}, exit: { opacity: 0, transform: 'translate(-50%, -50%) scale(0)' }, ...props, className: clsx('ape:p-5 ape:bg-white2 ape:rounded-normal ape:text-text ape:fixed ape:block ape:top-1/2 ape:left-1/2', 'ape:w-95 ape:max-w-[95vw] ape:max-h-[95vh] ape:overflow-y-auto ape:overflow-x-hidden', className), style: { zIndex: resolveZIndex(zIndex), ...style }, onAnimationComplete: onAnimationComplete, children: [title && (jsx(ModalHeader, { onDismiss: onClose, hideDivider: hideDivider, children: jsx(Text, { style: { fontSize: '22px', fontWeight: 700, lineHeight: '33px' }, children: title }) })), children] })) }), open && (jsx("div", { className: "ape:fixed ape:inset-0 ape:bg-modal-overlay ape:w-full ape:h-full ape:z-100 ape:transition-all ape:duration-1000 ape:ease-[ease]", style: backdrop, onClick: onClose }))] }));
|
|
18
|
+
return (jsxs("div", { id: title, style: { zIndex: resolveZIndex(zIndex) }, children: [jsx(AnimatePresence, { children: open && (jsxs(motion.div, { initial: { opacity: 0, x: '-50%', y: '-50%', scale: 0.1 }, animate: { opacity: 1, x: '-50%', y: '-50%', scale: 1 }, transition: { duration: 0.2 }, exit: { opacity: 0, x: '-50%', y: '-50%', scale: 0 }, ...props, className: clsx('ape:p-5 ape:bg-white2 ape:rounded-normal ape:text-text ape:fixed ape:block ape:top-1/2 ape:left-1/2', 'ape:w-95 ape:max-w-[95vw] ape:max-h-[95vh] ape:overflow-y-auto ape:overflow-x-hidden', className), style: { zIndex: resolveZIndex(zIndex), ...style }, onAnimationComplete: onAnimationComplete, children: [title && (jsx(ModalHeader, { onDismiss: onClose, hideDivider: hideDivider, children: jsx(Text, { style: { fontSize: '22px', fontWeight: 700, lineHeight: '33px' }, children: title }) })), children] })) }), open && (jsx("div", { className: "ape:fixed ape:inset-0 ape:bg-modal-overlay ape:w-full ape:h-full ape:z-100 ape:transition-all ape:duration-1000 ape:ease-[ease]", style: backdrop, onClick: onClose }))] }));
|
|
28
19
|
};
|
|
29
20
|
|
|
30
21
|
export { Modal as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/uikit-sdk/Modal/index.tsx"],"sourcesContent":["import React, { useContext } from 'react'\nimport { AnimatePresence, motion } from 'framer-motion'\nimport clsx from 'clsx'\nimport { ModalProps } from './types'\nimport ModalHeader from './ModalHeader'\nimport { Context as ModalContext } from '../../../contexts/ModalContext'\nimport Text from '../Text'\n\n// theme/base.ts zIndices — named tokens resolve through CSS vars, anything else is used as-is\nconst namedZIndex: Record<string, string> = {\n modal: 'var(--ape-z-index-modal)',\n dropdown: 'var(--ape-z-index-dropdown)',\n}\nconst resolveZIndex = (zIndex: string | number) => namedZIndex[zIndex as string] ?? zIndex\n\nconst Modal = ({\n children,\n onDismiss,\n open = true,\n title,\n zIndex = 'modal',\n onAnimationComplete,\n backdrop,\n hideDivider,\n className,\n style,\n ...props\n}: ModalProps | any) => {\n const { handleClose } = useContext(ModalContext)\n const onClose = onDismiss || handleClose\n\n return (\n <div id={title} style={{ zIndex: resolveZIndex(zIndex) }}>\n <AnimatePresence>\n {open && (\n <motion.div\n initial={{
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/uikit-sdk/Modal/index.tsx"],"sourcesContent":["import React, { useContext } from 'react'\nimport { AnimatePresence, motion } from 'framer-motion'\nimport clsx from 'clsx'\nimport { ModalProps } from './types'\nimport ModalHeader from './ModalHeader'\nimport { Context as ModalContext } from '../../../contexts/ModalContext'\nimport Text from '../Text'\n\n// theme/base.ts zIndices — named tokens resolve through CSS vars, anything else is used as-is\nconst namedZIndex: Record<string, string> = {\n modal: 'var(--ape-z-index-modal)',\n dropdown: 'var(--ape-z-index-dropdown)',\n}\nconst resolveZIndex = (zIndex: string | number) => namedZIndex[zIndex as string] ?? zIndex\n\nconst Modal = ({\n children,\n onDismiss,\n open = true,\n title,\n zIndex = 'modal',\n onAnimationComplete,\n backdrop,\n hideDivider,\n className,\n style,\n ...props\n}: ModalProps | any) => {\n const { handleClose } = useContext(ModalContext)\n const onClose = onDismiss || handleClose\n\n return (\n <div id={title} style={{ zIndex: resolveZIndex(zIndex) }}>\n <AnimatePresence>\n {open && (\n <motion.div\n initial={{ opacity: 0, x: '-50%', y: '-50%', scale: 0.1 }}\n animate={{ opacity: 1, x: '-50%', y: '-50%', scale: 1 }}\n transition={{ duration: 0.2 }}\n exit={{ opacity: 0, x: '-50%', y: '-50%', scale: 0 }}\n {...props}\n className={clsx(\n 'ape:p-5 ape:bg-white2 ape:rounded-normal ape:text-text ape:fixed ape:block ape:top-1/2 ape:left-1/2',\n 'ape:w-95 ape:max-w-[95vw] ape:max-h-[95vh] ape:overflow-y-auto ape:overflow-x-hidden',\n className,\n )}\n style={{ zIndex: resolveZIndex(zIndex), ...style }}\n onAnimationComplete={onAnimationComplete}\n >\n {title && (\n <ModalHeader onDismiss={onClose} hideDivider={hideDivider}>\n <Text style={{ fontSize: '22px', fontWeight: 700, lineHeight: '33px' }}>{title}</Text>\n </ModalHeader>\n )}\n {children}\n </motion.div>\n )}\n </AnimatePresence>\n {open && (\n <div\n className=\"ape:fixed ape:inset-0 ape:bg-modal-overlay ape:w-full ape:h-full ape:z-100 ape:transition-all ape:duration-1000 ape:ease-[ease]\"\n style={backdrop}\n onClick={onClose}\n />\n )}\n </div>\n )\n}\n\nexport default Modal\n"],"names":["ModalContext","_jsxs","_jsx"],"mappings":";;;;;;;;AAQA;AACA,MAAM,WAAW,GAA2B;AAC1C,IAAA,KAAK,EAAE,0BAA0B;AACjC,IAAA,QAAQ,EAAE,6BAA6B;CACxC;AACD,MAAM,aAAa,GAAG,CAAC,MAAuB,KAAK,WAAW,CAAC,MAAgB,CAAC,IAAI,MAAM;AAE1F,MAAM,KAAK,GAAG,CAAC,EACb,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,IAAI,EACX,KAAK,EACL,MAAM,GAAG,OAAO,EAChB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACS,KAAI;IACrB,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAACA,OAAY,CAAC;AAChD,IAAA,MAAM,OAAO,GAAG,SAAS,IAAI,WAAW;IAExC,QACEC,cAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,aACtDC,GAAA,CAAC,eAAe,cACb,IAAI,KACHD,IAAA,CAAC,MAAM,CAAC,GAAG,EAAA,EACT,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EACzD,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,EACvD,UAAU,EAAE,EAAE,QAA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