@elliemae/ds-dialog 2.3.0-next.3 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSDialog.js +99 -0
- package/dist/cjs/DSDialog.js.map +7 -0
- package/dist/cjs/DSDialogDatatestid.js +38 -0
- package/dist/cjs/DSDialogDatatestid.js.map +7 -0
- package/dist/cjs/DSDialogInternalTypes.js +27 -0
- package/dist/cjs/DSDialogInternalTypes.js.map +7 -0
- package/dist/cjs/DSDialogTypes.js +27 -0
- package/dist/cjs/DSDialogTypes.js.map +7 -0
- package/dist/cjs/defaultProps.js +45 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +94 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/propTypes.js +46 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/styles.js +151 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/cjs/utils.js +55 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/esm/DSDialog.js +75 -0
- package/dist/esm/DSDialog.js.map +7 -0
- package/dist/esm/DSDialogDatatestid.js +9 -0
- package/dist/esm/DSDialogDatatestid.js.map +7 -0
- package/dist/esm/DSDialogInternalTypes.js +2 -0
- package/dist/esm/DSDialogInternalTypes.js.map +7 -0
- package/dist/esm/DSDialogTypes.js +2 -0
- package/dist/esm/DSDialogTypes.js.map +7 -0
- package/dist/esm/defaultProps.js +16 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/{esm → dist/esm}/index.js +48 -19
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/propTypes.js +17 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/styles.js +122 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/esm/utils.js +26 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/types/DSDialog.d.ts +5 -0
- package/{types → dist/types}/DSDialogDatatestid.d.ts +0 -0
- package/dist/types/DSDialogInternalTypes.d.ts +25 -0
- package/dist/types/DSDialogTypes.d.ts +11 -0
- package/dist/types/defaultProps.d.ts +2 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/dist/types/propTypes.d.ts +2 -0
- package/{types → dist/types}/styles.d.ts +2 -14
- package/{types → dist/types}/utils.d.ts +1 -2
- package/package.json +46 -34
- package/cjs/DSDialog.js +0 -124
- package/cjs/DSDialogDatatestid.js +0 -10
- package/cjs/defaultProps.js +0 -19
- package/cjs/index.js +0 -70
- package/cjs/propTypes.js +0 -32
- package/cjs/sharedTypes.js +0 -7
- package/cjs/styles.js +0 -145
- package/cjs/utils.js +0 -35
- package/esm/DSDialog.js +0 -112
- package/esm/DSDialogDatatestid.js +0 -6
- package/esm/defaultProps.js +0 -15
- package/esm/propTypes.js +0 -24
- package/esm/sharedTypes.js +0 -5
- package/esm/styles.js +0 -125
- package/esm/utils.js +0 -28
- package/types/DSDialog.d.ts +0 -376
- package/types/defaultProps.d.ts +0 -2
- package/types/propTypes.d.ts +0 -387
- package/types/sharedTypes.d.ts +0 -6
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var utils_exports = {};
|
|
29
|
+
__export(utils_exports, {
|
|
30
|
+
DSDialogSizes: () => DSDialogSizes,
|
|
31
|
+
DSDialogSizesArrayValues: () => DSDialogSizesArrayValues,
|
|
32
|
+
allSizes: () => allSizes,
|
|
33
|
+
getSpaceProps: () => getSpaceProps
|
|
34
|
+
});
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
|
|
37
|
+
const DSDialogSizes = {
|
|
38
|
+
DEFAULT: "default",
|
|
39
|
+
SMALL: "small",
|
|
40
|
+
MEDIUM: "medium",
|
|
41
|
+
LARGE: "large",
|
|
42
|
+
XLARGE: "x-large",
|
|
43
|
+
XXLARGE: "xx-large"
|
|
44
|
+
};
|
|
45
|
+
const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
|
|
46
|
+
const allSizes = {
|
|
47
|
+
default: "576px",
|
|
48
|
+
small: "320px",
|
|
49
|
+
medium: "656px",
|
|
50
|
+
large: "848px",
|
|
51
|
+
"x-large": "1042px",
|
|
52
|
+
"xx-large": "1440px"
|
|
53
|
+
};
|
|
54
|
+
module.exports = __toCommonJS(utils_exports);
|
|
55
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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' 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
|
+
"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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import React2, { useCallback, useRef, useEffect, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useValidateTypescriptPropTypes,
|
|
7
|
+
useGetGlobalAttributes,
|
|
8
|
+
describe
|
|
9
|
+
} from "@elliemae/ds-props-helpers";
|
|
10
|
+
import { FixedBody, StyledDialogBackground, StyledDialogContainer } from "./styles";
|
|
11
|
+
import { propTypes } from "./propTypes";
|
|
12
|
+
import { defaultProps } from "./defaultProps";
|
|
13
|
+
import { getSpaceProps } from "./utils";
|
|
14
|
+
import { DSDialogDatatestid } from "./DSDialogDatatestid";
|
|
15
|
+
const DSDialog = (props) => {
|
|
16
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
17
|
+
const [bodyInfo, setBodyInfo] = useState({ overflow: false, padding: "0px" });
|
|
18
|
+
useValidateTypescriptPropTypes(propsWithDefault, propTypes);
|
|
19
|
+
const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;
|
|
20
|
+
const containerRef = useRef(null);
|
|
21
|
+
const handleOutsideClick = useCallback((e) => {
|
|
22
|
+
if (e.target.dataset.portalbg)
|
|
23
|
+
onClickOutside();
|
|
24
|
+
}, [onClickOutside]);
|
|
25
|
+
const handleOnKeyDown = useCallback((e) => {
|
|
26
|
+
if (e.key === "Escape")
|
|
27
|
+
onClickOutside();
|
|
28
|
+
}, [onClickOutside]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const body = document.getElementsByTagName("body")[0];
|
|
31
|
+
const { offsetHeight, scrollHeight } = body;
|
|
32
|
+
const padding = window.getComputedStyle(body, null)?.getPropertyValue("padding-right");
|
|
33
|
+
if (!isOpen)
|
|
34
|
+
return setBodyInfo({ overflow: false, padding: "0px" });
|
|
35
|
+
return setBodyInfo({
|
|
36
|
+
overflow: offsetHeight < scrollHeight,
|
|
37
|
+
padding
|
|
38
|
+
});
|
|
39
|
+
}, [isOpen]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (isOpen && !removeAutoFocus)
|
|
42
|
+
containerRef?.current?.focus();
|
|
43
|
+
}, [isOpen, removeAutoFocus]);
|
|
44
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });
|
|
45
|
+
if (isOpen) {
|
|
46
|
+
return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(StyledDialogBackground, {
|
|
47
|
+
onClick: handleOutsideClick,
|
|
48
|
+
"data-portalbg": true,
|
|
49
|
+
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
50
|
+
zIndex,
|
|
51
|
+
...globalAttributes
|
|
52
|
+
}, /* @__PURE__ */ React2.createElement(FixedBody, {
|
|
53
|
+
bodyInfo
|
|
54
|
+
}), /* @__PURE__ */ React2.createElement(StyledDialogContainer, {
|
|
55
|
+
role: "dialog",
|
|
56
|
+
"aria-modal": true,
|
|
57
|
+
ref: containerRef,
|
|
58
|
+
tabIndex: !removeAutoFocus ? 0 : void 0,
|
|
59
|
+
onKeyDown: handleOnKeyDown,
|
|
60
|
+
...getSpaceProps(rest),
|
|
61
|
+
size,
|
|
62
|
+
centered,
|
|
63
|
+
"data-testid": DSDialogDatatestid.CONTAINER
|
|
64
|
+
}, children)), document.getElementsByTagName("body")[0]);
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
DSDialog.propTypes = propTypes;
|
|
69
|
+
const DSDialogWithSchema = describe(DSDialog);
|
|
70
|
+
DSDialogWithSchema.propTypes = propTypes;
|
|
71
|
+
export {
|
|
72
|
+
DSDialog,
|
|
73
|
+
DSDialogWithSchema
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=DSDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog: React.ComponentType<DSDialogPropsT> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e: React.MouseEvent) => {\n if ((e.target as HTMLDivElement).dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n {...globalAttributes}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAIA,MAAM,WAAgD,CAAC,UAAU;AAC/D,QAAM,mBAAmB,6BAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,SAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,iCAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,OAA8B;AAEnD,QAAM,qBAAqB,YACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,YACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,YAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,YAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,QAAM,mBAAmB,uBAAuB,kBAAkB,EAAE,SAAS;AAE7E,MAAI,QAAQ;AACV,WAAO,SAAS,aACd,qCAAC,wBAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,mBAAmB;AAAA,MAChC;AAAA,SACI;AAAA,OAEJ,qCAAC,WAAD;AAAA,MAAW;AAAA,QACX,qCAAC,uBAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,cAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,mBAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialogDatatestid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSDialogDatatestid = {\n CONTAINER: 'ds-dialog-container',\n BACKGROUND: 'ds-dialog-background',\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSDialogSizes } from "./utils";
|
|
3
|
+
const noop = () => {
|
|
4
|
+
};
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
isOpen: false,
|
|
7
|
+
centered: false,
|
|
8
|
+
size: DSDialogSizes.DEFAULT,
|
|
9
|
+
removeAutoFocus: false,
|
|
10
|
+
onClickOutside: noop,
|
|
11
|
+
zIndex: 10
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
defaultProps
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { DSDialogDefaultPropsT } from './DSDialogInternalTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogDefaultPropsT = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n zIndex: 10,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,eAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { describe } from "react-desc";
|
|
3
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import {
|
|
5
|
+
DSDialogBody,
|
|
6
|
+
DSDialogHeader,
|
|
7
|
+
DSDialogFooter,
|
|
8
|
+
DSDialogSeparator,
|
|
9
|
+
DSDialogTitle,
|
|
10
|
+
DSDialogAddon,
|
|
11
|
+
DSDialogDefaultLayout,
|
|
12
|
+
DSDialogPrimaryMessage,
|
|
13
|
+
DSDialogSecondaryMessage
|
|
14
|
+
} from "./styles";
|
|
9
15
|
DSDialogBody.propTypes = globalAttributesPropTypes;
|
|
10
16
|
DSDialogHeader.propTypes = globalAttributesPropTypes;
|
|
11
17
|
DSDialogFooter.propTypes = globalAttributesPropTypes;
|
|
@@ -15,15 +21,15 @@ DSDialogAddon.propTypes = globalAttributesPropTypes;
|
|
|
15
21
|
DSDialogDefaultLayout.propTypes = globalAttributesPropTypes;
|
|
16
22
|
DSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;
|
|
17
23
|
DSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;
|
|
18
|
-
DSDialogBody.displayName =
|
|
19
|
-
DSDialogHeader.displayName =
|
|
20
|
-
DSDialogFooter.displayName =
|
|
21
|
-
DSDialogSeparator.displayName =
|
|
22
|
-
DSDialogTitle.displayName =
|
|
23
|
-
DSDialogAddon.displayName =
|
|
24
|
-
DSDialogDefaultLayout.displayName =
|
|
25
|
-
DSDialogPrimaryMessage.displayName =
|
|
26
|
-
DSDialogSecondaryMessage.displayName =
|
|
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";
|
|
27
33
|
const DSDialogBodyWithSchema = describe(DSDialogBody);
|
|
28
34
|
const DSDialogHeaderWithSchema = describe(DSDialogHeader);
|
|
29
35
|
const DSDialogFooterWithSchema = describe(DSDialogFooter);
|
|
@@ -42,5 +48,28 @@ DSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;
|
|
|
42
48
|
DSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;
|
|
43
49
|
DSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
44
50
|
DSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
45
|
-
|
|
46
|
-
export
|
|
51
|
+
export * from "./DSDialog";
|
|
52
|
+
export * from "./DSDialogDatatestid";
|
|
53
|
+
import { DSDialogSizes } from "./utils";
|
|
54
|
+
export {
|
|
55
|
+
DSDialogAddon,
|
|
56
|
+
DSDialogAddonWithSchema,
|
|
57
|
+
DSDialogBody,
|
|
58
|
+
DSDialogBodyWithSchema,
|
|
59
|
+
DSDialogDefaultLayout,
|
|
60
|
+
DSDialogDefaultLayoutWithSchema,
|
|
61
|
+
DSDialogFooter,
|
|
62
|
+
DSDialogFooterWithSchema,
|
|
63
|
+
DSDialogHeader,
|
|
64
|
+
DSDialogHeaderWithSchema,
|
|
65
|
+
DSDialogPrimaryMessage,
|
|
66
|
+
DSDialogPrimaryMessageWithSchema,
|
|
67
|
+
DSDialogSecondaryMessage,
|
|
68
|
+
DSDialogSecondaryMessageWithSchema,
|
|
69
|
+
DSDialogSeparator,
|
|
70
|
+
DSDialogSeparatorWithSchema,
|
|
71
|
+
DSDialogSizes,
|
|
72
|
+
DSDialogTitle,
|
|
73
|
+
DSDialogTitleWithSchema
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\n\nexport * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,aAAa,YAAY;AACzB,eAAe,YAAY;AAC3B,eAAe,YAAY;AAC3B,kBAAkB,YAAY;AAC9B,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,sBAAsB,YAAY;AAClC,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,aAAa,cAAc;AAC3B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,kBAAkB,cAAc;AAChC,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,sBAAsB,cAAc;AACpC,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AAEvC,MAAM,yBAAyB,SAAS;AACxC,MAAM,2BAA2B,SAAS;AAC1C,MAAM,2BAA2B,SAAS;AAC1C,MAAM,8BAA8B,SAAS;AAC7C,MAAM,0BAA0B,SAAS;AACzC,MAAM,0BAA0B,SAAS;AACzC,MAAM,kCAAkC,SAAS;AACjD,MAAM,mCAAmC,SAAS;AAClD,MAAM,qCAAqC,SAAS;AAEpD,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;AAE/C;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { globalAttributesPropTypes, PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSDialogSizes, DSDialogSizesArrayValues } from "./utils";
|
|
4
|
+
const propTypes = {
|
|
5
|
+
isOpen: PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
6
|
+
children: PropTypes.node.description("Nested components.").isRequired,
|
|
7
|
+
centered: PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
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),
|
|
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(() => {
|
|
10
|
+
}),
|
|
11
|
+
...globalAttributesPropTypes,
|
|
12
|
+
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT)
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
propTypes
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=propTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport { WeakValidationMap } from 'react';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n ...globalAttributesPropTypes,\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AAEA;AAEO,MAAM,YAAY;AAAA,EACvB,QAAQ,UAAU,KAAK,YAAY,sCAAsC,aAAa;AAAA,EACtF,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,iBAAiB,UAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA,KACnB;AAAA,EACH,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { createGlobalStyle } from "@elliemae/ds-system";
|
|
4
|
+
import { space, flexboxes, layout, sizing } from "@xstyled/styled-components";
|
|
5
|
+
import { allSizes } from "./utils";
|
|
6
|
+
const FixedBody = createGlobalStyle`
|
|
7
|
+
body {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
${({ bodyInfo }) => bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const StyledDialogBackground = styled.div`
|
|
14
|
+
position: fixed;
|
|
15
|
+
top: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
background: rgba(37, 41, 47, 50%);
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
z-index: ${({ zIndex }) => zIndex};
|
|
22
|
+
`;
|
|
23
|
+
const StyledDialogContainer = styled.div`
|
|
24
|
+
height: fit-content;
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
margin: ${({ centered }) => centered ? "auto" : "20vh auto auto auto"};
|
|
31
|
+
width: ${({ size }) => allSizes[size]};
|
|
32
|
+
min-width: 300px;
|
|
33
|
+
box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};
|
|
34
|
+
background: ${({ theme }) => theme.colors.neutral["000"]};
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
${space}
|
|
37
|
+
&:focus {
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
const DSDialogTitle = styled.h3`
|
|
42
|
+
font-size: ${({ theme }) => theme.fontSizes.title[700]};
|
|
43
|
+
display: -webkit-box;
|
|
44
|
+
-webkit-line-clamp: 2;
|
|
45
|
+
-webkit-box-orient: vertical;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
margin: 0;
|
|
48
|
+
`;
|
|
49
|
+
const DSDialogAddon = styled.div``;
|
|
50
|
+
const DSDialogHeader = styled.div`
|
|
51
|
+
display: grid;
|
|
52
|
+
align-items: center;
|
|
53
|
+
grid-auto-flow: column;
|
|
54
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
55
|
+
padding: 10px ${({ theme }) => theme.space.xs};
|
|
56
|
+
& ${DSDialogTitle} + ${DSDialogAddon} {
|
|
57
|
+
align-self: flex-start;
|
|
58
|
+
justify-self: flex-end;
|
|
59
|
+
}
|
|
60
|
+
& ${DSDialogAddon}:only-child {
|
|
61
|
+
justify-self: flex-end;
|
|
62
|
+
}
|
|
63
|
+
${space}
|
|
64
|
+
`;
|
|
65
|
+
const DSDialogSeparator = styled.hr.attrs(() => ({ "aria-hidden": true }))`
|
|
66
|
+
margin: 0;
|
|
67
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral["080"]};
|
|
68
|
+
`;
|
|
69
|
+
const DSDialogBody = styled.div`
|
|
70
|
+
padding: ${({ theme }) => theme.space.xs};
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
|
|
73
|
+
${layout}
|
|
74
|
+
${space}
|
|
75
|
+
${flexboxes}
|
|
76
|
+
${sizing}
|
|
77
|
+
`;
|
|
78
|
+
const DSDialogPrimaryMessage = styled.h3`
|
|
79
|
+
margin: 0;
|
|
80
|
+
`;
|
|
81
|
+
const DSDialogSecondaryMessage = styled.p`
|
|
82
|
+
margin: 0;
|
|
83
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
84
|
+
`;
|
|
85
|
+
const DSDialogDefaultLayout = styled.div`
|
|
86
|
+
display: grid;
|
|
87
|
+
grid-auto-flow: row;
|
|
88
|
+
justify-items: center;
|
|
89
|
+
align-items: center;
|
|
90
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
91
|
+
|
|
92
|
+
${DSDialogSecondaryMessage} {
|
|
93
|
+
text-align: center;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
const DSDialogFooter = styled.div`
|
|
97
|
+
display: grid;
|
|
98
|
+
grid-auto-flow: column;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: flex-end;
|
|
101
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
102
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
103
|
+
padding: 0 ${({ theme }) => theme.space.xs};
|
|
104
|
+
${space}
|
|
105
|
+
${flexboxes}
|
|
106
|
+
${sizing}
|
|
107
|
+
`;
|
|
108
|
+
export {
|
|
109
|
+
DSDialogAddon,
|
|
110
|
+
DSDialogBody,
|
|
111
|
+
DSDialogDefaultLayout,
|
|
112
|
+
DSDialogFooter,
|
|
113
|
+
DSDialogHeader,
|
|
114
|
+
DSDialogPrimaryMessage,
|
|
115
|
+
DSDialogSecondaryMessage,
|
|
116
|
+
DSDialogSeparator,
|
|
117
|
+
DSDialogTitle,
|
|
118
|
+
FixedBody,
|
|
119
|
+
StyledDialogBackground,
|
|
120
|
+
StyledDialogContainer
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport type { StyledDialogContainerT, StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';\n\nexport const FixedBody = createGlobalStyle<FixedBodyT>`\n body {\n overflow: hidden;\n \n ${({ bodyInfo }) => (bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.padding} + 15px ) !important;` : ``)}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n z-index: ${({ zIndex }) => zIndex};\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerPropsT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: auto;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n\n ${layout}\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexboxes}\n ${sizing}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAGO,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,eAAgB,SAAS,WAAW,wBAAwB,SAAS,iCAAiC;AAAA;AAAA;AAIxG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,SAAS;AAAA;AAAA,8BAEJ,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA,gBAClD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA,IAEhD;AAAA;AAAA;AAAA;AAAA;AAMG,MAAM,gBAAgB,OAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ7C,MAAM,gBAAgB,OAAO;AAE7B,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA,gBAIrB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA;AAGG,MAAM,oBAAoB,OAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,OAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,OAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAKvB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
|
|
3
|
+
const DSDialogSizes = {
|
|
4
|
+
DEFAULT: "default",
|
|
5
|
+
SMALL: "small",
|
|
6
|
+
MEDIUM: "medium",
|
|
7
|
+
LARGE: "large",
|
|
8
|
+
XLARGE: "x-large",
|
|
9
|
+
XXLARGE: "xx-large"
|
|
10
|
+
};
|
|
11
|
+
const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
|
|
12
|
+
const allSizes = {
|
|
13
|
+
default: "576px",
|
|
14
|
+
small: "320px",
|
|
15
|
+
medium: "656px",
|
|
16
|
+
large: "848px",
|
|
17
|
+
"x-large": "1042px",
|
|
18
|
+
"xx-large": "1440px"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
DSDialogSizes,
|
|
22
|
+
DSDialogSizesArrayValues,
|
|
23
|
+
allSizes,
|
|
24
|
+
getSpaceProps
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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' 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
|
+
"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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
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 };
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
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>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
File without changes
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { DSDialogInternalsT } from './sharedTypes';
|
|
3
|
-
interface FixedBodyT {
|
|
4
|
-
bodyInfo: DSDialogInternalsT.BodyInfoT;
|
|
5
|
-
}
|
|
6
|
-
interface StyledDialogBackgroundT {
|
|
7
|
-
zIndex: number;
|
|
8
|
-
}
|
|
9
|
-
interface StyledDialogContainerT {
|
|
10
|
-
size: DSDialogT.Sizes;
|
|
11
|
-
centered: boolean;
|
|
12
|
-
}
|
|
1
|
+
import type { StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';
|
|
13
2
|
export declare const FixedBody: import("styled-components").GlobalStyleComponent<FixedBodyT, import("styled-components").DefaultTheme>;
|
|
14
3
|
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogBackgroundT, never>;
|
|
15
|
-
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
4
|
+
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, any, never>;
|
|
16
5
|
export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
17
6
|
export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
7
|
export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -24,4 +13,3 @@ export declare const DSDialogPrimaryMessage: import("styled-components").StyledC
|
|
|
24
13
|
export declare const DSDialogSecondaryMessage: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
|
|
25
14
|
export declare const DSDialogDefaultLayout: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
26
15
|
export declare const DSDialogFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
27
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { GetSpaceArgsT } from './DSDialogInternalTypes';
|
|
2
2
|
export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
|
|
3
3
|
export declare const DSDialogSizes: {
|
|
4
4
|
DEFAULT: "default";
|
|
@@ -17,4 +17,3 @@ export declare const allSizes: {
|
|
|
17
17
|
'x-large': string;
|
|
18
18
|
'xx-large': string;
|
|
19
19
|
};
|
|
20
|
-
export {};
|