@elliemae/ds-dialog 3.0.0-next.9 → 3.0.0-rc.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 +19 -133
- package/dist/cjs/DSDialog.js.map +2 -2
- package/dist/cjs/DSDialogCTX.js +30 -0
- package/dist/cjs/DSDialogCTX.js.map +7 -0
- package/dist/cjs/DSDialogDatatestid.js +9 -16
- package/dist/cjs/DSDialogDatatestid.js.map +1 -1
- package/dist/cjs/config/useDialog.js +110 -0
- package/dist/cjs/config/useDialog.js.map +7 -0
- package/dist/cjs/defaultProps.js +12 -17
- package/dist/cjs/defaultProps.js.map +2 -2
- package/dist/cjs/index.js +31 -37
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/DSDialogPortal.js +42 -0
- package/dist/cjs/parts/DSDialogPortal.js.map +7 -0
- package/dist/cjs/parts/dialogContent/DSDialogContent.js +93 -0
- package/dist/cjs/parts/dialogContent/DSDialogContent.js.map +7 -0
- package/dist/cjs/parts/dialogContent/useDialogContent.js +62 -0
- package/dist/cjs/parts/dialogContent/useDialogContent.js.map +7 -0
- package/dist/cjs/propTypes.js +18 -25
- package/dist/cjs/propTypes.js.map +2 -2
- package/dist/cjs/sharedTypes.js +9 -16
- package/dist/cjs/sharedTypes.js.map +2 -2
- package/dist/cjs/styles.js +14 -21
- package/dist/cjs/styles.js.map +2 -2
- package/dist/cjs/utils.js +13 -16
- package/dist/cjs/utils.js.map +2 -2
- package/dist/esm/DSDialog.js +10 -124
- package/dist/esm/DSDialog.js.map +2 -2
- package/dist/esm/DSDialogCTX.js +8 -0
- package/dist/esm/DSDialogCTX.js.map +7 -0
- package/dist/esm/DSDialogDatatestid.js.map +1 -1
- package/dist/esm/config/useDialog.js +90 -0
- package/dist/esm/config/useDialog.js.map +7 -0
- package/dist/esm/defaultProps.js +3 -1
- package/dist/esm/defaultProps.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/DSDialogPortal.js +20 -0
- package/dist/esm/parts/DSDialogPortal.js.map +7 -0
- package/dist/esm/parts/dialogContent/DSDialogContent.js +73 -0
- package/dist/esm/parts/dialogContent/DSDialogContent.js.map +7 -0
- package/dist/esm/parts/dialogContent/useDialogContent.js +40 -0
- package/dist/esm/parts/dialogContent/useDialogContent.js.map +7 -0
- package/dist/esm/propTypes.js +1 -1
- package/dist/esm/propTypes.js.map +2 -2
- package/dist/esm/styles.js +5 -5
- package/dist/esm/styles.js.map +2 -2
- package/dist/esm/utils.js +4 -0
- package/dist/esm/utils.js.map +2 -2
- package/package.json +12 -12
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var DSDialogPortal_exports = {};
|
|
22
|
+
__export(DSDialogPortal_exports, {
|
|
23
|
+
DSDialogPortal: () => DSDialogPortal
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(DSDialogPortal_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_react = __toESM(require("react"));
|
|
28
|
+
var import_react_dom = __toESM(require("react-dom"));
|
|
29
|
+
var import_react2 = require("react");
|
|
30
|
+
var import_DSDialogCTX = require("../DSDialogCTX");
|
|
31
|
+
var import_DSDialogContent = require("./dialogContent/DSDialogContent");
|
|
32
|
+
const DSDialogPortal = () => {
|
|
33
|
+
const {
|
|
34
|
+
props: { isOpen },
|
|
35
|
+
actualPortalRef
|
|
36
|
+
} = (0, import_react2.useContext)(import_DSDialogCTX.DSDialogContext);
|
|
37
|
+
if (isOpen && actualPortalRef.current) {
|
|
38
|
+
return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_DSDialogContent.DSDialogContent, null), actualPortalRef.current);
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=DSDialogPortal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/parts/DSDialogPortal.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { useContext } from 'react';\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,mBAAkB;AAClB,uBAAqB;AACrB,oBAA2B;AAC3B,yBAAgC;AAChC,6BAAgC;AAEzB,MAAM,iBAAiB,MAA0B;AACtD,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT;AAAA,MACE,8BAAW,kCAAe;AAE9B,MAAI,UAAU,gBAAgB,SAAS;AACrC,WAAO,yBAAS,aAAa,mDAAC,4CAAgB,GAAI,gBAAgB,OAAO;AAAA,EAC3E;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
|
+
var DSDialogContent_exports = {};
|
|
51
|
+
__export(DSDialogContent_exports, {
|
|
52
|
+
DSDialogContent: () => DSDialogContent
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(DSDialogContent_exports);
|
|
55
|
+
var React = __toESM(require("react"));
|
|
56
|
+
var import_react = __toESM(require("react"));
|
|
57
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
58
|
+
var import_styles = require("../../styles");
|
|
59
|
+
var import_utils = require("../../utils");
|
|
60
|
+
var import_DSDialogDatatestid = require("../../DSDialogDatatestid");
|
|
61
|
+
var import_DSDialogCTX = require("../../DSDialogCTX");
|
|
62
|
+
var import_useDialogContent = require("./useDialogContent");
|
|
63
|
+
const DSDialogContent = () => {
|
|
64
|
+
const { handleOutsideClick, handleOnKeyDown } = (0, import_useDialogContent.useDialogContent)();
|
|
65
|
+
const { props, containerRef, portalInfo, portalClassName } = (0, import_react.useContext)(import_DSDialogCTX.DSDialogContext);
|
|
66
|
+
const _a = props, { removeAutoFocus, zIndex, centered, size, children } = _a, rest = __objRest(_a, ["removeAutoFocus", "zIndex", "centered", "size", "children"]);
|
|
67
|
+
const _b = (0, import_ds_utilities.useGetGlobalAttributes)(props, {
|
|
68
|
+
onClick: handleOutsideClick,
|
|
69
|
+
onKeyDown: handleOnKeyDown
|
|
70
|
+
}), { className } = _b, restOfGlobalAttributes = __objRest(_b, ["className"]);
|
|
71
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogBackground, {
|
|
72
|
+
className,
|
|
73
|
+
onClick: handleOutsideClick,
|
|
74
|
+
"data-portalbg": true,
|
|
75
|
+
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
76
|
+
zIndex
|
|
77
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styles.PortalStyles, {
|
|
78
|
+
portalInfo,
|
|
79
|
+
portalClassName
|
|
80
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, __spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
81
|
+
role: "dialog",
|
|
82
|
+
"aria-modal": true,
|
|
83
|
+
ref: containerRef,
|
|
84
|
+
tabIndex: !removeAutoFocus ? 0 : void 0,
|
|
85
|
+
onKeyDown: handleOnKeyDown
|
|
86
|
+
}, (0, import_utils.getSpaceProps)(rest)), {
|
|
87
|
+
centered,
|
|
88
|
+
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER
|
|
89
|
+
}), restOfGlobalAttributes), {
|
|
90
|
+
size
|
|
91
|
+
}), children));
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=DSDialogContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/dialogContent/DSDialogContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { 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 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={containerRef}\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,mBAAkC;AAClC,0BAAuC;AACvC,oBAA4E;AAC5E,mBAA8B;AAC9B,gCAAmC;AACnC,yBAAgC;AAChC,8BAAiC;AAE1B,MAAM,kBAAkB,MAAM;AACnC,QAAM,EAAE,oBAAoB,oBAAoB,8CAAiB;AACjE,QAAM,EAAE,OAAO,cAAc,YAAY,oBAAoB,6BAAW,kCAAe;AAEvF,QAAuE,YAA/D,mBAAiB,QAAQ,UAAU,MAAM,aAAsB,IAAT,iBAAS,IAAT,CAAtD,mBAAiB,UAAQ,YAAU,QAAM;AAEjD,QAAiD,qDAAuB,OAAO;AAAA,IAC7E,SAAS;AAAA,IACT,WAAW;AAAA,EACb,CAAC,GAHO,gBAAyC,IAA3B,mCAA2B,IAA3B,CAAd;AAKR,SACE,mDAAC;AAAA,IACC;AAAA,IACA,SAAS;AAAA,IACT,iBAAa;AAAA,IACb,eAAa,6CAAmB;AAAA,IAChC;AAAA,KAEA,mDAAC;AAAA,IAAa;AAAA,IAAwB;AAAA,GAAkC,GACxE,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,cAAU;AAAA,IACV,KAAK;AAAA,IACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,IACjC,WAAW;AAAA,KACP,gCAAc,IAA0C,IAN7D;AAAA,IAOC;AAAA,IACA,eAAa,6CAAmB;AAAA,MAC5B,yBATL;AAAA,IAUC;AAAA,MAEC,QACH,CACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var useDialogContent_exports = {};
|
|
22
|
+
__export(useDialogContent_exports, {
|
|
23
|
+
useDialogContent: () => useDialogContent
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(useDialogContent_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_react = require("react");
|
|
28
|
+
var import_DSDialogCTX = require("../../DSDialogCTX");
|
|
29
|
+
const useDialogContent = () => {
|
|
30
|
+
const {
|
|
31
|
+
props: { onClickOutside, onClose, removeAutoFocus },
|
|
32
|
+
containerRef
|
|
33
|
+
} = (0, import_react.useContext)(import_DSDialogCTX.DSDialogContext);
|
|
34
|
+
const handleOutsideClick = (0, import_react.useCallback)((e) => {
|
|
35
|
+
if (e.target.dataset.portalbg)
|
|
36
|
+
onClickOutside();
|
|
37
|
+
}, [onClickOutside]);
|
|
38
|
+
const handleOnKeyDown = (0, import_react.useCallback)((e) => {
|
|
39
|
+
if (e.key === "Escape")
|
|
40
|
+
onClose();
|
|
41
|
+
}, [onClose]);
|
|
42
|
+
(0, import_react.useEffect)(() => {
|
|
43
|
+
if (!removeAutoFocus)
|
|
44
|
+
containerRef?.current?.focus();
|
|
45
|
+
}, [containerRef, removeAutoFocus]);
|
|
46
|
+
const focusContainer = (0, import_react.useCallback)(() => {
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
const isContainerOrChildFocused = containerRef.current?.contains(document.activeElement);
|
|
49
|
+
if (!isContainerOrChildFocused)
|
|
50
|
+
containerRef.current?.focus?.();
|
|
51
|
+
});
|
|
52
|
+
}, [containerRef]);
|
|
53
|
+
(0, import_react.useEffect)(() => {
|
|
54
|
+
document.addEventListener("focusin", focusContainer);
|
|
55
|
+
return () => document.removeEventListener("focusin", focusContainer);
|
|
56
|
+
}, [focusContainer]);
|
|
57
|
+
return {
|
|
58
|
+
handleOutsideClick,
|
|
59
|
+
handleOnKeyDown
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=useDialogContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/dialogContent/useDialogContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useEffect, useContext } from 'react';\nimport { DSDialogContext } from '../../DSDialogCTX';\n\nexport const useDialogContent = () => {\n const {\n props: { onClickOutside, onClose, removeAutoFocus },\n containerRef,\n } = useContext(DSDialogContext);\n\n const handleOutsideClick = useCallback(\n (e: React.MouseEvent) => {\n if ((e.target as HTMLDivElement).dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n },\n [onClose],\n );\n\n useEffect(() => {\n if (!removeAutoFocus) containerRef?.current?.focus();\n }, [containerRef, removeAutoFocus]);\n\n const focusContainer = useCallback(() => {\n setTimeout(() => {\n const isContainerOrChildFocused = containerRef.current?.contains(document.activeElement);\n if (!isContainerOrChildFocused) containerRef.current?.focus?.();\n });\n }, [containerRef]);\n\n useEffect(() => {\n document.addEventListener('focusin', focusContainer);\n return () => document.removeEventListener('focusin', focusContainer);\n }, [focusContainer]);\n\n return {\n handleOutsideClick,\n handleOnKeyDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA0D;AAC1D,yBAAgC;AAEzB,MAAM,mBAAmB,MAAM;AACpC,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,SAAS;AAAA,IAClC;AAAA,MACE,6BAAW,kCAAe;AAE9B,QAAM,qBAAqB,8BACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU,qBAAe;AAAA,EACpE,GACA,CAAC,cAAc,CACjB;AAEA,QAAM,kBAAkB,8BACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU,cAAQ;AAAA,EAClC,GACA,CAAC,OAAO,CACV;AAEA,8BAAU,MAAM;AACd,QAAI,CAAC;AAAiB,oBAAc,SAAS,MAAM;AAAA,EACrD,GAAG,CAAC,cAAc,eAAe,CAAC;AAElC,QAAM,iBAAiB,8BAAY,MAAM;AACvC,eAAW,MAAM;AACf,YAAM,4BAA4B,aAAa,SAAS,SAAS,SAAS,aAAa;AACvF,UAAI,CAAC;AAA2B,qBAAa,SAAS,QAAQ;AAAA,IAChE,CAAC;AAAA,EACH,GAAG,CAAC,YAAY,CAAC;AAEjB,8BAAU,MAAM;AACd,aAAS,iBAAiB,WAAW,cAAc;AACnD,WAAO,MAAM,SAAS,oBAAoB,WAAW,cAAc;AAAA,EACrE,GAAG,CAAC,cAAc,CAAC;AAEnB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/propTypes.js
CHANGED
|
@@ -21,44 +21,37 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var propTypes_exports = {};
|
|
46
39
|
__export(propTypes_exports, {
|
|
47
40
|
propTypes: () => propTypes
|
|
48
41
|
});
|
|
42
|
+
module.exports = __toCommonJS(propTypes_exports);
|
|
49
43
|
var React = __toESM(require("react"));
|
|
50
|
-
var
|
|
44
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
51
45
|
var import_utils = require("./utils");
|
|
52
|
-
const propTypes = __spreadProps(__spreadValues({},
|
|
53
|
-
isOpen:
|
|
54
|
-
children:
|
|
55
|
-
centered:
|
|
56
|
-
removeAutoFocus:
|
|
57
|
-
onClickOutside:
|
|
46
|
+
const propTypes = __spreadProps(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), {
|
|
47
|
+
isOpen: import_ds_utilities.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
48
|
+
children: import_ds_utilities.PropTypes.node.description("Nested components.").isRequired,
|
|
49
|
+
centered: import_ds_utilities.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
50
|
+
removeAutoFocus: import_ds_utilities.PropTypes.bool.description("Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.").defaultValue(false),
|
|
51
|
+
onClickOutside: import_ds_utilities.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
|
|
58
52
|
}),
|
|
59
|
-
onClose:
|
|
53
|
+
onClose: import_ds_utilities.PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
|
|
60
54
|
}),
|
|
61
|
-
size:
|
|
55
|
+
size: import_ds_utilities.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT)
|
|
62
56
|
});
|
|
63
|
-
module.exports = __toCommonJS(propTypes_exports);
|
|
64
57
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, GlobalAttributesT, PropTypes } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, GlobalAttributesT, PropTypes } from '@elliemae/ds-utilities';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n [key: string]: unknown;\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n zIndex: number;\n onClickOutside: () => void;\n onClose: () => void;\n portalRef: null;\n children: React.ReactNode[] | [];\n }\n\n export interface PropsRequired {\n children: React.ReactNode[] | [];\n }\n\n export interface PropsOptional {\n portalRef: React.MutableRefObject<HTMLElement | null> | null;\n }\n\n export interface InternalProps extends Omit<DefaultProps, 'portalRef'>, PropsRequired, PropsOptional {}\n\n export interface Props\n extends Omit<DefaultProps, 'portalRef'>,\n PropsRequired,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'children'> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAwE;AACxE,mBAAwD;AAkCjD,MAAM,YAAY,iCACpB,gDADoB;AAAA,EAEvB,QAAQ,8BAAU,KAAK,YAAY,oCAAoC,EAAE,aAAa,KAAK;AAAA,EAC3F,UAAU,8BAAU,KAAK,YAAY,oBAAoB,EAAE;AAAA,EAC3D,UAAU,8BAAU,KAAK,YAAY,qBAAqB,EAAE,aAAa,KAAK;AAAA,EAC9E,iBAAiB,8BAAU,KACxB,YACC,uIACF,EACC,aAAa,KAAK;AAAA,EACrB,gBAAgB,8BAAU,KACvB,YAAY,+EAA+E,EAC3F,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,SAAS,8BAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAC7F,MAAM,8BAAU,MAAM,qCAAwB,EAC3C,YAAY,sBAAsB,EAClC,aAAa,2BAAc,OAAO;AACvC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/sharedTypes.js
CHANGED
|
@@ -4,24 +4,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var __toESM = (
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
17
|
var sharedTypes_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
18
|
module.exports = __toCommonJS(sharedTypes_exports);
|
|
19
|
+
var React = __toESM(require("react"));
|
|
27
20
|
//# sourceMappingURL=sharedTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sharedTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { DSDialogT } from './propTypes';\nexport namespace DSDialogInternalsT {\n export interface PortalInfo {\n scrollbarWidth: string;\n paddingRight: string;\n }\n\n export interface DSDialogContext {\n props: DSDialogT.InternalProps;\n actualPortalRef: React.MutableRefObject<HTMLElement | null>;\n containerRef: React.MutableRefObject<HTMLDivElement | null>;\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var styles_exports = {};
|
|
29
22
|
__export(styles_exports, {
|
|
30
23
|
DSDialogAddon: () => DSDialogAddon,
|
|
@@ -36,23 +29,24 @@ __export(styles_exports, {
|
|
|
36
29
|
DSDialogSecondaryMessage: () => DSDialogSecondaryMessage,
|
|
37
30
|
DSDialogSeparator: () => DSDialogSeparator,
|
|
38
31
|
DSDialogTitle: () => DSDialogTitle,
|
|
39
|
-
|
|
32
|
+
PortalStyles: () => PortalStyles,
|
|
40
33
|
StyledDialogBackground: () => StyledDialogBackground,
|
|
41
34
|
StyledDialogContainer: () => StyledDialogContainer
|
|
42
35
|
});
|
|
36
|
+
module.exports = __toCommonJS(styles_exports);
|
|
43
37
|
var React = __toESM(require("react"));
|
|
44
38
|
var import_styled_components = __toESM(require("styled-components"));
|
|
45
39
|
var import_ds_system = require("@elliemae/ds-system");
|
|
46
40
|
var import_styled_components2 = require("@xstyled/styled-components");
|
|
47
41
|
var import_utils = require("./utils");
|
|
48
|
-
const
|
|
49
|
-
|
|
42
|
+
const PortalStyles = import_ds_system.createGlobalStyle`
|
|
43
|
+
${({ portalClassName }) => `.${portalClassName}`} {
|
|
50
44
|
overflow: hidden;
|
|
51
|
-
${({
|
|
45
|
+
${({ portalInfo }) => portalInfo.scrollbarWidth !== "0px" ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;` : ``}
|
|
52
46
|
}
|
|
53
47
|
`;
|
|
54
48
|
const StyledDialogBackground = import_styled_components.default.div`
|
|
55
|
-
position:
|
|
49
|
+
position: absolute;
|
|
56
50
|
top: 0;
|
|
57
51
|
bottom: 0;
|
|
58
52
|
left: 0;
|
|
@@ -149,5 +143,4 @@ const DSDialogFooter = import_styled_components.default.div`
|
|
|
149
143
|
${import_styled_components2.flexboxes}
|
|
150
144
|
${import_styled_components2.sizing}
|
|
151
145
|
`;
|
|
152
|
-
module.exports = __toCommonJS(styles_exports);
|
|
153
146
|
//# sourceMappingURL=styles.js.map
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\ninterface
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\ninterface PortalStylesT {\n portalInfo: DSDialogInternalsT.PortalInfo;\n portalClassName: string;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n}\n\nexport const PortalStyles = createGlobalStyle<PortalStylesT>`\n ${({ portalClassName }) => `.${portalClassName}`} {\n overflow: hidden;\n ${({ portalInfo }) =>\n portalInfo.scrollbarWidth !== '0px'\n ? `padding-right: calc( ${portalInfo.paddingRight} + ${portalInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex }) => zIndex};\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: auto;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n ${sizing}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n\n ${layout}\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAkBlB,MAAM,eAAe;AAAA,IACxB,CAAC,EAAE,sBAAsB,IAAI;AAAA;AAAA,MAE3B,CAAC,EAAE,iBACH,WAAW,mBAAmB,QAC1B,wBAAwB,WAAW,kBAAkB,WAAW,iCAChE;AAAA;AAAA;AAIH,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAShC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,sBAAS;AAAA;AAAA,8BAEJ,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA,gBAClD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA,IAEhD;AAAA;AAAA;AAAA;AAAA;AAMG,MAAM,gBAAgB,iCAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7C,MAAM,gBAAgB,iCAAO;AAE7B,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA;AAAA,gBAIrB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA,IACA;AAAA;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe,KAAK,EAAE;AAAA;AAAA,0BAEtD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,iCAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,iCAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAKvB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -4,34 +4,30 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var utils_exports = {};
|
|
29
22
|
__export(utils_exports, {
|
|
30
23
|
DSDialogSizes: () => DSDialogSizes,
|
|
31
24
|
DSDialogSizesArrayValues: () => DSDialogSizesArrayValues,
|
|
32
25
|
allSizes: () => allSizes,
|
|
26
|
+
getCurrentRightPadding: () => getCurrentRightPadding,
|
|
27
|
+
getScrollbarWidth: () => getScrollbarWidth,
|
|
33
28
|
getSpaceProps: () => getSpaceProps
|
|
34
29
|
});
|
|
30
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
31
|
var React = __toESM(require("react"));
|
|
36
32
|
const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
|
|
37
33
|
const DSDialogSizes = {
|
|
@@ -51,5 +47,6 @@ const allSizes = {
|
|
|
51
47
|
"x-large": "1042px",
|
|
52
48
|
"xx-large": "1440px"
|
|
53
49
|
};
|
|
54
|
-
|
|
50
|
+
const getScrollbarWidth = (element) => element.tagName === "BODY" ? `${window.innerWidth - element.clientWidth}px` : `${element.offsetWidth - element.clientWidth}px`;
|
|
51
|
+
const getCurrentRightPadding = (element) => window.getComputedStyle(element, null)?.getPropertyValue("padding-right");
|
|
55
52
|
//# sourceMappingURL=utils.js.map
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export const getSpaceProps = (props: Record<string, unknown>) =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n\nexport const DSDialogSizes = {\n DEFAULT: 'default' as const,\n SMALL: 'small' as const,\n MEDIUM: 'medium' as const,\n LARGE: 'large' as const,\n XLARGE: 'x-large' as const,\n XXLARGE: 'xx-large' as const,\n};\n\nexport const DSDialogSizesArrayValues = Object.values(DSDialogSizes);\n\nexport const allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const getScrollbarWidth = (element: HTMLElement) =>\n element.tagName === 'BODY'\n ? `${window.innerWidth - element.clientWidth}px`\n : `${element.offsetWidth - element.clientWidth}px`;\n\nexport const getCurrentRightPadding = (element: HTMLElement) =>\n window.getComputedStyle(element, null)?.getPropertyValue('padding-right');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,gBAAgB,CAAC,UAC5B,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS,kBAAkB,KAAK,GAAG,CAAC,CAAC;AAElF,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,MAAM,2BAA2B,OAAO,OAAO,aAAa;AAE5D,MAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AACd;AAEO,MAAM,oBAAoB,CAAC,YAChC,QAAQ,YAAY,SAChB,GAAG,OAAO,aAAa,QAAQ,kBAC/B,GAAG,QAAQ,cAAc,QAAQ;AAEhC,MAAM,yBAAyB,CAAC,YACrC,OAAO,iBAAiB,SAAS,IAAI,GAAG,iBAAiB,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|