@elliemae/ds-modal-slide 2.3.0-alpha.9 → 2.3.0-next.3

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.
Files changed (37) hide show
  1. package/cjs/DSModalSlide.js +176 -0
  2. package/cjs/components/Footer.js +101 -0
  3. package/cjs/components/Header.js +69 -0
  4. package/cjs/components/blocks.js +54 -0
  5. package/cjs/index.js +17 -0
  6. package/esm/DSModalSlide.js +161 -0
  7. package/esm/components/Footer.js +90 -0
  8. package/esm/components/Header.js +57 -0
  9. package/esm/components/blocks.js +41 -0
  10. package/esm/index.js +3 -0
  11. package/package.json +30 -32
  12. package/{dist/types → types}/DSModalSlide.d.ts +0 -0
  13. package/{dist/types → types}/components/Footer.d.ts +0 -0
  14. package/{dist/types → types}/components/Header.d.ts +0 -0
  15. package/{dist/types → types}/components/blocks.d.ts +0 -0
  16. package/{dist/types → types}/index.d.ts +1 -1
  17. package/{dist/types → types}/tests/DSModalSlide.test.d.ts +0 -0
  18. package/dist/cjs/DSModalSlide.js +0 -152
  19. package/dist/cjs/DSModalSlide.js.map +0 -7
  20. package/dist/cjs/components/Footer.js +0 -81
  21. package/dist/cjs/components/Footer.js.map +0 -7
  22. package/dist/cjs/components/Header.js +0 -78
  23. package/dist/cjs/components/Header.js.map +0 -7
  24. package/dist/cjs/components/blocks.js +0 -65
  25. package/dist/cjs/components/blocks.js.map +0 -7
  26. package/dist/cjs/index.js +0 -40
  27. package/dist/cjs/index.js.map +0 -7
  28. package/dist/esm/DSModalSlide.js +0 -123
  29. package/dist/esm/DSModalSlide.js.map +0 -7
  30. package/dist/esm/components/Footer.js +0 -52
  31. package/dist/esm/components/Footer.js.map +0 -7
  32. package/dist/esm/components/Header.js +0 -49
  33. package/dist/esm/components/Header.js.map +0 -7
  34. package/dist/esm/components/blocks.js +0 -36
  35. package/dist/esm/components/blocks.js.map +0 -7
  36. package/dist/esm/index.js +0 -11
  37. package/dist/esm/index.js.map +0 -7
