@elliemae/ds-dialog 2.0.0-next.13 → 2.0.0-rc.12

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
@@ -18,6 +18,7 @@ var styles = require('./styles.js');
18
18
  var propTypes = require('./propTypes.js');
19
19
  var defaultProps = require('./defaultProps.js');
20
20
  var utils = require('./utils.js');
21
+ var DSDialogDatatestid = require('./DSDialogDatatestid.js');
21
22
  var jsxRuntime = require('react/jsx-runtime');
22
23
 
23
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -29,7 +30,7 @@ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
29
30
 
30
31
  var _FixedBody;
31
32
 
32
- const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus"];
33
+ const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus", "zIndex"];
33
34
 
34
35
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
35
36
 
@@ -37,7 +38,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
37
38
 
38
39
  const DSDialog = props => {
39
40
  const propsWithDefault = dsPropsHelpers.useMemoMergePropsWithDefault(props, defaultProps.defaultProps);
40
- dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());
41
+ dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefault, propTypes.propTypes);
41
42
 
42
43
  const {
43
44
  children,
@@ -45,7 +46,8 @@ const DSDialog = props => {
45
46
  onClickOutside,
46
47
  centered,
47
48
  size,
48
- removeAutoFocus
49
+ removeAutoFocus,
50
+ zIndex
49
51
  } = propsWithDefault,
50
52
  rest = _objectWithoutProperties__default["default"](propsWithDefault, _excluded);
51
53
 
@@ -65,7 +67,9 @@ const DSDialog = props => {
65
67
  if (isOpen) {
66
68
  return /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/_jsx__default["default"](styles.StyledDialogBackground, {
67
69
  onClick: handleOutsideClick,
68
- "data-portalbg": true
70
+ "data-portalbg": true,
71
+ "data-testid": DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
72
+ zIndex: zIndex
69
73
  }, void 0, _FixedBody || (_FixedBody = /*#__PURE__*/_jsx__default["default"](styles.FixedBody, {})), /*#__PURE__*/jsxRuntime.jsx(styles.StyledDialogContainer, _objectSpread(_objectSpread({
70
74
  role: "dialog",
71
75
  "aria-modal": true,
@@ -75,6 +79,7 @@ const DSDialog = props => {
75
79
  }, utils.getSpaceProps(rest)), {}, {
76
80
  size: size,
77
81
  centered: centered,
82
+ "data-testid": DSDialogDatatestid.DSDialogDatatestid.CONTAINER,
78
83
  children: children
79
84
  }))), document.getElementsByTagName('body')[0]);
80
85
  }
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const DSDialogDatatestid = {
6
+ CONTAINER: 'ds-dialog-container',
7
+ BACKGROUND: 'ds-dialog-background'
8
+ };
9
+
10
+ exports.DSDialogDatatestid = DSDialogDatatestid;
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -2,12 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var utils = require('./utils.js');
6
+
7
+ const noop = () => {};
8
+
5
9
  const defaultProps = {
6
10
  isOpen: false,
7
11
  centered: false,
8
- size: 'default',
12
+ size: utils.DSDialogSizes.DEFAULT,
9
13
  removeAutoFocus: false,
10
- onClickOutside: () => {}
14
+ onClickOutside: noop,
15
+ zIndex: 10
11
16
  };
12
17
 
13
18
  exports.defaultProps = defaultProps;
package/cjs/index.js CHANGED
@@ -3,12 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DSDialog = require('./DSDialog.js');
6
+ var DSDialogDatatestid = require('./DSDialogDatatestid.js');
7
+ var utils = require('./utils.js');
6
8
  var styles = require('./styles.js');
7
9
 
8
10
 
9
11
 
10
12
  exports.DSDialog = DSDialog.DSDialog;
11
13
  exports.DSDialogWithSchema = DSDialog.DSDialogWithSchema;
14
+ exports.DSDialogDatatestid = DSDialogDatatestid.DSDialogDatatestid;
15
+ exports.DSDialogSizes = utils.DSDialogSizes;
12
16
  exports.DSDialogAddon = styles.DSDialogAddon;
13
17
  exports.DSDialogBody = styles.DSDialogBody;
14
18
  exports.DSDialogDefaultLayout = styles.DSDialogDefaultLayout;
package/cjs/propTypes.js CHANGED
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var reactDesc = require('react-desc');
6
+ var utils = require('./utils.js');
6
7
 
7
8
  /* eslint-disable max-len */
8
9
  const propTypes = {
9
10
  isOpen: reactDesc.PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),
10
11
  children: reactDesc.PropTypes.node.description('Nested components.').isRequired,
11
12
  centered: reactDesc.PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
13
+ size: reactDesc.PropTypes.oneOf(utils.DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(utils.DSDialogSizes.DEFAULT),
12
14
  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),
13
15
  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(() => {})
14
16
  };
package/cjs/styles.js CHANGED
@@ -6,6 +6,7 @@ var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiter
6
6
  var styled = require('styled-components');
7
7
  var dsSystem = require('@elliemae/ds-system');
8
8
  var styledSystem = require('styled-system');
9
+ var utils = require('./utils.js');
9
10
 
10
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
12
 
@@ -13,47 +14,44 @@ var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_tagged
13
14
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
14
15
 
15
16
  var _templateObject;
16
- const allSizes = {
17
- default: '576px',
18
- small: '320px',
19
- medium: '656px',
20
- large: '848px',
21
- 'x-large': '1042px',
22
- 'xx-large': '1440px'
23
- };
24
17
  const FixedBody = dsSystem.createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n body {\n overflow: hidden;\n }\n"])));
25
18
  const StyledDialogBackground = /*#__PURE__*/styled__default["default"].div.withConfig({
26
19
  componentId: "sc-106vqwv-0"
27
- })(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;"]);
20
+ })(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;z-index:", ";"], _ref => {
21
+ let {
22
+ zIndex
23
+ } = _ref;
24
+ return zIndex;
25
+ });
28
26
  const StyledDialogContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
