@elliemae/ds-modal 2.2.0-alpha.4 → 3.0.0-next.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 (70) hide show
  1. package/cjs/DSModal.js +184 -86
  2. package/cjs/constants.js +28 -67
  3. package/cjs/index.js +18 -39
  4. package/cjs/v1/DSModal.js +130 -159
  5. package/cjs/v1/DSModalType.js +7 -45
  6. package/cjs/v1/DSModalWrapper.js +113 -76
  7. package/cjs/v1/ModalFeedBack/ModalFeedBack.js +72 -77
  8. package/cjs/v2/DSModal.js +186 -143
  9. package/cjs/v2/blocks.js +86 -69
  10. package/cjs/v2/components/DecisionHeader.js +37 -47
  11. package/cjs/v2/components/FeedbackIcon.js +50 -59
  12. package/cjs/v2/components/Footer.js +65 -68
  13. package/cjs/v2/components/FormHeader.js +46 -53
  14. package/cjs/v2/components/ModalContent.js +111 -95
  15. package/cjs/v2/components/SelectionHeader.js +48 -50
  16. package/cjs/v2/components/Title.js +25 -40
  17. package/cjs/v2/helpers.js +40 -49
  18. package/esm/DSModal.js +142 -26
  19. package/esm/constants.js +20 -38
  20. package/esm/index.js +4 -10
  21. package/esm/v1/DSModal.js +121 -130
  22. package/esm/v1/DSModalType.js +3 -16
  23. package/esm/v1/DSModalWrapper.js +105 -45
  24. package/esm/v1/ModalFeedBack/ModalFeedBack.js +66 -48
  25. package/esm/v2/DSModal.js +173 -112
  26. package/esm/v2/blocks.js +77 -42
  27. package/esm/v2/components/DecisionHeader.js +27 -18
  28. package/esm/v2/components/FeedbackIcon.js +36 -25
  29. package/esm/v2/components/Footer.js +54 -39
  30. package/esm/v2/components/FormHeader.js +36 -24
  31. package/esm/v2/components/ModalContent.js +102 -72
  32. package/esm/v2/components/SelectionHeader.js +38 -21
  33. package/esm/v2/components/Title.js +16 -11
  34. package/esm/v2/helpers.js +28 -16
  35. package/package.json +8 -8
  36. package/types/DSModal.d.ts +1 -1
  37. package/cjs/DSModal.js.map +0 -7
  38. package/cjs/constants.js.map +0 -7
  39. package/cjs/index.js.map +0 -7
  40. package/cjs/v1/DSModal.js.map +0 -7
  41. package/cjs/v1/DSModalType.js.map +0 -7
  42. package/cjs/v1/DSModalWrapper.js.map +0 -7
  43. package/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
  44. package/cjs/v2/DSModal.js.map +0 -7
  45. package/cjs/v2/blocks.js.map +0 -7
  46. package/cjs/v2/components/DecisionHeader.js.map +0 -7
  47. package/cjs/v2/components/FeedbackIcon.js.map +0 -7
  48. package/cjs/v2/components/Footer.js.map +0 -7
  49. package/cjs/v2/components/FormHeader.js.map +0 -7
  50. package/cjs/v2/components/ModalContent.js.map +0 -7
  51. package/cjs/v2/components/SelectionHeader.js.map +0 -7
  52. package/cjs/v2/components/Title.js.map +0 -7
  53. package/cjs/v2/helpers.js.map +0 -7
  54. package/esm/DSModal.js.map +0 -7
  55. package/esm/constants.js.map +0 -7
  56. package/esm/index.js.map +0 -7
  57. package/esm/v1/DSModal.js.map +0 -7
  58. package/esm/v1/DSModalType.js.map +0 -7
  59. package/esm/v1/DSModalWrapper.js.map +0 -7
  60. package/esm/v1/ModalFeedBack/ModalFeedBack.js.map +0 -7
  61. package/esm/v2/DSModal.js.map +0 -7
  62. package/esm/v2/blocks.js.map +0 -7
  63. package/esm/v2/components/DecisionHeader.js.map +0 -7
  64. package/esm/v2/components/FeedbackIcon.js.map +0 -7
  65. package/esm/v2/components/Footer.js.map +0 -7
  66. package/esm/v2/components/FormHeader.js.map +0 -7
  67. package/esm/v2/components/ModalContent.js.map +0 -7
  68. package/esm/v2/components/SelectionHeader.js.map +0 -7
  69. package/esm/v2/components/Title.js.map +0 -7
  70. package/esm/v2/helpers.js.map +0 -7
