@elliemae/ds-modal-slide 3.12.0-rc.2 → 3.12.0-rc.21

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.
@@ -35,6 +35,7 @@ var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_ds_utilities = require("@elliemae/ds-utilities");
38
+ var import_lodash = require("lodash");
38
39
  var import_react_dom = __toESM(require("react-dom"));
39
40
  var import_ds_system = require("@elliemae/ds-system");
40
41
  var import_ds_grid = require("@elliemae/ds-grid");
@@ -67,6 +68,7 @@ const DSModalSlide = (props2) => {
67
68
  const [isMoving, setMoving] = (0, import_react.useState)(false);
68
69
  const [show, setShow] = (0, import_react.useState)(isOpen);
69
70
  const [width, setWidth] = (0, import_react.useState)(50);
71
+ const [height, setHeight] = (0, import_react.useState)("100%");
70
72
  const theme = (0, import_ds_system.useTheme)();
71
73
  const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
72
74
  const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(props2);
@@ -83,9 +85,28 @@ const DSModalSlide = (props2) => {
83
85
  }
84
86
  }, [isOpen, fullWidth, isMoving]);
85
87
  (0, import_react.useEffect)(updateShow, [isOpen, fullWidth]);
88
+ const container = getContainer();
89
+ const handleHeight = (0, import_react.useCallback)(() => {
90
+ const newHeight = overrideHeight && container.scrollHeight > container.getBoundingClientRect().height ? container.scrollHeight : container.getBoundingClientRect().height;
91
+ setHeight(newHeight);
92
+ }, [container, overrideHeight]);
93
+ const onChangeParent = (0, import_react.useMemo)(() => (0, import_lodash.debounce)(handleHeight, 300), [handleHeight]);
94
+ (0, import_react.useEffect)(() => {
95
+ const resizeObserver = new ResizeObserver(() => onChangeParent());
96
+ if (container) {
97
+ resizeObserver.observe(container);
98
+ if (!container.style.position) {
99
+ container.style.position = "relative";
100
+ }
101
+ onChangeParent();
102
+ }
103
+ return () => {
104
+ if (container)
105
+ resizeObserver.unobserve(container);
106
+ };
107
+ }, [container, onChangeParent]);
86
108
  if (!show)
87
109
  return null;
88
- const container = getContainer();
89
110
  if (!container)
90
111
  return null;
91
112
  const handleAnimationEnd = () => {
@@ -93,74 +114,63 @@ const DSModalSlide = (props2) => {
93
114
  if (!isOpen)
94
115
  setShow(isOpen);
95
116
  };
96
- let { height } = container.getBoundingClientRect();
97
- if (overrideHeight && container.scrollHeight > height) {
98
- height = container.scrollHeight;
99
- }
100
- if (!container.style.position) {
101
- container.style.position = "relative";
102
- }
103
117
  return import_react_dom.default.createPortal(
104
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Wrapper, {
105
- ...globalAttrs,
106
- classProps: {
107
- show: isOpen,
108
- centered
109
- },
110
- style: {
111
- "--height": height,
112
- "--fade-in": fadeIn,
113
- "--fade-out": fadeOut,
114
- "--width": width
115
- },
116
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Overlay, {
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ import_blocks.Wrapper,
120
+ {
121
+ ...globalAttrs,
117
122
  classProps: {
118
- show: isOpen
123
+ show: isOpen,
124
+ centered
119
125
  },
120
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Content, {
121
- onAnimationEnd: handleAnimationEnd,
122
- classProps: {
123
- show: isOpen
124
- },
125
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, {
126
- style: {
127
- height: "100%",
128
- width: "100%",
129
- maxHeight: "100%",
130
- overflow: "hidden",
131
- "-webkit-backface-visibility": "hidden",
132
- "backface-visibility": "hidden",
133
- "-webkit-transform-style": "preserve-3d"
126
+ style: {
127
+ "--height": height,
128
+ "--fade-in": fadeIn,
129
+ "--fade-out": fadeOut,
130
+ "--width": width
131
+ },
132
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
+ import_blocks.Overlay,
134
+ {
135
+ classProps: {
136
+ show: isOpen
134
137
  },
135
- rows: contentRows,
136
- "data-testid": "ds-modal-slide",
137
- children: [
138
- header && import_react.default.cloneElement(header, { fullWidth }),
139
- header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, {
140
- position: "initial",
141
- type: "non-form"
142
- }),
143
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, {
144
- style: { overflow: "hidden" },
145
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledWrapper, {
146
- ref: innerRef,
147
- tabIndex: 0,
148
- role: "contentinfo",
149
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.ActualContent, {
150
- children
151
- })
152
- })
153
- }),
154
- footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, {
155
- position: "initial",
156
- type: "non-form"
157
- }),
158
- footer
159
- ]
160
- })
161
- })
162
- })
163
- }),
138
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
139
+ import_blocks.Content,
140
+ {
141
+ onAnimationEnd: handleAnimationEnd,
142
+ classProps: {
143
+ show: isOpen
144
+ },
145
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
146
+ import_ds_grid.Grid,
147
+ {
148
+ style: {
149
+ height: "100%",
150
+ width: "100%",
151
+ maxHeight: "100%",
152
+ overflow: "hidden",
153
+ "-webkit-backface-visibility": "hidden",
154
+ "backface-visibility": "hidden",
155
+ "-webkit-transform-style": "preserve-3d"
156
+ },
157
+ rows: contentRows,
158
+ "data-testid": "ds-modal-slide",
159
+ children: [
160
+ header && import_react.default.cloneElement(header, { fullWidth }),
161
+ header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, { position: "initial", type: "non-form" }),
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledWrapper, { ref: innerRef, tabIndex: 0, role: "contentinfo", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.ActualContent, { children }) }) }),
163
+ footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, { position: "initial", type: "non-form" }),
164
+ footer
165
+ ]
166
+ }
167
+ )
168
+ }
169
+ )
170
+ }
171
+ )
172
+ }
173
+ ),
164
174
  container