29
27
  componentId: "sc-106vqwv-1"
30
- })(["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:scroll;", " &:focus{outline:none;}"], _ref => {
28
+ })(["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;}"], _ref2 => {
31
29
  let {
32
30
  centered
33
- } = _ref;
34
- return centered ? 'auto' : '20vh auto auto auto';
35
- }, _ref2 => {
36
- let {
37
- size
38
31
  } = _ref2;
39
- return allSizes[size];
32
+ return centered ? 'auto' : '20vh auto auto auto';
40
33
  }, _ref3 => {
41
34
  let {
42
- theme
35
+ size
43
36
  } = _ref3;
44
- return theme.colors.neutral[500];
37
+ return utils.allSizes[size];
45
38
  }, _ref4 => {
46
39
  let {
47
40
  theme
48
41
  } = _ref4;
42
+ return theme.colors.neutral[500];
43
+ }, _ref5 => {
44
+ let {
45
+ theme
46
+ } = _ref5;
49
47
  return theme.colors.neutral['000'];
50
48
  }, styledSystem.space);
51
49
  const DSDialogTitle = /*#__PURE__*/styled__default["default"].h3.withConfig({
52
50
  componentId: "sc-106vqwv-2"
53
- })(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref5 => {
51
+ })(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref6 => {
54
52
  let {
55
53
  theme
56
- } = _ref5;
54
+ } = _ref6;
57
55
  return theme.fontSizes.title[700];
58
56
  });
59
57
  const DSDialogAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
@@ -61,33 +59,33 @@ const DSDialogAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
61
59
  })([""]);
62
60
  const DSDialogHeader = /*#__PURE__*/styled__default["default"].div.withConfig({
63
61
  componentId: "sc-106vqwv-4"
64
- })(["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;}", ""], _ref6 => {
62
+ })(["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;}", ""], _ref7 => {
65
63
  let {
66
64
  theme
67
- } = _ref6;
65
+ } = _ref7;
68
66
  return theme.space.m;
69
- }, _ref7 => {
67
+ }, _ref8 => {
70
68
  let {
71
69
  theme
72
- } = _ref7;
70
+ } = _ref8;
73
71
  return theme.space.xs;
