@elliemae/ds-modal-slide 3.0.0-next.12 → 3.0.0-next.16

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.
@@ -59,7 +59,11 @@ const DSModalSlide = ({
59
59
  const [show, setShow] = (0, import_react.useState)(isOpen);
60
60
  const [width, setWidth] = (0, import_react.useState)(50);
61
61
  const theme = (0, import_ds_system.useTheme)();
62
- const contentRows = [...header ? [theme.space.m] : [], "0px", "auto", "0px", ...footer ? [theme.space.m] : []];
62
+ const contentRows = [
63
+ ...header ? [`minmax(${theme.space.m}, 'auto')`, "auto"] : [],
64
+ "auto",
65
+ ...footer ? ["auto", theme.space.m] : []
66
+ ];
63
67
  const updateShow = (0, import_react.useCallback)(() => {
64
68
  if (fullWidth)
65
69
  setWidth(100);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSModalSlide.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\n\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwD;AACxD,wBAAoC;AACpC,uBAAqB;AACrB,uBAAyB;AACzB,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAGxB,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBAAiB;AAAA,MACb;AACJ,QAAM,CAAC,UAAU,aAAa,2BAAS;AACvC,QAAM,CAAC,MAAM,WAAW,2BAAS;AACjC,QAAM,CAAC,OAAO,YAAY,2BAAS;AACnC,QAAM,QAAQ;AACd,QAAM,cAAc,CAAC,GAAI,SAAS,CAAC,MAAM,MAAM,KAAK,IAAK,OAAO,QAAQ,OAAO,GAAI,SAAS,CAAC,MAAM,MAAM,KAAK;AAE9G,QAAM,aAAa,8BAAY,MAAM;AACnC,QAAI;AAAW,eA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A,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,mDAAC,6BAAD,MAAgB,aAGnB,UAAU,mDAAC,6BAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAC/C,YAKT;AAAA;AAIJ,MAAM,QAAQ;AAAA,EAIZ,UAAU,4BAAU,KAAK,YAAY;AAAA,EAIrC,QAAQ,4BAAU,KAAK,YAAY;AAAA,EAInC,UAAU,4BAAU,UAAU,CAAC,4BAAU,SAAS,4BAAU,QAAQ,4BAAU,MAAM,WAAW,YAC7F;AAAA,EAKF,WAAW,4BAAU,KAAK,YAAY;AAAA,EAItC,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAItC,SAAS,4BAAU,OAAO,YAAY;AAAA,EAItC,QAAQ,4BAAU,OAAO,YAAY;AAAA,EAIrC,gBAAgB,4BAAU,KAAK,YAAY;AAAA;AAG7C,aAAa,YAAY;AAEzB,MAAM,yBAAyB,gCAAS;AACxC,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [\n ...(header ? [`minmax(${theme.space.m}, 'auto')`, 'auto'] : []),\n 'auto',\n ...(footer ? ['auto', theme.space.m] : []),\n ];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\n\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwD;AACxD,wBAAoC;AACpC,uBAAqB;AACrB,uBAAyB;AACzB,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAGxB,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBAAiB;AAAA,MACb;AACJ,QAAM,CAAC,UAAU,aAAa,2BAAS;AACvC,QAAM,CAAC,MAAM,WAAW,2BAAS;AACjC,QAAM,CAAC,OAAO,YAAY,2BAAS;AACnC,QAAM,QAAQ;AACd,QAAM,cAAc;AAAA,IAClB,GAAI,SAAS,CAAC,UAAU,MAAM,MAAM,cAAc,UAAU;AAAA,IAC5D;AAAA,IACA,GAAI,SAAS,CAAC,QA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,MAChD,mDAAC,qBAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,mDAAC,qBAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,mDAAC,6BAAD,MAAgB,aAGnB,UAAU,mDAAC,6BAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAC/C,YAKT;AAAA;AAIJ,MAAM,QAAQ;AAAA,EAIZ,UAAU,4BAAU,KAAK,YAAY;AAAA,EAIrC,QAAQ,4BAAU,KAAK,YAAY;AAAA,EAInC,UAAU,4BAAU,UAAU,CAAC,4BAAU,SAAS,4BAAU,QAAQ,4BAAU,MAAM,WAAW,YAC7F;AAAA,EAKF,WAAW,4BAAU,KAAK,YAAY;AAAA,EAItC,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAItC,SAAS,4BAAU,OAAO,YAAY;AAAA,EAItC,QAAQ,4BAAU,OAAO,YAAY;AAAA,EAIrC,gBAAgB,4BAAU,KAAK,YAAY;AAAA;AAG7C,aAAa,YAAY;AAEzB,MAAM,yBAAyB,gCAAS;AACxC,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -24,7 +24,11 @@ const DSModalSlide = ({
24
24
  const [show, setShow] = useState(isOpen);
25
25
  const [width, setWidth] = useState(50);
26
26
  const theme = useTheme();
27
- const contentRows = [...header ? [theme.space.m] : [], "0px", "auto", "0px", ...footer ? [theme.space.m] : []];
27
+ const contentRows = [
28
+ ...header ? [`minmax(${theme.space.m}, 'auto')`, "auto"] : [],
29
+ "auto",
30
+ ...footer ? ["auto", theme.space.m] : []
31
+ ];
28
32
  const updateShow = useCallback(() => {
29
33
  if (fullWidth)
30
34
  setWidth(100);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\n\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
5
- "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAA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ACE,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,WAAW;AAAA,MACX,UAAU;AAAA,MACV,+BAA+B;AAAA,MAC/B,uBAAuB;AAAA,MACvB,2BAA2B;AAAA;AAAA,IAE7B,MAAM;AAAA,IACN,eAAY;AAAA,KAEX,UAAU,OAAM,aAAa,QAAQ,EAAE,cACvC,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAChD,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,eAAD,MAAgB,aAGnB,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAC/C,YAKT;AAAA;AAIJ,MAAM,QAAQ;AAAA,EAIZ,UAAU,UAAU,KAAK,YAAY;AAAA,EAIrC,QAAQ,UAAU,KAAK,YAAY;AAAA,EAInC,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM,WAAW,YAC7F;AAAA,EAKF,WAAW,UAAU,KAAK,YAAY;AAAA,EAItC,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAItC,SAAS,UAAU,OAAO,YAAY;AAAA,EAItC,QAAQ,UAAU,OAAO,YAAY;AAAA,EAIrC,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAG7C,aAAa,YAAY;AAEzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [\n ...(header ? [`minmax(${theme.space.m}, 'auto')`, 'auto'] : []),\n 'auto',\n ...(footer ? ['auto', theme.space.m] : []),\n ];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\n\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBAAiB;AAAA,MACb;AACJ,QAAM,CAAC,UAAU,aAAa,SAAS;AACvC,QAAM,CAAC,MAAM,WAAW,SAAS;AAC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vB,2BAA2B;AAAA;AAAA,IAE7B,MAAM;AAAA,IACN,eAAY;AAAA,KAEX,UAAU,OAAM,aAAa,QAAQ,EAAE,cACvC,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAChD,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,MAAD;AAAA,IAAM,OAAO,EAAE,UAAU;AAAA,KACvB,qCAAC,eAAD,MAAgB,aAGnB,UAAU,qCAAC,aAAD;AAAA,IAAa,UAAS;AAAA,IAAU,MAAK;AAAA,MAC/C,YAKT;AAAA;AAIJ,MAAM,QAAQ;AAAA,EAIZ,UAAU,UAAU,KAAK,YAAY;AAAA,EAIrC,QAAQ,UAAU,KAAK,YAAY;AAAA,EAInC,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM,WAAW,YAC7F;AAAA,EAKF,WAAW,UAAU,KAAK,YAAY;AAAA,EAItC,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAItC,SAAS,UAAU,OAAO,YAAY;AAAA,EAItC,QAAQ,UAAU,OAAO,YAAY;AAAA,EAIrC,gBAAgB,UAAU,KAAK,YAAY;AAAA;AAG7C,aAAa,YAAY;AAEzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-modal-slide",
3
- "version": "3.0.0-next.12",
3
+ "version": "3.0.0-next.16",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Modal Slide",
6
6
  "files": [
@@ -51,12 +51,12 @@
51
51
  "indent": 4
52
52
  },
53
53
  "dependencies": {
54
- "@elliemae/ds-button": "3.0.0-next.12",
55
- "@elliemae/ds-classnames": "3.0.0-next.12",
56
- "@elliemae/ds-grid": "3.0.0-next.12",
57
- "@elliemae/ds-icons": "3.0.0-next.12",
58
- "@elliemae/ds-separator": "3.0.0-next.12",
59
- "@elliemae/ds-system": "3.0.0-next.12",
54
+ "@elliemae/ds-button": "3.0.0-next.16",
55
+ "@elliemae/ds-classnames": "3.0.0-next.16",
56
+ "@elliemae/ds-grid": "3.0.0-next.16",
57
+ "@elliemae/ds-icons": "3.0.0-next.16",
58
+ "@elliemae/ds-separator": "3.0.0-next.16",
59
+ "@elliemae/ds-system": "3.0.0-next.16",
60
60
  "prop-types": "~15.8.1",
61
61
  "react-desc": "~4.1.3"
62
62
  },