@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,44 +1,55 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { ErrorHexegon, WarningTriangle, CheckmarkCircle, HelpCircle, InfoCircle } from "@elliemae/ds-icons";
4
- import { MODAL_SUB_TYPE_V2 } from "../../constants";
5
- import { ModalFeedback } from "../blocks";
6
- const feedbackIconSize = "xxl";
7
- const getIconType = (subtype) => {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { HelpCircle, InfoCircle, CheckmarkCircle, ErrorHexegon, WarningTriangle } from '@elliemae/ds-icons';
4
+ import { MODAL_SUB_TYPE_V2 } from '../../constants.js';
5
+ import { ModalFeedback } from '../blocks.js';
6
+
7
+ var _WarningTriangle, _ErrorHexegon, _CheckmarkCircle, _InfoCircle, _HelpCircle;
8
+ const feedbackIconSize = 'xxl';
9
+
10
+ const getIconType = subtype => {
8
11
  switch (subtype) {
9
12
  case MODAL_SUB_TYPE_V2.WARNING:
10
- return /* @__PURE__ */ React2.createElement(WarningTriangle, {
13
+ return _WarningTriangle || (_WarningTriangle = /*#__PURE__*/_jsx(WarningTriangle, {
11
14
  "data-testid": "icon-waring",
12
15
  size: feedbackIconSize
13
- });
16
+ }));
17
+
14
18
  case MODAL_SUB_TYPE_V2.ERROR:
15
- return /* @__PURE__ */ React2.createElement(ErrorHexegon, {
19
+ return _ErrorHexegon || (_ErrorHexegon = /*#__PURE__*/_jsx(ErrorHexegon, {
16
20
  "data-testid": "icon-error",
17
21
  size: feedbackIconSize
18
- });
22
+ }));
23
+
19
24
  case MODAL_SUB_TYPE_V2.SUCCESS:
20
- return /* @__PURE__ */ React2.createElement(CheckmarkCircle, {
25
+ return _CheckmarkCircle || (_CheckmarkCircle = /*#__PURE__*/_jsx(CheckmarkCircle, {
21
26
  "data-testid": "icon-success",
22
27
  size: feedbackIconSize
23
- });
28
+ }));
29
+
24
30
  case MODAL_SUB_TYPE_V2.INFORMATION:
25
- return /* @__PURE__ */ React2.createElement(InfoCircle, {
31
+ return _InfoCircle || (_InfoCircle = /*#__PURE__*/_jsx(InfoCircle, {
26
32
  "data-testid": "icon-information",
27
33
  size: feedbackIconSize
28
- });
34
+ }));
35
+
29
36
  default:
30
- return /* @__PURE__ */ React2.createElement(HelpCircle, {
37
+ return _HelpCircle || (_HelpCircle = /*#__PURE__*/_jsx(HelpCircle, {
31
38
  "data-testid": "icon-help",
32
39
  size: feedbackIconSize
33
- });
40
+ }));
34
41
  }
35
42
  };
36
- const FeedbackIcon = ({ modalSubType }) => /* @__PURE__ */ React2.createElement(ModalFeedback, {
37
- classProps: { type: modalSubType }
38
- }, getIconType(modalSubType));
39
- var FeedbackIcon_default = FeedbackIcon;
40
- export {
41
- FeedbackIcon,
42
- FeedbackIcon_default as default
43
+
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));
43
53
  };