74
72
  }, DSDialogTitle, DSDialogAddon, DSDialogAddon, styledSystem.space);
75
73
  const DSDialogSeparator = /*#__PURE__*/styled__default["default"].hr.attrs(() => ({
76
74
  'aria-hidden': true
77
75
  })).withConfig({
78
76
  componentId: "sc-106vqwv-5"
79
- })(["margin:0;border-top:1px solid ", ";"], _ref8 => {
77
+ })(["margin:0;border-top:1px solid ", ";"], _ref9 => {
80
78
  let {
81
79
  theme
82
- } = _ref8;
80
+ } = _ref9;
83
81
  return theme.colors.neutral['080'];
84
82
  });
85
83
  const DSDialogBody = /*#__PURE__*/styled__default["default"].div.withConfig({
86
84
  componentId: "sc-106vqwv-6"
87
- })(["padding:", ";overflow-y:auto;", " ", " ", ""], _ref9 => {
85
+ })(["padding:", ";overflow-y:auto;", " ", " ", ""], _ref10 => {
88
86
  let {
89
87
  theme
90
- } = _ref9;
88
+ } = _ref10;
91
89
  return theme.space.xs;
92
90
  }, styledSystem.layout, styledSystem.space, styledSystem.flexbox);
93
91
  const DSDialogPrimaryMessage = /*#__PURE__*/styled__default["default"].h3.withConfig({
@@ -95,36 +93,36 @@ const DSDialogPrimaryMessage = /*#__PURE__*/styled__default["default"].h3.withCo
95
93
  })(["margin:0;"]);
96
94
  const DSDialogSecondaryMessage = /*#__PURE__*/styled__default["default"].p.withConfig({
97
95
  componentId: "sc-106vqwv-8"
98
- })(["margin:0;color:", ";"], _ref10 => {
96
+ })(["margin:0;color:", ";"], _ref11 => {
99
97
  let {
100
98
  theme
101
- } = _ref10;
99
+ } = _ref11;
102
100
  return theme.colors.neutral[500];
103
101
  });
104
102
  const DSDialogDefaultLayout = /*#__PURE__*/styled__default["default"].div.withConfig({
105
103
  componentId: "sc-106vqwv-9"
106
- })(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref11 => {
104
+ })(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref12 => {
107
105
  let {
108
106
  theme
109
- } = _ref11;
107
+ } = _ref12;
110
108
  return theme.space.xxs;
111
109
  }, DSDialogSecondaryMessage);
112
110
  const DSDialogFooter = /*#__PURE__*/styled__default["default"].div.withConfig({
113
111
  componentId: "sc-106vqwv-10"
114
- })(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""], _ref12 => {
112
+ })(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""], _ref13 => {
115
113
  let {
116
114
  theme
117
- } = _ref12;
115
+ } = _ref13;
118
116
  return theme.space.xxs;
119
- }, _ref13 => {
117
+ }, _ref14 => {
120
118
  let {
121
119
  theme
122
- } = _ref13;
120
+ } = _ref14;
123
121
  return theme.space.m;
124
- }, _ref14 => {
122
+ }, _ref15 => {
125
123
  let {
126
124
  theme
127
- } = _ref14;
125
+ } = _ref15;
128
126
  return theme.space.xs;
129
127
  }, styledSystem.space, styledSystem.flexbox);
130
128
 
package/cjs/utils.js CHANGED
@@ -11,5 +11,25 @@ const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_
11
11
  let [key] = _ref;
12
12
  return /^[pm][xytblr]?$/.exec(key);
13
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
+ };
14
31
 
