@elliemae/ds-modal-slide 3.12.0-next.1 → 3.12.0-rc.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.
- package/dist/cjs/DSModalSlide.js +28 -14
- package/dist/cjs/DSModalSlide.js.map +3 -3
- package/dist/cjs/components/Header.js +31 -27
- package/dist/cjs/components/Header.js.map +2 -2
- package/dist/esm/DSModalSlide.js +30 -16
- package/dist/esm/DSModalSlide.js.map +3 -3
- package/dist/esm/components/Header.js +31 -27
- package/dist/esm/components/Header.js.map +2 -2
- package/package.json +10 -10
package/dist/cjs/DSModalSlide.js
CHANGED
|
@@ -42,23 +42,34 @@ var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
|
|
|
42
42
|
var import_blocks = require("./components/blocks");
|
|
43
43
|
var import_Header = __toESM(require("./components/Header"));
|
|
44
44
|
var import_Footer = __toESM(require("./components/Footer"));
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
const StyledWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid)`
|
|
46
|
+
overflow: auto;
|
|
47
|
+
&:focus,
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
outline: 1px solid ${({ theme }) => theme.colors.brand["600"]};
|
|
50
|
+
outline-offset: -1px;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const DSModalSlide = (props2) => {
|
|
54
|
+
const {
|
|
55
|
+
isOpen = false,
|
|
56
|
+
children,
|
|
57
|
+
getContainer,
|
|
58
|
+
centered = false,
|
|
59
|
+
fullWidth = false,
|
|
60
|
+
header = null,
|
|
61
|
+
footer = null,
|
|
62
|
+
fadeOut = 1500,
|
|
63
|
+
fadeIn = 1500,
|
|
64
|
+
overrideHeight = false,
|
|
65
|
+
innerRef = null
|
|
66
|
+
} = props2;
|
|
57
67
|
const [isMoving, setMoving] = (0, import_react.useState)(false);
|
|
58
68
|
const [show, setShow] = (0, import_react.useState)(isOpen);
|
|
59
69
|
const [width, setWidth] = (0, import_react.useState)(50);
|
|
60
70
|
const theme = (0, import_ds_system.useTheme)();
|
|
61
71
|
const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
|
|
72
|
+
const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(props2);
|
|
62
73
|
const updateShow = (0, import_react.useCallback)(() => {
|
|
63
74
|
if (fullWidth)
|
|
64
75
|
setWidth(100);
|
|
@@ -91,6 +102,7 @@ const DSModalSlide = ({
|
|
|
91
102
|
}
|
|
92
103
|
return import_react_dom.default.createPortal(
|
|
93
104
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Wrapper, {
|
|
105
|
+
...globalAttrs,
|
|
94
106
|
classProps: {
|
|
95
107
|
show: isOpen,
|
|
96
108
|
centered
|
|
@@ -130,8 +142,10 @@ const DSModalSlide = ({
|
|
|
130
142
|
}),
|
|
131
143
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, {
|
|
132
144
|
style: { overflow: "hidden" },
|
|
133
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
134
|
-
|
|
145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledWrapper, {
|
|
146
|
+
ref: innerRef,
|
|
147
|
+
tabIndex: 0,
|
|
148
|
+
role: "contentinfo",
|
|
135
149
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.ActualContent, {
|
|
136
150
|
children
|
|
137
151
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSModalSlide.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mCAAAA;AAAA,EAAA,iCAAAC;AAAA,EAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": ["ModalFooter", "ModalHeader", "ReactDOM", "React", "DSSeparator"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\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 globalAttrs = useGetGlobalAttributes(props);\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 {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;ADiGb;AAhGV,mBAAwD;AACxD,0BAA4D;AAC5D,uBAAqB;AACrB,uBAAiC;AACjC,qBAAqB;AACrB,0BAAwB;AACxB,oBAAyD;AACzD,oBAAwB;AACxB,oBAAwB;AAExB,MAAM,oBAAgB,yBAAO,mBAAI;AAAA;AAAA;AAAA;AAAA,yBAIR,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAK3D,MAAM,eAAe,CAACC,WAAU;AAC9B,QAAM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AA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AAK,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
|
+
"names": ["ModalFooter", "ModalHeader", "props", "ReactDOM", "React", "DSSeparator"]
|
|
7
7
|
}
|
|
@@ -36,34 +36,37 @@ 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 }) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.
|
|
44
|
-
children:
|
|
39
|
+
const ModalHeader = ({ innerRef = null, title: headerTitle = "", onClose = () => null, toolbar = null }) => {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(HeaderWrapper, {
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.HeaderLeftSide, {
|
|
43
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Header, {
|
|
44
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.Title, {
|
|
45
|
+
children: headerTitle
|
|
46
|
+
})
|
|
45
47
|
})
|
|
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
48
|
}),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
toolbar,
|
|
50
|
+
toolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSeparator, {
|
|
51
|
+
position: "initial",
|
|
52
|
+
margin: "none",
|
|
53
|
+
orientation: "vertical",
|
|
54
|
+
type: "non-form"
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCloseButton, {
|
|
57
|
+
"data-testid": "modal-slider-header-close",
|
|
58
|
+
"aria-label": "Close modal slide",
|
|
59
|
+
buttonType: "text",
|
|
60
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Close, {
|
|
61
|
+
"aria-label": "Close modal slide",
|
|
62
|
+
size: "s"
|
|
63
|
+
}),
|
|
64
|
+
onClick: onClose,
|
|
65
|
+
innerRef
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
67
70
|
const HeaderWrapper = import_ds_system.styled.div`
|
|
68
71
|
display: flex;
|
|
69
72
|
justify-content: space-between;
|
|
@@ -81,7 +84,8 @@ const StyledCloseButton = (0, import_ds_system.styled)(import_ds_button.default)
|
|
|
81
84
|
const props = {
|
|
82
85
|
onClose: import_ds_utilities.PropTypes.func.description("on modal close callback"),
|
|
83
86
|
toolbar: import_ds_utilities.PropTypes.node.description("modal toolbar comoponent"),
|
|
84
|
-
title: import_ds_utilities.PropTypes.string.description("modal title")
|
|
87
|
+
title: import_ds_utilities.PropTypes.string.description("modal title"),
|
|
88
|
+
innerRef: import_ds_utilities.PropTypes.func.description("button close ref ")
|
|
85
89
|
};
|
|
86
90
|
ModalHeader.propTypes = props;
|
|
87
91
|
ModalHeader.displayName = "ModalHeader";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
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 = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => {\n return (\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 innerRef={innerRef}\n />\n </HeaderWrapper>\n );\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 innerRef: PropTypes.func.description('button close ref '),\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;ADUnB;AATJ,0BAAoC;AACpC,uBAAuB;AACvB,0BAAwB;AACxB,sBAAsB;AACtB,uBAAqB;AACrB,oBAA8C;AAE9C,MAAM,cAAc,CAAC,EAAE,WAAW,MAAM,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,KAAK,MAAM;AAC1G,SACE,6CAAC;AAAA,IACC;AAAA,kDAAC;AAAA,QACC,sDAAC;AAAA,UACC,sDAAC;AAAA,YAAO;AAAA,WAAY;AAAA,SACtB;AAAA,OACF;AAAA,MACC;AAAA,MACA,WAAW,4CAAC;AAAA,QAAgB,UAAS;AAAA,QAAU,QAAO;AAAA,QAAO,aAAY;AAAA,QAAW,MAAK;AAAA,OAAW;AAAA,MACrG,4CAAC;AAAA,QACC,eAAY;AAAA,QACZ,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,4CAAC;AAAA,UAAM,cAAW;AAAA,UAAoB,MAAK;AAAA,SAAI;AAAA,QACrD,SAAS;AAAA,QACT;AAAA,OACF;AAAA;AAAA,GACF;AAEJ;AAEA,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;AAAA,EACjD,UAAU,8BAAU,KAAK,YAAY,mBAAmB;AAC1D;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,mCAA+B,8BAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["DSSeparator", "props", "DSButton"]
|
|
7
7
|
}
|
package/dist/esm/DSModalSlide.js
CHANGED
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React2, { useState, useEffect, useCallback } from "react";
|
|
4
|
-
import { PropTypes, describe } from "@elliemae/ds-utilities";
|
|
4
|
+
import { PropTypes, describe, useGetGlobalAttributes } from "@elliemae/ds-utilities";
|
|
5
5
|
import ReactDOM from "react-dom";
|
|
6
|
-
import { useTheme } from "@elliemae/ds-system";
|
|
6
|
+
import { useTheme, styled } from "@elliemae/ds-system";
|
|
7
7
|
import { Grid } from "@elliemae/ds-grid";
|
|
8
8
|
import DSSeparator from "@elliemae/ds-separator";
|
|
9
9
|
import { Wrapper, Overlay, Content, ActualContent } from "./components/blocks";
|
|
10
10
|
import ModalHeader from "./components/Header";
|
|
11
11
|
import ModalFooter from "./components/Footer";
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const StyledWrapper = styled(Grid)`
|
|
13
|
+
overflow: auto;
|
|
14
|
+
&:focus,
|
|
15
|
+
&:focus-visible {
|
|
16
|
+
outline: 1px solid ${({ theme }) => theme.colors.brand["600"]};
|
|
17
|
+
outline-offset: -1px;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const DSModalSlide = (props2) => {
|
|
21
|
+
const {
|
|
22
|
+
isOpen = false,
|
|
23
|
+
children,
|
|
24
|
+
getContainer,
|
|
25
|
+
centered = false,
|
|
26
|
+
fullWidth = false,
|
|
27
|
+
header = null,
|
|
28
|
+
footer = null,
|
|
29
|
+
fadeOut = 1500,
|
|
30
|
+
fadeIn = 1500,
|
|
31
|
+
overrideHeight = false,
|
|
32
|
+
innerRef = null
|
|
33
|
+
} = props2;
|
|
24
34
|
const [isMoving, setMoving] = useState(false);
|
|
25
35
|
const [show, setShow] = useState(isOpen);
|
|
26
36
|
const [width, setWidth] = useState(50);
|
|
27
37
|
const theme = useTheme();
|
|
28
38
|
const contentRows = [...header ? ["auto", "1px"] : [], "1fr", ...footer ? ["1px", theme.space.m] : []];
|
|
39
|
+
const globalAttrs = useGetGlobalAttributes(props2);
|
|
29
40
|
const updateShow = useCallback(() => {
|
|
30
41
|
if (fullWidth)
|
|
31
42
|
setWidth(100);
|
|
@@ -58,6 +69,7 @@ const DSModalSlide = ({
|
|
|
58
69
|
}
|
|
59
70
|
return ReactDOM.createPortal(
|
|
60
71
|
/* @__PURE__ */ jsx(Wrapper, {
|
|
72
|
+
...globalAttrs,
|
|
61
73
|
classProps: {
|
|
62
74
|
show: isOpen,
|
|
63
75
|
centered
|
|
@@ -97,8 +109,10 @@ const DSModalSlide = ({
|
|
|
97
109
|
}),
|
|
98
110
|
/* @__PURE__ */ jsx(Grid, {
|
|
99
111
|
style: { overflow: "hidden" },
|
|
100
|
-
children: /* @__PURE__ */ jsx(
|
|
101
|
-
|
|
112
|
+
children: /* @__PURE__ */ jsx(StyledWrapper, {
|
|
113
|
+
ref: innerRef,
|
|
114
|
+
tabIndex: 0,
|
|
115
|
+
role: "contentinfo",
|
|
102
116
|
children: /* @__PURE__ */ jsx(ActualContent, {
|
|
103
117
|
children
|
|
104
118
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSModalSlide.tsx"],
|
|
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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": ["React"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport { PropTypes, describe, useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport ReactDOM from 'react-dom';\nimport { useTheme, styled } 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\nconst StyledWrapper = styled(Grid)`\n overflow: auto;\n &:focus,\n &:focus-visible {\n outline: 1px solid ${({ theme }) => theme.colors.brand['600']};\n outline-offset: -1px;\n }\n`;\n// eslint-disable-next-line complexity\nconst DSModalSlide = (props) => {\n const {\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 innerRef = null,\n } = props;\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 globalAttrs = useGetGlobalAttributes(props);\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 {...globalAttrs}\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 <StyledWrapper ref={innerRef} tabIndex={0} role=\"contentinfo\">\n <ActualContent>{children}</ActualContent>\n </StyledWrapper>\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;ACiGb,SAca,KAdb;AAhGV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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
|
+
"names": ["React", "props"]
|
|
7
7
|
}
|
|
@@ -6,34 +6,37 @@ 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 }) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: /* @__PURE__ */ jsx(
|
|
14
|
-
children:
|
|
9
|
+
const ModalHeader = ({ innerRef = null, title: headerTitle = "", onClose = () => null, toolbar = null }) => {
|
|
10
|
+
return /* @__PURE__ */ jsxs(HeaderWrapper, {
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(HeaderLeftSide, {
|
|
13
|
+
children: /* @__PURE__ */ jsx(Header, {
|
|
14
|
+
children: /* @__PURE__ */ jsx(Title, {
|
|
15
|
+
children: headerTitle
|
|
16
|
+
})
|
|
15
17
|
})
|
|
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
18
|
}),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
toolbar,
|
|
20
|
+
toolbar && /* @__PURE__ */ jsx(StyledSeparator, {
|
|
21
|
+
position: "initial",
|
|
22
|
+
margin: "none",
|
|
23
|
+
orientation: "vertical",
|
|
24
|
+
type: "non-form"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx(StyledCloseButton, {
|
|
27
|
+
"data-testid": "modal-slider-header-close",
|
|
28
|
+
"aria-label": "Close modal slide",
|
|
29
|
+
buttonType: "text",
|
|
30
|
+
icon: /* @__PURE__ */ jsx(Close, {
|
|
31
|
+
"aria-label": "Close modal slide",
|
|
32
|
+
size: "s"
|
|
33
|
+
}),
|
|
34
|
+
onClick: onClose,
|
|
35
|
+
innerRef
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
37
40
|
const HeaderWrapper = styled.div`
|
|
38
41
|
display: flex;
|
|
39
42
|
justify-content: space-between;
|
|
@@ -51,7 +54,8 @@ const StyledCloseButton = styled(DSButton)`
|
|
|
51
54
|
const props = {
|
|
52
55
|
onClose: PropTypes.func.description("on modal close callback"),
|
|
53
56
|
toolbar: PropTypes.node.description("modal toolbar comoponent"),
|
|
54
|
-
title: PropTypes.string.description("modal title")
|
|
57
|
+
title: PropTypes.string.description("modal title"),
|
|
58
|
+
innerRef: PropTypes.func.description("button close ref ")
|
|
55
59
|
};
|
|
56
60
|
ModalHeader.propTypes = props;
|
|
57
61
|
ModalHeader.displayName = "ModalHeader";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Header.tsx"],
|
|
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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
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 = ({ innerRef = null, title: headerTitle = '', onClose = () => null, toolbar = null }) => {\n return (\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 innerRef={innerRef}\n />\n </HeaderWrapper>\n );\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 innerRef: PropTypes.func.description('button close ref '),\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;ACUnB,SAGM,KAHN;AATJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,cAAc;AACvB,OAAO,iBAAiB;AACxB,SAAS,aAAa;AACtB,OAAO,cAAc;AACrB,SAAS,QAAQ,gBAAgB,aAAa;AAE9C,MAAM,cAAc,CAAC,EAAE,WAAW,MAAM,OAAO,cAAc,IAAI,UAAU,MAAM,MAAM,UAAU,KAAK,MAAM;AAC1G,SACE,qBAAC;AAAA,IACC;AAAA,0BAAC;AAAA,QACC,8BAAC;AAAA,UACC,8BAAC;AAAA,YAAO;AAAA,WAAY;AAAA,SACtB;AAAA,OACF;AAAA,MACC;AAAA,MACA,WAAW,oBAAC;AAAA,QAAgB,UAAS;AAAA,QAAU,QAAO;AAAA,QAAO,aAAY;AAAA,QAAW,MAAK;AAAA,OAAW;AAAA,MACrG,oBAAC;AAAA,QACC,eAAY;AAAA,QACZ,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAM,oBAAC;AAAA,UAAM,cAAW;AAAA,UAAoB,MAAK;AAAA,SAAI;AAAA,QACrD,SAAS;AAAA,QACT;AAAA,OACF;AAAA;AAAA,GACF;AAEJ;AAEA,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7B,MAAM,kBAAkB,OAAO,WAAW;AAAA,aAC7B,CAACA,WAAUA,OAAM,MAAM,MAAM;AAAA;AAG1C,MAAM,oBAAoB,OAAO,QAAQ;AAAA,YAC7B,CAACA,WAAUA,OAAM,MAAM,MAAM;AAAA;AAGzC,MAAM,QAAQ;AAAA,EAEZ,SAAS,UAAU,KAAK,YAAY,yBAAyB;AAAA,EAE7D,SAAS,UAAU,KAAK,YAAY,0BAA0B;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,aAAa;AAAA,EACjD,UAAU,UAAU,KAAK,YAAY,mBAAmB;AAC1D;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,+BAA+B,SAAS,WAAW;AACzD,6BAA6B,YAAY;AAIzC,IAAO,iBAAQ;",
|
|
6
6
|
"names": ["props"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-modal-slide",
|
|
3
|
-
"version": "3.12.0-
|
|
3
|
+
"version": "3.12.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Modal Slide",
|
|
6
6
|
"files": [
|
|
@@ -51,23 +51,23 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-button": "3.12.0-
|
|
55
|
-
"@elliemae/ds-classnames": "3.12.0-
|
|
56
|
-
"@elliemae/ds-grid": "3.12.0-
|
|
57
|
-
"@elliemae/ds-icons": "3.12.0-
|
|
58
|
-
"@elliemae/ds-separator": "3.12.0-
|
|
59
|
-
"@elliemae/ds-system": "3.12.0-
|
|
60
|
-
"@elliemae/ds-utilities": "3.12.0-
|
|
54
|
+
"@elliemae/ds-button": "3.12.0-rc.1",
|
|
55
|
+
"@elliemae/ds-classnames": "3.12.0-rc.1",
|
|
56
|
+
"@elliemae/ds-grid": "3.12.0-rc.1",
|
|
57
|
+
"@elliemae/ds-icons": "3.12.0-rc.1",
|
|
58
|
+
"@elliemae/ds-separator": "3.12.0-rc.1",
|
|
59
|
+
"@elliemae/ds-system": "3.12.0-rc.1",
|
|
60
|
+
"@elliemae/ds-utilities": "3.12.0-rc.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@testing-library/react": "~12.1.3",
|
|
64
|
-
"styled-components": "~5.3.
|
|
64
|
+
"styled-components": "~5.3.6"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"lodash": "~4.17.21",
|
|
68
68
|
"react": "~17.0.2",
|
|
69
69
|
"react-dom": "~17.0.2",
|
|
70
|
-
"styled-components": "
|
|
70
|
+
"styled-components": "~5.3.6"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public",
|