44
- //# sourceMappingURL=FeedbackIcon.js.map
54
+
55
+ export { FeedbackIcon, FeedbackIcon as default };
@@ -1,40 +1,55 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import DSButton from "@elliemae/ds-button";
4
- import { ModalFooter, ModalFooterActions } from "../blocks";
5
- const Footer = ({
6
- additionalFooterCssClass,
7
- actionsRef,
8
- rejectLabel,
9
- onReject,
10
- overridePropsRejectButton,
11
- confirmLabel,
12
- onConfirm,
13
- overridePropsConfirmButton,
14
- showRejectButton
15
- }) => /* @__PURE__ */ React2.createElement(ModalFooter, {
16
- classProps: { additionalFooterCssClass },
17
- "data-testid": "modal-footer-wrapper"
18
- }, /* @__PURE__ */ React2.createElement(ModalFooterActions, {
19
- ref: actionsRef
20
- }, showRejectButton === true && /* @__PURE__ */ React2.createElement(DSButton, {
21
- buttonType: "secondary",
22
- className: "action-reject",
23
- containerProps: { "data-testid": "modal-footer-reject-btn" },
24
- labelText: rejectLabel,
25
- onClick: onReject,
26
- ...overridePropsRejectButton
27
- }), /* @__PURE__ */ React2.createElement(DSButton, {
28
- buttonType: "primary",
29
- className: "action-confirm",
30
- containerProps: { "data-testid": "modal-footer-confirm-btn" },
31
- labelText: confirmLabel,
32
- onClick: onConfirm,
33
- ...overridePropsConfirmButton
34
- })));
35
- var Footer_default = Footer;
36
- export {
37
- Footer,
38
- Footer_default as default
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 DSButton from '@elliemae/ds-button';
10
+ import { ModalFooter, ModalFooterActions } from '../blocks.js';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
12
+
13
+ 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; }
14
+
15
+ 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; }
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
31
+ },
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
+ }));
39
53
  };
40
- //# sourceMappingURL=Footer.js.map
54
+
55
+ export { Footer, Footer as default };
@@ -1,25 +1,37 @@
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, ModalHeaderTopRight } from "../blocks";
6
- import { Title } from "./Title";
7
- const FormHeader = ({ showClose, modalTitle, modalType, onClose }) => /* @__PURE__ */ React2.createElement(ModalHeader, {
8
- classProps: { type: "selection" }
9
- }, /* @__PURE__ */ React2.createElement(Title, {
10
- modalTitle,
11
- modalType
12
- }), /* @__PURE__ */ React2.createElement(ModalHeaderTopRight, {
13
- classProps: { type: "form" }
14
- }, showClose && /* @__PURE__ */ React2.createElement(DSButton, {
15
- buttonType: "link",
16
- containerProps: { "data-testid": "modal-close-btn" },
17
- icon: /* @__PURE__ */ React2.createElement(Close, null),
18
- onClick: onClose
19
- })));
20
- var FormHeader_default = FormHeader;
21
- export {
22
- FormHeader,
23
- FormHeader_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, ModalHeaderTopRight } from '../blocks.js';
6
+ import { Title } from './Title.js';
7
+
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
+ })));
24
35
  };