32
+ exports.DSDialogSizes = DSDialogSizes;
33
+ exports.DSDialogSizesArrayValues = DSDialogSizesArrayValues;
34
+ exports.allSizes = allSizes;
15
35
  exports.getSpaceProps = getSpaceProps;
package/esm/DSDialog.js CHANGED
@@ -14,11 +14,12 @@ import { StyledDialogBackground, FixedBody, StyledDialogContainer } from './styl
14
14
  import { propTypes } from './propTypes.js';
15
15
  import { defaultProps } from './defaultProps.js';
16
16
  import { getSpaceProps } from './utils.js';
17
+ import { DSDialogDatatestid } from './DSDialogDatatestid.js';
17
18
  import { jsx } from 'react/jsx-runtime';
18
19
 
19
20
  var _FixedBody;
20
21
 
21
- const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus"];
22
+ const _excluded = ["children", "isOpen", "onClickOutside", "centered", "size", "removeAutoFocus", "zIndex"];
22
23
 
23
24
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
24
25
 
@@ -26,7 +27,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
26
27
 
27
28
  const DSDialog = props => {
28
29
  const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
29
- useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());
30
+ useValidateTypescriptPropTypes(propsWithDefault, propTypes);
30
31
 
31
32
  const {
32
33
  children,
@@ -34,7 +35,8 @@ const DSDialog = props => {
34
35
  onClickOutside,
35
36
  centered,
36
37
  size,
37
- removeAutoFocus
38
+ removeAutoFocus,
39
+ zIndex
38
40
  } = propsWithDefault,
39
41
  rest = _objectWithoutProperties(propsWithDefault, _excluded);
40
42
 
@@ -54,7 +56,9 @@ const DSDialog = props => {
54
56
  if (isOpen) {
55
57
  return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/_jsx(StyledDialogBackground, {
56
58
  onClick: handleOutsideClick,
57
- "data-portalbg": true
59
+ "data-portalbg": true,
60
+ "data-testid": DSDialogDatatestid.BACKGROUND,
61
+ zIndex: zIndex
58
62
  }, void 0, _FixedBody || (_FixedBody = /*#__PURE__*/_jsx(FixedBody, {})), /*#__PURE__*/jsx(StyledDialogContainer, _objectSpread(_objectSpread({
59
63
  role: "dialog",
60
64
  "aria-modal": true,
@@ -64,6 +68,7 @@ const DSDialog = props => {
64
68
  }, getSpaceProps(rest)), {}, {
65
69
  size: size,
66
70
  centered: centered,
71
+ "data-testid": DSDialogDatatestid.CONTAINER,
67
72
  children: children
68
73
  }))), document.getElementsByTagName('body')[0]);
69
74
  }
@@ -0,0 +1,6 @@
1
+ const DSDialogDatatestid = {
2
+ CONTAINER: 'ds-dialog-container',
3
+ BACKGROUND: 'ds-dialog-background'
4
+ };
5
+
6
+ export { DSDialogDatatestid };
@@ -0,0 +1 @@
1
+
@@ -1,9 +1,14 @@
1
+ import { DSDialogSizes } from './utils.js';
2
+
3
+ const noop = () => {};
4
+
1
5
  const defaultProps = {
2
6
  isOpen: false,
3
7
  centered: false,
4
- size: 'default',
8
+ size: DSDialogSizes.DEFAULT,
5
9
  removeAutoFocus: false,
6
- onClickOutside: () => {}
10
+ onClickOutside: noop,
11
+ zIndex: 10
7
12
  };
8
13
 
9
14
  export { defaultProps };
package/esm/index.js CHANGED
@@ -1,2 +1,4 @@
1
1
  export { DSDialog, DSDialogWithSchema } from './DSDialog.js';
2
+ export { DSDialogDatatestid } from './DSDialogDatatestid.js';
3
+ export { DSDialogSizes } from './utils.js';
2
4
  export { DSDialogAddon, DSDialogBody, DSDialogDefaultLayout, DSDialogFooter, DSDialogHeader, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogSeparator, DSDialogTitle } from './styles.js';
package/esm/propTypes.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { PropTypes } from 'react-desc';
2
+ import { DSDialogSizesArrayValues, DSDialogSizes } from './utils.js';
2
3
 
3
4
  /* eslint-disable max-len */
4
5
  const propTypes = {
5
6
  isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),
6
7
  children: PropTypes.node.description('Nested components.').isRequired,
7
8
  centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),
9
+ size: PropTypes.oneOf(DSDialogSizesArrayValues).description("Dialog's width size.").defaultValue(DSDialogSizes.DEFAULT),
8
10
  removeAutoFocus: PropTypes.bool.description('Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.').defaultValue(false),
9
11
  onClickOutside: PropTypes.func.description('Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.').defaultValue(() => {})
10
12
  };
