@elliemae/ds-dialog 2.3.0-alpha.9 → 2.3.0-next.0

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.
Files changed (65) hide show
  1. package/cjs/DSDialog.js +124 -0
  2. package/cjs/DSDialogDatatestid.js +10 -0
  3. package/cjs/defaultProps.js +19 -0
  4. package/cjs/index.js +70 -0
  5. package/cjs/propTypes.js +32 -0
  6. package/cjs/sharedTypes.js +7 -0
  7. package/cjs/styles.js +145 -0
  8. package/cjs/utils.js +35 -0
  9. package/esm/DSDialog.js +112 -0
  10. package/esm/DSDialogDatatestid.js +6 -0
  11. package/esm/defaultProps.js +15 -0
  12. package/{dist/esm → esm}/index.js +19 -48
  13. package/esm/propTypes.js +24 -0
  14. package/esm/sharedTypes.js +5 -0
  15. package/esm/styles.js +125 -0
  16. package/esm/utils.js +28 -0
  17. package/package.json +35 -41
  18. package/types/DSDialog.d.ts +376 -0
  19. package/{dist/types → types}/DSDialogDatatestid.d.ts +0 -0
  20. package/types/defaultProps.d.ts +2 -0
  21. package/{dist/types → types}/index.d.ts +0 -0
  22. package/types/propTypes.d.ts +387 -0
  23. package/types/sharedTypes.d.ts +6 -0
  24. package/{dist/types → types}/styles.d.ts +14 -2
  25. package/{dist/types → types}/utils.d.ts +2 -1
  26. package/dist/cjs/DSDialog.js +0 -99
  27. package/dist/cjs/DSDialog.js.map +0 -7
  28. package/dist/cjs/DSDialogDatatestid.js +0 -38
  29. package/dist/cjs/DSDialogDatatestid.js.map +0 -7
  30. package/dist/cjs/DSDialogInternalTypes.js +0 -27
  31. package/dist/cjs/DSDialogInternalTypes.js.map +0 -7
  32. package/dist/cjs/DSDialogTypes.js +0 -27
  33. package/dist/cjs/DSDialogTypes.js.map +0 -7
  34. package/dist/cjs/defaultProps.js +0 -45
  35. package/dist/cjs/defaultProps.js.map +0 -7
  36. package/dist/cjs/index.js +0 -94
  37. package/dist/cjs/index.js.map +0 -7
  38. package/dist/cjs/propTypes.js +0 -46
  39. package/dist/cjs/propTypes.js.map +0 -7
  40. package/dist/cjs/styles.js +0 -151
  41. package/dist/cjs/styles.js.map +0 -7
  42. package/dist/cjs/utils.js +0 -55
  43. package/dist/cjs/utils.js.map +0 -7
  44. package/dist/esm/DSDialog.js +0 -75
  45. package/dist/esm/DSDialog.js.map +0 -7
  46. package/dist/esm/DSDialogDatatestid.js +0 -9
  47. package/dist/esm/DSDialogDatatestid.js.map +0 -7
  48. package/dist/esm/DSDialogInternalTypes.js +0 -2
  49. package/dist/esm/DSDialogInternalTypes.js.map +0 -7
  50. package/dist/esm/DSDialogTypes.js +0 -2
  51. package/dist/esm/DSDialogTypes.js.map +0 -7
  52. package/dist/esm/defaultProps.js +0 -16
  53. package/dist/esm/defaultProps.js.map +0 -7
  54. package/dist/esm/index.js.map +0 -7
  55. package/dist/esm/propTypes.js +0 -17
  56. package/dist/esm/propTypes.js.map +0 -7
  57. package/dist/esm/styles.js +0 -122
  58. package/dist/esm/styles.js.map +0 -7
  59. package/dist/esm/utils.js +0 -26
  60. package/dist/esm/utils.js.map +0 -7
  61. package/dist/types/DSDialog.d.ts +0 -5
  62. package/dist/types/DSDialogInternalTypes.d.ts +0 -25
  63. package/dist/types/DSDialogTypes.d.ts +0 -11
  64. package/dist/types/defaultProps.d.ts +0 -2
  65. package/dist/types/propTypes.d.ts +0 -2
