@elliemae/ds-modal 2.0.0-alpha.1 → 2.0.0-alpha.13

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 (36) hide show
  1. package/cjs/DSModal.js +40 -35
  2. package/cjs/constants.js +1 -1
  3. package/cjs/index.js +1 -1
  4. package/cjs/v1/DSModal.js +60 -55
  5. package/cjs/v1/DSModalWrapper.js +25 -18
  6. package/cjs/v1/ModalFeedBack/ModalFeedBack.js +25 -30
  7. package/cjs/v2/DSModal.js +49 -42
  8. package/cjs/v2/blocks.js +72 -48
  9. package/cjs/v2/components/DecisionHeader.js +22 -20
  10. package/cjs/v2/components/FeedbackIcon.js +17 -23
  11. package/cjs/v2/components/Footer.js +45 -37
  12. package/cjs/v2/components/FormHeader.js +31 -29
  13. package/cjs/v2/components/ModalContent.js +85 -77
  14. package/cjs/v2/components/SelectionHeader.js +29 -22
  15. package/cjs/v2/components/Title.js +12 -9
  16. package/cjs/v2/helpers.js +21 -16
  17. package/esm/DSModal.js +5 -0
  18. package/esm/v1/DSModal.js +48 -42
  19. package/esm/v1/DSModalWrapper.js +24 -17
  20. package/esm/v1/ModalFeedBack/ModalFeedBack.js +19 -20
  21. package/esm/v2/DSModal.js +42 -35
  22. package/esm/v2/blocks.js +72 -48
  23. package/esm/v2/components/DecisionHeader.js +21 -18
  24. package/esm/v2/components/FeedbackIcon.js +11 -12
  25. package/esm/v2/components/Footer.js +43 -35
  26. package/esm/v2/components/FormHeader.js +30 -27
  27. package/esm/v2/components/ModalContent.js +84 -76
  28. package/esm/v2/components/SelectionHeader.js +27 -19
  29. package/esm/v2/components/Title.js +11 -8
  30. package/esm/v2/helpers.js +21 -16
  31. package/package.json +13 -4
  32. package/types/v1/DSModal.d.ts +1 -1
  33. package/types/v2/DSModal.d.ts +197 -28
  34. package/types/v2/components/SelectionHeader.d.ts +1 -1
  35. package/cjs/package.json +0 -7
  36. package/esm/package.json +0 -7
package/esm/v2/DSModal.js CHANGED
@@ -1,3 +1,8 @@
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';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
@@ -12,39 +17,41 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
12
17
 
13
18
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
14
19
 
15
- const DSModal = ({
16
- containerProps = {},
17
- className = '',
18
- style = {},
19
- size = 'default',
20
- //
21
- modalType = MODAL_TYPE_V2.INFORMATION,
22
- modalSubType = null,
23
- modalTitle = '',
24
- dataTestId = 'ds-modal',
25
- centered = false,
26
- showRejectButton = false,
27
- showClose = true,
28
- searchProps = {},
29
- // override
30
- actionsRef = () => null,
31
- additionalFooterCssClass,
32
- overridePropsConfirmButton = {},
33
- overridePropsRejectButton = {},
34
- // react modal
35
- children,
36
- isOpen = true,
37
- onClose = () => null,
38
- onAfterOpen = () => null,
39
- onConfirm = () => null,
40
- onReject = () => null,
41
- rejectLabel = 'Discard',
42
- confirmLabel = 'Save',
43
- shouldCloseOnOverlayClick = false,
44
- appElement = '#root',
45
- zIndex = 10,
46
- removePadding = false
47
- }) => {
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
+
48
55
  if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal.setAppElement) {
49
56
  ReactModal.setAppElement(appElement);
50
57
  }
@@ -58,12 +65,12 @@ const DSModal = ({
58
65
  });
