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
@@ -1,15 +0,0 @@
1
- import { ModalId, ModalState, Position, Dimensions } from '../types';
2
-
3
- export declare function updateModalPosition(id: ModalId, position: Position, options?: {
4
- constrain?: boolean;
5
- drag?: boolean;
6
- size?: Dimensions;
7
- realtime?: boolean;
8
- }): void;
9
-
10
- export declare function clearPositionAnimation(id: ModalId): void;
11
-
12
- export declare function updateModalSize(id: ModalId, size: Dimensions): void;
13
-
14
- export declare function updateModal(id: ModalId, updates: Partial<ModalState>): void;
15
- //# sourceMappingURL=position.d.ts.map
@@ -1,15 +0,0 @@
1
- import { ModalState, ModalId, ModalGlow } from '../types';
2
-
3
- export interface CreateModalRegistrationProps {
4
- id: ModalId;
5
- title: string;
6
- icon?: string;
7
- autoOpen?: boolean;
8
- glow?: ModalGlow | null;
9
- }
10
- export declare function createModalRegistration(props: CreateModalRegistrationProps): Omit<ModalState, 'zIndex' | 'isAnimating'>;
11
-
12
- export declare function registerModal(modal: Omit<ModalState, 'zIndex' | 'isAnimating'>): void;
13
-
14
- export declare function unregisterModal(id: ModalId): void;
15
- //# sourceMappingURL=registration.d.ts.map
@@ -1,10 +0,0 @@
1
- import { StackingLayerName } from '../types';
2
-
3
- export declare function initializeStacking(): void;
4
-
5
- export declare function acquireModalZIndex(): number;
6
-
7
- export declare function getLayerZIndex(layer: StackingLayerName): number;
8
-
9
- export declare function resetStacking(): void;
10
- //# sourceMappingURL=stacking.d.ts.map
@@ -1,8 +0,0 @@
1
- import { ModalId } from '../types';
2
-
3
- export declare function bringToFront(id: ModalId): void;
4
-
5
- export declare function isTopModal(id: ModalId): boolean;
6
-
7
- export declare function reorderDock(newOrderOrFromIndex: ModalId[] | number, toIndex?: number): void;
8
- //# sourceMappingURL=zindex.d.ts.map
@@ -1,191 +0,0 @@
1
-
2
-
3
- export type ModalId = string;
4
-
5
- export interface Position {
6
-
7
- x: number;
8
-
9
- y: number;
10
- }
11
-
12
- export interface Dimensions {
13
-
14
- width: number;
15
-
16
- height: number;
17
- }
18
- export interface Bounds extends Position, Dimensions {
19
- }
20
- export interface ModalGlow {
21
- color: string;
22
- intensity: 'minimum' | 'low' | 'medium' | 'high';
23
- }
24
- export interface ModalState {
25
- id: ModalId;
26
- title: string;
27
- icon: string;
28
- iconBadge?: string;
29
- isOpen: boolean;
30
- isMinimized: boolean;
31
- isHiddenWithParent: boolean;
32
- isTransparent: boolean;
33
- isAnimating: boolean;
34
- isAnimatingPosition?: boolean;
35
- isRejected: boolean;
36
- zIndex: number;
37
- position: Position | null;
38
- size: Dimensions | null;
39
- hasBeenDragged: boolean;
40
- dockPosition: number;
41
- glow: ModalGlow | null;
42
- content?: unknown;
43
- contentBg?: string;
44
- parentId?: ModalId;
45
- childId?: ModalId;
46
- offsetFromParent?: Position;
47
- lastChildId?: ModalId;
48
- }
49
- export interface AnimationTransform {
50
- x: number;
51
- y: number;
52
- originX: number;
53
- originY: number;
54
- }
55
- export type DockPosition = 'left' | 'right' | 'bottom' | 'free';
56
- export type DockOrientation = 'horizontal' | 'vertical';
57
- export type DockLabelMode = 'hidden' | 'beside' | 'below';
58
- export type HeaderLayout = 'macos' | 'windows' | 'none';
59
- export type StackingLayerName = 'BASE' | 'DROPDOWN' | 'STICKY' | 'OVERLAY' | 'MODAL' | 'DOCK' | 'TOAST';
60
-
61
- export interface BackdropConfig {
62
-
63
- visible: boolean;
64
-
65
- blockClicks: boolean;
66
- }
67
-
68
- export interface ModalFeatures {
69
- dock: boolean;
70
- minimize: boolean;
71
- transparency: boolean;
72
- resize: boolean;
73
- drag: boolean;
74
- focusTrap: boolean;
75
- animations: boolean;
76
-
77
- backdrop: boolean | BackdropConfig;
78
- parentChild: boolean;
79
- }
80
-
81
- export interface AppearanceConfig {
82
- headerLayout: HeaderLayout;
83
- defaultWidth: string;
84
- defaultHeight: string;
85
- minWidth: number;
86
- minHeight: number;
87
- }
88
-
89
- export type DeepPartial<T> = {
90
- [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
91
- };
92
-
93
- export interface ModalFeaturesOverride {
94
- dock?: boolean;
95
- minimize?: boolean;
96
- transparency?: boolean;
97
- resize?: boolean;
98
- drag?: boolean;
99
- focusTrap?: boolean;
100
- animations?: boolean;
101
- backdrop?: boolean | BackdropConfig;
102
- parentChild?: boolean;
103
- }
104
-
105
- export interface AppearanceOverride {
106
- headerLayout?: HeaderLayout;
107
- defaultWidth?: string;
108
- defaultHeight?: string;
109
- minWidth?: number;
110
- minHeight?: number;
111
- }
112
-
113
- export interface AnimationOverride {
114
- open?: number;
115
- close?: number;
116
- minimize?: number;
117
- restore?: number;
118
- easing?: string;
119
- }
120
-
121
- export interface PositioningOverride {
122
- strategy?: 'centered' | 'smart';
123
- modalGap?: number;
124
- avoidElements?: string[];
125
- }
126
-
127
- export interface ParentChildOverride {
128
- movementMode?: 'realtime' | 'animated';
129
- animationDuration?: number;
130
- }
131
-
132
- export interface ModalConfigOverrides {
133
- features?: ModalFeaturesOverride;
134
- appearance?: AppearanceOverride;
135
- animations?: AnimationOverride;
136
- positioning?: PositioningOverride;
137
- parentChild?: ParentChildOverride;
138
- }
139
-
140
- export type ModalAnimationState = 'closed' | 'opening' | 'open' | 'closing' | 'minimizing' | 'minimized' | 'restoring';
141
-
142
- export type AnimationPhase = 'idle' | 'prepare' | 'animate' | 'complete';
143
-
144
- export interface BaseModalProps {
145
-
146
- id: ModalId;
147
-
148
- title: string;
149
-
150
- icon?: string;
151
-
152
- description?: string;
153
-
154
- maxWidth?: string;
155
-
156
- preferredHeight?: string;
157
-
158
- autoOpen?: boolean;
159
-
160
- openSourcePosition?: Position | null;
161
-
162
- glow?: ModalGlow;
163
-
164
- config?: ModalConfigOverrides;
165
-
166
- closeOnEscape?: boolean;
167
-
168
- onClose?: () => void;
169
- }
170
-
171
- export interface ExternalElementProps {
172
-
173
- bodyElement?: HTMLElement | null;
174
-
175
- footerElement?: HTMLElement | null;
176
-
177
- iconElement?: HTMLElement | null;
178
- }
179
-
180
- export interface ModalHeaderBaseProps {
181
- title: string;
182
-
183
- icon?: string;
184
- isTransparent?: boolean;
185
- titleId?: string;
186
- headerLayout?: HeaderLayout;
187
- minimizable?: boolean;
188
- minimizeDisabled?: boolean;
189
- transparencyEnabled?: boolean;
190
- }
191
- //# sourceMappingURL=types.d.ts.map
@@ -1,8 +0,0 @@
1
- import { BackdropConfig } from '../types';
2
-
3
- export declare function hasOpenModals(): boolean;
4
-
5
- export declare function getBackdropConfig(): BackdropConfig;
6
-
7
- export declare function isBackdropEnabled(): boolean;
8
- //# sourceMappingURL=backdrop.d.ts.map
@@ -1,193 +0,0 @@
1
-
2
-
3
- export declare const CSS: {
4
- readonly modal: "modal-dialog";
5
- readonly modalDragging: "modal-dragging";
6
- readonly modalResizing: "modal-resizing";
7
- readonly modalPositioned: "modal-positioned";
8
- readonly modalMinimizing: "modal-minimizing";
9
- readonly modalRestoring: "modal-restoring";
10
- readonly modalOpening: "modal-opening";
11
- readonly modalClosing: "modal-closing";
12
- readonly modalCentered: "modal-centered";
13
- readonly modalSolid: "modal-solid";
14
- readonly modalTransparent: "modal-transparent";
15
- readonly modalGlow: "modal-glow";
16
- readonly modalHasGlow: "modal-has-glow";
17
- readonly modalHasChild: "modal-has-child";
18
- readonly modalIsChild: "modal-is-child";
19
- readonly modalWasRestored: "modal-was-restored";
20
- readonly modalVisibleByAnimation: "modal-visible-by-animation";
21
- readonly modalAwaitingRestore: "modal-awaiting-restore";
22
- readonly modalAwaitingChildOpen: "modal-awaiting-child-open";
23
- readonly modalAnimatingToCenter: "modal-animating-to-center";
24
- readonly modalAnimatingPosition: "modal-animating-position";
25
- readonly modalAttention: "modal-attention";
26
- readonly modalGlowStabilizing: "modal-glow-stabilizing";
27
- readonly header: "modal-header";
28
- readonly headerDraggable: "modal-header-draggable";
29
- readonly body: "modal-body";
30
- readonly footer: "modal-footer";
31
- readonly childOverlay: "modal-child-overlay";
32
- readonly overlayClosing: "modal-overlay-closing";
33
- readonly headerTitle: "modal-header-title";
34
- readonly headerIcon: "modal-header-icon";
35
- readonly headerTitleGroup: "modal-header-title-group";
36
- readonly headerActions: "modal-header-actions";
37
- readonly headerTrafficLights: "modal-header-traffic-lights";
38
- readonly headerLight: "modal-header-light";
39
- readonly headerLightClose: "modal-header-light-close";
40
- readonly headerLightMinimize: "modal-header-light-minimize";
41
- readonly headerLightStyle: "modal-header-light-style";
42
- readonly headerLightDisabled: "modal-header-light-disabled";
43
- readonly headerMacCenter: "modal-header-mac-center";
44
- readonly headerMacSpacer: "modal-header-mac-spacer";
45
- readonly headerBtnWindows: "modal-header-btn-windows";
46
- readonly headerBtnWindowsClose: "modal-header-btn-windows-close";
47
- readonly headerBtnWindowsStyle: "modal-header-btn-windows-style";
48
- readonly headerBtnWindowsDisabled: "modal-header-btn-windows-disabled";
49
- readonly resizeHandles: "modal-resize-handles";
50
- readonly resizeHandle: "modal-resize-handle";
51
- readonly resizeN: "modal-resize-n";
52
- readonly resizeS: "modal-resize-s";
53
- readonly resizeE: "modal-resize-e";
54
- readonly resizeW: "modal-resize-w";
55
- readonly resizeNE: "modal-resize-ne";
56
- readonly resizeNW: "modal-resize-nw";
57
- readonly resizeSE: "modal-resize-se";
58
- readonly resizeSW: "modal-resize-sw";
59
- readonly resizePrefix: "modal-resize-";
60
- readonly dock: "modal-dock";
61
- readonly dockContainer: "modal-dock-container";
62
- readonly dockItem: "modal-dock-item";
63
- readonly dockItemActive: "modal-dock-item-active";
64
- readonly dockItemHasGlow: "modal-dock-item-has-glow";
65
- readonly dockItemHasChild: "modal-dock-item-has-child";
66
- readonly dockItemLabelBeside: "modal-dock-item-label-beside";
67
- readonly dockItemLabelBelow: "modal-dock-item-label-below";
68
- readonly dockItemIcon: "modal-dock-item-icon";
69
- readonly dockItemIconPlaceholder: "modal-dock-item-icon-placeholder";
70
- readonly dockItemLabel: "modal-dock-item-label";
71
- readonly dockItemGlow: "modal-dock-item-glow";
72
- readonly dockChildIndicator: "modal-dock-child-indicator";
73
- readonly dockHandle: "modal-dock-handle";
74
- readonly dockHandleDragging: "modal-dock-handle-dragging";
75
- readonly dockLeft: "modal-dock-left";
76
- readonly dockRight: "modal-dock-right";
77
- readonly dockBottom: "modal-dock-bottom";
78
- readonly dockFree: "modal-dock-free";
79
- readonly dockEmpty: "modal-dock-empty";
80
- readonly dockFreeHorizontal: "modal-dock-free-horizontal";
81
- readonly dockFreeVertical: "modal-dock-free-vertical";
82
- readonly backdrop: "modal-backdrop";
83
- readonly backdropVisible: "modal-backdrop-visible";
84
- readonly srOnly: "sr-only";
85
- readonly reactBodyContent: "react-modal-body-content";
86
- readonly reactFooterContent: "react-modal-footer-content";
87
- };
88
-
89
- export declare const CSS_CLASSES: {
90
- readonly dialog: "modal-dialog";
91
- readonly dialogCentered: "modal-centered";
92
- readonly dialogDragging: "modal-dragging";
93
- readonly dialogResizing: "modal-resizing";
94
- readonly dialogMinimizing: "modal-minimizing";
95
- readonly dialogRestoring: "modal-restoring";
96
- readonly dialogOpening: "modal-opening";
97
- readonly dialogClosing: "modal-closing";
98
- readonly dialogSolid: "modal-solid";
99
- readonly dialogTransparent: "modal-transparent";
100
- readonly dialogHasGlow: "modal-has-glow";
101
- readonly dialogHasChild: "modal-has-child";
102
- readonly dialogIsChild: "modal-is-child";
103
- readonly dialogAnimatingPosition: "modal-animating-position";
104
- readonly dialogAttention: "modal-attention";
105
- readonly header: "modal-header";
106
- readonly headerDraggable: "modal-header-draggable";
107
- readonly headerLayout: (layout: string) => string;
108
- readonly body: "modal-body";
109
- readonly footer: "modal-footer";
110
- readonly childOverlay: "modal-child-overlay";
111
- readonly overlayClosing: "modal-overlay-closing";
112
- readonly headerTitle: "modal-header-title";
113
- readonly headerIcon: "modal-header-icon";
114
- readonly headerTitleGroup: "modal-header-title-group";
115
- readonly headerActions: "modal-header-actions";
116
- readonly headerTrafficLights: "modal-header-traffic-lights";
117
- readonly headerLight: "modal-header-light";
118
- readonly headerLightClose: "modal-header-light-close";
119
- readonly headerLightMinimize: "modal-header-light-minimize";
120
- readonly headerLightStyle: "modal-header-light-style";
121
- readonly headerLightDisabled: "modal-header-light-disabled";
122
- readonly headerMacCenter: "modal-header-mac-center";
123
- readonly headerMacSpacer: "modal-header-mac-spacer";
124
- readonly headerBtnWindows: "modal-header-btn-windows";
125
- readonly headerBtnWindowsClose: "modal-header-btn-windows-close";
126
- readonly headerBtnWindowsStyle: "modal-header-btn-windows-style";
127
- readonly headerBtnWindowsDisabled: "modal-header-btn-windows-disabled";
128
- readonly resizeHandles: "modal-resize-handles";
129
- readonly resizeHandle: "modal-resize-handle";
130
- readonly resizePrefix: "modal-resize-";
131
- readonly dock: "modal-dock";
132
- readonly dockContainer: "modal-dock-container";
133
- readonly dockItem: "modal-dock-item";
134
- readonly dockItemActive: "modal-dock-item-active";
135
- readonly dockItemHasGlow: "modal-dock-item-has-glow";
136
- readonly dockItemHasChild: "modal-dock-item-has-child";
137
- readonly dockItemLabelBeside: "modal-dock-item-label-beside";
138
- readonly dockItemLabelBelow: "modal-dock-item-label-below";
139
- readonly dockItemIcon: "modal-dock-item-icon";
140
- readonly dockItemIconPlaceholder: "modal-dock-item-icon-placeholder";
141
- readonly dockItemLabel: "modal-dock-item-label";
142
- readonly dockItemGlow: "modal-dock-item-glow";
143
- readonly dockChildIndicator: "modal-dock-child-indicator";
144
- readonly dockHandle: "modal-dock-handle";
145
- readonly dockHandleDragging: "modal-dock-handle-dragging";
146
- readonly dockLeft: "modal-dock-left";
147
- readonly dockRight: "modal-dock-right";
148
- readonly dockBottom: "modal-dock-bottom";
149
- readonly dockFree: "modal-dock-free";
150
- readonly dockEmpty: "modal-dock-empty";
151
- readonly dockFreeHorizontal: "modal-dock-free-horizontal";
152
- readonly dockFreeVertical: "modal-dock-free-vertical";
153
- readonly backdrop: "modal-backdrop";
154
- readonly backdropVisible: "modal-backdrop-visible";
155
- };
156
-
157
- export declare const DATA_ATTRS: {
158
- readonly modalId: "data-modal-id";
159
- readonly dockContainer: "data-dock-container";
160
- readonly resizeDir: "data-resize-dir";
161
- readonly modalBridge: "data-modal-bridge";
162
- };
163
-
164
- export declare const DATA_ATTRIBUTES: {
165
- readonly modalId: "data-modal-id";
166
- readonly resizeDirection: "data-direction";
167
- readonly dockItemId: "data-dock-item-id";
168
- };
169
-
170
- export declare const RESIZE_DIRECTIONS: readonly ["n", "s", "e", "w", "ne", "nw", "se", "sw"];
171
- export type ResizeDirection = typeof RESIZE_DIRECTIONS[number];
172
-
173
- export declare const RESIZE_DIRECTION_LABELS: Record<ResizeDirection, string>;
174
-
175
- export declare const ANIMATION_DURATIONS: {
176
- readonly minimize: 500;
177
- readonly restore: 400;
178
- readonly open: 400;
179
- readonly close: 250;
180
- readonly overlay: 200;
181
- readonly centerAfterResize: 200;
182
- readonly glowStabilize: 1000;
183
- };
184
-
185
- export declare const DEFAULTS: {
186
- readonly minWidth: 280;
187
- readonly minHeight: 200;
188
- readonly maxWidth: "600px";
189
- readonly zIndexBase: 1000;
190
- };
191
-
192
- export declare const FOCUSABLE_SELECTORS: string;
193
- //# sourceMappingURL=constants.d.ts.map
@@ -1,12 +0,0 @@
1
- import { ModalState, Position } from '../types';
2
-
3
- export declare function getMinimizedModals(): ModalState[];
4
-
5
- export declare function constrainDockPosition(position: Position, dockWidth: number, dockHeight: number): Position;
6
-
7
- export declare function calculateDockDragPosition(clientX: number, clientY: number, dragOffset: Position, dockWidth: number, dockHeight: number, padding?: number): Position;
8
-
9
- export declare function getDockContainerClasses(dockPosition: 'left' | 'right' | 'bottom' | 'free', isEmpty: boolean): string;
10
-
11
- export declare function getDockClasses(dockPosition: 'left' | 'right' | 'bottom' | 'free', orientation: 'horizontal' | 'vertical'): string;
12
- //# sourceMappingURL=dock.d.ts.map
@@ -1,31 +0,0 @@
1
-
2
- export interface WhenDOMReadyOptions {
3
-
4
- timeout?: number;
5
-
6
- pollInterval?: number;
7
- }
8
-
9
- export declare function whenDOMReady(element: () => HTMLElement | null, condition: (el: HTMLElement) => boolean, options?: WhenDOMReadyOptions): Promise<HTMLElement>;
10
-
11
- export declare function whenHasDimensions(element: () => HTMLElement | null, options?: WhenDOMReadyOptions): Promise<HTMLElement>;
12
-
13
- export declare function whenExists(selector: string, options?: WhenDOMReadyOptions): Promise<HTMLElement>;
14
-
15
- export declare function whenAnimationIdle(element: () => HTMLElement | null, options?: WhenDOMReadyOptions): Promise<HTMLElement>;
16
-
17
- export declare function onAnimationEnd(element: HTMLElement, animationName?: string, timeout?: number): Promise<AnimationEvent>;
18
-
19
- export declare const ANIMATION_NAMES: {
20
- readonly MINIMIZE: "modal-genie-minimize";
21
- readonly RESTORE: "modal-genie-restore";
22
- readonly OPEN: "modal-genie-restore";
23
- readonly CLOSE: "modal-close";
24
- readonly CLOSE_CENTERED: "modal-close-centered";
25
- readonly CHILD_APPEAR: "modal-child-appear";
26
- readonly CHILD_DISAPPEAR: "modal-child-disappear";
27
- };
28
- export type AnimationName = typeof ANIMATION_NAMES[keyof typeof ANIMATION_NAMES];
29
-
30
- export declare function setupAnimationEndListener(element: HTMLElement, callback: (animationName: string) => void): () => void;
31
- //# sourceMappingURL=dom.d.ts.map
@@ -1,8 +0,0 @@
1
- import { ModalId, Position } from '../types';
2
-
3
- export declare function toDataId(id: ModalId): string;
4
-
5
- export declare function getModalDialogElement(id: ModalId): HTMLElement | null;
6
-
7
- export declare function screenCenter(): Position;
8
- //# sourceMappingURL=helpers.d.ts.map
@@ -1,8 +0,0 @@
1
-
2
- export * from './constants';
3
- export * from './dom';
4
- export * from './viewport';
5
- export * from './helpers';
6
- export * from './dock';
7
- export * from './backdrop';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1,7 +0,0 @@
1
- import { Position, Bounds } from '../../types';
2
- import { ViewportConstraintOptions } from './types';
3
-
4
- export declare function constrainToViewport(x: number, y: number, width: number, height: number, options?: ViewportConstraintOptions): Position;
5
-
6
- export declare function constrainSizeToViewport(x: number, y: number, width: number, height: number, options?: ViewportConstraintOptions): Bounds;
7
- //# sourceMappingURL=constraints.d.ts.map
@@ -1,7 +0,0 @@
1
-
2
- export type { ModalBounds, ViewportConstraintOptions, SmartPositionOptions, ModalBoundsWithId, ModalLayoutInfo, SmartLayoutOptions, SmartLayoutResult, } from './types';
3
- export { constrainToViewport, constrainSizeToViewport, } from './constraints';
4
- export { calculateOverlap, calculateTotalOverlap, calculateMinDistance, getElementBounds, } from './overlap';
5
- export { calculateEqualSpaceLayout, computeAvailableArea, tryGridConfig, findLeastOverlapPosition, createCascadeLayout, } from './smart-position';
6
- export { calculateSmartLayout, } from './smart-layout';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1,30 +0,0 @@
1
- import { ModalBounds } from './types';
2
-
3
- export declare function calculateOverlap(a: {
4
- x: number;
5
- y: number;
6
- width: number;
7
- height: number;
8
- }, b: {
9
- x: number;
10
- y: number;
11
- width: number;
12
- height: number;
13
- }): number;
14
-
15
- export declare function calculateTotalOverlap(x: number, y: number, width: number, height: number, existingModals: ModalBounds[], gap: number): number;
16
-
17
- export declare function calculateMinDistance(a: {
18
- x: number;
19
- y: number;
20
- width: number;
21
- height: number;
22
- }, b: {
23
- x: number;
24
- y: number;
25
- width: number;
26
- height: number;
27
- }): number;
28
-
29
- export declare function getElementBounds(selectors: string[]): ModalBounds[];
30
- //# sourceMappingURL=overlap.d.ts.map
@@ -1,3 +0,0 @@
1
-
2
- export { calculateEqualSpaceLayout as calculateSmartLayout } from './smart-position';
3
- //# sourceMappingURL=smart-layout.d.ts.map
@@ -1,36 +0,0 @@
1
- import { Position } from '../../types';
2
- import { ModalBounds, ModalLayoutInfo, SmartLayoutOptions, SmartLayoutResult } from './types';
3
- interface AvailableArea {
4
- x: number;
5
- y: number;
6
- width: number;
7
- height: number;
8
- }
9
- interface GridConfig {
10
- cols: number;
11
- rows: number;
12
-
13
- score: number;
14
- positions: Map<string, Position>;
15
- }
16
- interface ModalToPlace {
17
- id: string;
18
- width: number;
19
- height: number;
20
- }
21
-
22
- export declare function computeAvailableArea(vw: number, vh: number, margin: number, avoidBounds: ModalBounds[], avoidMargin: number): AvailableArea;
23
-
24
- export declare function tryGridConfig(cols: number, rows: number, modals: ModalToPlace[], area: AvailableArea, modalGap?: number): GridConfig | null;
25
-
26
- export declare function findLeastOverlapPosition(width: number, height: number, existingBounds: ModalBounds[], area: AvailableArea, gridResolution?: number): Position;
27
-
28
- export declare function createCascadeLayout(modals: ModalToPlace[], area: AvailableArea): Map<string, Position>;
29
-
30
- export declare function calculateEqualSpaceLayout(existingModals: ModalLayoutInfo[], newModal: {
31
- id: string;
32
- width: number;
33
- height: number;
34
- } | null, options?: SmartLayoutOptions): SmartLayoutResult;
35
- export {};
36
- //# sourceMappingURL=smart-position.d.ts.map
@@ -1,56 +0,0 @@
1
- import { Position } from '../../types';
2
-
3
- export interface ModalBounds {
4
- x: number;
5
- y: number;
6
- width: number;
7
- height: number;
8
- }
9
- export interface ViewportConstraintOptions {
10
-
11
- margin?: number;
12
-
13
- allowPartialVisibility?: boolean;
14
- }
15
- export interface SmartPositionOptions {
16
-
17
- modalGap?: number;
18
-
19
- margin?: number;
20
-
21
- gridResolution?: number;
22
-
23
- avoidBounds?: ModalBounds[];
24
-
25
- avoidMargin?: number;
26
- }
27
-
28
- export interface ModalBoundsWithId extends ModalBounds {
29
- id: string;
30
- }
31
-
32
- export interface ModalLayoutInfo {
33
- id: string;
34
- width: number;
35
- height: number;
36
- currentPosition: Position;
37
-
38
- parentId?: string;
39
- }
40
-
41
- export interface SmartLayoutOptions {
42
-
43
- modalGap?: number;
44
-
45
- viewportMargin?: number;
46
-
47
- avoidBounds?: ModalBounds[];
48
-
49
- avoidMargin?: number;
50
- }
51
-
52
- export interface SmartLayoutResult {
53
-
54
- positions: Map<string, Position>;
55
- }
56
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +0,0 @@
1
-
2
- export * from './viewport/index';
3
- //# sourceMappingURL=viewport.d.ts.map