@elliemae/ds-dialog 2.2.1 → 2.2.2-rc.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/cjs/DSDialog.js +21 -17
- package/cjs/index.js +52 -6
- package/cjs/propTypes.js +23 -10
- package/esm/DSDialog.js +22 -18
- package/esm/index.js +43 -1
- package/esm/propTypes.js +15 -6
- package/package.json +3 -3
- package/types/DSDialog.d.ts +2 -27
- package/types/DSDialogInternalTypes.d.ts +4 -4
- package/types/index.d.ts +49 -1
- package/types/propTypes.d.ts +2 -19
- package/types/styles.d.ts +4 -4
- package/types/utils.d.ts +6 -6
package/cjs/DSDialog.js
CHANGED
|
@@ -13,7 +13,6 @@ require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
|
13
13
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
14
|
var ReactDOM = require('react-dom');
|
|
15
15
|
var react = require('react');
|
|
16
|
-
var reactDesc = require('react-desc');
|
|
17
16
|
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
18
17
|
var styles = require('./styles.js');
|
|
19
18
|
var propTypes = require('./propTypes.js');
|
|
@@ -86,33 +85,38 @@ const DSDialog = props => {
|
|
|
86
85
|
|
|
87
86
|
if (isOpen && !removeAutoFocus) containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.focus();
|
|
88
87
|
}, [isOpen, removeAutoFocus]);
|
|
88
|
+
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
|
|
89
|
+
onClick: handleOutsideClick
|
|
90
|
+
});
|
|
89
91
|
|
|
90
92
|
if (isOpen) {
|
|
91
|
-
return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/
|
|
93
|
+
return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/jsxRuntime.jsxs(styles.StyledDialogBackground, _objectSpread(_objectSpread({
|
|
92
94
|
onClick: handleOutsideClick,
|
|
93
95
|
"data-portalbg": true,
|
|
94
96
|
"data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
|
|
95
97
|
zIndex: zIndex
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
}, globalAttributes), {}, {
|
|
99
|
+
children: [_FixedBody || (_FixedBody = /*#__PURE__*/_jsx__default["default"](styles.FixedBody, {
|
|
100
|
+
bodyInfo: bodyInfo
|
|
101
|
+
})), /*#__PURE__*/jsxRuntime.jsx(styles.StyledDialogContainer, _objectSpread(_objectSpread({
|
|
102
|
+
role: "dialog",
|
|
103
|
+
"aria-modal": true,
|
|
104
|
+
ref: containerRef,
|
|
105
|
+
tabIndex: !removeAutoFocus ? 0 : undefined,
|
|
106
|
+
onKeyDown: handleOnKeyDown
|
|
107
|
+
}, utils.getSpaceProps(rest)), {}, {
|
|
108
|
+
size: size,
|
|
109
|
+
centered: centered,
|
|
110
|
+
"data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
|
|
111
|
+
children: children
|
|
112
|
+
}))]
|
|
113
|
+
})), document.getElementsByTagName('body')[0]);
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
return null;
|
|
113
117
|
};
|
|
114
118
|
|
|
115
|
-
const DSDialogWithSchema =
|
|
119
|
+
const DSDialogWithSchema = dsPropsHelpers.describe(DSDialog);
|
|
116
120
|
DSDialogWithSchema.propTypes = propTypes.propTypes;
|
|
117
121
|
|
|
118
122
|
exports.DSDialog = DSDialog;
|
package/cjs/index.js
CHANGED
|
@@ -2,17 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
7
|
+
var styles = require('./styles.js');
|
|
5
8
|
var DSDialog = require('./DSDialog.js');
|
|
6
9
|
var DSDialogDatatestid = require('./DSDialogDatatestid.js');
|
|
7
10
|
var utils = require('./utils.js');
|
|
8
|
-
var styles = require('./styles.js');
|
|
9
|
-
|
|
10
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;
|
|
11
48
|
|
|
12
|
-
exports.DSDialog = DSDialog.DSDialog;
|
|
13
|
-
exports.DSDialogWithSchema = DSDialog.DSDialogWithSchema;
|
|
14
|
-
exports.DSDialogDatatestid = DSDialogDatatestid.DSDialogDatatestid;
|
|
15
|
-
exports.DSDialogSizes = utils.DSDialogSizes;
|
|
16
49
|
exports.DSDialogAddon = styles.DSDialogAddon;
|
|
17
50
|
exports.DSDialogBody = styles.DSDialogBody;
|
|
18
51
|
exports.DSDialogDefaultLayout = styles.DSDialogDefaultLayout;
|
|
@@ -22,3 +55,16 @@ exports.DSDialogPrimaryMessage = styles.DSDialogPrimaryMessage;
|
|
|
22
55
|
exports.DSDialogSecondaryMessage = styles.DSDialogSecondaryMessage;
|
|
23
56
|
exports.DSDialogSeparator = styles.DSDialogSeparator;
|
|
24
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
CHANGED
|
@@ -2,17 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
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');
|
|
6
12
|
var utils = require('./utils.js');
|
|
7
13
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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. Cb also triggers when the user press ESC key for accessibility purposes.').defaultValue(() => {})
|
|
27
|
+
}, dsPropsHelpers.globalAttributesPropTypes), {}, {
|
|
28
|
+
size: dsPropsHelpers.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT)
|
|
29
|
+
});
|
|
17
30
|
|
|
18
31
|
exports.propTypes = propTypes;
|
package/esm/DSDialog.js
CHANGED
|
@@ -9,14 +9,13 @@ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
9
9
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
12
|
-
import { describe } from '
|
|
13
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
|
|
12
|
+
import { describe, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
14
13
|
import { StyledDialogBackground, FixedBody, StyledDialogContainer } from './styles.js';
|
|
15
14
|
import { propTypes } from './propTypes.js';
|
|
16
15
|
import { defaultProps } from './defaultProps.js';
|
|
17
16
|
import { getSpaceProps } from './utils.js';
|
|
18
17
|
import { DSDialogDatatestid } from './DSDialogDatatestid.js';
|
|
19
|
-
import { jsx } from 'react/jsx-runtime';
|
|
18
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
20
19
|
|
|
21
20
|
const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus", "zIndex"];
|
|
22
21
|
|
|
@@ -75,27 +74,32 @@ const DSDialog = props => {
|
|
|
75
74
|
|
|
76
75
|
if (isOpen && !removeAutoFocus) containerRef === null || containerRef === void 0 ? void 0 : (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.focus();
|
|
77
76
|
}, [isOpen, removeAutoFocus]);
|
|
77
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefault, {
|
|
78
|
+
onClick: handleOutsideClick
|
|
79
|
+
});
|
|
78
80
|
|
|
79
81
|
if (isOpen) {
|
|
80
|
-
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/jsxs(StyledDialogBackground, _objectSpread(_objectSpread({
|
|
81
83
|
onClick: handleOutsideClick,
|
|
82
84
|
"data-portalbg": true,
|
|
83
85
|
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
84
86
|
zIndex: zIndex
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
87
|
+
}, globalAttributes), {}, {
|
|
88
|
+
children: [_FixedBody || (_FixedBody = /*#__PURE__*/_jsx(FixedBody, {
|
|
89
|
+
bodyInfo: bodyInfo
|
|
90
|
+
})), /*#__PURE__*/jsx(StyledDialogContainer, _objectSpread(_objectSpread({
|
|
91
|
+
role: "dialog",
|
|
92
|
+
"aria-modal": true,
|
|
93
|
+
ref: containerRef,
|
|
94
|
+
tabIndex: !removeAutoFocus ? 0 : undefined,
|
|
95
|
+
onKeyDown: handleOnKeyDown
|
|
96
|
+
}, getSpaceProps(rest)), {}, {
|
|
97
|
+
size: size,
|
|
98
|
+
centered: centered,
|
|
99
|
+
"data-testid": DSDialogDatatestid.CONTAINER,
|
|
100
|
+
children: children
|
|
101
|
+
}))]
|
|
102
|
+
})), document.getElementsByTagName('body')[0]);
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
return null;
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,46 @@
|
|
|
1
|
+
import { describe } from 'react-desc';
|
|
2
|
+
import { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
|
|
3
|
+
import { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage } from './styles.js';
|
|
4
|
+
export { DSDialogAddon, DSDialogBody, DSDialogDefaultLayout, DSDialogFooter, DSDialogHeader, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogSeparator, DSDialogTitle } from './styles.js';
|
|
1
5
|
export { DSDialog, DSDialogWithSchema } from './DSDialog.js';
|
|
2
6
|
export { DSDialogDatatestid } from './DSDialogDatatestid.js';
|
|
3
7
|
export { DSDialogSizes } from './utils.js';
|
|
4
|
-
|
|
8
|
+
|
|
9
|
+
DSDialogBody.propTypes = globalAttributesPropTypes;
|
|
10
|
+
DSDialogHeader.propTypes = globalAttributesPropTypes;
|
|
11
|
+
DSDialogFooter.propTypes = globalAttributesPropTypes;
|
|
12
|
+
DSDialogSeparator.propTypes = globalAttributesPropTypes;
|
|
13
|
+
DSDialogTitle.propTypes = globalAttributesPropTypes;
|
|
14
|
+
DSDialogAddon.propTypes = globalAttributesPropTypes;
|
|
15
|
+
DSDialogDefaultLayout.propTypes = globalAttributesPropTypes;
|
|
16
|
+
DSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;
|
|
17
|
+
DSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;
|
|
18
|
+
DSDialogBody.displayName = 'DSDialogBody';
|
|
19
|
+
DSDialogHeader.displayName = 'DSDialogHeader';
|
|
20
|
+
DSDialogFooter.displayName = 'DSDialogFooter';
|
|
21
|
+
DSDialogSeparator.displayName = 'DSDialogSeparator';
|
|
22
|
+
DSDialogTitle.displayName = 'DSDialogTitle';
|
|
23
|
+
DSDialogAddon.displayName = 'DSDialogAddon';
|
|
24
|
+
DSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';
|
|
25
|
+
DSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';
|
|
26
|
+
DSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';
|
|
27
|
+
const DSDialogBodyWithSchema = describe(DSDialogBody);
|
|
28
|
+
const DSDialogHeaderWithSchema = describe(DSDialogHeader);
|
|
29
|
+
const DSDialogFooterWithSchema = describe(DSDialogFooter);
|
|
30
|
+
const DSDialogSeparatorWithSchema = describe(DSDialogSeparator);
|
|
31
|
+
const DSDialogTitleWithSchema = describe(DSDialogTitle);
|
|
32
|
+
const DSDialogAddonWithSchema = describe(DSDialogAddon);
|
|
33
|
+
const DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);
|
|
34
|
+
const DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);
|
|
35
|
+
const DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);
|
|
36
|
+
DSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;
|
|
37
|
+
DSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;
|
|
38
|
+
DSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;
|
|
39
|
+
DSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;
|
|
40
|
+
DSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;
|
|
41
|
+
DSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;
|
|
42
|
+
DSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;
|
|
43
|
+
DSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
44
|
+
DSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
45
|
+
|
|
46
|
+
export { DSDialogAddonWithSchema, DSDialogBodyWithSchema, DSDialogDefaultLayoutWithSchema, DSDialogFooterWithSchema, DSDialogHeaderWithSchema, DSDialogPrimaryMessageWithSchema, DSDialogSecondaryMessageWithSchema, DSDialogSeparatorWithSchema, DSDialogTitleWithSchema };
|
package/esm/propTypes.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
|
|
2
8
|
import { DSDialogSizesArrayValues, DSDialogSizes } from './utils.js';
|
|
3
9
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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(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; }
|
|
13
|
+
const propTypes = _objectSpread(_objectSpread({
|
|
14
|
+
isOpen: PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),
|
|
7
15
|
children: PropTypes.node.description('Nested components.').isRequired,
|
|
8
16
|
centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
|
|
9
|
-
size: PropTypes.oneOf(DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(DSDialogSizes.DEFAULT),
|
|
10
17
|
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),
|
|
11
18
|
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(() => {})
|
|
12
|
-
}
|
|
19
|
+
}, globalAttributesPropTypes), {}, {
|
|
20
|
+
size: PropTypes.oneOf(DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(DSDialogSizes.DEFAULT)
|
|
21
|
+
});
|
|
13
22
|
|
|
14
23
|
export { propTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"build": "node ../../scripts/build/build.js"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@elliemae/ds-props-helpers": "2.2.
|
|
68
|
-
"@elliemae/ds-system": "2.2.
|
|
67
|
+
"@elliemae/ds-props-helpers": "2.2.2-rc.0",
|
|
68
|
+
"@elliemae/ds-system": "2.2.2-rc.0",
|
|
69
69
|
"@xstyled/styled-components": "~3.1.1",
|
|
70
70
|
"react-desc": "~4.1.3"
|
|
71
71
|
},
|
package/types/DSDialog.d.ts
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import type { DSDialogPropsT } from './DSDialogTypes';
|
|
4
|
-
declare const DSDialog:
|
|
5
|
-
|
|
6
|
-
propTypes: {
|
|
7
|
-
isOpen: {
|
|
8
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
9
|
-
};
|
|
10
|
-
children: import("react-desc").PropTypesDescValue;
|
|
11
|
-
centered: {
|
|
12
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
13
|
-
};
|
|
14
|
-
size: {
|
|
15
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
16
|
-
};
|
|
17
|
-
removeAutoFocus: {
|
|
18
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
-
};
|
|
20
|
-
onClickOutside: {
|
|
21
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
declare const DSDialogWithSchema: {
|
|
26
|
-
(props?: unknown): JSX.Element;
|
|
27
|
-
propTypes: unknown;
|
|
28
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
29
|
-
};
|
|
3
|
+
declare const DSDialog: React.ComponentType<DSDialogPropsT>;
|
|
4
|
+
declare const DSDialogWithSchema: import("@elliemae/ds-props-helpers/types/propTypes/types").DocumentedReactComponent<DSDialogPropsT>;
|
|
30
5
|
export { DSDialog, DSDialogWithSchema };
|
|
@@ -15,11 +15,11 @@ export interface StyledDialogContainerPropsT {
|
|
|
15
15
|
size: Sizes;
|
|
16
16
|
centered: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
19
|
-
bodyInfo: BodyInfoT;
|
|
20
|
-
}
|
|
21
|
-
export interface StyledDialogBackgroundPropsT {
|
|
18
|
+
export interface StyledDialogBackgroundT {
|
|
22
19
|
zIndex: number;
|
|
23
20
|
}
|
|
21
|
+
export interface FixedBodyT {
|
|
22
|
+
isBodyOverflow: boolean;
|
|
23
|
+
}
|
|
24
24
|
export declare type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;
|
|
25
25
|
export declare type GetSpaceArgsT = Partial<Record<string, string | number>>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,52 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage } from './styles';
|
|
4
|
+
declare const DSDialogBodyWithSchema: {
|
|
5
|
+
(props?: unknown): JSX.Element;
|
|
6
|
+
propTypes: unknown;
|
|
7
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
8
|
+
};
|
|
9
|
+
declare const DSDialogHeaderWithSchema: {
|
|
10
|
+
(props?: unknown): JSX.Element;
|
|
11
|
+
propTypes: unknown;
|
|
12
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
13
|
+
};
|
|
14
|
+
declare const DSDialogFooterWithSchema: {
|
|
15
|
+
(props?: unknown): JSX.Element;
|
|
16
|
+
propTypes: unknown;
|
|
17
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
18
|
+
};
|
|
19
|
+
declare const DSDialogSeparatorWithSchema: {
|
|
20
|
+
(props?: unknown): JSX.Element;
|
|
21
|
+
propTypes: unknown;
|
|
22
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
23
|
+
};
|
|
24
|
+
declare const DSDialogTitleWithSchema: {
|
|
25
|
+
(props?: unknown): JSX.Element;
|
|
26
|
+
propTypes: unknown;
|
|
27
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
28
|
+
};
|
|
29
|
+
declare const DSDialogAddonWithSchema: {
|
|
30
|
+
(props?: unknown): JSX.Element;
|
|
31
|
+
propTypes: unknown;
|
|
32
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
33
|
+
};
|
|
34
|
+
declare const DSDialogDefaultLayoutWithSchema: {
|
|
35
|
+
(props?: unknown): JSX.Element;
|
|
36
|
+
propTypes: unknown;
|
|
37
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
38
|
+
};
|
|
39
|
+
declare const DSDialogPrimaryMessageWithSchema: {
|
|
40
|
+
(props?: unknown): JSX.Element;
|
|
41
|
+
propTypes: unknown;
|
|
42
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
43
|
+
};
|
|
44
|
+
declare const DSDialogSecondaryMessageWithSchema: {
|
|
45
|
+
(props?: unknown): JSX.Element;
|
|
46
|
+
propTypes: unknown;
|
|
47
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
48
|
+
};
|
|
1
49
|
export * from './DSDialog';
|
|
2
50
|
export * from './DSDialogDatatestid';
|
|
3
51
|
export { DSDialogSizes } from './utils';
|
|
4
|
-
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage,
|
|
52
|
+
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogBodyWithSchema, DSDialogHeaderWithSchema, DSDialogFooterWithSchema, DSDialogSeparatorWithSchema, DSDialogTitleWithSchema, DSDialogAddonWithSchema, DSDialogDefaultLayoutWithSchema, DSDialogPrimaryMessageWithSchema, DSDialogSecondaryMessageWithSchema, };
|
package/types/propTypes.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const propTypes:
|
|
3
|
-
isOpen: {
|
|
4
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
5
|
-
};
|
|
6
|
-
children: import("react-desc").PropTypesDescValue;
|
|
7
|
-
centered: {
|
|
8
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
9
|
-
};
|
|
10
|
-
size: {
|
|
11
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
12
|
-
};
|
|
13
|
-
removeAutoFocus: {
|
|
14
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
15
|
-
};
|
|
16
|
-
onClickOutside: {
|
|
17
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
1
|
+
import { WeakValidationMap } from 'react';
|
|
2
|
+
export declare const propTypes: WeakValidationMap<unknown>;
|
package/types/styles.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const FixedBody: import("styled-components").GlobalStyleComponent<
|
|
3
|
-
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
4
|
-
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
1
|
+
import type { StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';
|
|
2
|
+
export declare const FixedBody: import("styled-components").GlobalStyleComponent<FixedBodyT, import("styled-components").DefaultTheme>;
|
|
3
|
+
export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogBackgroundT, never>;
|
|
4
|
+
export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, any, never>;
|
|
5
5
|
export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
|
|
6
6
|
export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
7
|
export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
package/types/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { GetSpaceArgsT } from './DSDialogInternalTypes';
|
|
2
2
|
export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
|
|
3
3
|
export declare const DSDialogSizes: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
DEFAULT: "default";
|
|
5
|
+
SMALL: "small";
|
|
6
|
+
MEDIUM: "medium";
|
|
7
|
+
LARGE: "large";
|
|
8
|
+
XLARGE: "x-large";
|
|
9
|
+
XXLARGE: "xx-large";
|
|
10
10
|
};
|
|
11
11
|
export declare const DSDialogSizesArrayValues: ("default" | "small" | "medium" | "large" | "x-large" | "xx-large")[];
|
|
12
12
|
export declare const allSizes: {
|