165
175
  );
166
176
  };
@@ -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, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\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 ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n\n const globalAttrs = useGetGlobalAttributes(props);\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 {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;\nDSModalSlide.displayName = 'DSModalSlide';\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,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADiGb;AAhGV,mBAAwD;AACxD,0BAA4D;AAC5D,uBAAqB;AACrB,uBAAiC;AACjC,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAExB,MAAM,oBAAgB,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA,yBAIR,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAK3D,MAAM,eAAe,CAACC,WAAU;AAC9B,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,iBAAiB;AAAA,IACjB,WAAW;AAAA,EACb,IAAIA;AACJ,QAAM,CAAC,UAAU,SAAS,QAAI,uBAAS,KAAK;AAC5C,QAAM,CAAC,MAAM,OA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,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,8BAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,8BAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport { debounce } from 'lodash';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const [height, setHeight] = useState('100%');\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n const globalAttrs = useGetGlobalAttributes(props);\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 const container = getContainer();\n\n const handleHeight = useCallback(() => {\n const newHeight =\n overrideHeight && container.scrollHeight > container.getBoundingClientRect().height\n ? container.scrollHeight\n : container.getBoundingClientRect().height;\n setHeight(newHeight);\n }, [container, overrideHeight]);\n\n const onChangeParent = useMemo(() => debounce(handleHeight, 300), [handleHeight]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => onChangeParent());\n if (container) {\n resizeObserver.observe(container);\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n onChangeParent();\n }\n return () => {\n if (container) resizeObserver.unobserve(container);\n };\n }, [container, onChangeParent]);\n\n if (!show) return null;\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n return ReactDOM.createPortal(\n <Wrapper\n {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;\nDSModalSlide.displayName = 'DSModalSlide';\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,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADmHb;AAjHV,mBAAiE;AACjE,0BAA4D;AAC5D,oBAAyB;AACzB,uBAAqB;AACrB,uBAAiC;AACjC,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAExB,MAAM,oBAAgB,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA,yBAIR,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAK3D,MAAM,eAAe,CAACC,WAAU;AAC9B,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IAC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U,4CAAC,oBAAAA,SAAA,EAAY,UAAS,WAAU,MAAK,YAAW;AAAA,sBAC1D;AAAA;AAAA;AAAA,gBACH;AAAA;AAAA,YACF;AAAA;AAAA,QACF;AAAA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,QAAQ;AAAA,EAIZ,UAAU,8BAAU,KAAK,YAAY,uCAAuC;AAAA,EAI5E,QAAQ,8BAAU,KAAK,YAAY,sCAAsC;AAAA,EAIzE,UAAU,8BAAU,UAAU,CAAC,8BAAU,SAAS,8BAAU,QAAQ,8BAAU,GAAG,CAAC,EAAE,WAAW;AAAA,IAC7F;AAAA,EACF;AAAA,EAIA,WAAW,8BAAU,KAAK,YAAY,gDAAgD;AAAA,EAItF,QAAQ,8BAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,8BAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,8BAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,8BAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,8BAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
6
6
  "names": ["ModalFooter", "ModalHeader", "props", "ReactDOM", "React", "DSSeparator"]
7
7
  }
@@ -44,28 +44,30 @@ const ModalFooter = ({
44
44
  rejectProps = {
45
45
  disabled: false
46
46
  }
47
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
48
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.FooterWrapper, {
49
- children: [
50
- !!onReject && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, {
51
- buttonType: "secondary",
52
- className: "action-reject",
53
- containerProps: { "data-testid": "modal-footer-reject-btn" },
54
- labelText: rejectLabel,
55
- onClick: onReject,
56
- ...rejectProps
57
- }),
58
- !!onConfirm && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, {
59
- buttonType: "primary",
60
- className: "action-confirm",
61
- containerProps: { "data-testid": "modal-footer-confirm-btn" },
62
- labelText: confirmLabel,
63
- onClick: onConfirm,
64
- ...confirmProps
65
- })
66
- ]
67
- })
68
- });
47
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.FooterWrapper, { children: [
48
+ !!onReject && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ import_ds_button.default,
50
+ {
51
+ buttonType: "secondary",
52
+ className: "action-reject",
53
+ containerProps: { "data-testid": "modal-footer-reject-btn" },
54
+ labelText: rejectLabel,
55
+ onClick: onReject,
56
+ ...rejectProps
57
+ }
58
+ ),
59
+ !!onConfirm && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_ds_button.default,
61
+ {
62
+ buttonType: "primary",
63
+ className: "action-confirm",
64
+ containerProps: { "data-testid": "modal-footer-confirm-btn" },
65
+ labelText: confirmLabel,
66
+ onClick: onConfirm,
67
+ ...confirmProps
68
+ }
69
+ )
70
+ ] }) });
69
71
  const props = {
70
72
  confirmLabel: import_ds_utilities.PropTypes.string.description("Confirm Label"),
71
73
  rejectLabel: import_ds_utilities.PropTypes.string.description("Reject Label"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Footer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiBrB;AAhBF,0BAAoC;AACpC,uBAAqB;AACrB,oBAA8B;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE;AAAA,EACE,uDAAC;AAAA,IACE;AAAA,OAAC,CAAC,YACD,4CAA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AA,GAAC,CAAC,YACD;AAAA,IAAC,iBAAAA;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,MAC3D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,EAED,CAAC,CAAC,aACD;AAAA,IAAC,iBAAAA;AAAA,IAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,MAC5D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,GAEJ,GACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,8BAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,8BAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,8BAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,8BAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,8BAAU,MAAM;AAAA,IAC5B,UAAU,8BAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,8BAAU,MAAM;AAAA,IAC3B,UAAU,8BAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,8BAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
6
6
  "names": ["DSButton"]
7
7
  }
@@ -37,35 +37,22 @@ var import_ds_icons = require("@elliemae/ds-icons");
37
37
  var import_ds_button = __toESM(require("@elliemae/ds-button"));
38
38
  var import_blocks = require("./blocks");
39
39
  const ModalHeader = ({ innerRef = null, title: headerTitle = "", onClose = () => null, toolbar = null }) => {
40
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(HeaderWrapper, {
41
- children: [
42
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.HeaderLeftSide, {
43
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Header, {
44
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Title, {
45
- children: headerTitle
46
- })
47
- })
48
- }),
49
- toolbar,
50
- toolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSeparator, {
51
- position: "initial",
52
- margin: "none",
53
- orientation: "vertical",
54
- type: "non-form"
55
- }),
56
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCloseButton, {
40
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(HeaderWrapper, { children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.HeaderLeftSide, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Title, { children: headerTitle }) }) }),
42
+ toolbar,
43
+ toolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSeparator, { position: "initial", margin: "none", orientation: "vertical", type: "non-form" }),
44
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
+ StyledCloseButton,
46
+ {
57
47
  "data-testid": "modal-slider-header-close",
58
48
  "aria-label": "Close modal slide",
59
49
  buttonType: "text",
60
- icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Close, {
61
- "aria-label": "Close modal slide",
62
- size: "s"
63
- }),
50
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Close, { "aria-label": "Close modal slide", size: "s" }),
64
51
  onClick: onClose,