@@ -1,59 +1,76 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from "@elliemae/ds-icons";
4
- import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
- import { MODAL_TYPE } from "../../constants";
6
- const feedbackIconSize = "xxl";
7
- const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;
8
- const getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {
9
- if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1)
10
- return modalType;
11
- if (hasError)
12
- return ERROR;
13
- if (hasWarning)
14
- return WARNING;
15
- if (hasSuccess)
16
- return SUCCESS;
17
- if (hasHelp)
18
- return HELP;
19
- if (hasInfo)
20
- return INFO;
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { InfoCircle, HelpCircle, CheckmarkCircle, WarningCircle } from '@elliemae/ds-icons';
4
+ import { convertPropToCssClassName } from '@elliemae/ds-classnames';
5
+ import { MODAL_TYPE } from '../../constants.js';
6
+
7
+ var _WarningCircle, _CheckmarkCircle, _HelpCircle, _InfoCircle, _InfoCircle2;
8
+ const feedbackIconSize = 'xxl';
9
+ const {
10
+ WARNING,
11
+ ERROR,
12
+ SUCCESS,
13
+ HELP,
14
+ INFO
15
+ } = MODAL_TYPE;
16
+
17
+ const getModalType = (modalType, _ref) => {
18
+ let {
19
+ hasError,
20
+ hasWarning,
21
+ hasSuccess,
22
+ hasInfo,
23
+ hasHelp
24
+ } = _ref;
25
+ if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1) return modalType;
26
+ if (hasError) return ERROR;
27
+ if (hasWarning) return WARNING;
28
+ if (hasSuccess) return SUCCESS;
29
+ if (hasHelp) return HELP;
30
+ if (hasInfo) return INFO;
21
31
  return INFO;
22
32
  };