25
- //# sourceMappingURL=FormHeader.js.map
36
+
37
+ export { FormHeader, FormHeader as default };
@@ -1,73 +1,103 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { MODAL_TYPE_V2 } from "../../constants";
4
- import { SelectionHeader } from "./SelectionHeader";
5
- import { DecisionHeader } from "./DecisionHeader";
6
- import { FormHeader } from "./FormHeader";
7
- import { FeedbackIcon } from "./FeedbackIcon";
8
- import { Footer } from "./Footer";
9
- import { Title } from "./Title";
10
- import {
11
- showDecision,
12
- showFeedBack,
13
- showFooter,
14
- showSelection,
15
- showForm
16
- } from "../helpers";
17
- import { ModalContent, ModalWrapper } from "../blocks";
18
- const DSModalContent = ({
19
- containerProps = {},
20
- modalType = MODAL_TYPE_V2.INFORMATION,
21
- modalSubType = null,
22
- modalTitle = "",
23
- showRejectButton = false,
24
- showClose = true,
25
- searchProps = {},
26
- actionsRef = () => null,
27
- additionalFooterCssClass,
28
- overridePropsConfirmButton = {},
29
- overridePropsRejectButton = {},
30
- children,
31
- onClose = () => null,
32
- onConfirm = () => null,
33
- onReject = () => null,
34
- rejectLabel = "Discard",
35
- confirmLabel = "Save",
36
- removePadding = false
37
- }) => /* @__PURE__ */ React2.createElement(ModalWrapper, {
38
- ...containerProps
39
- }, showForm({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(FormHeader, {
40
- modalTitle,
41
- modalType,
42
- onClose,
43
- showClose
44
- }), showSelection({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(SelectionHeader, {
45
- modalTitle,
46
- modalType,
47
- searchProps,
48
- showClose
49
- }), showDecision({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(DecisionHeader, {
50
- onClose,
51
- showClose
52
- }), showFeedBack({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(FeedbackIcon, {
53
- modalSubType
54
- }), showDecision({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(Title, {
55
- modalTitle,
56
- modalType
57
- }), /* @__PURE__ */ React2.createElement(ModalContent, {
58
- classProps: { type: modalType, removePadding }
59
- }, children), showFooter({ modalType, modalSubType }) && /* @__PURE__ */ React2.createElement(Footer, {
60
- actionsRef,
61
- additionalFooterCssClass,
62
- confirmLabel,
63
- onConfirm,
64
- onReject,
65
- overridePropsConfirmButton,
66
- overridePropsRejectButton,
67
- rejectLabel,
68
- showRejectButton
69
- }));
70
- export {
71
- DSModalContent
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import 'react';
9
+ import { MODAL_TYPE_V2 } from '../../constants.js';
10
+ import { SelectionHeader } from './SelectionHeader.js';
11
+ import { DecisionHeader } from './DecisionHeader.js';
12
+ import { FormHeader } from './FormHeader.js';
13
+ import { FeedbackIcon } from './FeedbackIcon.js';
14
+ import { Footer } from './Footer.js';
15
+ import { Title } from './Title.js';
16
+ import { showForm, showSelection, showDecision, showFeedBack, showFooter } from '../helpers.js';
17
+ import { ModalWrapper, ModalContent } from '../blocks.js';
18
+ import { jsxs } from 'react/jsx-runtime';
19
+
20
+ 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; }
21
+
22
+ 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; }
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
+ }));
72
101
  };
73
- //# sourceMappingURL=ModalContent.js.map
102
+
103
+ export { DSModalContent };
@@ -1,22 +1,39 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { DSSearchBox } from "@elliemae/ds-form";
4
- import { ModalHeader, ModalHeaderTopRight } from "../blocks";
5
- import { Title } from "./Title";
6
- const SelectionHeader = ({ searchProps = {}, modalTitle, modalType, showClose }) => /* @__PURE__ */ React2.createElement(ModalHeader, {
7
- classProps: { type: "selection" }
8
- }, /* @__PURE__ */ React2.createElement(Title, {
9
- modalTitle,
10
- modalType
11
- }), showClose && /* @__PURE__ */ React2.createElement(ModalHeaderTopRight, {
12
- classProps: { type: "selection" },
13
- "data-testid": "modal-search-box"
14
- }, /* @__PURE__ */ React2.createElement(DSSearchBox, {
15
- ...searchProps
16
- })));
17
- var SelectionHeader_default = SelectionHeader;
18
- export {
19
- SelectionHeader,
20
- SelectionHeader_default as default
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import 'react';
9
+ import { DSSearchBox } from '@elliemae/ds-form';
10
+ import { ModalHeader, ModalHeaderTopRight } from '../blocks.js';
11
+ import { Title } from './Title.js';
12
+ import { jsx } from 'react/jsx-runtime';
13
+
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
+ const SelectionHeader = _ref => {
18
+ let {
19
+ searchProps = {},
20
+ modalTitle,
21
+ modalType,
22
+ showClose
23
+ } = _ref;
24
+ return /*#__PURE__*/_jsx(ModalHeader, {
25
+ classProps: {
26
+ type: 'selection'
27
+ }
28
+ }, void 0, /*#__PURE__*/_jsx(Title, {
29
+ modalTitle: modalTitle,
30
+ modalType: modalType
31
+ }), showClose && /*#__PURE__*/_jsx(ModalHeaderTopRight, {
32
+ classProps: {
33
+ type: 'selection'
34
+ },
35
+ "data-testid": "modal-search-box"
36
+ }, void 0, /*#__PURE__*/jsx(DSSearchBox, _objectSpread({}, searchProps))));
21
37
  };
22
- //# sourceMappingURL=SelectionHeader.js.map
38
+
39
+ export { SelectionHeader, SelectionHeader as default };
@@ -1,12 +1,17 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { ModalTitle } from "../blocks";
4
- const Title = ({ modalTitle, modalType }) => /* @__PURE__ */ React2.createElement(ModalTitle, {
5
- classProps: { type: modalType }
6
- }, modalTitle);
7
- var Title_default = Title;
8
- export {
9
- Title,
10
- Title_default as default
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { ModalTitle } from '../blocks.js';
4
+
5
+ const Title = _ref => {
6
+ let {
7
+ modalTitle,
8
+ modalType
9
+ } = _ref;
10
+ return /*#__PURE__*/_jsx(ModalTitle, {
11
+ classProps: {
12
+ type: modalType
13
+ }
14
+ }, void 0, modalTitle);
11
15
  };
12
- //# sourceMappingURL=Title.js.map
16
+
17
+ export { Title, Title as default };
package/esm/v2/helpers.js CHANGED
@@ -1,25 +1,37 @@
1
- import * as React from "react";
2
- import { MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from "../constants";
3
- function showDecision({ modalType }) {
1
+ import { MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from '../constants.js';
2
+
3
+ function showDecision(_ref) {
4
+ let {
5
+ modalType
6
+ } = _ref;
4
7
  return [MODAL_TYPE_V2.INFORMATION, MODAL_TYPE_V2.DECISION].indexOf(modalType) > -1;
5
8
  }
6
- function showFeedBack({ modalType, modalSubType }) {
7
- return showDecision({ modalType }) && Object.values(MODAL_SUB_TYPE_V2).indexOf(modalSubType) > -1;
9
+ function showFeedBack(_ref2) {
10
+ let {
11
+ modalType,
12
+ modalSubType
13
+ } = _ref2;
14
+ return showDecision({
15
+ modalType
16
+ }) && Object.values(MODAL_SUB_TYPE_V2).indexOf(modalSubType) > -1;
8
17
  }
9
- function showFooter({ modalType }) {
18
+ function showFooter(_ref3) {
19
+ let {
20
+ modalType
21
+ } = _ref3;
10
22
  return modalType !== MODAL_TYPE_V2.INFORMATION;
11
23
  }
12
- function showSelection({ modalType }) {
24
+ function showSelection(_ref4) {
25
+ let {
26
+ modalType
27
+ } = _ref4;
13
28
  return modalType === MODAL_TYPE_V2.SELECTION;
14
29
  }
15
- function showForm({ modalType }) {
30
+ function showForm(_ref5) {
31
+ let {
32
+ modalType
33
+ } = _ref5;
16
34
  return modalType === MODAL_TYPE_V2.FORM;
17
35
  }
18
- export {
19
- showDecision,
20
- showFeedBack,
21
- showFooter,
22
- showForm,
23
- showSelection
24
- };
25
- //# sourceMappingURL=helpers.js.map
36
+
37
+ export { showDecision, showFeedBack, showFooter, showForm, showSelection };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-modal",
3
- "version": "2.2.0-alpha.4",
3
+ "version": "3.0.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Modal",
6
6
  "module": "./esm/index.js",
@@ -96,13 +96,13 @@
96
96
  "build": "node ../../scripts/build/build.js"
97
97
  },
98
98
  "dependencies": {
99
- "@elliemae/ds-button": "2.2.0-alpha.4",
100
- "@elliemae/ds-classnames": "2.2.0-alpha.4",
101
- "@elliemae/ds-form": "2.2.0-alpha.4",
102
- "@elliemae/ds-icon": "2.2.0-alpha.4",
103
- "@elliemae/ds-icons": "2.2.0-alpha.4",
104
- "@elliemae/ds-shared": "2.2.0-alpha.4",
105
- "@elliemae/ds-system": "2.2.0-alpha.4",
99
+ "@elliemae/ds-button": "3.0.0-next.2",
100
+ "@elliemae/ds-classnames": "3.0.0-next.2",
101
+ "@elliemae/ds-form": "3.0.0-next.2",
102
+ "@elliemae/ds-icon": "3.0.0-next.2",
103
+ "@elliemae/ds-icons": "3.0.0-next.2",
104
+ "@elliemae/ds-shared": "3.0.0-next.2",
105
+ "@elliemae/ds-system": "3.0.0-next.2",
106
106
  "prop-types": "~15.7.2",
107
107
  "react-desc": "~4.1.3",
108
108
  "react-modal": "~3.12.1"
@@ -10,5 +10,5 @@ declare const DSModal: {
10
10
  version: PropTypes.Requireable<number>;
11
11
  };
12
12
  };
13
- export { DSModalContent, DSModal };
13
+ export { DSModalContent };
14
14
  export default DSModal;
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSModal.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants';\nimport DSModalV1 from './v1/DSModal';\nimport DSModalV2, { DSModalContent } from './v2/DSModal';\nimport { sizes, iconSizes } from '@elliemae/ds-shared/prop-types';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n if (version === 2) return <DSModalV2 {...rest} />;\n return <DSModalV1 {...rest} />;\n};\n\nDSModal.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n};\n\nDSModalV1.propTypes = {\n version: PropTypes.oneOf([1, 2]),\n className: PropTypes.string,\n /**\n * Add an additional css class to the footer\n */\n additionalFooterCssClass: PropTypes.string,\n /**\n * Set style for the modal\n */\n style: PropTypes.objectOf(PropTypes.string),\n /**\n * Select size for the close icon\n */\n iconCloseSize: PropTypes.oneOf(iconSizes),\n /**\n * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']\n */\n modalType: PropTypes.oneOf(modalTypes),\n /**\n * Show the header or not\n */\n showHeader: PropTypes.bool,\n /**\n * Show the footer or not\n */\n showFooter: PropTypes.bool,\n /**\n * Main content of the modal\n */\n children: PropTypes.element.isRequired,\n /**\n * Content is centered or not\n */\n centered: PropTypes.bool,\n /**\n * Text to be added in the confirm button\n */\n confirmLabel: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n modalTitle: PropTypes.string,\n /**\n * Text to be added in the modal title\n */\n size: PropTypes.oneOf(sizes),\n /**\n * Modal is open or not\n */\n isOpen: PropTypes.bool,\n /**\n * Allows a function to be triggered once the modal is closed\n */\n onClose: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal is opened\n */\n onAfterOpen: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is confirmed\n */\n onConfirm: PropTypes.func,\n /**\n * Allows a function to be triggered once the modal open is rejected\n */\n onReject: PropTypes.func,\n /**\n * Text to be added in the reject button\n */\n rejectLabel: PropTypes.string,\n /**\n * If modal should close on overlay click\n */\n shouldCloseOnOverlayClick: PropTypes.bool,\n /**\n * Modal has error or not\n */\n hasError: PropTypes.bool,\n /**\n * Modal has warning or not\n */\n hasWarning: PropTypes.bool,\n /**\n * Modal has success or not\n */\n hasSuccess: PropTypes.bool,\n /**\n * Modal has info or not\n */\n hasInfo: PropTypes.bool,\n /**\n * Modal has help or not\n */\n hasHelp: PropTypes.bool,\n actionsRef: PropTypes.func,\n appElement: PropTypes.string,\n /**\n * Customized props for the confirm button\n */\n overridePropsConfirmButton: PropTypes.objectOf(PropTypes.shape({})),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.objectOf(PropTypes.string),\n /**\n * Show confirm button\n */\n showConfirmButton: PropTypes.bool,\n /**\n * Show confirm button\n */\n customCloseComponent: PropTypes.element,\n};\nexport { DSModalContent, DSModal };\nexport default DSModal;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAsB;AACtB,uBAA2B;AAC3B,qBAAsB;AACtB,sBAA0C;AAC1C,yBAAiC;AAEjC,MAAM,UAAU,CAAC,EAAE,UAAU,MAAM,WAAW;AAC5C,MAAI,YAAY;AAAG,WAAO,mDAAC,yBAAD;AAAA,SAAe;AAAA;AACzC,SAAO,mDAAC,wBAAD;AAAA,OAAe;AAAA;AAAA;AAGxB,QAAQ,YAAY;AAAA,EAClB,SAAS,0BAAU,MAAM,CAAC,GAAG;AAAA;AAG/B,uBAAU,YAAY;AAAA,EACpB,SAAS,0BAAU,MAAM,CAAC,GAAG;AAAA,EAC7B,WAAW,0BAAU;AAAA,EAIrB,0BAA0B,0BAAU;AAAA,EAIpC,OAAO,0BAAU,SAAS,0BAAU;AAAA,EAIpC,eAAe,0BAAU,MAAM;AAAA,EAI/B,WAAW,0BAAU,MAAM;AAAA,EAI3B,YAAY,0BAAU;AAAA,EAItB,YAAY,0BAAU;AAAA,EAItB,UAAU,0BAAU,QAAQ;AAAA,EAI5B,UAAU,0BAAU;AAAA,EAIpB,cAAc,0BAAU;AAAA,EAIxB,YAAY,0BAAU;AAAA,EAItB,MAAM,0BAAU,MAAM;AAAA,EAItB,QAAQ,0BAAU;AAAA,EAIlB,SAAS,0BAAU;AAAA,EAInB,aAAa,0BAAU;AAAA,EAIvB,WAAW,0BAAU;AAAA,EAIrB,UAAU,0BAAU;AAAA,EAIpB,aAAa,0BAAU;AAAA,EAIvB,2BAA2B,0BAAU;AAAA,EAIrC,UAAU,0BAAU;AAAA,EAIpB,YAAY,0BAAU;AAAA,EAItB,YAAY,0BAAU;AAAA,EAItB,SAAS,0BAAU;AAAA,EAInB,SAAS,0BAAU;AAAA,EACnB,YAAY,0BAAU;AAAA,EACtB,YAAY,0BAAU;AAAA,EAItB,4BAA4B,0BAAU,SAAS,0BAAU,MAAM;AAAA,EAI/D,2BAA2B,0BAAU,SAAS,0BAAU;AAAA,EAIxD,mBAAmB,0BAAU;AAAA,EAI7B,sBAAsB,0BAAU;AAAA;AAGlC,IAAO,kBAAQ;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/constants.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export const MODAL_TYPE = {\n DEFAULT: 'default',\n ALERT: 'alert',\n CONFIRM: 'confirm',\n NOTIFICATION: 'notification',\n WARNING: 'warning',\n ERROR: 'error',\n SUCCESS: 'success',\n HELP: 'help',\n INFO: 'info',\n};\n\nexport const modalTypes = [\n MODAL_TYPE.DEFAULT,\n MODAL_TYPE.ALERT,\n MODAL_TYPE.CONFIRM,\n MODAL_TYPE.NOTIFICATION,\n MODAL_TYPE.WARNING,\n MODAL_TYPE.ERROR,\n MODAL_TYPE.SUCCESS,\n MODAL_TYPE.HELP,\n MODAL_TYPE.INFO,\n];\n\nexport const MODAL_TYPE_V2 = {\n INFORMATION: 'information',\n DECISION: 'decision',\n SELECTION: 'selection',\n FORM: 'form',\n};\n\nexport const MODAL_SUB_TYPE_V2 = {\n SUCCESS: 'success',\n WARNING: 'warning',\n ERROR: 'error',\n INFORMATION: 'information',\n};\n\nexport default MODAL_TYPE;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,cAAc;AAAA,EACd,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA;AAGD,MAAM,aAAa;AAAA,EACxB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA,EACX,WAAW;AAAA;AAGN,MAAM,gBAAgB;AAAA,EAC3B,aAAa;AAAA,EACb,UAAU;AAAA,EACV,WAAW;AAAA,EACX,MAAM;AAAA;AAGD,MAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,aAAa;AAAA;AAGf,IAAO,oBAAQ;",
6
- "names": []
7
- }
package/cjs/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './DSModal';\nexport * from './constants';\nexport { DSModalWithSchema } from './v2/DSModal';\n\nexport { default } from './DSModal';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,qBAAkC;AAElC,sBAAwB;",
6
- "names": []
7
- }