65
52
  innerRef
66
- })
67
- ]
68
- });
53
+ }
54
+ )
55
+ ] });
69
56
  };
70
57
  const HeaderWrapper = import_ds_system.styled.div`
71
58
  display: flex;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => {\n return (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n innerRef={innerRef}\n />\n </HeaderWrapper>\n );\n};\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n innerRef: PropTypes.func.description('button close ref '),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;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zC,IAAO,iBAAQ;",
6
6
  "names": ["DSSeparator", "props", "DSButton"]
7
7
  }
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import React2, { useState, useEffect, useCallback } from "react";
3
+ import React2, { useState, useEffect, useCallback, useMemo } from "react";
4
4
  import { PropTypes, describe, useGetGlobalAttributes } from "@elliemae/ds-utilities";
5
+ import { debounce } from "lodash";
5
6
  import ReactDOM from "react-dom";
6
7
  import { useTheme, styled } from "@elliemae/ds-system";
7
8
  import { Grid } from "@elliemae/ds-grid";
@@ -34,6 +35,7 @@ const DSModalSlide = (props2) => {
34
35
  const [isMoving, setMoving] = useState(false);
35
36
  const [show, setShow] = useState(isOpen);
36
37
  const [width, setWidth] = useState(50);
38
+ const [height, setHeight] = useState("100%");
37
39
  const theme = useTheme();
38
40
  const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
39
41
  const globalAttrs = useGetGlobalAttributes(props2);
@@ -50,9 +52,28 @@ const DSModalSlide = (props2) => {
50
52
  }
51
53
  }, [isOpen, fullWidth, isMoving]);
52
54
  useEffect(updateShow, [isOpen, fullWidth]);
55
+ const container = getContainer();
56
+ const handleHeight = useCallback(() => {
57
+ const newHeight = overrideHeight && container.scrollHeight > container.getBoundingClientRect().height ? container.scrollHeight : container.getBoundingClientRect().height;
58
+ setHeight(newHeight);
59
+ }, [container, overrideHeight]);
60
+ const onChangeParent = useMemo(() => debounce(handleHeight, 300), [handleHeight]);
61
+ useEffect(() => {
62
+ const resizeObserver = new ResizeObserver(() => onChangeParent());
63
+ if (container) {
64
+ resizeObserver.observe(container);
65
+ if (!container.style.position) {
66
+ container.style.position = "relative";
67
+ }
68
+ onChangeParent();
69
+ }
70
+ return () => {
71
+ if (container)
72
+ resizeObserver.unobserve(container);
73
+ };
74
+ }, [container, onChangeParent]);
53
75
  if (!show)
54
76
  return null;
55
- const container = getContainer();
56
77
  if (!container)
57
78
  return null;
58
79
  const handleAnimationEnd = () => {
@@ -60,74 +81,63 @@ const DSModalSlide = (props2) => {
60
81
  if (!isOpen)
61
82
  setShow(isOpen);
62
83
  };
63
- let { height } = container.getBoundingClientRect();
64
- if (overrideHeight && container.scrollHeight > height) {
65
- height = container.scrollHeight;
66
- }
67
- if (!container.style.position) {
68
- container.style.position = "relative";
69
- }
70
84
  return ReactDOM.createPortal(
71
- /* @__PURE__ */ jsx(Wrapper, {
72
- ...globalAttrs,
73
- classProps: {
74
- show: isOpen,
75
- centered
76
- },
77
- style: {
78
- "--height": height,
79
- "--fade-in": fadeIn,
80
- "--fade-out": fadeOut,
81
- "--width": width
82
- },
83
- children: /* @__PURE__ */ jsx(Overlay, {
85
+ /* @__PURE__ */ jsx(
86
+ Wrapper,
87
+ {
88
+ ...globalAttrs,
84
89
  classProps: {
85
- show: isOpen
90
+ show: isOpen,
91
+ centered
86
92
  },
87
- children: /* @__PURE__ */ jsx(Content, {
88
- onAnimationEnd: handleAnimationEnd,
89
- classProps: {
90
- show: isOpen
91
- },
92
- children: /* @__PURE__ */ jsxs(Grid, {
93
- style: {
94
- height: "100%",
95
- width: "100%",
96
- maxHeight: "100%",
97
- overflow: "hidden",
98
- "-webkit-backface-visibility": "hidden",
99
- "backface-visibility": "hidden",
100
- "-webkit-transform-style": "preserve-3d"
93
+ style: {
94
+ "--height": height,
95
+ "--fade-in": fadeIn,
96
+ "--fade-out": fadeOut,
97
+ "--width": width
98
+ },
99
+ children: /* @__PURE__ */ jsx(
100
+ Overlay,
101
+ {
102
+ classProps: {
103
+ show: isOpen
101
104
  },
102
- rows: contentRows,
103
- "data-testid": "ds-modal-slide",
104
- children: [
105
- header && React2.cloneElement(header, { fullWidth }),
106
- header && /* @__PURE__ */ jsx(DSSeparator, {
107
- position: "initial",
108
- type: "non-form"
109
- }),
110
- /* @__PURE__ */ jsx(Grid, {
111
- style: { overflow: "hidden" },
112
- children: /* @__PURE__ */ jsx(StyledWrapper, {
113
- ref: innerRef,
114
- tabIndex: 0,
115
- role: "contentinfo",
116
- children: /* @__PURE__ */ jsx(ActualContent, {
117
- children
118
- })
119
- })
120
- }),
121
- footer && /* @__PURE__ */ jsx(DSSeparator, {
122
- position: "initial",
123
- type: "non-form"
124
- }),
125
- footer
126
- ]
127
- })
128
- })
129
- })
130
- }),
105
+ children: /* @__PURE__ */ jsx(
106
+ Content,
107
+ {
108
+ onAnimationEnd: handleAnimationEnd,
109
+ classProps: {
110
+ show: isOpen
111
+ },
112
+ children: /* @__PURE__ */ jsxs(
113
+ Grid,
114
+ {
115
+ style: {
116
+ height: "100%",
117
+ width: "100%",
118
+ maxHeight: "100%",
119
+ overflow: "hidden",
120
+ "-webkit-backface-visibility": "hidden",
121
+ "backface-visibility": "hidden",
122
+ "-webkit-transform-style": "preserve-3d"
123
+ },
124
+ rows: contentRows,
125
+ "data-testid": "ds-modal-slide",
126
+ children: [
127
+ header && React2.cloneElement(header, { fullWidth }),
128
+ header && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
129
+ /* @__PURE__ */ jsx(Grid, { style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(StyledWrapper, { ref: innerRef, tabIndex: 0, role: "contentinfo", children: /* @__PURE__ */ jsx(ActualContent, { children }) }) }),
130
+ footer && /* @__PURE__ */ jsx(DSSeparator, { position: "initial", type: "non-form" }),
131
+ footer
132
+ ]
133
+ }
134
+ )
135
+ }
136
+ )
137
+ }
138
+ )
139
+ }
140
+ ),
131
141
  container
132
142
  );
133
143
  };
@@ -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, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\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 ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n\n const globalAttrs = useGetGlobalAttributes(props);\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 {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiGb,SAca,KAdb;A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AAA,oBAAe;AAAA,mBAAS;AAAA,iBAC3B;AAAA,eACF;AAAA,cACC,UAAU,oBAAC;AAAA,gBAAY,UAAS;AAAA,gBAAU,MAAK;AAAA,eAAW;AAAA,cAC1D;AAAA;AAAA,WACH;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,QAAQ;AAAA,EAIZ,UAAU,UAAU,KAAK,YAAY,uCAAuC;AAAA,EAI5E,QAAQ,UAAU,KAAK,YAAY,sCAAsC;AAAA,EAIzE,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,GAAG,CAAC,EAAE,WAAW;AAAA,IAC7F;AAAA,EACF;AAAA,EAIA,WAAW,UAAU,KAAK,YAAY,gDAAgD;AAAA,EAItF,QAAQ,UAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,UAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,UAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport { debounce } from 'lodash';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const [height, setHeight] = useState('100%');\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n const globalAttrs = useGetGlobalAttributes(props);\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 const container = getContainer();\n\n const handleHeight = useCallback(() => {\n const newHeight =\n overrideHeight && container.scrollHeight > container.getBoundingClientRect().height\n ? container.scrollHeight\n : container.getBoundingClientRect().height;\n setHeight(newHeight);\n }, [container, overrideHeight]);\n\n const onChangeParent = useMemo(() => debounce(handleHeight, 300), [handleHeight]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => onChangeParent());\n if (container) {\n resizeObserver.observe(container);\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n onChangeParent();\n }\n return () => {\n if (container) resizeObserver.unobserve(container);\n };\n }, [container, onChangeParent]);\n\n if (!show) return null;\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n return ReactDOM.createPortal(\n <Wrapper\n {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DS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c;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
6
6
  "names": ["React", "props"]
7
7
  }
@@ -14,28 +14,30 @@ const ModalFooter = ({
14
14
  rejectProps = {
15
15
  disabled: false
16
16
  }
17
- }) => /* @__PURE__ */ jsx(Fragment, {
18
- children: /* @__PURE__ */ jsxs(FooterWrapper, {
19
- children: [
20
- !!onReject && /* @__PURE__ */ jsx(DSButton, {
21
- buttonType: "secondary",
22
- className: "action-reject",
23
- containerProps: { "data-testid": "modal-footer-reject-btn" },
24
- labelText: rejectLabel,
25
- onClick: onReject,
26
- ...rejectProps
27
- }),
28
- !!onConfirm && /* @__PURE__ */ jsx(DSButton, {
29
- buttonType: "primary",
30
- className: "action-confirm",
31
- containerProps: { "data-testid": "modal-footer-confirm-btn" },
32
- labelText: confirmLabel,
33
- onClick: onConfirm,
34
- ...confirmProps
35
- })
36
- ]
37
- })
38
- });
17
+ }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(FooterWrapper, { children: [
18
+ !!onReject && /* @__PURE__ */ jsx(
19
+ DSButton,
20
+ {
21
+ buttonType: "secondary",
22
+ className: "action-reject",
23
+ containerProps: { "data-testid": "modal-footer-reject-btn" },
24
+ labelText: rejectLabel,
25
+ onClick: onReject,
26
+ ...rejectProps
27
+ }
28
+ ),
29
+ !!onConfirm && /* @__PURE__ */ jsx(
30
+ DSButton,
31
+ {
32
+ buttonType: "primary",
33
+ className: "action-confirm",
34
+ containerProps: { "data-testid": "modal-footer-confirm-btn" },
35
+ labelText: confirmLabel,
36
+ onClick: onConfirm,
37
+ ...confirmProps
38
+ }
39
+ )
40
+ ] }) });
39
41
  const props = {
40
42
  confirmLabel: PropTypes.string.description("Confirm Label"),
41
43
  rejectLabel: PropTypes.string.description("Reject Label"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Footer.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACiBrB,mBAGM,KAFJ,YADF;AAhBF,SAAS,WAAW,gBAAgB;AACpC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,qBAAqB;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE,gCACE,+BAAC,iBACE;AAAA,GAAC,CAAC,YACD;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,MAC3D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,EAED,CAAC,CAAC,aACD;AAAA,IAAC;AAAA;AAAA,MACC,YAAW;AAAA,MACX,WAAU;AAAA,MACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,MAC5D,WAAW;AAAA,MACX,SAAS;AAAA,MACR,GAAG;AAAA;AAAA,EACN;AAAA,GAEJ,GACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,UAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,UAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,UAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,UAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,UAAU,MAAM;AAAA,IAC5B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,UAAU,MAAM;AAAA,IAC3B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
6
6
  "names": []
7
7
  }
@@ -7,35 +7,22 @@ import { Close } from "@elliemae/ds-icons";
7
7
  import DSButton from "@elliemae/ds-button";
8
8
  import { Header, HeaderLeftSide, Title } from "./blocks";
9
9
  const ModalHeader = ({ innerRef = null, title: headerTitle = "", onClose = () => null, toolbar = null }) => {
10
- return /* @__PURE__ */ jsxs(HeaderWrapper, {
11
- children: [
12
- /* @__PURE__ */ jsx(HeaderLeftSide, {
13
- children: /* @__PURE__ */ jsx(Header, {
14
- children: /* @__PURE__ */ jsx(Title, {
15
- children: headerTitle
16
- })
17
- })
18
- }),
19
- toolbar,
20
- toolbar && /* @__PURE__ */ jsx(StyledSeparator, {
21
- position: "initial",
22
- margin: "none",
23
- orientation: "vertical",
24
- type: "non-form"
25
- }),
26
- /* @__PURE__ */ jsx(StyledCloseButton, {
10
+ return /* @__PURE__ */ jsxs(HeaderWrapper, { children: [
11
+ /* @__PURE__ */ jsx(HeaderLeftSide, { children: /* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsx(Title, { children: headerTitle }) }) }),
12
+ toolbar,
13
+ toolbar && /* @__PURE__ */ jsx(StyledSeparator, { position: "initial", margin: "none", orientation: "vertical", type: "non-form" }),
14
+ /* @__PURE__ */ jsx(
15
+ StyledCloseButton,
16
+ {
27
17
  "data-testid": "modal-slider-header-close",
28
18
  "aria-label": "Close modal slide",
29
19
  buttonType: "text",
30
- icon: /* @__PURE__ */ jsx(Close, {
31
- "aria-label": "Close modal slide",
32
- size: "s"
33
- }),
20
+ icon: /* @__PURE__ */ jsx(Close, { "aria-label": "Close modal slide", size: "s" }),
34
21
  onClick: onClose,
35
22
  innerRef
36
- })
37
- ]
38
- });
23
+ }
24
+ )
25
+ ] });
39
26
  };
40
27
  const HeaderWrapper = styled.div`