23
- const getIconType = (modalType) => {
33
+
34
+ const getIconType = modalType => {
24
35
  switch (modalType) {
25
36
  case WARNING:
26
37
  case ERROR:
27
- return /* @__PURE__ */ React2.createElement(WarningCircle, {
38
+ return _WarningCircle || (_WarningCircle = /*#__PURE__*/_jsx(WarningCircle, {
28
39
  size: feedbackIconSize
29
- });
40
+ }));
41
+
30
42
  case SUCCESS:
31
- return /* @__PURE__ */ React2.createElement(CheckmarkCircle, {
43
+ return _CheckmarkCircle || (_CheckmarkCircle = /*#__PURE__*/_jsx(CheckmarkCircle, {
32
44
  size: feedbackIconSize
33
- });
45
+ }));
46
+
34
47
  case HELP:
35
- return /* @__PURE__ */ React2.createElement(HelpCircle, {
48
+ return _HelpCircle || (_HelpCircle = /*#__PURE__*/_jsx(HelpCircle, {
36
49
  size: feedbackIconSize
37
- });
50
+ }));
51
+
38
52
  case INFO:
39
- return /* @__PURE__ */ React2.createElement(InfoCircle, {
53
+ return _InfoCircle || (_InfoCircle = /*#__PURE__*/_jsx(InfoCircle, {
40
54
  size: feedbackIconSize
41
- });
55
+ }));
56
+
42
57
  default:
43
- return /* @__PURE__ */ React2.createElement(InfoCircle, {
58
+ return _InfoCircle2 || (_InfoCircle2 = /*#__PURE__*/_jsx(InfoCircle, {
44
59
  size: feedbackIconSize
45
- });
60
+ }));
46
61
  }
47
62
  };
48
- const ModalFeedBack = ({
49
- className = "",
50
- modalType = null,
51
- hasError = false,
52
- hasWarning = false,
53
- hasSuccess = false,
54
- hasInfo = false,
55
- hasHelp = false
56
- }) => {
63
+
64
+ const ModalFeedBack = _ref2 => {
65
+ let {
66
+ className = '',
67
+ modalType = null,
68
+ hasError = false,
69
+ hasWarning = false,
70
+ hasSuccess = false,
71
+ hasInfo = false,
72
+ hasHelp = false
73
+ } = _ref2;
57
74
  const type = getModalType(modalType, {
58
75
  hasError,
59
76
  hasWarning,
@@ -61,14 +78,15 @@ const ModalFeedBack = ({
61
78
  hasInfo,
62
79
  hasHelp
63
80
  });
64
- const { cssClassName } = convertPropToCssClassName("modal-feedback", className, { modalType: type });
81
+ const {
82
+ cssClassName
83
+ } = convertPropToCssClassName('modal-feedback', className, {
84
+ modalType: type
85
+ });
65
86
  const feedbackIcon = getIconType(type);
66
- return /* @__PURE__ */ React2.createElement("div", {
87
+ return /*#__PURE__*/_jsx("div", {
67
88
  className: cssClassName
68
- }, feedbackIcon);
69
- };
70
- var ModalFeedBack_default = ModalFeedBack;
71
- export {
72
- ModalFeedBack_default as default
89
+ }, void 0, feedbackIcon);
73
90
  };
74
- //# sourceMappingURL=ModalFeedBack.js.map
91
+
92
+ export { ModalFeedBack as default };
package/esm/v2/DSModal.js CHANGED
@@ -1,131 +1,192 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import ReactModal from "react-modal";
5
- import { convertPropToCssClassName } from "@elliemae/ds-classnames";
6
- import { MODAL_TYPE_V2 } from "../constants";
7
- import { DSModalContent } from "./components/ModalContent";
8
- const DSModal = ({
9
- containerProps = {},
10
- className = "",
11
- style = {},
12
- size = "default",
13
- modalType = MODAL_TYPE_V2.INFORMATION,
14
- modalSubType = null,
15
- modalTitle = "",
16
- dataTestId = "ds-modal",
17
- centered = false,
18
- showRejectButton = false,
19
- showClose = true,
20
- searchProps = {},
21
- actionsRef = () => null,
22
- additionalFooterCssClass,
23
- overridePropsConfirmButton = {},
24
- overridePropsRejectButton = {},
25
- children,
26
- isOpen = true,
27
- onClose = () => null,
28
- onAfterOpen = () => null,
29
- onConfirm = () => null,
30
- onReject = () => null,
31
- rejectLabel = "Discard",
32
- confirmLabel = "Save",
33
- shouldCloseOnOverlayClick = false,
34
- appElement = "#root",
35
- zIndex = 10,
36
- removePadding = false
37
- }) => {
38
- if (typeof document !== "undefined" && true && document && ReactModal.setAppElement) {
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 ReactModal from 'react-modal';
11
+ import { convertPropToCssClassName } from '@elliemae/ds-classnames';
12
+ import { MODAL_TYPE_V2 } from '../constants.js';
13
+ import { DSModalContent } from './components/ModalContent.js';
14
+ export { DSModalContent } from './components/ModalContent.js';
15
+
16
+ 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; }
17
+
18
+ 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; }
19
+
20
+ const DSModal = _ref => {
21
+ let {
22
+ containerProps = {},
23
+ className = '',
24
+ style = {},
25
+ size = 'default',
26
+ //
27
+ modalType = MODAL_TYPE_V2.INFORMATION,
28
+ modalSubType = null,
29
+ modalTitle = '',
30
+ dataTestId = 'ds-modal',
31
+ centered = false,
32
+ showRejectButton = false,
33
+ showClose = true,
34
+ searchProps = {},
35
+ // override
36
+ actionsRef = () => null,
37
+ additionalFooterCssClass,
38
+ overridePropsConfirmButton = {},
39
+ overridePropsRejectButton = {},
40
+ // react modal
41
+ children,
42
+ isOpen = true,
43
+ onClose = () => null,
44
+ onAfterOpen = () => null,
45
+ onConfirm = () => null,
46
+ onReject = () => null,
47
+ rejectLabel = 'Discard',
48
+ confirmLabel = 'Save',
49
+ shouldCloseOnOverlayClick = false,
50
+ appElement = '#root',
51
+ zIndex = 10,
52
+ removePadding = false
53
+ } = _ref;
54
+
55
+ if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal.setAppElement) {
39
56
  ReactModal.setAppElement(appElement);
40
57
  }
58
+
41
59
  const {
42
60
  cssClassName,
43
61
  classNameBlock,
44
62
  classNameModifier
45
- } = convertPropToCssClassName("modal-v2", className, { size });
46
- return /* @__PURE__ */ React2.createElement(ReactModal, {
63
+ } = convertPropToCssClassName('modal-v2', className, {
64
+ size
65
+ });
66
+ return /*#__PURE__*/_jsx(ReactModal, {
47
67
  testId: dataTestId,
48
- className: `${cssClassName} ${classNameBlock(`type-${modalType}`)}`,
68
+ className: "".concat(cssClassName, " ").concat(classNameBlock("type-".concat(modalType))),
49
69
  contentLabel: modalTitle,
50
- isOpen,
51
- onAfterOpen,
70
+ isOpen: isOpen,
71
+ onAfterOpen: onAfterOpen,
52
72
  onRequestClose: onClose,
53
- overlayClassName: `${classNameBlock("overlay")} ${classNameModifier(centered ? "center" : "top")}`,
54
- shouldCloseOnOverlayClick,
73
+ overlayClassName: "".concat(classNameBlock('overlay'), " ").concat(classNameModifier(centered ? 'center' : 'top')),
74
+ shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
55
75
  style: {
56
- content: {
57
- ...style
58
- },
76
+ content: _objectSpread({}, style),
59
77
  overlay: {
78
+ // 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
60
79
  zIndex
61
80
  }
62
81
  }
63
- }, /* @__PURE__ */ React2.createElement(DSModalContent, {
64
- actionsRef,
65
- additionalFooterCssClass,
66
- confirmLabel,
67
- containerProps,
68
- modalSubType,
69
- modalTitle,
70
- modalType,
71
- onClose,
72
- onConfirm,
73
- onReject,
74
- overridePropsConfirmButton,
75
- overridePropsRejectButton,
76
- rejectLabel,
77
- searchProps,
78
- showClose,
79
- showRejectButton,
80
- removePadding
81
- }, children));
82
+ }, void 0, /*#__PURE__*/_jsx(DSModalContent, {
83
+ actionsRef: actionsRef,
84
+ additionalFooterCssClass: additionalFooterCssClass,
85
+ confirmLabel: confirmLabel,
86
+ containerProps: containerProps,
87
+ modalSubType: modalSubType,
88
+ modalTitle: modalTitle,
89
+ modalType: modalType,
90
+ onClose: onClose,
91
+ onConfirm: onConfirm,
92
+ onReject: onReject,
93
+ overridePropsConfirmButton: overridePropsConfirmButton,
94
+ overridePropsRejectButton: overridePropsRejectButton,
95
+ rejectLabel: rejectLabel,
96
+ searchProps: searchProps,
97
+ showClose: showClose,
98
+ showRejectButton: showRejectButton,
99
+ removePadding: removePadding
100
+ }, void 0, children));
82
101
  };
102
+
83
103
  const props = {
84
- containerProps: PropTypes.object.description("inject props to container wrapper"),
85
- className: PropTypes.string.description("css class"),
86
- style: PropTypes.object.description("style object for container wrapper"),
87
- modalTitle: PropTypes.string.description("modal container title"),
88
- centered: PropTypes.bool.description("center container"),
89
- showRejectButton: PropTypes.bool.description("show reject button"),
90
- showClose: PropTypes.bool.description("show close button"),
91
- searchProps: PropTypes.object.description("Props for search component"),
92
- additionalFooterCssClass: PropTypes.string.description("css class for footer"),
93
- overridePropsConfirmButton: PropTypes.object.description("override props confirm button"),
94
- overridePropsRejectButton: PropTypes.object.description("override props reject button"),
95
- isOpen: PropTypes.bool.description("controlled isOpen flag"),
96
- onClose: PropTypes.func.description("close callback"),
97
- onAfterOpen: PropTypes.func.description("after open callback"),
98
- onConfirm: PropTypes.func.description("confirm callback"),
99
- onReject: PropTypes.func.description("reject callback"),
100
- rejectLabel: PropTypes.string.description("reject label"),
101
- confirmLabel: PropTypes.string.description("confirm text string"),
102
- size: PropTypes.oneOf([
103
- "default",
104
- "xx-large",
105
- "x-large",
106
- "large",
107
- "medium",
108
- "small"
109
- ]).description("modal container size"),
110
- modalSubType: PropTypes.any.description("modal sub type"),
111
- modalType: PropTypes.any.description("modal type"),
112
- actionsRef: PropTypes.any.description("ref for modal footer actions"),
113
- children: PropTypes.oneOfType([
114
- PropTypes.element,
115
- PropTypes.arrayOf([PropTypes.element])
116
- ]).description("modal container children"),
117
- shouldCloseOnOverlayClick: PropTypes.bool.description("close on click outside container"),
118
- appElement: PropTypes.string.description("App element ID to inject the modal"),
119
- zIndex: PropTypes.number.description("zindex for modal container"),
120
- removePadding: PropTypes.bool.description("remove modal builtin padding")
104
+ /** inject props to container wrapper */
105
+ containerProps: PropTypes.object.description('inject props to container wrapper'),
106
+
107
+ /** css class */
108
+ className: PropTypes.string.description('css class'),
109
+
110
+ /** style object for container wrapper */
111
+ style: PropTypes.object.description('style object for container wrapper'),
112
+
113
+ /** modal container title */
114
+ modalTitle: PropTypes.string.description('modal container title'),
115
+
116
+ /** center container */
117
+ centered: PropTypes.bool.description('center container'),
118
+
119
+ /** show reject button */
120
+ showRejectButton: PropTypes.bool.description('show reject button'),
121
+
122
+ /** show close button */
123
+ showClose: PropTypes.bool.description('show close button'),
124
+
125
+ /*
126
+ Props for search component
127
+ */
128
+ searchProps: PropTypes.object.description('Props for search component'),
129
+
130
+ /** css class for footer */
131
+ additionalFooterCssClass: PropTypes.string.description('css class for footer'),
132
+
133
+ /** override props confirm button */
134
+ overridePropsConfirmButton: PropTypes.object.description('override props confirm button'),
135
+
136
+ /** override props reject button */
137
+ overridePropsRejectButton: PropTypes.object.description('override props reject button'),
138
+
139
+ /** controlled isOpen flag */
140
+ isOpen: PropTypes.bool.description('controlled isOpen flag'),
141
+
142
+ /** close callback */
143
+ onClose: PropTypes.func.description('close callback'),
144
+
145
+ /** after open callback */
146
+ onAfterOpen: PropTypes.func.description('after open callback'),
147
+
148
+ /** confirm callback */
149
+ onConfirm: PropTypes.func.description('confirm callback'),
150
+
151
+ /** reject callback */
152
+ onReject: PropTypes.func.description('reject callback'),
153
+
154
+ /** reject label */
155
+ rejectLabel: PropTypes.string.description('reject label'),
156
+
157
+ /** confirm text string */
158
+ confirmLabel: PropTypes.string.description('confirm text string'),
159
+
160
+ /** modal container size */
161
+ size: PropTypes.oneOf(['default', 'xx-large', 'x-large', 'large', 'medium', 'small']).description('modal container size'),
162
+
163
+ /** modal sub type */
164
+ modalSubType: PropTypes.any.description('modal sub type'),
165
+
166
+ /** modal type */
167
+ modalType: PropTypes.any.description('modal type'),
168
+
169
+ /** ref for modal footer actions */
170
+ actionsRef: PropTypes.any.description('ref for modal footer actions'),
171
+
172
+ /** modal container children */
173
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf([PropTypes.element])]).description('modal container children'),
174
+
175
+ /** close on click outside container */
176
+ shouldCloseOnOverlayClick: PropTypes.bool.description('close on click outside container'),
177
+
178
+ /*
179
+ App element ID to inject the modal
180
+ */
181
+ appElement: PropTypes.string.description('App element ID to inject the modal'),
182
+
183
+ /** zindex for modal container */
184
+ zIndex: PropTypes.number.description('zindex for modal container'),
185
+
186
+ /** remove modal builtin padding */
187
+ removePadding: PropTypes.bool.description('remove modal builtin padding')
121
188
  };
