@elliemae/ds-dialog 3.0.0-alpha.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSDialog.js +44 -13
- package/dist/cjs/DSDialog.js.map +2 -2
- package/dist/cjs/defaultProps.js +1 -0
- package/dist/cjs/defaultProps.js.map +2 -2
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/propTypes.js +22 -4
- package/dist/cjs/propTypes.js.map +2 -2
- package/dist/cjs/{DSDialogTypes.js → sharedTypes.js} +3 -3
- package/dist/cjs/sharedTypes.js.map +7 -0
- package/dist/cjs/styles.js +2 -0
- package/dist/cjs/styles.js.map +2 -2
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/DSDialog.js +47 -14
- package/dist/esm/DSDialog.js.map +2 -2
- package/dist/esm/defaultProps.js +1 -0
- package/dist/esm/defaultProps.js.map +2 -2
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/propTypes.js +24 -4
- package/dist/esm/propTypes.js.map +2 -2
- package/dist/esm/sharedTypes.js +2 -0
- package/dist/esm/{DSDialogInternalTypes.js.map → sharedTypes.js.map} +0 -0
- package/dist/esm/styles.js +2 -0
- package/dist/esm/styles.js.map +2 -2
- package/dist/esm/utils.js.map +1 -1
- package/package.json +5 -3
- package/dist/cjs/DSDialogInternalTypes.js +0 -27
- package/dist/cjs/DSDialogInternalTypes.js.map +0 -7
- package/dist/cjs/DSDialogTypes.js.map +0 -7
- package/dist/esm/DSDialogInternalTypes.js +0 -2
- package/dist/esm/DSDialogTypes.js +0 -2
- package/dist/esm/DSDialogTypes.js.map +0 -7
- package/dist/types/DSDialog.d.ts +0 -5
- package/dist/types/DSDialogDatatestid.d.ts +0 -4
- package/dist/types/DSDialogInternalTypes.d.ts +0 -25
- package/dist/types/DSDialogTypes.d.ts +0 -11
- package/dist/types/defaultProps.d.ts +0 -2
- package/dist/types/index.d.ts +0 -52
- package/dist/types/propTypes.d.ts +0 -2
- package/dist/types/styles.d.ts +0 -15
- package/dist/types/utils.d.ts +0 -19
package/dist/cjs/DSDialog.js
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
8
37
|
var __export = (target, all) => {
|
|
9
38
|
for (var name in all)
|
|
10
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -43,7 +72,7 @@ const DSDialog = (props) => {
|
|
|
43
72
|
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
|
|
44
73
|
const [bodyInfo, setBodyInfo] = (0, import_react.useState)({ overflow: false, padding: "0px" });
|
|
45
74
|
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_propTypes.propTypes);
|
|
46
|
-
const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex,
|
|
75
|
+
const _a = propsWithDefault, { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex } = _a, rest = __objRest(_a, ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"]);
|
|
47
76
|
const containerRef = (0, import_react.useRef)(null);
|
|
48
77
|
const handleOutsideClick = (0, import_react.useCallback)((e) => {
|
|
49
78
|
if (e.target.dataset.portalbg)
|
|
@@ -51,16 +80,20 @@ const DSDialog = (props) => {
|
|
|
51
80
|
}, [onClickOutside]);
|
|
52
81
|
const handleOnKeyDown = (0, import_react.useCallback)((e) => {
|
|
53
82
|
if (e.key === "Escape")
|
|
54
|
-
|
|
55
|
-
}, [
|
|
83
|
+
onClose();
|
|
84
|
+
}, [onClose]);
|
|
85
|
+
const _b = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault, {
|
|
86
|
+
onClick: handleOutsideClick,
|
|
87
|
+
onKeyDown: handleOnKeyDown
|
|
88
|
+
}), { className } = _b, restOfGlobalAttributes = __objRest(_b, ["className"]);
|
|
56
89
|
(0, import_react.useEffect)(() => {
|
|
57
90
|
const body = document.getElementsByTagName("body")[0];
|
|
58
|
-
const {
|
|
91
|
+
const { clientHeight, scrollHeight } = body;
|
|
59
92
|
const padding = window.getComputedStyle(body, null)?.getPropertyValue("padding-right");
|
|
60
93
|
if (!isOpen)
|
|
61
94
|
return setBodyInfo({ overflow: false, padding: "0px" });
|
|
62
95
|
return setBodyInfo({
|
|
63
|
-
overflow:
|
|
96
|
+
overflow: scrollHeight > clientHeight,
|
|
64
97
|
padding
|
|
65
98
|
});
|
|
66
99
|
}, [isOpen]);
|
|
@@ -68,27 +101,25 @@ const DSDialog = (props) => {
|
|
|
68
101
|
if (isOpen && !removeAutoFocus)
|
|
69
102
|
containerRef?.current?.focus();
|
|
70
103
|
}, [isOpen, removeAutoFocus]);
|
|
71
|
-
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault, { onClick: handleOutsideClick });
|
|
72
104
|
if (isOpen) {
|
|
73
105
|
return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogBackground, {
|
|
106
|
+
className,
|
|
74
107
|
onClick: handleOutsideClick,
|
|
75
108
|
"data-portalbg": true,
|
|
76
109
|
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
77
|
-
zIndex
|
|
78
|
-
...globalAttributes
|
|
110
|
+
zIndex
|
|
79
111
|
}, /* @__PURE__ */ import_react.default.createElement(import_styles.FixedBody, {
|
|
80
112
|
bodyInfo
|
|
81
|
-
}), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, {
|
|
113
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, __spreadValues(__spreadProps(__spreadValues({
|
|
82
114
|
role: "dialog",
|
|
83
115
|
"aria-modal": true,
|
|
84
116
|
ref: containerRef,
|
|
85
|
-
tabIndex: !removeAutoFocus ? 0 : void 0
|
|
86
|
-
|
|
87
|
-
...(0, import_utils.getSpaceProps)(rest),
|
|
117
|
+
tabIndex: !removeAutoFocus ? 0 : void 0
|
|
118
|
+
}, (0, import_utils.getSpaceProps)(rest)), {
|
|
88
119
|
size,
|
|
89
120
|
centered,
|
|
90
121
|
"data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER
|
|
91
|
-
}, children)), document.getElementsByTagName("body")[0]);
|
|
122
|
+
}), restOfGlobalAttributes), children)), document.getElementsByTagName("body")[0]);
|
|
92
123
|
}
|
|
93
124
|
return null;
|
|
94
125
|
};
|
package/dist/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 {\n useMemoMergePropsWithDefault,\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\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 { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\nconst DSDialog = (props: DSDialogT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.Props>(props, defaultProps);\n const [bodyInfo, setBodyInfo] = useState<DSDialogInternalsT.BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes<DSDialogT.Props>(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex, ...rest } =\n 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') onClose();\n },\n [onClose],\n );\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(propsWithDefault, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { clientHeight, 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: scrollHeight > clientHeight,\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 className={className}\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 {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\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,WAAW,CAAC,UAA2B;AAC3C,QAAM,mBAAmB,0DAA8C,OAAO;AAC9E,QAAM,CAAC,UAAU,eAAe,2BAAuC,EAAE,UAAU,OAAO,SAAS;AAEnG,8DAAgD,kBAAkB;AAElE,QACE,uBADM,YAAU,QAAQ,gBAAgB,SAAS,UAAU,MAAM,iBAAiB,WAClF,IAD6F,iBAC7F,IAD6F,CAAvF,YAAU,UAAQ,kBAAgB,WAAS,YAAU,QAAM,mBAAiB;AAGpF,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,QAAiD,yDAAuB,kBAAkB;AAAA,IACxF,SAAS;AAAA,IACT,WAAW;AAAA,MAFL,gBAAyC,IAA3B,mCAA2B,IAA3B,CAAd;AAKR,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;AAAA,MACA,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,OAC7B,gCAAc,QALpB;AAAA,MAME;AAAA,MACA;AAAA,MACA,eAAa,6CAAmB;AAAA,QAC5B,yBAEH,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,sCAAS;AACpC,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/defaultProps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/defaultProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { DSDialogSizes } from './utils';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,
|
|
4
|
+
"sourcesContent": ["import { DSDialogSizes } from './utils';\nimport type { DSDialogT } from './propTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n onClose: noop,\n zIndex: 10,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,2BAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/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": ["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;
|
|
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;\n\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;AA0CP,wBAAc;AACd,wBAAc;AACd,mBAA8B;AA1C9B,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;AAErC,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/dist/cjs/propTypes.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -32,15 +49,16 @@ __export(propTypes_exports, {
|
|
|
32
49
|
var React = __toESM(require("react"));
|
|
33
50
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
51
|
var import_utils = require("./utils");
|
|
35
|
-
const propTypes = {
|
|
52
|
+
const propTypes = __spreadProps(__spreadValues({}, import_ds_props_helpers.globalAttributesPropTypes), {
|
|
36
53
|
isOpen: import_ds_props_helpers.PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
37
54
|
children: import_ds_props_helpers.PropTypes.node.description("Nested components.").isRequired,
|
|
38
55
|
centered: import_ds_props_helpers.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
39
56
|
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.
|
|
57
|
+
onClickOutside: import_ds_props_helpers.PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
|
|
58
|
+
}),
|
|
59
|
+
onClose: import_ds_props_helpers.PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
|
|
41
60
|
}),
|
|
42
|
-
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
43
61
|
size: import_ds_props_helpers.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT)
|
|
44
|
-
};
|
|
62
|
+
});
|
|
45
63
|
module.exports = __toCommonJS(propTypes_exports);
|
|
46
64
|
//# sourceMappingURL=propTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-len */\nimport { globalAttributesPropTypes, GlobalAttributesT, PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n zIndex: number;\n onClickOutside: () => void;\n onClose: () => void;\n }\n\n export interface PropsRequired {\n children: React.ReactNode;\n }\n\n export interface Props\n extends DefaultProps,\n PropsRequired,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'children'> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAwE;AACxE,mBAAwD;AAwBjD,MAAM,YAAY,iCACpB,oDADoB;AAAA,EAEvB,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,YAAY,iFACZ,aAAa,MAAM;AAAA;AAAA,EACtB,SAAS,kCAAU,KAAK,YAAY,oCAAoC,aAAa,MAAM;AAAA;AAAA,EAC3F,MAAM,kCAAU,MAAM,uCACnB,YAAY,wBACZ,aAAa,2BAAc;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
|
21
21
|
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
22
|
};
|
|
23
23
|
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var
|
|
24
|
+
var sharedTypes_exports = {};
|
|
25
25
|
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(
|
|
27
|
-
//# sourceMappingURL=
|
|
26
|
+
module.exports = __toCommonJS(sharedTypes_exports);
|
|
27
|
+
//# sourceMappingURL=sharedTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sharedTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export namespace DSDialogInternalsT {\n export interface BodyInfoT {\n overflow: boolean;\n padding: string;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/styles.js
CHANGED
|
@@ -86,6 +86,7 @@ const DSDialogTitle = import_styled_components.default.h3`
|
|
|
86
86
|
-webkit-line-clamp: 2;
|
|
87
87
|
-webkit-box-orient: vertical;
|
|
88
88
|
overflow: hidden;
|
|
89
|
+
line-height: 28px;
|
|
89
90
|
margin: 0;
|
|
90
91
|
`;
|
|
91
92
|
const DSDialogAddon = import_styled_components.default.div``;
|
|
@@ -103,6 +104,7 @@ const DSDialogHeader = import_styled_components.default.div`
|
|
|
103
104
|
justify-self: flex-end;
|
|
104
105
|
}
|
|
105
106
|
${import_styled_components2.space}
|
|
107
|
+
${import_styled_components2.sizing}
|
|
106
108
|
`;
|
|
107
109
|
const DSDialogSeparator = import_styled_components.default.hr.attrs(() => ({ "aria-hidden": true }))`
|
|
108
110
|
margin: 0;
|
package/dist/cjs/styles.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport 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 { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\ninterface FixedBodyT {\n bodyInfo: DSDialogInternalsT.BodyInfoT;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n}\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<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: auto;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n ${sizing}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n\n ${layout}\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAiBlB,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;AAAA;AAS7C,MAAM,gBAAgB,iCAAO;AAE7B,MAAM,iBAAiB,iCAAO;AAAA;AAAA;AAAA;AAAA,gBAIrB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA,IACA;AAAA;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe;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/dist/cjs/utils.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
4
|
+
"sourcesContent": ["type GetSpaceArgsT = Partial<Record<string, string | number>>;\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/dist/esm/DSDialog.js
CHANGED
|
@@ -1,10 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import ReactDOM from "react-dom";
|
|
3
34
|
import React2, { useCallback, useRef, useEffect, useState } from "react";
|
|
4
35
|
import {
|
|
5
36
|
useMemoMergePropsWithDefault,
|
|
6
|
-
useValidateTypescriptPropTypes,
|
|
7
37
|
useGetGlobalAttributes,
|
|
38
|
+
useValidateTypescriptPropTypes,
|
|
8
39
|
describe
|
|
9
40
|
} from "@elliemae/ds-props-helpers";
|
|
10
41
|
import { FixedBody, StyledDialogBackground, StyledDialogContainer } from "./styles";
|
|
@@ -16,7 +47,7 @@ const DSDialog = (props) => {
|
|
|
16
47
|
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
17
48
|
const [bodyInfo, setBodyInfo] = useState({ overflow: false, padding: "0px" });
|
|
18
49
|
useValidateTypescriptPropTypes(propsWithDefault, propTypes);
|
|
19
|
-
const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex,
|
|
50
|
+
const _a = propsWithDefault, { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex } = _a, rest = __objRest(_a, ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"]);
|
|
20
51
|
const containerRef = useRef(null);
|
|
21
52
|
const handleOutsideClick = useCallback((e) => {
|
|
22
53
|
if (e.target.dataset.portalbg)
|
|
@@ -24,16 +55,20 @@ const DSDialog = (props) => {
|
|
|
24
55
|
}, [onClickOutside]);
|
|
25
56
|
const handleOnKeyDown = useCallback((e) => {
|
|
26
57
|
if (e.key === "Escape")
|
|
27
|
-
|
|
28
|
-
}, [
|
|
58
|
+
onClose();
|
|
59
|
+
}, [onClose]);
|
|
60
|
+
const _b = useGetGlobalAttributes(propsWithDefault, {
|
|
61
|
+
onClick: handleOutsideClick,
|
|
62
|
+
onKeyDown: handleOnKeyDown
|
|
63
|
+
}), { className } = _b, restOfGlobalAttributes = __objRest(_b, ["className"]);
|
|
29
64
|
useEffect(() => {
|
|
30
65
|
const body = document.getElementsByTagName("body")[0];
|
|
31
|
-
const {
|
|
66
|
+
const { clientHeight, scrollHeight } = body;
|
|
32
67
|
const padding = window.getComputedStyle(body, null)?.getPropertyValue("padding-right");
|
|
33
68
|
if (!isOpen)
|
|
34
69
|
return setBodyInfo({ overflow: false, padding: "0px" });
|
|
35
70
|
return setBodyInfo({
|
|
36
|
-
overflow:
|
|
71
|
+
overflow: scrollHeight > clientHeight,
|
|
37
72
|
padding
|
|
38
73
|
});
|
|
39
74
|
}, [isOpen]);
|
|
@@ -41,27 +76,25 @@ const DSDialog = (props) => {
|
|
|
41
76
|
if (isOpen && !removeAutoFocus)
|
|
42
77
|
containerRef?.current?.focus();
|
|
43
78
|
}, [isOpen, removeAutoFocus]);
|
|
44
|
-
const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });
|
|
45
79
|
if (isOpen) {
|
|
46
80
|
return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(StyledDialogBackground, {
|
|
81
|
+
className,
|
|
47
82
|
onClick: handleOutsideClick,
|
|
48
83
|
"data-portalbg": true,
|
|
49
84
|
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
50
|
-
zIndex
|
|
51
|
-
...globalAttributes
|
|
85
|
+
zIndex
|
|
52
86
|
}, /* @__PURE__ */ React2.createElement(FixedBody, {
|
|
53
87
|
bodyInfo
|
|
54
|
-
}), /* @__PURE__ */ React2.createElement(StyledDialogContainer, {
|
|
88
|
+
}), /* @__PURE__ */ React2.createElement(StyledDialogContainer, __spreadValues(__spreadProps(__spreadValues({
|
|
55
89
|
role: "dialog",
|
|
56
90
|
"aria-modal": true,
|
|
57
91
|
ref: containerRef,
|
|
58
|
-
tabIndex: !removeAutoFocus ? 0 : void 0
|
|
59
|
-
|
|
60
|
-
...getSpaceProps(rest),
|
|
92
|
+
tabIndex: !removeAutoFocus ? 0 : void 0
|
|
93
|
+
}, getSpaceProps(rest)), {
|
|
61
94
|
size,
|
|
62
95
|
centered,
|
|
63
96
|
"data-testid": DSDialogDatatestid.CONTAINER
|
|
64
|
-
}, children)), document.getElementsByTagName("body")[0]);
|
|
97
|
+
}), restOfGlobalAttributes), children)), document.getElementsByTagName("body")[0]);
|
|
65
98
|
}
|
|
66
99
|
return null;
|
|
67
100
|
};
|
package/dist/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 {\n useMemoMergePropsWithDefault,\n
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAIA,MAAM,
|
|
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 useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\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 { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\nconst DSDialog = (props: DSDialogT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.Props>(props, defaultProps);\n const [bodyInfo, setBodyInfo] = useState<DSDialogInternalsT.BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes<DSDialogT.Props>(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex, ...rest } =\n 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') onClose();\n },\n [onClose],\n );\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(propsWithDefault, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { clientHeight, 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: scrollHeight > clientHeight,\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 className={className}\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 {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\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,WAAW,CAAC,UAA2B;AAC3C,QAAM,mBAAmB,6BAA8C,OAAO;AAC9E,QAAM,CAAC,UAAU,eAAe,SAAuC,EAAE,UAAU,OAAO,SAAS;AAEnG,iCAAgD,kBAAkB;AAElE,QACE,uBADM,YAAU,QAAQ,gBAAgB,SAAS,UAAU,MAAM,iBAAiB,WAClF,IAD6F,iBAC7F,IAD6F,CAAvF,YAAU,UAAQ,kBAAgB,WAAS,YAAU,QAAM,mBAAiB;AAGpF,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,QAAiD,4BAAuB,kBAAkB;AAAA,IACxF,SAAS;AAAA,IACT,WAAW;AAAA,MAFL,gBAAyC,IAA3B,mCAA2B,IAA3B,CAAd;AAKR,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;AAAA,MACA,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,OAC7B,cAAc,QALpB;AAAA,MAME;AAAA,MACA;AAAA,MACA,eAAa,mBAAmB;AAAA,QAC5B,yBAEH,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/defaultProps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSDialogSizes } from './utils';\nimport type {
|
|
5
|
-
"mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSDialogSizes } from './utils';\nimport type { DSDialogT } from './propTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n onClose: noop,\n zIndex: 10,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/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", "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;
|
|
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;\n\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;AAErC,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/dist/esm/propTypes.js
CHANGED
|
@@ -1,16 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
import * as React from "react";
|
|
2
21
|
import { globalAttributesPropTypes, PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
22
|
import { DSDialogSizes, DSDialogSizesArrayValues } from "./utils";
|
|
4
|
-
const propTypes = {
|
|
23
|
+
const propTypes = __spreadProps(__spreadValues({}, globalAttributesPropTypes), {
|
|
5
24
|
isOpen: PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
6
25
|
children: PropTypes.node.description("Nested components.").isRequired,
|
|
7
26
|
centered: PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
8
27
|
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),
|
|
9
|
-
onClickOutside: PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.
|
|
28
|
+
onClickOutside: PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
|
|
29
|
+
}),
|
|
30
|
+
onClose: PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
|
|
10
31
|
}),
|
|
11
|
-
...globalAttributesPropTypes,
|
|
12
32
|
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT)
|
|
13
|
-
};
|
|
33
|
+
});
|
|
14
34
|
export {
|
|
15
35
|
propTypes
|
|
16
36
|
};
|
|
@@ -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 { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport {
|
|
5
|
-
"mappings": "AAAA;ACCA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { globalAttributesPropTypes, GlobalAttributesT, PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n zIndex: number;\n onClickOutside: () => void;\n onClose: () => void;\n }\n\n export interface PropsRequired {\n children: React.ReactNode;\n }\n\n export interface Props\n extends DefaultProps,\n PropsRequired,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'children'> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAwBO,MAAM,YAAY,iCACpB,4BADoB;AAAA,EAEvB,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,YAAY,iFACZ,aAAa,MAAM;AAAA;AAAA,EACtB,SAAS,UAAU,KAAK,YAAY,oCAAoC,aAAa,MAAM;AAAA;AAAA,EAC3F,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
File without changes
|
package/dist/esm/styles.js
CHANGED
|
@@ -44,6 +44,7 @@ const DSDialogTitle = styled.h3`
|
|
|
44
44
|
-webkit-line-clamp: 2;
|
|
45
45
|
-webkit-box-orient: vertical;
|
|
46
46
|
overflow: hidden;
|
|
47
|
+
line-height: 28px;
|
|
47
48
|
margin: 0;
|
|
48
49
|
`;
|
|
49
50
|
const DSDialogAddon = styled.div``;
|
|
@@ -61,6 +62,7 @@ const DSDialogHeader = styled.div`
|
|
|
61
62
|
justify-self: flex-end;
|
|
62
63
|
}
|
|
63
64
|
${space}
|
|
65
|
+
${sizing}
|
|
64
66
|
`;
|
|
65
67
|
const DSDialogSeparator = styled.hr.attrs(() => ({ "aria-hidden": true }))`
|
|
66
68
|
margin: 0;
|
package/dist/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 { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\ninterface FixedBodyT {\n bodyInfo: DSDialogInternalsT.BodyInfoT;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n}\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<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: auto;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 28px;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n ${sizing}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n\n ${layout}\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAiBO,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;AAAA;AAS7C,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,IACA;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/dist/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", "
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "type GetSpaceArgsT = Partial<Record<string, string | number>>;\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": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
6
|
"files": [
|
|
@@ -67,8 +67,9 @@
|
|
|
67
67
|
"indent": 4
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@elliemae/ds-
|
|
71
|
-
"@elliemae/ds-
|
|
70
|
+
"@elliemae/ds-button": "3.0.0-alpha.1",
|
|
71
|
+
"@elliemae/ds-props-helpers": "3.0.0-alpha.1",
|
|
72
|
+
"@elliemae/ds-system": "3.0.0-alpha.1",
|
|
72
73
|
"@xstyled/styled-components": "~3.1.2",
|
|
73
74
|
"react-desc": "~4.1.3"
|
|
74
75
|
},
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
89
90
|
"test": "node ../../scripts/testing/test.mjs",
|
|
90
91
|
"lint": "node ../../scripts/lint.mjs",
|
|
92
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
91
93
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
92
94
|
}
|
|
93
95
|
}
|
|
@@ -1,27 +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 __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(module2))
|
|
11
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return target;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (module2, isNodeMode) => {
|
|
17
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
-
var DSDialogInternalTypes_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
module.exports = __toCommonJS(DSDialogInternalTypes_exports);
|
|
27
|
-
//# sourceMappingURL=DSDialogInternalTypes.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 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 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
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DSDialogTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n\nexport interface DSDialogPropsT {\n isOpen?: boolean;\n children: React.ReactNode;\n onClickOutside?: () => void;\n size?: Sizes;\n centered?: boolean;\n removeAutoFocus?: boolean;\n zIndex?: number;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/types/DSDialog.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DSDialogPropsT } from './DSDialogTypes';
|
|
3
|
-
declare const DSDialog: React.ComponentType<DSDialogPropsT>;
|
|
4
|
-
declare const DSDialogWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<DSDialogPropsT>;
|
|
5
|
-
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 StyledDialogBackgroundT {
|
|
19
|
-
zIndex: number;
|
|
20
|
-
}
|
|
21
|
-
export interface FixedBodyT {
|
|
22
|
-
isBodyOverflow: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;
|
|
25
|
-
export declare type GetSpaceArgsT = Partial<Record<string, string | number>>;
|
|
@@ -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/dist/types/index.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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
|
-
};
|
|
49
|
-
export * from './DSDialog';
|
|
50
|
-
export * from './DSDialogDatatestid';
|
|
51
|
-
export { DSDialogSizes } from './utils';
|
|
52
|
-
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogBodyWithSchema, DSDialogHeaderWithSchema, DSDialogFooterWithSchema, DSDialogSeparatorWithSchema, DSDialogTitleWithSchema, DSDialogAddonWithSchema, DSDialogDefaultLayoutWithSchema, DSDialogPrimaryMessageWithSchema, DSDialogSecondaryMessageWithSchema, };
|
package/dist/types/styles.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
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/dist/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
|
-
DEFAULT: "default";
|
|
5
|
-
SMALL: "small";
|
|
6
|
-
MEDIUM: "medium";
|
|
7
|
-
LARGE: "large";
|
|
8
|
-
XLARGE: "x-large";
|
|
9
|
-
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
|
-
};
|