package/esm/styles.js CHANGED
@@ -2,49 +2,47 @@ import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLit
2
2
  import styled from 'styled-components';
3
3
  import { createGlobalStyle } from '@elliemae/ds-system';
4
4
  import { space, layout, flexbox } from 'styled-system';
5
+ import { allSizes } from './utils.js';
5
6
 
6
7
  var _templateObject;
7
- const allSizes = {
8
- default: '576px',
9
- small: '320px',
10
- medium: '656px',
11
- large: '848px',
12
- 'x-large': '1042px',
13
- 'xx-large': '1440px'
14
- };
15
8
  const FixedBody = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n overflow: hidden;\n }\n"])));
16
9
  const StyledDialogBackground = /*#__PURE__*/styled.div.withConfig({
17
10
  componentId: "sc-106vqwv-0"
18
- })(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;"]);
11
+ })(["position:fixed;top:0;bottom:0;width:100%;height:100%;background:rgba(37,41,47,50%);overflow-y:auto;z-index:", ";"], _ref => {
12
+ let {
13
+ zIndex
14
+ } = _ref;
15
+ return zIndex;
16
+ });
19
17
  const StyledDialogContainer = /*#__PURE__*/styled.div.withConfig({
20
18
  componentId: "sc-106vqwv-1"
21
- })(["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:scroll;", " &:focus{outline:none;}"], _ref => {
19
+ })(["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;}"], _ref2 => {
22
20
  let {
23
21
  centered
24
- } = _ref;
22
+ } = _ref2;
25
23
  return centered ? 'auto' : '20vh auto auto auto';
26
- }, _ref2 => {
24
+ }, _ref3 => {
27
25
  let {
28
26
  size
29
- } = _ref2;
27
+ } = _ref3;
30
28
  return allSizes[size];
31
- }, _ref3 => {
29
+ }, _ref4 => {
32
30
  let {
33
31
  theme
34
- } = _ref3;
32
+ } = _ref4;
35
33
  return theme.colors.neutral[500];
36
- }, _ref4 => {
34
+ }, _ref5 => {
37
35
  let {
38
36
  theme
39
- } = _ref4;
37
+ } = _ref5;
40
38
  return theme.colors.neutral['000'];
41
39
  }, space);
42
40
  const DSDialogTitle = /*#__PURE__*/styled.h3.withConfig({
43
41
  componentId: "sc-106vqwv-2"
44
- })(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref5 => {
42
+ })(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref6 => {
45
43
  let {
46
44
  theme
47
- } = _ref5;
45
+ } = _ref6;
48
46
  return theme.fontSizes.title[700];
49
47
  });
50
48
  const DSDialogAddon = /*#__PURE__*/styled.div.withConfig({
@@ -52,33 +50,33 @@ const DSDialogAddon = /*#__PURE__*/styled.div.withConfig({
52
50
  })([""]);
53
51
  const DSDialogHeader = /*#__PURE__*/styled.div.withConfig({
54
52
  componentId: "sc-106vqwv-4"
55
- })(["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;}", ""], _ref6 => {
53
+ })(["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;}", ""], _ref7 => {
56
54
  let {
57
55
  theme
58
- } = _ref6;
56
+ } = _ref7;
59
57
  return theme.space.m;
60
- }, _ref7 => {
58
+ }, _ref8 => {
61
59
  let {
62
60
  theme
63
- } = _ref7;
61
+ } = _ref8;
64
62
  return theme.space.xs;
65
63
  }, DSDialogTitle, DSDialogAddon, DSDialogAddon, space);