@@ -0,0 +1,387 @@
1
+ /// <reference types="react" />
2
+ export declare namespace DSDialogT {
3
+ type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
4
+ interface DefaultProps {
5
+ isOpen: boolean;
6
+ centered: boolean;
7
+ size: Sizes;
8
+ removeAutoFocus: boolean;
9
+ zIndex: number;
10
+ onClickOutside: () => void;
11
+ onClose: () => void;
12
+ }
13
+ interface PropsRequired {
14
+ children: React.ReactNode;
15
+ }
16
+ interface Props extends DefaultProps, PropsRequired {
17
+ }
18
+ }
19
+ export declare const propTypes: {
20
+ size: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
21
+ 'aria-*': any;
22
+ 'on-*': any;
23
+ 'data-*': any;
24
+ 'all HTML attributes': any;
25
+ about: any;
26
+ accept: any;
27
+ acceptCharset: any;
28
+ accessKey: any;
29
+ action: any;
30
+ allowFullScreen: any;
31
+ allowTransparency: any;
32
+ alt: any;
33
+ 'aria-activedescendant': any;
34
+ 'aria-atomic': any;
35
+ 'aria-autocomplete': any;
36
+ 'aria-busy': any;
37
+ 'aria-checked': any;
38
+ 'aria-colcount': any;
39
+ 'aria-colindex': any;
40
+ 'aria-colspan': any;
41
+ 'aria-controls': any;
42
+ 'aria-current': any;
43
+ 'aria-describedby': any;
44
+ 'aria-details': any;
45
+ 'aria-disabled': any;
46
+ 'aria-dropeffect': any;
47
+ 'aria-errormessage': any;
48
+ 'aria-expanded': any;
49
+ 'aria-flowto': any;
50
+ 'aria-grabbed': any;
51
+ 'aria-haspopup': any;
52
+ 'aria-hidden': any;
53
+ 'aria-invalid': any;
54
+ 'aria-keyshortcuts': any;
55
+ 'aria-label': any;
56
+ 'aria-labelledby': any;
57
+ 'aria-level': any;
58
+ 'aria-live': any;
59
+ 'aria-modal': any;
60
+ 'aria-multiline': any;
61
+ 'aria-multiselectable': any;
62
+ 'aria-orientation': any;
63
+ 'aria-owns': any;
64
+ 'aria-placeholder': any;
65
+ 'aria-posinset': any;
66
+ 'aria-pressed': any;
67
+ 'aria-readonly': any;
68
+ 'aria-relevant': any;
69
+ 'aria-required': any;
70
+ 'aria-roledescription': any;
71
+ 'aria-rowcount': any;
72
+ 'aria-rowindex': any;
73
+ 'aria-rowspan': any;
74
+ 'aria-selected': any;
75
+ 'aria-setsize': any;
76
+ 'aria-sort': any;
77
+ 'aria-valuemax': any;
78
+ 'aria-valuemin': any;
79
+ 'aria-valuenow': any;
80
+ 'aria-valuetext': any;
81
+ as: any;
82
+ async: any;
83
+ autoCapitalize: any;
84
+ autoComplete: any;
85
+ autoCorrect: any;
86
+ autoFocus: any;
87
+ autoPlay: any;
88
+ autoSave: any;
89
+ capture: any;
90
+ cellPadding: any;
91
+ cellSpacing: any;
92
+ challenge: any;
93
+ charSet: any;
94
+ checked: any;
95
+ cite: any;
96
+ classID: any;
97
+ className: any;
98
+ color: any;
99
+ cols: any;
100
+ colSpan: any;
101
+ content: any;
102
+ contentEditable: any;
103
+ contextMenu: any;
104
+ controls: any;
105
+ coords: any;
106
+ crossOrigin: any;
107
+ data: any;
108
+ datatype: any;
109
+ dateTime: any;
110
+ default: any;
111
+ defaultChecked: any;
112
+ defaultValue: any;
113
+ defer: any;
114
+ dir: any;
115
+ disabled: any;
116
+ download: any;
117
+ draggable: any;
118
+ encType: any;
119
+ form: any;
120
+ formAction: any;
121
+ formEncType: any;
122
+ formMethod: any;
123
+ formNoValidate: any;
124
+ formTarget: any;
125
+ frameBorder: any;
126
+ headers: any;
127
+ height: any;
128
+ hidden: any;
129
+ high: any;
130
+ href: any;
131
+ hrefLang: any;
132
+ htmlFor: any;
133
+ httpEquiv: any;
134
+ id: any;
135
+ inlist: any;
136
+ inputMode: any;
137
+ integrity: any;
138
+ is: any;
139
+ itemID: any;
140
+ itemProp: any;
141
+ itemRef: any;
142
+ itemScope: any;
143
+ itemType: any;
144
+ keyParams: any;
145
+ keyType: any;
146
+ kind: any;
147
+ label: any;
148
+ lang: any;
149
+ list: any;
150
+ loop: any;
151
+ low: any;
152
+ manifest: any;
153
+ marginHeight: any;
154
+ marginWidth: any;
155
+ max: any;
156
+ maxLength: any;
157
+ media: any;
158
+ mediaGroup: any;
159
+ method: any;
160
+ min: any;
161
+ minLength: any;
162
+ multiple: any;
163
+ muted: any;
164
+ name: any;
165
+ nonce: any;
166
+ noValidate: any;
167
+ onAbort: any;
168
+ onAbortCapture: any;
169
+ onAnimationEnd: any;
170
+ onAnimationEndCapture: any;
171
+ onAnimationIteration: any;
172
+ onAnimationIterationCapture: any;
173
+ onAnimationStart: any;
174
+ onAnimationStartCapture: any;
175
+ onAuxClick: any;
176
+ onAuxClickCapture: any;
177
+ onBeforeInput: any;
178
+ onBeforeInputCapture: any;
179
+ onBlur: any;
180
+ onBlurCapture: any;
181
+ onCanPlay: any;
182
+ onCanPlayCapture: any;
183
+ onCanPlayThrough: any;
184
+ onCanPlayThroughCapture: any;
185
+ onChange: any;
186
+ onChangeCapture: any;
187
+ onClick: any;
188
+ onClickCapture: any;
189
+ onCompositionEnd: any;
190
+ onCompositionEndCapture: any;
191
+ onCompositionStart: any;
192
+ onCompositionStartCapture: any;
193
+ onCompositionUpdate: any;
194
+ onCompositionUpdateCapture: any;
195
+ onContextMenu: any;
196
+ onContextMenuCapture: any;
197
+ onCopy: any;
198
+ onCopyCapture: any;
199
+ onCut: any;
200
+ onCutCapture: any;
201
+ onDoubleClick: any;
202
+ onDoubleClickCapture: any;
203
+ onDrag: any;
204
+ onDragCapture: any;
205
+ onDragEnd: any;
206
+ onDragEndCapture: any;
207
+ onDragEnter: any;
208
+ onDragEnterCapture: any;
209
+ onDragExit: any;
210
+ onDragExitCapture: any;
211
+ onDragLeave: any;
212
+ onDragLeaveCapture: any;
213
+ onDragOver: any;
214
+ onDragOverCapture: any;
215
+ onDragStart: any;
216
+ onDragStartCapture: any;
217
+ onDrop: any;
218
+ onDropCapture: any;
219
+ onDurationChange: any;
220
+ onDurationChangeCapture: any;
221
+ onEmptied: any;
222
+ onEmptiedCapture: any;
223
+ onEncrypted: any;
224
+ onEncryptedCapture: any;
225
+ onEnded: any;
226
+ onEndedCapture: any;
227
+ onError: any;
228
+ onErrorCapture: any;
229
+ onFocus: any;
230
+ onFocusCapture: any;
231
+ onGotPointerCapture: any;
232
+ onGotPointerCaptureCapture: any;
233
+ onInput: any;
234
+ onInputCapture: any;
235
+ onInvalid: any;
236
+ onInvalidCapture: any;
237
+ onKeyDown: any;
238
+ onKeyDownCapture: any;
239
+ onKeyPress: any;
240
+ onKeyPressCapture: any;
241
+ onKeyUp: any;
242
+ onKeyUpCapture: any;
243
+ onLoad: any;
244
+ onLoadCapture: any;
245
+ onLoadedData: any;
246
+ onLoadedDataCapture: any;
247
+ onLoadedMetadata: any;
248
+ onLoadedMetadataCapture: any;
249
+ onLoadStart: any;
250
+ onLoadStartCapture: any;
251
+ onLostPointerCapture: any;
252
+ onLostPointerCaptureCapture: any;
253
+ onMouseDown: any;
254
+ onMouseDownCapture: any;
255
+ onMouseEnter: any;
256
+ onMouseLeave: any;
257
+ onMouseMove: any;
258
+ onMouseMoveCapture: any;
259
+ onMouseOut: any;
260
+ onMouseOutCapture: any;
261
+ onMouseOver: any;
262
+ onMouseOverCapture: any;
263
+ onMouseUp: any;
264
+ onMouseUpCapture: any;
265
+ onPaste: any;
266
+ onPasteCapture: any;
267
+ onPause: any;
268
+ onPauseCapture: any;
269
+ onPlay: any;
270
+ onPlayCapture: any;
271
+ onPlaying: any;
272
+ onPlayingCapture: any;
273
+ onPointerCancel: any;
274
+ onPointerCancelCapture: any;
275
+ onPointerDown: any;
276
+ onPointerDownCapture: any;
277
+ onPointerEnter: any;
278
+ onPointerEnterCapture: any;
279
+ onPointerLeave: any;
280
+ onPointerLeaveCapture: any;
281
+ onPointerMove: any;
282
+ onPointerMoveCapture: any;
283
+ onPointerOut: any;
284
+ onPointerOutCapture: any;
285
+ onPointerOver: any;
286
+ onPointerOverCapture: any;
287
+ onPointerUp: any;
288
+ onPointerUpCapture: any;
289
+ onProgress: any;
290
+ onProgressCapture: any;
291
+ onRateChange: any;
292
+ onRateChangeCapture: any;
293
+ onReset: any;
294
+ onResetCapture: any;
295
+ onScroll: any;
296
+ onScrollCapture: any;
297
+ onSeeked: any;
298
+ onSeekedCapture: any;
299
+ onSeeking: any;
300
+ onSeekingCapture: any;
301
+ onSelect: any;
302
+ onSelectCapture: any;
303
+ onStalled: any;
304
+ onStalledCapture: any;
305
+ onSubmit: any;
306
+ onSubmitCapture: any;
307
+ onSuspend: any;
308
+ onSuspendCapture: any;
309
+ onTimeUpdate: any;
310
+ onTimeUpdateCapture: any;
311
+ onTouchCancel: any;
312
+ onTouchCancelCapture: any;
313
+ onTouchEnd: any;
314
+ onTouchEndCapture: any;
315
+ onTouchMove: any;
316
+ onTouchMoveCapture: any;
317
+ onTouchStart: any;
318
+ onTouchStartCapture: any;
319
+ onTransitionEnd: any;
320
+ onTransitionEndCapture: any;
321
+ onVolumeChange: any;
322
+ onVolumeChangeCapture: any;
323
+ onWaiting: any;
324
+ onWaitingCapture: any;
325
+ onWheel: any;
326
+ onWheelCapture: any;
327
+ open: any;
328
+ optimum: any;
329
+ pattern: any;
330
+ placeholder: any;
331
+ playsInline: any;
332
+ poster: any;
333
+ prefix: any;
334
+ preload: any;
335
+ property: any;
336
+ radioGroup: any;
337
+ readOnly: any;
338
+ rel: any;
339
+ required: any;
340
+ resource: any;
341
+ results: any;
342
+ reversed: any;
343
+ role: any;
344
+ rows: any;
345
+ rowSpan: any;
346
+ sandbox: any;
347
+ scope: any;
348
+ scoped: any;
349
+ scrolling: any;
350
+ seamless: any;
351
+ security: any;
352
+ selected: any;
353
+ shape: any;
354
+ sizes: any;
355
+ slot: any;
356
+ span: any;
357
+ spellCheck: any;
358
+ src: any;
359
+ srcDoc: any;
360
+ srcLang: any;
361
+ srcSet: any;
362
+ start: any;
363
+ step: any;
364
+ style: any;
365
+ summary: any;
366
+ suppressContentEditableWarning: any;
367
+ suppressHydrationWarning: any;
368
+ tabIndex: any;
369
+ target: any;
370
+ title: any;
371
+ translate: any;
372
+ type: any;
373
+ typeof: any;
374
+ unselectable: any;
375
+ useMap: any;
376
+ value: any;
377
+ vocab: any;
378
+ width: any;
379
+ wmode: any;
380
+ wrap: any;
381
+ isOpen: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
382
+ children: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
383
+ centered: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
384
+ removeAutoFocus: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
385
+ onClickOutside: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
386
+ onClose: import("@elliemae/ds-props-helpers/types/propTypes/types").ReactDescT;
387
+ };
@@ -0,0 +1,6 @@
1
+ export declare namespace DSDialogInternalsT {
2
+ interface BodyInfoT {
3
+ overflow: boolean;
4
+ padding: string;
5
+ }
6
+ }
@@ -1,7 +1,18 @@
1
- import type { StyledDialogBackgroundT, FixedBodyT } from './DSDialogInternalTypes';
1
+ import { DSDialogT } from './propTypes';
2
+ import type { DSDialogInternalsT } from './sharedTypes';
3
+ interface FixedBodyT {
4
+ bodyInfo: DSDialogInternalsT.BodyInfoT;
5
+ }
6
+ interface StyledDialogBackgroundT {
7
+ zIndex: number;
8
+ }
9
+ interface StyledDialogContainerT {
10
+ size: DSDialogT.Sizes;
11
+ centered: boolean;
12
+ }
2
13
  export declare const FixedBody: import("styled-components").GlobalStyleComponent<FixedBodyT, import("styled-components").DefaultTheme>;
