@elliemae/ds-modal-slide 2.2.0-alpha.3 → 3.0.0-next.0
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.
- package/cjs/DSModalSlide.js +135 -111
- package/cjs/components/Footer.js +97 -77
- package/cjs/components/Header.js +65 -74
- package/cjs/components/blocks.js +52 -63
- package/cjs/index.js +17 -40
- package/esm/DSModalSlide.js +113 -75
- package/esm/components/Footer.js +82 -44
- package/esm/components/Header.js +52 -44
- package/esm/components/blocks.js +41 -36
- package/esm/index.js +3 -11
- package/package.json +7 -7
- package/types/index.d.ts +1 -1
- package/cjs/DSModalSlide.js.map +0 -7
- package/cjs/components/Footer.js.map +0 -7
- package/cjs/components/Header.js.map +0 -7
- package/cjs/components/blocks.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/esm/DSModalSlide.js.map +0 -7
- package/esm/components/Footer.js.map +0 -7
- package/esm/components/Header.js.map +0 -7
- package/esm/components/blocks.js.map +0 -7
- package/esm/index.js.map +0 -7
package/cjs/DSModalSlide.js
CHANGED
|
@@ -1,152 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
isOpen = false,
|
|
48
|
-
children,
|
|
49
|
-
getContainer,
|
|
50
|
-
centered = false,
|
|
51
|
-
fullWidth = false,
|
|
52
|
-
header = null,
|
|
53
|
-
footer = null,
|
|
54
|
-
fadeOut = 1500,
|
|
55
|
-
fadeIn = 1500,
|
|
56
|
-
overrideHeight = false
|
|
57
|
-
}) => {
|
|
58
|
-
const [isMoving, setMoving] = (0, import_react.useState)(false);
|
|
59
|
-
const [show, setShow] = (0, import_react.useState)(isOpen);
|
|
60
|
-
const [width, setWidth] = (0, import_react.useState)(50);
|
|
61
|
-
const theme = (0, import_ds_system.useTheme)();
|
|
62
|
-
const contentRows = [...header ? [theme.space.m] : [], "0px", "auto", "0px", ...footer ? [theme.space.m] : []];
|
|
63
|
-
const updateShow = (0, import_react.useCallback)(() => {
|
|
64
|
-
if (fullWidth)
|
|
65
|
-
setWidth(100);
|
|
66
|
-
else
|
|
67
|
-
setWidth(50);
|
|
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
|
+
|
|
68
47
|
if (isOpen !== show) {
|
|
69
48
|
setMoving(true);
|
|
49
|
+
|
|
70
50
|
if (isOpen) {
|
|
71
51
|
setShow(isOpen);
|
|
72
52
|
}
|
|
73
53
|
}
|
|
74
54
|
}, [isOpen, fullWidth, isMoving]);
|
|
75
|
-
|
|
76
|
-
if (!show)
|
|
77
|
-
return null;
|
|
55
|
+
React.useEffect(updateShow, [isOpen, fullWidth]);
|
|
56
|
+
if (!show) return null;
|
|
78
57
|
const container = getContainer();
|
|
79
|
-
if (!container)
|
|
80
|
-
|
|
58
|
+
if (!container) return null;
|
|
59
|
+
|
|
81
60
|
const handleAnimationEnd = () => {
|
|
82
61
|
setMoving(false);
|
|
83
|
-
if (!isOpen)
|
|
84
|
-
setShow(isOpen);
|
|
62
|
+
if (!isOpen) setShow(isOpen);
|
|
85
63
|
};
|
|
86
|
-
|
|
64
|
+
|
|
65
|
+
let {
|
|
66
|
+
height
|
|
67
|
+
} = container.getBoundingClientRect();
|
|
68
|
+
|
|
87
69
|
if (overrideHeight && container.scrollHeight > height) {
|
|
88
70
|
height = container.scrollHeight;
|
|
89
71
|
}
|
|
72
|
+
|
|
90
73
|
if (!container.style.position) {
|
|
91
|
-
container.style.position =
|
|
74
|
+
container.style.position = 'relative';
|
|
92
75
|
}
|
|
93
|
-
|
|
76
|
+
|
|
77
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/_jsx__default["default"](blocks.Wrapper, {
|
|
94
78
|
classProps: {
|
|
95
79
|
show: isOpen,
|
|
96
80
|
centered
|
|
97
81
|
},
|
|
98
82
|
style: {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
83
|
+
'--height': height,
|
|
84
|
+
'--fade-in': fadeIn,
|
|
85
|
+
'--fade-out': fadeOut,
|
|
86
|
+
'--width': width
|
|
103
87
|
}
|
|
104
|
-
},
|
|
88
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Overlay, {
|
|
105
89
|
classProps: {
|
|
106
90
|
show: isOpen
|
|
107
91
|
}
|
|
108
|
-
},
|
|
92
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.Content, {
|
|
109
93
|
onAnimationEnd: handleAnimationEnd,
|
|
110
94
|
classProps: {
|
|
111
95
|
show: isOpen
|
|
112
96
|
}
|
|
113
|
-
},
|
|
97
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
114
98
|
style: {
|
|
115
|
-
height:
|
|
116
|
-
width:
|
|
117
|
-
maxHeight:
|
|
118
|
-
overflow:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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'
|
|
122
106
|
},
|
|
123
107
|
rows: contentRows,
|
|
124
108
|
"data-testid": "ds-modal-slide"
|
|
125
|
-
},
|
|
109
|
+
}, void 0, header && /*#__PURE__*/React__default["default"].cloneElement(header, {
|
|
110
|
+
fullWidth
|
|
111
|
+
}), header && (_DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx__default["default"](DSSeparator__default["default"], {
|
|
126
112
|
position: "initial",
|
|
127
113
|
type: "non-form"
|
|
128
|
-
}),
|
|
129
|
-
style: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
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"], {
|
|
133
123
|
position: "initial",
|
|
134
124
|
type: "non-form"
|
|
135
|
-
}), footer)))), container);
|
|
125
|
+
}))), footer)))), container);
|
|
136
126
|
};
|
|
127
|
+
|
|
137
128
|
const props = {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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')
|
|
146
168
|
};
|
|
147
|
-
|
|
148
|
-
const DSModalSlideWithSchema = (0, import_react_desc.describe)(DSModalSlide);
|
|
169
|
+
const DSModalSlideWithSchema = reactDesc.describe(DSModalSlide);
|
|
149
170
|
DSModalSlideWithSchema.propTypes = props;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
171
|
+
|
|
172
|
+
exports.ModalHeader = Header["default"];
|
|
173
|
+
exports.ModalFooter = Footer["default"];
|
|
174
|
+
exports.DSModalSlide = DSModalSlide;
|
|
175
|
+
exports.DSModalSlideWithSchema = DSModalSlideWithSchema;
|
|
176
|
+
exports["default"] = DSModalSlide;
|
package/cjs/components/Footer.js
CHANGED
|
@@ -1,81 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
});
|
|
11
60
|
};
|
|
12
|
-
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var Footer_exports = {};
|
|
29
|
-
__export(Footer_exports, {
|
|
30
|
-
DSModalSlideFooterWithSchema: () => DSModalSlideFooterWithSchema,
|
|
31
|
-
default: () => Footer_default
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
36
|
-
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
37
|
-
var import_blocks = __toESM(require("./blocks"));
|
|
38
|
-
const ModalFooter = ({
|
|
39
|
-
confirmLabel = "Confirm",
|
|
40
|
-
rejectLabel = "Cancel",
|
|
41
|
-
onConfirm,
|
|
42
|
-
onReject,
|
|
43
|
-
confirmProps = {
|
|
44
|
-
disabled: false
|
|
45
|
-
},
|
|
46
|
-
rejectProps = {
|
|
47
|
-
disabled: false
|
|
48
|
-
}
|
|
49
|
-
}) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.FooterWrapper, null, !!onReject && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
50
|
-
buttonType: "secondary",
|
|
51
|
-
className: "action-reject",
|
|
52
|
-
containerProps: { "data-testid": "modal-footer-reject-btn" },
|
|
53
|
-
labelText: rejectLabel,
|
|
54
|
-
onClick: onReject,
|
|
55
|
-
...rejectProps
|
|
56
|
-
}), !!onConfirm && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
57
|
-
buttonType: "primary",
|
|
58
|
-
className: "action-confirm",
|
|
59
|
-
containerProps: { "data-testid": "modal-footer-confirm-btn" },
|
|
60
|
-
labelText: confirmLabel,
|
|
61
|
-
onClick: onConfirm,
|
|
62
|
-
...confirmProps
|
|
63
|
-
})));
|
|
61
|
+
|
|
64
62
|
const props = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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.')
|
|
75
96
|
};
|
|
76
|
-
|
|
77
|
-
const DSModalSlideFooterWithSchema = (0, import_react_desc.describe)(ModalFooter);
|
|
97
|
+
const DSModalSlideFooterWithSchema = reactDesc.describe(ModalFooter);
|
|
78
98
|
DSModalSlideFooterWithSchema.propTypes = props;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
99
|
+
|
|
100
|
+
exports.DSModalSlideFooterWithSchema = DSModalSlideFooterWithSchema;
|
|
101
|
+
exports["default"] = ModalFooter;
|
package/cjs/components/Header.js
CHANGED
|
@@ -1,78 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
-
var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
|
|
38
|
-
var import_ds_icons = __toESM(require("@elliemae/ds-icons"));
|
|
39
|
-
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
40
|
-
var import_blocks = __toESM(require("./blocks"));
|
|
41
|
-
const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */ import_react.default.createElement(HeaderWrapper, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.HeaderLeftSide, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.Header, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.Title, null, headerTitle))), toolbar, toolbar && /* @__PURE__ */ import_react.default.createElement(StyledSeparator, {
|
|
42
|
-
position: "initial",
|
|
43
|
-
margin: "none",
|
|
44
|
-
orientation: "vertical",
|
|
45
|
-
type: "non-form"
|
|
46
|
-
}), /* @__PURE__ */ import_react.default.createElement(StyledCloseButton, {
|
|
47
|
-
"data-testid": "modal-slider-header-close",
|
|
48
|
-
"aria-label": "Close modal slide",
|
|
49
|
-
buttonType: "text",
|
|
50
|
-
icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Close, {
|
|
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",
|
|
51
36
|
"aria-label": "Close modal slide",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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);
|
|
68
55
|
const props = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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')
|
|
72
64
|
};
|
|
73
|
-
|
|
74
|
-
const DSModalSlideHeaderWithSchema = (0, import_react_desc.describe)(ModalHeader);
|
|
65
|
+
const DSModalSlideHeaderWithSchema = reactDesc.describe(ModalHeader);
|
|
75
66
|
DSModalSlideHeaderWithSchema.propTypes = props;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
|
|
68
|
+
exports.DSModalSlideHeaderWithSchema = DSModalSlideHeaderWithSchema;
|
|
69
|
+
exports["default"] = ModalHeader;
|