@elliemae/ds-modal 2.2.0-next.4 → 2.3.0-alpha.2

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 (72) hide show
  1. package/cjs/DSModal.js +86 -184
  2. package/cjs/DSModal.js.map +7 -0
  3. package/cjs/constants.js +67 -28
  4. package/cjs/constants.js.map +7 -0
  5. package/cjs/index.js +43 -18
  6. package/cjs/index.js.map +7 -0
  7. package/cjs/v1/DSModal.js +159 -130
  8. package/cjs/v1/DSModal.js.map +7 -0
  9. package/cjs/v1/DSModalType.js +45 -7
  10. package/cjs/v1/DSModalType.js.map +7 -0
  11. package/cjs/v1/DSModalWrapper.js +76 -113
  12. package/cjs/v1/DSModalWrapper.js.map +7 -0
  13. package/cjs/v1/ModalFeedBack/ModalFeedBack.js +77 -72
  14. package/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
  15. package/cjs/v2/DSModal.js +143 -186
  16. package/cjs/v2/DSModal.js.map +7 -0
  17. package/cjs/v2/blocks.js +69 -86
  18. package/cjs/v2/blocks.js.map +7 -0
  19. package/cjs/v2/components/DecisionHeader.js +47 -37
  20. package/cjs/v2/components/DecisionHeader.js.map +7 -0
  21. package/cjs/v2/components/FeedbackIcon.js +59 -50
  22. package/cjs/v2/components/FeedbackIcon.js.map +7 -0
  23. package/cjs/v2/components/Footer.js +68 -65
  24. package/cjs/v2/components/Footer.js.map +7 -0
  25. package/cjs/v2/components/FormHeader.js +53 -46
  26. package/cjs/v2/components/FormHeader.js.map +7 -0
  27. package/cjs/v2/components/ModalContent.js +95 -111
  28. package/cjs/v2/components/ModalContent.js.map +7 -0
  29. package/cjs/v2/components/SelectionHeader.js +50 -48
  30. package/cjs/v2/components/SelectionHeader.js.map +7 -0
  31. package/cjs/v2/components/Title.js +40 -25
  32. package/cjs/v2/components/Title.js.map +7 -0
  33. package/cjs/v2/helpers.js +49 -40
  34. package/cjs/v2/helpers.js.map +7 -0
  35. package/esm/DSModal.js +26 -142
  36. package/esm/DSModal.js.map +7 -0
  37. package/esm/constants.js +38 -20
  38. package/esm/constants.js.map +7 -0
  39. package/esm/index.js +14 -4
  40. package/esm/index.js.map +7 -0
  41. package/esm/v1/DSModal.js +130 -121
  42. package/esm/v1/DSModal.js.map +7 -0
  43. package/esm/v1/DSModalType.js +16 -3
  44. package/esm/v1/DSModalType.js.map +7 -0
  45. package/esm/v1/DSModalWrapper.js +45 -105
  46. package/esm/v1/DSModalWrapper.js.map +7 -0
  47. package/esm/v1/ModalFeedBack/ModalFeedBack.js +48 -66
  48. package/esm/v1/ModalFeedBack/ModalFeedBack.js.map +7 -0
  49. package/esm/v2/DSModal.js +112 -173
  50. package/esm/v2/DSModal.js.map +7 -0
  51. package/esm/v2/blocks.js +42 -77
  52. package/esm/v2/blocks.js.map +7 -0
  53. package/esm/v2/components/DecisionHeader.js +18 -27
  54. package/esm/v2/components/DecisionHeader.js.map +7 -0
  55. package/esm/v2/components/FeedbackIcon.js +25 -36
  56. package/esm/v2/components/FeedbackIcon.js.map +7 -0
  57. package/esm/v2/components/Footer.js +39 -54
  58. package/esm/v2/components/Footer.js.map +7 -0
  59. package/esm/v2/components/FormHeader.js +24 -36
  60. package/esm/v2/components/FormHeader.js.map +7 -0
  61. package/esm/v2/components/ModalContent.js +72 -102
  62. package/esm/v2/components/ModalContent.js.map +7 -0
  63. package/esm/v2/components/SelectionHeader.js +21 -38
  64. package/esm/v2/components/SelectionHeader.js.map +7 -0
  65. package/esm/v2/components/Title.js +11 -16
  66. package/esm/v2/components/Title.js.map +7 -0
  67. package/esm/v2/helpers.js +16 -28
  68. package/esm/v2/helpers.js.map +7 -0
  69. package/package.json +8 -8
  70. package/types/DSModal.d.ts +1 -1
  71. package/types/index.d.ts +2 -3
  72. package/types/v2/DSModal.d.ts +1 -30