66
64
  const DSDialogSeparator = /*#__PURE__*/styled.hr.attrs(() => ({
67
65
  'aria-hidden': true
68
66
  })).withConfig({
69
67
  componentId: "sc-106vqwv-5"
70
- })(["margin:0;border-top:1px solid ", ";"], _ref8 => {
68
+ })(["margin:0;border-top:1px solid ", ";"], _ref9 => {
71
69
  let {
72
70
  theme
73
- } = _ref8;
71
+ } = _ref9;
74
72
  return theme.colors.neutral['080'];
75
73
  });
76
74
  const DSDialogBody = /*#__PURE__*/styled.div.withConfig({
77
75
  componentId: "sc-106vqwv-6"
78
- })(["padding:", ";overflow-y:auto;", " ", " ", ""], _ref9 => {
76
+ })(["padding:", ";overflow-y:auto;", " ", " ", ""], _ref10 => {
79
77
  let {
80
78
  theme
81
- } = _ref9;
79
+ } = _ref10;
82
80
  return theme.space.xs;
83
81
  }, layout, space, flexbox);
84
82
  const DSDialogPrimaryMessage = /*#__PURE__*/styled.h3.withConfig({
@@ -86,36 +84,36 @@ const DSDialogPrimaryMessage = /*#__PURE__*/styled.h3.withConfig({
86
84
  })(["margin:0;"]);
87
85
  const DSDialogSecondaryMessage = /*#__PURE__*/styled.p.withConfig({
88
86
  componentId: "sc-106vqwv-8"
89
- })(["margin:0;color:", ";"], _ref10 => {
87
+ })(["margin:0;color:", ";"], _ref11 => {
90
88
  let {
91
89
  theme
92
- } = _ref10;
90
+ } = _ref11;
93
91
  return theme.colors.neutral[500];
94
92
  });
95
93
  const DSDialogDefaultLayout = /*#__PURE__*/styled.div.withConfig({
96
94
  componentId: "sc-106vqwv-9"
97
- })(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref11 => {
95
+ })(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref12 => {
98
96
  let {
99
97
  theme
100
- } = _ref11;
98
+ } = _ref12;
101
99
  return theme.space.xxs;
102
100
  }, DSDialogSecondaryMessage);
103
101
  const DSDialogFooter = /*#__PURE__*/styled.div.withConfig({
104
102
  componentId: "sc-106vqwv-10"
105
- })(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""], _ref12 => {
103
+ })(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""], _ref13 => {
106
104
  let {
107
105
  theme
108
- } = _ref12;
106
+ } = _ref13;
109
107
  return theme.space.xxs;
110
- }, _ref13 => {
108
+ }, _ref14 => {
111
109
  let {
112
110
  theme
113
- } = _ref13;
111
+ } = _ref14;
114
112
  return theme.space.m;
115
- }, _ref14 => {
113
+ }, _ref15 => {
116
114
  let {
117
115
  theme
118
- } = _ref14;
116
+ } = _ref15;
119
117
  return theme.space.xs;
120
118
  }, space, flexbox);
121
119
 
package/esm/utils.js CHANGED
@@ -7,5 +7,22 @@ const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_
7
7
  let [key] = _ref;
8
8
  return /^[pm][xytblr]?$/.exec(key);
9
9
  }));
10
+ const DSDialogSizes = {
11
+ DEFAULT: 'default',
12
+ SMALL: 'small',
13
+ MEDIUM: 'medium',
14
+ LARGE: 'large',
15
+ XLARGE: 'x-large',
16
+ XXLARGE: 'xx-large'
17
+ };
18
+ const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
19
+ const allSizes = {
20
+ default: '576px',
21
+ small: '320px',
22
+ medium: '656px',
23
+ large: '848px',
24
+ 'x-large': '1042px',
25
+ 'xx-large': '1440px'
26
+ };
10
27
 
