@elliemae/ds-dialog 2.3.0-alpha.1 → 2.3.0-alpha.6
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/{cjs → dist/cjs}/DSDialog.js +4 -3
- package/dist/cjs/DSDialog.js.map +7 -0
- package/{cjs → dist/cjs}/DSDialogDatatestid.js +0 -0
- package/{cjs → dist/cjs}/DSDialogDatatestid.js.map +0 -0
- package/{cjs → dist/cjs}/DSDialogInternalTypes.js +0 -0
- package/{cjs → dist/cjs}/DSDialogInternalTypes.js.map +1 -1
- package/{cjs → dist/cjs}/DSDialogTypes.js +0 -0
- package/{cjs → dist/cjs}/DSDialogTypes.js.map +0 -0
- package/{cjs → dist/cjs}/defaultProps.js +0 -0
- package/{cjs → dist/cjs}/defaultProps.js.map +0 -0
- package/dist/cjs/index.js +94 -0
- package/dist/cjs/index.js.map +7 -0
- package/{cjs → dist/cjs}/propTypes.js +9 -8
- package/dist/cjs/propTypes.js.map +7 -0
- package/{cjs → dist/cjs}/styles.js +0 -0
- package/dist/cjs/styles.js.map +7 -0
- package/{cjs → dist/cjs}/utils.js +0 -0
- package/{cjs → dist/cjs}/utils.js.map +1 -1
- package/{esm → dist/esm}/DSDialog.js +9 -3
- package/dist/esm/DSDialog.js.map +7 -0
- package/{esm → dist/esm}/DSDialogDatatestid.js +0 -0
- package/{esm → dist/esm}/DSDialogDatatestid.js.map +0 -0
- package/{esm → dist/esm}/DSDialogInternalTypes.js +0 -0
- package/{esm → dist/esm}/DSDialogInternalTypes.js.map +0 -0
- package/{esm → dist/esm}/DSDialogTypes.js +0 -0
- package/{esm → dist/esm}/DSDialogTypes.js.map +0 -0
- package/{esm → dist/esm}/defaultProps.js +0 -0
- package/{esm → dist/esm}/defaultProps.js.map +0 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/index.js.map +7 -0
- package/{esm → dist/esm}/propTypes.js +5 -4
- package/dist/esm/propTypes.js.map +7 -0
- package/{esm → dist/esm}/styles.js +0 -0
- package/dist/esm/styles.js.map +7 -0
- package/{esm → dist/esm}/utils.js +0 -0
- package/{esm → dist/esm}/utils.js.map +1 -1
- package/package.json +37 -35
- package/cjs/DSDialog.js.map +0 -7
- package/cjs/index.js +0 -47
- package/cjs/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/esm/DSDialog.js.map +0 -7
- package/esm/index.js +0 -28
- package/esm/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
- package/types/DSDialog.d.ts +0 -30
- package/types/DSDialogDatatestid.d.ts +0 -4
- package/types/DSDialogInternalTypes.d.ts +0 -25
- package/types/DSDialogTypes.d.ts +0 -11
- package/types/defaultProps.d.ts +0 -2
- package/types/index.d.ts +0 -4
- package/types/propTypes.d.ts +0 -19
- package/types/styles.d.ts +0 -15
- package/types/utils.d.ts +0 -19
|
@@ -33,7 +33,6 @@ __export(DSDialog_exports, {
|
|
|
33
33
|
var React = __toESM(require("react"));
|
|
34
34
|
var import_react_dom = __toESM(require("react-dom"));
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_react_desc = require("react-desc");
|
|
37
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
37
|
var import_styles = require("./styles");
|
|
39
38
|
var import_propTypes = require("./propTypes");
|
|
@@ -69,12 +68,14 @@ const DSDialog = (props) => {
|
|
|
69
68
|
if (isOpen && !removeAutoFocus)
|
|
70
69
|
containerRef?.current?.focus();
|
|
71
70
|
}, [isOpen, removeAutoFocus]);
|
|
71
|
+
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault, { onClick: handleOutsideClick });
|
|
72
72
|
if (isOpen) {
|
|
73
73
|
return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogBackground, {
|
|
74
74
|
onClick: handleOutsideClick,
|
|
75
75
|
"data-portalbg": true,
|
|
76
76
|
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
77
|
-
zIndex
|
|
77
|
+
zIndex,
|
|
78
|
+
...globalAttributes
|
|
78
79
|
}, /* @__PURE__ */ import_react.default.createElement(import_styles.FixedBody, {
|
|
79
80
|
bodyInfo
|
|
80
81
|
}), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, {
|
|
@@ -92,7 +93,7 @@ const DSDialog = (props) => {
|
|
|
92
93
|
return null;
|
|
93
94
|
};
|
|
94
95
|
DSDialog.propTypes = import_propTypes.propTypes;
|
|
95
|
-
const DSDialogWithSchema = (0,
|
|
96
|
+
const DSDialogWithSchema = (0, import_ds_props_helpers.describe)(DSDialog);
|
|
96
97
|
DSDialogWithSchema.propTypes = import_propTypes.propTypes;
|
|
97
98
|
module.exports = __toCommonJS(DSDialog_exports);
|
|
98
99
|
//# sourceMappingURL=DSDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSDialog.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog: React.ComponentType<DSDialogPropsT> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\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') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n {...globalAttributes}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqB;AACrB,mBAAgE;AAChE,8BAKO;AACP,oBAAyE;AACzE,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAA8B;AAC9B,gCAAmC;AAInC,MAAM,WAAgD,CAAC,UAAU;AAC/D,QAAM,mBAAmB,0DAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,2BAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,8DAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,yBAA8B;AAEnD,QAAM,qBAAqB,8BACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,8BACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,8BAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,8BAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,QAAM,mBAAmB,oDAAuB,kBAAkB,EAAE,SAAS;AAE7E,MAAI,QAAQ;AACV,WAAO,yBAAS,aACd,mDAAC,sCAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,6CAAmB;AAAA,MAChC;AAAA,SACI;AAAA,OAEJ,mDAAC,yBAAD;AAAA,MAAW;AAAA,QACX,mDAAC,qCAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,gCAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,6CAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,sCAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSDialogInternalTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DSDialogPropsT, Sizes } from './DSDialogTypes';\n\nexport interface BodyInfoT {\n overflow: boolean;\n padding: string;\n}\n\nexport interface DSDialogDefaultPropsT {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n zIndex: number;\n}\n\nexport interface StyledDialogContainerPropsT {\n size: Sizes;\n centered: boolean;\n}\n\nexport interface
|
|
4
|
+
"sourcesContent": ["import type { DSDialogPropsT, Sizes } from './DSDialogTypes';\n\nexport interface BodyInfoT {\n overflow: boolean;\n padding: string;\n}\n\nexport interface DSDialogDefaultPropsT {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n zIndex: number;\n}\n\nexport interface StyledDialogContainerPropsT {\n size: Sizes;\n centered: boolean;\n}\n\nexport interface StyledDialogBackgroundT {\n zIndex: number;\n}\n\nexport interface FixedBodyT {\n isBodyOverflow: boolean;\n}\n\nexport type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;\n\nexport type GetSpaceArgsT = Partial<Record<string, string | number>>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
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);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
DSDialogAddon: () => import_styles.DSDialogAddon,
|
|
31
|
+
DSDialogAddonWithSchema: () => DSDialogAddonWithSchema,
|
|
32
|
+
DSDialogBody: () => import_styles.DSDialogBody,
|
|
33
|
+
DSDialogBodyWithSchema: () => DSDialogBodyWithSchema,
|
|
34
|
+
DSDialogDefaultLayout: () => import_styles.DSDialogDefaultLayout,
|
|
35
|
+
DSDialogDefaultLayoutWithSchema: () => DSDialogDefaultLayoutWithSchema,
|
|
36
|
+
DSDialogFooter: () => import_styles.DSDialogFooter,
|
|
37
|
+
DSDialogFooterWithSchema: () => DSDialogFooterWithSchema,
|
|
38
|
+
DSDialogHeader: () => import_styles.DSDialogHeader,
|
|
39
|
+
DSDialogHeaderWithSchema: () => DSDialogHeaderWithSchema,
|
|
40
|
+
DSDialogPrimaryMessage: () => import_styles.DSDialogPrimaryMessage,
|
|
41
|
+
DSDialogPrimaryMessageWithSchema: () => DSDialogPrimaryMessageWithSchema,
|
|
42
|
+
DSDialogSecondaryMessage: () => import_styles.DSDialogSecondaryMessage,
|
|
43
|
+
DSDialogSecondaryMessageWithSchema: () => DSDialogSecondaryMessageWithSchema,
|
|
44
|
+
DSDialogSeparator: () => import_styles.DSDialogSeparator,
|
|
45
|
+
DSDialogSeparatorWithSchema: () => DSDialogSeparatorWithSchema,
|
|
46
|
+
DSDialogSizes: () => import_utils.DSDialogSizes,
|
|
47
|
+
DSDialogTitle: () => import_styles.DSDialogTitle,
|
|
48
|
+
DSDialogTitleWithSchema: () => DSDialogTitleWithSchema
|
|
49
|
+
});
|
|
50
|
+
var React = __toESM(require("react"));
|
|
51
|
+
var import_react_desc = require("react-desc");
|
|
52
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
53
|
+
var import_styles = require("./styles");
|
|
54
|
+
__reExport(src_exports, require("./DSDialog"));
|
|
55
|
+
__reExport(src_exports, require("./DSDialogDatatestid"));
|
|
56
|
+
var import_utils = require("./utils");
|
|
57
|
+
import_styles.DSDialogBody.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
58
|
+
import_styles.DSDialogHeader.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
59
|
+
import_styles.DSDialogFooter.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
60
|
+
import_styles.DSDialogSeparator.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
61
|
+
import_styles.DSDialogTitle.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
62
|
+
import_styles.DSDialogAddon.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
63
|
+
import_styles.DSDialogDefaultLayout.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
64
|
+
import_styles.DSDialogPrimaryMessage.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
65
|
+
import_styles.DSDialogSecondaryMessage.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
66
|
+
import_styles.DSDialogBody.displayName = "DSDialogBody";
|
|
67
|
+
import_styles.DSDialogHeader.displayName = "DSDialogHeader";
|
|
68
|
+
import_styles.DSDialogFooter.displayName = "DSDialogFooter";
|
|
69
|
+
import_styles.DSDialogSeparator.displayName = "DSDialogSeparator";
|
|
70
|
+
import_styles.DSDialogTitle.displayName = "DSDialogTitle";
|
|
71
|
+
import_styles.DSDialogAddon.displayName = "DSDialogAddon";
|
|
72
|
+
import_styles.DSDialogDefaultLayout.displayName = "DSDialogDefaultLayout";
|
|
73
|
+
import_styles.DSDialogPrimaryMessage.displayName = "DSDialogPrimaryMessage";
|
|
74
|
+
import_styles.DSDialogSecondaryMessage.displayName = "DSDialogSecondaryMessage";
|
|
75
|
+
const DSDialogBodyWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogBody);
|
|
76
|
+
const DSDialogHeaderWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogHeader);
|
|
77
|
+
const DSDialogFooterWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogFooter);
|
|
78
|
+
const DSDialogSeparatorWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogSeparator);
|
|
79
|
+
const DSDialogTitleWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogTitle);
|
|
80
|
+
const DSDialogAddonWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogAddon);
|
|
81
|
+
const DSDialogDefaultLayoutWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogDefaultLayout);
|
|
82
|
+
const DSDialogPrimaryMessageWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogPrimaryMessage);
|
|
83
|
+
const DSDialogSecondaryMessageWithSchema = (0, import_react_desc.describe)(import_styles.DSDialogSecondaryMessage);
|
|
84
|
+
DSDialogBodyWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
85
|
+
DSDialogHeaderWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
86
|
+
DSDialogFooterWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
87
|
+
DSDialogSeparatorWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
88
|
+
DSDialogTitleWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
89
|
+
DSDialogAddonWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
90
|
+
DSDialogDefaultLayoutWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
91
|
+
DSDialogPrimaryMessageWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
92
|
+
DSDialogSecondaryMessageWithSchema.propTypes = import_ds_props_helpers.globalAttributesPropTypes;
|
|
93
|
+
module.exports = __toCommonJS(src_exports);
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { describe } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\n\nexport * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAyB;AACzB,8BAA0C;AAC1C,oBAUO;AAyCP,wBAAc;AACd,wBAAc;AACd,mBAA8B;AAzC9B,2BAAa,YAAY;AACzB,6BAAe,YAAY;AAC3B,6BAAe,YAAY;AAC3B,gCAAkB,YAAY;AAC9B,4BAAc,YAAY;AAC1B,4BAAc,YAAY;AAC1B,oCAAsB,YAAY;AAClC,qCAAuB,YAAY;AACnC,uCAAyB,YAAY;AACrC,2BAAa,cAAc;AAC3B,6BAAe,cAAc;AAC7B,6BAAe,cAAc;AAC7B,gCAAkB,cAAc;AAChC,4BAAc,cAAc;AAC5B,4BAAc,cAAc;AAC5B,oCAAsB,cAAc;AACpC,qCAAuB,cAAc;AACrC,uCAAyB,cAAc;AAEvC,MAAM,yBAAyB,gCAAS;AACxC,MAAM,2BAA2B,gCAAS;AAC1C,MAAM,2BAA2B,gCAAS;AAC1C,MAAM,8BAA8B,gCAAS;AAC7C,MAAM,0BAA0B,gCAAS;AACzC,MAAM,0BAA0B,gCAAS;AACzC,MAAM,kCAAkC,gCAAS;AACjD,MAAM,mCAAmC,gCAAS;AAClD,MAAM,qCAAqC,gCAAS;AAEpD,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -30,16 +30,17 @@ __export(propTypes_exports, {
|
|
|
30
30
|
propTypes: () => propTypes
|
|
31
31
|
});
|
|
32
32
|
var React = __toESM(require("react"));
|
|
33
|
-
var
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
34
|
var import_utils = require("./utils");
|
|
35
35
|
const propTypes = {
|
|
36
|
-
isOpen:
|
|
37
|
-
children:
|
|
38
|
-
centered:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
isOpen: import_ds_props_helpers.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
37
|
+
children: import_ds_props_helpers.PropTypes.node.description("Nested components.").isRequired,
|
|
38
|
+
centered: import_ds_props_helpers.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
39
|
+
removeAutoFocus: import_ds_props_helpers.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),
|
|
40
|
+
onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.").defaultValue(() => {
|
|
41
|
+
}),
|
|
42
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
43
|
+
size: import_ds_props_helpers.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT)
|
|
43
44
|
};
|
|
44
45
|
module.exports = __toCommonJS(propTypes_exports);
|
|
45
46
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { WeakValidationMap } from 'react';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\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(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n ...globalAttributesPropTypes,\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAqD;AAErD,mBAAwD;AAEjD,MAAM,YAAY;AAAA,EACvB,QAAQ,kCAAU,KAAK,YAAY,sCAAsC,aAAa;AAAA,EACtF,UAAU,kCAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,kCAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,iBAAiB,kCAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,kCAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA,KACnB;AAAA,EACH,MAAM,kCAAU,MAAM,uCACnB,YAAY,wBACZ,aAAa,2BAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 type { StyledDialogContainerT, StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<FixedBodyT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 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<StyledDialogContainerPropsT>`\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 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`;\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;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAGlB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,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;AAQ7C,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;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,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
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n\nexport const DSDialogSizes = {\n DEFAULT: 'default',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n XLARGE: 'x-large',\n XXLARGE: 'xx-large'
|
|
4
|
+
"sourcesContent": ["import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,gBAAgB,CAAC,UAC5B,OAAO,YAAY,OAAO,QAAQ,OAAO,OAAO,CAAC,CAAC,SAAS,kBAAkB,KAAK;AAE7E,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA;AAGJ,MAAM,2BAA2B,OAAO,OAAO;AAE/C,MAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import ReactDOM from "react-dom";
|
|
3
3
|
import React2, { useCallback, useRef, useEffect, useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useValidateTypescriptPropTypes,
|
|
7
|
+
useGetGlobalAttributes,
|
|
8
|
+
describe
|
|
9
|
+
} from "@elliemae/ds-props-helpers";
|
|
6
10
|
import { FixedBody, StyledDialogBackground, StyledDialogContainer } from "./styles";
|
|
7
11
|
import { propTypes } from "./propTypes";
|
|
8
12
|
import { defaultProps } from "./defaultProps";
|
|
@@ -37,12 +41,14 @@ const DSDialog = (props) => {
|
|
|
37
41
|
if (isOpen && !removeAutoFocus)
|
|
38
42
|
containerRef?.current?.focus();
|
|
39
43
|
}, [isOpen, removeAutoFocus]);
|
|
44
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });
|
|
40
45
|
if (isOpen) {
|
|
41
46
|
return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(StyledDialogBackground, {
|
|
42
47
|
onClick: handleOutsideClick,
|
|
43
48
|
"data-portalbg": true,
|
|
44
49
|
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
45
|
-
zIndex
|
|
50
|
+
zIndex,
|
|
51
|
+
...globalAttributes
|
|
46
52
|
}, /* @__PURE__ */ React2.createElement(FixedBody, {
|
|
47
53
|
bodyInfo
|
|
48
54
|
}), /* @__PURE__ */ React2.createElement(StyledDialogContainer, {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog: React.ComponentType<DSDialogPropsT> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\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') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n {...globalAttributes}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAIA,MAAM,WAAgD,CAAC,UAAU;AAC/D,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,SAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,iCAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,OAA8B;AAEnD,QAAM,qBAAqB,YACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,YACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,YAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,YAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,QAAM,mBAAmB,uBAAuB,kBAAkB,EAAE,SAAS;AAE7E,MAAI,QAAQ;AACV,WAAO,SAAS,aACd,qCAAC,wBAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,mBAAmB;AAAA,MAChC;AAAA,SACI;AAAA,OAEJ,qCAAC,WAAD;AAAA,MAAW;AAAA,QACX,qCAAC,uBAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,cAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,mBAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { describe } from "react-desc";
|
|
3
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import {
|
|
5
|
+
DSDialogBody,
|
|
6
|
+
DSDialogHeader,
|
|
7
|
+
DSDialogFooter,
|
|
8
|
+
DSDialogSeparator,
|
|
9
|
+
DSDialogTitle,
|
|
10
|
+
DSDialogAddon,
|
|
11
|
+
DSDialogDefaultLayout,
|
|
12
|
+
DSDialogPrimaryMessage,
|
|
13
|
+
DSDialogSecondaryMessage
|
|
14
|
+
} from "./styles";
|
|
15
|
+
DSDialogBody.propTypes = globalAttributesPropTypes;
|
|
16
|
+
DSDialogHeader.propTypes = globalAttributesPropTypes;
|
|
17
|
+
DSDialogFooter.propTypes = globalAttributesPropTypes;
|
|
18
|
+
DSDialogSeparator.propTypes = globalAttributesPropTypes;
|
|
19
|
+
DSDialogTitle.propTypes = globalAttributesPropTypes;
|
|
20
|
+
DSDialogAddon.propTypes = globalAttributesPropTypes;
|
|
21
|
+
DSDialogDefaultLayout.propTypes = globalAttributesPropTypes;
|
|
22
|
+
DSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;
|
|
23
|
+
DSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;
|
|
24
|
+
DSDialogBody.displayName = "DSDialogBody";
|
|
25
|
+
DSDialogHeader.displayName = "DSDialogHeader";
|
|
26
|
+
DSDialogFooter.displayName = "DSDialogFooter";
|
|
27
|
+
DSDialogSeparator.displayName = "DSDialogSeparator";
|
|
28
|
+
DSDialogTitle.displayName = "DSDialogTitle";
|
|
29
|
+
DSDialogAddon.displayName = "DSDialogAddon";
|
|
30
|
+
DSDialogDefaultLayout.displayName = "DSDialogDefaultLayout";
|
|
31
|
+
DSDialogPrimaryMessage.displayName = "DSDialogPrimaryMessage";
|
|
32
|
+
DSDialogSecondaryMessage.displayName = "DSDialogSecondaryMessage";
|
|
33
|
+
const DSDialogBodyWithSchema = describe(DSDialogBody);
|
|
34
|
+
const DSDialogHeaderWithSchema = describe(DSDialogHeader);
|
|
35
|
+
const DSDialogFooterWithSchema = describe(DSDialogFooter);
|
|
36
|
+
const DSDialogSeparatorWithSchema = describe(DSDialogSeparator);
|
|
37
|
+
const DSDialogTitleWithSchema = describe(DSDialogTitle);
|
|
38
|
+
const DSDialogAddonWithSchema = describe(DSDialogAddon);
|
|
39
|
+
const DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);
|
|
40
|
+
const DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);
|
|
41
|
+
const DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);
|
|
42
|
+
DSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;
|
|
43
|
+
DSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;
|
|
44
|
+
DSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;
|
|
45
|
+
DSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;
|
|
46
|
+
DSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;
|
|
47
|
+
DSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;
|
|
48
|
+
DSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;
|
|
49
|
+
DSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
50
|
+
DSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
51
|
+
export * from "./DSDialog";
|
|
52
|
+
export * from "./DSDialogDatatestid";
|
|
53
|
+
import { DSDialogSizes } from "./utils";
|
|
54
|
+
export {
|
|
55
|
+
DSDialogAddon,
|
|
56
|
+
DSDialogAddonWithSchema,
|
|
57
|
+
DSDialogBody,
|
|
58
|
+
DSDialogBodyWithSchema,
|
|
59
|
+
DSDialogDefaultLayout,
|
|
60
|
+
DSDialogDefaultLayoutWithSchema,
|
|
61
|
+
DSDialogFooter,
|
|
62
|
+
DSDialogFooterWithSchema,
|
|
63
|
+
DSDialogHeader,
|
|
64
|
+
DSDialogHeaderWithSchema,
|
|
65
|
+
DSDialogPrimaryMessage,
|
|
66
|
+
DSDialogPrimaryMessageWithSchema,
|
|
67
|
+
DSDialogSecondaryMessage,
|
|
68
|
+
DSDialogSecondaryMessageWithSchema,
|
|
69
|
+
DSDialogSeparator,
|
|
70
|
+
DSDialogSeparatorWithSchema,
|
|
71
|
+
DSDialogSizes,
|
|
72
|
+
DSDialogTitle,
|
|
73
|
+
DSDialogTitleWithSchema
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\n\nexport * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,aAAa,YAAY;AACzB,eAAe,YAAY;AAC3B,eAAe,YAAY;AAC3B,kBAAkB,YAAY;AAC9B,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,sBAAsB,YAAY;AAClC,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,aAAa,cAAc;AAC3B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,kBAAkB,cAAc;AAChC,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,sBAAsB,cAAc;AACpC,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AAEvC,MAAM,yBAAyB,SAAS;AACxC,MAAM,2BAA2B,SAAS;AAC1C,MAAM,2BAA2B,SAAS;AAC1C,MAAM,8BAA8B,SAAS;AAC7C,MAAM,0BAA0B,SAAS;AACzC,MAAM,0BAA0B,SAAS;AACzC,MAAM,kCAAkC,SAAS;AACjD,MAAM,mCAAmC,SAAS;AAClD,MAAM,qCAAqC,SAAS;AAEpD,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;AAE/C;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { PropTypes } from "
|
|
2
|
+
import { globalAttributesPropTypes, PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import { DSDialogSizes, DSDialogSizesArrayValues } from "./utils";
|
|
4
4
|
const propTypes = {
|
|
5
|
-
isOpen: PropTypes.bool.description("
|
|
5
|
+
isOpen: PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
6
6
|
children: PropTypes.node.description("Nested components.").isRequired,
|
|
7
7
|
centered: PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
8
|
-
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT),
|
|
9
8
|
removeAutoFocus: 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),
|
|
10
9
|
onClickOutside: PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.").defaultValue(() => {
|
|
11
|
-
})
|
|
10
|
+
}),
|
|
11
|
+
...globalAttributesPropTypes,
|
|
12
|
+
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT)
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
15
|
propTypes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { WeakValidationMap } from 'react';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\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(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n ...globalAttributesPropTypes,\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AAEA;AAEO,MAAM,YAAY;AAAA,EACvB,QAAQ,UAAU,KAAK,YAAY,sCAAsC,aAAa;AAAA,EACtF,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,iBAAiB,UAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA,KACnB;AAAA,EACH,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 type { StyledDialogContainerT, StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<FixedBodyT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 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<StyledDialogContainerPropsT>`\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 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`;\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"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAGO,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,SAAS;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,OAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ7C,MAAM,gBAAgB,OAAO;AAE7B,MAAM,iBAAiB,OAAO;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;AAGG,MAAM,oBAAoB,OAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,OAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,OAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,OAAO;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
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n\nexport const DSDialogSizes = {\n DEFAULT: 'default',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n XLARGE: 'x-large',\n XXLARGE: 'xx-large'
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\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"],
|
|
5
5
|
"mappings": "AAAA;ACEO,MAAM,gBAAgB,CAAC,UAC5B,OAAO,YAAY,OAAO,QAAQ,OAAO,OAAO,CAAC,CAAC,SAAS,kBAAkB,KAAK;AAE7E,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA;AAGJ,MAAM,2BAA2B,OAAO,OAAO;AAE/C,MAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,47 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "2.3.0-alpha.
|
|
3
|
+
"version": "2.3.0-alpha.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./utils": {
|
|
15
|
-
"import": "./esm/utils.js",
|
|
16
|
-
"require": "./cjs/utils.js"
|
|
18
|
+
"import": "./dist/esm/utils.js",
|
|
19
|
+
"require": "./dist/cjs/utils.js"
|
|
17
20
|
},
|
|
18
21
|
"./styles": {
|
|
19
|
-
"import": "./esm/styles.js",
|
|
20
|
-
"require": "./cjs/styles.js"
|
|
22
|
+
"import": "./dist/esm/styles.js",
|
|
23
|
+
"require": "./dist/cjs/styles.js"
|
|
21
24
|
},
|
|
22
25
|
"./propTypes": {
|
|
23
|
-
"import": "./esm/propTypes.js",
|
|
24
|
-
"require": "./cjs/propTypes.js"
|
|
26
|
+
"import": "./dist/esm/propTypes.js",
|
|
27
|
+
"require": "./dist/cjs/propTypes.js"
|
|
25
28
|
},
|
|
26
29
|
"./DSDialogTypes": {
|
|
27
|
-
"import": "./esm/DSDialogTypes.js",
|
|
28
|
-
"require": "./cjs/DSDialogTypes.js"
|
|
30
|
+
"import": "./dist/esm/DSDialogTypes.js",
|
|
31
|
+
"require": "./dist/cjs/DSDialogTypes.js"
|
|
29
32
|
},
|
|
30
33
|
"./DSDialogInternalTypes": {
|
|
31
|
-
"import": "./esm/DSDialogInternalTypes.js",
|
|
32
|
-
"require": "./cjs/DSDialogInternalTypes.js"
|
|
34
|
+
"import": "./dist/esm/DSDialogInternalTypes.js",
|
|
35
|
+
"require": "./dist/cjs/DSDialogInternalTypes.js"
|
|
33
36
|
},
|
|
34
37
|
"./DSDialogDatatestid": {
|
|
35
|
-
"import": "./esm/DSDialogDatatestid.js",
|
|
36
|
-
"require": "./cjs/DSDialogDatatestid.js"
|
|
38
|
+
"import": "./dist/esm/DSDialogDatatestid.js",
|
|
39
|
+
"require": "./dist/cjs/DSDialogDatatestid.js"
|
|
37
40
|
},
|
|
38
41
|
"./DSDialog": {
|
|
39
|
-
"import": "./esm/DSDialog.js",
|
|
40
|
-
"require": "./cjs/DSDialog.js"
|
|
42
|
+
"import": "./dist/esm/DSDialog.js",
|
|
43
|
+
"require": "./dist/cjs/DSDialog.js"
|
|
41
44
|
},
|
|
42
45
|
"./defaultProps": {
|
|
43
|
-
"import": "./esm/defaultProps.js",
|
|
44
|
-
"require": "./cjs/defaultProps.js"
|
|
46
|
+
"import": "./dist/esm/defaultProps.js",
|
|
47
|
+
"require": "./dist/cjs/defaultProps.js"
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"sideEffects": [
|
|
@@ -53,20 +56,14 @@
|
|
|
53
56
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
54
57
|
},
|
|
55
58
|
"engines": {
|
|
56
|
-
"
|
|
57
|
-
"node": ">=
|
|
59
|
+
"pnpm": ">=6",
|
|
60
|
+
"node": ">=16"
|
|
58
61
|
},
|
|
59
62
|
"author": "ICE MT",
|
|
60
|
-
"scripts": {
|
|
61
|
-
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
62
|
-
"prebuild": "exit 0",
|
|
63
|
-
"predev": "exit 0",
|
|
64
|
-
"build": "node ../../scripts/build/build.js"
|
|
65
|
-
},
|
|
66
63
|
"dependencies": {
|
|
67
|
-
"@elliemae/ds-props-helpers": "2.3.0-alpha.
|
|
68
|
-
"@elliemae/ds-system": "2.3.0-alpha.
|
|
69
|
-
"@xstyled/styled-components": "~3.1.
|
|
64
|
+
"@elliemae/ds-props-helpers": "2.3.0-alpha.6",
|
|
65
|
+
"@elliemae/ds-system": "2.3.0-alpha.6",
|
|
66
|
+
"@xstyled/styled-components": "~3.1.2",
|
|
70
67
|
"react-desc": "~4.1.3"
|
|
71
68
|
},
|
|
72
69
|
"devDependencies": {
|
|
@@ -79,7 +76,12 @@
|
|
|
79
76
|
},
|
|
80
77
|
"publishConfig": {
|
|
81
78
|
"access": "public",
|
|
82
|
-
"
|
|
83
|
-
|
|
79
|
+
"typeSafety": false
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
83
|
+
"prebuild": "exit 0",
|
|
84
|
+
"predev": "exit 0",
|
|
85
|
+
"build": "node ../../scripts/build/build.js"
|
|
84
86
|
}
|
|
85
87
|
}
|
package/cjs/DSDialog.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSDialog.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\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') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqB;AACrB,mBAAgE;AAChE,wBAAyB;AACzB,8BAA6E;AAC7E,oBAAyE;AACzE,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAA8B;AAC9B,gCAAmC;AAInC,MAAM,WAAW,CAAC,UAA2C;AAC3D,QAAM,mBAAmB,0DAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,2BAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,8DAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,yBAA8B;AAEnD,QAAM,qBAAqB,8BACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,8BACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,8BAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,8BAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,MAAI,QAAQ;AACV,WAAO,yBAAS,aACd,mDAAC,sCAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,6CAAmB;AAAA,MAChC;AAAA,OAEA,mDAAC,yBAAD;AAAA,MAAW;AAAA,QACX,mDAAC,qCAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,gCAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,6CAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,gCAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
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);
|
|
28
|
-
var src_exports = {};
|
|
29
|
-
__export(src_exports, {
|
|
30
|
-
DSDialogAddon: () => import_styles.DSDialogAddon,
|
|
31
|
-
DSDialogBody: () => import_styles.DSDialogBody,
|
|
32
|
-
DSDialogDefaultLayout: () => import_styles.DSDialogDefaultLayout,
|
|
33
|
-
DSDialogFooter: () => import_styles.DSDialogFooter,
|
|
34
|
-
DSDialogHeader: () => import_styles.DSDialogHeader,
|
|
35
|
-
DSDialogPrimaryMessage: () => import_styles.DSDialogPrimaryMessage,
|
|
36
|
-
DSDialogSecondaryMessage: () => import_styles.DSDialogSecondaryMessage,
|
|
37
|
-
DSDialogSeparator: () => import_styles.DSDialogSeparator,
|
|
38
|
-
DSDialogSizes: () => import_utils.DSDialogSizes,
|
|
39
|
-
DSDialogTitle: () => import_styles.DSDialogTitle
|
|
40
|
-
});
|
|
41
|
-
var React = __toESM(require("react"));
|
|
42
|
-
__reExport(src_exports, require("./DSDialog"));
|
|
43
|
-
__reExport(src_exports, require("./DSDialogDatatestid"));
|
|
44
|
-
var import_utils = require("./utils");
|
|
45
|
-
var import_styles = require("./styles");
|
|
46
|
-
module.exports = __toCommonJS(src_exports);
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\n\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,mBAA8B;AAE9B,oBAUO;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/propTypes.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether 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 size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\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(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,wBAA0B;AAC1B,mBAAwD;AAEjD,MAAM,YAAY;AAAA,EACvB,QAAQ,4BAAU,KAAK,YAAY,qCAAqC,aAAa;AAAA,EACrF,UAAU,4BAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,4BAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,MAAM,4BAAU,MAAM,uCACnB,YAAY,wBACZ,aAAa,2BAAc;AAAA,EAC9B,iBAAiB,4BAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,4BAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/styles.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 type {\n StyledDialogContainerPropsT,\n StyledDialogFixedBodyPropsT,\n StyledDialogBackgroundPropsT,\n} from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<StyledDialogFixedBodyPropsT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundPropsT>`\n position: fixed;\n top: 0;\n bottom: 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<StyledDialogContainerPropsT>`\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 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`;\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;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAOlB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,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;AAQ7C,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;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,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
|
-
"names": []
|
|
7
|
-
}
|
package/esm/DSDialog.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\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') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,MAAM,WAAW,CAAC,UAA2C;AAC3D,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,SAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,iCAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,OAA8B;AAEnD,QAAM,qBAAqB,YACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,YACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,YAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,YAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,MAAI,QAAQ;AACV,WAAO,SAAS,aACd,qCAAC,wBAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,mBAAmB;AAAA,MAChC;AAAA,OAEA,qCAAC,WAAD;AAAA,MAAW;AAAA,QACX,qCAAC,uBAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,cAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,mBAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/esm/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export * from "./DSDialog";
|
|
3
|
-
export * from "./DSDialogDatatestid";
|
|
4
|
-
import { DSDialogSizes } from "./utils";
|
|
5
|
-
import {
|
|
6
|
-
DSDialogBody,
|
|
7
|
-
DSDialogHeader,
|
|
8
|
-
DSDialogFooter,
|
|
9
|
-
DSDialogSeparator,
|
|
10
|
-
DSDialogTitle,
|
|
11
|
-
DSDialogAddon,
|
|
12
|
-
DSDialogDefaultLayout,
|
|
13
|
-
DSDialogPrimaryMessage,
|
|
14
|
-
DSDialogSecondaryMessage
|
|
15
|
-
} from "./styles";
|
|
16
|
-
export {
|
|
17
|
-
DSDialogAddon,
|
|
18
|
-
DSDialogBody,
|
|
19
|
-
DSDialogDefaultLayout,
|
|
20
|
-
DSDialogFooter,
|
|
21
|
-
DSDialogHeader,
|
|
22
|
-
DSDialogPrimaryMessage,
|
|
23
|
-
DSDialogSecondaryMessage,
|
|
24
|
-
DSDialogSeparator,
|
|
25
|
-
DSDialogSizes,
|
|
26
|
-
DSDialogTitle
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\n\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/esm/propTypes.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether 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 size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\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(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AAEO,MAAM,YAAY;AAAA,EACvB,QAAQ,UAAU,KAAK,YAAY,qCAAqC,aAAa;AAAA,EACrF,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA,EAC9B,iBAAiB,UAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/esm/styles.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 type {\n StyledDialogContainerPropsT,\n StyledDialogFixedBodyPropsT,\n StyledDialogBackgroundPropsT,\n} from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<StyledDialogFixedBodyPropsT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundPropsT>`\n position: fixed;\n top: 0;\n bottom: 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<StyledDialogContainerPropsT>`\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 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`;\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"],
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAOO,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,SAAS;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,OAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ7C,MAAM,gBAAgB,OAAO;AAE7B,MAAM,iBAAiB,OAAO;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;AAGG,MAAM,oBAAoB,OAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,OAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,OAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,OAAO;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
|
-
"names": []
|
|
7
|
-
}
|
package/types/DSDialog.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { DSDialogPropsT } from './DSDialogTypes';
|
|
4
|
-
declare const DSDialog: {
|
|
5
|
-
(props: DSDialogPropsT): React.ReactNode;
|
|
6
|
-
propTypes: {
|
|
7
|
-
isOpen: {
|
|
8
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
9
|
-
};
|
|
10
|
-
children: import("react-desc").PropTypesDescValue;
|
|
11
|
-
centered: {
|
|
12
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
13
|
-
};
|
|
14
|
-
size: {
|
|
15
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
16
|
-
};
|
|
17
|
-
removeAutoFocus: {
|
|
18
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
-
};
|
|
20
|
-
onClickOutside: {
|
|
21
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
declare const DSDialogWithSchema: {
|
|
26
|
-
(props?: unknown): JSX.Element;
|
|
27
|
-
propTypes: unknown;
|
|
28
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
29
|
-
};
|
|
30
|
-
export { DSDialog, DSDialogWithSchema };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { DSDialogPropsT, Sizes } from './DSDialogTypes';
|
|
2
|
-
export interface BodyInfoT {
|
|
3
|
-
overflow: boolean;
|
|
4
|
-
padding: string;
|
|
5
|
-
}
|
|
6
|
-
export interface DSDialogDefaultPropsT {
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
centered: boolean;
|
|
9
|
-
size: Sizes;
|
|
10
|
-
removeAutoFocus: boolean;
|
|
11
|
-
onClickOutside: () => void;
|
|
12
|
-
zIndex: number;
|
|
13
|
-
}
|
|
14
|
-
export interface StyledDialogContainerPropsT {
|
|
15
|
-
size: Sizes;
|
|
16
|
-
centered: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface StyledDialogFixedBodyPropsT {
|
|
19
|
-
bodyInfo: BodyInfoT;
|
|
20
|
-
}
|
|
21
|
-
export interface StyledDialogBackgroundPropsT {
|
|
22
|
-
zIndex: number;
|
|
23
|
-
}
|
|
24
|
-
export declare type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;
|
|
25
|
-
export declare type GetSpaceArgsT = Partial<Record<string, string | number>>;
|
package/types/DSDialogTypes.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
|
|
3
|
-
export interface DSDialogPropsT {
|
|
4
|
-
isOpen?: boolean;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
onClickOutside?: () => void;
|
|
7
|
-
size?: Sizes;
|
|
8
|
-
centered?: boolean;
|
|
9
|
-
removeAutoFocus?: boolean;
|
|
10
|
-
zIndex?: number;
|
|
11
|
-
}
|
package/types/defaultProps.d.ts
DELETED
package/types/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './DSDialog';
|
|
2
|
-
export * from './DSDialogDatatestid';
|
|
3
|
-
export { DSDialogSizes } from './utils';
|
|
4
|
-
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, } from './styles';
|
package/types/propTypes.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
export declare const propTypes: {
|
|
3
|
-
isOpen: {
|
|
4
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
5
|
-
};
|
|
6
|
-
children: import("react-desc").PropTypesDescValue;
|
|
7
|
-
centered: {
|
|
8
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
9
|
-
};
|
|
10
|
-
size: {
|
|
11
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
12
|
-
};
|
|
13
|
-
removeAutoFocus: {
|
|
14
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
15
|
-
};
|
|
16
|
-
onClickOutside: {
|
|
17
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
18
|
-
};
|
|
19
|
-
};
|
package/types/styles.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { StyledDialogContainerPropsT, StyledDialogFixedBodyPropsT, StyledDialogBackgroundPropsT } from './DSDialogInternalTypes';
|
|
2
|
-
export declare const FixedBody: import("styled-components").GlobalStyleComponent<StyledDialogFixedBodyPropsT, import("styled-components").DefaultTheme>;
|
|
3
|
-
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogBackgroundPropsT, never>;
|
|
4
|
-
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogContainerPropsT, never>;
|
|
5
|
-
export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
-
export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
-
export declare const DSDialogSeparator: import("styled-components").StyledComponent<"hr", import("styled-components").DefaultTheme, {
|
|
9
|
-
'aria-hidden': true;
|
|
10
|
-
}, "aria-hidden">;
|
|
11
|
-
export declare const DSDialogBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare const DSDialogPrimaryMessage: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
-
export declare const DSDialogSecondaryMessage: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
-
export declare const DSDialogDefaultLayout: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
-
export declare const DSDialogFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/types/utils.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { GetSpaceArgsT } from './DSDialogInternalTypes';
|
|
2
|
-
export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
|
|
3
|
-
export declare const DSDialogSizes: {
|
|
4
|
-
readonly DEFAULT: "default";
|
|
5
|
-
readonly SMALL: "small";
|
|
6
|
-
readonly MEDIUM: "medium";
|
|
7
|
-
readonly LARGE: "large";
|
|
8
|
-
readonly XLARGE: "x-large";
|
|
9
|
-
readonly XXLARGE: "xx-large";
|
|
10
|
-
};
|
|
11
|
-
export declare const DSDialogSizesArrayValues: ("default" | "small" | "medium" | "large" | "x-large" | "xx-large")[];
|
|
12
|
-
export declare const allSizes: {
|
|
13
|
-
default: string;
|
|
14
|
-
small: string;
|
|
15
|
-
medium: string;
|
|
16
|
-
large: string;
|
|
17
|
-
'x-large': string;
|
|
18
|
-
'xx-large': string;
|
|
19
|
-
};
|