@elliemae/ds-dialog 2.3.0-next.0 → 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
package/package.json
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./utils": {
|
|
15
|
-
"import": "./esm/utils.js",
|
|
16
|
-
"require": "./cjs/utils.js"
|
|
18
|
+
"import": "./dist/esm/utils.js",
|
|
19
|
+
"require": "./dist/cjs/utils.js"
|
|
17
20
|
},
|
|
18
21
|
"./styles": {
|
|
19
|
-
"import": "./esm/styles.js",
|
|
20
|
-
"require": "./cjs/styles.js"
|
|
21
|
-
},
|
|
22
|
-
"./sharedTypes": {
|
|
23
|
-
"import": "./esm/sharedTypes.js",
|
|
24
|
-
"require": "./cjs/sharedTypes.js"
|
|
22
|
+
"import": "./dist/esm/styles.js",
|
|
23
|
+
"require": "./dist/cjs/styles.js"
|
|
25
24
|
},
|
|
26
25
|
"./propTypes": {
|
|
27
|
-
"import": "./esm/propTypes.js",
|
|
28
|
-
"require": "./cjs/propTypes.js"
|
|
26
|
+
"import": "./dist/esm/propTypes.js",
|
|
27
|
+
"require": "./dist/cjs/propTypes.js"
|
|
28
|
+
},
|
|
29
|
+
"./DSDialogTypes": {
|
|
30
|
+
"import": "./dist/esm/DSDialogTypes.js",
|
|
31
|
+
"require": "./dist/cjs/DSDialogTypes.js"
|
|
32
|
+
},
|
|
33
|
+
"./DSDialogInternalTypes": {
|
|
34
|
+
"import": "./dist/esm/DSDialogInternalTypes.js",
|
|
35
|
+
"require": "./dist/cjs/DSDialogInternalTypes.js"
|
|
29
36
|
},
|
|
30
37
|
"./DSDialogDatatestid": {
|
|
31
|
-
"import": "./esm/DSDialogDatatestid.js",
|
|
32
|
-
"require": "./cjs/DSDialogDatatestid.js"
|
|
38
|
+
"import": "./dist/esm/DSDialogDatatestid.js",
|
|
39
|
+
"require": "./dist/cjs/DSDialogDatatestid.js"
|
|
33
40
|
},
|
|
34
41
|
"./DSDialog": {
|
|
35
|
-
"import": "./esm/DSDialog.js",
|
|
36
|
-
"require": "./cjs/DSDialog.js"
|
|
42
|
+
"import": "./dist/esm/DSDialog.js",
|
|
43
|
+
"require": "./dist/cjs/DSDialog.js"
|
|
37
44
|
},
|
|
38
45
|
"./defaultProps": {
|
|
39
|
-
"import": "./esm/defaultProps.js",
|
|
40
|
-
"require": "./cjs/defaultProps.js"
|
|
46
|
+
"import": "./dist/esm/defaultProps.js",
|
|
47
|
+
"require": "./dist/cjs/defaultProps.js"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
50
|
"sideEffects": [
|
|
@@ -49,20 +56,20 @@
|
|
|
49
56
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
50
57
|
},
|
|
51
58
|
"engines": {
|
|
52
|
-
"
|
|
53
|
-
"node": ">=
|
|
59
|
+
"pnpm": ">=6",
|
|
60
|
+
"node": ">=16"
|
|
54
61
|
},
|
|
55
62
|
"author": "ICE MT",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
63
|
+
"jestSonar": {
|
|
64
|
+
"sonar56x": true,
|
|
65
|
+
"reportPath": "reports",
|
|
66
|
+
"reportFile": "tests.xml",
|
|
67
|
+
"indent": 4
|
|
61
68
|
},
|
|
62
69
|
"dependencies": {
|
|
63
|
-
"@elliemae/ds-props-helpers": "
|
|
64
|
-
"@elliemae/ds-system": "
|
|
65
|
-
"@xstyled/styled-components": "~3.1.
|
|
70
|
+
"@elliemae/ds-props-helpers": "3.0.0-alpha.0",
|
|
71
|
+
"@elliemae/ds-system": "3.0.0-alpha.0",
|
|
72
|
+
"@xstyled/styled-components": "~3.1.2",
|
|
66
73
|
"react-desc": "~4.1.3"
|
|
67
74
|
},
|
|
68
75
|
"devDependencies": {
|
|
@@ -75,7 +82,12 @@
|
|
|
75
82
|
},
|
|
76
83
|
"publishConfig": {
|
|
77
84
|
"access": "public",
|
|
78
|
-
"
|
|
79
|
-
|
|
85
|
+
"typeSafety": false
|
|
86
|
+
},
|
|
87
|
+
"scripts": {
|
|
88
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
89
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
90
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
91
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
80
92
|
}
|
|
81
93
|
}
|
package/cjs/DSDialog.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
-
var ReactDOM = require('react-dom');
|
|
15
|
-
var react = require('react');
|
|
16
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
17
|
-
var styles = require('./styles.js');
|
|
18
|
-
var propTypes = require('./propTypes.js');
|
|
19
|
-
var defaultProps = require('./defaultProps.js');
|
|
20
|
-
var utils = require('./utils.js');
|
|
21
|
-
var DSDialogDatatestid = require('./DSDialogDatatestid.js');
|
|
22
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
23
|
-
|
|
24
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
-
|
|
26
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
27
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
28
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
29
|
-
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
30
|
-
|
|
31
|
-
const _excluded = ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"];
|
|
32
|
-
|
|
33
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
34
|
-
|
|
35
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
36
|
-
|
|
37
|
-
const DSDialog = props => {
|
|
38
|
-
var _FixedBody;
|
|
39
|
-
|
|
40
|
-
const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps.defaultProps);
|
|
41
|
-
const [bodyInfo, setBodyInfo] = react.useState({
|
|
42
|
-
overflow: false,
|
|
43
|
-
padding: '0px'
|
|
44
|
-
});
|
|
45
|
-
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, propTypes.propTypes);
|
|
46
|
-
|
|
47
|
-
const {
|
|
48
|
-
children,
|
|
49
|
-
isOpen,
|
|
50
|
-
onClickOutside,
|
|
51
|
-
onClose,
|
|
52
|
-
centered,
|
|
53
|
-
size,
|
|
54
|
-
removeAutoFocus,
|
|
55
|
-
zIndex
|
|
56
|
-
} = propsWithDefault,
|
|
57
|
-
rest = _objectWithoutProperties__default["default"](propsWithDefault, _excluded);
|
|
58
|
-
|
|
59
|
-
const containerRef = react.useRef(null);
|
|
60
|
-
const handleOutsideClick = react.useCallback(e => {
|
|
61
|
-
if (e.target.dataset.portalbg) onClickOutside();
|
|
62
|
-
}, [onClickOutside]);
|
|
63
|
-
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
|
|
64
|
-
onClick: handleOutsideClick
|
|
65
|
-
});
|
|
66
|
-
const handleOnKeyDown = react.useCallback(e => {
|
|
67
|
-
if (e.key === 'Escape') onClose();
|
|
68
|
-
if (globalAttributes.onKeyDown) globalAttributes.onKeyDown(e);
|
|
69
|
-
}, [globalAttributes, onClose]);
|
|
70
|
-
react.useEffect(() => {
|
|
71
|
-
var _window$getComputedSt;
|
|
72
|
-
|
|
73
|
-
const body = document.getElementsByTagName('body')[0];
|
|
74
|
-
const {
|
|
75
|
-
offsetHeight,
|
|
76
|
-
scrollHeight
|
|
77
|
-
} = body;
|
|
78
|
-
const padding = (_window$getComputedSt = window.getComputedStyle(body, null)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.getPropertyValue('padding-right');
|
|
79
|
-
if (!isOpen) return setBodyInfo({
|
|
80
|
-
overflow: false,
|
|
81
|
-
padding: '0px'
|
|
82
|
-
});
|
|
83
|
-
return setBodyInfo({
|
|
84
|
-
overflow: offsetHeight < scrollHeight,
|
|
85
|
-
padding
|
|
86
|
-
});
|
|
87
|
-
}, [isOpen]);
|
|
88
|
-
react.useEffect(() => {
|
|
89
|
-
var _containerRef$current;
|
|
90
|
-
|
|
91
|
-
if (isOpen && !removeAutoFocus) containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.focus();
|
|
92
|
-
}, [isOpen, removeAutoFocus]);
|
|
93
|
-
|
|
94
|
-
if (isOpen) {
|
|
95
|
-
return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/_jsx__default["default"](styles.StyledDialogBackground, {
|
|
96
|
-
onClick: handleOutsideClick,
|
|
97
|
-
"data-portalbg": true,
|
|
98
|
-
"data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
99
|
-
zIndex: zIndex
|
|
100
|
-
}, void 0, _FixedBody || (_FixedBody = /*#__PURE__*/_jsx__default["default"](styles.FixedBody, {
|
|
101
|
-
bodyInfo: bodyInfo
|
|
102
|
-
})), /*#__PURE__*/jsxRuntime.jsx(styles.StyledDialogContainer, _objectSpread(_objectSpread(_objectSpread({
|
|
103
|
-
role: "dialog",
|
|
104
|
-
"aria-modal": true,
|
|
105
|
-
ref: containerRef,
|
|
106
|
-
tabIndex: !removeAutoFocus ? 0 : undefined
|
|
107
|
-
}, utils.getSpaceProps(rest)), {}, {
|
|
108
|
-
size: size,
|
|
109
|
-
centered: centered,
|
|
110
|
-
"data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER
|
|
111
|
-
}, globalAttributes), {}, {
|
|
112
|
-
onKeyDown: handleOnKeyDown,
|
|
113
|
-
children: children
|
|
114
|
-
}))), document.getElementsByTagName('body')[0]);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return null;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const DSDialogWithSchema = dsPropsHelpers.describe(DSDialog);
|
|
121
|
-
DSDialogWithSchema.propTypes = propTypes.propTypes;
|
|
122
|
-
|
|
123
|
-
exports.DSDialog = DSDialog;
|
|
124
|
-
exports.DSDialogWithSchema = DSDialogWithSchema;
|
package/cjs/defaultProps.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var utils = require('./utils.js');
|
|
6
|
-
|
|
7
|
-
const noop = () => {};
|
|
8
|
-
|
|
9
|
-
const defaultProps = {
|
|
10
|
-
isOpen: false,
|
|
11
|
-
centered: false,
|
|
12
|
-
size: utils.DSDialogSizes.DEFAULT,
|
|
13
|
-
removeAutoFocus: false,
|
|
14
|
-
onClickOutside: noop,
|
|
15
|
-
onClose: noop,
|
|
16
|
-
zIndex: 10
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.defaultProps = defaultProps;
|
package/cjs/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var reactDesc = require('react-desc');
|
|
6
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
7
|
-
var styles = require('./styles.js');
|
|
8
|
-
var DSDialog = require('./DSDialog.js');
|
|
9
|
-
var DSDialogDatatestid = require('./DSDialogDatatestid.js');
|
|
10
|
-
var utils = require('./utils.js');
|
|
11
|
-
|
|
12
|
-
styles.DSDialogBody.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
13
|
-
styles.DSDialogHeader.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
14
|
-
styles.DSDialogFooter.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
15
|
-
styles.DSDialogSeparator.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
16
|
-
styles.DSDialogTitle.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
17
|
-
styles.DSDialogAddon.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
18
|
-
styles.DSDialogDefaultLayout.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
19
|
-
styles.DSDialogPrimaryMessage.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
20
|
-
styles.DSDialogSecondaryMessage.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
21
|
-
styles.DSDialogBody.displayName = 'DSDialogBody';
|
|
22
|
-
styles.DSDialogHeader.displayName = 'DSDialogHeader';
|
|
23
|
-
styles.DSDialogFooter.displayName = 'DSDialogFooter';
|
|
24
|
-
styles.DSDialogSeparator.displayName = 'DSDialogSeparator';
|
|
25
|
-
styles.DSDialogTitle.displayName = 'DSDialogTitle';
|
|
26
|
-
styles.DSDialogAddon.displayName = 'DSDialogAddon';
|
|
27
|
-
styles.DSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';
|
|
28
|
-
styles.DSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';
|
|
29
|
-
styles.DSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';
|
|
30
|
-
const DSDialogBodyWithSchema = reactDesc.describe(styles.DSDialogBody);
|
|
31
|
-
const DSDialogHeaderWithSchema = reactDesc.describe(styles.DSDialogHeader);
|
|
32
|
-
const DSDialogFooterWithSchema = reactDesc.describe(styles.DSDialogFooter);
|
|
33
|
-
const DSDialogSeparatorWithSchema = reactDesc.describe(styles.DSDialogSeparator);
|
|
34
|
-
const DSDialogTitleWithSchema = reactDesc.describe(styles.DSDialogTitle);
|
|
35
|
-
const DSDialogAddonWithSchema = reactDesc.describe(styles.DSDialogAddon);
|
|
36
|
-
const DSDialogDefaultLayoutWithSchema = reactDesc.describe(styles.DSDialogDefaultLayout);
|
|
37
|
-
const DSDialogPrimaryMessageWithSchema = reactDesc.describe(styles.DSDialogPrimaryMessage);
|
|
38
|
-
const DSDialogSecondaryMessageWithSchema = reactDesc.describe(styles.DSDialogSecondaryMessage);
|
|
39
|
-
DSDialogBodyWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
40
|
-
DSDialogHeaderWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
41
|
-
DSDialogFooterWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
42
|
-
DSDialogSeparatorWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
43
|
-
DSDialogTitleWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
44
|
-
DSDialogAddonWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
45
|
-
DSDialogDefaultLayoutWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
46
|
-
DSDialogPrimaryMessageWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
47
|
-
DSDialogSecondaryMessageWithSchema.propTypes = dsPropsHelpers.globalAttributesPropTypes;
|
|
48
|
-
|
|
49
|
-
exports.DSDialogAddon = styles.DSDialogAddon;
|
|
50
|
-
exports.DSDialogBody = styles.DSDialogBody;
|
|
51
|
-
exports.DSDialogDefaultLayout = styles.DSDialogDefaultLayout;
|
|
52
|
-
exports.DSDialogFooter = styles.DSDialogFooter;
|
|
53
|
-
exports.DSDialogHeader = styles.DSDialogHeader;
|
|
54
|
-
exports.DSDialogPrimaryMessage = styles.DSDialogPrimaryMessage;
|
|
55
|
-
exports.DSDialogSecondaryMessage = styles.DSDialogSecondaryMessage;
|
|
56
|
-
exports.DSDialogSeparator = styles.DSDialogSeparator;
|
|
57
|
-
exports.DSDialogTitle = styles.DSDialogTitle;
|
|
58
|
-
exports.DSDialog = DSDialog.DSDialog;
|
|
59
|
-
exports.DSDialogWithSchema = DSDialog.DSDialogWithSchema;
|
|
60
|
-
exports.DSDialogDatatestid = DSDialogDatatestid.DSDialogDatatestid;
|
|
61
|
-
exports.DSDialogSizes = utils.DSDialogSizes;
|
|
62
|
-
exports.DSDialogAddonWithSchema = DSDialogAddonWithSchema;
|
|
63
|
-
exports.DSDialogBodyWithSchema = DSDialogBodyWithSchema;
|
|
64
|
-
exports.DSDialogDefaultLayoutWithSchema = DSDialogDefaultLayoutWithSchema;
|
|
65
|
-
exports.DSDialogFooterWithSchema = DSDialogFooterWithSchema;
|
|
66
|
-
exports.DSDialogHeaderWithSchema = DSDialogHeaderWithSchema;
|
|
67
|
-
exports.DSDialogPrimaryMessageWithSchema = DSDialogPrimaryMessageWithSchema;
|
|
68
|
-
exports.DSDialogSecondaryMessageWithSchema = DSDialogSecondaryMessageWithSchema;
|
|
69
|
-
exports.DSDialogSeparatorWithSchema = DSDialogSeparatorWithSchema;
|
|
70
|
-
exports.DSDialogTitleWithSchema = DSDialogTitleWithSchema;
|
package/cjs/propTypes.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
12
|
-
var utils = require('./utils.js');
|
|
13
|
-
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
-
|
|
16
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
const propTypes = _objectSpread(_objectSpread({
|
|
22
|
-
isOpen: dsPropsHelpers.PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),
|
|
23
|
-
children: dsPropsHelpers.PropTypes.node.description('Nested components.').isRequired,
|
|
24
|
-
centered: dsPropsHelpers.PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
|
|
25
|
-
removeAutoFocus: dsPropsHelpers.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),
|
|
26
|
-
onClickOutside: dsPropsHelpers.PropTypes.func.description('Callback that should be used to close the modal when the user clicks outside.').defaultValue(() => {}),
|
|
27
|
-
onClose: dsPropsHelpers.PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {})
|
|
28
|
-
}, dsPropsHelpers.globalAttributesPropTypes), {}, {
|
|
29
|
-
size: dsPropsHelpers.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT)
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
exports.propTypes = propTypes;
|
package/cjs/sharedTypes.js
DELETED
package/cjs/styles.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
|
-
var styled = require('styled-components');
|
|
7
|
-
var dsSystem = require('@elliemae/ds-system');
|
|
8
|
-
var styledComponents = require('@xstyled/styled-components');
|
|
9
|
-
var utils = require('./utils.js');
|
|
10
|
-
|
|
11
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
-
|
|
13
|
-
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
14
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
|
-
|
|
16
|
-
var _templateObject;
|
|
17
|
-
const FixedBody = dsSystem.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n body {\n overflow: hidden;\n \n ", "\n }\n"])), _ref => {
|
|
18
|
-
let {
|
|
19
|
-
bodyInfo
|
|
20
|
-
} = _ref;
|
|
21
|
-
return bodyInfo.overflow ? "padding-right: calc( ".concat(bodyInfo.padding, " + 15px ) !important;") : "";
|
|
22
|
-
});
|
|
23
|
-
const StyledDialogBackground = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
24
|
-
componentId: "sc-106vqwv-0"
|
|
25
|
-
})(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;z-index:", ";"], _ref2 => {
|
|
26
|
-
let {
|
|
27
|
-
zIndex
|
|
28
|
-
} = _ref2;
|
|
29
|
-
return zIndex;
|
|
30
|
-
});
|
|
31
|
-
const StyledDialogContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
32
|
-
componentId: "sc-106vqwv-1"
|
|
33
|
-
})(["height:fit-content;position:absolute;top:0;bottom:0;left:0;right:0;margin:", ";width:", ";min-width:300px;box-shadow:0 10px 20px 0 ", ";background:", ";overflow-y:auto;", " &:focus{outline:none;}"], _ref3 => {
|
|
34
|
-
let {
|
|
35
|
-
centered
|
|
36
|
-
} = _ref3;
|
|
37
|
-
return centered ? 'auto' : '20vh auto auto auto';
|
|
38
|
-
}, _ref4 => {
|
|
39
|
-
let {
|
|
40
|
-
size
|
|
41
|
-
} = _ref4;
|
|
42
|
-
return utils.allSizes[size];
|
|
43
|
-
}, _ref5 => {
|
|
44
|
-
let {
|
|
45
|
-
theme
|
|
46
|
-
} = _ref5;
|
|
47
|
-
return theme.colors.neutral[500];
|
|
48
|
-
}, _ref6 => {
|
|
49
|
-
let {
|
|
50
|
-
theme
|
|
51
|
-
} = _ref6;
|
|
52
|
-
return theme.colors.neutral['000'];
|
|
53
|
-
}, styledComponents.space);
|
|
54
|
-
const DSDialogTitle = /*#__PURE__*/styled__default["default"].h3.withConfig({
|
|
55
|
-
componentId: "sc-106vqwv-2"
|
|
56
|
-
})(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:28px;margin:0;"], _ref7 => {
|
|
57
|
-
let {
|
|
58
|
-
theme
|
|
59
|
-
} = _ref7;
|
|
60
|
-
return theme.fontSizes.title[700];
|
|
61
|
-
});
|
|
62
|
-
const DSDialogAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
63
|
-
componentId: "sc-106vqwv-3"
|
|
64
|
-
})([""]);
|
|
65
|
-
const DSDialogHeader = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
66
|
-
componentId: "sc-106vqwv-4"
|
|
67
|
-
})(["display:grid;align-items:center;grid-auto-flow:column;min-height:", ";padding:10px ", ";& ", " + ", "{align-self:flex-start;justify-self:flex-end;}& ", ":only-child{justify-self:flex-end;}", " ", ""], _ref8 => {
|
|
68
|
-
let {
|
|
69
|
-
theme
|
|
70
|
-
} = _ref8;
|
|
71
|
-
return theme.space.m;
|
|
72
|
-
}, _ref9 => {
|
|
73
|
-
let {
|
|
74
|
-
theme
|
|
75
|
-
} = _ref9;
|
|
76
|
-
return theme.space.xs;
|
|
77
|
-
}, DSDialogTitle, DSDialogAddon, DSDialogAddon, styledComponents.space, styledComponents.sizing);
|
|
78
|
-
const DSDialogSeparator = /*#__PURE__*/styled__default["default"].hr.attrs(() => ({
|
|
79
|
-
'aria-hidden': true
|
|
80
|
-
})).withConfig({
|
|
81
|
-
componentId: "sc-106vqwv-5"
|
|
82
|
-
})(["margin:0;border-top:1px solid ", ";"], _ref10 => {
|
|
83
|
-
let {
|
|
84
|
-
theme
|
|
85
|
-
} = _ref10;
|
|
86
|
-
return theme.colors.neutral['080'];
|
|
87
|
-
});
|
|
88
|
-
const DSDialogBody = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
89
|
-
componentId: "sc-106vqwv-6"
|
|
90
|
-
})(["padding:", ";overflow-y:auto;", " ", " ", " ", ""], _ref11 => {
|
|
91
|
-
let {
|
|
92
|
-
theme
|
|
93
|
-
} = _ref11;
|
|
94
|
-
return theme.space.xs;
|
|
95
|
-
}, styledComponents.layout, styledComponents.space, styledComponents.flexboxes, styledComponents.sizing);
|
|
96
|
-
const DSDialogPrimaryMessage = /*#__PURE__*/styled__default["default"].h3.withConfig({
|
|
97
|
-
componentId: "sc-106vqwv-7"
|
|
98
|
-
})(["margin:0;"]);
|
|
99
|
-
const DSDialogSecondaryMessage = /*#__PURE__*/styled__default["default"].p.withConfig({
|
|
100
|
-
componentId: "sc-106vqwv-8"
|
|
101
|
-
})(["margin:0;color:", ";"], _ref12 => {
|
|
102
|
-
let {
|
|
103
|
-
theme
|
|
104
|
-
} = _ref12;
|
|
105
|
-
return theme.colors.neutral[500];
|
|
106
|
-
});
|
|
107
|
-
const DSDialogDefaultLayout = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
108
|
-
componentId: "sc-106vqwv-9"
|
|
109
|
-
})(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref13 => {
|
|
110
|
-
let {
|
|
111
|
-
theme
|
|
112
|
-
} = _ref13;
|
|
113
|
-
return theme.space.xxs;
|
|
114
|
-
}, DSDialogSecondaryMessage);
|
|
115
|
-
const DSDialogFooter = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
116
|
-
componentId: "sc-106vqwv-10"
|
|
117
|
-
})(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", " ", ""], _ref14 => {
|
|
118
|
-
let {
|
|
119
|
-
theme
|
|
120
|
-
} = _ref14;
|
|
121
|
-
return theme.space.xxs;
|
|
122
|
-
}, _ref15 => {
|
|
123
|
-
let {
|
|
124
|
-
theme
|
|
125
|
-
} = _ref15;
|
|
126
|
-
return theme.space.m;
|
|
127
|
-
}, _ref16 => {
|
|
128
|
-
let {
|
|
129
|
-
theme
|
|
130
|
-
} = _ref16;
|
|
131
|
-
return theme.space.xs;
|
|
132
|
-
}, styledComponents.space, styledComponents.flexboxes, styledComponents.sizing);
|
|
133
|
-
|
|
134
|
-
exports.DSDialogAddon = DSDialogAddon;
|
|
135
|
-
exports.DSDialogBody = DSDialogBody;
|
|
136
|
-
exports.DSDialogDefaultLayout = DSDialogDefaultLayout;
|
|
137
|
-
exports.DSDialogFooter = DSDialogFooter;
|
|
138
|
-
exports.DSDialogHeader = DSDialogHeader;
|
|
139
|
-
exports.DSDialogPrimaryMessage = DSDialogPrimaryMessage;
|
|
140
|
-
exports.DSDialogSecondaryMessage = DSDialogSecondaryMessage;
|
|
141
|
-
exports.DSDialogSeparator = DSDialogSeparator;
|
|
142
|
-
exports.DSDialogTitle = DSDialogTitle;
|
|
143
|
-
exports.FixedBody = FixedBody;
|
|
144
|
-
exports.StyledDialogBackground = StyledDialogBackground;
|
|
145
|
-
exports.StyledDialogContainer = StyledDialogContainer;
|
package/cjs/utils.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
-
|
|
10
|
-
const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_ref => {
|
|
11
|
-
let [key] = _ref;
|
|
12
|
-
return /^[pm][xytblr]?$/.exec(key);
|
|
13
|
-
}));
|
|
14
|
-
const DSDialogSizes = {
|
|
15
|
-
DEFAULT: 'default',
|
|
16
|
-
SMALL: 'small',
|
|
17
|
-
MEDIUM: 'medium',
|
|
18
|
-
LARGE: 'large',
|
|
19
|
-
XLARGE: 'x-large',
|
|
20
|
-
XXLARGE: 'xx-large'
|
|
21
|
-
};
|
|
22
|
-
const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
|
|
23
|
-
const allSizes = {
|
|
24
|
-
default: '576px',
|
|
25
|
-
small: '320px',
|
|
26
|
-
medium: '656px',
|
|
27
|
-
large: '848px',
|
|
28
|
-
'x-large': '1042px',
|
|
29
|
-
'xx-large': '1440px'
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.DSDialogSizes = DSDialogSizes;
|
|
33
|
-
exports.DSDialogSizesArrayValues = DSDialogSizesArrayValues;
|
|
34
|
-
exports.allSizes = allSizes;
|
|
35
|
-
exports.getSpaceProps = getSpaceProps;
|