3
14
  export declare const StyledDialogBackground: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogBackgroundT, never>;
4
- export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, any, never>;
15
+ export declare const StyledDialogContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, StyledDialogContainerT, never>;
5
16
  export declare const DSDialogTitle: import("styled-components").StyledComponent<"h3", import("styled-components").DefaultTheme, {}, never>;
6
17
  export declare const DSDialogAddon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
18
  export declare const DSDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -13,3 +24,4 @@ export declare const DSDialogPrimaryMessage: import("styled-components").StyledC
13
24
  export declare const DSDialogSecondaryMessage: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {}, never>;
14
25
  export declare const DSDialogDefaultLayout: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
15
26
  export declare const DSDialogFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
27
+ export {};
@@ -1,4 +1,4 @@
1
- import type { GetSpaceArgsT } from './DSDialogInternalTypes';
1
+ declare type GetSpaceArgsT = Partial<Record<string, string | number>>;
2
2
  export declare const getSpaceProps: (props: GetSpaceArgsT) => GetSpaceArgsT;
3
3
  export declare const DSDialogSizes: {
4
4
  DEFAULT: "default";
@@ -17,3 +17,4 @@ export declare const allSizes: {
17
17
  'x-large': string;
18
18
  'xx-large': string;
19
19
  };
20
+ export {};
@@ -1,99 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var DSDialog_exports = {};
29
- __export(DSDialog_exports, {
30
- DSDialog: () => DSDialog,
31
- DSDialogWithSchema: () => DSDialogWithSchema
32
- });
33
- var React = __toESM(require("react"));
34
- var import_react_dom = __toESM(require("react-dom"));
35
- var import_react = __toESM(require("react"));
36
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
- var import_styles = require("./styles");
38
- var import_propTypes = require("./propTypes");
39
- var import_defaultProps = require("./defaultProps");
40
- var import_utils = require("./utils");
41
- var import_DSDialogDatatestid = require("./DSDialogDatatestid");
42
- const DSDialog = (props) => {
43
- const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_defaultProps.defaultProps);
44
- const [bodyInfo, setBodyInfo] = (0, import_react.useState)({ overflow: false, padding: "0px" });
45
- (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_propTypes.propTypes);
46
- const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;
47
- const containerRef = (0, import_react.useRef)(null);
48
- const handleOutsideClick = (0, import_react.useCallback)((e) => {
49
- if (e.target.dataset.portalbg)
50
- onClickOutside();
51
- }, [onClickOutside]);
52
- const handleOnKeyDown = (0, import_react.useCallback)((e) => {
53
- if (e.key === "Escape")
54
- onClickOutside();
55
- }, [onClickOutside]);
56
- (0, import_react.useEffect)(() => {
57
- const body = document.getElementsByTagName("body")[0];
58
- const { offsetHeight, scrollHeight } = body;
59
- const padding = window.getComputedStyle(body, null)?.getPropertyValue("padding-right");
60
- if (!isOpen)
61
- return setBodyInfo({ overflow: false, padding: "0px" });
62
- return setBodyInfo({
63
- overflow: offsetHeight < scrollHeight,
64
- padding
65
- });
66
- }, [isOpen]);
67
- (0, import_react.useEffect)(() => {
68
- if (isOpen && !removeAutoFocus)
69
- containerRef?.current?.focus();
70
- }, [isOpen, removeAutoFocus]);
71
- const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault, { onClick: handleOutsideClick });
72
- if (isOpen) {
73
- return import_react_dom.default.createPortal(/* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogBackground, {
74
- onClick: handleOutsideClick,
75
- "data-portalbg": true,
76
- "data-testid": import_DSDialogDatatestid.DSDialogDatatestid.BACKGROUND,
77
- zIndex,
78
- ...globalAttributes
79
- }, /* @__PURE__ */ import_react.default.createElement(import_styles.FixedBody, {
80
- bodyInfo
81
- }), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledDialogContainer, {
82
- role: "dialog",
83
- "aria-modal": true,
84
- ref: containerRef,
85
- tabIndex: !removeAutoFocus ? 0 : void 0,
86
- onKeyDown: handleOnKeyDown,
87
- ...(0, import_utils.getSpaceProps)(rest),
88
- size,
89
- centered,
90
- "data-testid": import_DSDialogDatatestid.DSDialogDatatestid.CONTAINER
91
- }, children)), document.getElementsByTagName("body")[0]);
92
- }
93
- return null;
94
- };
95
- DSDialog.propTypes = import_propTypes.propTypes;
96
- const DSDialogWithSchema = (0, import_ds_props_helpers.describe)(DSDialog);
97
- DSDialogWithSchema.propTypes = import_propTypes.propTypes;
98
- module.exports = __toCommonJS(DSDialog_exports);
99
- //# sourceMappingURL=DSDialog.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSDialog.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import ReactDOM from 'react-dom';\nimport React, { useCallback, useRef, useEffect, useState } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\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 { BodyInfoT, DSDialogPropsWithDefaultT } from './DSDialogInternalTypes';\nimport type { DSDialogPropsT } from './DSDialogTypes';\n\nconst DSDialog: React.ComponentType<DSDialogPropsT> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps) as DSDialogPropsWithDefaultT;\n const [bodyInfo, setBodyInfo] = useState<BodyInfoT>({ overflow: false, padding: '0px' });\n\n useValidateTypescriptPropTypes(propsWithDefault, propTypes);\n\n const { children, isOpen, onClickOutside, centered, size, removeAutoFocus, zIndex, ...rest } = propsWithDefault;\n\n const containerRef = useRef<HTMLDivElement | null>(null);\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') onClickOutside();\n },\n [onClickOutside],\n );\n\n useEffect(() => {\n const body = document.getElementsByTagName('body')[0];\n const { offsetHeight, scrollHeight } = body;\n const padding = window.getComputedStyle(body, null)?.getPropertyValue('padding-right');\n\n if (!isOpen) return setBodyInfo({ overflow: false, padding: '0px' });\n\n return setBodyInfo({\n overflow: offsetHeight < scrollHeight,\n padding,\n });\n }, [isOpen]);\n\n useEffect(() => {\n if (isOpen && !removeAutoFocus) containerRef?.current?.focus();\n }, [isOpen, removeAutoFocus]);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault, { onClick: handleOutsideClick });\n\n if (isOpen) {\n return ReactDOM.createPortal(\n <StyledDialogBackground\n onClick={handleOutsideClick}\n data-portalbg\n data-testid={DSDialogDatatestid.BACKGROUND}\n zIndex={zIndex}\n {...globalAttributes}\n >\n <FixedBody bodyInfo={bodyInfo} />\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 data-testid={DSDialogDatatestid.CONTAINER}\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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAqB;AACrB,mBAAgE;AAChE,8BAKO;AACP,oBAAyE;AACzE,uBAA0B;AAC1B,0BAA6B;AAC7B,mBAA8B;AAC9B,gCAAmC;AAInC,MAAM,WAAgD,CAAC,UAAU;AAC/D,QAAM,mBAAmB,0DAA6B,OAAO;AAC7D,QAAM,CAAC,UAAU,eAAe,2BAAoB,EAAE,UAAU,OAAO,SAAS;AAEhF,8DAA+B,kBAAkB;AAEjD,QAAM,EAAE,UAAU,QAAQ,gBAAgB,UAAU,MAAM,iBAAiB,WAAW,SAAS;AAE/F,QAAM,eAAe,yBAA8B;AAEnD,QAAM,qBAAqB,8BACzB,CAAC,MAAwB;AACvB,QAAK,EAAE,OAA0B,QAAQ;AAAU;AAAA,KAErD,CAAC;AAGH,QAAM,kBAAkB,8BACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ;AAAU;AAAA,KAE1B,CAAC;AAGH,8BAAU,MAAM;AACd,UAAM,OAAO,SAAS,qBAAqB,QAAQ;AACnD,UAAM,EAAE,cAAc,iBAAiB;AACvC,UAAM,UAAU,OAAO,iBAAiB,MAAM,OAAO,iBAAiB;AAEtE,QAAI,CAAC;AAAQ,aAAO,YAAY,EAAE,UAAU,OAAO,SAAS;AAE5D,WAAO,YAAY;AAAA,MACjB,UAAU,eAAe;AAAA,MACzB;AAAA;AAAA,KAED,CAAC;AAEJ,8BAAU,MAAM;AACd,QAAI,UAAU,CAAC;AAAiB,oBAAc,SAAS;AAAA,KACtD,CAAC,QAAQ;AAEZ,QAAM,mBAAmB,oDAAuB,kBAAkB,EAAE,SAAS;AAE7E,MAAI,QAAQ;AACV,WAAO,yBAAS,aACd,mDAAC,sCAAD;AAAA,MACE,SAAS;AAAA,MACT,iBAAa;AAAA,MACb,eAAa,6CAAmB;AAAA,MAChC;AAAA,SACI;AAAA,OAEJ,mDAAC,yBAAD;AAAA,MAAW;AAAA,QACX,mDAAC,qCAAD;AAAA,MACE,MAAK;AAAA,MACL,cAAU;AAAA,MACV,KAAK;AAAA,MACL,UAAU,CAAC,kBAAkB,IAAI;AAAA,MACjC,WAAW;AAAA,SACP,gCAAc;AAAA,MAClB;AAAA,MACA;AAAA,MACA,eAAa,6CAAmB;AAAA,OAE/B,YAGL,SAAS,qBAAqB,QAAQ;AAAA;AAI1C,SAAO;AAAA;AAGT,SAAS,YAAY;AAErB,MAAM,qBAAqB,sCAAS;AACpC,mBAAmB,YAAY;",
6
- "names": []
7
- }
@@ -1,38 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var DSDialogDatatestid_exports = {};
29
- __export(DSDialogDatatestid_exports, {
30
- DSDialogDatatestid: () => DSDialogDatatestid
31
- });
32
- var React = __toESM(require("react"));
33
- const DSDialogDatatestid = {
34
- CONTAINER: "ds-dialog-container",
35
- BACKGROUND: "ds-dialog-background"
36
- };
37
- module.exports = __toCommonJS(DSDialogDatatestid_exports);
38
- //# sourceMappingURL=DSDialogDatatestid.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSDialogDatatestid.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export const DSDialogDatatestid = {\n CONTAINER: 'ds-dialog-container',\n BACKGROUND: 'ds-dialog-background',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB;AAAA,EAChC,WAAW;AAAA,EACX,YAAY;AAAA;",
6
- "names": []
7
- }
@@ -1,27 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __reExport = (target, module2, copyDefault, desc) => {
9
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
- for (let key of __getOwnPropNames(module2))
11
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
- }
14
- return target;
15
- };
16
- var __toESM = (module2, isNodeMode) => {
17
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
- };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
- var DSDialogInternalTypes_exports = {};
25
- var React = __toESM(require("react"));
26
- module.exports = __toCommonJS(DSDialogInternalTypes_exports);
27
- //# sourceMappingURL=DSDialogInternalTypes.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSDialogInternalTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { DSDialogPropsT, Sizes } from './DSDialogTypes';\n\nexport interface BodyInfoT {\n overflow: boolean;\n padding: string;\n}\n\nexport interface DSDialogDefaultPropsT {\n isOpen: boolean;\n centered: boolean;\n size: Sizes;\n removeAutoFocus: boolean;\n onClickOutside: () => void;\n zIndex: number;\n}\n\nexport interface StyledDialogContainerPropsT {\n size: Sizes;\n centered: boolean;\n}\n\nexport interface StyledDialogBackgroundT {\n zIndex: number;\n}\n\nexport interface FixedBodyT {\n isBodyOverflow: boolean;\n}\n\nexport type DSDialogPropsWithDefaultT = Required<DSDialogPropsT>;\n\nexport type GetSpaceArgsT = Partial<Record<string, string | number>>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
- "names": []
7
- }
@@ -1,27 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __reExport = (target, module2, copyDefault, desc) => {
9
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
10
- for (let key of __getOwnPropNames(module2))
11
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
12
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
13
- }
14
- return target;
15
- };
16
- var __toESM = (module2, isNodeMode) => {
17
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
18
- };
19
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
20
- return (module2, temp) => {
21
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
22
- };
23
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
24
- var DSDialogTypes_exports = {};
25
- var React = __toESM(require("react"));
26
- module.exports = __toCommonJS(DSDialogTypes_exports);
27
- //# sourceMappingURL=DSDialogTypes.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/DSDialogTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export type Sizes = 'default' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';\n\nexport interface DSDialogPropsT {\n isOpen?: boolean;\n children: React.ReactNode;\n onClickOutside?: () => void;\n size?: Sizes;\n centered?: boolean;\n removeAutoFocus?: boolean;\n zIndex?: number;\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;",
6
- "names": []
7
- }