11
- export { getSpaceProps };
28
+ export { DSDialogSizes, DSDialogSizesArrayValues, allSizes, getSpaceProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-dialog",
3
- "version": "2.0.0-next.13",
3
+ "version": "2.0.0-rc.12",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Dialog",
6
6
  "module": "./esm/index.js",
@@ -15,10 +15,6 @@
15
15
  "import": "./esm/utils.js",
16
16
  "require": "./cjs/utils.js"
17
17
  },
18
- "./types": {
19
- "import": "./esm/types/index.d.js",
20
- "require": "./cjs/types/index.d.js"
21
- },
22
18
  "./styles": {
23
19
  "import": "./esm/styles.js",
24
20
  "require": "./cjs/styles.js"
@@ -27,6 +23,18 @@
27
23
  "import": "./esm/propTypes.js",
28
24
  "require": "./cjs/propTypes.js"
29
25
  },
26
+ "./DSDialogTypes": {
27
+ "import": "./esm/DSDialogTypes.js",
28
+ "require": "./cjs/DSDialogTypes.js"
29
+ },
30
+ "./DSDialogInternalTypes.d": {
31
+ "import": "./esm/DSDialogInternalTypes.d.js",
32
+ "require": "./cjs/DSDialogInternalTypes.d.js"
33
+ },
34
+ "./DSDialogDatatestid": {
35
+ "import": "./esm/DSDialogDatatestid.js",
36
+ "require": "./cjs/DSDialogDatatestid.js"
37
+ },
30
38
  "./DSDialog": {
31
39
  "import": "./esm/DSDialog.js",
32
40
  "require": "./cjs/DSDialog.js"
@@ -56,8 +64,8 @@
56
64
  "build": "node ../../scripts/build/build.js"
57
65
  },
58
66
  "dependencies": {
59
- "@elliemae/ds-props-helpers": "2.0.0-next.13",
60
- "@elliemae/ds-system": "2.0.0-next.13",
67
+ "@elliemae/ds-props-helpers": "2.0.0-rc.12",
68
+ "@elliemae/ds-system": "2.0.0-rc.12",
61
69
  "react-desc": "~4.1.3",
62
70
  "styled-system": "~5.1.5"
63
71
  },
@@ -1,14 +1,30 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
1
2
  import React from 'react';
2
- import type { DSDialogPropsT } from './types/index.d';
3
+ import type { DSDialogPropsT } from './DSDialogTypes';
3
4
  declare const DSDialog: {
4
5
  (props: DSDialogPropsT): React.ReactNode;
5
6
  propTypes: {
6
- isOpen: any;
7
- children: any;
8
- centered: any;
9
- removeAutoFocus: any;
10
- onClickOutside: any;
7
+ isOpen: {
8
+ deprecated: import("react-desc").PropTypesDescValidator;
9
+ };
10
+ children: import("react-desc").PropTypesDescValidator;
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
+ };
11
23
  };
12
24
  };
13
- declare const DSDialogWithSchema: any;
25
+ declare const DSDialogWithSchema: {
26
+ (props?: DSDialogPropsT | undefined): JSX.Element;
27
+ propTypes: unknown;
28
+ toTypescript: () => import("react-desc").TypescriptSchema;
29
+ };
14
30
  export { DSDialog, DSDialogWithSchema };
