@elliemae/ds-dialog 2.2.0-alpha.4 → 3.0.0-next.2

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 CHANGED
@@ -1,94 +1,112 @@
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 DSDialog_exports = {};
29
- __export(DSDialog_exports, {
30
- DSDialog: () => DSDialog,
31
- DSDialogWithSchema: () => DSDialogWithSchema
32
- });
33
- var React = __toESM(require("react"));
34
- var import_react_dom = __toESM(require("react-dom"));
35
- var import_react = __toESM(require("react"));
36
- var import_react_desc = require("react-desc");
37
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
- var import_styles = require("./styles");
39
- var import_propTypes = require("./propTypes");
40
- var import_defaultProps = require("./defaultProps");
41
- var import_utils = require("./utils");
42
- var import_DSDialogDatatestid = require("./DSDialogDatatestid");
43
- const DSDialog = (props) => {
44
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
45
- const [isBodyOverflow, setIsBodyOverflow] = (0, import_react.useState)(false);
46
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_propTypes.propTypes);
47
- const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;
48
- const containerRef = (0, import_react.useRef)(null);
49
- const handleOutsideClick = (0, import_react.useCallback)((e) => {
50
- if (e.target.dataset.portalbg)
51
- onClickOutside();
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 reactDesc = require('react-desc');
17
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
18
+ var styles = require('./styles.js');
19
+ var propTypes = require('./propTypes.js');
20
+ var defaultProps = require('./defaultProps.js');
21
+ var utils = require('./utils.js');
22
+ var DSDialogDatatestid = require('./DSDialogDatatestid.js');
23
+ var jsxRuntime = require('react/jsx-runtime');
24
+
25
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
+
27
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
28
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
29
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
30
+ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
31
+
32
+ const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus", "zIndex"];
33
+
34
+ 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; }
35
+
36
+ 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; }
37
+
38
+ const DSDialog = props => {
39
+ var _FixedBody;
40
+
41
+ const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps.defaultProps);
42
+ const [isBodyOverflow, setIsBodyOverflow] = react.useState(false);
43
+ dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, propTypes.propTypes);
44
+
45
+ const {
46
+ children,
47
+ isOpen,
48
+ onClickOutside,
49
+ centered,
50
+ size,
51
+ removeAutoFocus,
52
+ zIndex
53
+ } = propsWithDefault,
54
+ rest = _objectWithoutProperties__default["default"](propsWithDefault, _excluded);
55
+
56
+ const containerRef = react.useRef(null);
57
+ const handleOutsideClick = react.useCallback(e => {
58
+ if (e.target.dataset.portalbg) onClickOutside();
52
59
  }, [onClickOutside]);