59
66
  return /*#__PURE__*/_jsx(ReactModal, {
60
67
  testId: dataTestId,
61
- className: `${cssClassName} ${classNameBlock(`type-${modalType}`)}`,
68
+ className: "".concat(cssClassName, " ").concat(classNameBlock("type-".concat(modalType))),
62
69
  contentLabel: modalTitle,
63
70
  isOpen: isOpen,
64
71
  onAfterOpen: onAfterOpen,
65
72
  onRequestClose: onClose,
66
- overlayClassName: `${classNameBlock('overlay')} ${classNameModifier(centered ? 'center' : 'top')}`,
73
+ overlayClassName: "".concat(classNameBlock('overlay'), " ").concat(classNameModifier(centered ? 'center' : 'top')),
67
74
  shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
68
75
  style: {
69
76
  content: _objectSpread({}, style),
package/esm/v2/blocks.js CHANGED
@@ -1,53 +1,77 @@
1
1
  import { aggregatedClasses } from '@elliemae/ds-classnames';
2
2
 
3
3
  const blockName = 'modal-v2';
4
- const ModalHeader = aggregatedClasses('div')(blockName, 'modal-header', ({
5
- type,
6
- showClose
7
- }) => ({
8
- [type]: type,
9
- 'with-close': showClose
10
- }));
11
- const ModalHeaderTopRight = aggregatedClasses('div')(blockName, 'modal-header-close', ({
12
- type
13
- }) => ({
14
- [type]: type
15
- }));
16
- const ModalFeedback = aggregatedClasses('div')(blockName, 'modal-feedback', ({
17
- type
18
- }) => ({
19
- [type]: type
20
- }));
21
- const ModalTitle = aggregatedClasses('h3')(blockName, 'modal-title', ({
22
- type
23
- }) => ({
24
- [type]: type
25
- }));
26
- const ModalContent = aggregatedClasses('div')(blockName, 'modal-content', ({
27
- type,
28
- removePadding
29
- }) => ({
30
- [type]: type,
31
- 'remove-padding': removePadding
32
- }));
33
- const ModalWrapper = aggregatedClasses('div')(blockName, 'modal-wrapper', ({
34
- type,
35
- removePadding
36
- }) => ({
37
- [type]: type,
38
- 'remove-padding': removePadding
39
- }));
40
- const ModalFooter = aggregatedClasses('div')(blockName, 'modal-footer', ({
41
- type,
42
- additionalFooterCssClass
43
- }) => ({
44
- [type]: type,
45
- [additionalFooterCssClass]: additionalFooterCssClass
46
- }));
47
- const ModalFooterActions = aggregatedClasses('div')(blockName, 'modal-footer-actions', ({
48
- type
49
- }) => ({
50
- [type]: type
51
- }));
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
+ });
52
76
 
53
77
  export { ModalContent, ModalFeedback, ModalFooter, ModalFooterActions, ModalHeader, ModalHeaderTopRight, ModalTitle, ModalWrapper };
@@ -1,25 +1,28 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import CloseIcon from '@elliemae/ds-icons/Close';
4
- import DSButton from '@elliemae/ds-basic/Button';
3
+ import { Close } from '@elliemae/ds-icons';
4
+ import DSButton from '@elliemae/ds-button';
5
5
  import { ModalHeader } from '../blocks.js';
6
6
 
7
- var _CloseIcon;
8
- const DecisionHeader = ({
9
- onClose,
10
- showClose
11
- }) => /*#__PURE__*/_jsx(ModalHeader, {
12
- classProps: {
13
- type: 'decision',
7
+ var _Close;
8
+ const DecisionHeader = _ref => {
9
+ let {
10
+ onClose,
14
11
  showClose
15
- }
16
- }, void 0, showClose && /*#__PURE__*/_jsx(DSButton, {
17
- buttonType: "link",
18
- containerProps: {
19
- 'data-testid': 'modal-button-close'
20
- },
21
- icon: _CloseIcon || (_CloseIcon = /*#__PURE__*/_jsx(CloseIcon, {})),
22
- onClick: onClose
23
- }));
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
+ }));
26
+ };
24
27
 
25
28
  export { DecisionHeader, DecisionHeader as default };
@@ -1,10 +1,6 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import ErrorHexegon from '@elliemae/ds-icons/ErrorHexegon';
4
- import WarningTriangle from '@elliemae/ds-icons/WarningTriangle';
5
- import CheckmarkCircle from '@elliemae/ds-icons/CheckmarkCircle';
6
- import HelpCircle from '@elliemae/ds-icons/HelpCircle';
7
- import InfoCircle from '@elliemae/ds-icons/InfoCircle';
3
+ import { HelpCircle, InfoCircle, CheckmarkCircle, ErrorHexegon, WarningTriangle } from '@elliemae/ds-icons';
8
4
  import { MODAL_SUB_TYPE_V2 } from '../../constants.js';