@@ -0,0 +1,4 @@
1
+ export declare const DSDialogDatatestid: {
2
+ CONTAINER: string;
3
+ BACKGROUND: string;
4
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ export declare type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
3
+ export interface DSDialogPropsT {
4
+ isOpen?: boolean;
5
+ children: React.ReactNode;
6
+ onClickOutside?: () => void;
7
+ size?: Sizes;
8
+ centered?: boolean;
9
+ removeAutoFocus?: boolean;
10
+ }
@@ -1,2 +1,2 @@
1
- import type { DSDialogPropsT } from './types/index.d';
2
- export declare const defaultProps: Partial<DSDialogPropsT>;
1
+ import type { DSDialogDefaultPropsT } from './DSDialogInternalTypes';
2
+ export declare const defaultProps: DSDialogDefaultPropsT;
package/types/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './DSDialog';
2
+ export * from './DSDialogDatatestid';
3
+ export { DSDialogSizes } from './utils';
2
4
  export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, } from './styles';
@@ -1,7 +1,19 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
1
2
  export declare const propTypes: {
2
- isOpen: any;
3
- children: any;
4
- centered: any;
5
- removeAutoFocus: any;
6
- onClickOutside: any;
3
+ isOpen: {
4
+ deprecated: import("react-desc").PropTypesDescValidator;
5
+ };
6
+ children: import("react-desc").PropTypesDescValidator;
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
+ };
7
19
  };
package/types/styles.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import type { StyledDialogContainerT } from './types/index.d';
1
+ import type { StyledDialogContainerT } from './DSDialogInternalTypes';
2
2
  export declare const FixedBody: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
3
- export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", any, StyledDialogContainerT, never>;
5
- export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", any, {}, never>;
6
- export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", any, {}, never>;
7
- export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const DSDialogSeparator: import("styled-components").StyledComponent<"hr", any, {
3
+ export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogContainerT, never>;
5
+ export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
6
+ export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
+ export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
+ export declare const DSDialogSeparator: import("styled-components").StyledComponent<"hr", import("styled-components").DefaultTheme, {
9
9
  'aria-hidden': true;
10
10
  }, "aria-hidden">;
11
- export declare const DSDialogBody: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const DSDialogPrimaryMessage: import("styled-components").StyledComponent<"h3", any, {}, never>;
13
- export declare const DSDialogSecondaryMessage: import("styled-components").StyledComponent<"p", any, {}, never>;
14
- export declare const DSDialogDefaultLayout: import("styled-components").StyledComponent<"div", any, {}, never>;
15
- export declare const DSDialogFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const DSDialogBody: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
12
+ export declare const DSDialogPrimaryMessage: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
13
+ export declare const DSDialogSecondaryMessage: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
14
+ export declare const DSDialogDefaultLayout: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
+ export declare const DSDialogFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
package/types/utils.d.ts CHANGED
@@ -1,2 +1,19 @@
1
- import type { GetSpaceArgsT } from './types/index.d';
1
+ import type { GetSpaceArgsT } from './DSDialogInternalTypes';
2
2
  export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
3
+ export declare const DSDialogSizes: {
4
+ readonly DEFAULT: "default";
5
+ readonly SMALL: "small";
6
+ readonly MEDIUM: "medium";
7
+ readonly LARGE: "large";
8
+ readonly XLARGE: "x-large";
9
+ readonly XXLARGE: "xx-large";
10
+ };
11
+ export declare const DSDialogSizesArrayValues: ("default" | "small" | "medium" | "large" | "x-large" | "xx-large")[];
12
+ export declare const allSizes: {
13
+ default: string;
14
+ small: string;
15
+ medium: string;
16
+ large: string;
17
+ 'x-large': string;
18
+ 'xx-large': string;
19
+ };
@@ -1,16 +0,0 @@
1
- /// <reference types="react" />
2
- export declare type sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
3
- export interface DSDialogPropsT {
4
- isOpen?: boolean;
5
- children: React.ReactNode;
6
- onClickOutside?: () => void;
7
- size?: sizes;
8
- centered?: boolean;
9
- removeAutoFocus?: boolean;
10
- }
11
- export interface StyledDialogContainerT {
12
- size?: sizes;
13
- centered?: boolean;
14
- }
15
- export declare type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;
16
- export declare type GetSpaceArgsT = Partial<Record<string, string | number>>;