@elliemae/ds-dialog 3.0.0-next.0 → 3.0.0-next.4
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/dist/cjs/DSDialog.js +157 -0
- package/dist/cjs/DSDialog.js.map +7 -0
- package/dist/cjs/DSDialogDatatestid.js +38 -0
- package/dist/cjs/DSDialogDatatestid.js.map +7 -0
- package/dist/cjs/defaultProps.js +46 -0
- package/dist/cjs/defaultProps.js.map +7 -0
- package/dist/cjs/index.js +94 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/propTypes.js +64 -0
- package/dist/cjs/propTypes.js.map +7 -0
- package/dist/cjs/sharedTypes.js +27 -0
- package/dist/cjs/sharedTypes.js.map +7 -0
- package/dist/cjs/styles.js +153 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/cjs/utils.js +55 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/esm/DSDialog.js +135 -0
- package/dist/esm/DSDialog.js.map +7 -0
- package/dist/esm/DSDialogDatatestid.js +9 -0
- package/dist/esm/DSDialogDatatestid.js.map +7 -0
- package/dist/esm/defaultProps.js +17 -0
- package/dist/esm/defaultProps.js.map +7 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/propTypes.js +37 -0
- package/dist/esm/propTypes.js.map +7 -0
- package/dist/esm/sharedTypes.js +2 -0
- package/dist/esm/sharedTypes.js.map +7 -0
- package/dist/esm/styles.js +124 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/esm/utils.js +26 -0
- package/dist/esm/utils.js.map +7 -0
- package/package.json +45 -35
- package/cjs/DSDialog.js +0 -107
- package/cjs/DSDialogDatatestid.js +0 -10
- package/cjs/DSDialogInternalTypes.d.js +0 -2
- package/cjs/DSDialogTypes.js +0 -2
- package/cjs/defaultProps.js +0 -18
- package/cjs/index.js +0 -24
- package/cjs/propTypes.js +0 -18
- package/cjs/styles.js +0 -121
- package/cjs/utils.js +0 -35
- package/esm/DSDialog.js +0 -95
- package/esm/DSDialogDatatestid.js +0 -6
- package/esm/DSDialogInternalTypes.d.js +0 -1
- package/esm/DSDialogTypes.js +0 -1
- package/esm/defaultProps.js +0 -14
- package/esm/index.js +0 -4
- package/esm/propTypes.js +0 -14
- package/esm/styles.js +0 -101
- package/esm/utils.js +0 -28
- package/types/DSDialog.d.ts +0 -30
- package/types/DSDialogDatatestid.d.ts +0 -4
- package/types/DSDialogTypes.d.ts +0 -10
- package/types/defaultProps.d.ts +0 -2
- package/types/index.d.ts +0 -4
- package/types/propTypes.d.ts +0 -19
- package/types/styles.d.ts +0 -14
- package/types/utils.d.ts +0 -19
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styles_exports = {};
|
|
29
|
+
__export(styles_exports, {
|
|
30
|
+
DSDialogAddon: () => DSDialogAddon,
|
|
31
|
+
DSDialogBody: () => DSDialogBody,
|
|
32
|
+
DSDialogDefaultLayout: () => DSDialogDefaultLayout,
|
|
33
|
+
DSDialogFooter: () => DSDialogFooter,
|
|
34
|
+
DSDialogHeader: () => DSDialogHeader,
|
|
35
|
+
DSDialogPrimaryMessage: () => DSDialogPrimaryMessage,
|
|
36
|
+
DSDialogSecondaryMessage: () => DSDialogSecondaryMessage,
|
|
37
|
+
DSDialogSeparator: () => DSDialogSeparator,
|
|
38
|
+
DSDialogTitle: () => DSDialogTitle,
|
|
39
|
+
FixedBody: () => FixedBody,
|
|
40
|
+
StyledDialogBackground: () => StyledDialogBackground,
|
|
41
|
+
StyledDialogContainer: () => StyledDialogContainer
|
|
42
|
+
});
|
|
43
|
+
var React = __toESM(require("react"));
|
|
44
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
45
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
46
|
+
var import_styled_components2 = require("@xstyled/styled-components");
|
|
47
|
+
var import_utils = require("./utils");
|
|
48
|
+
const FixedBody = import_ds_system.createGlobalStyle`
|
|
49
|
+
body {
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
${({ bodyInfo }) => bodyInfo.overflow ? `padding-right: calc( ${bodyInfo.paddingRight} + ${bodyInfo.scrollbarWidth} ) !important;` : ``}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const StyledDialogBackground = import_styled_components.default.div`
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: 0;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
background: rgba(37, 41, 47, 50%);
|
|
62
|
+
overflow-y: auto;
|
|
63
|
+
z-index: ${({ zIndex }) => zIndex};
|
|
64
|
+
`;
|
|
65
|
+
const StyledDialogContainer = import_styled_components.default.div`
|
|
66
|
+
height: fit-content;
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
margin: ${({ centered }) => centered ? "auto" : "20vh auto auto auto"};
|
|
73
|
+
width: ${({ size }) => import_utils.allSizes[size]};
|
|
74
|
+
min-width: 300px;
|
|
75
|
+
box-shadow: 0 10px 20px 0 ${({ theme }) => theme.colors.neutral[500]};
|
|
76
|
+
background: ${({ theme }) => theme.colors.neutral["000"]};
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
${import_styled_components2.space}
|
|
79
|
+
&:focus {
|
|
80
|
+
outline: none;
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
const DSDialogTitle = import_styled_components.default.h3`
|
|
84
|
+
font-size: ${({ theme }) => theme.fontSizes.title[700]};
|
|
85
|
+
display: -webkit-box;
|
|
86
|
+
-webkit-line-clamp: 2;
|
|
87
|
+
-webkit-box-orient: vertical;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
line-height: 28px;
|
|
90
|
+
margin: 0;
|
|
91
|
+
`;
|
|
92
|
+
const DSDialogAddon = import_styled_components.default.div``;
|
|
93
|
+
const DSDialogHeader = import_styled_components.default.div`
|
|
94
|
+
display: grid;
|
|
95
|
+
align-items: center;
|
|
96
|
+
grid-auto-flow: column;
|
|
97
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
98
|
+
padding: 10px ${({ theme }) => theme.space.xs};
|
|
99
|
+
& ${DSDialogTitle} + ${DSDialogAddon} {
|
|
100
|
+
align-self: flex-start;
|
|
101
|
+
justify-self: flex-end;
|
|
102
|
+
}
|
|
103
|
+
& ${DSDialogAddon}:only-child {
|
|
104
|
+
justify-self: flex-end;
|
|
105
|
+
}
|
|
106
|
+
${import_styled_components2.space}
|
|
107
|
+
${import_styled_components2.sizing}
|
|
108
|
+
`;
|
|
109
|
+
const DSDialogSeparator = import_styled_components.default.hr.attrs(() => ({ "aria-hidden": true }))`
|
|
110
|
+
margin: 0;
|
|
111
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral["080"]};
|
|
112
|
+
`;
|
|
113
|
+
const DSDialogBody = import_styled_components.default.div`
|
|
114
|
+
padding: ${({ theme }) => theme.space.xs};
|
|
115
|
+
overflow-y: auto;
|
|
116
|
+
|
|
117
|
+
${import_styled_components2.layout}
|
|
118
|
+
${import_styled_components2.space}
|
|
119
|
+
${import_styled_components2.flexboxes}
|
|
120
|
+
${import_styled_components2.sizing}
|
|
121
|
+
`;
|
|
122
|
+
const DSDialogPrimaryMessage = import_styled_components.default.h3`
|
|
123
|
+
margin: 0;
|
|
124
|
+
`;
|
|
125
|
+
const DSDialogSecondaryMessage = import_styled_components.default.p`
|
|
126
|
+
margin: 0;
|
|
127
|
+
color: ${({ theme }) => theme.colors.neutral[500]};
|
|
128
|
+
`;
|
|
129
|
+
const DSDialogDefaultLayout = import_styled_components.default.div`
|
|
130
|
+
display: grid;
|
|
131
|
+
grid-auto-flow: row;
|
|
132
|
+
justify-items: center;
|
|
133
|
+
align-items: center;
|
|
134
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
135
|
+
|
|
136
|
+
${DSDialogSecondaryMessage} {
|
|
137
|
+
text-align: center;
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
const DSDialogFooter = import_styled_components.default.div`
|
|
141
|
+
display: grid;
|
|
142
|
+
grid-auto-flow: column;
|
|
143
|
+
align-items: center;
|
|
144
|
+
justify-content: flex-end;
|
|
145
|
+
grid-gap: ${({ theme }) => theme.space.xxs};
|
|
146
|
+
min-height: ${({ theme }) => theme.space.m};
|
|
147
|
+
padding: 0 ${({ theme }) => theme.space.xs};
|
|
148
|
+
${import_styled_components2.space}
|
|
149
|
+
${import_styled_components2.flexboxes}
|
|
150
|
+
${import_styled_components2.sizing}
|
|
151
|
+
`;
|
|
152
|
+
module.exports = __toCommonJS(styles_exports);
|
|
153
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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 { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\ninterface FixedBodyT {\n bodyInfo: DSDialogInternalsT.BodyInfoT;\n}\n\ninterface StyledDialogBackgroundT {\n zIndex: number;\n}\n\ninterface StyledDialogContainerT {\n size: DSDialogT.Sizes;\n centered: boolean;\n}\n\nexport const FixedBody = createGlobalStyle<FixedBodyT>`\n body {\n overflow: hidden;\n ${({ bodyInfo }) =>\n bodyInfo.overflow\n ? `padding-right: calc( ${bodyInfo.paddingRight} + ${bodyInfo.scrollbarWidth} ) !important;`\n : ``}\n }\n`;\n\nexport const StyledDialogBackground = styled.div<StyledDialogBackgroundT>`\n position: fixed;\n top: 0;\n bottom: 0;\n left: 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 line-height: 28px;\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 ${sizing}\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\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAkC;AAClC,gCAAiD;AACjD,mBAAyB;AAiBlB,MAAM,YAAY;AAAA;AAAA;AAAA,MAGnB,CAAC,EAAE,eACH,SAAS,WACL,wBAAwB,SAAS,kBAAkB,SAAS,iCAC5D;AAAA;AAAA;AAIH,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAShC,CAAC,EAAE,aAAa;AAAA;AAGtB,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhC,CAAC,EAAE,eAAgB,WAAW,SAAS;AAAA,WACxC,CAAC,EAAE,WAAW,sBAAS;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,iCAAO;AAAA,eACrB,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS7C,MAAM,gBAAgB,iCAAO;AAE7B,MAAM,iBAAiB,iCAAO;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,IACA;AAAA;AAGG,MAAM,oBAAoB,iCAAO,GAAG,MAAM,MAAO,GAAE,eAAe;AAAA;AAAA,0BAE/C,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGvD,MAAM,eAAe,iCAAO;AAAA,aACtB,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA;AAAA,IAGpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAyB,iCAAO;AAAA;AAAA;AAItC,MAAM,2BAA2B,iCAAO;AAAA;AAAA,WAEpC,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAGxC,MAAM,wBAAwB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,cAK9B,CAAC,EAAE,YAAY,MAAM,MAAM;AAAA;AAAA,IAErC;AAAA;AAAA;AAAA;AAKG,MAAM,iBAAiB,iCAAO;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
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var utils_exports = {};
|
|
29
|
+
__export(utils_exports, {
|
|
30
|
+
DSDialogSizes: () => DSDialogSizes,
|
|
31
|
+
DSDialogSizesArrayValues: () => DSDialogSizesArrayValues,
|
|
32
|
+
allSizes: () => allSizes,
|
|
33
|
+
getSpaceProps: () => getSpaceProps
|
|
34
|
+
});
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
const getSpaceProps = (props) => Object.fromEntries(Object.entries(props).filter(([key]) => /^[pm][xytblr]?$/.exec(key)));
|
|
37
|
+
const DSDialogSizes = {
|
|
38
|
+
DEFAULT: "default",
|
|
39
|
+
SMALL: "small",
|
|
40
|
+
MEDIUM: "medium",
|
|
41
|
+
LARGE: "large",
|
|
42
|
+
XLARGE: "x-large",
|
|
43
|
+
XXLARGE: "xx-large"
|
|
44
|
+
};
|
|
45
|
+
const DSDialogSizesArrayValues = Object.values(DSDialogSizes);
|
|
46
|
+
const allSizes = {
|
|
47
|
+
default: "576px",
|
|
48
|
+
small: "320px",
|
|
49
|
+
medium: "656px",
|
|
50
|
+
large: "848px",
|
|
51
|
+
"x-large": "1042px",
|
|
52
|
+
"xx-large": "1440px"
|
|
53
|
+
};
|
|
54
|
+
module.exports = __toCommonJS(utils_exports);
|
|
55
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["type GetSpaceArgsT = Partial<Record<string, string | number>>;\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' as const,\n SMALL: 'small' as const,\n MEDIUM: 'medium' as const,\n LARGE: 'large' as const,\n XLARGE: 'x-large' as const,\n XXLARGE: 'xx-large' as const,\n};\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,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
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import * as React from "react";
|
|
33
|
+
import ReactDOM from "react-dom";
|
|
34
|
+
import React2, { useCallback, useRef, useEffect, useState, useMemo } from "react";
|
|
35
|
+
import { debounce } from "lodash";
|
|
36
|
+
import {
|
|
37
|
+
useMemoMergePropsWithDefault,
|
|
38
|
+
useGetGlobalAttributes,
|
|
39
|
+
useValidateTypescriptPropTypes,
|
|
40
|
+
describe
|
|
41
|
+
} from "@elliemae/ds-props-helpers";
|
|
42
|
+
import { FixedBody, StyledDialogBackground, StyledDialogContainer } from "./styles";
|
|
43
|
+
import { propTypes } from "./propTypes";
|
|
44
|
+
import { defaultProps } from "./defaultProps";
|
|
45
|
+
import { getSpaceProps } from "./utils";
|
|
46
|
+
import { DSDialogDatatestid } from "./DSDialogDatatestid";
|
|
47
|
+
const DSDialog = (props) => {
|
|
48
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
49
|
+
const [bodyInfo, setBodyInfo] = useState({
|
|
50
|
+
overflow: false,
|
|
51
|
+
paddingRight: "0px",
|
|
52
|
+
scrollbarWidth: "0px"
|
|
53
|
+
});
|
|
54
|
+
useValidateTypescriptPropTypes(propsWithDefault, propTypes);
|
|
55
|
+
const _a = propsWithDefault, { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex } = _a, rest = __objRest(_a, ["children", "isOpen", "onClickOutside", "onClose", "centered", "size", "removeAutoFocus", "zIndex"]);
|
|
56
|
+
const containerRef = useRef(null);
|
|
57
|
+
const focusContainer = useCallback(() => {
|
|
58
|
+
const isContainerOrChildFocused = containerRef.current?.contains(document.activeElement);
|
|
59
|
+
if (!isContainerOrChildFocused)
|
|
60
|
+
containerRef.current?.focus?.();
|
|
61
|
+
}, []);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
document.addEventListener("focusin", focusContainer);
|
|
64
|
+
return () => document.removeEventListener("focusin", focusContainer);
|
|
65
|
+
}, [focusContainer]);
|
|
66
|
+
const handleOutsideClick = useCallback((e) => {
|
|
67
|
+
if (e.target.dataset.portalbg)
|
|
68
|
+
onClickOutside();
|
|
69
|
+
}, [onClickOutside]);
|
|
70
|
+
const handleOnKeyDown = useCallback((e) => {
|
|
71
|
+
if (e.key === "Escape")
|
|
72
|
+
onClose();
|
|
73
|
+
}, [onClose]);
|
|
74
|
+
const _b = useGetGlobalAttributes(propsWithDefault, {
|
|
75
|
+
onClick: handleOutsideClick,
|
|
76
|
+
onKeyDown: handleOnKeyDown
|
|
77
|
+
}), { className } = _b, restOfGlobalAttributes = __objRest(_b, ["className"]);
|
|
78
|
+
const calculateScrollbar = useCallback(() => {
|
|
79
|
+
const body = document.getElementsByTagName("body")[0];
|
|
80
|
+
const { clientWidth } = body;
|
|
81
|
+
setBodyInfo((prev) => __spreadProps(__spreadValues({}, prev), { scrollbarWidth: `${window.innerWidth - clientWidth}px` }));
|
|
82
|
+
}, []);
|
|
83
|
+
const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
calculateScrollbar();
|
|
86
|
+
}, [calculateScrollbar]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
window.addEventListener("resize", debouncedCalculateScrollbar);
|
|
89
|
+
return () => {
|
|
90
|
+
window.removeEventListener("resize", debouncedCalculateScrollbar);
|
|
91
|
+
};
|
|
92
|
+
}, [calculateScrollbar, debouncedCalculateScrollbar]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (isOpen) {
|
|
95
|
+
const body = document.getElementsByTagName("body")[0];
|
|
96
|
+
const { clientHeight, scrollHeight } = body;
|
|
97
|
+
const paddingRight = window.getComputedStyle(body, null)?.getPropertyValue("padding-right");
|
|
98
|
+
setBodyInfo((prev) => __spreadProps(__spreadValues({}, prev), { overflow: scrollHeight > clientHeight, paddingRight }));
|
|
99
|
+
} else
|
|
100
|
+
setBodyInfo((prev) => __spreadProps(__spreadValues({}, prev), { overflow: false, paddingRight: "0px" }));
|
|
101
|
+
}, [isOpen]);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (isOpen && !removeAutoFocus)
|
|
104
|
+
containerRef?.current?.focus();
|
|
105
|
+
}, [isOpen, removeAutoFocus]);
|
|
106
|
+
if (isOpen) {
|
|
107
|
+
return ReactDOM.createPortal(/* @__PURE__ */ React2.createElement(StyledDialogBackground, {
|
|
108
|
+
className,
|
|
109
|
+
onClick: handleOutsideClick,
|
|
110
|
+
"data-portalbg": true,
|
|
111
|
+
"data-testid": DSDialogDatatestid.BACKGROUND,
|
|
112
|
+
zIndex
|
|
113
|
+
}, /* @__PURE__ */ React2.createElement(FixedBody, {
|
|
114
|
+
bodyInfo
|
|
115
|
+
}), /* @__PURE__ */ React2.createElement(StyledDialogContainer, __spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
116
|
+
role: "dialog",
|
|
117
|
+
"aria-modal": true,
|
|
118
|
+
ref: containerRef,
|
|
119
|
+
tabIndex: !removeAutoFocus ? 0 : void 0
|
|
120
|
+
}, getSpaceProps(rest)), {
|
|
121
|
+
centered,
|
|
122
|
+
"data-testid": DSDialogDatatestid.CONTAINER
|
|
123
|
+
}), restOfGlobalAttributes), {
|
|
124
|
+
size
|
|
125
|
+
}), children)), document.getElementsByTagName("body")[0]);
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
};
|
|
129
|
+
const DSDialogWithSchema = describe(DSDialog);
|
|
130
|
+
DSDialogWithSchema.propTypes = propTypes;
|
|
131
|
+
export {
|
|
132
|
+
DSDialog,
|
|
133
|
+
DSDialogWithSchema
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=DSDialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState, WeakValidationMap, useMemo } from 'react';\nimport { debounce } from 'lodash';\nimport {\n useMemoMergePropsWithDefault,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n describe,\n} from '@elliemae/ds-props-helpers';\nimport { FixedBody, StyledDialogBackground, StyledDialogContainer } from './styles';\nimport { propTypes } from './propTypes';\nimport { defaultProps } from './defaultProps';\nimport { getSpaceProps } from './utils';\nimport { DSDialogDatatestid } from './DSDialogDatatestid';\nimport type { DSDialogT } from './propTypes';\nimport type { DSDialogInternalsT } from './sharedTypes';\n\nconst DSDialog = (props: DSDialogT.Props): JSX.Element | null => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSDialogT.Props>(props, defaultProps);\n const [bodyInfo, setBodyInfo] = useState<DSDialogInternalsT.BodyInfoT>({\n overflow: false,\n paddingRight: '0px',\n scrollbarWidth: '0px',\n });\n\n useValidateTypescriptPropTypes<DSDialogT.Props>(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, onClose, centered, size, removeAutoFocus, zIndex, ...rest } =\n propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const focusContainer = useCallback(() => {\n const isContainerOrChildFocused = containerRef.current?.contains(document.activeElement);\n if (!isContainerOrChildFocused) containerRef.current?.focus?.();\n }, []);\n\n useEffect(() => {\n document.addEventListener('focusin', focusContainer);\n return () => document.removeEventListener('focusin', focusContainer);\n }, [focusContainer]);\n\n const handleOutsideClick = useCallback(\n (e: React.MouseEvent) => {\n if ((e.target as HTMLDivElement).dataset.portalbg) onClickOutside();\n },\n [onClickOutside],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n },\n [onClose],\n );\n\n const { className, ...restOfGlobalAttributes } = useGetGlobalAttributes(propsWithDefault, {\n onClick: handleOutsideClick,\n onKeyDown: handleOnKeyDown,\n });\n\n const calculateScrollbar = useCallback(() => {\n const body = document.getElementsByTagName('body')[0];\n const { clientWidth } = body;\n setBodyInfo((prev) => ({ ...prev, scrollbarWidth: `${window.innerWidth - clientWidth}px` }));\n }, []);\n\n const debouncedCalculateScrollbar = useMemo(() => debounce(calculateScrollbar, 300), [calculateScrollbar]);\n\n useEffect(() => {\n calculateScrollbar();\n }, [calculateScrollbar]);\n\n useEffect(() => {\n window.addEventListener('resize', debouncedCalculateScrollbar);\n return () => {\n window.removeEventListener('resize', debouncedCalculateScrollbar);\n };\n }, [calculateScrollbar, debouncedCalculateScrollbar]);\n\n useEffect(() => {\n if (isOpen) {\n const body = document.getElementsByTagName('body')[0];\n const { clientHeight, scrollHeight } = body;\n const paddingRight = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n setBodyInfo((prev) => ({ ...prev, overflow: scrollHeight > clientHeight, paddingRight }));\n } else setBodyInfo((prev) => ({ ...prev, overflow: false, paddingRight: '0px' }));\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n className={className}\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n >\n <FixedBody bodyInfo={bodyInfo} />\n <StyledDialogContainer\n role=\"dialog\"\n aria-modal\n ref={containerRef}\n tabIndex={!removeAutoFocus ? 0 : undefined}\n {...getSpaceProps(rest as Record<string, string | number>)}\n centered={centered}\n data-testid={DSDialogDatatestid.CONTAINER}\n {...restOfGlobalAttributes}\n size={size}\n >\n {children}\n </StyledDialogContainer>\n </StyledDialogBackground>,\n document.getElementsByTagName('body')[0],\n );\n }\n\n return null;\n};\n\nconst DSDialogWithSchema = describe<DSDialogT.Props>(DSDialog);\nDSDialogWithSchema.propTypes = propTypes as WeakValidationMap<unknown>;\n\nexport { DSDialog, DSDialogWithSchema };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA;AACA;AACA;AACA;AACA;AAIA,MAAM,WAAW,CAAC,UAA+C;AAC/D,QAAM,mBAAmB,6BAA8C,OAAO;AAC9E,QAAM,CAAC,UAAU,eAAe,SAAuC;AAAA,IACrE,UAAU;AAAA,IACV,cAAc;AAAA,IACd,gBAAgB;AAAA;AAGlB,iCAAgD,kBAAkB;AAElE,QACE,uBADM,YAAU,QAAQ,gBAAgB,SAAS,UAAU,MAAM,iBAAiB,WAClF,IAD6F,iBAC7F,IAD6F,CAAvF,YAAU,UAAQ,kBAAgB,WAAS,YAAU,QAAM,mBAAiB;AAGpF,QAAM,eAAe,OAA8B;AAEnD,QAAM,iBAAiB,YAAY,MAAM;AACvC,UAAM,4BAA4B,aAAa,SAAS,SAAS,SAAS;AAC1E,QAAI,CAAC;AAA2B,mBAAa,SAAS;AAAA,KACrD;AAEH,YAAU,MAAM;AACd,aAAS,iBAAiB,WAAW;AACrC,WAAO,MAAM,SAAS,oBAAoB,WAAW;AAAA,KACpD,CAAC;AAEJ,QAAM,qBAAqB,YACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,YACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,QAAiD,4BAAuB,kBAAkB;AAAA,IACxF,SAAS;AAAA,IACT,WAAW;AAAA,MAFL,gBAAyC,IAA3B,mCAA2B,IAA3B,CAAd;AAKR,QAAM,qBAAqB,YAAY,MAAM;AAC3C,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,gBAAgB;AACxB,gBAAY,CAAC,SAAU,iCAAK,OAAL,EAAW,gBAAgB,GAAG,OAAO,aAAa;AAAA,KACxE;AAEH,QAAM,8BAA8B,QAAQ,MAAM,SAAS,oBAAoB,MAAM,CAAC;AAEtF,YAAU,MAAM;AACd;AAAA,KACC,CAAC;AAEJ,YAAU,MAAM;AACd,WAAO,iBAAiB,UAAU;AAClC,WAAO,MAAM;AACX,aAAO,oBAAoB,UAAU;AAAA;AAAA,KAEtC,CAAC,oBAAoB;AAExB,YAAU,MAAM;AACd,QAAI,QAAQ;AACV,YAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,YAAM,EAAE,cAAc,iBAAiB;AACvC,YAAM,eAAe,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAE3E,kBAAY,CAAC,SAAU,iCAAK,OAAL,EAAW,UAAU,eAAe,cAAc;AAAA;AACpE,kBAAY,CAAC,SAAU,iCAAK,OAAL,EAAW,UAAU,OAAO,cAAc;AAAA,KACvE,CAAC;AAEJ,YAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,MAAI,QAAQ;AACV,WAAO,SAAS,aACd,qCAAC,wBAAD;AAAA,MACE;AAAA,MACA,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,mBAAmB;AAAA,MAChC;AAAA,OAEA,qCAAC,WAAD;AAAA,MAAW;AAAA,QACX,qCAAC,uBAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,OAC7B,cAAc,QALpB;AAAA,MAME;AAAA,MACA,eAAa,mBAAmB;AAAA,QAC5B,yBARN;AAAA,MASE;AAAA,QAEC,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,MAAM,qBAAqB,SAA0B;AACrD,mBAAmB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSDialogDatatestid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSDialogDatatestid = {\n CONTAINER: 'ds-dialog-container',\n BACKGROUND: 'ds-dialog-background',\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSDialogSizes } from "./utils";
|
|
3
|
+
const noop = () => {
|
|
4
|
+
};
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
isOpen: false,
|
|
7
|
+
centered: false,
|
|
8
|
+
size: DSDialogSizes.DEFAULT,
|
|
9
|
+
removeAutoFocus: false,
|
|
10
|
+
onClickOutside: noop,
|
|
11
|
+
onClose: noop,
|
|
12
|
+
zIndex: 10
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
defaultProps
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=defaultProps.js.map
|
|
@@ -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 { DSDialogT } from './propTypes';\n\nconst noop = () => {};\n\nexport const defaultProps: DSDialogT.DefaultProps = {\n isOpen: false,\n centered: false,\n size: DSDialogSizes.DEFAULT,\n removeAutoFocus: false,\n onClickOutside: noop,\n onClose: noop,\n zIndex: 10,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAGA,MAAM,OAAO,MAAM;AAAA;AAEZ,MAAM,eAAuC;AAAA,EAClD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,MAAM,cAAc;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { describe } from "react-desc";
|
|
3
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import {
|
|
5
|
+
DSDialogBody,
|
|
6
|
+
DSDialogHeader,
|
|
7
|
+
DSDialogFooter,
|
|
8
|
+
DSDialogSeparator,
|
|
9
|
+
DSDialogTitle,
|
|
10
|
+
DSDialogAddon,
|
|
11
|
+
DSDialogDefaultLayout,
|
|
12
|
+
DSDialogPrimaryMessage,
|
|
13
|
+
DSDialogSecondaryMessage
|
|
14
|
+
} from "./styles";
|
|
15
|
+
DSDialogBody.propTypes = globalAttributesPropTypes;
|
|
16
|
+
DSDialogHeader.propTypes = globalAttributesPropTypes;
|
|
17
|
+
DSDialogFooter.propTypes = globalAttributesPropTypes;
|
|
18
|
+
DSDialogSeparator.propTypes = globalAttributesPropTypes;
|
|
19
|
+
DSDialogTitle.propTypes = globalAttributesPropTypes;
|
|
20
|
+
DSDialogAddon.propTypes = globalAttributesPropTypes;
|
|
21
|
+
DSDialogDefaultLayout.propTypes = globalAttributesPropTypes;
|
|
22
|
+
DSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;
|
|
23
|
+
DSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;
|
|
24
|
+
DSDialogBody.displayName = "DSDialogBody";
|
|
25
|
+
DSDialogHeader.displayName = "DSDialogHeader";
|
|
26
|
+
DSDialogFooter.displayName = "DSDialogFooter";
|
|
27
|
+
DSDialogSeparator.displayName = "DSDialogSeparator";
|
|
28
|
+
DSDialogTitle.displayName = "DSDialogTitle";
|
|
29
|
+
DSDialogAddon.displayName = "DSDialogAddon";
|
|
30
|
+
DSDialogDefaultLayout.displayName = "DSDialogDefaultLayout";
|
|
31
|
+
DSDialogPrimaryMessage.displayName = "DSDialogPrimaryMessage";
|
|
32
|
+
DSDialogSecondaryMessage.displayName = "DSDialogSecondaryMessage";
|
|
33
|
+
const DSDialogBodyWithSchema = describe(DSDialogBody);
|
|
34
|
+
const DSDialogHeaderWithSchema = describe(DSDialogHeader);
|
|
35
|
+
const DSDialogFooterWithSchema = describe(DSDialogFooter);
|
|
36
|
+
const DSDialogSeparatorWithSchema = describe(DSDialogSeparator);
|
|
37
|
+
const DSDialogTitleWithSchema = describe(DSDialogTitle);
|
|
38
|
+
const DSDialogAddonWithSchema = describe(DSDialogAddon);
|
|
39
|
+
const DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);
|
|
40
|
+
const DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);
|
|
41
|
+
const DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);
|
|
42
|
+
DSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;
|
|
43
|
+
DSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;
|
|
44
|
+
DSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;
|
|
45
|
+
DSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;
|
|
46
|
+
DSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;
|
|
47
|
+
DSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;
|
|
48
|
+
DSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;
|
|
49
|
+
DSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
50
|
+
DSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;
|
|
51
|
+
export * from "./DSDialog";
|
|
52
|
+
export * from "./DSDialogDatatestid";
|
|
53
|
+
import { DSDialogSizes } from "./utils";
|
|
54
|
+
export {
|
|
55
|
+
DSDialogAddon,
|
|
56
|
+
DSDialogAddonWithSchema,
|
|
57
|
+
DSDialogBody,
|
|
58
|
+
DSDialogBodyWithSchema,
|
|
59
|
+
DSDialogDefaultLayout,
|
|
60
|
+
DSDialogDefaultLayoutWithSchema,
|
|
61
|
+
DSDialogFooter,
|
|
62
|
+
DSDialogFooterWithSchema,
|
|
63
|
+
DSDialogHeader,
|
|
64
|
+
DSDialogHeaderWithSchema,
|
|
65
|
+
DSDialogPrimaryMessage,
|
|
66
|
+
DSDialogPrimaryMessageWithSchema,
|
|
67
|
+
DSDialogSecondaryMessage,
|
|
68
|
+
DSDialogSecondaryMessageWithSchema,
|
|
69
|
+
DSDialogSeparator,
|
|
70
|
+
DSDialogSeparatorWithSchema,
|
|
71
|
+
DSDialogSizes,
|
|
72
|
+
DSDialogTitle,
|
|
73
|
+
DSDialogTitleWithSchema
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -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", "import { describe } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\nimport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n} from './styles';\n\nDSDialogBody.propTypes = globalAttributesPropTypes;\nDSDialogHeader.propTypes = globalAttributesPropTypes;\nDSDialogFooter.propTypes = globalAttributesPropTypes;\nDSDialogSeparator.propTypes = globalAttributesPropTypes;\nDSDialogTitle.propTypes = globalAttributesPropTypes;\nDSDialogAddon.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayout.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessage.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessage.propTypes = globalAttributesPropTypes;\n\nDSDialogBody.displayName = 'DSDialogBody';\nDSDialogHeader.displayName = 'DSDialogHeader';\nDSDialogFooter.displayName = 'DSDialogFooter';\nDSDialogSeparator.displayName = 'DSDialogSeparator';\nDSDialogTitle.displayName = 'DSDialogTitle';\nDSDialogAddon.displayName = 'DSDialogAddon';\nDSDialogDefaultLayout.displayName = 'DSDialogDefaultLayout';\nDSDialogPrimaryMessage.displayName = 'DSDialogPrimaryMessage';\nDSDialogSecondaryMessage.displayName = 'DSDialogSecondaryMessage';\n\nconst DSDialogBodyWithSchema = describe(DSDialogBody);\nconst DSDialogHeaderWithSchema = describe(DSDialogHeader);\nconst DSDialogFooterWithSchema = describe(DSDialogFooter);\nconst DSDialogSeparatorWithSchema = describe(DSDialogSeparator);\nconst DSDialogTitleWithSchema = describe(DSDialogTitle);\nconst DSDialogAddonWithSchema = describe(DSDialogAddon);\nconst DSDialogDefaultLayoutWithSchema = describe(DSDialogDefaultLayout);\nconst DSDialogPrimaryMessageWithSchema = describe(DSDialogPrimaryMessage);\nconst DSDialogSecondaryMessageWithSchema = describe(DSDialogSecondaryMessage);\n\nDSDialogBodyWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogHeaderWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogFooterWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSeparatorWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogTitleWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogAddonWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogDefaultLayoutWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogPrimaryMessageWithSchema.propTypes = globalAttributesPropTypes;\nDSDialogSecondaryMessageWithSchema.propTypes = globalAttributesPropTypes;\n\nexport * from './DSDialog';\nexport * from './DSDialogDatatestid';\nexport { DSDialogSizes } from './utils';\nexport {\n DSDialogBody,\n DSDialogHeader,\n DSDialogFooter,\n DSDialogSeparator,\n DSDialogTitle,\n DSDialogAddon,\n DSDialogDefaultLayout,\n DSDialogPrimaryMessage,\n DSDialogSecondaryMessage,\n DSDialogBodyWithSchema,\n DSDialogHeaderWithSchema,\n DSDialogFooterWithSchema,\n DSDialogSeparatorWithSchema,\n DSDialogTitleWithSchema,\n DSDialogAddonWithSchema,\n DSDialogDefaultLayoutWithSchema,\n DSDialogPrimaryMessageWithSchema,\n DSDialogSecondaryMessageWithSchema,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,aAAa,YAAY;AACzB,eAAe,YAAY;AAC3B,eAAe,YAAY;AAC3B,kBAAkB,YAAY;AAC9B,cAAc,YAAY;AAC1B,cAAc,YAAY;AAC1B,sBAAsB,YAAY;AAClC,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AAErC,aAAa,cAAc;AAC3B,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,kBAAkB,cAAc;AAChC,cAAc,cAAc;AAC5B,cAAc,cAAc;AAC5B,sBAAsB,cAAc;AACpC,uBAAuB,cAAc;AACrC,yBAAyB,cAAc;AAEvC,MAAM,yBAAyB,SAAS;AACxC,MAAM,2BAA2B,SAAS;AAC1C,MAAM,2BAA2B,SAAS;AAC1C,MAAM,8BAA8B,SAAS;AAC7C,MAAM,0BAA0B,SAAS;AACzC,MAAM,0BAA0B,SAAS;AACzC,MAAM,kCAAkC,SAAS;AACjD,MAAM,mCAAmC,SAAS;AAClD,MAAM,qCAAqC,SAAS;AAEpD,uBAAuB,YAAY;AACnC,yBAAyB,YAAY;AACrC,yBAAyB,YAAY;AACrC,4BAA4B,YAAY;AACxC,wBAAwB,YAAY;AACpC,wBAAwB,YAAY;AACpC,gCAAgC,YAAY;AAC5C,iCAAiC,YAAY;AAC7C,mCAAmC,YAAY;AAE/C;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import { globalAttributesPropTypes, PropTypes } from "@elliemae/ds-props-helpers";
|
|
22
|
+
import { DSDialogSizes, DSDialogSizesArrayValues } from "./utils";
|
|
23
|
+
const propTypes = __spreadProps(__spreadValues({}, globalAttributesPropTypes), {
|
|
24
|
+
isOpen: PropTypes.bool.description("Whether the Dialog is open or not.").defaultValue(false),
|
|
25
|
+
children: PropTypes.node.description("Nested components.").isRequired,
|
|
26
|
+
centered: PropTypes.bool.description("Centers the Dialog.").defaultValue(false),
|
|
27
|
+
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),
|
|
28
|
+
onClickOutside: PropTypes.func.description("Callback that should be used to close the modal when the user clicks outside.").defaultValue(() => {
|
|
29
|
+
}),
|
|
30
|
+
onClose: PropTypes.func.description("Callback triggered with ESC key.").defaultValue(() => {
|
|
31
|
+
}),
|
|
32
|
+
size: PropTypes.oneOf(DSDialogSizesArrayValues).description(`Dialog's width size.`).defaultValue(DSDialogSizes.DEFAULT)
|
|
33
|
+
});
|
|
34
|
+
export {
|
|
35
|
+
propTypes
|
|
36
|
+
};
|
|
37
|
+
//# 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 { globalAttributesPropTypes, GlobalAttributesT, PropTypes } from '@elliemae/ds-props-helpers';\nimport { DSDialogSizes, DSDialogSizesArrayValues } from './utils';\n\nexport declare namespace DSDialogT {\n export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n export interface DefaultProps {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n zIndex: number;\n onClickOutside: () => void;\n onClose: () => void;\n }\n\n export interface PropsRequired {\n children: React.ReactNode;\n }\n\n export interface Props\n extends DefaultProps,\n PropsRequired,\n Omit<GlobalAttributesT<HTMLDivElement>, 'size' | 'children'> {}\n}\n\nexport const propTypes = {\n ...globalAttributesPropTypes,\n isOpen: PropTypes.bool.description('Whether 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('Callback that should be used to close the modal when the user clicks outside.')\n .defaultValue(() => {}),\n onClose: PropTypes.func.description('Callback triggered with ESC key.').defaultValue(() => {}),\n size: PropTypes.oneOf(DSDialogSizesArrayValues)\n .description(`Dialog's width size.`)\n .defaultValue(DSDialogSizes.DEFAULT),\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAwBO,MAAM,YAAY,iCACpB,4BADoB;AAAA,EAEvB,QAAQ,UAAU,KAAK,YAAY,sCAAsC,aAAa;AAAA,EACtF,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,UAAU,UAAU,KAAK,YAAY,uBAAuB,aAAa;AAAA,EACzE,iBAAiB,UAAU,KACxB,YACC,yIAED,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YAAY,iFACZ,aAAa,MAAM;AAAA;AAAA,EACtB,SAAS,UAAU,KAAK,YAAY,oCAAoC,aAAa,MAAM;AAAA;AAAA,EAC3F,MAAM,UAAU,MAAM,0BACnB,YAAY,wBACZ,aAAa,cAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|