@elliemae/ds-modal-slide 3.5.0-rc.9 → 3.5.1-next.0
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.
- package/dist/cjs/DSModalSlide.js +48 -33
- package/dist/cjs/DSModalSlide.js.map +1 -1
- package/dist/cjs/components/Footer.js +23 -16
- package/dist/cjs/components/Footer.js.map +2 -2
- package/dist/cjs/components/Header.js +29 -16
- package/dist/cjs/components/Header.js.map +2 -2
- package/dist/esm/DSModalSlide.js +48 -33
- package/dist/esm/DSModalSlide.js.map +1 -1
- package/dist/esm/components/Footer.js +23 -16
- package/dist/esm/components/Footer.js.map +2 -2
- package/dist/esm/components/Header.js +29 -16
- package/dist/esm/components/Header.js.map +2 -2
- package/package.json +8 -8
package/dist/cjs/DSModalSlide.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(DSModalSlide_exports, {
|
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(DSModalSlide_exports);
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
36
|
var import_react = __toESM(require("react"));
|
|
36
37
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
37
38
|
var import_react_dom = __toESM(require("react-dom"));
|
|
@@ -89,7 +90,7 @@ const DSModalSlide = ({
|
|
|
89
90
|
container.style.position = "relative";
|
|
90
91
|
}
|
|
91
92
|
return import_react_dom.default.createPortal(
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Wrapper, {
|
|
93
94
|
classProps: {
|
|
94
95
|
show: isOpen,
|
|
95
96
|
centered
|
|
@@ -99,39 +100,53 @@ const DSModalSlide = ({
|
|
|
99
100
|
"--fade-in": fadeIn,
|
|
100
101
|
"--fade-out": fadeOut,
|
|
101
102
|
"--width": width
|
|
102
|
-
}
|
|
103
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_blocks.Overlay, {
|
|
104
|
-
classProps: {
|
|
105
|
-
show: isOpen
|
|
106
|
-
}
|
|
107
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_blocks.Content, {
|
|
108
|
-
onAnimationEnd: handleAnimationEnd,
|
|
109
|
-
classProps: {
|
|
110
|
-
show: isOpen
|
|
111
|
-
}
|
|
112
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
113
|
-
style: {
|
|
114
|
-
height: "100%",
|
|
115
|
-
width: "100%",
|
|
116
|
-
maxHeight: "100%",
|
|
117
|
-
overflow: "hidden",
|
|
118
|
-
"-webkit-backface-visibility": "hidden",
|
|
119
|
-
"backface-visibility": "hidden",
|
|
120
|
-
"-webkit-transform-style": "preserve-3d"
|
|
121
103
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Overlay, {
|
|
105
|
+
classProps: {
|
|
106
|
+
show: isOpen
|
|
107
|
+
},
|
|
108
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Content, {
|
|
109
|
+
onAnimationEnd: handleAnimationEnd,
|
|
110
|
+
classProps: {
|
|
111
|
+
show: isOpen
|
|
112
|
+
},
|
|
113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, {
|
|
114
|
+
style: {
|
|
115
|
+
height: "100%",
|
|
116
|
+
width: "100%",
|
|
117
|
+
maxHeight: "100%",
|
|
118
|
+
overflow: "hidden",
|
|
119
|
+
"-webkit-backface-visibility": "hidden",
|
|
120
|
+
"backface-visibility": "hidden",
|
|
121
|
+
"-webkit-transform-style": "preserve-3d"
|
|
122
|
+
},
|
|
123
|
+
rows: contentRows,
|
|
124
|
+
"data-testid": "ds-modal-slide",
|
|
125
|
+
children: [
|
|
126
|
+
header && import_react.default.cloneElement(header, { fullWidth }),
|
|
127
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, {
|
|
128
|
+
position: "initial",
|
|
129
|
+
type: "non-form"
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, {
|
|
132
|
+
style: { overflow: "hidden" },
|
|
133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, {
|
|
134
|
+
style: { overflow: "auto" },
|
|
135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.ActualContent, {
|
|
136
|
+
children
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
}),
|
|
140
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_separator.default, {
|
|
141
|
+
position: "initial",
|
|
142
|
+
type: "non-form"
|
|
143
|
+
}),
|
|
144
|
+
footer
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
})
|
|
149
|
+
}),
|
|
135
150
|
container
|
|
136
151
|
);
|
|
137
152
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSModalSlide.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAAwD;AACxD,0BAAoC;AACpC,uBAAqB;AACrB,uBAAyB;AACzB,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,o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EAAE,WAAW;AAAA,IAC7F;AAAA,EACF;AAAA,EAIA,WAAW,8BAAU,KAAK,YAAY,gDAAgD;AAAA,EAItF,QAAQ,8BAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,8BAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,8BAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,8BAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,6BAAyB,8BAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["ModalFooter", "ModalHeader", "ReactDOM", "React", "DSSeparator"]
|
|
7
7
|
}
|
|
@@ -29,7 +29,7 @@ __export(Footer_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(Footer_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
34
|
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
35
35
|
var import_blocks = require("./blocks");
|
|
@@ -44,21 +44,28 @@ const ModalFooter = ({
|
|
|
44
44
|
rejectProps = {
|
|
45
45
|
disabled: false
|
|
46
46
|
}
|
|
47
|
-
}) => /* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
47
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
48
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.FooterWrapper, {
|
|
49
|
+
children: [
|
|
50
|
+
!!onReject && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, {
|
|
51
|
+
buttonType: "secondary",
|
|
52
|
+
className: "action-reject",
|
|
53
|
+
containerProps: { "data-testid": "modal-footer-reject-btn" },
|
|
54
|
+
labelText: rejectLabel,
|
|
55
|
+
onClick: onReject,
|
|
56
|
+
...rejectProps
|
|
57
|
+
}),
|
|
58
|
+
!!onConfirm && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, {
|
|
59
|
+
buttonType: "primary",
|
|
60
|
+
className: "action-confirm",
|
|
61
|
+
containerProps: { "data-testid": "modal-footer-confirm-btn" },
|
|
62
|
+
labelText: confirmLabel,
|
|
63
|
+
onClick: onConfirm,
|
|
64
|
+
...confirmProps
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
62
69
|
const props = {
|
|
63
70
|
confirmLabel: import_ds_utilities.PropTypes.string.description("Confirm Label"),
|
|
64
71
|
rejectLabel: import_ds_utilities.PropTypes.string.description("Reject Label"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Footer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,0BAAoC;AACpC,uBAAqB;AACrB,oBAA8B;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE;AAAA,EACE,uDAAC;AAAA,IACE;AAAA,OAAC,CAAC,YACD,4CAAC,iBAAAA,SAAA;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,QAC3D,WAAW;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,OACN;AAAA,MAED,CAAC,CAAC,aACD,4CAAC,iBAAAA,SAAA;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,QAC5D,WAAW;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,OACN;AAAA;AAAA,GAEJ;AAAA,CACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,8BAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,8BAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,8BAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,8BAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,8BAAU,MAAM;AAAA,IAC5B,UAAU,8BAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,8BAAU,MAAM;AAAA,IAC3B,UAAU,8BAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,8BAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": ["DSButton"]
|
|
7
7
|
}
|
|
@@ -29,28 +29,41 @@ __export(Header_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(Header_exports);
|
|
31
31
|
var React = __toESM(require("react"));
|
|
32
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
34
34
|
var import_ds_system = require("@elliemae/ds-system");
|
|
35
35
|
var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
|
|
36
36
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
37
37
|
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
38
38
|
var import_blocks = require("./blocks");
|
|
39
|
-
const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(HeaderWrapper, {
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.HeaderLeftSide, {
|
|
42
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Header, {
|
|
43
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Title, {
|
|
44
|
+
children: headerTitle
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
toolbar,
|
|
49
|
+
toolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSeparator, {
|
|
50
|
+
position: "initial",
|
|
51
|
+
margin: "none",
|
|
52
|
+
orientation: "vertical",
|
|
53
|
+
type: "non-form"
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCloseButton, {
|
|
56
|
+
"data-testid": "modal-slider-header-close",
|
|
57
|
+
"aria-label": "Close modal slide",
|
|
58
|
+
buttonType: "text",
|
|
59
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Close, {
|
|
60
|
+
"aria-label": "Close modal slide",
|
|
61
|
+
size: "s"
|
|
62
|
+
}),
|
|
63
|
+
onClick: onClose
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
});
|
|
54
67
|
const HeaderWrapper = import_ds_system.styled.div`
|
|
55
68
|
display: flex;
|
|
56
69
|
justify-content: space-between;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ title: headerTitle = '', onClose = () => null, toolbar = null }) => (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n />\n </HeaderWrapper>\n);\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,0BAAoC;AACpC,uBAAuB;AACvB,0BAAwB;AACxB,sBAAsB;AACtB,uBAAqB;AACrB,oBAA8C;AAE9C,MAAM,cAAc,CAAC,EAAE,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,KAAK,MACnF,6CAAC;AAAA,EACC;AAAA,gDAAC;AAAA,MACC,sDAAC;AAAA,QACC,sDAAC;AAAA,UAAO;AAAA,SAAY;AAAA,OACtB;AAAA,KACF;AAAA,IACC;AAAA,IACA,WAAW,4CAAC;AAAA,MAAgB,UAAS;AAAA,MAAU,QAAO;AAAA,MAAO,aAAY;AAAA,MAAW,MAAK;AAAA,KAAW;AAAA,IACrG,4CAAC;AAAA,MACC,eAAY;AAAA,MACZ,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,4CAAC;AAAA,QAAM,cAAW;AAAA,QAAoB,MAAK;AAAA,OAAI;AAAA,MACrD,SAAS;AAAA,KACX;AAAA;AAAA,CACF;AAGF,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,sBAAkB,yBAAO,oBAAAA,OAAW;AAAA,aAC7B,CAACC,WAAUA,OAAM,MAAM,MAAM;AAAA;AAG1C,MAAM,wBAAoB,yBAAO,iBAAAC,OAAQ;AAAA,YAC7B,CAACD,WAAUA,OAAM,MAAM,MAAM;AAAA;AAGzC,MAAM,QAAQ;AAAA,EAEZ,SAAS,8BAAU,KAAK,YAAY,yBAAyB;AAAA,EAE7D,SAAS,8BAAU,KAAK,YAAY,0BAA0B;AAAA,EAE9D,OAAO,8BAAU,OAAO,YAAY,aAAa;AACnD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,8BAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": ["DSSeparator", "props", "DSButton"]
|
|
7
7
|
}
|
package/dist/esm/DSModalSlide.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import React2, { useState, useEffect, useCallback } from "react";
|
|
3
4
|
import { PropTypes, describe } from "@elliemae/ds-utilities";
|
|
4
5
|
import ReactDOM from "react-dom";
|
|
@@ -56,7 +57,7 @@ const DSModalSlide = ({
|
|
|
56
57
|
container.style.position = "relative";
|
|
57
58
|
}
|
|
58
59
|
return ReactDOM.createPortal(
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ jsx(Wrapper, {
|
|
60
61
|
classProps: {
|
|
61
62
|
show: isOpen,
|
|
62
63
|
centered
|
|
@@ -66,39 +67,53 @@ const DSModalSlide = ({
|
|
|
66
67
|
"--fade-in": fadeIn,
|
|
67
68
|
"--fade-out": fadeOut,
|
|
68
69
|
"--width": width
|
|
69
|
-
}
|
|
70
|
-
}, /* @__PURE__ */ React2.createElement(Overlay, {
|
|
71
|
-
classProps: {
|
|
72
|
-
show: isOpen
|
|
73
|
-
}
|
|
74
|
-
}, /* @__PURE__ */ React2.createElement(Content, {
|
|
75
|
-
onAnimationEnd: handleAnimationEnd,
|
|
76
|
-
classProps: {
|
|
77
|
-
show: isOpen
|
|
78
|
-
}
|
|
79
|
-
}, /* @__PURE__ */ React2.createElement(Grid, {
|
|
80
|
-
style: {
|
|
81
|
-
height: "100%",
|
|
82
|
-
width: "100%",
|
|
83
|
-
maxHeight: "100%",
|
|
84
|
-
overflow: "hidden",
|
|
85
|
-
"-webkit-backface-visibility": "hidden",
|
|
86
|
-
"backface-visibility": "hidden",
|
|
87
|
-
"-webkit-transform-style": "preserve-3d"
|
|
88
70
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
71
|
+
children: /* @__PURE__ */ jsx(Overlay, {
|
|
72
|
+
classProps: {
|
|
73
|
+
show: isOpen
|
|
74
|
+
},
|
|
75
|
+
children: /* @__PURE__ */ jsx(Content, {
|
|
76
|
+
onAnimationEnd: handleAnimationEnd,
|
|
77
|
+
classProps: {
|
|
78
|
+
show: isOpen
|
|
79
|
+
},
|
|
80
|
+
children: /* @__PURE__ */ jsxs(Grid, {
|
|
81
|
+
style: {
|
|
82
|
+
height: "100%",
|
|
83
|
+
width: "100%",
|
|
84
|
+
maxHeight: "100%",
|
|
85
|
+
overflow: "hidden",
|
|
86
|
+
"-webkit-backface-visibility": "hidden",
|
|
87
|
+
"backface-visibility": "hidden",
|
|
88
|
+
"-webkit-transform-style": "preserve-3d"
|
|
89
|
+
},
|
|
90
|
+
rows: contentRows,
|
|
91
|
+
"data-testid": "ds-modal-slide",
|
|
92
|
+
children: [
|
|
93
|
+
header && React2.cloneElement(header, { fullWidth }),
|
|
94
|
+
header && /* @__PURE__ */ jsx(DSSeparator, {
|
|
95
|
+
position: "initial",
|
|
96
|
+
type: "non-form"
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ jsx(Grid, {
|
|
99
|
+
style: { overflow: "hidden" },
|
|
100
|
+
children: /* @__PURE__ */ jsx(Grid, {
|
|
101
|
+
style: { overflow: "auto" },
|
|
102
|
+
children: /* @__PURE__ */ jsx(ActualContent, {
|
|
103
|
+
children
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
footer && /* @__PURE__ */ jsx(DSSeparator, {
|
|
108
|
+
position: "initial",
|
|
109
|
+
type: "non-form"
|
|
110
|
+
}),
|
|
111
|
+
footer
|
|
112
|
+
]
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
102
117
|
container
|
|
103
118
|
);
|
|
104
119
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Wrapper, Overlay, Content, ActualContent } from './components/blocks';\nimport ModalHeader from './components/Header';\nimport ModalFooter from './components/Footer';\n\n// eslint-disable-next-line complexity\nconst DSModalSlide = ({\n isOpen = false,\n children,\n getContainer,\n centered = false,\n fullWidth = false,\n header = null,\n footer = null,\n fadeOut = 1500,\n fadeIn = 1500,\n overrideHeight = false,\n}) => {\n const [isMoving, setMoving] = useState(false);\n const [show, setShow] = useState(isOpen);\n const [width, setWidth] = useState(50);\n const theme = useTheme();\n const contentRows = [...(header ? ['auto', '1px'] : []), '1fr', ...(footer ? ['1px', theme.space.m] : [])];\n\n const updateShow = useCallback(() => {\n if (fullWidth) setWidth(100);\n else setWidth(50);\n if (isOpen !== show) {\n setMoving(true);\n if (isOpen) {\n setShow(isOpen);\n }\n }\n }, [isOpen, fullWidth, isMoving]);\n\n useEffect(updateShow, [isOpen, fullWidth]);\n\n if (!show) return null;\n\n const container = getContainer();\n if (!container) return null;\n\n const handleAnimationEnd = () => {\n setMoving(false);\n if (!isOpen) setShow(isOpen);\n };\n\n let { height } = container.getBoundingClientRect();\n if (overrideHeight && container.scrollHeight > height) {\n height = container.scrollHeight;\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n return ReactDOM.createPortal(\n <Wrapper\n classProps={{\n show: isOpen,\n centered,\n }}\n style={{\n '--height': height,\n '--fade-in': fadeIn,\n '--fade-out': fadeOut,\n '--width': width,\n }}\n >\n <Overlay\n classProps={{\n show: isOpen,\n }}\n >\n <Content\n onAnimationEnd={handleAnimationEnd}\n classProps={{\n show: isOpen,\n }}\n >\n <Grid\n style={{\n height: '100%',\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n '-webkit-backface-visibility': 'hidden',\n 'backface-visibility': 'hidden',\n '-webkit-transform-style': 'preserve-3d',\n }}\n rows={contentRows}\n data-testid=\"ds-modal-slide\"\n >\n {header && React.cloneElement(header, { fullWidth })}\n {header && <DSSeparator position=\"initial\" type=\"non-form\" />}\n <Grid style={{ overflow: 'hidden' }}>\n <Grid style={{ overflow: 'auto' }}>\n <ActualContent>{children}</ActualContent>\n </Grid>\n </Grid>\n {footer && <DSSeparator position=\"initial\" type=\"non-form\" />}\n {footer}\n </Grid>\n </Content>\n </Overlay>\n </Wrapper>,\n container,\n );\n};\n\nconst props = {\n /**\n * If the modal slide is centered or not\n */\n centered: PropTypes.bool.description('If the modal slide is centered or not'),\n /**\n * If the modal slide is visible or not\n */\n isOpen: PropTypes.bool.description('If the modal slide is visible or not'),\n /**\n * Main content of the modal\n */\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.string, PropTypes.any]).isRequired.description(\n 'Main content of the modal',\n ),\n /**\n * If the modal slide takes the full width or not\n */\n fullWidth: PropTypes.bool.description('If the modal slide takes the full width or not'),\n /**\n * If the modal slide has a header, only available for full width option\n */\n header: PropTypes.element.description('If the modal slide has a header, only available for full width option'),\n /**\n * Ratio of fade out\n */\n fadeOut: PropTypes.number.description('Ratio of fade out'),\n /**\n * Ratio of fade in\n */\n fadeIn: PropTypes.number.description('Ratio of fade in'),\n /**\n * Override the panel height to scroll height of the container\n */\n overrideHeight: PropTypes.bool.description('Override the panel height to scroll height of the container'),\n};\n\nDSModalSlide.propTypes = props;\nDSModalSlide.displayName = 'DSModalSlide';\nconst DSModalSlideWithSchema = describe(DSModalSlide);\nDSModalSlideWithSchema.propTypes = props;\n\nexport { ModalHeader, ModalFooter, DSModalSlide, DSModalSlideWithSchema };\n\nexport default DSModalSlide;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,OAAOA,UAAS,UAAU,WAAW,mBAAmB;AACxD,SAAS,WAAW,gBAAgB;AACpC,OAAO,cAAc;AACrB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,OAAO,iBAAiB;AACxB,SAAS,SAAS,SAAS,SAAS,qBAAqB;AACzD,OAAO,iBAAiB;AACxB,OAAO,iBAAiB;AAGxB,MAAM,eAAe,CAAC;AAAA,EACpB,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,iBAAiB;AACnB,MAAM;AACJ,QAAM,CAAC,UAAU,SAAS,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,MAAM;AACvC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,QAAQ,SAAS;AACvB,QAAM,cAAc,CAAC,GAAI,SAAS,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAI,OAAO,GAAI,SAAS,CAAC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,CAAE;AAEzG,QAAM,aAAa,YAAY,MAAM;AACnC,QAAI;AAAW,eAAS,GAAG;AAAA;AACtB,eAAS,EAAE;AAChB,QAAI,WAAW,MAAM;AACnB,gBAAU,IAAI;AACd,UAAI,QAAQ;AACV,gBAAQ,MAAM;AAAA,MAChB;AAAA,IACF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;AAAA,kBAAK,OAAO,EAAE,UAAU,OAAO;AAAA,kBAC9B,8BAAC;AAAA,oBAAe;AAAA,mBAAS;AAAA,iBAC3B;AAAA,eACF;AAAA,cACC,UAAU,oBAAC;AAAA,gBAAY,UAAS;AAAA,gBAAU,MAAK;AAAA,eAAW;AAAA,cAC1D;AAAA;AAAA,WACH;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,QAAQ;AAAA,EAIZ,UAAU,UAAU,KAAK,YAAY,uCAAuC;AAAA,EAI5E,QAAQ,UAAU,KAAK,YAAY,sCAAsC;AAAA,EAIzE,UAAU,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,QAAQ,UAAU,GAAG,CAAC,EAAE,WAAW;AAAA,IAC7F;AAAA,EACF;AAAA,EAIA,WAAW,UAAU,KAAK,YAAY,gDAAgD;AAAA,EAItF,QAAQ,UAAU,QAAQ,YAAY,uEAAuE;AAAA,EAI7G,SAAS,UAAU,OAAO,YAAY,mBAAmB;AAAA,EAIzD,QAAQ,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAIvD,gBAAgB,UAAU,KAAK,YAAY,6DAA6D;AAC1G;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAInC,IAAO,uBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PropTypes, describe } from "@elliemae/ds-utilities";
|
|
4
4
|
import DSButton from "@elliemae/ds-button";
|
|
5
5
|
import { FooterWrapper } from "./blocks";
|
|
@@ -14,21 +14,28 @@ const ModalFooter = ({
|
|
|
14
14
|
rejectProps = {
|
|
15
15
|
disabled: false
|
|
16
16
|
}
|
|
17
|
-
}) => /* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
17
|
+
}) => /* @__PURE__ */ jsx(Fragment, {
|
|
18
|
+
children: /* @__PURE__ */ jsxs(FooterWrapper, {
|
|
19
|
+
children: [
|
|
20
|
+
!!onReject && /* @__PURE__ */ jsx(DSButton, {
|
|
21
|
+
buttonType: "secondary",
|
|
22
|
+
className: "action-reject",
|
|
23
|
+
containerProps: { "data-testid": "modal-footer-reject-btn" },
|
|
24
|
+
labelText: rejectLabel,
|
|
25
|
+
onClick: onReject,
|
|
26
|
+
...rejectProps
|
|
27
|
+
}),
|
|
28
|
+
!!onConfirm && /* @__PURE__ */ jsx(DSButton, {
|
|
29
|
+
buttonType: "primary",
|
|
30
|
+
className: "action-confirm",
|
|
31
|
+
containerProps: { "data-testid": "modal-footer-confirm-btn" },
|
|
32
|
+
labelText: confirmLabel,
|
|
33
|
+
onClick: onConfirm,
|
|
34
|
+
...confirmProps
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
32
39
|
const props = {
|
|
33
40
|
confirmLabel: PropTypes.string.description("Confirm Label"),
|
|
34
41
|
rejectLabel: PropTypes.string.description("Reject Label"),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Footer.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { FooterWrapper } from './blocks';\n\nconst ModalFooter = ({\n confirmLabel = 'Confirm',\n rejectLabel = 'Cancel',\n onConfirm,\n onReject,\n confirmProps = {\n disabled: false,\n },\n rejectProps = {\n disabled: false,\n },\n}) => (\n <>\n <FooterWrapper>\n {!!onReject && (\n <DSButton\n buttonType=\"secondary\"\n className=\"action-reject\"\n containerProps={{ 'data-testid': 'modal-footer-reject-btn' }}\n labelText={rejectLabel}\n onClick={onReject}\n {...rejectProps}\n />\n )}\n {!!onConfirm && (\n <DSButton\n buttonType=\"primary\"\n className=\"action-confirm\"\n containerProps={{ 'data-testid': 'modal-footer-confirm-btn' }}\n labelText={confirmLabel}\n onClick={onConfirm}\n {...confirmProps}\n />\n )}\n </FooterWrapper>\n </>\n);\n\nconst props = {\n /**\n * Confirm Label\n */\n confirmLabel: PropTypes.string.description('Confirm Label'),\n /**\n * Reject Label\n */\n rejectLabel: PropTypes.string.description('Reject Label'),\n /**\n * Callback\n */\n onConfirm: PropTypes.func.description('Callback'),\n /**\n * Callback\n */\n onReject: PropTypes.func.description('Callback'),\n /**\n * Extra DSButton props for confirm btn.\n */\n confirmProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for confirm btn.'),\n /**\n * Extra DSButton props for reject btn.\n */\n rejectProps: PropTypes.shape({\n disabled: PropTypes.bool,\n }).description('Extra DSButton props for reject btn.'),\n};\n\nModalFooter.propTypes = props;\nModalFooter.displayName = 'ModalFooter';\nconst DSModalSlideFooterWithSchema = describe(ModalFooter);\nDSModalSlideFooterWithSchema.propTypes = props;\n\nexport { DSModalSlideFooterWithSchema };\n\nexport default ModalFooter;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,WAAW,gBAAgB;AACpC,OAAO,cAAc;AACrB,SAAS,qBAAqB;AAE9B,MAAM,cAAc,CAAC;AAAA,EACnB,eAAe;AAAA,EACf,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,eAAe;AAAA,IACb,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,UAAU;AAAA,EACZ;AACF,MACE;AAAA,EACE,+BAAC;AAAA,IACE;AAAA,OAAC,CAAC,YACD,oBAAC;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAgB,EAAE,eAAe,0BAA0B;AAAA,QAC3D,WAAW;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,OACN;AAAA,MAED,CAAC,CAAC,aACD,oBAAC;AAAA,QACC,YAAW;AAAA,QACX,WAAU;AAAA,QACV,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,QAC5D,WAAW;AAAA,QACX,SAAS;AAAA,QACR,GAAG;AAAA,OACN;AAAA;AAAA,GAEJ;AAAA,CACF;AAGF,MAAM,QAAQ;AAAA,EAIZ,cAAc,UAAU,OAAO,YAAY,eAAe;AAAA,EAI1D,aAAa,UAAU,OAAO,YAAY,cAAc;AAAA,EAIxD,WAAW,UAAU,KAAK,YAAY,UAAU;AAAA,EAIhD,UAAU,UAAU,KAAK,YAAY,UAAU;AAAA,EAI/C,cAAc,UAAU,MAAM;AAAA,IAC5B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,uCAAuC;AAAA,EAItD,aAAa,UAAU,MAAM;AAAA,IAC3B,UAAU,UAAU;AAAA,EACtB,CAAC,EAAE,YAAY,sCAAsC;AACvD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,26 +1,39 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PropTypes, describe } from "@elliemae/ds-utilities";
|
|
4
4
|
import { styled } from "@elliemae/ds-system";
|
|
5
5
|
import DSSeparator from "@elliemae/ds-separator";
|
|
6
6
|
import { Close } from "@elliemae/ds-icons";
|
|
7
7
|
import DSButton from "@elliemae/ds-button";
|
|
8
8
|
import { Header, HeaderLeftSide, Title } from "./blocks";
|
|
9
|
-
const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
const ModalHeader = ({ title: headerTitle = "", onClose = () => null, toolbar = null }) => /* @__PURE__ */ jsxs(HeaderWrapper, {
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(HeaderLeftSide, {
|
|
12
|
+
children: /* @__PURE__ */ jsx(Header, {
|
|
13
|
+
children: /* @__PURE__ */ jsx(Title, {
|
|
14
|
+
children: headerTitle
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
18
|
+
toolbar,
|
|
19
|
+
toolbar && /* @__PURE__ */ jsx(StyledSeparator, {
|
|
20
|
+
position: "initial",
|
|
21
|
+
margin: "none",
|
|
22
|
+
orientation: "vertical",
|
|
23
|
+
type: "non-form"
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx(StyledCloseButton, {
|
|
26
|
+
"data-testid": "modal-slider-header-close",
|
|
27
|
+
"aria-label": "Close modal slide",
|
|
28
|
+
buttonType: "text",
|
|
29
|
+
icon: /* @__PURE__ */ jsx(Close, {
|
|
30
|
+
"aria-label": "Close modal slide",
|
|
31
|
+
size: "s"
|
|
32
|
+
}),
|
|
33
|
+
onClick: onClose
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
});
|
|
24
37
|
const HeaderWrapper = styled.div`
|
|
25
38
|
display: flex;
|
|
26
39
|
justify-content: space-between;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Header.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport { styled } from '@elliemae/ds-system';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Close } from '@elliemae/ds-icons';\nimport DSButton from '@elliemae/ds-button';\nimport { Header, HeaderLeftSide, Title } from './blocks';\n\nconst ModalHeader = ({ title: headerTitle = '', onClose = () => null, toolbar = null }) => (\n <HeaderWrapper>\n <HeaderLeftSide>\n <Header>\n <Title>{headerTitle}</Title>\n </Header>\n </HeaderLeftSide>\n {toolbar}\n {toolbar && <StyledSeparator position=\"initial\" margin=\"none\" orientation=\"vertical\" type=\"non-form\" />}\n <StyledCloseButton\n data-testid=\"modal-slider-header-close\"\n aria-label=\"Close modal slide\"\n buttonType=\"text\"\n icon={<Close aria-label=\"Close modal slide\" size=\"s\" />}\n onClick={onClose}\n />\n </HeaderWrapper>\n);\n\nconst HeaderWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n height: 48px;\n overflow: hidden;\n`;\n\nconst StyledSeparator = styled(DSSeparator)`\n padding: ${(props) => props.theme.space.xs} 0;\n`;\n\nconst StyledCloseButton = styled(DSButton)`\n margin: ${(props) => props.theme.space.xs};\n`;\n\nconst props = {\n /** on modal close callback */\n onClose: PropTypes.func.description('on modal close callback'),\n /** modal toolbar component */\n toolbar: PropTypes.node.description('modal toolbar comoponent'),\n /** modal title */\n title: PropTypes.string.description('modal title'),\n};\n\nModalHeader.propTypes = props;\nModalHeader.displayName = 'ModalHeader';\nconst DSModalSlideHeaderWithSchema = describe(ModalHeader);\nDSModalSlideHeaderWithSchema.propTypes = props;\n\nexport { DSModalSlideHeaderWithSchema };\n\nexport default ModalHeader;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;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,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal-slide",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal Slide",
|
|
6
6
|
"files": [
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-button": "3.5.
|
|
55
|
-
"@elliemae/ds-classnames": "3.5.
|
|
56
|
-
"@elliemae/ds-grid": "3.5.
|
|
57
|
-
"@elliemae/ds-icons": "3.5.
|
|
58
|
-
"@elliemae/ds-separator": "3.5.
|
|
59
|
-
"@elliemae/ds-system": "3.5.
|
|
60
|
-
"@elliemae/ds-utilities": "3.5.
|
|
54
|
+
"@elliemae/ds-button": "3.5.1-next.0",
|
|
55
|
+
"@elliemae/ds-classnames": "3.5.1-next.0",
|
|
56
|
+
"@elliemae/ds-grid": "3.5.1-next.0",
|
|
57
|
+
"@elliemae/ds-icons": "3.5.1-next.0",
|
|
58
|
+
"@elliemae/ds-separator": "3.5.1-next.0",
|
|
59
|
+
"@elliemae/ds-system": "3.5.1-next.0",
|
|
60
|
+
"@elliemae/ds-utilities": "3.5.1-next.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@testing-library/react": "~12.1.3",
|