122
- DSModal.propTypes = props;
123
189
  const DSModalWithSchema = describe(DSModal);
124
190
  DSModalWithSchema.propTypes = props;
125
- var DSModal_default = DSModal;
126
- export {
127
- DSModalContent,
128
- DSModalWithSchema,
129
- DSModal_default as default
130
- };
131
- //# sourceMappingURL=DSModal.js.map
191
+
192
+ export { DSModalWithSchema, DSModal as default };
package/esm/v2/blocks.js CHANGED
@@ -1,42 +1,77 @@
1
- import * as React from "react";
2
- import { aggregatedClasses } from "@elliemae/ds-classnames";
3
- const blockName = "modal-v2";
4
- const ModalHeader = aggregatedClasses("div")(blockName, "modal-header", ({ type, showClose }) => ({
5
- [type]: type,
6
- "with-close": showClose
7
- }));
8
- const ModalHeaderTopRight = aggregatedClasses("div")(blockName, "modal-header-close", ({ type }) => ({
9
- [type]: type
10
- }));
11
- const ModalFeedback = aggregatedClasses("div")(blockName, "modal-feedback", ({ type }) => ({
12
- [type]: type
13
- }));
14
- const ModalTitle = aggregatedClasses("h3")(blockName, "modal-title", ({ type }) => ({
15
- [type]: type
16
- }));
17
- const ModalContent = aggregatedClasses("div")(blockName, "modal-content", ({ type, removePadding }) => ({
18
- [type]: type,
19
- "remove-padding": removePadding
20
- }));
21
- const ModalWrapper = aggregatedClasses("div")(blockName, "modal-wrapper", ({ type, removePadding }) => ({
22
- [type]: type,
23
- "remove-padding": removePadding
24
- }));
25
- const ModalFooter = aggregatedClasses("div")(blockName, "modal-footer", ({ type, additionalFooterCssClass }) => ({
26
- [type]: type,
27
- [additionalFooterCssClass]: additionalFooterCssClass
28
- }));
29
- const ModalFooterActions = aggregatedClasses("div")(blockName, "modal-footer-actions", ({ type }) => ({
30
- [type]: type
31
- }));
32
- export {
33
- ModalContent,
34
- ModalFeedback,
35
- ModalFooter,
36
- ModalFooterActions,
37
- ModalHeader,
38
- ModalHeaderTopRight,
39
- ModalTitle,
40
- ModalWrapper
41
- };
42
- //# sourceMappingURL=blocks.js.map
1
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
2
+
3
+ const blockName = 'modal-v2';
4
+ const ModalHeader = aggregatedClasses('div')(blockName, 'modal-header', _ref => {
5
+ let {
6
+ type,
7
+ showClose
8
+ } = _ref;
9
+ return {
10
+ [type]: type,
11
+ 'with-close': showClose
12
+ };
13
+ });
14
+ const ModalHeaderTopRight = aggregatedClasses('div')(blockName, 'modal-header-close', _ref2 => {
15
+ let {
16
+ type
17
+ } = _ref2;
18
+ return {
19
+ [type]: type
20
+ };
21
+ });
22
+ const ModalFeedback = aggregatedClasses('div')(blockName, 'modal-feedback', _ref3 => {
23
+ let {
24
+ type
25
+ } = _ref3;
26
+ return {
27
+ [type]: type
28
+ };
29
+ });
30
+ const ModalTitle = aggregatedClasses('h3')(blockName, 'modal-title', _ref4 => {
31
+ let {
32
+ type
33
+ } = _ref4;
34
+ return {
35
+ [type]: type
36
+ };
37
+ });
38
+ const ModalContent = aggregatedClasses('div')(blockName, 'modal-content', _ref5 => {
39
+ let {
40
+ type,
41
+ removePadding
42
+ } = _ref5;
43
+ return {
44
+ [type]: type,
45
+ 'remove-padding': removePadding
46
+ };
47
+ });
48
+ const ModalWrapper = aggregatedClasses('div')(blockName, 'modal-wrapper', _ref6 => {
49
+ let {
50
+ type,
51
+ removePadding
52
+ } = _ref6;
53
+ return {
54
+ [type]: type,
55
+ 'remove-padding': removePadding
56
+ };
57
+ });
58
+ const ModalFooter = aggregatedClasses('div')(blockName, 'modal-footer', _ref7 => {
59
+ let {
60
+ type,
61
+ additionalFooterCssClass
62
+ } = _ref7;
63
+ return {
64
+ [type]: type,
65
+ [additionalFooterCssClass]: additionalFooterCssClass
66
+ };
67
+ });
68
+ const ModalFooterActions = aggregatedClasses('div')(blockName, 'modal-footer-actions', _ref8 => {
69
+ let {
70
+ type
71
+ } = _ref8;
72
+ return {
73
+ [type]: type
74
+ };
75
+ });
76
+
77
+ export { ModalContent, ModalFeedback, ModalFooter, ModalFooterActions, ModalHeader, ModalHeaderTopRight, ModalTitle, ModalWrapper };
@@ -1,19 +1,28 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { Close } from "@elliemae/ds-icons";
4
- import DSButton from "@elliemae/ds-button";
5
- import { ModalHeader } from "../blocks";
6
- const DecisionHeader = ({ onClose, showClose }) => /* @__PURE__ */ React2.createElement(ModalHeader, {
7
- classProps: { type: "decision", showClose }
8
- }, showClose && /* @__PURE__ */ React2.createElement(DSButton, {
9
- buttonType: "link",
10
- containerProps: { "data-testid": "modal-button-close" },
11
- icon: /* @__PURE__ */ React2.createElement(Close, null),
12
- onClick: onClose
13
- }));
14
- var DecisionHeader_default = DecisionHeader;
15
- export {
16
- DecisionHeader,
17
- DecisionHeader_default as default
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { Close } from '@elliemae/ds-icons';
4
+ import DSButton from '@elliemae/ds-button';
5
+ import { ModalHeader } from '../blocks.js';
6
+
7
+ var _Close;
8
+ const DecisionHeader = _ref => {
9
+ let {
10
+ onClose,
11
+ showClose
12
+ } = _ref;
13
+ return /*#__PURE__*/_jsx(ModalHeader, {
14
+ classProps: {
15
+ type: 'decision',
16
+ showClose
17
+ }
18
+ }, void 0, showClose && /*#__PURE__*/_jsx(DSButton, {
19
+ buttonType: "link",
20
+ containerProps: {
21
+ 'data-testid': 'modal-button-close'
22
+ },
23
+ icon: _Close || (_Close = /*#__PURE__*/_jsx(Close, {})),
24
+ onClick: onClose
25
+ }));
18
26
  };
19
- //# sourceMappingURL=DecisionHeader.js.map
27
+
28
+ export { DecisionHeader, DecisionHeader as default };