epic-modals 1.0.0 → 1.0.2

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 (114) hide show
  1. package/dist/core.d.ts +1558 -0
  2. package/dist/core.js +1 -1
  3. package/dist/react.d.ts +101 -12
  4. package/dist/react.js +1 -1
  5. package/dist/styles/basic.css +1 -0
  6. package/dist/styles/showcase.css +1 -0
  7. package/dist/svelte.d.ts +227 -19
  8. package/dist/svelte.js +1 -1
  9. package/dist/vanilla.d.ts +148 -3
  10. package/dist/vanilla.js +1 -1
  11. package/package.json +8 -13
  12. package/dist/core/animation/controller.d.ts +0 -58
  13. package/dist/core/animation/flip.d.ts +0 -8
  14. package/dist/core/animation/genie.d.ts +0 -14
  15. package/dist/core/animation/index.d.ts +0 -6
  16. package/dist/core/animation/timing.d.ts +0 -34
  17. package/dist/core/behaviors/drag.d.ts +0 -34
  18. package/dist/core/behaviors/focusTrap.d.ts +0 -23
  19. package/dist/core/behaviors/index.d.ts +0 -6
  20. package/dist/core/behaviors/parentChild.d.ts +0 -27
  21. package/dist/core/behaviors/resize.d.ts +0 -49
  22. package/dist/core/config/defaults.d.ts +0 -90
  23. package/dist/core/config/index.d.ts +0 -4
  24. package/dist/core/config/resolution.d.ts +0 -25
  25. package/dist/core/index.d.ts +0 -9
  26. package/dist/core/modal/Controller.d.ts +0 -70
  27. package/dist/core/modal/Controller.types.d.ts +0 -77
  28. package/dist/core/modal/Interactions.d.ts +0 -67
  29. package/dist/core/modal/Lifecycle.d.ts +0 -20
  30. package/dist/core/modal/Positioning.d.ts +0 -40
  31. package/dist/core/modal/StateManager.d.ts +0 -91
  32. package/dist/core/modal/Styling.d.ts +0 -42
  33. package/dist/core/modal/index.d.ts +0 -8
  34. package/dist/core/state/effects.d.ts +0 -16
  35. package/dist/core/state/events.d.ts +0 -15
  36. package/dist/core/state/getters.d.ts +0 -37
  37. package/dist/core/state/index.d.ts +0 -17
  38. package/dist/core/state/internal.d.ts +0 -105
  39. package/dist/core/state/layout.d.ts +0 -17
  40. package/dist/core/state/minimize.d.ts +0 -18
  41. package/dist/core/state/open-close.d.ts +0 -21
  42. package/dist/core/state/parent-child.d.ts +0 -17
  43. package/dist/core/state/pending.d.ts +0 -55
  44. package/dist/core/state/position.d.ts +0 -15
  45. package/dist/core/state/registration.d.ts +0 -15
  46. package/dist/core/state/stacking.d.ts +0 -10
  47. package/dist/core/state/zindex.d.ts +0 -8
  48. package/dist/core/types.d.ts +0 -191
  49. package/dist/core/utils/backdrop.d.ts +0 -8
  50. package/dist/core/utils/constants.d.ts +0 -193
  51. package/dist/core/utils/dock.d.ts +0 -12
  52. package/dist/core/utils/dom.d.ts +0 -31
  53. package/dist/core/utils/helpers.d.ts +0 -8
  54. package/dist/core/utils/index.d.ts +0 -8
  55. package/dist/core/utils/viewport/constraints.d.ts +0 -7
  56. package/dist/core/utils/viewport/index.d.ts +0 -7
  57. package/dist/core/utils/viewport/overlap.d.ts +0 -30
  58. package/dist/core/utils/viewport/smart-layout.d.ts +0 -3
  59. package/dist/core/utils/viewport/smart-position.d.ts +0 -36
  60. package/dist/core/utils/viewport/types.d.ts +0 -56
  61. package/dist/core/utils/viewport.d.ts +0 -3
  62. package/dist/epic-modals.css +0 -47
  63. package/dist/index.d.ts +0 -2
  64. package/dist/index.js +0 -1
  65. package/dist/react/components/Backdrop.d.ts +0 -7
  66. package/dist/react/components/ModalProvider.d.ts +0 -10
  67. package/dist/react/components/Portal.d.ts +0 -10
  68. package/dist/react/components/dock/Dock.d.ts +0 -7
  69. package/dist/react/components/dock/DockItem.d.ts +0 -16
  70. package/dist/react/components/modal/Modal.d.ts +0 -10
  71. package/dist/react/components/modal/ModalHeader.d.ts +0 -13
  72. package/dist/react/components/modal/ModalInner.d.ts +0 -17
  73. package/dist/react/components/modal/ResizeHandles.d.ts +0 -9
  74. package/dist/react/components/wizard/WizardModal.d.ts +0 -33
  75. package/dist/react/components/wizard/WizardStep.d.ts +0 -15
  76. package/dist/react/context.d.ts +0 -11
  77. package/dist/react/hooks/useConfig.d.ts +0 -25
  78. package/dist/react/useModal.d.ts +0 -23
  79. package/dist/runtime.js +0 -1
  80. package/dist/styles/animations.css +0 -1
  81. package/dist/styles/backdrop.css +0 -1
  82. package/dist/styles/dock.css +0 -1
  83. package/dist/styles/index.css +0 -1
  84. package/dist/styles/modal.css +0 -1
  85. package/dist/styles/themes/dark.css +0 -1
  86. package/dist/styles/themes/light.css +0 -1
  87. package/dist/styles/variables.css +0 -1
  88. package/dist/styles/wizard.css +0 -1
  89. package/dist/svelte/actions/appendElement.d.ts +0 -6
  90. package/dist/svelte/components/Backdrop.svelte.d.ts +0 -1
  91. package/dist/svelte/components/ModalProvider.svelte.d.ts +0 -1
  92. package/dist/svelte/components/Portal.svelte.d.ts +0 -1
  93. package/dist/svelte/components/dock/Dock.svelte.d.ts +0 -1
  94. package/dist/svelte/components/modal/Modal.svelte.d.ts +0 -1
  95. package/dist/svelte/components/modal/ModalHeader.svelte.d.ts +0 -1
  96. package/dist/svelte/components/modal/ModalInner.svelte.d.ts +0 -1
  97. package/dist/svelte/components/modal/ResizeHandles.svelte.d.ts +0 -1
  98. package/dist/svelte/components/wizard/WizardModal.svelte.d.ts +0 -1
  99. package/dist/svelte/components/wizard/WizardStep.svelte.d.ts +0 -1
  100. package/dist/svelte/context.d.ts +0 -8
  101. package/dist/svelte/hooks/index.d.ts +0 -10
  102. package/dist/svelte/hooks/useFocusTrap.svelte.d.ts +0 -11
  103. package/dist/svelte/hooks/useModal.svelte.d.ts +0 -37
  104. package/dist/svelte/hooks/useModalConfig.svelte.d.ts +0 -27
  105. package/dist/svelte/hooks/useModalZIndex.svelte.d.ts +0 -10
  106. package/dist/svelte/hooks/usePortal.svelte.d.ts +0 -8
  107. package/dist/svelte/hooks/useWindowEvent.svelte.d.ts +0 -7
  108. package/dist/svelte/stores.svelte.d.ts +0 -6
  109. package/dist/svelte/wizardContext.svelte.d.ts +0 -36
  110. package/dist/ui.js +0 -1
  111. package/dist/vanilla/VanillaBackdrop.d.ts +0 -14
  112. package/dist/vanilla/VanillaDock.d.ts +0 -24
  113. package/dist/vanilla/VanillaModal.d.ts +0 -76
  114. package/dist/vanilla/index.d.ts +0 -47