9
5
  import { ModalFeedback } from '../blocks.js';
10
6
 
@@ -45,12 +41,15 @@ const getIconType = subtype => {
45
41
  }
46
42
  };
47
43
 
48
- const FeedbackIcon = ({
49
- modalSubType
50
- }) => /*#__PURE__*/_jsx(ModalFeedback, {
51
- classProps: {
52
- type: modalSubType
53
- }
54
- }, void 0, getIconType(modalSubType));
44
+ const FeedbackIcon = _ref => {
45
+ let {
46
+ modalSubType
47
+ } = _ref;
48
+ return /*#__PURE__*/_jsx(ModalFeedback, {
49
+ classProps: {
50
+ type: modalSubType
51
+ }
52
+ }, void 0, getIconType(modalSubType));
53
+ };
55
54
 
56
55
  export { FeedbackIcon, FeedbackIcon as default };
@@ -1,47 +1,55 @@
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';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
4
- import DSButton from '@elliemae/ds-basic/Button';
9
+ import DSButton from '@elliemae/ds-button';
5
10
  import { ModalFooter, ModalFooterActions } from '../blocks.js';
6
11
  import { jsxs, jsx } from 'react/jsx-runtime';
7
12
 
8
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
14
 
10
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
- const Footer = ({
12
- additionalFooterCssClass,
13
- actionsRef,
14
- rejectLabel,
15
- onReject,
16
- overridePropsRejectButton,
17
- confirmLabel,
18
- onConfirm,
19
- overridePropsConfirmButton,
20
- showRejectButton
21
- }) => /*#__PURE__*/_jsx(ModalFooter, {
22
- classProps: {
23
- additionalFooterCssClass
24
- },
25
- "data-testid": "modal-footer-wrapper"
26
- }, void 0, /*#__PURE__*/jsxs(ModalFooterActions, {
27
- ref: actionsRef,
28
- children: [showRejectButton === true && /*#__PURE__*/jsx(DSButton, _objectSpread({
29
- buttonType: "secondary",
30
- className: "action-reject",
31
- containerProps: {
32
- 'data-testid': 'modal-footer-reject-btn'
16
+ const Footer = _ref => {
17
+ let {
18
+ additionalFooterCssClass,
19
+ actionsRef,
20
+ rejectLabel,
21
+ onReject,
22
+ overridePropsRejectButton,
23
+ confirmLabel,
24
+ onConfirm,
25
+ overridePropsConfirmButton,
26
+ showRejectButton
27
+ } = _ref;
28
+ return /*#__PURE__*/_jsx(ModalFooter, {
29
+ classProps: {
30
+ additionalFooterCssClass
33
31
  },
34
- labelText: rejectLabel,
35
- onClick: onReject
36
- }, overridePropsRejectButton)), /*#__PURE__*/jsx(DSButton, _objectSpread({
37
- buttonType: "primary",
38
- className: "action-confirm",
39
- containerProps: {
40
- 'data-testid': 'modal-footer-confirm-btn'
41
- },
42
- labelText: confirmLabel,
43
- onClick: onConfirm
44
- }, overridePropsConfirmButton))]
45
- }));
32
+ "data-testid": "modal-footer-wrapper"
33
+ }, void 0, /*#__PURE__*/jsxs(ModalFooterActions, {
34
+ ref: actionsRef,
35
+ children: [showRejectButton === true && /*#__PURE__*/jsx(DSButton, _objectSpread({
36
+ buttonType: "secondary",
37
+ className: "action-reject",
38
+ containerProps: {
39
+ 'data-testid': 'modal-footer-reject-btn'
40
+ },
41
+ labelText: rejectLabel,
42
+ onClick: onReject
43
+ }, overridePropsRejectButton)), /*#__PURE__*/jsx(DSButton, _objectSpread({
44
+ buttonType: "primary",
45
+ className: "action-confirm",
46
+ containerProps: {
47
+ 'data-testid': 'modal-footer-confirm-btn'
48
+ },
49
+ labelText: confirmLabel,
50
+ onClick: onConfirm
51
+ }, overridePropsConfirmButton))]
52
+ }));
53
+ };
46
54
 
47
55
  export { Footer, Footer as default };
@@ -1,34 +1,37 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import CloseIcon from '@elliemae/ds-icons/Close';
4
- import DSButton from '@elliemae/ds-basic/Button';
3
+ import { Close } from '@elliemae/ds-icons';
4
+ import DSButton from '@elliemae/ds-button';
5
5
  import { ModalHeader, ModalHeaderTopRight } from '../blocks.js';
6
6
  import { Title } from './Title.js';
7
7
 
8
- var _CloseIcon;
9
- const FormHeader = ({
10
- showClose,
11
- modalTitle,
12
- modalType,
13
- onClose
14
- }) => /*#__PURE__*/_jsx(ModalHeader, {
15
- classProps: {
16
- type: 'selection'
17
- }
18
- }, void 0, /*#__PURE__*/_jsx(Title, {
19
- modalTitle: modalTitle,
20
- modalType: modalType
21
- }), /*#__PURE__*/_jsx(ModalHeaderTopRight, {
22
- classProps: {
23
- type: 'form'
24
- }
25
- }, void 0, showClose && /*#__PURE__*/_jsx(DSButton, {
26
- buttonType: "link",
27
- containerProps: {
28
- 'data-testid': 'modal-close-btn'
29
- },
30
- icon: _CloseIcon || (_CloseIcon = /*#__PURE__*/_jsx(CloseIcon, {})),
31
- onClick: onClose
32
- })));
8
+ var _Close;
9
+ const FormHeader = _ref => {
10
+ let {
11
+ showClose,
12
+ modalTitle,
13
+ modalType,
14
+ onClose
15
+ } = _ref;
16
+ return /*#__PURE__*/_jsx(ModalHeader, {
17
+ classProps: {
18
+ type: 'selection'
19
+ }
20
+ }, void 0, /*#__PURE__*/_jsx(Title, {
21
+ modalTitle: modalTitle,
22
+ modalType: modalType
23
+ }), /*#__PURE__*/_jsx(ModalHeaderTopRight, {
24
+ classProps: {
25
+ type: 'form'
26
+ }
27
+ }, void 0, showClose && /*#__PURE__*/_jsx(DSButton, {
28
+ buttonType: "link",
29
+ containerProps: {
30
+ 'data-testid': 'modal-close-btn'
31
+ },
32
+ icon: _Close || (_Close = /*#__PURE__*/_jsx(Close, {})),
33
+ onClick: onClose
34
+ })));
35
+ };
33
36
 
34
37
  export { FormHeader, FormHeader as default };
@@ -1,3 +1,8 @@
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';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
8
  import 'react';
@@ -15,81 +20,84 @@ import { jsxs } from 'react/jsx-runtime';
15
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
16
21
 
17
22
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
18
- const DSModalContent = ({
19
- containerProps = {},
20
- //
21
- modalType = MODAL_TYPE_V2.INFORMATION,
22
- modalSubType = null,
23
- modalTitle = '',
24
- showRejectButton = false,
25
- showClose = true,
26
- searchProps = {},
27
- // override
28
- actionsRef = () => null,
29
- additionalFooterCssClass,
30
- overridePropsConfirmButton = {},
31
- overridePropsRejectButton = {},
32
- // react modal
33
- children,
34
- onClose = () => null,
35
- onConfirm = () => null,
36
- onReject = () => null,
37
- rejectLabel = 'Discard',
38
- confirmLabel = 'Save',
39
- removePadding = false
40
- }) => /*#__PURE__*/jsxs(ModalWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
41
- children: [showForm({
42
- modalType,
43
- modalSubType
44
- }) && /*#__PURE__*/_jsx(FormHeader, {
45
- modalTitle: modalTitle,
46
- modalType: modalType,
47
- onClose: onClose,
48
- showClose: showClose
49
- }), showSelection({
50
- modalType,
51
- modalSubType
52
- }) && /*#__PURE__*/_jsx(SelectionHeader, {
53
- modalTitle: modalTitle,
54
- modalType: modalType,
55
- searchProps: searchProps,
56
- showClose: showClose
57
- }), showDecision({
58
- modalType,
59
- modalSubType
60
- }) && /*#__PURE__*/_jsx(DecisionHeader, {
61
- onClose: onClose,
62
- showClose: showClose
63
- }), showFeedBack({
64
- modalType,
65
- modalSubType
66
- }) && /*#__PURE__*/_jsx(FeedbackIcon, {
67
- modalSubType: modalSubType
68
- }), showDecision({
69
- modalType,
70
- modalSubType
71
- }) && /*#__PURE__*/_jsx(Title, {
72
- modalTitle: modalTitle,
73
- modalType: modalType
74
- }), /*#__PURE__*/_jsx(ModalContent, {
75
- classProps: {
76
- type: modalType,
77
- removePadding
78
- }
79
- }, void 0, children), showFooter({
80
- modalType,
81
- modalSubType
82
- }) && /*#__PURE__*/_jsx(Footer, {
83
- actionsRef: actionsRef,
84
- additionalFooterCssClass: additionalFooterCssClass,
85
- confirmLabel: confirmLabel,
86
- onConfirm: onConfirm,
87
- onReject: onReject,
88
- overridePropsConfirmButton: overridePropsConfirmButton,
89
- overridePropsRejectButton: overridePropsRejectButton,
90
- rejectLabel: rejectLabel,
91
- showRejectButton: showRejectButton
92
- })]
93
- }));
23
+ const DSModalContent = _ref => {
24
+ let {
25
+ containerProps = {},
26
+ //
27
+ modalType = MODAL_TYPE_V2.INFORMATION,
28
+ modalSubType = null,
29
+ modalTitle = '',
30
+ showRejectButton = false,
31
+ showClose = true,
32
+ searchProps = {},
33
+ // override
34
+ actionsRef = () => null,
35
+ additionalFooterCssClass,
36
+ overridePropsConfirmButton = {},
37
+ overridePropsRejectButton = {},
38
+ // react modal
39
+ children,
40
+ onClose = () => null,
41
+ onConfirm = () => null,
42
+ onReject = () => null,
43
+ rejectLabel = 'Discard',
44
+ confirmLabel = 'Save',
45
+ removePadding = false
46
+ } = _ref;
47
+ return /*#__PURE__*/jsxs(ModalWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
48
+ children: [showForm({
49
+ modalType,
50
+ modalSubType
51
+ }) && /*#__PURE__*/_jsx(FormHeader, {
52
+ modalTitle: modalTitle,
53
+ modalType: modalType,
54
+ onClose: onClose,
55
+ showClose: showClose
56
+ }), showSelection({
57
+ modalType,
58
+ modalSubType
59
+ }) && /*#__PURE__*/_jsx(SelectionHeader, {
60
+ modalTitle: modalTitle,
61
+ modalType: modalType,
62
+ searchProps: searchProps,
63
+ showClose: showClose
64
+ }), showDecision({
65
+ modalType,
66
+ modalSubType
67
+ }) && /*#__PURE__*/_jsx(DecisionHeader, {
68
+ onClose: onClose,
69
+ showClose: showClose
70
+ }), showFeedBack({
71
+ modalType,
72
+ modalSubType
73
+ }) && /*#__PURE__*/_jsx(FeedbackIcon, {
74
+ modalSubType: modalSubType
75
+ }), showDecision({
76
+ modalType,
77
+ modalSubType
78
+ }) && /*#__PURE__*/_jsx(Title, {
79
+ modalTitle: modalTitle,
80
+ modalType: modalType
81
+ }), /*#__PURE__*/_jsx(ModalContent, {
82
+ classProps: {
83
+ type: modalType,
84
+ removePadding
85
+ }
86
+ }, void 0, children), showFooter({
87
+ modalType,
88
+ modalSubType
89
+ }) && /*#__PURE__*/_jsx(Footer, {
90
+ actionsRef: actionsRef,
91
+ additionalFooterCssClass: additionalFooterCssClass,
92
+ confirmLabel: confirmLabel,
93
+ onConfirm: onConfirm,
94
+ onReject: onReject,
95
+ overridePropsConfirmButton: overridePropsConfirmButton,
96
+ overridePropsRejectButton: overridePropsRejectButton,
97
+ rejectLabel: rejectLabel,
98
+ showRejectButton: showRejectButton
99
+ })]
100
+ }));
101
+ };
94
102
 
95
103
  export { DSModalContent };