41
28
  display: flex;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Header.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => {\n return (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n innerRef={innerRef}\n />\n </HeaderWrapper>\n );\n};\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n innerRef: PropTypes.func.description('button close ref '),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACUnB,SAGM,KAHN;AATJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,cAAc;AACvB,OAAO,iBAAiB;AACxB,SAAS,aAAa;AACtB,OAAO,cAAc;AACrB,SAAS,QAAQ,gBAAgB,aAAa;AAE9C,MAAM,cAAc,CAAC,EAAE,WAAW,MAAM,OAAO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,gBAAgB,aAAa;AAE9C,MAAM,cAAc,CAAC,EAAE,WAAW,MAAM,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,KAAK,MAAM;AAC1G,SACE,qBAAC,iBACC;AAAA,wBAAC,kBACC,8BAAC,UACC,8BAAC,SAAO,uBAAY,GACtB,GACF;AAAA,IACC;AAAA,IACA,WAAW,oBAAC,mBAAgB,UAAS,WAAU,QAAO,QAAO,aAAY,YAAW,MAAK,YAAW;AAAA,IACrG;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,oBAAC,SAAM,cAAW,qBAAoB,MAAK,KAAI;AAAA,QACrD,SAAS;AAAA,QACT;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,kBAAkB,OAAO,WAAW;AAAA,aAC7B,CAACA,WAAUA,OAAM,MAAM,MAAM;AAAA;AAG1C,MAAM,oBAAoB,OAAO,QAAQ;AAAA,YAC7B,CAACA,WAAUA,OAAM,MAAM,MAAM;AAAA;AAGzC,MAAM,QAAQ;AAAA,EAEZ,SAAS,UAAU,KAAK,YAAY,yBAAyB;AAAA,EAE7D,SAAS,UAAU,KAAK,YAAY,0BAA0B;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,aAAa;AAAA,EACjD,UAAU,UAAU,KAAK,YAAY,mBAAmB;AAC1D;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