package/cjs/v2/DSModal.js CHANGED
@@ -1,203 +1,160 @@
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 ReactModal = require('react-modal');
15
- var dsClassnames = require('@elliemae/ds-classnames');
16
- var constants = require('../constants.js');
17
- var ModalContent = require('./components/ModalContent.js');
18
-
19
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
-
21
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
22
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
23
- var ReactModal__default = /*#__PURE__*/_interopDefaultLegacy(ReactModal);
24
-
25
- 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; }
26
-
27
- 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; }
28
-
29
- const DSModal = _ref => {
30
- let {
31
- containerProps = {},
32
- className = '',
33
- style = {},
34
- size = 'default',
35
- //
36
- modalType = constants.MODAL_TYPE_V2.INFORMATION,
37
- modalSubType = null,
38
- modalTitle = '',
39
- dataTestId = 'ds-modal',
40
- centered = false,
41
- showRejectButton = false,
42
- showClose = true,
43
- searchProps = {},
44
- // override
45
- actionsRef = () => null,
46
- additionalFooterCssClass,
47
- overridePropsConfirmButton = {},
48
- overridePropsRejectButton = {},
49
- // react modal
50
- children,
51
- isOpen = true,
52
- onClose = () => null,
53
- onAfterOpen = () => null,
54
- onConfirm = () => null,
55
- onReject = () => null,
56
- rejectLabel = 'Discard',
57
- confirmLabel = 'Save',
58
- shouldCloseOnOverlayClick = false,
59
- appElement = '#root',
60
- zIndex = 10,
61
- removePadding = false
62
- } = _ref;
63
-
64
- if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal__default["default"].setAppElement) {
65
- ReactModal__default["default"].setAppElement(appElement);
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
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 DSModal_exports = {};
29
+ __export(DSModal_exports, {
30
+ DSModalContent: () => import_ModalContent.DSModalContent,
31
+ DSModalWithSchema: () => DSModalWithSchema,
32
+ default: () => DSModal_default
33
+ });
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_react_desc = require("react-desc");
37
+ var import_react_modal = __toESM(require("react-modal"));
38
+ var import_ds_classnames = require("@elliemae/ds-classnames");
39
+ var import_constants = require("../constants");
40
+ var import_ModalContent = require("./components/ModalContent");
41
+ const DSModal = ({
42
+ containerProps = {},
43
+ className = "",
44
+ style = {},
45
+ size = "default",
46
+ modalType = import_constants.MODAL_TYPE_V2.INFORMATION,
47
+ modalSubType = null,
48
+ modalTitle = "",
49
+ dataTestId = "ds-modal",
50
+ centered = false,
51
+ showRejectButton = false,
52
+ showClose = true,
53
+ searchProps = {},
54
+ actionsRef = () => null,
55
+ additionalFooterCssClass,
56
+ overridePropsConfirmButton = {},
57
+ overridePropsRejectButton = {},
58
+ children,
59
+ isOpen = true,
60
+ onClose = () => null,
61
+ onAfterOpen = () => null,
62
+ onConfirm = () => null,
63
+ onReject = () => null,
64
+ rejectLabel = "Discard",
65
+ confirmLabel = "Save",
66
+ shouldCloseOnOverlayClick = false,
67
+ appElement = "#root",
68
+ zIndex = 10,
69
+ removePadding = false
70
+ }) => {
71
+ if (typeof document !== "undefined" && true && document && import_react_modal.default.setAppElement) {
72
+ import_react_modal.default.setAppElement(appElement);
66
73
  }
67
-
68
74
  const {
69
75
  cssClassName,
70
76
  classNameBlock,
71
77
  classNameModifier
72
- } = dsClassnames.convertPropToCssClassName('modal-v2', className, {
73
- size
74
- });
75
- return /*#__PURE__*/_jsx__default["default"](ReactModal__default["default"], {
78
+ } = (0, import_ds_classnames.convertPropToCssClassName)("modal-v2", className, { size });
79
+ return /* @__PURE__ */ import_react.default.createElement(import_react_modal.default, {
76
80
  testId: dataTestId,
77
- className: "".concat(cssClassName, " ").concat(classNameBlock("type-".concat(modalType))),
81
+ className: `${cssClassName} ${classNameBlock(`type-${modalType}`)}`,
78
82
  contentLabel: modalTitle,
79
- isOpen: isOpen,
80
- onAfterOpen: onAfterOpen,
83
+ isOpen,
84
+ onAfterOpen,
81
85
  onRequestClose: onClose,
82
- overlayClassName: "".concat(classNameBlock('overlay'), " ").concat(classNameModifier(centered ? 'center' : 'top')),
83
- shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
86
+ overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered ? "center" : "top")}`,
87
+ shouldCloseOnOverlayClick,
84
88
  style: {
85
- content: _objectSpread({}, style),
89
+ content: {
90
+ ...style
91
+ },
86
92
  overlay: {
87
- // position: 'absolute', https://jira.elliemae.io/browse/PUI-1471, the overlay should be positioned based on the browser window rather positioned absolute to its parent
88
93
  zIndex
89
94
  }
90
95
  }
91
- }, void 0, /*#__PURE__*/_jsx__default["default"](ModalContent.DSModalContent, {
92
- actionsRef: actionsRef,
93
- additionalFooterCssClass: additionalFooterCssClass,
94
- confirmLabel: confirmLabel,
95
- containerProps: containerProps,
96
- modalSubType: modalSubType,
97
- modalTitle: modalTitle,
98
- modalType: modalType,
99
- onClose: onClose,
100
- onConfirm: onConfirm,
101
- onReject: onReject,
102
- overridePropsConfirmButton: overridePropsConfirmButton,
103
- overridePropsRejectButton: overridePropsRejectButton,
104
- rejectLabel: rejectLabel,
105
- searchProps: searchProps,
106
- showClose: showClose,
107
- showRejectButton: showRejectButton,
108
- removePadding: removePadding
109
- }, void 0, children));
96
+ }, /* @__PURE__ */ import_react.default.createElement(import_ModalContent.DSModalContent, {
97
+ actionsRef,
98
+ additionalFooterCssClass,
99
+ confirmLabel,
100
+ containerProps,
101
+ modalSubType,
102
+ modalTitle,
103
+ modalType,
104
+ onClose,
105
+ onConfirm,
106
+ onReject,
107
+ overridePropsConfirmButton,
108
+ overridePropsRejectButton,
109
+ rejectLabel,
110
+ searchProps,
111
+ showClose,
112
+ showRejectButton,
113
+ removePadding
114
+ }, children));
110
115
  };
111
-
112
116
  const props = {
113
- /** inject props to container wrapper */
114
- containerProps: reactDesc.PropTypes.object.description('inject props to container wrapper'),
115
-
116
- /** css class */
117
- className: reactDesc.PropTypes.string.description('css class'),
118
-
119
- /** style object for container wrapper */
120
- style: reactDesc.PropTypes.object.description('style object for container wrapper'),
121
-
122
- /** modal container title */
123
- modalTitle: reactDesc.PropTypes.string.description('modal container title'),
124
-
125
- /** center container */
126
- centered: reactDesc.PropTypes.bool.description('center container'),
127
-
128
- /** show reject button */
129
- showRejectButton: reactDesc.PropTypes.bool.description('show reject button'),
130
-
131
- /** show close button */
132
- showClose: reactDesc.PropTypes.bool.description('show close button'),
133
-
134
- /*
135
- Props for search component
136
- */
137
- searchProps: reactDesc.PropTypes.object.description('Props for search component'),
138
-
139
- /** css class for footer */
140
- additionalFooterCssClass: reactDesc.PropTypes.string.description('css class for footer'),
141
-
142
- /** override props confirm button */
143
- overridePropsConfirmButton: reactDesc.PropTypes.object.description('override props confirm button'),
144
-
145
- /** override props reject button */
146
- overridePropsRejectButton: reactDesc.PropTypes.object.description('override props reject button'),
147
-
148
- /** controlled isOpen flag */
149
- isOpen: reactDesc.PropTypes.bool.description('controlled isOpen flag'),
150
-
151
- /** close callback */
152
- onClose: reactDesc.PropTypes.func.description('close callback'),
153
-
154
- /** after open callback */
155
- onAfterOpen: reactDesc.PropTypes.func.description('after open callback'),
156
-
157
- /** confirm callback */
158
- onConfirm: reactDesc.PropTypes.func.description('confirm callback'),
159
-
160
- /** reject callback */
161
- onReject: reactDesc.PropTypes.func.description('reject callback'),
162
-
163
- /** reject label */
164
- rejectLabel: reactDesc.PropTypes.string.description('reject label'),
165
-
166
- /** confirm text string */
167
- confirmLabel: reactDesc.PropTypes.string.description('confirm text string'),
168
-
169
- /** modal container size */
170
- size: reactDesc.PropTypes.oneOf(['default', 'xx-large', 'x-large', 'large', 'medium', 'small']).description('modal container size'),
171
-
172
- /** modal sub type */
173
- modalSubType: reactDesc.PropTypes.any.description('modal sub type'),
174
-
175
- /** modal type */
176
- modalType: reactDesc.PropTypes.any.description('modal type'),
177
-
178
- /** ref for modal footer actions */
179
- actionsRef: reactDesc.PropTypes.any.description('ref for modal footer actions'),
180
-
181
- /** modal container children */
182
- children: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.element, reactDesc.PropTypes.arrayOf([reactDesc.PropTypes.element])]).description('modal container children'),
183
-
184
- /** close on click outside container */
185
- shouldCloseOnOverlayClick: reactDesc.PropTypes.bool.description('close on click outside container'),
186
-
187
- /*
188
- App element ID to inject the modal
189
- */
190
- appElement: reactDesc.PropTypes.string.description('App element ID to inject the modal'),
191
-
192
- /** zindex for modal container */
193
- zIndex: reactDesc.PropTypes.number.description('zindex for modal container'),
194
-
195
- /** remove modal builtin padding */
196
- removePadding: reactDesc.PropTypes.bool.description('remove modal builtin padding')
117
+ containerProps: import_react_desc.PropTypes.object.description("inject props to container wrapper"),
118
+ className: import_react_desc.PropTypes.string.description("css class"),
119
+ style: import_react_desc.PropTypes.object.description("style object for container wrapper"),
120
+ modalTitle: import_react_desc.PropTypes.string.description("modal container title"),
121
+ centered: import_react_desc.PropTypes.bool.description("center container"),
122
+ showRejectButton: import_react_desc.PropTypes.bool.description("show reject button"),
123
+ showClose: import_react_desc.PropTypes.bool.description("show close button"),
124
+ searchProps: import_react_desc.PropTypes.object.description("Props for search component"),
125
+ additionalFooterCssClass: import_react_desc.PropTypes.string.description("css class for footer"),
126
+ overridePropsConfirmButton: import_react_desc.PropTypes.object.description("override props confirm button"),
127
+ overridePropsRejectButton: import_react_desc.PropTypes.object.description("override props reject button"),
128
+ isOpen: import_react_desc.PropTypes.bool.description("controlled isOpen flag"),
129
+ onClose: import_react_desc.PropTypes.func.description("close callback"),
130
+ onAfterOpen: import_react_desc.PropTypes.func.description("after open callback"),
131
+ onConfirm: import_react_desc.PropTypes.func.description("confirm callback"),
132
+ onReject: import_react_desc.PropTypes.func.description("reject callback"),
133
+ rejectLabel: import_react_desc.PropTypes.string.description("reject label"),
134
+ confirmLabel: import_react_desc.PropTypes.string.description("confirm text string"),
135
+ size: import_react_desc.PropTypes.oneOf([
136
+ "default",
137
+ "xx-large",
138
+ "x-large",
139
+ "large",
140
+ "medium",
141
+ "small"
142
+ ]).description("modal container size"),
143
+ modalSubType: import_react_desc.PropTypes.any.description("modal sub type"),
144
+ modalType: import_react_desc.PropTypes.any.description("modal type"),
145
+ actionsRef: import_react_desc.PropTypes.any.description("ref for modal footer actions"),
146
+ children: import_react_desc.PropTypes.oneOfType([
147
+ import_react_desc.PropTypes.element,
148
+ import_react_desc.PropTypes.arrayOf([import_react_desc.PropTypes.element])
149
+ ]).description("modal container children"),
150
+ shouldCloseOnOverlayClick: import_react_desc.PropTypes.bool.description("close on click outside container"),
151
+ appElement: import_react_desc.PropTypes.string.description("App element ID to inject the modal"),
152
+ zIndex: import_react_desc.PropTypes.number.description("zindex for modal container"),
153
+ removePadding: import_react_desc.PropTypes.bool.description("remove modal builtin padding")
197
154
  };
198
- const DSModalWithSchema = reactDesc.describe(DSModal);
155
+ DSModal.propTypes = props;
156
+ const DSModalWithSchema = (0, import_react_desc.describe)(DSModal);
199
157
  DSModalWithSchema.propTypes = props;
200
-
201
- exports.DSModalContent = ModalContent.DSModalContent;
202
- exports.DSModalWithSchema = DSModalWithSchema;
203
- exports["default"] = DSModal;
158
+ var DSModal_default = DSModal;
159
+ module.exports = __toCommonJS(DSModal_exports);
160
+ //# sourceMappingURL=DSModal.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v2/DSModal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE_V2 } from '../constants';\nimport { DSModalContent } from './components/ModalContent';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n style = {},\n size = 'default',\n //\n modalType = MODAL_TYPE_V2.INFORMATION,\n modalSubType = null,\n modalTitle = '',\n dataTestId = 'ds-modal',\n centered = false,\n showRejectButton = false,\n showClose = true,\n searchProps = {},\n // override\n actionsRef = () => null,\n additionalFooterCssClass,\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n // react modal\n children,\n isOpen = true,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Discard',\n confirmLabel = 'Save',\n shouldCloseOnOverlayClick = false,\n appElement = '#root',\n zIndex = 10,\n removePadding = false,\n}) => {\n if (\n typeof document !== 'undefined' &&\n process.env.NODE_ENV !== 'test' &&\n document &&\n ReactModal.setAppElement\n ) {\n ReactModal.setAppElement(appElement);\n }\n\n const {\n cssClassName,\n classNameBlock,\n classNameModifier,\n } = convertPropToCssClassName('modal-v2', className, { size });\n\n return (\n <ReactModal\n testId={dataTestId}\n className={`${cssClassName} ${classNameBlock(`type-${modalType}`)}`}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(\n centered ? 'center' : 'top',\n )}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n // position: 'absolute', https://jira.elliemae.io/browse/PUI-1471, the overlay should be positioned based on the browser window rather positioned absolute to its parent\n zIndex,\n },\n }}\n >\n <DSModalContent\n actionsRef={actionsRef}\n additionalFooterCssClass={additionalFooterCssClass}\n confirmLabel={confirmLabel}\n containerProps={containerProps}\n modalSubType={modalSubType}\n modalTitle={modalTitle}\n modalType={modalType}\n onClose={onClose}\n onConfirm={onConfirm}\n onReject={onReject}\n overridePropsConfirmButton={overridePropsConfirmButton}\n overridePropsRejectButton={overridePropsRejectButton}\n rejectLabel={rejectLabel}\n searchProps={searchProps}\n showClose={showClose}\n showRejectButton={showRejectButton}\n removePadding={removePadding}\n >\n {children}\n </DSModalContent>\n </ReactModal>\n );\n};\n\nconst props = {\n /** inject props to container wrapper */\n containerProps: PropTypes.object.description(\n 'inject props to container wrapper',\n ),\n /** css class */\n className: PropTypes.string.description('css class'),\n /** style object for container wrapper */\n style: PropTypes.object.description('style object for container wrapper'),\n /** modal container title */\n modalTitle: PropTypes.string.description('modal container title'),\n /** center container */\n centered: PropTypes.bool.description('center container'),\n /** show reject button */\n showRejectButton: PropTypes.bool.description('show reject button'),\n /** show close button */\n showClose: PropTypes.bool.description('show close button'),\n /*\n Props for search component\n */\n searchProps: PropTypes.object.description('Props for search component'),\n /** css class for footer */\n additionalFooterCssClass: PropTypes.string.description(\n 'css class for footer',\n ),\n /** override props confirm button */\n overridePropsConfirmButton: PropTypes.object.description(\n 'override props confirm button',\n ),\n /** override props reject button */\n overridePropsRejectButton: PropTypes.object.description(\n 'override props reject button',\n ),\n /** controlled isOpen flag */\n isOpen: PropTypes.bool.description('controlled isOpen flag'),\n /** close callback */\n onClose: PropTypes.func.description('close callback'),\n /** after open callback */\n onAfterOpen: PropTypes.func.description('after open callback'),\n /** confirm callback */\n onConfirm: PropTypes.func.description('confirm callback'),\n /** reject callback */\n onReject: PropTypes.func.description('reject callback'),\n /** reject label */\n rejectLabel: PropTypes.string.description('reject label'),\n /** confirm text string */\n confirmLabel: PropTypes.string.description('confirm text string'),\n /** modal container size */\n size: PropTypes.oneOf([\n 'default',\n 'xx-large',\n 'x-large',\n 'large',\n 'medium',\n 'small',\n ]).description('modal container size'),\n /** modal sub type */\n modalSubType: PropTypes.any.description('modal sub type'),\n /** modal type */\n modalType: PropTypes.any.description('modal type'),\n /** ref for modal footer actions */\n actionsRef: PropTypes.any.description('ref for modal footer actions'),\n /** modal container children */\n children: PropTypes.oneOfType([\n PropTypes.element,\n PropTypes.arrayOf([PropTypes.element]),\n ]).description('modal container children'),\n /** close on click outside container */\n shouldCloseOnOverlayClick: PropTypes.bool.description(\n 'close on click outside container',\n ),\n /*\n App element ID to inject the modal\n */\n appElement: PropTypes.string.description(\n 'App element ID to inject the modal',\n ),\n /** zindex for modal container */\n zIndex: PropTypes.number.description('zindex for modal container'),\n /** remove modal builtin padding */\n removePadding: PropTypes.bool.description('remove modal builtin padding'),\n};\n\nDSModal.propTypes = props;\n\nconst DSModalWithSchema = describe(DSModal);\nDSModalWithSchema.propTypes = props;\n\nexport { DSModalContent, DSModalWithSchema };\nexport default DSModal;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
package/cjs/v2/blocks.js CHANGED
@@ -1,88 +1,71 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dsClassnames = require('@elliemae/ds-classnames');
6
-
7
- const blockName = 'modal-v2';
8
- const ModalHeader = dsClassnames.aggregatedClasses('div')(blockName, 'modal-header', _ref => {
9
- let {
10
- type,
11
- showClose
12
- } = _ref;
13
- return {
14
- [type]: type,
15
- 'with-close': showClose
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
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);
16
26
  };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var blocks_exports = {};
29
+ __export(blocks_exports, {
30
+ ModalContent: () => ModalContent,
31
+ ModalFeedback: () => ModalFeedback,
32
+ ModalFooter: () => ModalFooter,
33
+ ModalFooterActions: () => ModalFooterActions,
34
+ ModalHeader: () => ModalHeader,
35
+ ModalHeaderTopRight: () => ModalHeaderTopRight,
36
+ ModalTitle: () => ModalTitle,
37
+ ModalWrapper: () => ModalWrapper
17
38
  });
18
- const ModalHeaderTopRight = dsClassnames.aggregatedClasses('div')(blockName, 'modal-header-close', _ref2 => {
19
- let {
20
- type
21
- } = _ref2;
22
- return {
23
- [type]: type
24
- };
25
- });
26
- const ModalFeedback = dsClassnames.aggregatedClasses('div')(blockName, 'modal-feedback', _ref3 => {
27
- let {
28
- type
29
- } = _ref3;
30
- return {
31
- [type]: type
32
- };
33
- });
34
- const ModalTitle = dsClassnames.aggregatedClasses('h3')(blockName, 'modal-title', _ref4 => {
35
- let {
36
- type
37
- } = _ref4;
38
- return {
39
- [type]: type
40
- };
41
- });
42
- const ModalContent = dsClassnames.aggregatedClasses('div')(blockName, 'modal-content', _ref5 => {
43
- let {
44
- type,
45
- removePadding
46
- } = _ref5;
47
- return {
48
- [type]: type,
49
- 'remove-padding': removePadding
50
- };
51
- });
52
- const ModalWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'modal-wrapper', _ref6 => {
53
- let {
54
- type,
55
- removePadding
56
- } = _ref6;
57
- return {
58
- [type]: type,
59
- 'remove-padding': removePadding
60
- };
61
- });
62
- const ModalFooter = dsClassnames.aggregatedClasses('div')(blockName, 'modal-footer', _ref7 => {
63
- let {
64
- type,
65
- additionalFooterCssClass
66
- } = _ref7;
67
- return {
68
- [type]: type,
69
- [additionalFooterCssClass]: additionalFooterCssClass
70
- };
71
- });
72
- const ModalFooterActions = dsClassnames.aggregatedClasses('div')(blockName, 'modal-footer-actions', _ref8 => {
73
- let {
74
- type
75
- } = _ref8;
76
- return {
77
- [type]: type
78
- };
79
- });
80
-
81
- exports.ModalContent = ModalContent;
82
- exports.ModalFeedback = ModalFeedback;
83
- exports.ModalFooter = ModalFooter;
84
- exports.ModalFooterActions = ModalFooterActions;
85
- exports.ModalHeader = ModalHeader;
86
- exports.ModalHeaderTopRight = ModalHeaderTopRight;
87
- exports.ModalTitle = ModalTitle;
88
- exports.ModalWrapper = ModalWrapper;
39
+ var React = __toESM(require("react"));
40
+ var import_ds_classnames = require("@elliemae/ds-classnames");
41
+ const blockName = "modal-v2";
42
+ const ModalHeader = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-header", ({ type, showClose }) => ({
43
+ [type]: type,
44
+ "with-close": showClose
45
+ }));
46
+ const ModalHeaderTopRight = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-header-close", ({ type }) => ({
47
+ [type]: type
48
+ }));
49
+ const ModalFeedback = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-feedback", ({ type }) => ({
50
+ [type]: type
51
+ }));
52
+ const ModalTitle = (0, import_ds_classnames.aggregatedClasses)("h3")(blockName, "modal-title", ({ type }) => ({
53
+ [type]: type
54
+ }));
55
+ const ModalContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-content", ({ type, removePadding }) => ({
56
+ [type]: type,
57
+ "remove-padding": removePadding
58
+ }));
59
+ const ModalWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-wrapper", ({ type, removePadding }) => ({
60
+ [type]: type,
61
+ "remove-padding": removePadding
62
+ }));
63
+ const ModalFooter = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-footer", ({ type, additionalFooterCssClass }) => ({
64
+ [type]: type,
65
+ [additionalFooterCssClass]: additionalFooterCssClass
66
+ }));
67
+ const ModalFooterActions = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "modal-footer-actions", ({ type }) => ({
68
+ [type]: type
69
+ }));
70
+ module.exports = __toCommonJS(blocks_exports);
71
+ //# sourceMappingURL=blocks.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/v2/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'modal-v2';\n\nexport const ModalHeader = aggregatedClasses('div')(blockName, 'modal-header', ({ type, showClose }) => ({\n [type]: type,\n 'with-close': showClose,\n}));\n\nexport const ModalHeaderTopRight = aggregatedClasses('div')(blockName, 'modal-header-close', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalFeedback = aggregatedClasses('div')(blockName, 'modal-feedback', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalTitle = aggregatedClasses('h3')(blockName, 'modal-title', ({ type }) => ({\n [type]: type,\n}));\n\nexport const ModalContent = aggregatedClasses('div')(blockName, 'modal-content', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalWrapper = aggregatedClasses('div')(blockName, 'modal-wrapper', ({ type, removePadding }) => ({\n [type]: type,\n 'remove-padding': removePadding,\n}));\n\nexport const ModalFooter = aggregatedClasses('div')(\n blockName,\n 'modal-footer',\n ({ type, additionalFooterCssClass }) => ({\n [type]: type,\n [additionalFooterCssClass]: additionalFooterCssClass,\n }),\n);\n\nexport const ModalFooterActions = aggregatedClasses('div')(blockName, 'modal-footer-actions', ({ type }) => ({\n [type]: type,\n}));\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAElC,MAAM,YAAY;AAEX,MAAM,cAAc,4CAAkB,OAAO,WAAW,gBAAgB,CAAC,EAAE,MAAM,gBAAiB;AAAA,GACtG,OAAO;AAAA,EACR,cAAc;AAAA;AAGT,MAAM,sBAAsB,4CAAkB,OAAO,WAAW,sBAAsB,CAAC,EAAE,WAAY;AAAA,GACzG,OAAO;AAAA;AAGH,MAAM,gBAAgB,4CAAkB,OAAO,WAAW,kBAAkB,CAAC,EAAE,WAAY;AAAA,GAC/F,OAAO;AAAA;AAGH,MAAM,aAAa,4CAAkB,MAAM,WAAW,eAAe,CAAC,EAAE,WAAY;AAAA,GACxF,OAAO;AAAA;AAGH,MAAM,eAAe,4CAAkB,OAAO,WAAW,iBAAiB,CAAC,EAAE,MAAM,oBAAqB;AAAA,GAC5G,OAAO;AAAA,EACR,kBAAkB;AAAA;AAGb,MAAM,eAAe,4CAAkB,OAAO,WAAW,iBAAiB,CAAC,EAAE,MAAM,oBAAqB;AAAA,GAC5G,OAAO;AAAA,EACR,kBAAkB;AAAA;AAGb,MAAM,cAAc,4CAAkB,OAC3C,WACA,gBACA,CAAC,EAAE,MAAM,+BAAgC;AAAA,GACtC,OAAO;AAAA,GACP,2BAA2B;AAAA;AAIzB,MAAM,qBAAqB,4CAAkB,OAAO,WAAW,wBAAwB,CAAC,EAAE,WAAY;AAAA,GAC1G,OAAO;AAAA;",
6
+ "names": []
7
+ }
@@ -1,38 +1,48 @@
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 dsIcons = require('@elliemae/ds-icons');
8
- var DSButton = require('@elliemae/ds-button');
9
- var blocks = require('../blocks.js');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
14
- var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
15
-
16
- var _Close;
17
- const DecisionHeader = _ref => {
18
- let {
19
- onClose,
20
- showClose
21
- } = _ref;
22
- return /*#__PURE__*/_jsx__default["default"](blocks.ModalHeader, {
23
- classProps: {
24
- type: 'decision',
25
- showClose
26
- }
27
- }, void 0, showClose && /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
28
- buttonType: "link",
29
- containerProps: {
30
- 'data-testid': 'modal-button-close'
31
- },
32
- icon: _Close || (_Close = /*#__PURE__*/_jsx__default["default"](dsIcons.Close, {})),
33
- onClick: onClose
34
- }));
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
35
11
  };
36
-
37
- exports.DecisionHeader = DecisionHeader;
38
- exports["default"] = DecisionHeader;
12
+ var __reExport = (target, module2, copyDefault, desc) => {
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 DecisionHeader_exports = {};
29
+ __export(DecisionHeader_exports, {
30
+ DecisionHeader: () => DecisionHeader,
31
+ default: () => DecisionHeader_default
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_react = __toESM(require("react"));
35
+ var import_ds_icons = require("@elliemae/ds-icons");
36
+ var import_ds_button = __toESM(require("@elliemae/ds-button"));
37
+ var import_blocks = require("../blocks");
38
+ const DecisionHeader = ({ onClose, showClose }) => /* @__PURE__ */ import_react.default.createElement(import_blocks.ModalHeader, {
39
+ classProps: { type: "decision", showClose }
40
+ }, showClose && /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
41
+ buttonType: "link",
42
+ containerProps: { "data-testid": "modal-button-close" },
43
+ icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.Close, null),
44
+ onClick: onClose
45
+ }));
46
+ var DecisionHeader_default = DecisionHeader;
47
+ module.exports = __toCommonJS(DecisionHeader_exports);
48
+ //# sourceMappingURL=DecisionHeader.js.map