53
- const handleOnKeyDown = (0, import_react.useCallback)((e) => {
54
- if (e.key === "Escape")
55
- onClickOutside();
60
+ const handleOnKeyDown = react.useCallback(e => {
61
+ if (e.key === 'Escape') onClickOutside();
56
62
  }, [onClickOutside]);
57
- (0, import_react.useEffect)(() => {
58
- const body = document.getElementsByTagName("body")[0];
59
- const { offsetHeight, scrollHeight } = body;
60
- if (!isOpen)
61
- return setIsBodyOverflow(false);
63
+ react.useEffect(() => {
64
+ const body = document.getElementsByTagName('body')[0];
65
+ const {
66
+ offsetHeight,
67
+ scrollHeight
68
+ } = body;
69
+ if (!isOpen) return setIsBodyOverflow(false);
62
70
  return setIsBodyOverflow(offsetHeight < scrollHeight);
63
71
  }, [isOpen]);
64
- (0, import_react.useEffect)(() => {
65
- if (isOpen && !removeAutoFocus)
66
- containerRef?.current?.focus();
72
+ react.useEffect(() => {
73
+ var _containerRef$current;
74
+
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();
67
76
  }, [isOpen, removeAutoFocus]);
77
+ const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefault, {
78
+ onClick: handleOutsideClick
79
+ });
80
+
68
81
  if (isOpen) {
69
- return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogBackground, {
82
+ return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/jsxRuntime.jsxs(styles.StyledDialogBackground, _objectSpread(_objectSpread({
70
83
  onClick: handleOutsideClick,
71
84
  "data-portalbg": true,
72
- "data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
73
- zIndex
74
- }, /* @__PURE__ */ import_react.default.createElement(import_styles.FixedBody, {
75
- isBodyOverflow
76
- }), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, {
77
- role: "dialog",
78
- "aria-modal": true,
79
- ref: containerRef,
80
- tabIndex: !removeAutoFocus ? 0 : void 0,
81
- onKeyDown: handleOnKeyDown,
82
- ...(0, import_utils.getSpaceProps)(rest),
83
- size,
84
- centered,
85
- "data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER
86
- }, children)), document.getElementsByTagName("body")[0]);
85
+ "data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
86
+ zIndex: zIndex
87
+ }, globalAttributes), {}, {
88
+ children: [_FixedBody || (_FixedBody = /*#__PURE__*/_jsx__default["default"](styles.FixedBody, {
89
+ isBodyOverflow: isBodyOverflow
90
+ })), /*#__PURE__*/jsxRuntime.jsx(styles.StyledDialogContainer, _objectSpread(_objectSpread({
91
+ role: "dialog",
92
+ "aria-modal": true,
93
+ ref: containerRef,
94
+ tabIndex: !removeAutoFocus ? 0 : undefined,
95
+ onKeyDown: handleOnKeyDown
96
+ }, utils.getSpaceProps(rest)), {}, {
97
+ size: size,
98
+ centered: centered,
99
+ "data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
100
+ children: children
101
+ }))]
102
+ })), document.getElementsByTagName('body')[0]);
87
103
  }
104
+
88
105
  return null;
89
106
  };
90
- DSDialog.propTypes = import_propTypes.propTypes;
91
- const DSDialogWithSchema = (0, import_react_desc.describe)(DSDialog);
92
- DSDialogWithSchema.propTypes = import_propTypes.propTypes;
93
- module.exports = __toCommonJS(DSDialog_exports);
94
- //# sourceMappingURL=DSDialog.js.map
107
+
108
+ const DSDialogWithSchema = reactDesc.describe(DSDialog);
109
+ DSDialogWithSchema.propTypes = propTypes.propTypes;
110
+
111
+ exports.DSDialog = DSDialog;
112
+ exports.DSDialogWithSchema = DSDialogWithSchema;
@@ -1,38 +1,10 @@
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 DSDialogDatatestid_exports = {};
29
- __export(DSDialogDatatestid_exports, {
30
- DSDialogDatatestid: () => DSDialogDatatestid
31
- });
32
- var React = __toESM(require("react"));
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
33
5
  const DSDialogDatatestid = {
34
- CONTAINER: "ds-dialog-container",
35
- BACKGROUND: "ds-dialog-background"
6
+ CONTAINER: 'ds-dialog-container',
7
+ BACKGROUND: 'ds-dialog-background'
36
8
  };
37
- module.exports = __toCommonJS(DSDialogDatatestid_exports);
38
- //# sourceMappingURL=DSDialogDatatestid.js.map
9
+
10
+ exports.DSDialogDatatestid = DSDialogDatatestid;
@@ -1,27 +1,2 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __reExport = (target, module2, copyDefault, desc) => {
9
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
- for (let key of __getOwnPropNames(module2))
11
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
- }
14
- return target;
15
- };
16
- var __toESM = (module2, isNodeMode) => {
17
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
- };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
- var DSDialogInternalTypes_d_exports = {};
25
- var React = __toESM(require("react"));
26
- module.exports = __toCommonJS(DSDialogInternalTypes_d_exports);
27
- //# sourceMappingURL=DSDialogInternalTypes.d.js.map
1
+ 'use strict';
2
+
@@ -1,27 +1,2 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __reExport = (target, module2, copyDefault, desc) => {
9
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
- for (let key of __getOwnPropNames(module2))
11
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
- }
14
- return target;
15
- };
16
- var __toESM = (module2, isNodeMode) => {
17
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
- };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
- var DSDialogTypes_exports = {};
25
- var React = __toESM(require("react"));
26
- module.exports = __toCommonJS(DSDialogTypes_exports);
27
- //# sourceMappingURL=DSDialogTypes.js.map
1
+ 'use strict';
2
+
@@ -1,45 +1,18 @@
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 defaultProps_exports = {};
29
- __export(defaultProps_exports, {
30
- defaultProps: () => defaultProps
31
- });
32
- var React = __toESM(require("react"));
33
- var import_utils = require("./utils");
34
- const noop = () => {
35
- };
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var utils = require('./utils.js');
6
+
7
+ const noop = () => {};
8
+
36
9
  const defaultProps = {
37
10
  isOpen: false,
38
11
  centered: false,
39
- size: import_utils.DSDialogSizes.DEFAULT,
12
+ size: utils.DSDialogSizes.DEFAULT,
40
13
  removeAutoFocus: false,
41
14
  onClickOutside: noop,
42
15
  zIndex: 10
43
16
  };
