@elliemae/ds-dialog 1.61.5 → 2.0.0-alpha.14
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 +47 -33
- package/cjs/DSDialogDatatestid.js +10 -0
- package/cjs/DSDialogInternalTypes.d.js +2 -0
- package/cjs/DSDialogTypes.js +2 -0
- package/cjs/defaultProps.js +8 -4
- package/cjs/index.js +4 -15
- package/cjs/propTypes.js +4 -3
- package/cjs/styles.js +78 -55
- package/cjs/utils.js +27 -13
- package/esm/DSDialog.js +45 -31
- package/esm/DSDialogDatatestid.js +6 -0
- package/esm/DSDialogInternalTypes.d.js +1 -0
- package/esm/DSDialogTypes.js +1 -0
- package/esm/defaultProps.js +8 -4
- package/esm/index.js +2 -15
- package/esm/propTypes.js +4 -3
- package/esm/styles.js +77 -54
- package/esm/utils.js +25 -10
- package/package.json +61 -11
- package/types/DSDialog.d.ts +30 -0
- package/types/DSDialogDatatestid.d.ts +4 -0
- package/types/DSDialogTypes.d.ts +10 -0
- package/types/defaultProps.d.ts +2 -0
- package/types/index.d.ts +4 -0
- package/types/propTypes.d.ts +19 -0
- package/types/styles.d.ts +15 -0
- package/types/utils.d.ts +19 -0
- package/DSDialog/package.json +0 -10
- package/cjs/DSDialog.js.map +0 -1
- package/cjs/defaultProps.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/cjs/styles.js.map +0 -1
- package/cjs/types/index.d.js +0 -3
- package/cjs/types/index.d.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/defaultProps/package.json +0 -10
- package/esm/DSDialog.js.map +0 -1
- package/esm/defaultProps.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/esm/styles.js.map +0 -1
- package/esm/types/index.d.js +0 -2
- package/esm/types/index.d.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/propTypes/package.json +0 -10
- package/styles/package.json +0 -10
- package/types/package.json +0 -10
- package/utils/package.json +0 -10
package/esm/propTypes.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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
|
-
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(
|
|
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
|
};
|
|
11
13
|
|
|
12
14
|
export { propTypes };
|
|
13
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/styles.js
CHANGED
|
@@ -2,96 +2,119 @@ 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
|
-
|
|
8
|
-
|
|
9
|
-
small: '320px',
|
|
10
|
-
medium: '656px',
|
|
11
|
-
large: '848px',
|
|
12
|
-
'x-large': '1042px',
|
|
13
|
-
'xx-large': '1440px'
|
|
14
|
-
};
|
|
15
|
-
var FixedBody = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n overflow: hidden;\n }\n"])));
|
|
16
|
-
var StyledDialogBackground = /*#__PURE__*/styled.div.withConfig({
|
|
8
|
+
const FixedBody = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n body {\n overflow: hidden;\n }\n"])));
|
|
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;"]
|
|
19
|
-
|
|
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
|
+
});
|
|
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:
|
|
22
|
-
|
|
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 => {
|
|
20
|
+
let {
|
|
21
|
+
centered
|
|
22
|
+
} = _ref2;
|
|
23
23
|
return centered ? 'auto' : '20vh auto auto auto';
|
|
24
|
-
},
|
|
25
|
-
|
|
24
|
+
}, _ref3 => {
|
|
25
|
+
let {
|
|
26
|
+
size
|
|
27
|
+
} = _ref3;
|
|
26
28
|
return allSizes[size];
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
+
}, _ref4 => {
|
|
30
|
+
let {
|
|
31
|
+
theme
|
|
32
|
+
} = _ref4;
|
|
29
33
|
return theme.colors.neutral[500];
|
|
30
|
-
},
|
|
31
|
-
|
|
34
|
+
}, _ref5 => {
|
|
35
|
+
let {
|
|
36
|
+
theme
|
|
37
|
+
} = _ref5;
|
|
32
38
|
return theme.colors.neutral['000'];
|
|
33
39
|
}, space);
|
|
34
|
-
|
|
40
|
+
const DSDialogTitle = /*#__PURE__*/styled.h3.withConfig({
|
|
35
41
|
componentId: "sc-106vqwv-2"
|
|
36
|
-
})(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"],
|
|
37
|
-
|
|
42
|
+
})(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref6 => {
|
|
43
|
+
let {
|
|
44
|
+
theme
|
|
45
|
+
} = _ref6;
|
|
38
46
|
return theme.fontSizes.title[700];
|
|
39
47
|
});
|
|
40
|
-
|
|
48
|
+
const DSDialogAddon = /*#__PURE__*/styled.div.withConfig({
|
|
41
49
|
componentId: "sc-106vqwv-3"
|
|
42
50
|
})([""]);
|
|
43
|
-
|
|
51
|
+
const DSDialogHeader = /*#__PURE__*/styled.div.withConfig({
|
|
44
52
|
componentId: "sc-106vqwv-4"
|
|
45
|
-
})(["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;}", ""],
|
|
46
|
-
|
|
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 => {
|
|
54
|
+
let {
|
|
55
|
+
theme
|
|
56
|
+
} = _ref7;
|
|
47
57
|
return theme.space.m;
|
|
48
|
-
},
|
|
49
|
-
|
|
58
|
+
}, _ref8 => {
|
|
59
|
+
let {
|
|
60
|
+
theme
|
|
61
|
+
} = _ref8;
|
|
50
62
|
return theme.space.xs;
|
|
51
63
|
}, DSDialogTitle, DSDialogAddon, DSDialogAddon, space);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
}).withConfig({
|
|
64
|
+
const DSDialogSeparator = /*#__PURE__*/styled.hr.attrs(() => ({
|
|
65
|
+
'aria-hidden': true
|
|
66
|
+
})).withConfig({
|
|
57
67
|
componentId: "sc-106vqwv-5"
|
|
58
|
-
})(["margin:0;border-top:1px solid ", ";"],
|
|
59
|
-
|
|
68
|
+
})(["margin:0;border-top:1px solid ", ";"], _ref9 => {
|
|
69
|
+
let {
|
|
70
|
+
theme
|
|
71
|
+
} = _ref9;
|
|
60
72
|
return theme.colors.neutral['080'];
|
|
61
73
|
});
|
|
62
|
-
|
|
74
|
+
const DSDialogBody = /*#__PURE__*/styled.div.withConfig({
|
|
63
75
|
componentId: "sc-106vqwv-6"
|
|
64
|
-
})(["padding:", ";overflow-y:auto;", " ", " ", ""],
|
|
65
|
-
|
|
76
|
+
})(["padding:", ";overflow-y:auto;", " ", " ", ""], _ref10 => {
|
|
77
|
+
let {
|
|
78
|
+
theme
|
|
79
|
+
} = _ref10;
|
|
66
80
|
return theme.space.xs;
|
|
67
81
|
}, layout, space, flexbox);
|
|
68
|
-
|
|
82
|
+
const DSDialogPrimaryMessage = /*#__PURE__*/styled.h3.withConfig({
|
|
69
83
|
componentId: "sc-106vqwv-7"
|
|
70
84
|
})(["margin:0;"]);
|
|
71
|
-
|
|
85
|
+
const DSDialogSecondaryMessage = /*#__PURE__*/styled.p.withConfig({
|
|
72
86
|
componentId: "sc-106vqwv-8"
|
|
73
|
-
})(["margin:0;color:", ";"],
|
|
74
|
-
|
|
87
|
+
})(["margin:0;color:", ";"], _ref11 => {
|
|
88
|
+
let {
|
|
89
|
+
theme
|
|
90
|
+
} = _ref11;
|
|
75
91
|
return theme.colors.neutral[500];
|
|
76
92
|
});
|
|
77
|
-
|
|
93
|
+
const DSDialogDefaultLayout = /*#__PURE__*/styled.div.withConfig({
|
|
78
94
|
componentId: "sc-106vqwv-9"
|
|
79
|
-
})(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"],
|
|
80
|
-
|
|
95
|
+
})(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref12 => {
|
|
96
|
+
let {
|
|
97
|
+
theme
|
|
98
|
+
} = _ref12;
|
|
81
99
|
return theme.space.xxs;
|
|
82
100
|
}, DSDialogSecondaryMessage);
|
|
83
|
-
|
|
101
|
+
const DSDialogFooter = /*#__PURE__*/styled.div.withConfig({
|
|
84
102
|
componentId: "sc-106vqwv-10"
|
|
85
|
-
})(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""],
|
|
86
|
-
|
|
103
|
+
})(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", ""], _ref13 => {
|
|
104
|
+
let {
|
|
105
|
+
theme
|
|
106
|
+
} = _ref13;
|
|
87
107
|
return theme.space.xxs;
|
|
88
|
-
},
|
|
89
|
-
|
|
108
|
+
}, _ref14 => {
|
|
109
|
+
let {
|
|
110
|
+
theme
|
|
111
|
+
} = _ref14;
|
|
90
112
|
return theme.space.m;
|
|
91
|
-
},
|
|
92
|
-
|
|
113
|
+
}, _ref15 => {
|
|
114
|
+
let {
|
|
115
|
+
theme
|
|
116
|
+
} = _ref15;
|
|
93
117
|
return theme.space.xs;
|
|
94
118
|
}, space, flexbox);
|
|
95
119
|
|
|
96
120
|
export { DSDialogAddon, DSDialogBody, DSDialogDefaultLayout, DSDialogFooter, DSDialogHeader, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogSeparator, DSDialogTitle, FixedBody, StyledDialogBackground, StyledDialogContainer };
|
|
97
|
-
//# sourceMappingURL=styles.js.map
|
package/esm/utils.js
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
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/web.dom-collections.iterator.js';
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_ref => {
|
|
7
|
+
let [key] = _ref;
|
|
8
|
+
return /^[pm][xytblr]?$/.exec(key);
|
|
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'
|
|
10
26
|
};
|
|
11
27
|
|
|
12
|
-
export { getSpaceProps };
|
|
13
|
-
//# sourceMappingURL=utils.js.map
|
|
28
|
+
export { DSDialogSizes, DSDialogSizesArrayValues, allSizes, getSpaceProps };
|
package/package.json
CHANGED
|
@@ -1,14 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.14",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"description": "ICE MT - Dimsum - Dialog",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./utils": {
|
|
15
|
+
"import": "./esm/utils.js",
|
|
16
|
+
"require": "./cjs/utils.js"
|
|
17
|
+
},
|
|
18
|
+
"./styles": {
|
|
19
|
+
"import": "./esm/styles.js",
|
|
20
|
+
"require": "./cjs/styles.js"
|
|
21
|
+
},
|
|
22
|
+
"./propTypes": {
|
|
23
|
+
"import": "./esm/propTypes.js",
|
|
24
|
+
"require": "./cjs/propTypes.js"
|
|
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
|
+
},
|
|
38
|
+
"./DSDialog": {
|
|
39
|
+
"import": "./esm/DSDialog.js",
|
|
40
|
+
"require": "./cjs/DSDialog.js"
|
|
41
|
+
},
|
|
42
|
+
"./defaultProps": {
|
|
43
|
+
"import": "./esm/defaultProps.js",
|
|
44
|
+
"require": "./cjs/defaultProps.js"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
8
47
|
"sideEffects": [
|
|
9
48
|
"*.css",
|
|
10
49
|
"*.scss"
|
|
11
50
|
],
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"npm": ">=7",
|
|
57
|
+
"node": ">=14"
|
|
58
|
+
},
|
|
59
|
+
"author": "ICE MT",
|
|
12
60
|
"scripts": {
|
|
13
61
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
62
|
"prebuild": "exit 0",
|
|
@@ -16,20 +64,22 @@
|
|
|
16
64
|
"build": "node ../../scripts/build/build.js"
|
|
17
65
|
},
|
|
18
66
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-props-helpers": "
|
|
20
|
-
"@elliemae/ds-system": "
|
|
67
|
+
"@elliemae/ds-props-helpers": "2.0.0-alpha.14",
|
|
68
|
+
"@elliemae/ds-system": "2.0.0-alpha.14",
|
|
69
|
+
"react-desc": "~4.1.3",
|
|
21
70
|
"styled-system": "~5.1.5"
|
|
22
71
|
},
|
|
23
72
|
"devDependencies": {
|
|
24
|
-
"styled-components": "~5.3.
|
|
73
|
+
"styled-components": "~5.3.3"
|
|
25
74
|
},
|
|
26
75
|
"peerDependencies": {
|
|
27
|
-
"react": "
|
|
28
|
-
"react-dom": "^17.0.
|
|
29
|
-
"styled-components": "^5.3.
|
|
76
|
+
"react": "^17.0.2",
|
|
77
|
+
"react-dom": "^17.0.2",
|
|
78
|
+
"styled-components": "^5.3.3"
|
|
30
79
|
},
|
|
31
80
|
"publishConfig": {
|
|
32
81
|
"access": "public",
|
|
33
|
-
"directory": "dist"
|
|
82
|
+
"directory": "dist",
|
|
83
|
+
"generateSubmodules": true
|
|
34
84
|
}
|
|
35
85
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { DSDialogPropsT } from './DSDialogTypes';
|
|
4
|
+
declare const DSDialog: {
|
|
5
|
+
(props: DSDialogPropsT): React.ReactNode;
|
|
6
|
+
propTypes: {
|
|
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
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
declare const DSDialogWithSchema: {
|
|
26
|
+
(props?: DSDialogPropsT | undefined): JSX.Element;
|
|
27
|
+
propTypes: unknown;
|
|
28
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
29
|
+
};
|
|
30
|
+
export { DSDialog, DSDialogWithSchema };
|
|
@@ -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
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './DSDialog';
|
|
2
|
+
export * from './DSDialogDatatestid';
|
|
3
|
+
export { DSDialogSizes } from './utils';
|
|
4
|
+
export { DSDialogBody, DSDialogHeader, DSDialogFooter, DSDialogSeparator, DSDialogTitle, DSDialogAddon, DSDialogDefaultLayout, DSDialogPrimaryMessage, DSDialogSecondaryMessage, } from './styles';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
export declare const propTypes: {
|
|
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
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StyledDialogContainerT } from './DSDialogInternalTypes';
|
|
2
|
+
export declare const FixedBody: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
|
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
|
+
'aria-hidden': true;
|
|
10
|
+
}, "aria-hidden">;
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GetSpaceArgsT } from './DSDialogInternalTypes';
|
|
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
|
+
};
|
package/DSDialog/package.json
DELETED
package/cjs/DSDialog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","ReactDOM","createPortal","React","StyledDialogBackground","FixedBody","StyledDialogContainer","undefined","getSpaceProps","document","getElementsByTagName","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAA4C;AAC3D,MAAMC,gBAAgB,GAAGC,2CAA4B,CAACF,KAAD,EAAQG,yBAAR,CAArD;AAEAC,EAAAA,6CAA8B,CAACH,gBAAD,EAAmBI,kBAAkB,CAACC,YAAnB,EAAnB,CAA9B;;AACA,MAAQC,QAAR,GAAuFN,gBAAvF,CAAQM,QAAR;AAAA,MAAkBC,MAAlB,GAAuFP,gBAAvF,CAAkBO,MAAlB;AAAA,MAA0BC,cAA1B,GAAuFR,gBAAvF,CAA0BQ,cAA1B;AAAA,MAA0CC,QAA1C,GAAuFT,gBAAvF,CAA0CS,QAA1C;AAAA,MAAoDC,IAApD,GAAuFV,gBAAvF,CAAoDU,IAApD;AAAA,MAA0DC,eAA1D,GAAuFX,gBAAvF,CAA0DW,eAA1D;AAAA,MAA8EC,IAA9E,gDAAuFZ,gBAAvF;;AAEA,MAAMa,YAAY,GAAGC,YAAM,CAAwB,IAAxB,CAA3B;AAEA,MAAMC,kBAAkB,GAAGC,iBAAW,CACpC,UAACC,CAAD,EAAO;AACL,QAAIA,CAAC,CAACC,MAAF,CAASC,OAAT,CAAiBC,QAArB,EAA+BZ,cAAc;AAC9C,GAHmC,EAIpC,CAACA,cAAD,CAJoC,CAAtC;AAOA,MAAMa,eAAe,GAAGL,iBAAW,CACjC,UAACC,CAAD,EAAO;AACL,QAAIA,CAAC,CAACK,GAAF,KAAU,QAAd,EAAwBd,cAAc;AACvC,GAHgC,EAIjC,CAACA,cAAD,CAJiC,CAAnC;AAOAe,EAAAA,eAAS,CAAC,YAAM;AAAA;;AACd,QAAIhB,MAAM,IAAI,CAACI,eAAf,EAAgCE,YAAY,SAAZ,IAAAA,YAAY,WAAZ,qCAAAA,YAAY,CAAEW,OAAd,gFAAuBC,KAAvB;AACjC,GAFQ,EAEN,CAAClB,MAAD,EAASI,eAAT,CAFM,CAAT;;AAIA,MAAIJ,MAAJ,EAAY;AACV,wBAAOmB,4BAAQ,CAACC,YAAT,eACLC,wCAACC,6BAAD;AAAwB,MAAA,OAAO,EAAEd,kBAAjC;AAAqD;AAArD,oBACEa,wCAACE,gBAAD,OADF,eAEEF,wCAACG,4BAAD;AACE,MAAA,IAAI,EAAC,QADP;AAEE,wBAFF;AAGE,MAAA,GAAG,EAAElB,YAHP;AAIE,MAAA,QAAQ,EAAE,CAACF,eAAD,GAAmB,CAAnB,GAAuBqB,SAJnC;AAKE,MAAA,SAAS,EAAEX;AALb,OAMMY,mBAAa,CAACrB,IAAD,CANnB;AAOE,MAAA,IAAI,EAAEF,IAPR;AAQE,MAAA,QAAQ,EAAED;AARZ,QAUGH,QAVH,CAFF,CADK,EAgBL4B,QAAQ,CAACC,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAhBK,CAAP;AAkBD;;AAED,SAAO,IAAP;AACD;;AAEDrC,QAAQ,CAACsC,SAAT,GAAqBA,mBAArB;IAEMhC,kBAAkB,GAAGiC,kBAAQ,CAACvC,QAAD;AACnCM,kBAAkB,CAACgC,SAAnB,GAA+BA,mBAA/B;;;;;"}
|
package/cjs/defaultProps.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":";;;;IAEaA,YAAqC,GAAG;AACnDC,EAAAA,MAAM,EAAE,KAD2C;AAEnDC,EAAAA,QAAQ,EAAE,KAFyC;AAGnDC,EAAAA,IAAI,EAAE,SAH6C;AAInDC,EAAAA,eAAe,EAAE,KAJkC;AAKnDC,EAAAA,cAAc,EAAE,0BAAM;AAL6B;;;;"}
|
package/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/propTypes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;;;;;AAAA;IAGaA,SAAS,GAAG;AACvBC,EAAAA,MAAM,EAAEC,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,mCAA3B,EAAgEC,YAAhE,CAA6E,KAA7E,CADe;AAEvBC,EAAAA,QAAQ,EAAEJ,mBAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,oBAA3B,EAAiDI,UAFpC;AAGvBC,EAAAA,QAAQ,EAAEP,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,qBAA3B,EAAkDC,YAAlD,CAA+D,KAA/D,CAHa;AAIvBK,EAAAA,eAAe,EAAER,mBAAS,CAACC,IAAV,CACdC,WADc,CAEb,uIAFa,EAIdC,YAJc,CAID,KAJC,CAJM;AASvBM,EAAAA,cAAc,EAAET,mBAAS,CAACU,IAAV,CACbR,WADa,CAEZ,wJAFY,EAIbC,YAJa,CAIA,YAAM,EAJN;AATO;;;;"}
|
package/cjs/styles.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;;;;;;;;;;AAKA,IAAMA,QAAQ,GAAG;AACfC,EAAAA,OAAO,EAAE,OADM;AAEfC,EAAAA,KAAK,EAAE,OAFQ;AAGfC,EAAAA,MAAM,EAAE,OAHO;AAIfC,EAAAA,KAAK,EAAE,OAJQ;AAKf,aAAW,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,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/cjs/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;;;;;;;;;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;AAAA,SAC3BC,MAAM,CAACC,WAAP,CAAmBD,MAAM,CAACE,OAAP,CAAeH,KAAf,EAAsBI,MAAtB,CAA6B;AAAA;AAAA,QAAEC,GAAF;;AAAA,WAAW,kBAAkBC,IAAlB,CAAuBD,GAAvB,CAAX;AAAA,GAA7B,CAAnB,CAD2B;AAAA;;;;"}
|
package/esm/DSDialog.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSDialog.js","sources":["../../src/DSDialog.tsx"],"sourcesContent":["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect } from 'react';\nimport { describe } from 'react-desc';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSDialogPropsT, DSDialogPropsWithDefaultT } from './types/index.d';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\n\nconst DSDialog = (props: DSDialogPropsT): React.ReactNode => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n\n useValidateTypescriptPropTypes(propsWithDefault, DSDialogWithSchema.toTypescript());\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const handleOutsideClick = useCallback(\n (e) => {\n if (e.target.dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e) => {\n if (e.key === 'Escape') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground onClick={handleOutsideClick} data-portalbg>\n <FixedBody />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n onKeyDown={handleOnKeyDown}\n {...getSpaceProps(rest)}\n size={size}\n centered={centered}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nDSDialog.propTypes = propTypes;\n\nconst DSDialogWithSchema = describe(DSDialog);\nDSDialogWithSchema.propTypes = propTypes;\n\nexport { DSDialog, DSDialogWithSchema };\n"],"names":["DSDialog","props","propsWithDefault","useMemoMergePropsWithDefault","defaultProps","useValidateTypescriptPropTypes","DSDialogWithSchema","toTypescript","children","isOpen","onClickOutside","centered","size","removeAutoFocus","rest","containerRef","useRef","handleOutsideClick","useCallback","e","target","dataset","portalbg","handleOnKeyDown","key","useEffect","current","focus","ReactDOM","createPortal","undefined","getSpaceProps","document","getElementsByTagName","propTypes","describe"],"mappings":";;;;;;;;;;;;;;;;;;IAUMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAA4C;AAC3D,MAAMC,gBAAgB,GAAGC,4BAA4B,CAACF,KAAD,EAAQG,YAAR,CAArD;AAEAC,EAAAA,8BAA8B,CAACH,gBAAD,EAAmBI,kBAAkB,CAACC,YAAnB,EAAnB,CAA9B;;AACA,MAAQC,QAAR,GAAuFN,gBAAvF,CAAQM,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AAuBiB,SAJnC;AAKE,MAAA,SAAS,EAAEP;AALb,OAMMQ,aAAa,CAACjB,IAAD,CANnB;AAOE,MAAA,IAAI,EAAEF,IAPR;AAQE,MAAA,QAAQ,EAAED;AARZ,QAUGH,QAVH,CAFF,CADK,EAgBLwB,QAAQ,CAACC,oBAAT,CAA8B,MAA9B,EAAsC,CAAtC,CAhBK,CAAP;AAkBD;;AAED,SAAO,IAAP;AACD;;AAEDjC,QAAQ,CAACkC,SAAT,GAAqBA,SAArB;IAEM5B,kBAAkB,GAAG6B,QAAQ,CAACnC,QAAD;AACnCM,kBAAkB,CAAC4B,SAAnB,GAA+BA,SAA/B;;;;"}
|
package/esm/defaultProps.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultProps.js","sources":["../../src/defaultProps.tsx"],"sourcesContent":["import type { DSDialogPropsT } from './types/index.d';\n\nexport const defaultProps: Partial<DSDialogPropsT> = {\n isOpen: false,\n centered: false,\n size: 'default',\n removeAutoFocus: false,\n onClickOutside: () => {},\n};\n"],"names":["defaultProps","isOpen","centered","size","removeAutoFocus","onClickOutside"],"mappings":"IAEaA,YAAqC,GAAG;AACnDC,EAAAA,MAAM,EAAE,KAD2C;AAEnDC,EAAAA,QAAQ,EAAE,KAFyC;AAGnDC,EAAAA,IAAI,EAAE,SAH6C;AAInDC,EAAAA,eAAe,EAAE,KAJkC;AAKnDC,EAAAA,cAAc,EAAE,0BAAM;AAL6B;;;;"}
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/esm/propTypes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n isOpen: PropTypes.bool.description('Wether the Dialog is open or not.').defaultValue(false),\n children: PropTypes.node.description('Nested components.').isRequired,\n centered: PropTypes.bool.description('Centers the Dialog.').defaultValue(false),\n removeAutoFocus: PropTypes.bool\n .description(\n 'Removes focus in the Dialog container when is open. If you want to focus an specific element in the Dialog, it should be set to true.',\n )\n .defaultValue(false),\n onClickOutside: PropTypes.func\n .description(\n 'Callback that should be used to close the modal when the user clicks outside. Cb also triggers when the user press ESC key for accessibility purposes.',\n )\n .defaultValue(() => {}),\n};\n"],"names":["propTypes","isOpen","PropTypes","bool","description","defaultValue","children","node","isRequired","centered","removeAutoFocus","onClickOutside","func"],"mappings":";;AAAA;IAGaA,SAAS,GAAG;AACvBC,EAAAA,MAAM,EAAEC,SAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,mCAA3B,EAAgEC,YAAhE,CAA6E,KAA7E,CADe;AAEvBC,EAAAA,QAAQ,EAAEJ,SAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,oBAA3B,EAAiDI,UAFpC;AAGvBC,EAAAA,QAAQ,EAAEP,SAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,qBAA3B,EAAkDC,YAAlD,CAA+D,KAA/D,CAHa;AAIvBK,EAAAA,eAAe,EAAER,SAAS,CAACC,IAAV,CACdC,WADc,CAEb,uIAFa,EAIdC,YAJc,CAID,KAJC,CAJM;AASvBM,EAAAA,cAAc,EAAET,SAAS,CAACU,IAAV,CACbR,WADa,CAEZ,wJAFY,EAIbC,YAJa,CAIA,YAAM,EAJN;AATO;;;;"}
|
package/esm/styles.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../src/styles.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexbox, layout } from 'styled-system';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nconst allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n }\n`;\n\nexport const StyledDialogBackground = styled.div`\n position: fixed;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n background: rgba(37, 41, 47, 50%);\n overflow-y: auto;\n`;\n\nexport const StyledDialogContainer = styled.div<StyledDialogContainerT>`\n height: fit-content;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: ${({ centered }) => (centered ? 'auto' : '20vh auto auto auto')};\n width: ${({ size }) => allSizes[size]};\n min-width: 300px;\n box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};\n background: ${({ theme }) => theme.colors.neutral['000']};\n overflow-y: scroll;\n ${space}\n &:focus {\n outline: none;\n }\n`;\n\nexport const DSDialogTitle = styled.h3`\n font-size: ${({ theme }) => theme.fontSizes.title[700]};\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n margin: 0;\n`;\n\nexport const DSDialogAddon = styled.div``;\n\nexport const DSDialogHeader = styled.div`\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n min-height: ${({ theme }) => theme.space.m};\n padding: 10px ${({ theme }) => theme.space.xs};\n & ${DSDialogTitle} + ${DSDialogAddon} {\n align-self: flex-start;\n justify-self: flex-end;\n }\n & ${DSDialogAddon}:only-child {\n justify-self: flex-end;\n }\n ${space}\n`;\n\nexport const DSDialogSeparator = styled.hr.attrs(() => ({ 'aria-hidden': true }))`\n margin: 0;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral['080']};\n`;\n\nexport const DSDialogBody = styled.div`\n padding: ${({ theme }) => theme.space.xs};\n overflow-y: auto;\n ${layout}\n ${space}\n ${flexbox}\n`;\n\nexport const DSDialogPrimaryMessage = styled.h3`\n margin: 0;\n`;\n\nexport const DSDialogSecondaryMessage = styled.p`\n margin: 0;\n color: ${({ theme }) => theme.colors.neutral[500]};\n`;\n\nexport const DSDialogDefaultLayout = styled.div`\n display: grid;\n grid-auto-flow: row;\n justify-items: center;\n align-items: center;\n grid-gap: ${({ theme }) => theme.space.xxs};\n\n ${DSDialogSecondaryMessage} {\n text-align: center;\n }\n`;\n\nexport const DSDialogFooter = styled.div`\n display: grid;\n grid-auto-flow: column;\n align-items: center;\n justify-content: flex-end;\n grid-gap: ${({ theme }) => theme.space.xxs};\n min-height: ${({ theme }) => theme.space.m};\n padding: 0 ${({ theme }) => theme.space.xs};\n ${space}\n ${flexbox}\n`;\n"],"names":["allSizes","default","small","medium","large","FixedBody","createGlobalStyle","StyledDialogBackground","styled","div","StyledDialogContainer","centered","size","theme","colors","neutral","space","DSDialogTitle","h3","fontSizes","title","DSDialogAddon","DSDialogHeader","m","xs","DSDialogSeparator","hr","attrs","DSDialogBody","layout","flexbox","DSDialogPrimaryMessage","DSDialogSecondaryMessage","p","DSDialogDefaultLayout","xxs","DSDialogFooter"],"mappings":";;;;;;AAKA,IAAMA,QAAQ,GAAG;AACfC,EAAAA,OAAO,EAAE,OADM;AAEfC,EAAAA,KAAK,EAAE,OAFQ;AAGfC,EAAAA,MAAM,EAAE,OAHO;AAIfC,EAAAA,KAAK,EAAE,OAJQ;AAKf,aAAW,QALI;AAMf,cAAY;AANG,CAAjB;IASaC,SAAS,GAAGC,iBAAH;IAMTC,sBAAsB,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA;IAUtBC,qBAAqB,gBAAGF,MAAM,CAACC,GAAV;AAAA;AAAA,8MAOtB;AAAA,MAAGE,QAAH,QAAGA,QAAH;AAAA,SAAmBA,QAAQ,GAAG,MAAH,GAAY,qBAAvC;AAAA,CAPsB,EAQvB;AAAA,MAAGC,IAAH,SAAGA,IAAH;AAAA,SAAcZ,QAAQ,CAACY,IAAD,CAAtB;AAAA,CARuB,EAUJ;AAAA,MAAGC,KAAH,SAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAVI,EAWlB;A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AAH,UAAGA,KAAH;AAAA,SAAeA,KAAK,CAACC,MAAN,CAAaC,OAAb,CAAqB,GAArB,CAAf;AAAA,CAF0B;IAKxBmB,qBAAqB,gBAAG1B,MAAM,CAACC,GAAV;AAAA;AAAA,uHAKpB;AAAA,MAAGI,KAAH,UAAGA,KAAH;AAAA,SAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALoB,EAO9BH,wBAP8B;IAYrBI,cAAc,gBAAG5B,MAAM,CAACC,GAAV;AAAA;AAAA,8IAKb;AAAA,MAAGI,KAAH,UAAGA,KAAH;AAAA,SAAeA,KAAK,CAACG,KAAN,CAAYmB,GAA3B;AAAA,CALa,EAMX;AAAA,MAAGtB,KAAH,UAAGA,KAAH;AAAA,SAAeA,KAAK,CAACG,KAAN,CAAYO,CAA3B;AAAA,CANW,EAOZ;AAAA,MAAGV,KAAH,UAAGA,KAAH;AAAA,SAAeA,KAAK,CAACG,KAAN,CAAYQ,EAA3B;AAAA,CAPY,EAQvBR,KARuB,EASvBc,OATuB;;;;"}
|
package/esm/types/index.d.js
DELETED
package/esm/types/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/esm/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.tsx"],"sourcesContent":["import type { GetSpaceArgsT } from './types/index.d';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n"],"names":["getSpaceProps","props","Object","fromEntries","entries","filter","key","exec"],"mappings":";;IAEaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD;AAAA,SAC3BC,MAAM,CAACC,WAAP,CAAmBD,MAAM,CAACE,OAAP,CAAeH,KAAf,EAAsBI,MAAtB,CAA6B;AAAA;AAAA,QAAEC,GAAF;;AAAA,WAAW,kBAAkBC,IAAlB,CAAuBD,GAAvB,CAAX;AAAA,GAA7B,CAAnB,CAD2B;AAAA;;;;"}
|
package/propTypes/package.json
DELETED
package/styles/package.json
DELETED