package/dist/core.d.ts ADDED
@@ -0,0 +1,1558 @@
1
+ export declare function acquireModalZIndex(): number;
2
+
3
+ export declare function animateModalsToPositions(moves: Map<string, Position>): void;
4
+
5
+ export declare const ANIMATION_DURATIONS: {
6
+ readonly minimize: 500;
7
+ readonly restore: 400;
8
+ readonly open: 400;
9
+ readonly close: 250;
10
+ readonly overlay: 200;
11
+ readonly centerAfterResize: 200;
12
+ readonly glowStabilize: 1000;
13
+ };
14
+
15
+ export declare const ANIMATION_NAMES: {
16
+ readonly MINIMIZE: "modal-genie-minimize";
17
+ readonly RESTORE: "modal-genie-restore";
18
+ readonly OPEN: "modal-genie-restore";
19
+ readonly CLOSE: "modal-close";
20
+ readonly CLOSE_CENTERED: "modal-close-centered";
21
+ readonly CHILD_APPEAR: "modal-child-appear";
22
+ readonly CHILD_DISAPPEAR: "modal-child-disappear";
23
+ };
24
+
25
+ export declare interface AnimationController {
26
+ getState(): AnimationState;
27
+ isAnimating(): boolean;
28
+ getAnimationType(): AnimationType;
29
+ getTransform(): AnimationTransform | null;
30
+ getPendingOpenSource(): Position | null;
31
+ setPendingOpenSource(source: Position | null): void;
32
+ startMinimize(customTarget?: Position, onComplete?: () => void): boolean;
33
+ startRestore(storePosition: Position | undefined, modalSize: Dimensions | undefined): void;
34
+ startOpen(): boolean;
35
+ startClose(onComplete: () => void): boolean;
36
+ forceClearMinimize(): void;
37
+ destroy(): void;
38
+ subscribe(callback: (state: AnimationState) => void): () => void;
39
+ }
40
+
41
+ export declare interface AnimationControllerOptions {
42
+
43
+ getId: () => string;
44
+
45
+ getElement: () => HTMLElement | null;
46
+
47
+ getPosition: () => Position;
48
+
49
+ setPosition: (pos: Position) => void;
50
+
51
+ getHasBeenDragged: () => boolean;
52
+
53
+ setHasBeenDragged: (value: boolean) => void;
54
+
55
+ getHasBeenResized: () => boolean;
56
+
57
+ getSize: () => Dimensions;
58
+
59
+ areAnimationsEnabled?: () => boolean;
60
+
61
+ onMinimizeComplete?: (position: Position, hasBeenDragged: boolean, size: Dimensions) => void;
62
+
63
+ onOpenStart?: () => void;
64
+ }
65
+
66
+ export declare interface AnimationDurations {
67
+
68
+ open: number;
69
+
70
+ close: number;
71
+
72
+ minimize: number;
73
+
74
+ restore: number;
75
+
76
+ easing: string;
77
+ }
78
+
79
+ export declare interface AnimationEvents {
80
+ change: AnimationState;
81
+ animationStart: {
82
+ type: AnimationType;
83
+ };
84
+ animationEnd: {
85
+ type: AnimationType;
86
+ };
87
+ }
88
+
89
+ export declare interface AnimationOverride {
90
+ open?: number;
91
+ close?: number;
92
+ minimize?: number;
93
+ restore?: number;
94
+ easing?: string;
95
+ }
96
+
97
+ export declare type AnimationPhase = 'idle' | 'prepare' | 'animate' | 'complete';
98
+
99
+ export declare interface AnimationState {
100
+ type: AnimationType;
101
+ isAnimating: boolean;
102
+ transform: AnimationTransform | null;
103
+ }
104
+
105
+ export declare interface AnimationTransform {
106
+ x: number;
107
+ y: number;
108
+ originX: number;
109
+ originY: number;
110
+ }
111
+
112
+ export declare type AnimationType = 'open' | 'close' | 'minimize' | 'restore' | 'attention' | 'none';
113
+
114
+ export declare interface AppearanceConfig {
115
+ headerLayout: HeaderLayout;
116
+ defaultWidth: string;
117
+ defaultHeight: string;
118
+ minWidth: number;
119
+ minHeight: number;
120
+ }
121
+
122
+ export declare interface AppearanceOverride {
123
+ headerLayout?: HeaderLayout;
124
+ defaultWidth?: string;
125
+ defaultHeight?: string;
126
+ minWidth?: number;
127
+ minHeight?: number;
128
+ }
129
+
130
+ export declare function applyLayoutPositions(positions: Map<string, Position>): void;
131
+
132
+ declare interface AvailableArea {
133
+ x: number;
134
+ y: number;
135
+ width: number;
136
+ height: number;
137
+ }
138
+
139
+ export declare interface BackdropConfig {
140
+
141
+ visible: boolean;
142
+
143
+ blockClicks: boolean;
144
+ }
145
+
146
+ export declare interface BaseModalProps {
147
+
148
+ id: ModalId;
149
+
150
+ title: string;
151
+
152
+ icon?: string;
153
+
154
+ description?: string;
155
+
156
+ maxWidth?: string;
157
+
158
+ preferredHeight?: string;
159
+
160
+ autoOpen?: boolean;
161
+
162
+ openSourcePosition?: Position | null;
163
+
164
+ glow?: ModalGlow;
165
+
166
+ config?: ModalConfigOverrides;
167
+
168
+ closeOnEscape?: boolean;
169
+
170
+ onClose?: () => void;
171
+ }
172
+
173
+ export declare function batchUpdates(callback: () => void): void;
174
+
175
+ export declare interface Bounds extends Position, Dimensions {
176
+ }
177
+
178
+ export declare function bringToFront(id: ModalId): void;
179
+
180
+ export declare function calculateCenteredChildPosition(parentPosition: Position, parentSize: Dimensions, childSize: Dimensions): Position;
181
+
182
+ export declare function calculateChildCenterPosition(parentId: ModalId, childWidth: number, childHeight: number): Position | null;
183
+
184
+ export declare function calculateChildPosition(parentPosition: Position, offset: Position): Position;
185
+
186
+ export declare function calculateDockDragPosition(clientX: number, clientY: number, dragOffset: Position, dockWidth: number, dockHeight: number, padding?: number): Position;
187
+
188
+ declare function calculateEqualSpaceLayout(existingModals: ModalLayoutInfo[], newModal: {
189
+ id: string;
190
+ width: number;
191
+ height: number;
192
+ } | null, options?: SmartLayoutOptions): SmartLayoutResult;
193
+ export { calculateEqualSpaceLayout }
194
+ export { calculateEqualSpaceLayout as calculateSmartLayout }
195
+
196
+ export declare function calculateMinDistance(a: {
197
+ x: number;
198
+ y: number;
199
+ width: number;
200
+ height: number;
201
+ }, b: {
202
+ x: number;
203
+ y: number;
204
+ width: number;
205
+ height: number;
206
+ }): number;
207
+
208
+ export declare function calculateMinimizeTransform(modalPosition: Position, modalSize: Dimensions, targetPosition: Position): AnimationTransform;
209
+
210
+ export declare function calculateOffsetFromParent(childPosition: Position, parentPosition: Position): Position;
211
+
212
+ export declare function calculateOpenTransform(modalPosition: Position, modalSize: Dimensions, sourcePosition: Position): AnimationTransform;
213
+
214
+ export declare function calculateOverlap(a: {
215
+ x: number;
216
+ y: number;
217
+ width: number;
218
+ height: number;
219
+ }, b: {
220
+ x: number;
221
+ y: number;
222
+ width: number;
223
+ height: number;
224
+ }): number;
225
+
226
+ export declare function calculateParentPosition(childPosition: Position, offset: Position): Position;
227
+
228
+ export declare function calculateRestoreTransform(modalPosition: Position, modalSize: Dimensions, sourcePosition: Position): AnimationTransform;
229
+
230
+ export declare function calculateTotalOverlap(x: number, y: number, width: number, height: number, existingModals: ModalBounds[], gap: number): number;
231
+
232
+ export declare function cleanupResizeListener(): void;
233
+
234
+ export declare function clearActiveAttention(id: ModalId): void;
235
+
236
+ export declare function clearPendingParentAnimation(parentId: ModalId): void;
237
+
238
+ export declare function clearPositionAnimation(id: ModalId): void;
239
+
240
+ export declare function closeAllModals(exclude?: ModalId[]): void;
241
+
242
+ export declare function closeModal(id: ModalId, force?: boolean): void;
243
+
244
+ export declare function computeAvailableArea(vw: number, vh: number, margin: number, avoidBounds: ModalBounds[], avoidMargin: number): AvailableArea;
245
+
246
+ export declare function computeCssClasses(input: ComputeCssClassesInput): string[];
247
+
248
+ export declare interface ComputeCssClassesInput {
249
+ isDragging: boolean;
250
+ isResizing: boolean;
251
+ hasBeenDragged: boolean;
252
+ isMinimizing: boolean;
253
+ isRestoring: boolean;
254
+ isOpening: boolean;
255
+ isClosing: boolean;
256
+ showCentered: boolean;
257
+ isTransparent: boolean;
258
+ glowEnabled: boolean;
259
+ hasChild: boolean;
260
+ isChildModal: boolean;
261
+ wasRestored: boolean;
262
+ isVisibleByAnimation: boolean;
263
+ isAwaitingRestore: boolean;
264
+ isAwaitingChildOpen: boolean;
265
+ isAnimatingToCenter: boolean;
266
+ isAnimatingPosition: boolean;
267
+ isAttentionAnimating: boolean;
268
+ glowStabilizing: boolean;
269
+ }
270
+
271
+ export declare interface ComputedModalState {
272
+ position: Position;
273
+ size: Dimensions;
274
+ zIndex: number;
275
+ isDragging: boolean;
276
+ isResizing: boolean;
277
+ hasBeenDragged: boolean;
278
+ hasBeenResized: boolean;
279
+ isMinimizing: boolean;
280
+ isRestoring: boolean;
281
+ isOpening: boolean;
282
+ isClosing: boolean;
283
+ isAnyAnimating: boolean;
284
+ animationTransform: AnimationTransform | null;
285
+ isVisible: boolean;
286
+ showCentered: boolean;
287
+ isAwaitingRestore: boolean;
288
+ isAwaitingChildOpen: boolean;
289
+ isVisibleByAnimation: boolean;
290
+ hasChild: boolean;
291
+ isChildModal: boolean;
292
+ showOverlay: boolean;
293
+ isTransparent: boolean;
294
+ isAttentionAnimating: boolean;
295
+ glowStabilizing: boolean;
296
+ isAnimatingPosition: boolean;
297
+ isAnimatingToCenter: boolean;
298
+ wasRestored: boolean;
299
+ overlayClosing: boolean;
300
+ glowEnabled: boolean;
301
+ draggable: boolean;
302
+ resizable: boolean;
303
+ minimizable: boolean;
304
+ dataState: string;
305
+ dataAnimationPhase: string;
306
+ style: Record<string, string | number>;
307
+ cssClasses: string[];
308
+ }
309
+
310
+ export declare function computeStyle(input: ComputeStyleInput): Record<string, string | number>;
311
+
312
+ export declare interface ComputeStyleInput {
313
+ position: Position;
314
+ hasBeenDragged: boolean;
315
+ hasBeenResized: boolean;
316
+ size: Dimensions;
317
+ animationTransform: AnimationTransform | null;
318
+ zIndex: number;
319
+ glowEnabled: boolean;
320
+ glow: ModalGlow | null;
321
+ maxWidth: string | undefined;
322
+ preferredHeight: string | undefined;
323
+
324
+ isAnimatingPosition?: boolean;
325
+ }
326
+
327
+ export declare interface ConfigResolver {
328
+
329
+ getEffectiveConfig: () => ModalLibraryConfig;
330
+
331
+ isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
332
+
333
+ getAppearance: <K extends keyof AppearanceConfig>(key: K) => AppearanceConfig[K];
334
+
335
+ getAnimation: <K extends keyof AnimationDurations>(key: K) => AnimationDurations[K];
336
+
337
+ getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
338
+
339
+ getParentChild: <K extends keyof ParentChildConfig>(key: K) => ParentChildConfig[K];
340
+ }
341
+
342
+ export declare interface ConfigResolverOptions {
343
+
344
+ getModalConfig: () => ModalConfigOverrides | undefined;
345
+
346
+ getProviderConfig: () => PartialModalLibraryConfig | undefined;
347
+ }
348
+
349
+ export declare function constrainDockPosition(position: Position, dockWidth: number, dockHeight: number): Position;
350
+
351
+ export declare function constrainSizeToViewport(x: number, y: number, width: number, height: number, options?: ViewportConstraintOptions): Bounds;
352
+
353
+ export declare function constrainToViewport(x: number, y: number, width: number, height: number, options?: ViewportConstraintOptions): Position;
354
+
355
+ export declare function consumeOpenSourcePosition(id: ModalId): Position | null;
356
+
357
+ export declare function consumePendingAttention(id: ModalId): void;
358
+
359
+ export declare function consumePendingChildRestore(id: ModalId): void;
360
+
361
+ export declare function consumePendingClose(id: ModalId): void;
362
+
363
+ export declare function consumePendingForceClose(id: ModalId): void;
364
+
365
+ export declare function consumePendingMinimize(id: ModalId): AnimationTransform | null;
366
+
367
+ export declare function consumePendingMinimizeTarget(): AnimationTransform | null;
368
+
369
+ export declare function consumePendingMinimizeWithParent(id: ModalId): void;
370
+
371
+ export declare function consumePendingOpen(id: ModalId): void;
372
+
373
+ export declare function consumePendingParentAnimation(id: ModalId): Position | null;
374
+
375
+ export declare function consumePendingParentLink(modalId?: ModalId): {
376
+ parentId: ModalId;
377
+ childId: ModalId;
378
+ } | null;
379
+
380
+ export declare function consumePendingRestore(id: ModalId): void;
381
+
382
+ export declare function containsFocus(container: HTMLElement): boolean;
383
+
384
+ export declare function createAnimationController(options: AnimationControllerOptions): AnimationController;
385
+
386
+ export declare function createConfigHelper(modalConfig?: DeepPartial<{
387
+ features?: Partial<ModalFeatures>;
388
+ appearance?: Partial<AppearanceConfig>;
389
+ positioning?: Partial<PositioningConfig>;
390
+ }>, providerConfig?: PartialModalLibraryConfig): ModalConfigHelper;
391
+
392
+ export declare function createConfigResolver(options: ConfigResolverOptions): ConfigResolver;
393
+
394
+ export declare function createDragBehavior(options?: DragBehaviorOptions): DragBehavior;
395
+
396
+ export declare function createEventEmitter<T>(): {
397
+
398
+ on<K extends keyof T>(event: K, callback: EventCallback<T[K]>): () => void;
399
+
400
+ emit<K extends keyof T>(event: K, data: T[K]): void;
401
+
402
+ off<K extends keyof T>(event?: K): void;
403
+
404
+ listenerCount<K extends keyof T>(event: K): number;
405
+ };
406
+
407
+ export declare function createFocusTrap(container: HTMLElement): {
408
+
409
+ activate(): void;
410
+
411
+ deactivate(): void;
412
+
413
+ handleKeyDown(event: KeyboardEvent): void;
414
+
415
+ containsFocus(): boolean;
416
+ };
417
+
418
+ export declare function createModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
419
+
420
+ export declare function createModalController(options: ModalControllerOptions): ModalController;
421
+
422
+ export declare function createModalRegistration(props: CreateModalRegistrationProps): Omit<ModalState, 'zIndex' | 'isAnimating'>;
423
+
424
+ export declare interface CreateModalRegistrationProps {
425
+ id: ModalId;
426
+ title: string;
427
+ icon?: string;
428
+ autoOpen?: boolean;
429
+ glow?: ModalGlow | null;
430
+ }
431
+
432
+ export declare function createResizeBehavior(options: ResizeBehaviorOptions): ResizeBehavior;
433
+
434
+ declare const CSS_2: {
435
+ readonly modal: "modal-dialog";
436
+ readonly modalDragging: "modal-dragging";
437
+ readonly modalResizing: "modal-resizing";
438
+ readonly modalPositioned: "modal-positioned";
439
+ readonly modalMinimizing: "modal-minimizing";
440
+ readonly modalRestoring: "modal-restoring";
441
+ readonly modalOpening: "modal-opening";
442
+ readonly modalClosing: "modal-closing";
443
+ readonly modalCentered: "modal-centered";
444
+ readonly modalSolid: "modal-solid";
445
+ readonly modalTransparent: "modal-transparent";
446
+ readonly modalGlow: "modal-glow";
447
+ readonly modalHasGlow: "modal-has-glow";
448
+ readonly modalHasChild: "modal-has-child";
449
+ readonly modalIsChild: "modal-is-child";
450
+ readonly modalWasRestored: "modal-was-restored";
451
+ readonly modalVisibleByAnimation: "modal-visible-by-animation";
452
+ readonly modalAwaitingRestore: "modal-awaiting-restore";
453
+ readonly modalAwaitingChildOpen: "modal-awaiting-child-open";
454
+ readonly modalAnimatingToCenter: "modal-animating-to-center";
455
+ readonly modalAnimatingPosition: "modal-animating-position";
456
+ readonly modalAttention: "modal-attention";
457
+ readonly modalGlowStabilizing: "modal-glow-stabilizing";
458
+ readonly header: "modal-header";
459
+ readonly headerDraggable: "modal-header-draggable";
460
+ readonly body: "modal-body";
461
+ readonly footer: "modal-footer";
462
+ readonly childOverlay: "modal-child-overlay";
463
+ readonly overlayClosing: "modal-overlay-closing";
464
+ readonly headerTitle: "modal-header-title";
465
+ readonly headerIcon: "modal-header-icon";
466
+ readonly headerTitleGroup: "modal-header-title-group";
467
+ readonly headerActions: "modal-header-actions";
468
+ readonly headerTrafficLights: "modal-header-traffic-lights";
469
+ readonly headerLight: "modal-header-light";
470
+ readonly headerLightClose: "modal-header-light-close";
471
+ readonly headerLightMinimize: "modal-header-light-minimize";
472
+ readonly headerLightStyle: "modal-header-light-style";
473
+ readonly headerLightDisabled: "modal-header-light-disabled";
474
+ readonly headerMacCenter: "modal-header-mac-center";
475
+ readonly headerMacSpacer: "modal-header-mac-spacer";
476
+ readonly headerBtnWindows: "modal-header-btn-windows";
477
+ readonly headerBtnWindowsClose: "modal-header-btn-windows-close";
478
+ readonly headerBtnWindowsStyle: "modal-header-btn-windows-style";
479
+ readonly headerBtnWindowsDisabled: "modal-header-btn-windows-disabled";
480
+ readonly resizeHandles: "modal-resize-handles";
481
+ readonly resizeHandle: "modal-resize-handle";
482
+ readonly resizeN: "modal-resize-n";
483
+ readonly resizeS: "modal-resize-s";
484
+ readonly resizeE: "modal-resize-e";
485
+ readonly resizeW: "modal-resize-w";
486
+ readonly resizeNE: "modal-resize-ne";
487
+ readonly resizeNW: "modal-resize-nw";
488
+ readonly resizeSE: "modal-resize-se";
489
+ readonly resizeSW: "modal-resize-sw";
490
+ readonly resizePrefix: "modal-resize-";
491
+ readonly dock: "modal-dock";
492
+ readonly dockContainer: "modal-dock-container";
493
+ readonly dockItem: "modal-dock-item";
494
+ readonly dockItemActive: "modal-dock-item-active";
495
+ readonly dockItemHasGlow: "modal-dock-item-has-glow";
496
+ readonly dockItemHasChild: "modal-dock-item-has-child";
497
+ readonly dockItemLabelBeside: "modal-dock-item-label-beside";
498
+ readonly dockItemLabelBelow: "modal-dock-item-label-below";
499
+ readonly dockItemIcon: "modal-dock-item-icon";
500
+ readonly dockItemIconPlaceholder: "modal-dock-item-icon-placeholder";
501
+ readonly dockItemLabel: "modal-dock-item-label";
502
+ readonly dockItemGlow: "modal-dock-item-glow";
503
+ readonly dockChildIndicator: "modal-dock-child-indicator";
504
+ readonly dockHandle: "modal-dock-handle";
505
+ readonly dockHandleDragging: "modal-dock-handle-dragging";
506
+ readonly dockLeft: "modal-dock-left";
507
+ readonly dockRight: "modal-dock-right";
508
+ readonly dockBottom: "modal-dock-bottom";
509
+ readonly dockFree: "modal-dock-free";
510
+ readonly dockEmpty: "modal-dock-empty";
511
+ readonly dockFreeHorizontal: "modal-dock-free-horizontal";
512
+ readonly dockFreeVertical: "modal-dock-free-vertical";
513
+ readonly backdrop: "modal-backdrop";
514
+ readonly backdropVisible: "modal-backdrop-visible";
515
+ readonly srOnly: "sr-only";
516
+ readonly reactBodyContent: "react-modal-body-content";
517
+ readonly reactFooterContent: "react-modal-footer-content";
518
+ };
519
+ export { CSS_2 as CSS }
520
+
521
+ export declare const CSS_CLASSES: {
522
+ readonly dialog: "modal-dialog";
523
+ readonly dialogCentered: "modal-centered";
524
+ readonly dialogDragging: "modal-dragging";
525
+ readonly dialogResizing: "modal-resizing";
526
+ readonly dialogMinimizing: "modal-minimizing";
527
+ readonly dialogRestoring: "modal-restoring";
528
+ readonly dialogOpening: "modal-opening";
529
+ readonly dialogClosing: "modal-closing";
530
+ readonly dialogSolid: "modal-solid";
531
+ readonly dialogTransparent: "modal-transparent";
532
+ readonly dialogHasGlow: "modal-has-glow";
533
+ readonly dialogHasChild: "modal-has-child";
534
+ readonly dialogIsChild: "modal-is-child";
535
+ readonly dialogAnimatingPosition: "modal-animating-position";
536
+ readonly dialogAttention: "modal-attention";
537
+ readonly header: "modal-header";
538
+ readonly headerDraggable: "modal-header-draggable";
539
+ readonly headerLayout: (layout: string) => string;
540
+ readonly body: "modal-body";
541
+ readonly footer: "modal-footer";
542
+ readonly childOverlay: "modal-child-overlay";
543
+ readonly overlayClosing: "modal-overlay-closing";
544
+ readonly headerTitle: "modal-header-title";
545
+ readonly headerIcon: "modal-header-icon";
546
+ readonly headerTitleGroup: "modal-header-title-group";
547
+ readonly headerActions: "modal-header-actions";
548
+ readonly headerTrafficLights: "modal-header-traffic-lights";
549
+ readonly headerLight: "modal-header-light";
550
+ readonly headerLightClose: "modal-header-light-close";
551
+ readonly headerLightMinimize: "modal-header-light-minimize";
552
+ readonly headerLightStyle: "modal-header-light-style";
553
+ readonly headerLightDisabled: "modal-header-light-disabled";
554
+ readonly headerMacCenter: "modal-header-mac-center";
555
+ readonly headerMacSpacer: "modal-header-mac-spacer";
556
+ readonly headerBtnWindows: "modal-header-btn-windows";
557
+ readonly headerBtnWindowsClose: "modal-header-btn-windows-close";
558
+ readonly headerBtnWindowsStyle: "modal-header-btn-windows-style";
559
+ readonly headerBtnWindowsDisabled: "modal-header-btn-windows-disabled";
560
+ readonly resizeHandles: "modal-resize-handles";
561
+ readonly resizeHandle: "modal-resize-handle";
562
+ readonly resizePrefix: "modal-resize-";
563
+ readonly dock: "modal-dock";
564
+ readonly dockContainer: "modal-dock-container";
565
+ readonly dockItem: "modal-dock-item";
566
+ readonly dockItemActive: "modal-dock-item-active";
567
+ readonly dockItemHasGlow: "modal-dock-item-has-glow";
568
+ readonly dockItemHasChild: "modal-dock-item-has-child";
569
+ readonly dockItemLabelBeside: "modal-dock-item-label-beside";
570
+ readonly dockItemLabelBelow: "modal-dock-item-label-below";
571
+ readonly dockItemIcon: "modal-dock-item-icon";
572
+ readonly dockItemIconPlaceholder: "modal-dock-item-icon-placeholder";
573
+ readonly dockItemLabel: "modal-dock-item-label";
574
+ readonly dockItemGlow: "modal-dock-item-glow";
575
+ readonly dockChildIndicator: "modal-dock-child-indicator";
576
+ readonly dockHandle: "modal-dock-handle";
577
+ readonly dockHandleDragging: "modal-dock-handle-dragging";
578
+ readonly dockLeft: "modal-dock-left";
579
+ readonly dockRight: "modal-dock-right";
580
+ readonly dockBottom: "modal-dock-bottom";
581
+ readonly dockFree: "modal-dock-free";
582
+ readonly dockEmpty: "modal-dock-empty";
583
+ readonly dockFreeHorizontal: "modal-dock-free-horizontal";
584
+ readonly dockFreeVertical: "modal-dock-free-vertical";
585
+ readonly backdrop: "modal-backdrop";
586
+ readonly backdropVisible: "modal-backdrop-visible";
587
+ };
588
+
589
+ export declare const DATA_ATTRIBUTES: {
590
+ readonly modalId: "data-modal-id";
591
+ readonly resizeDirection: "data-direction";
592
+ readonly dockItemId: "data-dock-item-id";
593
+ };
594
+
595
+ export declare const DATA_ATTRS: {
596
+ readonly modalId: "data-modal-id";
597
+ readonly dockContainer: "data-dock-container";
598
+ readonly resizeDir: "data-resize-dir";
599
+ readonly modalBridge: "data-modal-bridge";
600
+ };
601
+
602
+ export declare type DeepPartial<T> = {
603
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
604
+ };
605
+
606
+ export declare const defaultConfig: ModalLibraryConfig;
607
+
608
+ export declare const DEFAULTS: {
609
+ readonly minWidth: 280;
610
+ readonly minHeight: 200;
611
+ readonly maxWidth: "600px";
612
+ readonly zIndexBase: 1000;
613
+ };
614
+
615
+ export declare interface Dimensions {
616
+
617
+ width: number;
618
+
619
+ height: number;
620
+ }
621
+
622
+ export declare interface DockConfig {
623
+
624
+ position: DockPosition;
625
+
626
+ labelMode: DockLabelMode;
627
+
628
+ enableReorder: boolean;
629
+
630
+ enableFreeDrag: boolean;
631
+ }
632
+
633
+ export declare type DockLabelMode = 'hidden' | 'beside' | 'below';
634
+
635
+ export declare type DockOrientation = 'horizontal' | 'vertical';
636
+
637
+ export declare type DockPosition = 'left' | 'right' | 'bottom' | 'free';
638
+
639
+ export declare type DockPositionGetter = () => {
640
+ x: number;
641
+ y: number;
642
+ width: number;
643
+ height: number;
644
+ };
645
+
646
+ export declare interface DragBehavior {
647
+ getState(): DragState;
648
+ getPosition(): Position;
649
+ isDragging(): boolean;
650
+ hasBeenDragged(): boolean;
651
+ setPosition(position: Position): void;
652
+ setHasBeenDragged(value: boolean): void;
653
+ reset(): void;
654
+ constrainToViewport(modalSize: Dimensions): void;
655
+ onPointerDown(e: PointerEvent, element: HTMLElement): void;
656
+ onPointerMove(e: PointerEvent, modalSize: Dimensions): void;
657
+ onPointerUp(e: PointerEvent, element: HTMLElement): void;
658
+ subscribe(callback: (state: DragState) => void): () => void;
659
+ destroy(): void;
660
+ }
661
+
662
+ export declare interface DragBehaviorOptions {
663
+ initialPosition?: Position;
664
+ constrain?: boolean;
665
+ }
666
+
667
+ export declare interface DragEvents {
668
+ change: DragState;
669
+ dragStart: Position;
670
+ dragMove: Position;
671
+ dragEnd: Position;
672
+ }
673
+
674
+ export declare interface DragState {
675
+ isDragging: boolean;
676
+ position: Position;
677
+ hasBeenDragged: boolean;
678
+ }
679
+
680
+ export declare const DURATIONS: {
681
+ readonly minimize: 500;
682
+ readonly restore: 400;
683
+ readonly open: 400;
684
+ readonly close: 250;
685
+ readonly attention: 300;
686
+ readonly parentMove: 300;
687
+
688
+ readonly parentRetargetInterval: 100;
689
+ readonly centerAfterResize: 200;
690
+ readonly glowStabilize: 1000;
691
+ readonly overlayFade: 200;
692
+ };
693
+
694
+ export declare const EASINGS: {
695
+
696
+ readonly easeOut: "ease-out";
697
+
698
+ readonly easeOutCubic: "cubic-bezier(0.25, 0.1, 0.25, 1)";
699
+
700
+ readonly linear: "linear";
701
+
702
+ readonly easeInOut: "ease-in-out";
703
+ };
704
+
705
+ export declare function endAttentionAnimation(_id: ModalId): void;
706
+
707
+ export declare type EventCallback<T = void> = (data: T) => void;
708
+
709
+ export declare type EventEmitter<T> = ReturnType<typeof createEventEmitter<T>>;
710
+
711
+ export declare interface ExternalElementProps {
712
+
713
+ bodyElement?: HTMLElement | null;
714
+
715
+ footerElement?: HTMLElement | null;
716
+
717
+ iconElement?: HTMLElement | null;
718
+ }
719
+
720
+ export declare function finalizeChildMinimize(id: ModalId): void;
721
+
722
+ export declare function finalizeModalClose(id: ModalId): void;
723
+
724
+ export declare function findChildModalElement(childId: string): HTMLElement | null;
725
+
726
+ export declare function findParentModalElement(parentId: string): HTMLElement | null;
727
+
728
+ export declare function findRootAncestor(modalId: string, getParentId: (id: string) => string | undefined): string;
729
+
730
+ export declare function flipAnimate(element: HTMLElement, oldPosition: Position, newPosition: Position, options?: {
731
+ duration?: number;
732
+ easing?: string;
733
+ onComplete?: () => void;
734
+ }): () => void;
735
+
736
+ export declare const FOCUSABLE_SELECTORS: string;
737
+
738
+ export declare function focusFirstElement(container: HTMLElement): boolean;
739
+
740
+ export declare function focusLastElement(container: HTMLElement): boolean;
741
+
742
+ export declare function getAncestorIds(modalId: string, getParentId: (id: string) => string | undefined): string[];
743
+
744
+ export declare function getBackdropConfig(): BackdropConfig;
745
+
746
+ export declare function getConfig(): ModalLibraryConfig;
747
+
748
+ export declare function getConfigVersion(): number;
749
+
750
+ export declare function getDefaultDockTarget(): Position;
751
+
752
+ export declare function getDescendantIds(modalId: string, getChildId: (id: string) => string | undefined): string[];
753
+
754
+ export declare function getDockClasses(dockPosition: 'left' | 'right' | 'bottom' | 'free', orientation: 'horizontal' | 'vertical'): string;
755
+
756
+ export declare function getDockContainerClasses(dockPosition: 'left' | 'right' | 'bottom' | 'free', isEmpty: boolean): string;
757
+
758
+ export declare function getDockItemElement(id: ModalId): HTMLElement | null;
759
+
760
+ export declare function getDockItemPosition(modalId: string, fallback?: Position): Position;
761
+
762
+ export declare function getDockOrder(): ModalId[];
763
+
764
+ export declare function getDuration(type: AnimationType): number;
765
+
766
+ export declare function getEasing(type: AnimationType): string;
767
+
768
+ export declare function getElementBounds(selectors: string[]): ModalBounds[];
769
+
770
+ export declare function getFocusableElements(container: HTMLElement): HTMLElement[];
771
+
772
+ export declare function _getInternalState(): {
773
+ modals: Map<string, ModalState>;
774
+ pendingMinimize: string[];
775
+ pendingOpen: string[];
776
+ pendingClose: string[];
777
+ pendingRestore: string[];
778
+ dockOrder: string[];
779
+ animatingModals: Set<string>;
780
+ transparentModals: Set<string>;
781
+ };
782
+
783
+ export declare function getLayerZIndex(layer: StackingLayerName): number;
784
+
785
+ export declare function getMinimizedModals(): ModalState[];
786
+
787
+ export declare function getModalBounds(element: HTMLElement): {
788
+ position: Position;
789
+ size: Dimensions;
790
+ };
791
+
792
+ export declare function getModalLayoutInfos(): ModalLayoutInfo[];
793
+
794
+ export declare function getModalsStore(): Map<ModalId, ModalState>;
795
+
796
+ export declare function getModalState(id: ModalId): ModalState | undefined;
797
+
798
+ export declare function getModalsToClose(fromIdOrExclude: ModalId | ModalId[]): ModalId[];
799
+
800
+ export declare function getOpenModalBounds(excludeId?: ModalId): ModalBounds[];
801
+
802
+ export declare function getOpenModalBoundsWithIds(excludeId?: ModalId): Array<{
803
+ id: string;
804
+ x: number;
805
+ y: number;
806
+ width: number;
807
+ height: number;
808
+ }>;
809
+
810
+ export declare function getOpenSourcePosition(id: ModalId): Position | null;
811
+
812
+ export declare function getPendingParentAnimation(id: ModalId): Position | null;
813
+
814
+ export declare function getPendingParentLink(): {
815
+ parentId: ModalId;
816
+ childId: ModalId;
817
+ } | null;
818
+
819
+ export declare function getStateVersion(): number;
820
+
821
+ export declare function handleWindowResize(): void;
822
+
823
+ export declare function hasOpenModals(): boolean;
824
+
825
+ export declare function hasPendingAttention(id: ModalId): boolean;
826
+
827
+ export declare function hasPendingChildRestore(id: ModalId): boolean;
828
+
829
+ export declare function hasPendingClose(id: ModalId): boolean;
830
+
831
+ export declare function hasPendingForceClose(id: ModalId): boolean;
832
+
833
+ export declare function hasPendingMinimize(id: ModalId): boolean;
834
+
835
+ export declare function hasPendingMinimizeWithParent(id: ModalId): boolean;
836
+
837
+ export declare function hasPendingOpen(id: ModalId): boolean;
838
+
839
+ export declare function hasPendingParentAnimation(id: ModalId): boolean;
840
+
841
+ export declare function hasPendingParentLinkFor(id: ModalId): boolean;
842
+
843
+ export declare function hasPendingRestore(id: ModalId): boolean;
844
+
845
+ export declare type HeaderLayout = 'macos' | 'windows' | 'none';
846
+
847
+ export declare function hideChildWithParent(parentId: ModalId): void;
848
+
849
+ export declare function initializeResizeListener(): void;
850
+
851
+ export declare function initializeStacking(): void;
852
+
853
+ export declare interface InteractionConfigHelper {
854
+ isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
855
+ }
856
+
857
+ export declare interface InteractionDragBehavior {
858
+ onPointerDown: (e: PointerEvent, element: HTMLElement) => void;
859
+ onPointerMove: (e: PointerEvent, modalSize: {
860
+ width: number;
861
+ height: number;
862
+ }) => void;
863
+ onPointerUp: (e: PointerEvent, element: HTMLElement) => void;
864
+ isDragging: () => boolean;
865
+ getPosition: () => {
866
+ x: number;
867
+ y: number;
868
+ };
869
+ hasBeenDragged: () => boolean;
870
+ }
871
+
872
+ export declare interface InteractionResizeBehavior {
873
+ startResize: (e: PointerEvent, direction: ResizeDirection) => void;
874
+ hasBeenResized: () => boolean;
875
+ getSize: () => {
876
+ width: number;
877
+ height: number;
878
+ };
879
+ justFinishedResizing: () => boolean;
880
+ }
881
+
882
+ export declare interface InteractionState {
883
+ hasChild: boolean;
884
+ }
885
+
886
+ export declare function isBackdropEnabled(): boolean;
887
+
888
+ export declare function isFeatureEnabled(feature: keyof ModalFeatures): boolean;
889
+
890
+ export declare function isModalAnimating(id: ModalId): boolean;
891
+
892
+ export declare function isModalOpen(id: ModalId): boolean;
893
+
894
+ export declare function isModalRegistered(id: ModalId): boolean;
895
+
896
+ export declare function isTopModal(id: ModalId): boolean;
897
+
898
+ export declare function linkModals(parentId: ModalId, childId: ModalId, offset: Position): void;
899
+
900
+ export declare function mergeConfig(base: ModalLibraryConfig, override: PartialModalLibraryConfig): ModalLibraryConfig;
901
+
902
+ export declare function minimizeModal(id: ModalId): void;
903
+
904
+ export declare type ModalAnimationState = 'closed' | 'opening' | 'open' | 'closing' | 'minimizing' | 'minimized' | 'restoring';
905
+
906
+ export declare interface ModalBounds {
907
+ x: number;
908
+ y: number;
909
+ width: number;
910
+ height: number;
911
+ }
912
+
913
+ export declare interface ModalBoundsWithId extends ModalBounds {
914
+ id: string;
915
+ }
916
+
917
+ export declare interface ModalConfigHelper {
918
+ isFeatureEnabled: (feature: keyof ModalFeatures) => boolean;
919
+ getAppearance: <K extends keyof AppearanceConfig>(key: K) => AppearanceConfig[K];
920
+ getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
921
+ getEffectiveConfig: () => ModalLibraryConfig;
922
+ }
923
+
924
+ export declare interface ModalConfigOverrides {
925
+ features?: ModalFeaturesOverride;
926
+ appearance?: AppearanceOverride;
927
+ animations?: AnimationOverride;
928
+ positioning?: PositioningOverride;
929
+ parentChild?: ParentChildOverride;
930
+ }
931
+
932
+ export declare class ModalController {
933
+ private id;
934
+ private dataId;
935
+ private options;
936
+ private drag;
937
+ private resize;
938
+ private animation;
939
+ private positioning;
940
+ private lifecycle;
941
+ private interactions;
942
+ private stateManager;
943
+ private overlayClosing;
944
+ private emitter;
945
+ private unsubscribeState;
946
+ private cachedState;
947
+ constructor(options: ModalControllerOptions);
948
+
949
+ mount(element: HTMLElement): void;
950
+
951
+ destroy(): void;
952
+
953
+ private get element();
954
+
955
+ private handleWindowResize;
956
+
957
+ private register;
958
+
959
+ getState(): ComputedModalState;
960
+
961
+ subscribe(callback: (state: ComputedModalState) => void): () => void;
962
+ private notifyStateChange;
963
+
964
+ startDrag(e: PointerEvent): void;
965
+
966
+ startResize(e: PointerEvent, direction: ResizeDirection): void;
967
+
968
+ handlePointerMove(e: PointerEvent): void;
969
+
970
+ handlePointerUp(e: PointerEvent): void;
971
+
972
+ handleKeyDown(e: KeyboardEvent): void;
973
+
974
+ handleTabKey(e: KeyboardEvent): void;
975
+
976
+ minimize(): void;
977
+
978
+ close(): void;
979
+
980
+ toggleTransparency(): void;
981
+
982
+ bringToFront(): void;
983
+
984
+ setOpenSourcePosition(position: Position | null): void;
985
+
986
+ updateGlow(glow: ModalControllerOptions['glow']): void;
987
+
988
+ focusFirst(): void;
989
+ private handleResizeEnd;
990
+ private handleStateChange;
991
+ private handlePendingStates;
992
+ getId(): ModalId;
993
+ getDataId(): string;
994
+ getElement(): HTMLElement | null;
995
+ }
996
+
997
+ export declare interface ModalControllerEvents {
998
+ stateChange: ComputedModalState;
999
+ close: void;
1000
+ }
1001
+
1002
+ export declare interface ModalControllerOptions {
1003
+
1004
+ id: ModalId;
1005
+
1006
+ title: string;
1007
+
1008
+ icon?: string;
1009
+
1010
+ config?: ModalConfigOverrides;
1011
+
1012
+ providerConfig?: Partial<ModalLibraryConfig>;
1013
+
1014
+ maxWidth?: string;
1015
+
1016
+ preferredHeight?: string;
1017
+
1018
+ glow?: ModalGlow;
1019
+
1020
+ closeOnEscape?: boolean;
1021
+
1022
+ autoOpen?: boolean;
1023
+
1024
+ openSourcePosition?: Position | null;
1025
+
1026
+ onClose?: () => void;
1027
+
1028
+ skipRegistration?: boolean;
1029
+
1030
+ configHelper: ModalConfigHelper;
1031
+ }
1032
+
1033
+ export declare interface ModalFeatures {
1034
+ dock: boolean;
1035
+ minimize: boolean;
1036
+ transparency: boolean;
1037
+ resize: boolean;
1038
+ drag: boolean;
1039
+ focusTrap: boolean;
1040
+ animations: boolean;
1041
+
1042
+ backdrop: boolean | BackdropConfig;
1043
+ parentChild: boolean;
1044
+ }
1045
+
1046
+ export declare interface ModalFeaturesOverride {
1047
+ dock?: boolean;
1048
+ minimize?: boolean;
1049
+ transparency?: boolean;
1050
+ resize?: boolean;
1051
+ drag?: boolean;
1052
+ focusTrap?: boolean;
1053
+ animations?: boolean;
1054
+ backdrop?: boolean | BackdropConfig;
1055
+ parentChild?: boolean;
1056
+ }
1057
+
1058
+ export declare interface ModalGlow {
1059
+ color: string;
1060
+ intensity: 'minimum' | 'low' | 'medium' | 'high';
1061
+ }
1062
+
1063
+ export declare interface ModalHeaderBaseProps {
1064
+ title: string;
1065
+
1066
+ icon?: string;
1067
+ isTransparent?: boolean;
1068
+ titleId?: string;
1069
+ headerLayout?: HeaderLayout;
1070
+ minimizable?: boolean;
1071
+ minimizeDisabled?: boolean;
1072
+ transparencyEnabled?: boolean;
1073
+ }
1074
+
1075
+ export declare type ModalId = string;
1076
+
1077
+ export declare class ModalInteractions {
1078
+ private options;
1079
+ constructor(options: ModalInteractionsOptions);
1080
+
1081
+ startDrag(e: PointerEvent): void;
1082
+
1083
+ startResize(e: PointerEvent, direction: ResizeDirection): void;
1084
+
1085
+ handlePointerMove(e: PointerEvent): void;
1086
+
1087
+ handlePointerUp(e: PointerEvent): void;
1088
+
1089
+ handleKeyDown(e: KeyboardEvent): void;
1090
+
1091
+ handleTabKey(e: KeyboardEvent): void;
1092
+
1093
+ focusFirst(): void;
1094
+ }
1095
+
1096
+ export declare interface ModalInteractionsOptions {
1097
+ id: string;
1098
+ configHelper: InteractionConfigHelper;
1099
+ getDragBehavior: () => InteractionDragBehavior;
1100
+ getResizeBehavior: () => InteractionResizeBehavior;
1101
+ getElement: () => HTMLElement | null;
1102
+ getState: () => InteractionState;
1103
+ onDragMove: () => void;
1104
+ onDragEnd: () => void;
1105
+ onClose?: () => void;
1106
+ closeOnEscape?: boolean;
1107
+ isTopModal: () => boolean;
1108
+ }
1109
+
1110
+ export declare interface ModalLayoutInfo {
1111
+ id: string;
1112
+ width: number;
1113
+ height: number;
1114
+ currentPosition: Position;
1115
+
1116
+ parentId?: string;
1117
+ }
1118
+
1119
+ export declare interface ModalLibraryConfig {
1120
+ features: ModalFeatures;
1121
+ dock: DockConfig;
1122
+ animations: AnimationDurations;
1123
+ appearance: AppearanceConfig;
1124
+ zIndex: ZIndexConfig;
1125
+ parentChild: ParentChildConfig;
1126
+ positioning: PositioningConfig;
1127
+
1128
+ portalTarget: string | HTMLElement;
1129
+ }
1130
+
1131
+ export declare class ModalLifecycle {
1132
+ private element;
1133
+ private resizeHandler;
1134
+ private options;
1135
+ constructor(options?: ModalLifecycleOptions);
1136
+
1137
+ mount(element: HTMLElement): void;
1138
+
1139
+ destroy(): void;
1140
+
1141
+ getElement(): HTMLElement | null;
1142
+
1143
+ isMounted(): boolean;
1144
+ }
1145
+
1146
+ export declare interface ModalLifecycleOptions {
1147
+ onMount?: () => void;
1148
+ onDestroy?: () => void;
1149
+ onWindowResize?: () => void;
1150
+ }
1151
+
1152
+ export declare class ModalPositioning {
1153
+ private id;
1154
+ private dataId;
1155
+ private configHelper;
1156
+ private getDragBehavior;
1157
+ private getElement;
1158
+ constructor(options: ModalPositioningOptions);
1159
+
1160
+ constrainToViewport(size: Dimensions): void;
1161
+
1162
+ shouldApplySmartPositioning(): boolean;
1163
+
1164
+ applySmartPositioning(): boolean;
1165
+
1166
+ scheduleSmartPositioning(): void;
1167
+
1168
+ centerChildOnParent(parentId: ModalId): boolean;
1169
+
1170
+ scheduleCenterChildOnParent(parentId: ModalId): void;
1171
+ }
1172
+
1173
+ export declare interface ModalPositioningOptions {
1174
+
1175
+ id: ModalId;
1176
+
1177
+ dataId: string;
1178
+
1179
+ configHelper: PositioningConfigHelper;
1180
+
1181
+ getDragBehavior: () => DragBehavior;
1182
+
1183
+ getElement: () => HTMLElement | null;
1184
+ }
1185
+
1186
+ export declare interface ModalState {
1187
+ id: ModalId;
1188
+ title: string;
1189
+ icon: string;
1190
+ iconBadge?: string;
1191
+ isOpen: boolean;
1192
+ isMinimized: boolean;
1193
+ isHiddenWithParent: boolean;
1194
+ isTransparent: boolean;
1195
+ isAnimating: boolean;
1196
+ isAnimatingPosition?: boolean;
1197
+ isRejected: boolean;
1198
+ zIndex: number;
1199
+ position: Position | null;
1200
+ size: Dimensions | null;
1201
+ hasBeenDragged: boolean;
1202
+ dockPosition: number;
1203
+ glow: ModalGlow | null;
1204
+ content?: unknown;
1205
+ contentBg?: string;
1206
+ parentId?: ModalId;
1207
+ childId?: ModalId;
1208
+ offsetFromParent?: Position;
1209
+ lastChildId?: ModalId;
1210
+ }
1211
+
1212
+ export declare class ModalStateManager {
1213
+ private id;
1214
+ private options;
1215
+ private _isHandlingMinimize;
1216
+ private _isAttentionAnimating;
1217
+ private _wasRestored;
1218
+ private _glowStabilizing;
1219
+ private _restoreHold;
1220
+ private _isAnimatingToCenter;
1221
+ private _cancelParentAnimationCleanup;
1222
+ private _parentFlipInFlight;
1223
+ private _deferredParentTarget;
1224
+ private _parentFlipStartTime;
1225
+ constructor(options: ModalStateManagerOptions);
1226
+
1227
+ handlePendingStates(): void;
1228
+
1229
+ private handlePendingForceClose;
1230
+
1231
+ private handlePendingMinimize;
1232
+
1233
+ private handlePendingMinimizeWithParent;
1234
+
1235
+ private handlePendingRestore;
1236
+
1237
+ private handlePendingChildRestore;
1238
+
1239
+ private handlePendingClose;
1240
+
1241
+ private handlePendingParentLink;
1242
+
1243
+ private handlePendingOpen;
1244
+
1245
+ private openChildModalWithAnimation;
1246
+
1247
+ private openStandaloneModalWithAnimation;
1248
+
1249
+ private handlePendingAttention;
1250
+
1251
+ private handlePendingParentAnimation;
1252
+
1253
+ private startParentFlip;
1254
+
1255
+ private handleChildCentering;
1256
+ get wasRestored(): boolean;
1257
+ set wasRestored(value: boolean);
1258
+ get isAttentionAnimating(): boolean;
1259
+ get glowStabilizing(): boolean;
1260
+ set glowStabilizing(value: boolean);
1261
+ get restoreHold(): boolean;
1262
+ set restoreHold(value: boolean);
1263
+ get isAnimatingToCenter(): boolean;
1264
+ set isAnimatingToCenter(value: boolean);
1265
+ get isHandlingMinimize(): boolean;
1266
+ }
1267
+
1268
+ export declare interface ModalStateManagerOptions {
1269
+
1270
+ id: ModalId;
1271
+
1272
+ options: {
1273
+ glow?: unknown;
1274
+ openSourcePosition?: Position | null;
1275
+ onClose?: () => void;
1276
+ };
1277
+
1278
+ getDragBehavior: () => DragBehavior;
1279
+
1280
+ getResizeBehavior: () => ResizeBehavior;
1281
+
1282
+ getAnimationController: () => AnimationController;
1283
+
1284
+ getElement: () => HTMLElement | null;
1285
+
1286
+ getPositioning: () => StateManagerPositioning;
1287
+
1288
+ onStateChange: () => void;
1289
+
1290
+ focusFirst: () => void;
1291
+ }
1292
+
1293
+ export declare function normalizeBackdropConfig(backdrop: boolean | BackdropConfig): BackdropConfig;
1294
+
1295
+ export declare function onAnimationEnd(element: HTMLElement, animationName?: string, timeout?: number): Promise<AnimationEvent>;
1296
+
1297
+ export declare function openChildModal(childId: ModalId, parentId: ModalId, source: HTMLElement | Position): void;
1298
+
1299
+ export declare function openModal(id: ModalId, source: HTMLElement | Position, options?: OpenModalOptions): void;
1300
+
1301
+ export declare interface OpenModalOptions {
1302
+
1303
+ parentId?: ModalId;
1304
+ }
1305
+
1306
+ export declare interface ParentChildConfig {
1307
+
1308
+ movementMode: 'realtime' | 'animated';
1309
+
1310
+ animationDuration: number;
1311
+ }
1312
+
1313
+ export declare interface ParentChildOverride {
1314
+ movementMode?: 'realtime' | 'animated';
1315
+ animationDuration?: number;
1316
+ }
1317
+
1318
+ export declare type PartialModalLibraryConfig = DeepPartial<ModalLibraryConfig>;
1319
+
1320
+ export declare interface Position {
1321
+
1322
+ x: number;
1323
+
1324
+ y: number;
1325
+ }
1326
+
1327
+ export declare interface PositioningConfig {
1328
+
1329
+ strategy: 'centered' | 'smart';
1330
+
1331
+ modalGap: number;
1332
+
1333
+ avoidElements: string[];
1334
+ }
1335
+
1336
+ export declare interface PositioningConfigHelper {
1337
+ getPositioning: <K extends keyof PositioningConfig>(key: K) => PositioningConfig[K];
1338
+ }
1339
+
1340
+ export declare interface PositioningOverride {
1341
+ strategy?: 'centered' | 'smart';
1342
+ modalGap?: number;
1343
+ avoidElements?: string[];
1344
+ }
1345
+
1346
+ export declare function registerModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
1347
+
1348
+ export declare interface RegistryCallbacks {
1349
+ mountModal: (id: ModalId) => void;
1350
+ isRegisteredInRegistry: (id: ModalId) => boolean;
1351
+ unmountModal: (id: ModalId) => void;
1352
+ }
1353
+
1354
+ export declare function reorderDock(newOrderOrFromIndex: ModalId[] | number, toIndex?: number): void;
1355
+
1356
+ export declare function resetConfig(): void;
1357
+
1358
+ export declare function _resetInternalState(): void;
1359
+
1360
+ export declare function resetModalTransparency(id: ModalId): void;
1361
+
1362
+ export declare function resetStacking(): void;
1363
+
1364
+ export declare const RESIZE_DIRECTION_LABELS: Record<ResizeDirection_2, string>;
1365
+
1366
+ export declare const RESIZE_DIRECTIONS: readonly ["n", "s", "e", "w", "ne", "nw", "se", "sw"];
1367
+
1368
+ export declare interface ResizeBehavior {
1369
+ getState(): ResizeState;
1370
+ getSize(): Dimensions;
1371
+ isResizing(): boolean;
1372
+ hasBeenResized(): boolean;
1373
+ justFinishedResizing(): boolean;
1374
+ setSize(size: Dimensions): void;
1375
+ reset(): void;
1376
+ constrainToViewport(): void;
1377
+ startResize(e: PointerEvent, direction: ResizeDirection): void;
1378
+ subscribe(callback: (state: ResizeState) => void): () => void;
1379
+ destroy(): void;
1380
+ }
1381
+
1382
+ export declare interface ResizeBehaviorOptions {
1383
+ minWidth?: number;
1384
+ minHeight?: number;
1385
+ getPosition: () => Position;
1386
+ setPosition: (pos: Position) => void;
1387
+ getHasBeenDragged: () => boolean;
1388
+ setHasBeenDragged: (value: boolean) => void;
1389
+ getElement: () => HTMLElement | null;
1390
+ getSymmetricResize?: () => boolean;
1391
+ onResizeEnd?: (position: Position, size: Dimensions) => void;
1392
+ }
1393
+
1394
+ export declare type ResizeDirection = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw' | '';
1395
+
1396
+ declare type ResizeDirection_2 = typeof RESIZE_DIRECTIONS[number];
1397
+
1398
+ export declare interface ResizeEvents {
1399
+ change: ResizeState;
1400
+ resizeStart: {
1401
+ direction: ResizeDirection;
1402
+ };
1403
+ resizeMove: {
1404
+ size: Dimensions;
1405
+ position: Position;
1406
+ };
1407
+ resizeEnd: {
1408
+ size: Dimensions;
1409
+ position: Position;
1410
+ };
1411
+ }
1412
+
1413
+ export declare interface ResizeState {
1414
+ isResizing: boolean;
1415
+ direction: ResizeDirection;
1416
+ size: Dimensions;
1417
+ hasBeenResized: boolean;
1418
+ }
1419
+
1420
+ export declare function restoreAllMinimizedModals(): void;
1421
+
1422
+ export declare function restoreChildModal(id: ModalId): void;
1423
+
1424
+ export declare function restoreModal(id: ModalId): void;
1425
+
1426
+ export declare function setConfig(config: PartialModalLibraryConfig): void;
1427
+
1428
+ export declare function setDockPositionGetterInternal(getter: DockPositionGetter | null): void;
1429
+
1430
+ export declare function setModalAnimating(id: ModalId, animating: boolean): void;
1431
+
1432
+ declare function setRegistryCallbacksInternal(callbacks: RegistryCallbacks | null): void;
1433
+ export { setRegistryCallbacksInternal }
1434
+ export { setRegistryCallbacksInternal as setRegistryFunctions }
1435
+
1436
+ export declare function setupAnimationEndListener(element: HTMLElement, callback: (animationName: string) => void): () => void;
1437
+
1438
+ declare function setURLCallbacks(callbacks: URLStateCallbacks | null): void;
1439
+ export { setURLCallbacks }
1440
+ export { setURLCallbacks as setURLStateCallbacks }
1441
+
1442
+ export declare function shakeElement(element: HTMLElement): void;
1443
+
1444
+ export declare function shouldChildBeVisible(parentIsOpen: boolean, parentIsMinimized: boolean, parentIsHiddenWithParent: boolean): boolean;
1445
+
1446
+ export declare interface SmartLayoutOptions {
1447
+
1448
+ modalGap?: number;
1449
+
1450
+ viewportMargin?: number;
1451
+
1452
+ avoidBounds?: ModalBounds[];
1453
+
1454
+ avoidMargin?: number;
1455
+ }
1456
+
1457
+ export declare interface SmartLayoutResult {
1458
+
1459
+ positions: Map<string, Position>;
1460
+ }
1461
+
1462
+ export declare interface SmartPositionOptions {
1463
+
1464
+ modalGap?: number;
1465
+
1466
+ margin?: number;
1467
+
1468
+ gridResolution?: number;
1469
+
1470
+ avoidBounds?: ModalBounds[];
1471
+
1472
+ avoidMargin?: number;
1473
+ }
1474
+
1475
+ export declare type StackingLayerName = 'BASE' | 'DROPDOWN' | 'STICKY' | 'OVERLAY' | 'MODAL' | 'DOCK' | 'TOAST';
1476
+
1477
+ export declare function startAttentionAnimation(_id: ModalId): void;
1478
+
1479
+ export declare interface StateManagerPositioning {
1480
+ centerChildOnParent: (parentId: ModalId) => boolean;
1481
+ scheduleCenterChildOnParent: (parentId: ModalId) => void;
1482
+ applySmartPositioning: () => void;
1483
+ scheduleSmartPositioning: () => void;
1484
+ }
1485
+
1486
+ export declare function storeOpenSourcePosition(id: ModalId, position: Position): void;
1487
+
1488
+ export declare function subscribe(callback: () => void): () => void;
1489
+
1490
+ export declare function subscribeToConfig(callback: () => void): () => void;
1491
+
1492
+ export declare function toDataId(id: ModalId): string;
1493
+
1494
+ export declare function toggleModalTransparency(id: ModalId): void;
1495
+
1496
+ export declare function transformToCSSVars(transform: AnimationTransform): Record<string, string>;
1497
+
1498
+ export declare function trapFocus(event: KeyboardEvent, container: HTMLElement): void;
1499
+
1500
+ export declare function triggerAttention(id: ModalId): void;
1501
+
1502
+ export declare function triggerCascadingParentAnimations(childId: ModalId): void;
1503
+
1504
+ export declare function triggerRearrangement(newModal: {
1505
+ id: string;
1506
+ width: number;
1507
+ height: number;
1508
+ } | null): void;
1509
+
1510
+ export declare function triggerRejection(id: ModalId): void;
1511
+
1512
+ export declare function unhideChildModal(id: ModalId): void;
1513
+
1514
+ export declare function unregisterModal(id: ModalId): void;
1515
+
1516
+ export declare function updateModal(id: ModalId, updates: Partial<ModalState>): void;
1517
+
1518
+ export declare function updateModalPosition(id: ModalId, position: Position, options?: {
1519
+ constrain?: boolean;
1520
+ drag?: boolean;
1521
+ size?: Dimensions;
1522
+ realtime?: boolean;
1523
+ }): void;
1524
+
1525
+ export declare function updateModalSize(id: ModalId, size: Dimensions): void;
1526
+
1527
+ export declare interface URLStateCallbacks {
1528
+ push: (id: ModalId) => void;
1529
+ replace: (id: ModalId) => void;
1530
+ pop: () => void;
1531
+ }
1532
+
1533
+ export declare interface ViewportConstraintOptions {
1534
+
1535
+ margin?: number;
1536
+
1537
+ allowPartialVisibility?: boolean;
1538
+ }
1539
+
1540
+ declare interface WhenDOMReadyOptions {
1541
+
1542
+ timeout?: number;
1543
+
1544
+ pollInterval?: number;
1545
+ }
1546
+
1547
+ export declare function whenHasDimensions(element: () => HTMLElement | null, options?: WhenDOMReadyOptions): Promise<HTMLElement>;
1548
+
1549
+ export declare interface ZIndexConfig {
1550
+
1551
+ base: number;
1552
+
1553
+ dock: number;
1554
+
1555
+ toast: number;
1556
+ }
1557
+
1558
+ export { }