@elliemae/ds-modal 3.16.0 → 3.16.1

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 (89) hide show
  1. package/dist/cjs/DSModal.js +88 -3
  2. package/dist/cjs/DSModal.js.map +2 -2
  3. package/dist/cjs/constants.js +4 -0
  4. package/dist/cjs/constants.js.map +1 -1
  5. package/dist/cjs/index.js +7 -3
  6. package/dist/cjs/index.js.map +2 -2
  7. package/dist/cjs/package.json +7 -0
  8. package/dist/cjs/v1/DSModal.js +81 -2
  9. package/dist/cjs/v1/DSModal.js.map +2 -2
  10. package/dist/cjs/v1/DSModalType.js +4 -0
  11. package/dist/cjs/v1/DSModalType.js.map +1 -1
  12. package/dist/cjs/v1/DSModalWrapper.js +9 -1
  13. package/dist/cjs/v1/DSModalWrapper.js.map +2 -2
  14. package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js +5 -1
  15. package/dist/cjs/v1/ModalFeedBack/ModalFeedBack.js.map +2 -2
  16. package/dist/cjs/v2/DSModal.js +41 -2
  17. package/dist/cjs/v2/DSModal.js.map +2 -2
  18. package/dist/cjs/v2/blocks.js +4 -0
  19. package/dist/cjs/v2/blocks.js.map +1 -1
  20. package/dist/cjs/v2/components/DecisionHeader.js +5 -1
  21. package/dist/cjs/v2/components/DecisionHeader.js.map +2 -2
  22. package/dist/cjs/v2/components/FeedbackIcon.js +6 -2
  23. package/dist/cjs/v2/components/FeedbackIcon.js.map +2 -2
  24. package/dist/cjs/v2/components/Footer.js +5 -1
  25. package/dist/cjs/v2/components/Footer.js.map +2 -2
  26. package/dist/cjs/v2/components/FormHeader.js +6 -2
  27. package/dist/cjs/v2/components/FormHeader.js.map +2 -2
  28. package/dist/cjs/v2/components/ModalContent.js +16 -9
  29. package/dist/cjs/v2/components/ModalContent.js.map +2 -2
  30. package/dist/cjs/v2/components/SelectionHeader.js +6 -2
  31. package/dist/cjs/v2/components/SelectionHeader.js.map +2 -2
  32. package/dist/cjs/v2/components/Title.js +5 -1
  33. package/dist/cjs/v2/components/Title.js.map +2 -2
  34. package/dist/cjs/v2/helpers.js +5 -1
  35. package/dist/cjs/v2/helpers.js.map +2 -2
  36. package/dist/esm/DSModal.js +84 -3
  37. package/dist/esm/DSModal.js.map +2 -2
  38. package/dist/esm/index.js +3 -3
  39. package/dist/esm/index.js.map +1 -1
  40. package/dist/esm/package.json +7 -0
  41. package/dist/esm/v1/DSModal.js +77 -2
  42. package/dist/esm/v1/DSModal.js.map +2 -2
  43. package/dist/esm/v1/DSModalWrapper.js +5 -1
  44. package/dist/esm/v1/DSModalWrapper.js.map +2 -2
  45. package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js +1 -1
  46. package/dist/esm/v1/ModalFeedBack/ModalFeedBack.js.map +1 -1
  47. package/dist/esm/v2/DSModal.js +37 -2
  48. package/dist/esm/v2/DSModal.js.map +2 -2
  49. package/dist/esm/v2/blocks.js.map +1 -1
  50. package/dist/esm/v2/components/DecisionHeader.js +1 -1
  51. package/dist/esm/v2/components/DecisionHeader.js.map +1 -1
  52. package/dist/esm/v2/components/FeedbackIcon.js +2 -2
  53. package/dist/esm/v2/components/FeedbackIcon.js.map +1 -1
  54. package/dist/esm/v2/components/Footer.js +1 -1
  55. package/dist/esm/v2/components/Footer.js.map +1 -1
  56. package/dist/esm/v2/components/FormHeader.js +2 -2
  57. package/dist/esm/v2/components/FormHeader.js.map +1 -1
  58. package/dist/esm/v2/components/ModalContent.js +12 -9
  59. package/dist/esm/v2/components/ModalContent.js.map +2 -2
  60. package/dist/esm/v2/components/SelectionHeader.js +2 -2
  61. package/dist/esm/v2/components/SelectionHeader.js.map +1 -1
  62. package/dist/esm/v2/components/Title.js +1 -1
  63. package/dist/esm/v2/components/Title.js.map +1 -1
  64. package/dist/esm/v2/helpers.js +1 -1
  65. package/dist/esm/v2/helpers.js.map +1 -1
  66. package/package.json +14 -14
  67. package/dist/types/DSModal.d.ts +0 -13
  68. package/dist/types/constants.d.ts +0 -25
  69. package/dist/types/index.d.ts +0 -3
  70. package/dist/types/v1/DSModal.d.ts +0 -142
  71. package/dist/types/v1/DSModalType.d.ts +0 -1
  72. package/dist/types/v1/DSModalWrapper.d.ts +0 -133
  73. package/dist/types/v1/ModalFeedBack/ModalFeedBack.d.ts +0 -10
  74. package/dist/types/v2/DSModal.d.ts +0 -120
  75. package/dist/types/v2/blocks.d.ts +0 -9
  76. package/dist/types/v2/components/DecisionHeader.d.ts +0 -5
  77. package/dist/types/v2/components/FeedbackIcon.d.ts +0 -4
  78. package/dist/types/v2/components/Footer.d.ts +0 -12
  79. package/dist/types/v2/components/FormHeader.d.ts +0 -7
  80. package/dist/types/v2/components/ModalContent.d.ts +0 -20
  81. package/dist/types/v2/components/SelectionHeader.d.ts +0 -7
  82. package/dist/types/v2/components/Title.d.ts +0 -5
  83. package/dist/types/v2/components/tests/DecisionHeader.test.d.ts +0 -1
  84. package/dist/types/v2/components/tests/FeedbackIcon.test.d.ts +0 -1
  85. package/dist/types/v2/components/tests/Footer.test.d.ts +0 -1
  86. package/dist/types/v2/components/tests/FormHeader.test.d.ts +0 -1
  87. package/dist/types/v2/components/tests/SelectionHeader.test.d.ts +0 -1
  88. package/dist/types/v2/helpers.d.ts +0 -16
  89. package/dist/types/v2/tests/DSModal.test.d.ts +0 -1
