@elliemae/ds-dialog 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/DSDialog.js +5 -4
- package/dist/cjs/DSDialog.js.map +2 -2
- package/dist/cjs/parts/DSDialogPortal.js +3 -2
- package/dist/cjs/parts/DSDialogPortal.js.map +2 -2
- package/dist/cjs/parts/dialogContent/DSDialogContent.js +24 -18
- package/dist/cjs/parts/dialogContent/DSDialogContent.js.map +2 -2
- package/dist/esm/DSDialog.js +5 -4
- package/dist/esm/DSDialog.js.map +2 -2
- package/dist/esm/parts/DSDialogPortal.js +3 -2
- package/dist/esm/parts/DSDialogPortal.js.map +2 -2
- package/dist/esm/parts/dialogContent/DSDialogContent.js +24 -18
- package/dist/esm/parts/dialogContent/DSDialogContent.js.map +2 -2
- package/package.json +5 -5
package/dist/cjs/DSDialog.js
CHANGED
|
@@ -29,7 +29,7 @@ __export(DSDialog_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(DSDialog_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_propTypes = require("./propTypes");
|
|
35
35
|
var import_useDialog = require("./config/useDialog");
|
|
@@ -37,9 +37,10 @@ var import_DSDialogPortal = require("./parts/DSDialogPortal");
|
|
|
37
37
|
var import_DSDialogCTX = require("./DSDialogCTX");
|
|
38
38
|
const DSDialog = (props) => {
|
|
39
39
|
const ctx = (0, import_useDialog.useDialog)(props);
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
value: ctx
|
|
42
|
-
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSDialogCTX.DSDialogContext.Provider, {
|
|
41
|
+
value: ctx,
|
|
42
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSDialogPortal.DSDialogPortal, {})
|
|
43
|
+
});
|
|
43
44
|
};
|
|
44
45
|
DSDialog.displayName = "DSDialog";
|
|
45
46
|
const DSDialogWithSchema = (0, import_ds_utilities.describe)(DSDialog);
|
package/dist/cjs/DSDialog.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDialog.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { WeakValidationMap } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { propTypes } from './propTypes';\nimport { useDialog } from './config/useDialog';\nimport { DSDialogPortal } from './parts/DSDialogPortal';\nimport { DSDialogContext } from './DSDialogCTX';\nimport type { DSDialogT } from './propTypes';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\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,0BAAyB;AACzB,uBAA0B;AAC1B,uBAA0B;AAC1B,4BAA+B;AAC/B,yBAAgC;AAGhC,MAAM,WAAW,CAAC,UAAwC;AACxD,QAAM,UAAM,4BAAU,KAAK;AAE3B,SACE,4CAAC,mCAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,IAC/B,sDAAC,wCAAe;AAAA,GAClB;AAEJ;AACA,SAAS,cAAc;AACvB,MAAM,yBAAqB,8BAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -28,7 +28,8 @@ __export(DSDialogPortal_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(DSDialogPortal_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
32
33
|
var import_react_dom = __toESM(require("react-dom"));
|
|
33
34
|
var import_DSDialogCTX = require("../DSDialogCTX");
|
|
34
35
|
var import_DSDialogContent = require("./dialogContent/DSDialogContent");
|
|
@@ -38,7 +39,7 @@ const DSDialogPortal = () => {
|
|
|
38
39
|
actualPortalRef
|
|
39
40
|
} = (0, import_react.useContext)(import_DSDialogCTX.DSDialogContext);
|
|
40
41
|
if (isOpen && actualPortalRef.current) {
|
|
41
|
-
return import_react_dom.default.createPortal(/* @__PURE__ */
|
|
42
|
+
return import_react_dom.default.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSDialogContent.DSDialogContent, {}), actualPortalRef.current);
|
|
42
43
|
}
|
|
43
44
|
return null;
|
|
44
45
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/DSDialogPortal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useContext } from 'react';\nimport ReactDOM from 'react-dom';\nimport { DSDialogContext } from '../DSDialogCTX';\nimport { DSDialogContent } from './dialogContent/DSDialogContent';\n\nexport const DSDialogPortal = (): JSX.Element | null => {\n const {\n props: { isOpen },\n actualPortalRef,\n } = useContext(DSDialogContext);\n\n if (isOpen && actualPortalRef.current) {\n return ReactDOM.createPortal(<DSDialogContent />, actualPortalRef.current);\n }\n\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,uBAAqB;AACrB,yBAAgC;AAChC,6BAAgC;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,EACF,QAAI,yBAAW,kCAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,iBAAAA,QAAS,aAAa,
|
|
6
|
-
"names": ["ReactDOM"
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAAA,mBAAkC;AAClC,uBAAqB;AACrB,yBAAgC;AAChC,6BAAgC;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,EACF,QAAI,yBAAW,kCAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,iBAAAA,QAAS,aAAa,4CAAC,0CAAgB,GAAI,gBAAgB,OAAO;AAAA,EAC3E;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": ["ReactDOM"]
|
|
7
7
|
}
|
|
@@ -28,7 +28,8 @@ __export(DSDialogContent_exports, {
|
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(DSDialogContent_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
32
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
33
34
|
var import_styles = require("../../styles");
|
|
34
35
|
var import_utils = require("../../utils");
|
|
@@ -53,26 +54,31 @@ const DSDialogContent = () => {
|
|
|
53
54
|
},
|
|
54
55
|
[containerRef, removeAutoFocus]
|
|
55
56
|
);
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.StyledDialogBackground, {
|
|
57
58
|
className,
|
|
58
59
|
onClick: handleOutsideClick,
|
|
59
60
|
"data-portalbg": true,
|
|
60
61
|
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
61
|
-
zIndex
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
zIndex,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.PortalStyles, {
|
|
65
|
+
portalInfo,
|
|
66
|
+
portalClassName
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledDialogContainer, {
|
|
69
|
+
role: "dialog",
|
|
70
|
+
"aria-modal": true,
|
|
71
|
+
ref: refCallback,
|
|
72
|
+
tabIndex: !removeAutoFocus ? 0 : void 0,
|
|
73
|
+
onKeyDown: handleOnKeyDown,
|
|
74
|
+
...(0, import_utils.getSpaceProps)(rest),
|
|
75
|
+
centered,
|
|
76
|
+
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
|
|
77
|
+
...restOfGlobalAttributes,
|
|
78
|
+
size,
|
|
79
|
+
children
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
});
|
|
77
83
|
};
|
|
78
84
|
//# sourceMappingURL=DSDialogContent.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/dialogContent/DSDialogContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useCallback, useContext } from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport { PortalStyles, StyledDialogBackground, StyledDialogContainer } from '../../styles';\nimport { getSpaceProps } from '../../utils';\nimport { DSDialogDatatestid } from '../../DSDialogDatatestid';\nimport { DSDialogContext } from '../../DSDialogCTX';\nimport { useDialogContent } from './useDialogContent';\n\nexport const DSDialogContent = () => {\n const { handleOutsideClick, handleOnKeyDown } = useDialogContent();\n const { props, containerRef, portalInfo, portalClassName } = useContext(DSDialogContext);\n\n const { removeAutoFocus, zIndex, centered, size, children, ...rest } = props;\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(props, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n const refCallback = useCallback(\n (_ref: HTMLDivElement | null) => {\n if (_ref) {\n containerRef.current = _ref;\n if (!removeAutoFocus) _ref.focus();\n }\n },\n [containerRef, removeAutoFocus],\n );\n\n return (\n <StyledDialogBackground\n className={className}\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <PortalStyles portalInfo={portalInfo} portalClassName={portalClassName} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={refCallback}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest as unknown as Record<string, unknown>)}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\n size={size}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+C;AAC/C,0BAAuC;AACvC,oBAA4E;AAC5E,mBAA8B;AAC9B,gCAAmC;AACnC,yBAAgC;AAChC,8BAAiC;AAE1B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AAC;AAAA,IACC;AAAA,IACA,SAAS;AAAA,IACT,iBAAa;AAAA,IACb,eAAa,6CAAmB;AAAA,IAChC;AAAA,IAEA;AAAA,kDAAC;AAAA,QAAa;AAAA,QAAwB;AAAA,OAAkC;AAAA,MACxE,4CAAC;AAAA,QACC,MAAK;AAAA,QACL,cAAU;AAAA,QACV,KAAK;AAAA,QACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,QACjC,WAAW;AAAA,QACV,OAAG,4BAAc,IAA0C;AAAA,QAC5D;AAAA,QACA,eAAa,6CAAmB;AAAA,QAC/B,GAAG;AAAA,QACJ;AAAA,QAEC;AAAA,OACH;AAAA;AAAA,GACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSDialog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-utilities";
|
|
4
4
|
import { propTypes } from "./propTypes";
|
|
5
5
|
import { useDialog } from "./config/useDialog";
|
|
@@ -7,9 +7,10 @@ import { DSDialogPortal } from "./parts/DSDialogPortal";
|
|
|
7
7
|
import { DSDialogContext } from "./DSDialogCTX";
|
|
8
8
|
const DSDialog = (props) => {
|
|
9
9
|
const ctx = useDialog(props);
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
value: ctx
|
|
12
|
-
|
|
10
|
+
return /* @__PURE__ */ jsx(DSDialogContext.Provider, {
|
|
11
|
+
value: ctx,
|
|
12
|
+
children: /* @__PURE__ */ jsx(DSDialogPortal, {})
|
|
13
|
+
});
|
|
13
14
|
};
|
|
14
15
|
DSDialog.displayName = "DSDialog";
|
|
15
16
|
const DSDialogWithSchema = describe(DSDialog);
|
package/dist/esm/DSDialog.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { WeakValidationMap } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { propTypes } from './propTypes';\nimport { useDialog } from './config/useDialog';\nimport { DSDialogPortal } from './parts/DSDialogPortal';\nimport { DSDialogContext } from './DSDialogCTX';\nimport type { DSDialogT } from './propTypes';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element => {\n const ctx = useDialog(props);\n\n return (\n <DSDialogContext.Provider value={ctx}>\n <DSDialogPortal />\n </DSDialogContext.Provider>\n );\n};\nDSDialog.displayName = 'DSDialog';\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAGhC,MAAM,WAAW,CAAC,UAAwC;AACxD,QAAM,MAAM,UAAU,KAAK;AAE3B,SACE,oBAAC,gBAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,IAC/B,8BAAC,kBAAe;AAAA,GAClB;AAEJ;AACA,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useContext } from "react";
|
|
3
4
|
import ReactDOM from "react-dom";
|
|
4
5
|
import { DSDialogContext } from "../DSDialogCTX";
|
|
5
6
|
import { DSDialogContent } from "./dialogContent/DSDialogContent";
|
|
@@ -9,7 +10,7 @@ const DSDialogPortal = () => {
|
|
|
9
10
|
actualPortalRef
|
|
10
11
|
} = useContext(DSDialogContext);
|
|
11
12
|
if (isOpen && actualPortalRef.current) {
|
|
12
|
-
return ReactDOM.createPortal(/* @__PURE__ */
|
|
13
|
+
return ReactDOM.createPortal(/* @__PURE__ */ jsx(DSDialogContent, {}), actualPortalRef.current);
|
|
13
14
|
}
|
|
14
15
|
return null;
|
|
15
16
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DSDialogPortal.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport ReactDOM from 'react-dom';\nimport { DSDialogContext } from '../DSDialogCTX';\nimport { DSDialogContent } from './dialogContent/DSDialogContent';\n\nexport const DSDialogPortal = (): JSX.Element | null => {\n const {\n props: { isOpen },\n actualPortalRef,\n } = useContext(DSDialogContext);\n\n if (isOpen && actualPortalRef.current) {\n return ReactDOM.createPortal(<DSDialogContent />, actualPortalRef.current);\n }\n\n return null;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,kBAAkB;AAClC,OAAO,cAAc;AACrB,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,SAAS,aAAa,oBAAC,mBAAgB,GAAI,gBAAgB,OAAO;AAAA,EAC3E;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useContext } from "react";
|
|
3
4
|
import { useGetGlobalAttributes } from "@elliemae/ds-utilities";
|
|
4
5
|
import { PortalStyles, StyledDialogBackground, StyledDialogContainer } from "../../styles";
|
|
5
6
|
import { getSpaceProps } from "../../utils";
|
|
@@ -24,27 +25,32 @@ const DSDialogContent = () => {
|
|
|
24
25
|
},
|
|
25
26
|
[containerRef, removeAutoFocus]
|
|
26
27
|
);
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ jsxs(StyledDialogBackground, {
|
|
28
29
|
className,
|
|
29
30
|
onClick: handleOutsideClick,
|
|
30
31
|
"data-portalbg": true,
|
|
31
32
|
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
32
|
-
zIndex
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
zIndex,
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx(PortalStyles, {
|
|
36
|
+
portalInfo,
|
|
37
|
+
portalClassName
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(StyledDialogContainer, {
|
|
40
|
+
role: "dialog",
|
|
41
|
+
"aria-modal": true,
|
|
42
|
+
ref: refCallback,
|
|
43
|
+
tabIndex: !removeAutoFocus ? 0 : void 0,
|
|
44
|
+
onKeyDown: handleOnKeyDown,
|
|
45
|
+
...getSpaceProps(rest),
|
|
46
|
+
centered,
|
|
47
|
+
"data-testid": DSDialogDatatestid.CONTAINER,
|
|
48
|
+
...restOfGlobalAttributes,
|
|
49
|
+
size,
|
|
50
|
+
children
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
48
54
|
};
|
|
49
55
|
export {
|
|
50
56
|
DSDialogContent
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/dialogContent/DSDialogContent.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useContext } from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-utilities';\nimport { PortalStyles, StyledDialogBackground, StyledDialogContainer } from '../../styles';\nimport { getSpaceProps } from '../../utils';\nimport { DSDialogDatatestid } from '../../DSDialogDatatestid';\nimport { DSDialogContext } from '../../DSDialogCTX';\nimport { useDialogContent } from './useDialogContent';\n\nexport const DSDialogContent = () => {\n const { handleOutsideClick, handleOnKeyDown } = useDialogContent();\n const { props, containerRef, portalInfo, portalClassName } = useContext(DSDialogContext);\n\n const { removeAutoFocus, zIndex, centered, size, children, ...rest } = props;\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(props, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n const refCallback = useCallback(\n (_ref: HTMLDivElement | null) => {\n if (_ref) {\n containerRef.current = _ref;\n if (!removeAutoFocus) _ref.focus();\n }\n },\n [containerRef, removeAutoFocus],\n );\n\n return (\n <StyledDialogBackground\n className={className}\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <PortalStyles portalInfo={portalInfo} portalClassName={portalClassName} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={refCallback}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest as unknown as Record<string, unknown>)}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\n size={size}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>\n );\n};\n"],
|
|
5
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
6
|
"files": [
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"indent": 4
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@elliemae/ds-button": "3.5.
|
|
71
|
-
"@elliemae/ds-icons": "3.5.
|
|
72
|
-
"@elliemae/ds-system": "3.5.
|
|
73
|
-
"@elliemae/ds-utilities": "3.5.
|
|
70
|
+
"@elliemae/ds-button": "3.5.1-next.0",
|
|
71
|
+
"@elliemae/ds-icons": "3.5.1-next.0",
|
|
72
|
+
"@elliemae/ds-system": "3.5.1-next.0",
|
|
73
|
+
"@elliemae/ds-utilities": "3.5.1-next.0",
|
|
74
74
|
"@xstyled/styled-components": "~3.6.0",
|
|
75
75
|
"lodash": "~4.17.21",
|
|
76
76
|
"uid": "~2.0.0"
|