@@ -0,0 +1,176 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('core-js/modules/web.dom-collections.iterator.js');
7
+ var React = require('react');
8
+ var reactDesc = require('react-desc');
9
+ var ReactDOM = require('react-dom');
10
+ var dsSystem = require('@elliemae/ds-system');
11
+ var dsGrid = require('@elliemae/ds-grid');
12
+ var DSSeparator = require('@elliemae/ds-separator');
13
+ var blocks = require('./components/blocks.js');
14
+ var Header = require('./components/Header.js');
15
+ var Footer = require('./components/Footer.js');
16
+
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
+
19
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
20
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
+ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
22
+ var DSSeparator__default = /*#__PURE__*/_interopDefaultLegacy(DSSeparator);
23
+
24
+ var _DSSeparator, _DSSeparator2;
25
+
26
+ const DSModalSlide = _ref => {
27
+ let {
28
+ isOpen = false,
29
+ children,
30
+ getContainer,
31
+ centered = false,
32
+ fullWidth = false,
33
+ header = null,
34
+ footer = null,
35
+ fadeOut = 1500,
36
+ fadeIn = 1500,
37
+ overrideHeight = false
38
+ } = _ref;
39
+ const [isMoving, setMoving] = React.useState(false);
40
+ const [show, setShow] = React.useState(isOpen);
41
+ const [width, setWidth] = React.useState(50);
42
+ const theme = dsSystem.useTheme();
43
+ const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];
44
+ const updateShow = React.useCallback(() => {
45
+ if (fullWidth) setWidth(100);else setWidth(50);
46
+
47
+ if (isOpen !== show) {
48
+ setMoving(true);
49
+
50
+ if (isOpen) {
51
+ setShow(isOpen);
52
+ }
53
+ }
54
+ }, [isOpen, fullWidth, isMoving]);
55
+ React.useEffect(updateShow, [isOpen, fullWidth]);
56
+ if (!show) return null;
57
+ const container = getContainer();
58
+ if (!container) return null;
59
+
60
+ const handleAnimationEnd = () => {
61
+ setMoving(false);
62
+ if (!isOpen) setShow(isOpen);
63
+ };
64
+
65
+ let {
66
+ height
67
+ } = container.getBoundingClientRect();
68
+
69
+ if (overrideHeight && container.scrollHeight > height) {
70
+ height = container.scrollHeight;
71
+ }
72
+
73
+ if (!container.style.position) {
74
+ container.style.position = 'relative';
75
+ }
76
+
77
+ return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/_jsx__default["default"](blocks.Wrapper, {
78
+ classProps: {
79
+ show: isOpen,
80
+ centered
81
+ },
82
+ style: {
83
+ '--height': height,
84
+ '--fade-in': fadeIn,
85
+ '--fade-out': fadeOut,
86
+ '--width': width
87
+ }
88
+ }, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Overlay, {
89
+ classProps: {
90
+ show: isOpen
91
+ }
92
+ }, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Content, {
93
+ onAnimationEnd: handleAnimationEnd,
94
+ classProps: {
95
+ show: isOpen
96
+ }
97
+ }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
98
+ style: {
99
+ height: '100%',
100
+ width: '100%',
101
+ maxHeight: '100%',
102
+ overflow: 'hidden',
103
+ '-webkit-backface-visibility': 'hidden',
104
+ 'backface-visibility': 'hidden',
105
+ '-webkit-transform-style': 'preserve-3d'
106
+ },
107
+ rows: contentRows,
108
+ "data-testid": "ds-modal-slide"
109
+ }, void 0, header && /*#__PURE__*/React__default["default"].cloneElement(header, {
110
+ fullWidth
111
+ }), header && (_DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx__default["default"](DSSeparator__default["default"], {
112
+ position: "initial",
113
+ type: "non-form"
114
+ }))), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
115
+ style: {
116
+ overflow: 'hidden'
117
+ }
118
+ }, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
119
+ style: {
120
+ overflow: 'auto'
121
+ }
122
+ }, void 0, /*#__PURE__*/_jsx__default["default"](blocks.ActualContent, {}, void 0, children))), footer && (_DSSeparator2 || (_DSSeparator2 = /*#__PURE__*/_jsx__default["default"](DSSeparator__default["default"], {
123
+ position: "initial",
124
+ type: "non-form"
125
+ }))), footer)))), container);
126
+ };
127
+
128
+ const props = {
129
+ /**
130
+ * If the modal slide is centered or not
131
+ */
132
+ centered: reactDesc.PropTypes.bool.description('If the modal slide is centered or not'),
133
+
134
+ /**
135
+ * If the modal slide is visible or not
136
+ */
137
+ isOpen: reactDesc.PropTypes.bool.description('If the modal slide is visible or not'),
138
+
139
+ /**
140
+ * Main content of the modal
141
+ */
142
+ children: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.element, reactDesc.PropTypes.string, reactDesc.PropTypes.any]).isRequired.description('Main content of the modal'),
143
+
144
+ /**
145
+ * If the modal slide takes the full width or not
146
+ */
147
+ fullWidth: reactDesc.PropTypes.bool.description('If the modal slide takes the full width or not'),
148
+
149
+ /**
150
+ * If the modal slide has a header, only available for full width option
151
+ */
152
+ header: reactDesc.PropTypes.element.description('If the modal slide has a header, only available for full width option'),
153
+
154
+ /**
155
+ * Ratio of fade out
156
+ */
157
+ fadeOut: reactDesc.PropTypes.number.description('Ratio of fade out'),
158
+
159
+ /**
160
+ * Ratio of fade in
161
+ */
162
+ fadeIn: reactDesc.PropTypes.number.description('Ratio of fade in'),
163
+
164
+ /**
165
+ * Override the panel height to scroll height of the container
166
+ */
167
+ overrideHeight: reactDesc.PropTypes.bool.description('Override the panel height to scroll height of the container')
168
+ };
169
+ const DSModalSlideWithSchema = reactDesc.describe(DSModalSlide);
170
+ DSModalSlideWithSchema.propTypes = props;
171
+
172
+ exports.ModalHeader = Header["default"];
173
+ exports.ModalFooter = Footer["default"];
174
+ exports.DSModalSlide = DSModalSlide;
175
+ exports.DSModalSlideWithSchema = DSModalSlideWithSchema;
176
+ exports["default"] = DSModalSlide;
@@ -0,0 +1,101 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('core-js/modules/esnext.async-iterator.filter.js');
6
+ require('core-js/modules/esnext.iterator.constructor.js');
7
+ require('core-js/modules/esnext.iterator.filter.js');
8
+ require('core-js/modules/esnext.async-iterator.for-each.js');
9
+ require('core-js/modules/esnext.iterator.for-each.js');
10
+ var _jsx = require('@babel/runtime/helpers/jsx');
11
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
12
+ require('react');
13
+ var reactDesc = require('react-desc');
14
+ var DSButton = require('@elliemae/ds-button');
15
+ var blocks = require('./blocks.js');
16
+ var jsxRuntime = require('react/jsx-runtime');
17
+
18
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
+
20
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
21
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
22
+ var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
23
+
24
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
25
+
26
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
27
+
28
+ const ModalFooter = _ref => {
29
+ let {
30
+ confirmLabel = 'Confirm',
31
+ rejectLabel = 'Cancel',
32
+ onConfirm,
33
+ onReject,
34
+ confirmProps = {
35
+ disabled: false
36
+ },
37
+ rejectProps = {
38
+ disabled: false
39
+ }
40
+ } = _ref;
41
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
42
+ children: /*#__PURE__*/_jsx__default["default"](blocks.FooterWrapper, {}, void 0, !!onReject && /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread({
43
+ buttonType: "secondary",
44
+ className: "action-reject",
45
+ containerProps: {
46
+ 'data-testid': 'modal-footer-reject-btn'
47
+ },
48
+ labelText: rejectLabel,
49
+ onClick: onReject
50
+ }, rejectProps)), !!onConfirm && /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread({
51
+ buttonType: "primary",
52
+ className: "action-confirm",
53
+ containerProps: {
54
+ 'data-testid': 'modal-footer-confirm-btn'
55
+ },
56
+ labelText: confirmLabel,
57
+ onClick: onConfirm
58
+ }, confirmProps)))
59
+ });
60
+ };
61
+
62
+ const props = {
63
+ /**
64
+ * Confirm Label
65
+ */
66
+ confirmLabel: reactDesc.PropTypes.string.description('Confirm Label'),
67
+
68
+ /**
69
+ * Reject Label
70
+ */
71
+ rejectLabel: reactDesc.PropTypes.string.description('Reject Label'),
72
+
73
+ /**
74
+ * Callback
75
+ */
76
+ onConfirm: reactDesc.PropTypes.func.description('Callback'),
77
+
78
+ /**
79
+ * Callback
80
+ */
81
+ onReject: reactDesc.PropTypes.func.description('Callback'),
82
+
83
+ /**
84
+ * Extra DSButton props for confirm btn.
85
+ */
86
+ confirmProps: reactDesc.PropTypes.shape({
87
+ disabled: reactDesc.PropTypes.bool
88
+ }).description('Extra DSButton props for confirm btn.'),
89
+
90
+ /**
91
+ * Extra DSButton props for reject btn.
92
+ */
93
+ rejectProps: reactDesc.PropTypes.shape({
94
+ disabled: reactDesc.PropTypes.bool
95
+ }).description('Extra DSButton props for reject btn.')
96
+ };
97
+ const DSModalSlideFooterWithSchema = reactDesc.describe(ModalFooter);
98
+ DSModalSlideFooterWithSchema.propTypes = props;
99
+
100
+ exports.DSModalSlideFooterWithSchema = DSModalSlideFooterWithSchema;
101
+ exports["default"] = ModalFooter;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('react');
7
+ var reactDesc = require('react-desc');
8
+ var styled = require('styled-components');
9
+ var DSSeparator = require('@elliemae/ds-separator');
10
+ var dsIcons = require('@elliemae/ds-icons');
11
+ var DSButton = require('@elliemae/ds-button');
12
+ var blocks = require('./blocks.js');
13
+
14
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
+
16
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
17
+ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
18
+ var DSSeparator__default = /*#__PURE__*/_interopDefaultLegacy(DSSeparator);
19
+ var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
20
+
21
+ var _StyledSeparator, _Close;
22
+
23
+ const ModalHeader = _ref => {
24
+ let {
25
+ title: headerTitle = '',
26
+ onClose = () => null,
27
+ toolbar = null
28
+ } = _ref;
29
+ return /*#__PURE__*/_jsx__default["default"](HeaderWrapper, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.HeaderLeftSide, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Header, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Title, {}, void 0, headerTitle))), toolbar, toolbar && (_StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](StyledSeparator, {
30
+ position: "initial",
31
+ margin: "none",
32
+ orientation: "vertical",
33
+ type: "non-form"
34
+ }))), /*#__PURE__*/_jsx__default["default"](StyledCloseButton, {
35
+ "data-testid": "modal-slider-header-close",
36
+ "aria-label": "Close modal slide",
37
+ buttonType: "text",
38
+ icon: _Close || (_Close = /*#__PURE__*/_jsx__default["default"](dsIcons.Close, {
39
+ "aria-label": "Close modal slide",
40
+ size: "s"
41
+ })),
42
+ onClick: onClose
43
+ }));
44
+ };
45
+
46
+ const HeaderWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
47
+ componentId: "sc-oxqqo8-0"
48
+ })(["display:flex;justify-content:space-between;width:100%;align-items:center;"]);
49
+ const StyledSeparator = /*#__PURE__*/styled__default["default"](DSSeparator__default["default"]).withConfig({
50
+ componentId: "sc-oxqqo8-1"
51
+ })(["padding:", " 0;"], props => props.theme.space.xs);
52
+ const StyledCloseButton = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
53
+ componentId: "sc-oxqqo8-2"
54
+ })(["margin:", ";"], props => props.theme.space.xs);
55
+ const props = {
56
+ /** on modal close callback */
57
+ onClose: reactDesc.PropTypes.func.description('on modal close callback'),
58
+
59
+ /** modal toolbar component */
60
+ toolbar: reactDesc.PropTypes.node.description('modal toolbar comoponent'),
61
+
62
+ /** modal title */
63
+ title: reactDesc.PropTypes.string.description('modal title')
64
+ };
65
+ const DSModalSlideHeaderWithSchema = reactDesc.describe(ModalHeader);
66
+ DSModalSlideHeaderWithSchema.propTypes = props;
67
+
68
+ exports.DSModalSlideHeaderWithSchema = DSModalSlideHeaderWithSchema;
69
+ exports["default"] = ModalHeader;
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsClassnames = require('@elliemae/ds-classnames');
6
+
7
+ const blockName = 'modal-slide';
8
+ const Wrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper', _ref => {
9
+ let {
10
+ show,
11
+ centered
12
+ } = _ref;
13
+ return {
14
+ showing: show,
15
+ disappearing: !show,
16
+ centered
17
+ };
18
+ });
19
+ const Overlay = dsClassnames.aggregatedClasses('div')(blockName, 'overlay', _ref2 => {
20
+ let {
21
+ show
22
+ } = _ref2;
23
+ return {
24
+ showing: show,
25
+ disappearing: !show
26
+ };
27
+ });
28
+ const Content = dsClassnames.aggregatedClasses('div')(blockName, 'content', _ref3 => {
29
+ let {
30
+ show
31
+ } = _ref3;
32
+ return {
33
+ showing: show,
34
+ disappearing: !show
35
+ };
36
+ });
37
+ const Title = dsClassnames.aggregatedClasses('div')(blockName, 'title', () => ({}));
38
+ const BreadcrumTitle = dsClassnames.aggregatedClasses('div')(blockName, 'breadcrum-title', () => ({}));
39
+ const HeaderLeftSide = dsClassnames.aggregatedClasses('div')(blockName, 'header-left-side', () => ({}));
40
+ const ActualContent = dsClassnames.aggregatedClasses('div')(blockName, 'actual-content', () => ({}));
41
+ const Header = dsClassnames.aggregatedClasses('div')(blockName, 'header', () => ({}));
42
+ const Footer = dsClassnames.aggregatedClasses('div')(blockName, 'footer', () => ({}));
43
+ const FooterWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'footer-wrapper', () => ({}));
44
+
45
+ exports.ActualContent = ActualContent;
46
+ exports.BreadcrumTitle = BreadcrumTitle;
47
+ exports.Content = Content;
48
+ exports.Footer = Footer;
49
+ exports.FooterWrapper = FooterWrapper;
50
+ exports.Header = Header;
51
+ exports.HeaderLeftSide = HeaderLeftSide;
52
+ exports.Overlay = Overlay;
53
+ exports.Title = Title;
54
+ exports.Wrapper = Wrapper;
package/cjs/index.js ADDED
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSModalSlide = require('./DSModalSlide.js');
6
+ var Header = require('./components/Header.js');
7
+ var Footer = require('./components/Footer.js');
8
+
9
+
10
+
11
+ exports.DSModalSlide = DSModalSlide.DSModalSlide;
12
+ exports.DSModalSlideWithSchema = DSModalSlide.DSModalSlideWithSchema;
13
+ exports["default"] = DSModalSlide.DSModalSlide;
14
+ exports.DSModalSlideHeaderWithSchema = Header.DSModalSlideHeaderWithSchema;
15
+ exports.ModalHeader = Header["default"];
16
+ exports.DSModalSlideFooterWithSchema = Footer.DSModalSlideFooterWithSchema;
17
+ exports.ModalFooter = Footer["default"];
@@ -0,0 +1,161 @@
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/web.dom-collections.iterator.js';
3
+ import React, { useState, useCallback, useEffect } from 'react';
4
+ import { PropTypes, describe } from 'react-desc';
5
+ import ReactDOM from 'react-dom';
6
+ import { useTheme } from '@elliemae/ds-system';
7
+ import { Grid } from '@elliemae/ds-grid';
8
+ import DSSeparator from '@elliemae/ds-separator';
9
+ import { Wrapper, Overlay, Content, ActualContent } from './components/blocks.js';
10
+ export { default as ModalHeader } from './components/Header.js';
11
+ export { default as ModalFooter } from './components/Footer.js';
12
+
13
+ var _DSSeparator, _DSSeparator2;
14
+
15
+ const DSModalSlide = _ref => {
16
+ let {
17
+ isOpen = false,
18
+ children,
19
+ getContainer,
20
+ centered = false,
21
+ fullWidth = false,
22
+ header = null,
23
+ footer = null,
24
+ fadeOut = 1500,
25
+ fadeIn = 1500,
26
+ overrideHeight = false
27
+ } = _ref;
28
+ const [isMoving, setMoving] = useState(false);
29
+ const [show, setShow] = useState(isOpen);
30
+ const [width, setWidth] = useState(50);
31
+ const theme = useTheme();
32
+ const contentRows = [...(header ? [theme.space.m] : []), '0px', 'auto', '0px', ...(footer ? [theme.space.m] : [])];
33
+ const updateShow = useCallback(() => {
34
+ if (fullWidth) setWidth(100);else setWidth(50);
35
+
36
+ if (isOpen !== show) {
37
+ setMoving(true);
38
+
39
+ if (isOpen) {
40
+ setShow(isOpen);
41
+ }
42
+ }
43
+ }, [isOpen, fullWidth, isMoving]);
44
+ useEffect(updateShow, [isOpen, fullWidth]);
45
+ if (!show) return null;
46
+ const container = getContainer();
47
+ if (!container) return null;
48
+
49
+ const handleAnimationEnd = () => {
50
+ setMoving(false);
51
+ if (!isOpen) setShow(isOpen);
52
+ };
53
+
54
+ let {
55
+ height
56
+ } = container.getBoundingClientRect();
57
+
58
+ if (overrideHeight && container.scrollHeight > height) {
59
+ height = container.scrollHeight;
60
+ }
61
+
62
+ if (!container.style.position) {
63
+ container.style.position = 'relative';
64
+ }
65
+
66
+ return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsx(Wrapper, {
67
+ classProps: {
68
+ show: isOpen,
69
+ centered
70
+ },
71
+ style: {
72
+ '--height': height,
73
+ '--fade-in': fadeIn,
74
+ '--fade-out': fadeOut,
75
+ '--width': width
76
+ }
77
+ }, void 0, /*#__PURE__*/_jsx(Overlay, {
78
+ classProps: {
79
+ show: isOpen
80
+ }
81
+ }, void 0, /*#__PURE__*/_jsx(Content, {
82
+ onAnimationEnd: handleAnimationEnd,
83
+ classProps: {
84
+ show: isOpen
85
+ }
86
+ }, void 0, /*#__PURE__*/_jsx(Grid, {
87
+ style: {
88
+ height: '100%',
89
+ width: '100%',
90
+ maxHeight: '100%',
91
+ overflow: 'hidden',
92
+ '-webkit-backface-visibility': 'hidden',
93
+ 'backface-visibility': 'hidden',
94
+ '-webkit-transform-style': 'preserve-3d'
95
+ },
96
+ rows: contentRows,
97
+ "data-testid": "ds-modal-slide"
98
+ }, void 0, header && /*#__PURE__*/React.cloneElement(header, {
99
+ fullWidth
100
+ }), header && (_DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx(DSSeparator, {
101
+ position: "initial",
102
+ type: "non-form"
103
+ }))), /*#__PURE__*/_jsx(Grid, {
104
+ style: {
105
+ overflow: 'hidden'
106
+ }
107
+ }, void 0, /*#__PURE__*/_jsx(Grid, {
108
+ style: {
109
+ overflow: 'auto'
110
+ }
111
+ }, void 0, /*#__PURE__*/_jsx(ActualContent, {}, void 0, children))), footer && (_DSSeparator2 || (_DSSeparator2 = /*#__PURE__*/_jsx(DSSeparator, {
112
+ position: "initial",
113
+ type: "non-form"
114
+ }))), footer)))), container);
115
+ };
116
+
117
+ const props = {
118
+ /**
119
+ * If the modal slide is centered or not
120
+ */
121
+ centered: PropTypes.bool.description('If the modal slide is centered or not'),
122
+
123
+ /**
124
+ * If the modal slide is visible or not
125
+ */
126
+ isOpen: PropTypes.bool.description('If the modal slide is visible or not'),
127
+
128
+ /**
129
+ * Main content of the modal
130
+ */
131
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description('Main content of the modal'),
132
+
133
+ /**
134
+ * If the modal slide takes the full width or not
135
+ */
136
+ fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),
137
+
138
+ /**
139
+ * If the modal slide has a header, only available for full width option
140
+ */
141
+ header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),
142
+
143
+ /**
144
+ * Ratio of fade out
145
+ */
146
+ fadeOut: PropTypes.number.description('Ratio of fade out'),
147
+
148
+ /**
149
+ * Ratio of fade in
150
+ */
151
+ fadeIn: PropTypes.number.description('Ratio of fade in'),
152
+
153
+ /**
154
+ * Override the panel height to scroll height of the container
155
+ */
156
+ overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container')
157
+ };
158
+ const DSModalSlideWithSchema = describe(DSModalSlide);
159
+ DSModalSlideWithSchema.propTypes = props;
160
+
161
+ export { DSModalSlide, DSModalSlideWithSchema, DSModalSlide as default };
@@ -0,0 +1,90 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'react';
9
+ import { PropTypes, describe } from 'react-desc';
10
+ import DSButton from '@elliemae/ds-button';
11
+ import { FooterWrapper } from './blocks.js';
12
+ import { jsx, Fragment } from 'react/jsx-runtime';
13
+
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+
18
+ const ModalFooter = _ref => {
19
+ let {
20
+ confirmLabel = 'Confirm',
21
+ rejectLabel = 'Cancel',
22
+ onConfirm,
23
+ onReject,
24
+ confirmProps = {
25
+ disabled: false
26
+ },
27
+ rejectProps = {
28
+ disabled: false
29
+ }
30
+ } = _ref;
31
+ return /*#__PURE__*/jsx(Fragment, {
32
+ children: /*#__PURE__*/_jsx(FooterWrapper, {}, void 0, !!onReject && /*#__PURE__*/jsx(DSButton, _objectSpread({
33
+ buttonType: "secondary",
34
+ className: "action-reject",
35
+ containerProps: {
36
+ 'data-testid': 'modal-footer-reject-btn'
37
+ },
38
+ labelText: rejectLabel,
39
+ onClick: onReject
40
+ }, rejectProps)), !!onConfirm && /*#__PURE__*/jsx(DSButton, _objectSpread({
41
+ buttonType: "primary",
42
+ className: "action-confirm",
43
+ containerProps: {
44
+ 'data-testid': 'modal-footer-confirm-btn'
45
+ },
46
+ labelText: confirmLabel,
47
+ onClick: onConfirm
48
+ }, confirmProps)))
49
+ });
50
+ };
51
+
52
+ const props = {
53
+ /**
54
+ * Confirm Label
55
+ */
56
+ confirmLabel: PropTypes.string.description('Confirm Label'),
57
+
58
+ /**
59
+ * Reject Label
60
+ */
61
+ rejectLabel: PropTypes.string.description('Reject Label'),
62
+
63
+ /**
64
+ * Callback
65
+ */
66
+ onConfirm: PropTypes.func.description('Callback'),
67
+
68
+ /**
69
+ * Callback
70
+ */
71
+ onReject: PropTypes.func.description('Callback'),
72
+
73
+ /**
74
+ * Extra DSButton props for confirm btn.
75
+ */
76
+ confirmProps: PropTypes.shape({
77
+ disabled: PropTypes.bool
78
+ }).description('Extra DSButton props for confirm btn.'),
79
+
80
+ /**
81
+ * Extra DSButton props for reject btn.
82
+ */
83
+ rejectProps: PropTypes.shape({
84
+ disabled: PropTypes.bool
85
+ }).description('Extra DSButton props for reject btn.')
86
+ };
87
+ const DSModalSlideFooterWithSchema = describe(ModalFooter);
88
+ DSModalSlideFooterWithSchema.propTypes = props;
89
+
90
+ export { DSModalSlideFooterWithSchema, ModalFooter as default };