@elliemae/ds-dialog 2.2.0-alpha.1 → 2.2.0-alpha.5
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 +80 -93
- package/cjs/DSDialog.js.map +7 -0
- package/cjs/DSDialogDatatestid.js +36 -8
- package/cjs/DSDialogDatatestid.js.map +7 -0
- package/cjs/DSDialogInternalTypes.d.js +27 -2
- package/cjs/DSDialogInternalTypes.d.js.map +7 -0
- package/cjs/DSDialogTypes.js +27 -2
- package/cjs/DSDialogTypes.js.map +7 -0
- package/cjs/defaultProps.js +38 -11
- package/cjs/defaultProps.js.map +7 -0
- package/cjs/index.js +47 -24
- package/cjs/index.js.map +7 -0
- package/cjs/propTypes.js +43 -16
- package/cjs/propTypes.js.map +7 -0
- package/cjs/styles.js +148 -143
- package/cjs/styles.js.map +7 -0
- package/cjs/utils.js +50 -30
- package/cjs/utils.js.map +7 -0
- package/esm/DSDialog.js +42 -72
- package/esm/DSDialog.js.map +7 -0
- package/esm/DSDialogDatatestid.js +7 -4
- package/esm/DSDialogDatatestid.js.map +7 -0
- package/esm/DSDialogInternalTypes.d.js +2 -1
- package/esm/DSDialogInternalTypes.d.js.map +7 -0
- package/esm/DSDialogTypes.js +2 -1
- package/esm/DSDialogTypes.js.map +7 -0
- package/esm/defaultProps.js +8 -6
- package/esm/defaultProps.js.map +7 -0
- package/esm/index.js +28 -4
- package/esm/index.js.map +7 -0
- package/esm/propTypes.js +14 -12
- package/esm/propTypes.js.map +7 -0
- package/esm/styles.js +120 -124
- package/esm/styles.js.map +7 -0
- package/esm/utils.js +21 -23
- package/esm/utils.js.map +7 -0
- package/package.json +7 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/defaultProps.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSDialogSizes } from './utils';\nimport type { DSDialogDefaultPropsT } from './DSDialogInternalTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogDefaultPropsT = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n zIndex: 10,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,eAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./DSDialog";
|
|
3
|
+
export * from "./DSDialogDatatestid";
|
|
4
|
+
import { DSDialogSizes } from "./utils";
|
|
5
|
+
import {
|
|
6
|
+
DSDialogBody,
|
|
7
|
+
DSDialogHeader,
|
|
8
|
+
DSDialogFooter,
|
|
9
|
+
DSDialogSeparator,
|
|
10
|
+
DSDialogTitle,
|
|
11
|
+
DSDialogAddon,
|
|
12
|
+
DSDialogDefaultLayout,
|
|
13
|
+
DSDialogPrimaryMessage,
|
|
14
|
+
DSDialogSecondaryMessage
|
|
15
|
+
} from "./styles";
|
|
16
|
+
export {
|
|
17
|
+
DSDialogAddon,
|
|
18
|
+
DSDialogBody,
|
|
19
|
+
DSDialogDefaultLayout,
|
|
20
|
+
DSDialogFooter,
|
|
21
|
+
DSDialogHeader,
|
|
22
|
+
DSDialogPrimaryMessage,
|
|
23
|
+
DSDialogSecondaryMessage,
|
|
24
|
+
DSDialogSeparator,
|
|
25
|
+
DSDialogSizes,
|
|
26
|
+
DSDialogTitle
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\n\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/propTypes.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/* eslint-disable max-len */
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
|
+
import { DSDialogSizes, DSDialogSizesArrayValues } from "./utils";
|
|
5
4
|
const propTypes = {
|
|
6
|
-
isOpen: PropTypes.bool.description(
|
|
7
|
-
children: PropTypes.node.description(
|
|
8
|
-
centered: PropTypes.bool.description(
|
|
9
|
-
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(
|
|
10
|
-
removeAutoFocus: PropTypes.bool.description(
|
|
11
|
-
onClickOutside: PropTypes.func.description(
|
|
5
|
+
isOpen: PropTypes.bool.description("Wether the Dialog is open or not.").defaultValue(false),
|
|
6
|
+
children: PropTypes.node.description("Nested components.").isRequired,
|
|
7
|
+
centered: PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
8
|
+
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT),
|
|
9
|
+
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),
|
|
10
|
+
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
|
+
})
|
|
12
12
|
};
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export {
|
|
14
|
+
propTypes
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=propTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport { PropTypes } from 'react-desc';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\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 size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\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"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAEO,MAAM,YAAY;AAAA,EACvB,QAAQ,UAAU,KAAK,YAAY,qCAAqC,aAAa;AAAA,EACrF,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA,EAC9B,iBAAiB,UAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YACC,0JAED,aAAa,MAAM;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/styles.js
CHANGED
|
@@ -1,125 +1,121 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styled from
|
|
3
|
-
import { createGlobalStyle } from
|
|
4
|
-
import { space,
|
|
5
|
-
import { allSizes } from
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { createGlobalStyle } from "@elliemae/ds-system";
|
|
4
|
+
import { space, flexboxes, layout, sizing } from "@xstyled/styled-components";
|
|
5
|
+
import { allSizes } from "./utils";
|
|
6
|
+
const FixedBody = createGlobalStyle`
|
|
7
|
+
body {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
${({ isBodyOverflow }) => isBodyOverflow ? `padding-right: 15px !important;` : ``}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
const StyledDialogBackground = styled.div`
|
|
14
|
+
position: fixed;
|
|
15
|
+
top: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
background: rgba(37, 41, 47, 50%);
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
z-index: ${({ zIndex }) => zIndex};
|
|
22
|
+
`;
|
|
23
|
+
const StyledDialogContainer = styled.div`
|
|
24
|
+
height: fit-content;
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
margin: ${({ centered }) => centered ? "auto" : "20vh auto auto auto"};
|
|
31
|
+
width: ${({ size }) => allSizes[size]};
|
|
32
|
+
min-width: 300px;
|
|
33
|
+
box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};
|
|
34
|
+
background: ${({ theme }) => theme.colors.neutral["000"]};
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
${space}
|
|
37
|
+
&:focus {
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
const DSDialogTitle = styled.h3`
|
|
42
|
+
font-size: ${({ theme }) => theme.fontSizes.title[700]};
|
|
43
|
+
display: -webkit-box;
|
|
44
|
+
-webkit-line-clamp: 2;
|
|
45
|
+
-webkit-box-orient: vertical;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
margin: 0;
|
|
48
|
+
`;
|
|
49
|
+
const DSDialogAddon = styled.div``;
|
|
50
|
+
const DSDialogHeader = styled.div`
|
|
51
|
+
display: grid;
|
|
52
|
+
align-items: center;
|
|
53
|
+
grid-auto-flow: column;
|
|
54
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
55
|
+
padding: 10px ${({ theme }) => theme.space.xs};
|
|
56
|
+
& ${DSDialogTitle} + ${DSDialogAddon} {
|
|
57
|
+
align-self: flex-start;
|
|
58
|
+
justify-self: flex-end;
|
|
59
|
+
}
|
|
60
|
+
& ${DSDialogAddon}:only-child {
|
|
61
|
+
justify-self: flex-end;
|
|
62
|
+
}
|
|
63
|
+
${space}
|
|
64
|
+
`;
|
|
65
|
+
const DSDialogSeparator = styled.hr.attrs(() => ({ "aria-hidden": true }))`
|
|
66
|
+
margin: 0;
|
|
67
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral["080"]};
|
|
68
|
+
`;
|
|
69
|
+
const DSDialogBody = styled.div`
|
|
70
|
+
padding: ${({ theme }) => theme.space.xs};
|
|
71
|
+
overflow-y: auto;
|
|
72
|
+
${layout}
|
|
73
|
+
${space}
|
|
74
|
+
${flexboxes}
|
|
75
|
+
${sizing}
|
|
76
|
+
`;
|
|
77
|
+
const DSDialogPrimaryMessage = styled.h3`
|
|
78
|
+
margin: 0;
|
|
79
|
+
`;
|
|
80
|
+
const DSDialogSecondaryMessage = styled.p`
|
|
81
|
+
margin: 0;
|
|
82
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
83
|
+
`;
|
|
84
|
+
const DSDialogDefaultLayout = styled.div`
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-auto-flow: row;
|
|
87
|
+
justify-items: center;
|
|
88
|
+
align-items: center;
|
|
89
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
6
90
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return theme.colors.neutral[500];
|
|
39
|
-
}, _ref6 => {
|
|
40
|
-
let {
|
|
41
|
-
theme
|
|
42
|
-
} = _ref6;
|
|
43
|
-
return theme.colors.neutral['000'];
|
|
44
|
-
}, space);
|
|
45
|
-
const DSDialogTitle = /*#__PURE__*/styled.h3.withConfig({
|
|
46
|
-
componentId: "sc-106vqwv-2"
|
|
47
|
-
})(["font-size:", ";display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;"], _ref7 => {
|
|
48
|
-
let {
|
|
49
|
-
theme
|
|
50
|
-
} = _ref7;
|
|
51
|
-
return theme.fontSizes.title[700];
|
|
52
|
-
});
|
|
53
|
-
const DSDialogAddon = /*#__PURE__*/styled.div.withConfig({
|
|
54
|
-
componentId: "sc-106vqwv-3"
|
|
55
|
-
})([""]);
|
|
56
|
-
const DSDialogHeader = /*#__PURE__*/styled.div.withConfig({
|
|
57
|
-
componentId: "sc-106vqwv-4"
|
|
58
|
-
})(["display:grid;align-items:center;grid-auto-flow:column;min-height:", ";padding:10px ", ";& ", " + ", "{align-self:flex-start;justify-self:flex-end;}& ", ":only-child{justify-self:flex-end;}", ""], _ref8 => {
|
|
59
|
-
let {
|
|
60
|
-
theme
|
|
61
|
-
} = _ref8;
|
|
62
|
-
return theme.space.m;
|
|
63
|
-
}, _ref9 => {
|
|
64
|
-
let {
|
|
65
|
-
theme
|
|
66
|
-
} = _ref9;
|
|
67
|
-
return theme.space.xs;
|
|
68
|
-
}, DSDialogTitle, DSDialogAddon, DSDialogAddon, space);
|
|
69
|
-
const DSDialogSeparator = /*#__PURE__*/styled.hr.attrs(() => ({
|
|
70
|
-
'aria-hidden': true
|
|
71
|
-
})).withConfig({
|
|
72
|
-
componentId: "sc-106vqwv-5"
|
|
73
|
-
})(["margin:0;border-top:1px solid ", ";"], _ref10 => {
|
|
74
|
-
let {
|
|
75
|
-
theme
|
|
76
|
-
} = _ref10;
|
|
77
|
-
return theme.colors.neutral['080'];
|
|
78
|
-
});
|
|
79
|
-
const DSDialogBody = /*#__PURE__*/styled.div.withConfig({
|
|
80
|
-
componentId: "sc-106vqwv-6"
|
|
81
|
-
})(["padding:", ";overflow-y:auto;", " ", " ", " ", ""], _ref11 => {
|
|
82
|
-
let {
|
|
83
|
-
theme
|
|
84
|
-
} = _ref11;
|
|
85
|
-
return theme.space.xs;
|
|
86
|
-
}, layout, space, flexboxes, sizing);
|
|
87
|
-
const DSDialogPrimaryMessage = /*#__PURE__*/styled.h3.withConfig({
|
|
88
|
-
componentId: "sc-106vqwv-7"
|
|
89
|
-
})(["margin:0;"]);
|
|
90
|
-
const DSDialogSecondaryMessage = /*#__PURE__*/styled.p.withConfig({
|
|
91
|
-
componentId: "sc-106vqwv-8"
|
|
92
|
-
})(["margin:0;color:", ";"], _ref12 => {
|
|
93
|
-
let {
|
|
94
|
-
theme
|
|
95
|
-
} = _ref12;
|
|
96
|
-
return theme.colors.neutral[500];
|
|
97
|
-
});
|
|
98
|
-
const DSDialogDefaultLayout = /*#__PURE__*/styled.div.withConfig({
|
|
99
|
-
componentId: "sc-106vqwv-9"
|
|
100
|
-
})(["display:grid;grid-auto-flow:row;justify-items:center;align-items:center;grid-gap:", ";", "{text-align:center;}"], _ref13 => {
|
|
101
|
-
let {
|
|
102
|
-
theme
|
|
103
|
-
} = _ref13;
|
|
104
|
-
return theme.space.xxs;
|
|
105
|
-
}, DSDialogSecondaryMessage);
|
|
106
|
-
const DSDialogFooter = /*#__PURE__*/styled.div.withConfig({
|
|
107
|
-
componentId: "sc-106vqwv-10"
|
|
108
|
-
})(["display:grid;grid-auto-flow:column;align-items:center;justify-content:flex-end;grid-gap:", ";min-height:", ";padding:0 ", ";", " ", " ", ""], _ref14 => {
|
|
109
|
-
let {
|
|
110
|
-
theme
|
|
111
|
-
} = _ref14;
|
|
112
|
-
return theme.space.xxs;
|
|
113
|
-
}, _ref15 => {
|
|
114
|
-
let {
|
|
115
|
-
theme
|
|
116
|
-
} = _ref15;
|
|
117
|
-
return theme.space.m;
|
|
118
|
-
}, _ref16 => {
|
|
119
|
-
let {
|
|
120
|
-
theme
|
|
121
|
-
} = _ref16;
|
|
122
|
-
return theme.space.xs;
|
|
123
|
-
}, space, flexboxes, sizing);
|
|
124
|
-
|
|
125
|
-
export { DSDialogAddon, DSDialogBody, DSDialogDefaultLayout, DSDialogFooter, DSDialogHeader, DSDialogPrimaryMessage, DSDialogSecondaryMessage, DSDialogSeparator, DSDialogTitle, FixedBody, StyledDialogBackground, StyledDialogContainer };
|
|
91
|
+
${DSDialogSecondaryMessage} {
|
|
92
|
+
text-align: center;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
const DSDialogFooter = styled.div`
|
|
96
|
+
display: grid;
|
|
97
|
+
grid-auto-flow: column;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
101
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
102
|
+
padding: 0 ${({ theme }) => theme.space.xs};
|
|
103
|
+
${space}
|
|
104
|
+
${flexboxes}
|
|
105
|
+
${sizing}
|
|
106
|
+
`;
|
|
107
|
+
export {
|
|
108
|
+
DSDialogAddon,
|
|
109
|
+
DSDialogBody,
|
|
110
|
+
DSDialogDefaultLayout,
|
|
111
|
+
DSDialogFooter,
|
|
112
|
+
DSDialogHeader,
|
|
113
|
+
DSDialogPrimaryMessage,
|
|
114
|
+
DSDialogSecondaryMessage,
|
|
115
|
+
DSDialogSeparator,
|
|
116
|
+
DSDialogTitle,
|
|
117
|
+
FixedBody,
|
|
118
|
+
StyledDialogBackground,
|
|
119
|
+
StyledDialogContainer
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { createGlobalStyle } from '@elliemae/ds-system';\nimport { space, flexboxes, layout, sizing } from '@xstyled/styled-components';\nimport { allSizes } from './utils';\nimport type { StyledDialogContainerT } from './types/index.d';\n\nexport const FixedBody = createGlobalStyle`\n body {\n overflow: hidden;\n \n ${({ isBodyOverflow }) => (isBodyOverflow ? `padding-right: 15px !important;` : ``)}\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 z-index: ${({ zIndex }) => zIndex};\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: auto;\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 ${flexboxes}\n ${sizing}\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 ${flexboxes}\n ${sizing}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAGO,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,MAInB,CAAC,EAAE,qBAAsB,iBAAiB,oCAAoC;AAAA;AAAA;AAI7E,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAQhC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,SAAS;AAAA;AAAA,8BAEJ,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA,gBAClD,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA,IAEhD;AAAA;AAAA;AAAA;AAAA;AAMG,MAAM,gBAAgB,OAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ7C,MAAM,gBAAgB,OAAO;AAE7B,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA,gBAIrB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,kBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,MACvC,mBAAmB;AAAA;AAAA;AAAA;AAAA,MAInB;AAAA;AAAA;AAAA,IAGF;AAAA;AAGG,MAAM,oBAAoB,OAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,OAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAEpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,OAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,OAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAKvB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,gBACzB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,eAC5B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/utils.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
|
|
6
|
-
const getSpaceProps = props => Object.fromEntries(Object.entries(props).filter(_ref => {
|
|
7
|
-
let [key] = _ref;
|
|
8
|
-
return /^[pm][xytblr]?$/.exec(key);
|
|
9
|
-
}));
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
|
|
10
3
|
const DSDialogSizes = {
|
|
11
|
-
DEFAULT:
|
|
12
|
-
SMALL:
|
|
13
|
-
MEDIUM:
|
|
14
|
-
LARGE:
|
|
15
|
-
XLARGE:
|
|
16
|
-
XXLARGE:
|
|
4
|
+
DEFAULT: "default",
|
|
5
|
+
SMALL: "small",
|
|
6
|
+
MEDIUM: "medium",
|
|
7
|
+
LARGE: "large",
|
|
8
|
+
XLARGE: "x-large",
|
|
9
|
+
XXLARGE: "xx-large"
|
|
17
10
|
};
|
|
18
11
|
const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
|
|
19
12
|
const allSizes = {
|
|
20
|
-
default:
|
|
21
|
-
small:
|
|
22
|
-
medium:
|
|
23
|
-
large:
|
|
24
|
-
|
|
25
|
-
|
|
13
|
+
default: "576px",
|
|
14
|
+
small: "320px",
|
|
15
|
+
medium: "656px",
|
|
16
|
+
large: "848px",
|
|
17
|
+
"x-large": "1042px",
|
|
18
|
+
"xx-large": "1440px"
|
|
26
19
|
};
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
export {
|
|
21
|
+
DSDialogSizes,
|
|
22
|
+
DSDialogSizesArrayValues,
|
|
23
|
+
allSizes,
|
|
24
|
+
getSpaceProps
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
package/esm/utils.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { GetSpaceArgsT } from './DSDialogInternalTypes';\n\nexport const getSpaceProps = (props: GetSpaceArgsT): GetSpaceArgsT =>\n Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));\n\nexport const DSDialogSizes = {\n DEFAULT: 'default',\n SMALL: 'small',\n MEDIUM: 'medium',\n LARGE: 'large',\n XLARGE: 'x-large',\n XXLARGE: 'xx-large',\n} as const;\n\nexport const DSDialogSizesArrayValues = Object.values(DSDialogSizes);\n\nexport const allSizes = {\n default: '576px',\n small: '320px',\n medium: '656px',\n large: '848px',\n 'x-large': '1042px',\n 'xx-large': '1440px',\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACEO,MAAM,gBAAgB,CAAC,UAC5B,OAAO,YAAY,OAAO,QAAQ,OAAO,OAAO,CAAC,CAAC,SAAS,kBAAkB,KAAK;AAE7E,MAAM,gBAAgB;AAAA,EAC3B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA;AAGJ,MAAM,2BAA2B,OAAO,OAAO;AAE/C,MAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-dialog",
|
|
3
|
-
"version": "2.2.0-alpha.
|
|
3
|
+
"version": "2.2.0-alpha.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Dialog",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -64,9 +64,12 @@
|
|
|
64
64
|
"build": "node ../../scripts/build/build.js"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@elliemae/ds-props-helpers": "2.2.0-alpha.
|
|
68
|
-
"@elliemae/ds-system": "2.2.0-alpha.
|
|
69
|
-
"@xstyled/
|
|
67
|
+
"@elliemae/ds-props-helpers": "2.2.0-alpha.5",
|
|
68
|
+
"@elliemae/ds-system": "2.2.0-alpha.5",
|
|
69
|
+
"@xstyled/core": "~3.1.2",
|
|
70
|
+
"@xstyled/styled-components": "~3.1.2",
|
|
71
|
+
"@xstyled/system": "~3.1.2",
|
|
72
|
+
"@xstyled/util": "~3.1.0",
|
|
70
73
|
"react-desc": "~4.1.3"
|
|
71
74
|
},
|
|
72
75
|
"devDependencies": {
|