@@ -1,9 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import PropTypes from "prop-types";
4
- import { modalTypes } from "./constants";
5
- import DSModalV1 from "./v1/DSModal";
6
- import DSModalV2, { DSModalContent } from "./v2/DSModal";
4
+ import { modalTypes } from "./constants.js";
5
+ import DSModalV1 from "./v1/DSModal.js";
6
+ import DSModalV2, { DSModalContent } from "./v2/DSModal.js";
7
7
  import { sizes, iconSizes } from "@elliemae/ds-shared";
8
8
  import { useDeprecateComponent } from "@elliemae/ds-utilities";
9
9
  const DSModal = ({ version = 1, ...rest }) => {
@@ -18,34 +18,115 @@ DSModal.propTypes = {
18
18
  DSModalV1.propTypes = {
19
19
  version: PropTypes.oneOf([1, 2]),
20
20
  className: PropTypes.string,
21
+ /**
22
+ * Add an additional css class to the footer
23
+ */
21
24
  additionalFooterCssClass: PropTypes.string,
25
+ /**
26
+ * Set style for the modal
27
+ */
22
28
  style: PropTypes.objectOf(PropTypes.string),
29
+ /**
30
+ * Select size for the close icon
31
+ */
23
32
  iconCloseSize: PropTypes.oneOf(iconSizes),
33
+ /**
34
+ * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']
35
+ */
24
36
  modalType: PropTypes.oneOf(modalTypes),
37
+ /**
38
+ * Show the header or not
39
+ */
25
40
  showHeader: PropTypes.bool,
41
+ /**
42
+ * Show the footer or not
43
+ */
26
44
  showFooter: PropTypes.bool,
45
+ /**
46
+ * Main content of the modal
47
+ */
27
48
  children: PropTypes.element.isRequired,
49
+ /**
50
+ * Content is centered or not
51
+ */
28
52
  centered: PropTypes.bool,
53
+ /**
54
+ * Text to be added in the confirm button
55
+ */
29
56
  confirmLabel: PropTypes.string,
57
+ /**
58
+ * Text to be added in the modal title
59
+ */
30
60
  modalTitle: PropTypes.string,
61
+ /**
62
+ * Text to be added in the modal title
63
+ */
31
64
  size: PropTypes.oneOf(sizes),
65
+ /**
66
+ * Modal is open or not
67
+ */
32
68
  isOpen: PropTypes.bool,
69
+ /**
70
+ * Allows a function to be triggered once the modal is closed
71
+ */
33
72
  onClose: PropTypes.func,
73
+ /**
74
+ * Allows a function to be triggered once the modal is opened
75
+ */
34
76
  onAfterOpen: PropTypes.func,
77
+ /**
78
+ * Allows a function to be triggered once the modal open is confirmed
79
+ */
35
80
  onConfirm: PropTypes.func,
81
+ /**
82
+ * Allows a function to be triggered once the modal open is rejected
83
+ */
36
84
  onReject: PropTypes.func,
85
+ /**
86
+ * Text to be added in the reject button
87
+ */
37
88
  rejectLabel: PropTypes.string,
89
+ /**
90
+ * If modal should close on overlay click
91
+ */
38
92
  shouldCloseOnOverlayClick: PropTypes.bool,
93
+ /**
94
+ * Modal has error or not
95
+ */
39
96
  hasError: PropTypes.bool,
97
+ /**
98
+ * Modal has warning or not
99
+ */
40
100
  hasWarning: PropTypes.bool,
101
+ /**
102
+ * Modal has success or not
103
+ */
41
104
  hasSuccess: PropTypes.bool,
105
+ /**
106
+ * Modal has info or not
107
+ */
42
108
  hasInfo: PropTypes.bool,
109
+ /**
110
+ * Modal has help or not
111
+ */
43
112
  hasHelp: PropTypes.bool,
44
113
  actionsRef: PropTypes.func,
45
114
  appElement: PropTypes.string,
115
+ /**
116
+ * Customized props for the confirm button
117
+ */
46
118
  overridePropsConfirmButton: PropTypes.objectOf(PropTypes.shape({})),
119
+ /**
120
+ * Customized props for the reject button
121
+ */
47
122
  overridePropsRejectButton: PropTypes.objectOf(PropTypes.string),
123
+ /**
124
+ * Show confirm button
125
+ */
48
126
  showConfirmButton: PropTypes.bool,
127
+ /**
128
+ * Show confirm button
129
+ */
49
130
  customCloseComponent: PropTypes.element
50
131
  };
51
132
  var DSModal_default = DSModal;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModal.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n useDeprecateComponent({ componentName: 'ds-modal', version: 'TBD Date: 2023 Q3' });\n\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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACYK;AAV5B,OAAO,eAAe;AACtB,SAAS,kBAAkB;AAC3B,OAAO,eAAe;AACtB,OAAO,aAAa,sBAAsB;AAC1C,SAAS,OAAO,iBAAiB;AACjC,SAAS,6BAA6B;AAEtC,MAAM,UAAU,CAAC,EAAE,UAAU,MAAM,KAAK,MAAM;AAC5C,wBAAsB,EAAE,eAAe,YAAY,SAAS,oBAAoB,CAAC;AAEjF,MAAI,YAAY;AAAG,WAAO,oBAAC,aAAW,GAAG,MAAM;AAC/C,SAAO,oBAAC,aAAW,GAAG,MAAM;AAC9B;AAEA,QAAQ,YAAY;AAAA,EAClB,SAAS,UAAU,MAAM,CAAC,GAAG,CAAC,CAAC;AACjC;AAEA,UAAU,YAAY;AAAA,EACpB,SAAS,UAAU,MAAM,CAAC,GAAG,CAAC,CAAC;AAAA,EAC/B,WAAW,UAAU;AAAA,EAIrB,0BAA0B,UAAU;AAAA,EAIpC,OAAO,UAAU,SAAS,UAAU,MAAM;AAAA,EAI1C,eAAe,UAAU,MAAM,SAAS;AAAA,EAIxC,WAAW,UAAU,MAAM,UAAU;AAAA,EAIrC,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,UAAU,UAAU,QAAQ;AAAA,EAI5B,UAAU,UAAU;AAAA,EAIpB,cAAc,UAAU;AAAA,EAIxB,YAAY,UAAU;AAAA,EAItB,MAAM,UAAU,MAAM,KAAK;AAAA,EAI3B,QAAQ,UAAU;AAAA,EAIlB,SAAS,UAAU;AAAA,EAInB,aAAa,UAAU;AAAA,EAIvB,WAAW,UAAU;AAAA,EAIrB,UAAU,UAAU;AAAA,EAIpB,aAAa,UAAU;AAAA,EAIvB,2BAA2B,UAAU;AAAA,EAIrC,UAAU,UAAU;AAAA,EAIpB,YAAY,UAAU;AAAA,EAItB,YAAY,UAAU;AAAA,EAItB,SAAS,UAAU;AAAA,EAInB,SAAS,UAAU;AAAA,EACnB,YAAY,UAAU;AAAA,EACtB,YAAY,UAAU;AAAA,EAItB,4BAA4B,UAAU,SAAS,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAIlE,2BAA2B,UAAU,SAAS,UAAU,MAAM;AAAA,EAI9D,mBAAmB,UAAU;AAAA,EAI7B,sBAAsB,UAAU;AAClC;AAEA,IAAO,kBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { modalTypes } from './constants.js';\nimport DSModalV1 from './v1/DSModal.js';\nimport DSModalV2, { DSModalContent } from './v2/DSModal.js';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\nimport { useDeprecateComponent } from '@elliemae/ds-utilities';\n\nconst DSModal = ({ version = 1, ...rest }) => {\n useDeprecateComponent({ componentName: 'ds-modal', version: 'TBD Date: 2023 Q3' });\n\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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACYK;AAV5B,OAAO,eAAe;AACtB,SAAS,kBAAkB;AAC3B,OAAO,eAAe;AACtB,OAAO,aAAa,sBAAsB;AAC1C,SAAS,OAAO,iBAAiB;AACjC,SAAS,6BAA6B;AAEtC,MAAM,UAAU,CAAC,EAAE,UAAU,GAAG,GAAG,KAAK,MAAM;AAC5C,wB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,EAIpB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAItB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAItB,SAAS,UAAU;AAAA;AAAA;AAAA;AAAA,EAInB,SAAS,UAAU;AAAA,EACnB,YAAY,UAAU;AAAA,EACtB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAItB,4BAA4B,UAAU,SAAS,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAIlE,2BAA2B,UAAU,SAAS,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA,EAI9D,mBAAmB,UAAU;AAAA;AAAA;AAAA;AAAA,EAI7B,sBAAsB,UAAU;AAClC;AAEA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { DSModal, DSModal as DSModal2 } from "./DSModal";
3
- import { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from "./constants";
4
- import { DSModalWithSchema } from "./v2/DSModal";
2
+ import { DSModal, DSModal as DSModal2 } from "./DSModal.js";
3
+ import { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from "./constants.js";
4
+ import { DSModalWithSchema } from "./v2/DSModal.js";
5
5
  export {
6
6
  DSModal,
7
7
  DSModalWithSchema,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSModal, DSModal as default } from './DSModal';\nexport { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from './constants';\nexport { DSModalWithSchema } from './v2/DSModal';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSModal, DSModal as default } from './DSModal.js';\nexport { MODAL_TYPE, modalTypes, MODAL_TYPE_V2, MODAL_SUB_TYPE_V2 } from './constants.js';\nexport { DSModalWithSchema } from './v2/DSModal.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAoB,WAAXA,gBAA0B;AAC5C,SAAS,YAAY,YAAY,eAAe,yBAAyB;AACzE,SAAS,yBAAyB;",
6
6
  "names": ["DSModal"]
7
7
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "module",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -6,8 +6,8 @@ import { convertPropToCssClassName } from "@elliemae/ds-classnames";
6
6
  import { DSIconSizes } from "@elliemae/ds-icon";
7
7
  import { Close } from "@elliemae/ds-icons";
8
8
  import DSButton from "@elliemae/ds-button";
9
- import MODAL_TYPE, { modalTypes } from "../constants";
10
- import ModalFeedBack from "./ModalFeedBack/ModalFeedBack";
9
+ import MODAL_TYPE, { modalTypes } from "../constants.js";
10
+ import ModalFeedBack from "./ModalFeedBack/ModalFeedBack.js";
11
11
  import { sizes, iconSizes } from "@elliemae/ds-shared";
12
12
  const DSModal = ({
13
13
  containerProps = {},
@@ -125,32 +125,107 @@ const DSModal = ({
125
125
  };
126
126
  DSModal.propTypes = {
127
127
  className: PropTypes.string,
128
+ /**
129
+ * Add an additional css class to the footer
130
+ */
128
131
  additionalFooterCssClass: PropTypes.string,
132
+ /**
133
+ * Set style for the modal
134
+ */
129
135
  style: PropTypes.shape({}),
136
+ /**
137
+ * Select size for the close icon
138
+ */
130
139
  iconCloseSize: PropTypes.oneOf(iconSizes),
140
+ /**
141
+ * ['default', 'alert', 'confirm', 'notification', 'warning', 'error', 'success', 'help', 'info']
142
+ */
131
143
  modalType: PropTypes.oneOf(modalTypes),
144
+ /**
145
+ * Show the header or not
146
+ */
132
147
  showHeader: PropTypes.bool,
148
+ /**
149
+ * Show the footer or not
150
+ */
133
151
  showFooter: PropTypes.bool,
152
+ /**
153
+ * Main content of the modal
154
+ */
134
155
  children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired,
156
+ /**
157
+ * Content is centered or not
158
+ */
135
159
  centered: PropTypes.bool,
160
+ /**
161
+ * Text to be added in the confirm button
162
+ */
136
163
  confirmLabel: PropTypes.string,
164
+ /**
165
+ * Text to be added in the modal title
166
+ */
137
167
  modalTitle: PropTypes.string,
168
+ /**
169
+ * Text to be added in the modal title
170
+ */
138
171
  size: PropTypes.oneOf(sizes),
172
+ /**
173
+ * Modal is open or not
174
+ */
139
175
  isOpen: PropTypes.bool,
176
+ /**
177
+ * Allows a function to be triggered once the modal is closed
178
+ */
140
179
  onClose: PropTypes.func,
180
+ /**
181
+ * Allows a function to be triggered once the modal is opened
182
+ */
141
183
  onAfterOpen: PropTypes.func,
184
+ /**
185
+ * Allows a function to be triggered once the modal open is confirmed
186
+ */
142
187
  onConfirm: PropTypes.func,
188
+ /**
189
+ * Allows a function to be triggered once the modal open is rejected
190
+ */
143
191
  onReject: PropTypes.func,
192
+ /**
193
+ * Text to be added in the reject button
194
+ */
144
195
  rejectLabel: PropTypes.string,
196
+ /**
197
+ * If modal should close on overlay click
198
+ */
145
199
  shouldCloseOnOverlayClick: PropTypes.bool,
200
+ /**
201
+ * Modal has error or not
202
+ */
146
203
  hasError: PropTypes.bool,
204
+ /**
205
+ * Modal has warning or not
206
+ */
147
207
  hasWarning: PropTypes.bool,
208
+ /**
209
+ * Modal has success or not
210
+ */
148
211
  hasSuccess: PropTypes.bool,
212
+ /**
213
+ * Modal has info or not
214
+ */
149
215
  hasInfo: PropTypes.bool,
216
+ /**
217
+ * Modal has help or not
218
+ */
150
219
  hasHelp: PropTypes.bool,
151
220
  actionsRef: PropTypes.func,
152
221
  appElement: PropTypes.string,
222
+ /**
223
+ * Customized props for the confirm button
224
+ */
153
225
  overridePropsConfirmButton: PropTypes.shape({}),
226
+ /**
227
+ * Customized props for the reject button
228
+ */
154
229
  overridePropsRejectButton: PropTypes.shape({})
155
230
  };
156
231
  var DSModal_default = DSModal;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModal.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n dataTestId = 'ds-modal',\n additionalFooterCssClass = '',\n style = {},\n iconCloseSize = DSIconSizes.S,\n modalType = MODAL_TYPE.DEFAULT,\n showHeader = true,\n showFooter = true,\n children,\n centered = true,\n confirmLabel = 'Accept',\n modalTitle = '',\n size = 'medium',\n isOpen = false,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Cancel',\n shouldCloseOnOverlayClick = false,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n actionsRef = () => null,\n appElement = '#root',\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n zIndex = 10,\n}) => {\n // http://reactcommunity.org/react-modal/accessibility/ https://github.com/reactjs/react-modal#examples\n typeof document !== 'undefined' && document && ReactModal.setAppElement && ReactModal.setAppElement(appElement); // eslint-disable-line\n const { cssClassName, classNameElement, classNameBlock, classNameModifier, classNameBlockModifier } =\n convertPropToCssClassName('modal', className, {\n hasError,\n hasWarning,\n hasSuccess,\n modalType,\n size,\n });\n\n const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\n const isAFeedbackType = [WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1;\n const showFeedBack = isAFeedbackType || hasError || hasWarning || hasSuccess || hasInfo || hasHelp;\n\n return (\n <ReactModal\n testId={dataTestId}\n className={cssClassName}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(centered && 'center')}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n zIndex,\n },\n }}\n >\n <div {...containerProps}>\n {showHeader && (\n <div className={classNameBlock('modal-header')}>\n <div className={classNameElement('title', 'modal-header')}>{modalTitle}</div>\n <div className={classNameElement('icon', 'modal-header')}>\n <DSButton buttonType=\"link\" icon={<Close />} onClick={onClose} size={iconCloseSize} />\n </div>\n </div>\n )}\n <div className={classNameElement('body')}>\n {showFeedBack && (\n <ModalFeedBack\n hasError={hasError}\n hasHelp={hasHelp}\n hasInfo={hasInfo}\n hasSuccess={hasSuccess}\n hasWarning={hasWarning}\n modalType={modalType}\n />\n )}\n {children}\n </div>\n {showFooter && !isAFeedbackType && (\n <div\n className={`${classNameBlock('modal-footer')} ${\n additionalFooterCssClass ? classNameBlockModifier(additionalFooterCssClass, 'modal-footer') : ''\n }`}\n >\n <div ref={actionsRef} className={classNameBlock('modal-footer-actions')}>\n {modalType === MODAL_TYPE.CONFIRM && (\n <DSButton\n buttonType=\"secondary\"\n className={`${classNameElement('button-action')} ${classNameModifier('reject', 'button-action')} `}\n labelText={rejectLabel}\n onClick={onReject}\n {...overridePropsRejectButton}\n />\n )}\n <DSButton\n buttonType=\"primary\"\n className={`${classNameElement('button-action')} ${classNameModifier('confirm', 'button-action')} `}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...overridePropsConfirmButton}\n />\n </div>\n </div>\n )}\n </div>\n </ReactModal>\n );\n};\n\nDSModal.propTypes = {\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.shape({}),\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.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).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.shape({}),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.shape({}),\n};\n\nexport default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};\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport MODAL_TYPE, { modalTypes } from '../constants.js';\nimport ModalFeedBack from './ModalFeedBack/ModalFeedBack.js';\nimport { sizes, iconSizes } from '@elliemae/ds-shared';\n\nconst DSModal = ({\n containerProps = {},\n className = '',\n dataTestId = 'ds-modal',\n additionalFooterCssClass = '',\n style = {},\n iconCloseSize = DSIconSizes.S,\n modalType = MODAL_TYPE.DEFAULT,\n showHeader = true,\n showFooter = true,\n children,\n centered = true,\n confirmLabel = 'Accept',\n modalTitle = '',\n size = 'medium',\n isOpen = false,\n onClose = () => null,\n onAfterOpen = () => null,\n onConfirm = () => null,\n onReject = () => null,\n rejectLabel = 'Cancel',\n shouldCloseOnOverlayClick = false,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n actionsRef = () => null,\n appElement = '#root',\n overridePropsConfirmButton = {},\n overridePropsRejectButton = {},\n zIndex = 10,\n}) => {\n // http://reactcommunity.org/react-modal/accessibility/ https://github.com/reactjs/react-modal#examples\n typeof document !== 'undefined' && document && ReactModal.setAppElement && ReactModal.setAppElement(appElement); // eslint-disable-line\n const { cssClassName, classNameElement, classNameBlock, classNameModifier, classNameBlockModifier } =\n convertPropToCssClassName('modal', className, {\n hasError,\n hasWarning,\n hasSuccess,\n modalType,\n size,\n });\n\n const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\n const isAFeedbackType = [WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1;\n const showFeedBack = isAFeedbackType || hasError || hasWarning || hasSuccess || hasInfo || hasHelp;\n\n return (\n <ReactModal\n testId={dataTestId}\n className={cssClassName}\n contentLabel={modalTitle}\n isOpen={isOpen}\n onAfterOpen={onAfterOpen}\n onRequestClose={onClose}\n overlayClassName={`${classNameBlock('overlay')} ${classNameModifier(centered && 'center')}`}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n style={{\n content: {\n ...style,\n },\n overlay: {\n zIndex,\n },\n }}\n >\n <div {...containerProps}>\n {showHeader && (\n <div className={classNameBlock('modal-header')}>\n <div className={classNameElement('title', 'modal-header')}>{modalTitle}</div>\n <div className={classNameElement('icon', 'modal-header')}>\n <DSButton buttonType=\"link\" icon={<Close />} onClick={onClose} size={iconCloseSize} />\n </div>\n </div>\n )}\n <div className={classNameElement('body')}>\n {showFeedBack && (\n <ModalFeedBack\n hasError={hasError}\n hasHelp={hasHelp}\n hasInfo={hasInfo}\n hasSuccess={hasSuccess}\n hasWarning={hasWarning}\n modalType={modalType}\n />\n )}\n {children}\n </div>\n {showFooter && !isAFeedbackType && (\n <div\n className={`${classNameBlock('modal-footer')} ${\n additionalFooterCssClass ? classNameBlockModifier(additionalFooterCssClass, 'modal-footer') : ''\n }`}\n >\n <div ref={actionsRef} className={classNameBlock('modal-footer-actions')}>\n {modalType === MODAL_TYPE.CONFIRM && (\n <DSButton\n buttonType=\"secondary\"\n className={`${classNameElement('button-action')} ${classNameModifier('reject', 'button-action')} `}\n labelText={rejectLabel}\n onClick={onReject}\n {...overridePropsRejectButton}\n />\n )}\n <DSButton\n buttonType=\"primary\"\n className={`${classNameElement('button-action')} ${classNameModifier('confirm', 'button-action')} `}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...overridePropsConfirmButton}\n />\n </div>\n </div>\n )}\n </div>\n </ReactModal>\n );\n};\n\nDSModal.propTypes = {\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.shape({}),\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.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).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.shape({}),\n /**\n * Customized props for the reject button\n */\n overridePropsRejectButton: PropTypes.shape({}),\n};\n\nexport default DSModal;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkFb,SACE,KADF;AAhFV,OAAO,eAAe;AACtB,OAAO,gBAAgB;AACvB,SAAS,iCAAiC;AAC1C,SAAS,mBAAmB;AAC5B,SA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A,EAItB,SAAS,UAAU;AAAA;AAAA;AAAA;AAAA,EAInB,SAAS,UAAU;AAAA,EACnB,YAAY,UAAU;AAAA,EACtB,YAAY,UAAU;AAAA;AAAA;AAAA;AAAA,EAItB,4BAA4B,UAAU,MAAM,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA,EAI9C,2BAA2B,UAAU,MAAM,CAAC,CAAC;AAC/C;AAEA,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { Component, createElement } from "react";
3
- import { MODAL_TYPE } from "../constants";
3
+ import { MODAL_TYPE } from "../constants.js";
4
4
  var DSModalWrapper_default = (WrappedComponent) => {
5
5
  class DSModalWrapper extends Component {
6
6
  constructor() {
@@ -38,6 +38,10 @@ var DSModalWrapper_default = (WrappedComponent) => {
38
38
  this.setState({ actions: node });
39
39
  this.handleResize();
40
40
  };
41
+ /**
42
+ * Change button width to 100% if the
43
+ * combined width of the button (or button group) exceed 50% of the container width.
44
+ */
41
45
  this.handleResize = () => {
42
46
  if (!this.state)
43
47
  return null;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v1/DSModalWrapper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize = () => {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (containerWidth && actionsWidth && (actionsWidth / containerWidth) * 100 > 50) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n };\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,qBAAqB;AACzC,SAAS,kBAAkB;AAE3B,IAAO,yBAAQ,CAAC,qBAAqB;AACnC,QAAM,uBAAuB,UAAU;AAAA,IAAvC;AAAA;AACE,mBAAQ;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iBAAiB,UAAU,KAAK,YAAY;AAAA,IACrD;AAAA,IAEA,uBAAuB;AACrB,aAAO,oBAAoB,UAAU,KAAK,YAAY;AAAA,IACxD;AAAA,IAiDA,cAAc;AACZ,YAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,UAAI,cAAc,WAAW,SAAS;AACpC,cAAM,gBAAgB,YAAY,MAAM;AAEtC,gBAAM,EAAE,WAAW,QAAQ,IAAI,KAAK;AACpC,cAAI,CAAC,aAAa,CAAC;AAAS,mBAAO;AACnC,wBAAc,aAAa;AAC3B,eAAK,SAAS,EAAE,YAAY,KAAK,CAAC;AAClC,iBAAO,KAAK,aAAa;AAAA,QAC3B,GAAG,GAAG;AAAA,MACR;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,EAAE,OAAO,MAAM,IAAI;AACzB,YAAM,EAAE,0BAA0B,OAAO,IAAI;AAC7C,aAAO,cAAc,kBAAkB;AAAA,QACrC,GAAG;AAAA,QACH;AAAA,QACA,UAAU,KAAK;AAAA,QACf,gBAAgB,KAAK;AAAA,QACrB,gBAAgB,KAAK;AAAA,QACrB,cAAc,KAAK;AAAA,QACnB,YAAY,KAAK;AAAA,QACjB;AAAA,QACA,aAAa,MAAM;AACjB,cAAI,MAAM;AAAa,kBAAM,YAAY;AACzC,eAAK,YAAY;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { Component, createElement } from 'react';\nimport { MODAL_TYPE } from '../constants.js';\n\nexport default (WrappedComponent) => {\n class DSModalWrapper extends Component {\n state = {\n childready: false,\n additionalFooterCssClass: 'loading',\n container: null,\n actions: null,\n height: '100%',\n };\n\n componentDidMount() {\n window.addEventListener('resize', this.handleResize);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.handleResize);\n }\n\n onHeaderHeight = (e) => {\n this.heightHeaderFlag = true;\n this.heightHeader = e.height || 0;\n };\n\n onFooterHeight = (e) => {\n this.heightFooterFlag = true;\n this.heightFooter = e.height || 0;\n };\n\n onResize = ({ bounds }) => {\n if (this.heightFooterFlag && this.heightHeaderFlag) {\n return this.setState({\n height: bounds.height - this.heightFooter - this.heightHeader,\n });\n }\n return setTimeout(this.onResize({ bounds }), 0);\n };\n\n handleContainer = (node) => {\n if (node) this.setState({ container: node });\n this.handleResize();\n };\n\n handleActions = (node) => {\n if (node) this.setState({ actions: node });\n this.handleResize();\n };\n\n /**\n * Change button width to 100% if the\n * combined width of the button (or button group) exceed 50% of the container width.\n */\n handleResize = () => {\n if (!this.state) return null;\n const { container, actions, childready } = this.state;\n if (!childready) return null;\n this.setState({ additionalFooterCssClass: null }); // !important reset to default state to recalculate\n const { clientWidth: containerWidth } = container;\n const { clientWidth: actionsWidth } = actions;\n // Change button width to 100% if the combined width of the button (or button group) exceed 50% of the container width.\n if (containerWidth && actionsWidth && (actionsWidth / containerWidth) * 100 > 50) {\n return this.setState({ additionalFooterCssClass: 'fluid-actions' });\n }\n return this.setState({ additionalFooterCssClass: null });\n };\n\n verifyNodes() {\n const { modalType } = this.props;\n if (modalType !== MODAL_TYPE.DEFAULT) {\n const nodesInterval = setInterval(() => {\n // !important it checks when nodes are availables\n const { container, actions } = this.state;\n if (!container || !actions) return null;\n clearInterval(nodesInterval);\n this.setState({ childready: true });\n return this.handleResize();\n }, 100);\n }\n }\n\n render() {\n const { props, state } = this;\n const { additionalFooterCssClass, height } = state;\n return createElement(WrappedComponent, {\n ...props,\n height,\n onResize: this.onResize,\n onFooterHeight: this.onFooterHeight,\n onHeaderHeight: this.onHeaderHeight,\n containerRef: this.handleContainer,\n actionsRef: this.handleActions,\n additionalFooterCssClass,\n onAfterOpen: () => {\n if (props.onAfterOpen) props.onAfterOpen();\n this.verifyNodes();\n },\n });\n }\n }\n\n return DSModalWrapper;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,qBAAqB;AACzC,SAAS,kBAAkB;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,CAAC;AAAA,QACpE;AACA,eAAO,KAAK,SAAS,EAAE,0BAA0B,KAAK,CAAC;AAAA,MACzD;AAAA;AAAA,IArDA,oBAAoB;AAClB,aAAO,iBAAiB,UAAU,KAAK,YAAY;AAAA,IACrD;AAAA,IAEA,uBAAuB;AACrB,aAAO,oBAAoB,UAAU,KAAK,YAAY;AAAA,IACxD;AAAA,IAiDA,cAAc;AACZ,YAAM,EAAE,UAAU,IAAI,KAAK;AAC3B,UAAI,cAAc,WAAW,SAAS;AACpC,cAAM,gBAAgB,YAAY,MAAM;AAEtC,gBAAM,EAAE,WAAW,QAAQ,IAAI,KAAK;AACpC,cAAI,CAAC,aAAa,CAAC;AAAS,mBAAO;AACnC,wBAAc,aAAa;AAC3B,eAAK,SAAS,EAAE,YAAY,KAAK,CAAC;AAClC,iBAAO,KAAK,aAAa;AAAA,QAC3B,GAAG,GAAG;AAAA,MACR;AAAA,IACF;AAAA,IAEA,SAAS;AACP,YAAM,EAAE,OAAO,MAAM,IAAI;AACzB,YAAM,EAAE,0BAA0B,OAAO,IAAI;AAC7C,aAAO,cAAc,kBAAkB;AAAA,QACrC,GAAG;AAAA,QACH;AAAA,QACA,UAAU,KAAK;AAAA,QACf,gBAAgB,KAAK;AAAA,QACrB,gBAAgB,KAAK;AAAA,QACrB,cAAc,KAAK;AAAA,QACnB,YAAY,KAAK;AAAA,QACjB;AAAA,QACA,aAAa,MAAM;AACjB,cAAI,MAAM;AAAa,kBAAM,YAAY;AACzC,eAAK,YAAY;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from "@elliemae/ds-icons";
4
4
  import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
- import { MODAL_TYPE } from "../../constants";
5
+ import { MODAL_TYPE } from "../../constants.js";
6
6
  const feedbackIconSize = "xxl";
7
7
  const { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;
8
8
  const getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/v1/ModalFeedBack/ModalFeedBack.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from '@elliemae/ds-icons';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE } from '../../constants';\n\nconst feedbackIconSize = 'xxl';\n\nconst { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\nconst getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {\n if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1) return modalType;\n if (hasError) return ERROR;\n if (hasWarning) return WARNING;\n if (hasSuccess) return SUCCESS;\n if (hasHelp) return HELP;\n if (hasInfo) return INFO;\n return INFO;\n};\n\nconst getIconType = (modalType) => {\n switch (modalType) {\n case WARNING:\n case ERROR:\n return <WarningCircle size={feedbackIconSize} />;\n case SUCCESS:\n return <CheckmarkCircle size={feedbackIconSize} />;\n case HELP:\n return <HelpCircle size={feedbackIconSize} />;\n case INFO:\n return <InfoCircle size={feedbackIconSize} />;\n default:\n return <InfoCircle size={feedbackIconSize} />;\n }\n};\n\nconst ModalFeedBack = ({\n className = '',\n modalType = null,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n}) => {\n const type = getModalType(modalType, {\n hasError,\n hasWarning,\n hasSuccess,\n hasInfo,\n hasHelp,\n });\n const { cssClassName } = convertPropToCssClassName('modal-feedback', className, { modalType: type });\n const feedbackIcon = getIconType(type);\n\n return <div className={cssClassName}>{feedbackIcon}</div>;\n};\n\nexport default ModalFeedBack;\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { WarningCircle, CheckmarkCircle, HelpCircle, InfoCircle } from '@elliemae/ds-icons';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE } from '../../constants.js';\n\nconst feedbackIconSize = 'xxl';\n\nconst { WARNING, ERROR, SUCCESS, HELP, INFO } = MODAL_TYPE;\n\nconst getModalType = (modalType, { hasError, hasWarning, hasSuccess, hasInfo, hasHelp }) => {\n if ([WARNING, ERROR, SUCCESS, HELP, INFO].indexOf(modalType) > -1) return modalType;\n if (hasError) return ERROR;\n if (hasWarning) return WARNING;\n if (hasSuccess) return SUCCESS;\n if (hasHelp) return HELP;\n if (hasInfo) return INFO;\n return INFO;\n};\n\nconst getIconType = (modalType) => {\n switch (modalType) {\n case WARNING:\n case ERROR:\n return <WarningCircle size={feedbackIconSize} />;\n case SUCCESS:\n return <CheckmarkCircle size={feedbackIconSize} />;\n case HELP:\n return <HelpCircle size={feedbackIconSize} />;\n case INFO:\n return <InfoCircle size={feedbackIconSize} />;\n default:\n return <InfoCircle size={feedbackIconSize} />;\n }\n};\n\nconst ModalFeedBack = ({\n className = '',\n modalType = null,\n hasError = false,\n hasWarning = false,\n hasSuccess = false,\n hasInfo = false,\n hasHelp = false,\n}) => {\n const type = getModalType(modalType, {\n hasError,\n hasWarning,\n hasSuccess,\n hasInfo,\n hasHelp,\n });\n const { cssClassName } = convertPropToCssClassName('modal-feedback', className, { modalType: type });\n const feedbackIcon = getIconType(type);\n\n return <div className={cssClassName}>{feedbackIcon}</div>;\n};\n\nexport default ModalFeedBack;\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACuBV;AAtBb,SAAS,eAAe,iBAAiB,YAAY,kBAAkB;AACvE,SAAS,iCAAiC;AAC1C,SAAS,kBAAkB;AAE3B,MAAM,mBAAmB;AAEzB,MAAM,EAA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} from "@elliemae/ds-props-helpers";
6
6
  import ReactModal from "react-modal";
7
7
  import { convertPropToCssClassName } from "@elliemae/ds-classnames";
8
- import { MODAL_TYPE_V2 } from "../constants";
9
- import { DSModalContent } from "./components/ModalContent";
8
+ import { MODAL_TYPE_V2 } from "../constants.js";
9
+ import { DSModalContent } from "./components/ModalContent.js";
10
10
  const DSModal = ({
11
11
  containerProps = {},
12
12
  className = "",
13
13
  style = {},
14
14
  size = "default",
15
+ //
15
16
  modalType = MODAL_TYPE_V2.INFORMATION,
16
17
  modalSubType = null,
17
18
  modalTitle = "",
@@ -20,10 +21,12 @@ const DSModal = ({
20
21
  showRejectButton = false,
21
22
  showClose = true,
22
23
  searchProps = {},
24
+ // override
23
25
  actionsRef = () => null,
24
26
  additionalFooterCssClass,
25
27
  overridePropsConfirmButton = {},
26
28
  overridePropsRejectButton = {},
29
+ // react modal
27
30
  children,
28
31
  isOpen = true,
29
32
  onClose = () => null,
@@ -60,6 +63,7 @@ const DSModal = ({
60
63
  ...style
61
64
  },
62
65
  overlay: {
66
+ // 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
63
67
  zIndex: zIndex ?? theme.zIndex.dialog
64
68
  }
65
69
  },
@@ -90,36 +94,67 @@ const DSModal = ({
90
94
  );
91
95
  };
92
96
  const props = {
97
+ /** inject props to container wrapper */
93
98
  containerProps: PropTypes.object.description("inject props to container wrapper"),
99
+ /** css class */
94
100
  className: PropTypes.string.description("css class"),
101
+ /** style object for container wrapper */
95
102
  style: PropTypes.object.description("style object for container wrapper"),
103
+ /** modal container title */
96
104
  modalTitle: PropTypes.string.description("modal container title"),
105
+ /** center container */
97
106
  centered: PropTypes.bool.description("center container"),
107
+ /** show reject button */
98
108
  showRejectButton: PropTypes.bool.description("show reject button"),
109
+ /** show close button */
99
110
  showClose: PropTypes.bool.description("show close button"),
111
+ /*
112
+ Props for search component
113
+ */
100
114
  searchProps: PropTypes.object.description("Props for search component"),
115
+ /** css class for footer */
101
116
  additionalFooterCssClass: PropTypes.string.description("css class for footer"),
117
+ /** override props confirm button */
102
118
  overridePropsConfirmButton: PropTypes.object.description("override props confirm button"),
119
+ /** override props reject button */
103
120
  overridePropsRejectButton: PropTypes.object.description("override props reject button"),
121
+ /** controlled isOpen flag */
104
122
  isOpen: PropTypes.bool.description("controlled isOpen flag"),
123
+ /** close callback */
105
124
  onClose: PropTypes.func.description("close callback"),
125
+ /** after open callback */
106
126
  onAfterOpen: PropTypes.func.description("after open callback"),
127
+ /** confirm callback */
107
128
  onConfirm: PropTypes.func.description("confirm callback"),
129
+ /** reject callback */
108
130
  onReject: PropTypes.func.description("reject callback"),
131
+ /** reject label */
109
132
  rejectLabel: PropTypes.string.description("reject label"),
133
+ /** confirm text string */
110
134
  confirmLabel: PropTypes.string.description("confirm text string"),
135
+ /** modal container size */
111
136
  size: PropTypes.oneOf(["default", "xx-large", "x-large", "large", "medium", "small"]).description(
112
137
  "modal container size"
113
138
  ),
139
+ /** modal sub type */
114
140
  modalSubType: PropTypes.any.description("modal sub type"),
141
+ /** modal type */
115
142
  modalType: PropTypes.any.description("modal type"),
143
+ /** ref for modal footer actions */
116
144
  actionsRef: PropTypes.any.description("ref for modal footer actions"),
145
+ /** modal container children */
117
146
  children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).description(
118
147
  "modal container children"
119
148
  ),
149
+ /** close on click outside container */
120
150
  shouldCloseOnOverlayClick: PropTypes.bool.description("close on click outside container"),
151
+ /*
152
+ App element ID to inject the modal
153
+ */
121
154
  appElement: PropTypes.string.description("App element ID to inject the modal"),
155
+ /** zindex for modal container */
122
156
  zIndex: PropTypes.number.description("zindex for modal container"),
157
+ /** remove modal builtin padding */
123
158
  removePadding: PropTypes.bool.description("remove modal builtin padding")
124
159
  };
125
160
  DSModal.propTypes = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/DSModal.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\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,\n removePadding = false,\n}) => {\n if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal.setAppElement) {\n ReactModal.setAppElement(appElement);\n }\n\n const { cssClassName, classNameBlock, classNameModifier } = convertPropToCssClassName('modal-v2', className, {\n size,\n });\n\n const theme = useContext(ThemeContext);\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(centered ? 'center' : 'top')}`}\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: zIndex ?? theme.zIndex.dialog,\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('inject props to container wrapper'),\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('css class for footer'),\n /** override props confirm button */\n overridePropsConfirmButton: PropTypes.object.description('override props confirm button'),\n /** override props reject button */\n overridePropsRejectButton: PropTypes.object.description('override props reject button'),\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(['default', 'xx-large', 'x-large', 'large', 'medium', 'small']).description(\n 'modal container size',\n ),\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([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).description(\n 'modal container children',\n ),\n /** close on click outside container */\n shouldCloseOnOverlayClick: PropTypes.bool.description('close on click outside container'),\n /*\n App element ID to inject the modal\n */\n appElement: PropTypes.string.description('App element ID to inject the modal'),\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;\nDSModal.displayName = 'DSModal';\nconst DSModalWithSchema = describe(DSModal);\nDSModalWithSchema.propTypes = props;\n\nexport { DSModalContent, DSModalWithSchema };\nexport default DSModal;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACwEjB;AAvEN,SAAgB,kBAAkB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,gBAAgB;AACpC,OAAO,gBAAgB;AACvB,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,QAAQ,CAAC;AAAA,EACT,OAAO;AAAA,EAEP,YAAY,cAAc;AAAA,EAC1B,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,cAAc,CAAC;AAAA,EAEf,aAAa,MAAM;AAAA,EACnB;AAAA,EACA,6BAA6B,CAAC;AAAA,EAC9B,4BAA4B,CAAC;AAAA,EAE7B;AAAA,EACA,SAAS;AAAA,EACT,UAAU,MAAM;AAAA,EAChB,cAAc,MAAM;AAAA,EACpB,YAAY,MAAM;AAAA,EAClB,WAAW,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AkB,YAAY;AAG9B,IAAO,kBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport ReactModal from 'react-modal';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MODAL_TYPE_V2 } from '../constants.js';\nimport { DSModalContent } from './components/ModalContent.js';\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,\n removePadding = false,\n}) => {\n if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && document && ReactModal.setAppElement) {\n ReactModal.setAppElement(appElement);\n }\n\n const { cssClassName, classNameBlock, classNameModifier } = convertPropToCssClassName('modal-v2', className, {\n size,\n });\n\n const theme = useContext(ThemeContext);\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(centered ? 'center' : 'top')}`}\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: zIndex ?? theme.zIndex.dialog,\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('inject props to container wrapper'),\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('css class for footer'),\n /** override props confirm button */\n overridePropsConfirmButton: PropTypes.object.description('override props confirm button'),\n /** override props reject button */\n overridePropsRejectButton: PropTypes.object.description('override props reject button'),\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(['default', 'xx-large', 'x-large', 'large', 'medium', 'small']).description(\n 'modal container size',\n ),\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([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).description(\n 'modal container children',\n ),\n /** close on click outside container */\n shouldCloseOnOverlayClick: PropTypes.bool.description('close on click outside container'),\n /*\n App element ID to inject the modal\n */\n appElement: PropTypes.string.description('App element ID to inject the modal'),\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;\nDSModal.displayName = 'DSModal';\nconst DSModalWithSchema = describe(DSModal);\nDSModalWithSchema.propTypes = props;\n\nexport { DSModalContent, DSModalWithSchema };\nexport default DSModal;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwEjB;AAvEN,SAAgB,kBAAkB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,gBAAgB;AACpC,OAAO,gBAAgB;AACvB,SAAS,iCAAiC;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAE/B,MAAM,UAAU,CAAC;AAAA,EACf,iBAAiB,CAAC;AAAA,EAClB,YAAY;AAAA,EACZ,QAAQ,CAAC;AAAA,EACT,OAAO;AAAA;AAAA,EAEP,YAAY,cAAc;AAAA,EAC1B,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,EACX,mBAAmB;AAAA,EACnB,YAAY;AAAA,EACZ,cAAc,CAAC;AAAA;AAAA,EAEf,aAAa,MAAM;AAAA,EACnB;AAAA,EACA,6BAA6B,CAAC;AAAA,EAC9B,4BAA4B,CAAC;AAAA;AAAA,EAE7B;AAAA,EACA,SAAS;AAAA,EACT,UAAU,MAAM;AAAA,EAChB,cAAc,MAAM;AAAA,EAC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YAAY,UAAU,OAAO,YAAY,oCAAoC;AAAA;AAAA,EAE7E,QAAQ,UAAU,OAAO,YAAY,4BAA4B;AAAA;AAAA,EAEjE,eAAe,UAAU,KAAK,YAAY,8BAA8B;AAC1E;AAEA,QAAQ,YAAY;AACpB,QAAQ,cAAc;AACtB,MAAM,oBAAoB,SAAS,OAAO;AAC1C,kBAAkB,YAAY;AAG9B,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/blocks.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAA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