44
- module.exports = __toCommonJS(defaultProps_exports);
45
- //# sourceMappingURL=defaultProps.js.map
17
+
18
+ exports.defaultProps = defaultProps;
package/cjs/index.js CHANGED
@@ -1,47 +1,70 @@
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 src_exports = {};
29
- __export(src_exports, {
30
- DSDialogAddon: () => import_styles.DSDialogAddon,
31
- DSDialogBody: () => import_styles.DSDialogBody,
32
- DSDialogDefaultLayout: () => import_styles.DSDialogDefaultLayout,
33
- DSDialogFooter: () => import_styles.DSDialogFooter,
34
- DSDialogHeader: () => import_styles.DSDialogHeader,
35
- DSDialogPrimaryMessage: () => import_styles.DSDialogPrimaryMessage,
36
- DSDialogSecondaryMessage: () => import_styles.DSDialogSecondaryMessage,
37
- DSDialogSeparator: () => import_styles.DSDialogSeparator,
38
- DSDialogSizes: () => import_utils.DSDialogSizes,
39
- DSDialogTitle: () => import_styles.DSDialogTitle
40
- });
41
- var React = __toESM(require("react"));
42
- __reExport(src_exports, require("./DSDialog"));
43
- __reExport(src_exports, require("./DSDialogDatatestid"));
44
- var import_utils = require("./utils");
45
- var import_styles = require("./styles");
46
- module.exports = __toCommonJS(src_exports);
47
- //# sourceMappingURL=index.js.map
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 CHANGED
@@ -1,45 +1,31 @@
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 propTypes_exports = {};
29
- __export(propTypes_exports, {
30
- propTypes: () => propTypes
31
- });
32
- var React = __toESM(require("react"));
33
- var import_react_desc = require("react-desc");
34
- var import_utils = require("./utils");
35
- const propTypes = {
36
- isOpen: import_react_desc.PropTypes.bool.description("Wether the Dialog is open or not.").defaultValue(false),
37
- children: import_react_desc.PropTypes.node.description("Nested components.").isRequired,
38
- centered: import_react_desc.PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
39
- size: import_react_desc.PropTypes.oneOf(import_utils.DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(import_utils.DSDialogSizes.DEFAULT),
40
- removeAutoFocus: import_react_desc.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),
41
- onClickOutside: import_react_desc.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(() => {
42
- })
43
- };
44
- module.exports = __toCommonJS(propTypes_exports);
45
- //# sourceMappingURL=propTypes.js.map
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 reactDesc = require('react-desc');
12
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
13
+ var utils = require('./utils.js');
14
+
15
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
+
17
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
18
+
19
+ 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; }
20
+
21
+ 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; }
22
+ const propTypes = _objectSpread({
23
+ isOpen: reactDesc.PropTypes.bool.description('Whether the Dialog is open or not.').defaultValue(false),
24
+ children: reactDesc.PropTypes.node.description('Nested components.').isRequired,
25
+ centered: reactDesc.PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
26
+ size: reactDesc.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT),
27
+ removeAutoFocus: reactDesc.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),
28
+ onClickOutside: reactDesc.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(() => {})
29
+ }, dsPropsHelpers.globalAttributesPropTypes);
30
+
31
+ exports.propTypes = propTypes;