6
6
  "names": ["props"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-modal-slide",
3
- "version": "3.12.0-rc.2",
3
+ "version": "3.12.0-rc.21",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Modal Slide",
6
6
  "files": [
@@ -51,13 +51,13 @@
51
51
  "indent": 4
52
52
  },
53
53
  "dependencies": {
54
- "@elliemae/ds-button": "3.12.0-rc.2",
55
- "@elliemae/ds-classnames": "3.12.0-rc.2",
56
- "@elliemae/ds-grid": "3.12.0-rc.2",
57
- "@elliemae/ds-icons": "3.12.0-rc.2",
58
- "@elliemae/ds-separator": "3.12.0-rc.2",
59
- "@elliemae/ds-system": "3.12.0-rc.2",
60
- "@elliemae/ds-utilities": "3.12.0-rc.2"
54
+ "@elliemae/ds-button": "3.12.0-rc.21",
55
+ "@elliemae/ds-grid": "3.12.0-rc.21",
56
+ "@elliemae/ds-classnames": "3.12.0-rc.21",
57
+ "@elliemae/ds-icons": "3.12.0-rc.21",
58
+ "@elliemae/ds-system": "3.12.0-rc.21",
59
+ "@elliemae/ds-utilities": "3.12.0-rc.21",
60
+ "@elliemae/ds-separator": "3.12.0-rc.21"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@testing-library/react": "~12.1.3",