@elliemae/ds-dialog 2.3.0-alpha.2 → 2.3.0-alpha.3
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/DSDialog.js +4 -3
- package/cjs/DSDialog.js.map +2 -2
- package/cjs/DSDialogInternalTypes.js.map +1 -1
- package/cjs/index.js +49 -2
- package/cjs/index.js.map +2 -2
- package/cjs/propTypes.js +9 -8
- package/cjs/propTypes.js.map +2 -2
- package/cjs/styles.js.map +2 -2
- package/cjs/utils.js.map +1 -1
- package/esm/DSDialog.js +9 -3
- package/esm/DSDialog.js.map +2 -2
- package/esm/index.js +51 -4
- package/esm/index.js.map +2 -2
- package/esm/propTypes.js +5 -4
- package/esm/propTypes.js.map +2 -2
- package/esm/styles.js.map +2 -2
- package/esm/utils.js.map +1 -1
- package/package.json +3 -3
- package/types/DSDialog.d.ts +2 -27
- package/types/DSDialogInternalTypes.d.ts +4 -4
- package/types/index.d.ts +49 -1
- package/types/propTypes.d.ts +2 -19
- package/types/styles.d.ts +4 -4
- package/types/utils.d.ts +6 -6
package/cjs/DSDialog.js
CHANGED
|
@@ -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
|
package/cjs/DSDialog.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqB;AACrB,mBAAgE;AAChE,
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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
|
}
|
package/cjs/index.js
CHANGED
|
@@ -28,20 +28,67 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
|
28
28
|
var src_exports = {};
|
|
29
29
|
__export(src_exports, {
|
|
30
30
|
DSDialogAddon: () => import_styles.DSDialogAddon,
|
|
31
|
+
DSDialogAddonWithSchema: () => DSDialogAddonWithSchema,
|
|
31
32
|
DSDialogBody: () => import_styles.DSDialogBody,
|
|
33
|
+
DSDialogBodyWithSchema: () => DSDialogBodyWithSchema,
|
|
32
34
|
DSDialogDefaultLayout: () => import_styles.DSDialogDefaultLayout,
|
|
35
|
+
DSDialogDefaultLayoutWithSchema: () => DSDialogDefaultLayoutWithSchema,
|
|
33
36
|
DSDialogFooter: () => import_styles.DSDialogFooter,
|
|
37
|
+
DSDialogFooterWithSchema: () => DSDialogFooterWithSchema,
|
|
34
38
|
DSDialogHeader: () => import_styles.DSDialogHeader,
|
|
39
|
+
DSDialogHeaderWithSchema: () => DSDialogHeaderWithSchema,
|
|
35
40
|
DSDialogPrimaryMessage: () => import_styles.DSDialogPrimaryMessage,
|
|
41
|
+
DSDialogPrimaryMessageWithSchema: () => DSDialogPrimaryMessageWithSchema,
|
|
36
42
|
DSDialogSecondaryMessage: () => import_styles.DSDialogSecondaryMessage,
|
|
43
|
+
DSDialogSecondaryMessageWithSchema: () => DSDialogSecondaryMessageWithSchema,
|
|
37
44
|
DSDialogSeparator: () => import_styles.DSDialogSeparator,
|
|
45
|
+
DSDialogSeparatorWithSchema: () => DSDialogSeparatorWithSchema,
|
|
38
46
|
DSDialogSizes: () => import_utils.DSDialogSizes,
|
|
39
|
-
DSDialogTitle: () => import_styles.DSDialogTitle
|
|
47
|
+
DSDialogTitle: () => import_styles.DSDialogTitle,
|
|
48
|
+
DSDialogTitleWithSchema: () => DSDialogTitleWithSchema
|
|
40
49
|
});
|
|
41
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");
|
|
42
54
|
__reExport(src_exports, require("./DSDialog"));
|
|
43
55
|
__reExport(src_exports, require("./DSDialogDatatestid"));
|
|
44
56
|
var import_utils = require("./utils");
|
|
45
|
-
|
|
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;
|
|
46
93
|
module.exports = __toCommonJS(src_exports);
|
|
47
94
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;AACd,mBAA8B;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/cjs/propTypes.js
CHANGED
|
@@ -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
|
package/cjs/propTypes.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { PropTypes } from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport type {
|
|
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;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["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
|
}
|
package/esm/DSDialog.js
CHANGED
|
@@ -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, {
|
package/esm/DSDialog.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 {
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { DSDialogSizes } from "./utils";
|
|
2
|
+
import { describe } from "react-desc";
|
|
3
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
|
|
5
4
|
import {
|
|
6
5
|
DSDialogBody,
|
|
7
6
|
DSDialogHeader,
|
|
@@ -13,16 +12,64 @@ import {
|
|
|
13
12
|
DSDialogPrimaryMessage,
|
|
14
13
|
DSDialogSecondaryMessage
|
|
15
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";
|
|
16
54
|
export {
|
|
17
55
|
DSDialogAddon,
|
|
56
|
+
DSDialogAddonWithSchema,
|
|
18
57
|
DSDialogBody,
|
|
58
|
+
DSDialogBodyWithSchema,
|
|
19
59
|
DSDialogDefaultLayout,
|
|
60
|
+
DSDialogDefaultLayoutWithSchema,
|
|
20
61
|
DSDialogFooter,
|
|
62
|
+
DSDialogFooterWithSchema,
|
|
21
63
|
DSDialogHeader,
|
|
64
|
+
DSDialogHeaderWithSchema,
|
|
22
65
|
DSDialogPrimaryMessage,
|
|
66
|
+
DSDialogPrimaryMessageWithSchema,
|
|
23
67
|
DSDialogSecondaryMessage,
|
|
68
|
+
DSDialogSecondaryMessageWithSchema,
|
|
24
69
|
DSDialogSeparator,
|
|
70
|
+
DSDialogSeparatorWithSchema,
|
|
25
71
|
DSDialogSizes,
|
|
26
|
-
DSDialogTitle
|
|
72
|
+
DSDialogTitle,
|
|
73
|
+
DSDialogTitleWithSchema
|
|
27
74
|
};
|
|
28
75
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/esm/propTypes.js
CHANGED
|
@@ -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
|
package/esm/propTypes.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 '
|
|
5
|
-
"mappings": "AAAA;ACCA;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/esm/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 {
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;
|
|
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
6
|
"names": []
|
|
7
7
|
}
|
package/esm/utils.js.map
CHANGED
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "2.3.0-alpha.
|
|
3
|
+
"version": "2.3.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"build": "node ../../scripts/build/build.js"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@elliemae/ds-props-helpers": "2.3.0-alpha.
|
|
68
|
-
"@elliemae/ds-system": "2.3.0-alpha.
|
|
67
|
+
"@elliemae/ds-props-helpers": "2.3.0-alpha.3",
|
|
68
|
+
"@elliemae/ds-system": "2.3.0-alpha.3",
|
|
69
69
|
"@xstyled/styled-components": "~3.1.1",
|
|
70
70
|
"react-desc": "~4.1.3"
|
|
71
71
|
},
|
package/types/DSDialog.d.ts
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import type { DSDialogPropsT } from './DSDialogTypes';
|
|
4
|
-
declare const DSDialog:
|
|
5
|
-
|
|
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
|
-
};
|
|
3
|
+
declare const DSDialog: React.ComponentType<DSDialogPropsT>;
|
|
4
|
+
declare const DSDialogWithSchema: import("@elliemae/ds-props-helpers/types/propTypes/types").DocumentedReactComponent<DSDialogPropsT>;
|
|
30
5
|
export { DSDialog, DSDialogWithSchema };
|
|
@@ -15,11 +15,11 @@ export interface StyledDialogContainerPropsT {
|
|
|
15
15
|
size: Sizes;
|
|
16
16
|
centered: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
19
|
-
bodyInfo: BodyInfoT;
|
|
20
|
-
}
|
|
21
|
-
export interface StyledDialogBackgroundPropsT {
|
|
18
|
+
export interface StyledDialogBackgroundT {
|
|
22
19
|
zIndex: number;
|
|
23
20
|
}
|
|
21
|
+
export interface FixedBodyT {
|
|
22
|
+
isBodyOverflow: boolean;
|
|
23
|
+
}
|
|
24
24
|
export declare type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;
|
|
25
25
|
export declare type GetSpaceArgsT = Partial<Record<string, string | number>>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,52 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage } from './styles';
|
|
4
|
+
declare const DSDialogBodyWithSchema: {
|
|
5
|
+
(props?: unknown): JSX.Element;
|
|
6
|
+
propTypes: unknown;
|
|
7
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
8
|
+
};
|
|
9
|
+
declare const DSDialogHeaderWithSchema: {
|
|
10
|
+
(props?: unknown): JSX.Element;
|
|
11
|
+
propTypes: unknown;
|
|
12
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
13
|
+
};
|
|
14
|
+
declare const DSDialogFooterWithSchema: {
|
|
15
|
+
(props?: unknown): JSX.Element;
|
|
16
|
+
propTypes: unknown;
|
|
17
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
18
|
+
};
|
|
19
|
+
declare const DSDialogSeparatorWithSchema: {
|
|
20
|
+
(props?: unknown): JSX.Element;
|
|
21
|
+
propTypes: unknown;
|
|
22
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
23
|
+
};
|
|
24
|
+
declare const DSDialogTitleWithSchema: {
|
|
25
|
+
(props?: unknown): JSX.Element;
|
|
26
|
+
propTypes: unknown;
|
|
27
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
28
|
+
};
|
|
29
|
+
declare const DSDialogAddonWithSchema: {
|
|
30
|
+
(props?: unknown): JSX.Element;
|
|
31
|
+
propTypes: unknown;
|
|
32
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
33
|
+
};
|
|
34
|
+
declare const DSDialogDefaultLayoutWithSchema: {
|
|
35
|
+
(props?: unknown): JSX.Element;
|
|
36
|
+
propTypes: unknown;
|
|
37
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
38
|
+
};
|
|
39
|
+
declare const DSDialogPrimaryMessageWithSchema: {
|
|
40
|
+
(props?: unknown): JSX.Element;
|
|
41
|
+
propTypes: unknown;
|
|
42
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
43
|
+
};
|
|
44
|
+
declare const DSDialogSecondaryMessageWithSchema: {
|
|
45
|
+
(props?: unknown): JSX.Element;
|
|
46
|
+
propTypes: unknown;
|
|
47
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
48
|
+
};
|
|
1
49
|
export * from './DSDialog';
|
|
2
50
|
export * from './DSDialogDatatestid';
|
|
3
51
|
export { DSDialogSizes } from './utils';
|
|
4
|
-
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage,
|
|
52
|
+
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogBodyWithSchema, DSDialogHeaderWithSchema, DSDialogFooterWithSchema, DSDialogSeparatorWithSchema, DSDialogTitleWithSchema, DSDialogAddonWithSchema, DSDialogDefaultLayoutWithSchema, DSDialogPrimaryMessageWithSchema, DSDialogSecondaryMessageWithSchema, };
|
package/types/propTypes.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
};
|
|
1
|
+
import { WeakValidationMap } from 'react';
|
|
2
|
+
export declare const propTypes: WeakValidationMap<unknown>;
|
package/types/styles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const FixedBody: import("styled-components").GlobalStyleComponent<
|
|
3
|
-
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
4
|
-
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
1
|
+
import type { StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';
|
|
2
|
+
export declare const FixedBody: import("styled-components").GlobalStyleComponent<FixedBodyT, import("styled-components").DefaultTheme>;
|
|
3
|
+
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogBackgroundT, never>;
|
|
4
|
+
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, any, never>;
|
|
5
5
|
export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { GetSpaceArgsT } from './DSDialogInternalTypes';
|
|
2
2
|
export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
|
|
3
3
|
export declare const DSDialogSizes: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
DEFAULT: "default";
|
|
5
|
+
SMALL: "small";
|
|
6
|
+
MEDIUM: "medium";
|
|
7
|
+
LARGE: "large";
|
|
8
|
+
XLARGE: "x-large";
|
|
9
|
+
XXLARGE: "xx-large";
|
|
10
10
|
};
|
|
11
11
|
export declare const DSDialogSizesArrayValues: ("default" | "small" | "medium" | "large" | "x-large" | "xx-large")[];
|
|
12
12
|
export declare const allSizes: {
|