@vibe/dialog 3.1.0 → 4.0.0-alpha.1

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 (87) hide show
  1. package/dist/Dialog/Dialog.d.ts +4 -263
  2. package/dist/Dialog/Dialog.js +1 -1
  3. package/dist/Dialog/Dialog.js.map +1 -1
  4. package/dist/Dialog/Dialog.module.scss.js +1 -1
  5. package/dist/Dialog/Dialog.types.d.ts +204 -1
  6. package/dist/Dialog/{DialogContent → components/DialogContent}/DialogContent.d.ts +11 -12
  7. package/dist/Dialog/components/DialogContent/DialogContent.js +2 -0
  8. package/dist/Dialog/components/DialogContent/DialogContent.js.map +1 -0
  9. package/dist/Dialog/components/DialogContent/DialogContent.module.scss.js +2 -0
  10. package/dist/Dialog/components/Refable/Refable.d.ts +18 -0
  11. package/dist/Dialog/components/Refable/Refable.js +2 -0
  12. package/dist/Dialog/components/Refable/Refable.js.map +1 -0
  13. package/dist/Dialog/{DialogContent → hooks}/useDisableScroll.d.ts +1 -1
  14. package/dist/Dialog/hooks/useDisableScroll.js +2 -0
  15. package/dist/Dialog/hooks/useDisableScroll.js.map +1 -0
  16. package/dist/Dialog/index.d.ts +2 -2
  17. package/dist/DialogContentContainer/DialogContentContainer.d.ts +2 -2
  18. package/dist/DialogContentContainer/DialogContentContainer.js +1 -1
  19. package/dist/DialogContentContainer/DialogContentContainer.js.map +1 -1
  20. package/dist/DialogContentContainer/DialogContentContainer.module.scss.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/mocked_classnames/Dialog/Dialog.d.ts +4 -263
  23. package/dist/mocked_classnames/Dialog/Dialog.js +1 -1
  24. package/dist/mocked_classnames/Dialog/Dialog.js.map +1 -1
  25. package/dist/mocked_classnames/Dialog/Dialog.module.scss.js +1 -1
  26. package/dist/mocked_classnames/Dialog/Dialog.types.d.ts +204 -1
  27. package/dist/mocked_classnames/Dialog/{DialogContent → components/DialogContent}/DialogContent.d.ts +11 -12
  28. package/dist/mocked_classnames/Dialog/components/DialogContent/DialogContent.js +2 -0
  29. package/dist/mocked_classnames/Dialog/components/DialogContent/DialogContent.js.map +1 -0
  30. package/dist/mocked_classnames/Dialog/components/DialogContent/DialogContent.module.scss.js +2 -0
  31. package/dist/mocked_classnames/Dialog/components/Refable/Refable.d.ts +18 -0
  32. package/dist/mocked_classnames/Dialog/components/Refable/Refable.js +2 -0
  33. package/dist/mocked_classnames/Dialog/components/Refable/Refable.js.map +1 -0
  34. package/dist/mocked_classnames/Dialog/{DialogContent → hooks}/useDisableScroll.d.ts +1 -1
  35. package/dist/mocked_classnames/Dialog/hooks/useDisableScroll.js +2 -0
  36. package/dist/mocked_classnames/Dialog/hooks/useDisableScroll.js.map +1 -0
  37. package/dist/mocked_classnames/Dialog/index.d.ts +2 -2
  38. package/dist/mocked_classnames/DialogContentContainer/DialogContentContainer.d.ts +2 -2
  39. package/dist/mocked_classnames/DialogContentContainer/DialogContentContainer.js +1 -1
  40. package/dist/mocked_classnames/DialogContentContainer/DialogContentContainer.js.map +1 -1
  41. package/dist/mocked_classnames/DialogContentContainer/DialogContentContainer.module.scss.js +1 -1
  42. package/dist/mocked_classnames/index.js +1 -1
  43. package/package.json +7 -8
  44. package/dist/Dialog/DialogContent/DialogContent.js +0 -2
  45. package/dist/Dialog/DialogContent/DialogContent.js.map +0 -1
  46. package/dist/Dialog/DialogContent/DialogContent.module.scss.js +0 -2
  47. package/dist/Dialog/DialogContent/useDisableScroll.js +0 -2
  48. package/dist/Dialog/DialogContent/useDisableScroll.js.map +0 -1
  49. package/dist/Dialog/modifiers/observeContentResizeModifier.d.ts +0 -2
  50. package/dist/Dialog/modifiers/observeContentResizeModifier.js +0 -2
  51. package/dist/Dialog/modifiers/observeContentResizeModifier.js.map +0 -1
  52. package/dist/Dialog/modifiers/observeReferenceResizeModifier.d.ts +0 -2
  53. package/dist/Dialog/modifiers/observeReferenceResizeModifier.js +0 -2
  54. package/dist/Dialog/modifiers/observeReferenceResizeModifier.js.map +0 -1
  55. package/dist/Dialog/useForceUpdate.d.ts +0 -2
  56. package/dist/Dialog/useForceUpdate.js +0 -2
  57. package/dist/Dialog/useForceUpdate.js.map +0 -1
  58. package/dist/Dialog/usePopover.d.ts +0 -19
  59. package/dist/Dialog/usePopover.js +0 -2
  60. package/dist/Dialog/usePopover.js.map +0 -1
  61. package/dist/Refable/Refable.d.ts +0 -11
  62. package/dist/Refable/Refable.js +0 -2
  63. package/dist/Refable/Refable.js.map +0 -1
  64. package/dist/Refable/index.d.ts +0 -1
  65. package/dist/mocked_classnames/Dialog/DialogContent/DialogContent.js +0 -2
  66. package/dist/mocked_classnames/Dialog/DialogContent/DialogContent.js.map +0 -1
  67. package/dist/mocked_classnames/Dialog/DialogContent/DialogContent.module.scss.js +0 -2
  68. package/dist/mocked_classnames/Dialog/DialogContent/useDisableScroll.js +0 -2
  69. package/dist/mocked_classnames/Dialog/DialogContent/useDisableScroll.js.map +0 -1
  70. package/dist/mocked_classnames/Dialog/modifiers/observeContentResizeModifier.d.ts +0 -2
  71. package/dist/mocked_classnames/Dialog/modifiers/observeContentResizeModifier.js +0 -2
  72. package/dist/mocked_classnames/Dialog/modifiers/observeContentResizeModifier.js.map +0 -1
  73. package/dist/mocked_classnames/Dialog/modifiers/observeReferenceResizeModifier.d.ts +0 -2
  74. package/dist/mocked_classnames/Dialog/modifiers/observeReferenceResizeModifier.js +0 -2
  75. package/dist/mocked_classnames/Dialog/modifiers/observeReferenceResizeModifier.js.map +0 -1
  76. package/dist/mocked_classnames/Dialog/useForceUpdate.d.ts +0 -2
  77. package/dist/mocked_classnames/Dialog/useForceUpdate.js +0 -2
  78. package/dist/mocked_classnames/Dialog/useForceUpdate.js.map +0 -1
  79. package/dist/mocked_classnames/Dialog/usePopover.d.ts +0 -19
  80. package/dist/mocked_classnames/Dialog/usePopover.js +0 -2
  81. package/dist/mocked_classnames/Dialog/usePopover.js.map +0 -1
  82. package/dist/mocked_classnames/Refable/Refable.d.ts +0 -11
  83. package/dist/mocked_classnames/Refable/Refable.js +0 -2
  84. package/dist/mocked_classnames/Refable/Refable.js.map +0 -1
  85. package/dist/mocked_classnames/Refable/index.d.ts +0 -1
  86. /package/dist/Dialog/{DialogContent → components/DialogContent}/DialogContent.module.scss.js.map +0 -0
  87. /package/dist/mocked_classnames/Dialog/{DialogContent → components/DialogContent}/DialogContent.module.scss.js.map +0 -0
@@ -1,263 +1,4 @@
1
- import React, { PureComponent, type ReactElement } from "react";
2
- import { type Modifier } from "react-popper";
3
- import { NOOP, type VibeComponentProps } from "@vibe/shared";
4
- import type * as PopperJS from "@popperjs/core";
5
- import { type DialogAnimationType, type DialogPosition, type DialogTriggerEvent, type DialogEvent } from "./Dialog.types";
6
- import { LayerContext } from "@vibe/layer";
7
- export interface DialogProps extends VibeComponentProps {
8
- /**
9
- * Class name applied to the reference wrapper element.
10
- */
11
- referenceWrapperClassName?: string;
12
- /**
13
- * The wrapper element type to use for React components. Defaults to "span".
14
- */
15
- referenceWrapperElement?: "span" | "div";
16
- /**
17
- * The placement of the dialog relative to the reference element.
18
- */
19
- position?: DialogPosition;
20
- /**
21
- * Custom Popper.js modifiers.
22
- * https://popper.js.org/docs/v2/modifiers/
23
- */
24
- modifiers?: Modifier<any>[];
25
- /**
26
- * The starting edge of the dialog.
27
- */
28
- startingEdge?: string;
29
- /**
30
- * Offset values for positioning adjustments.
31
- * `main` - horizontal offset
32
- * `secondary` - vertical offset
33
- */
34
- moveBy?: {
35
- main?: number;
36
- secondary?: number;
37
- };
38
- /**
39
- * Delay in milliseconds before showing the dialog.
40
- */
41
- showDelay?: number;
42
- /**
43
- * Delay in milliseconds before hiding the dialog.
44
- */
45
- hideDelay?: number;
46
- /**
47
- * Events that trigger showing the dialog.
48
- */
49
- showTrigger?: DialogTriggerEvent | DialogTriggerEvent[];
50
- /**
51
- * Events that trigger hiding the dialog.
52
- */
53
- hideTrigger?: DialogTriggerEvent | DialogTriggerEvent[];
54
- /**
55
- * If true, prevents closing the dialog when the mouse enters it.
56
- */
57
- showOnDialogEnter?: boolean;
58
- /**
59
- * If true, shows the dialog when the component mounts.
60
- */
61
- shouldShowOnMount?: boolean;
62
- /**
63
- * If true, disables opening the dialog.
64
- */
65
- disable?: boolean;
66
- /**
67
- * Controls the open state of the dialog.
68
- */
69
- open?: boolean;
70
- /**
71
- * Derived state control for managing dialog visibility.
72
- */
73
- isOpen?: boolean;
74
- /**
75
- * Classes that prevent showing the dialog when present.
76
- */
77
- showTriggerIgnoreClass?: string | Array<string>;
78
- /**
79
- * Classes that prevent hiding the dialog when present.
80
- */
81
- hideTriggerIgnoreClass?: string | Array<string>;
82
- /**
83
- * The animation type used for the dialog.
84
- */
85
- animationType?: DialogAnimationType;
86
- /**
87
- * Class name applied to the dialog content container.
88
- */
89
- wrapperClassName?: string;
90
- /**
91
- * If true, prevents animation when mounting.
92
- */
93
- preventAnimationOnMount?: boolean;
94
- /**
95
- * The CSS selector of the container where the dialog is rendered.
96
- */
97
- containerSelector?: string;
98
- /**
99
- * If true, positions the tooltip element.
100
- */
101
- tooltip?: boolean;
102
- /**
103
- * Class name applied to the tooltip element.
104
- */
105
- tooltipClassName?: string;
106
- /**
107
- * Callback fired when the dialog is shown.
108
- */
109
- onDialogDidShow?: (event?: DialogEvent, eventName?: DialogTriggerEvent | string) => void;
110
- /**
111
- * Callback fired when the dialog is hidden.
112
- */
113
- onDialogDidHide?: (event: DialogEvent, eventName: DialogTriggerEvent | string) => void;
114
- /**
115
- * Callback fired when clicking outside the dialog.
116
- */
117
- onClickOutside?: (event: React.MouseEvent) => void;
118
- /**
119
- * Callback fired when clicking inside the dialog content.
120
- */
121
- onContentClick?: (event: React.MouseEvent) => void;
122
- /**
123
- * The z-index applied to the dialog.
124
- */
125
- zIndex?: number;
126
- /**
127
- * If true, uses derived state from props.
128
- */
129
- useDerivedStateFromProps?: boolean;
130
- /**
131
- * If true, makes the dialog disappear when the reference element is hidden.
132
- */
133
- hideWhenReferenceHidden?: boolean;
134
- /**
135
- * If true, triggers the callback when the dialog mounts.
136
- */
137
- shouldCallbackOnMount?: boolean;
138
- /**
139
- * If true, instantly shows and hides the dialog without delay.
140
- */
141
- instantShowAndHide?: boolean;
142
- /**
143
- * Callback to dynamically adjust show delay and animation behavior.
144
- */
145
- getDynamicShowDelay?: () => {
146
- showDelay: number;
147
- preventAnimation: boolean;
148
- };
149
- /**
150
- * The content displayed inside the dialog.
151
- */
152
- content?: (() => JSX.Element) | JSX.Element;
153
- /**
154
- * The element to position the dialog beside.
155
- */
156
- children?: ReactElement | ReactElement[] | string;
157
- /**
158
- * If true, keyboard focus/blur events behave like mouse enter/leave.
159
- */
160
- addKeyboardHideShowTriggersByDefault?: boolean;
161
- /**
162
- * If true, disables scrolling for the container element.
163
- */
164
- disableContainerScroll?: boolean | string;
165
- /**
166
- * Enables the observation of content resize for the popper element.
167
- * When set to `true`, a ResizeObserver is attached to the popper content,
168
- * automatically triggering repositioning when the size of the content changes.
169
- *
170
- * This is useful for dialogs, tooltips, or popovers with dynamic content
171
- * that may grow or shrink without a re-render being triggered.
172
- */
173
- observeContentResize?: boolean;
174
- /**
175
- * If true, provides a LayerProvider context for nested dialogs to render correctly.
176
- * This is useful when you have components that use Dialog internally (like Dropdown)
177
- * inside another Dialog, ensuring proper z-index stacking and click-outside behavior.
178
- */
179
- enableNestedDialogLayer?: boolean;
180
- }
181
- export interface DialogState {
182
- /**
183
- * If true, the dialog is open.
184
- */
185
- isOpen?: boolean;
186
- /**
187
- * If true, the dialog state is derived from props.
188
- */
189
- shouldUseDerivedStateFromProps?: boolean;
190
- /**
191
- * If true, prevents animation when opening or closing the dialog.
192
- */
193
- preventAnimation?: boolean;
194
- }
195
- export default class Dialog extends PureComponent<DialogProps, DialogState> {
196
- static defaultProps: {
197
- position: string;
198
- modifiers: (import("react-popper").StrictModifier<any> | Partial<PopperJS.Modifier<any, object>>)[];
199
- moveBy: {
200
- main: number;
201
- secondary: number;
202
- };
203
- showDelay: number;
204
- hideDelay: number;
205
- showTrigger: string;
206
- hideTrigger: string;
207
- showOnDialogEnter: boolean;
208
- shouldShowOnMount: boolean;
209
- disable: boolean;
210
- open: boolean;
211
- animationType: string;
212
- preventAnimationOnMount: boolean;
213
- tooltip: boolean;
214
- onDialogDidShow: typeof NOOP;
215
- onDialogDidHide: typeof NOOP;
216
- onClickOutside: typeof NOOP;
217
- onContentClick: typeof NOOP;
218
- useDerivedStateFromProps: boolean;
219
- hideWhenReferenceHidden: boolean;
220
- shouldCallbackOnMount: boolean;
221
- instantShowAndHide: boolean;
222
- addKeyboardHideShowTriggersByDefault: boolean;
223
- observeContentResize: boolean;
224
- enableNestedDialogLayer: boolean;
225
- };
226
- private showTimeout;
227
- private hideTimeout;
228
- private containerRef;
229
- context: React.ContextType<typeof LayerContext>;
230
- constructor(props: DialogProps);
231
- closeDialogOnEscape(event: KeyboardEvent): void;
232
- componentDidMount(): void;
233
- componentWillUnmount(): void;
234
- static getDerivedStateFromProps(nextProps: DialogProps, state: DialogState): DialogState;
235
- getDefaultContainer(): HTMLElement;
236
- getContainer(): Element;
237
- showDialog(event: DialogEvent, eventName: DialogTriggerEvent | string, options?: {
238
- preventAnimation?: boolean;
239
- }): void;
240
- onShowDialog(event: DialogEvent, eventName: DialogTriggerEvent | string): void;
241
- showDialogIfNeeded(event: DialogEvent, eventName: DialogTriggerEvent | string, options?: {}): void;
242
- hideDialog(event: DialogEvent, eventName: DialogTriggerEvent | string): void;
243
- onHideDialog(event: DialogEvent, eventName: DialogTriggerEvent | string): void;
244
- hideDialogIfNeeded(event: DialogEvent, eventName: DialogTriggerEvent | string): void;
245
- handleEvent(eventName: DialogTriggerEvent, target: EventTarget, event: DialogEvent): void;
246
- isShown(): boolean;
247
- isShowTrigger(eventName: DialogTriggerEvent): boolean;
248
- isHideTrigger(eventName: DialogTriggerEvent): boolean;
249
- onMouseEnter(e: React.MouseEvent): void;
250
- onMouseLeave(e: React.MouseEvent): void;
251
- onClick(e: React.MouseEvent): void;
252
- onKeyDown(event: React.KeyboardEvent): void;
253
- onMouseDown(e: React.MouseEvent): void;
254
- onFocus(e: React.FocusEvent): void;
255
- onBlur(e: React.FocusEvent): void;
256
- onEsc(e: React.KeyboardEvent): void;
257
- onContextMenu(e: React.MouseEvent): void;
258
- onClickOutside(event: React.MouseEvent): void;
259
- onDialogEnter(event: React.MouseEvent): void;
260
- onDialogLeave(event: React.MouseEvent): void;
261
- onContentClick(e: React.MouseEvent): void;
262
- render(): string | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | React.JSX.Element;
263
- }
1
+ import React from "react";
2
+ import { type DialogProps } from "./Dialog.types";
3
+ declare function Dialog({ id, "data-testid": dataTestId, children, content, position, moveBy, middleware: middlewareProp, startingEdge, showDelay, hideDelay, instantShowAndHide, getDynamicShowDelay, showTrigger, hideTrigger, showOnDialogEnter, showTriggerIgnoreClass, hideTriggerIgnoreClass, addKeyboardHideShowTriggersByDefault, shouldShowOnMount, disable, open, isOpen: isOpenProp, useDerivedStateFromProps, animationType, preventAnimationOnMount, tooltip, tooltipClassName, containerSelector, disableContainerScroll, zIndex, wrapperClassName, referenceWrapperClassName, referenceWrapperElement, onBlur: onBlurProp, onKeyDown: onKeyDownProp, onClick: onClickProp, onFocus: onFocusProp, onMouseDown: onMouseDownProp, onMouseEnter: onMouseEnterProp, onMouseLeave: onMouseLeaveProp, onContextMenu: onContextMenuProp, onDialogDidShow, onDialogDidHide, onClickOutside: onClickOutsideProp, onContentClick: onContentClickProp, hideWhenReferenceHidden, shouldCallbackOnMount, observeContentResize }: DialogProps): React.JSX.Element;
4
+ export default Dialog;
@@ -1,2 +1,2 @@
1
- import e from"classnames";import t,{PureComponent as i}from"react";import{createPortal as o}from"react-dom";import{Manager as n,Reference as s,Popper as r}from"react-popper";import{isFunction as a}from"es-toolkit";import{NOOP as h,isClient as l,isInsideClass as d,convertToArray as u,getTestId as c,ComponentDefaultTestId as p,chainRefFunctions as m,chainFunctions as g}from"@vibe/shared";import D from"./DialogContent/DialogContent.js";import{Refable as f}from"../Refable/Refable.js";import w from"./Dialog.module.scss.js";import{LayerContext as C,LayerProvider as v}from"@vibe/layer";import{createObserveContentResizeModifier as E}from"./modifiers/observeContentResizeModifier.js";class T extends i{constructor(e){super(e),this.state={shouldUseDerivedStateFromProps:e.useDerivedStateFromProps,isOpen:e.shouldShowOnMount},this.containerRef=t.createRef(),this.onMouseEnter=this.onMouseEnter.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.isShown=this.isShown.bind(this),this.onEsc=this.onEsc.bind(this),this.onClickOutside=this.onClickOutside.bind(this),this.onDialogEnter=this.onDialogEnter.bind(this),this.onDialogLeave=this.onDialogLeave.bind(this),this.getContainer=this.getContainer.bind(this),this.onContentClick=this.onContentClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.closeDialogOnEscape=this.closeDialogOnEscape.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.getDefaultContainer=this.getDefaultContainer.bind(this),this.hideTimeout=null,this.showTimeout=null}closeDialogOnEscape(e){const{isOpen:t}=this.state;if(t)switch(e.key){case"Escape":this.hideDialogIfNeeded(e,"esckey");break;case"Tab":this.handleEvent("tab",e.target,e);break;case"Enter":this.handleEvent("enter",e.target,e)}}componentDidMount(){const{shouldCallbackOnMount:e,onDialogDidShow:t}=this.props,{isOpen:i}=this.state;l()&&document.addEventListener("keyup",this.closeDialogOnEscape),e&&i&&t&&t()}componentWillUnmount(){l()&&document.removeEventListener("keyup",this.closeDialogOnEscape),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)}static getDerivedStateFromProps(e,t){return t.shouldUseDerivedStateFromProps?{isOpen:e.isOpen}:null}getDefaultContainer(){const{layerRef:e}=this.context;return(null==e?void 0:e.current)?e.current:document.body}getContainer(){const{containerSelector:e}=this.props;if(!e)return this.getDefaultContainer();const t=document.querySelector(e);return t&&t instanceof Element?t:this.getDefaultContainer()}showDialog(e,t,i={}){const{showDelay:o,instantShowAndHide:n,getDynamicShowDelay:s}=this.props;let r=o,a=i.preventAnimation;if(s){const e=s();r=e.showDelay||0,a=a||e.preventAnimation}n?(this.onShowDialog(e,t),this.setState({isOpen:!0,preventAnimation:a}),this.showTimeout=null):this.showTimeout=setTimeout((()=>{this.onShowDialog(e,t),this.showTimeout=null,this.setState({isOpen:!0,preventAnimation:a})}),r)}onShowDialog(e,t){if(this.isShown())return;const{onDialogDidShow:i}=this.props;i(e,t)}showDialogIfNeeded(e,t,i={}){const{disable:o}=this.props;o||(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.showTimeout||this.showDialog(e,t,i))}hideDialog(e,t){const{hideDelay:i,instantShowAndHide:o}=this.props;o?(this.onHideDialog(e,t),this.setState({isOpen:!1}),this.hideTimeout=null):this.hideTimeout=setTimeout((()=>{this.onHideDialog(e,t),this.setState({isOpen:!1}),this.hideTimeout=null}),i)}onHideDialog(e,t){const{onDialogDidHide:i}=this.props;i&&i(e,t)}hideDialogIfNeeded(e,t){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null),this.hideTimeout||this.hideDialog(e,t)}handleEvent(e,t,i){const{showTriggerIgnoreClass:o,hideTriggerIgnoreClass:n}=this.props;return!this.isShowTrigger(e)||this.isShown()||d(t,o)?this.isHideTrigger(e)&&!d(t,n)?this.hideDialogIfNeeded(i,e):void 0:this.showDialogIfNeeded(i,e)}isShown(){const{isOpen:e}=this.state,{open:t}=this.props;return e||t}isShowTrigger(e){const{showTrigger:t,addKeyboardHideShowTriggersByDefault:i}=this.props,o=u(t);return!(!i||"focus"!==e||-1>=o.indexOf("mouseenter"))||o.indexOf(e)>-1}isHideTrigger(e){const{hideTrigger:t,addKeyboardHideShowTriggersByDefault:i}=this.props,o=u(t);return!(!i||"blur"!==e||-1>=o.indexOf("mouseleave"))||o.indexOf(e)>-1}onMouseEnter(e){this.handleEvent("mouseenter",e.target,e)}onMouseLeave(e){this.handleEvent("mouseleave",e.target,e)}onClick(e){e.button||this.handleEvent("click",e.target,e)}onKeyDown(e){"Enter"===e.key&&this.handleEvent("enter",e.target,e),"Tab"===e.key&&this.handleEvent("tab",e.target,e)}onMouseDown(e){e.button||this.handleEvent("mousedown",e.target,e)}onFocus(e){this.handleEvent("focus",e.target,e)}onBlur(e){this.handleEvent("blur",e.relatedTarget,e)}onEsc(e){this.handleEvent("esckey",e.target,e)}onContextMenu(e){const t=this.isShown();(this.isShowTrigger("contextmenu")&&!t||this.isHideTrigger("contextmenu")&&t)&&e.preventDefault(),this.handleEvent("contextmenu",e.target,e)}onClickOutside(e){const{onClickOutside:t}=this.props;this.handleEvent("clickoutside",e.target,e),t(e)}onDialogEnter(e){const{showOnDialogEnter:t}=this.props;t&&this.showDialogIfNeeded(e,"DialogEnter")}onDialogLeave(e){const{showOnDialogEnter:t}=this.props;t&&this.hideDialogIfNeeded(e,"DialogLeave")}onContentClick(e){const{onContentClick:t}=this.props;this.handleEvent("onContentClick",e.target,e),t(e)}render(){const{wrapperClassName:i,content:h,startingEdge:d,children:u,preventAnimationOnMount:g,animationType:C,position:T,showDelay:b,moveBy:S,modifiers:O,tooltip:k,tooltipClassName:M,referenceWrapperClassName:x,referenceWrapperElement:H,zIndex:R,hideWhenReferenceHidden:L,disableContainerScroll:N,containerSelector:I,observeContentResize:A,enableNestedDialogLayer:B,id:F,"data-testid":K}=this.props,{preventAnimation:P}=this.state,z=K||c(p.DIALOG,F),j=g||P?void 0:C,W=a(h)?h():h;return W?t.createElement(n,null,t.createElement(s,null,(({ref:i})=>t.createElement(f,{className:e(x),wrapperElement:H,ref:i,onBlur:y("onBlur",this,this.props),onKeyDown:y("onKeyDown",this,this.props),onClick:y("onClick",this,this.props),onFocus:y("onFocus",this,this.props),onMouseDown:y("onMouseDown",this,this.props),onMouseEnter:y("onMouseEnter",this,this.props),onMouseLeave:y("onMouseLeave",this,this.props),onContextMenu:y("onContextMenu",this,this.props)},u))),l()&&o(t.createElement(r,{placement:T,modifiers:[{name:"offset",options:{offset:[S.secondary,S.main]}},{name:"zIndex",enabled:!0,phase:"write",fn:({state:e})=>(R&&(e.styles.popper.zIndex=R+""),e)},{name:"rotator",enabled:!0,phase:"write",fn:({state:e})=>e.styles.arrow?(e.styles.arrow.transform=e.styles.arrow.transform+" rotate(45deg)",e):e},E(A),...O]},(({placement:o,style:n,ref:s,arrowProps:r,isReferenceHidden:a})=>{if(!this.isShown()&&o)return null;if(L&&a){const e=new CustomEvent("onReferenceHidden");this.hideDialog(e,"onReferenceHidden")}const h=m([s,this.containerRef]),l=t.createElement(D,{"data-testid":z,isReferenceHidden:L&&a,onMouseEnter:this.onDialogEnter,onMouseLeave:this.onDialogLeave,onClickOutside:this.onClickOutside,onContextMenu:this.onContextMenu,onEsc:this.onEsc,animationType:j,position:o,wrapperClassName:i,startingEdge:d,isOpen:this.isShown(),showDelay:b,styleObject:n,ref:h,onClick:this.onContentClick,hasTooltip:!!k,containerSelector:I,disableContainerScroll:N},W,k&&t.createElement("div",{style:r.style,ref:r.ref,className:e(w.arrow,M),"data-placement":o}));return B?t.createElement(v,{layerRef:this.containerRef},l):l})),this.getContainer())):u}}function y(e,t,i){return g([i[e],t[e]],!0)}T.defaultProps={position:"top",modifiers:[],moveBy:{main:0,secondary:0},showDelay:100,hideDelay:100,showTrigger:"mouseenter",hideTrigger:"mouseleave",showOnDialogEnter:!1,shouldShowOnMount:!1,disable:!1,open:!1,animationType:"expand",preventAnimationOnMount:!1,tooltip:!1,onDialogDidShow:h,onDialogDidHide:h,onClickOutside:h,onContentClick:h,useDerivedStateFromProps:!1,hideWhenReferenceHidden:!1,shouldCallbackOnMount:!1,instantShowAndHide:!1,addKeyboardHideShowTriggersByDefault:!1,observeContentResize:!1,enableNestedDialogLayer:!1},T.contextType=C;export{T as default};
1
+ import e from"classnames";import n,{useState as t,useRef as r,useContext as o,useMemo as a,useCallback as l,useEffect as i}from"react";import{createPortal as s}from"react-dom";import{offset as u,flip as c,shift as m,arrow as d,hide as p,autoUpdate as f,useFloating as g}from"@floating-ui/react-dom";import{isFunction as y}from"es-toolkit";import{convertToArray as h,isInsideClass as v,chainFunctions as w,isClient as C,getTestId as b,ComponentDefaultTestId as D,chainRefFunctions as E,NOOP as k}from"@vibe/shared";import T from"./components/DialogContent/DialogContent.js";import{Refable as x}from"./components/Refable/Refable.js";import M from"./Dialog.module.scss.js";import{LayerContext as S,LayerProvider as O}from"@vibe/layer";function R({id:R,"data-testid":A,children:H,content:j,position:L="top",moveBy:F={main:0,secondary:0},middleware:N=[],startingEdge:I,showDelay:z=100,hideDelay:B=100,instantShowAndHide:K=!1,getDynamicShowDelay:W,showTrigger:q="mouseenter",hideTrigger:G="mouseleave",showOnDialogEnter:P=!1,showTriggerIgnoreClass:V,hideTriggerIgnoreClass:J,addKeyboardHideShowTriggersByDefault:Q=!0,shouldShowOnMount:U=!1,disable:X=!1,open:Y=!1,isOpen:Z,useDerivedStateFromProps:$=!1,animationType:_="expand",preventAnimationOnMount:ee=!1,tooltip:ne=!1,tooltipClassName:te,containerSelector:re,disableContainerScroll:oe,zIndex:ae,wrapperClassName:le,referenceWrapperClassName:ie,referenceWrapperElement:se,onBlur:ue,onKeyDown:ce,onClick:me,onFocus:de,onMouseDown:pe,onMouseEnter:fe,onMouseLeave:ge,onContextMenu:ye,onDialogDidShow:he=k,onDialogDidHide:ve=k,onClickOutside:we=k,onContentClick:Ce=k,hideWhenReferenceHidden:be=!1,shouldCallbackOnMount:De=!1,observeContentResize:Ee=!1}){var ke,Te;const[xe,Me]=t(U),[Se,Oe]=t(!1),[Re,Ae]=t(null),He=r(null),je=r(null),Le=r(null),Fe=r(null),Ne=n.Children.toArray(H).some((e=>n.isValidElement(e))),{layerRef:Ie}=o(S),ze=($?Z:xe)||Y,Be=a((()=>{const e=[],n=N.filter((e=>null!=e&&"object"==typeof e&&"function"==typeof e.fn)),t=n.some((e=>"offset"===e.name)),r=n.some((e=>"flip"===e.name)),o=n.some((e=>"shift"===e.name));return t||0===F.main&&0===F.secondary||e.push(u({mainAxis:F.main||0,crossAxis:F.secondary||0})),r||e.push(c()),o||e.push(m()),e.push(...n),ne&&e.push(d({element:Fe})),be&&e.push(p()),e}),[F.main,F.secondary,ne,be,N]),Ke=l(((e,n,t)=>f(e,n,t,{elementResize:Ee,layoutShift:!1})),[Ee]),{refs:We,floatingStyles:qe,placement:Ge,middlewareData:Pe}=g({placement:L,middleware:Be,whileElementsMounted:Ke,elements:{reference:Re}}),Ve=null!==(Te=null===(ke=Pe.hide)||void 0===ke?void 0:ke.referenceHidden)&&void 0!==Te&&Te,Je=l((e=>{const n=h(q);return!(!Q||"focus"!==e||!n.includes("mouseenter"))||n.includes(e)}),[q,Q]),Qe=l((e=>{const n=h(G);return!(!Q||"blur"!==e||!n.includes("mouseleave"))||n.includes(e)}),[G,Q]),Ue=l(((e,n,t={})=>{let r=z,o=t.preventAnimation;if(W){const e=W();r=e.showDelay||0,o=null!=o?o:e.preventAnimation}K?(he(e,n),Me(!0),Oe(!!o),He.current=null):He.current=setTimeout((()=>{he(e,n),He.current=null,Me(!0),Oe(!!o)}),r)}),[z,W,K,he]),Xe=l(((e,n)=>{K?(ve(e,n),Me(!1),je.current=null):je.current=setTimeout((()=>{ve(e,n),Me(!1),je.current=null}),B)}),[B,K,ve]),Ye=l(((e,n,t={})=>{X||(je.current&&(clearTimeout(je.current),je.current=null),He.current||Ue(e,n,t))}),[X,Ue]),Ze=l(((e,n)=>{He.current&&(clearTimeout(He.current),He.current=null),je.current||Xe(e,n)}),[Xe]),$e=l(((e,n,t)=>{if(n)return!Je(e)||ze||v(n,V)?Qe(e)&&!v(n,J)?Ze(t,e):void 0:Ye(t,e)}),[Je,Qe,ze,V,J,Ye,Ze]),_e=l((()=>{if(re){const e=document.querySelector(re);if(e instanceof Element)return e}return(null==Ie?void 0:Ie.current)||document.body}),[re,Ie]),en=l((e=>$e("mouseenter",e.target,e)),[$e]),nn=l((e=>$e("mouseleave",e.target,e)),[$e]),tn=l((e=>{e.button||$e("click",e.target,e)}),[$e]),rn=l((e=>{"Enter"===e.key&&$e("enter",e.target,e),"Tab"===e.key&&$e("tab",e.target,e)}),[$e]),on=l((e=>{e.button||$e("mousedown",e.target,e)}),[$e]),an=l((e=>$e("focus",e.target,e)),[$e]),ln=l((e=>{$e("blur",e.relatedTarget||e.target,e)}),[$e]),sn=l((e=>$e("esckey",e.target,e)),[$e]),un=l((e=>{(Je("contextmenu")&&!ze||Qe("contextmenu")&&ze)&&e.preventDefault(),$e("contextmenu",e.target,e)}),[ze,Je,Qe,$e]),cn=l((e=>{$e("clickoutside",e.target,e),we(e)}),[$e,we]),mn=l((e=>{P&&Ye(e,"DialogEnter")}),[P,Ye]),dn=l((e=>{P&&Ze(e,"DialogLeave")}),[P,Ze]),pn=l((e=>{$e("onContentClick",e.target,e),Ce(e)}),[$e,Ce]),fn=a((()=>w([ue,ln],!0)),[ue,ln]),gn=a((()=>w([ce,rn],!0)),[ce,rn]),yn=a((()=>w([me,tn],!0)),[me,tn]),hn=a((()=>w([de,an],!0)),[de,an]),vn=a((()=>w([pe,on],!0)),[pe,on]),wn=a((()=>w([fe,en],!0)),[fe,en]),Cn=a((()=>w([ge,nn],!0)),[ge,nn]),bn=a((()=>w([ye,un],!0)),[ye,un]),Dn=r();Dn.current=e=>{if(ze)switch(e.key){case"Escape":Ze(e,"esckey");break;case"Tab":$e("tab",e.target,e);break;case"Enter":$e("enter",e.target,e)}},i((()=>{De&&U&&he()}),[]),i((()=>()=>{He.current&&clearTimeout(He.current),je.current&&clearTimeout(je.current)}),[]),i((()=>{if(!C())return;const e=e=>{var n;return null===(n=Dn.current)||void 0===n?void 0:n.call(Dn,e)};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)}),[]),i((()=>{if(be&&Ve&&ze){const e=new CustomEvent("onReferenceHidden");Xe(e,"onReferenceHidden")}}),[be,Ve,ze,Xe]);const En=A||b(D.DIALOG,R),kn=a((()=>{if(!Pe.arrow)return{};const{x:e,y:n}=Pe.arrow;return{left:null!=e?e+"px":"",top:null!=n?n+"px":"",transform:"rotate(45deg)"}}),[Pe.arrow]),Tn=a((()=>Object.assign(Ne?Object.assign({},qe):{},void 0!==ae&&{zIndex:ae})),[qe,ae,Ne]),xn=ee||Se?void 0:_,Mn=y(j)?j():j;if(!Mn)return n.createElement(n.Fragment,null,H);const Sn=E([We.setFloating,Le]),On=n.createElement(T,{"data-testid":En,isReferenceHidden:be&&Ve,onMouseEnter:mn,onMouseLeave:dn,onClickOutside:cn,onContextMenu:un,onEsc:sn,animationType:xn,position:Ge,wrapperClassName:le,startingEdge:I,isOpen:ze,showDelay:z,styleObject:Tn,ref:Sn,onClick:pn,hasTooltip:!!ne,containerSelector:re,disableContainerScroll:oe},Mn,ne&&n.createElement("div",{style:kn,ref:Fe,className:e(M.arrow,te),"data-placement":Ge}));return n.createElement(n.Fragment,null,n.createElement(x,{className:e(ie),wrapperElement:se,ref:Ae,onBlur:fn,onKeyDown:gn,onClick:yn,onFocus:hn,onMouseDown:vn,onMouseEnter:wn,onMouseLeave:Cn,onContextMenu:bn},H),C()&&ze&&s(n.createElement(O,{layerRef:Le},On),_e()))}export{R as default};
2
2
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { PureComponent, type ReactElement } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Manager, type Modifier, Popper, Reference } from \"react-popper\";\nimport { isFunction } from \"es-toolkit\";\nimport {\n chainFunctions,\n chainRefFunctions,\n convertToArray,\n NOOP,\n isInsideClass,\n type VibeComponentProps,\n ComponentDefaultTestId,\n getTestId,\n isClient\n} from \"@vibe/shared\";\nimport DialogContent from \"./DialogContent/DialogContent\";\nimport { Refable } from \"../Refable/Refable\";\nimport type * as PopperJS from \"@popperjs/core\";\nimport styles from \"./Dialog.module.scss\";\nimport {\n type DialogAnimationType,\n type DialogPosition,\n type DialogTriggerEvent,\n type DialogEvent\n} from \"./Dialog.types\";\nimport { LayerContext, LayerProvider } from \"@vibe/layer\";\nimport { createObserveContentResizeModifier } from \"./modifiers/observeContentResizeModifier\";\n\nexport interface DialogProps extends VibeComponentProps {\n /**\n * Class name applied to the reference wrapper element.\n */\n referenceWrapperClassName?: string;\n /**\n * The wrapper element type to use for React components. Defaults to \"span\".\n */\n referenceWrapperElement?: \"span\" | \"div\";\n /**\n * The placement of the dialog relative to the reference element.\n */\n position?: DialogPosition;\n /**\n * Custom Popper.js modifiers.\n * https://popper.js.org/docs/v2/modifiers/\n */\n modifiers?: Modifier<any>[];\n /**\n * The starting edge of the dialog.\n */\n startingEdge?: string;\n /**\n * Offset values for positioning adjustments.\n * `main` - horizontal offset\n * `secondary` - vertical offset\n */\n moveBy?: { main?: number; secondary?: number };\n /**\n * Delay in milliseconds before showing the dialog.\n */\n showDelay?: number;\n /**\n * Delay in milliseconds before hiding the dialog.\n */\n hideDelay?: number;\n /**\n * Events that trigger showing the dialog.\n */\n showTrigger?: DialogTriggerEvent | DialogTriggerEvent[];\n /**\n * Events that trigger hiding the dialog.\n */\n hideTrigger?: DialogTriggerEvent | DialogTriggerEvent[];\n /**\n * If true, prevents closing the dialog when the mouse enters it.\n */\n showOnDialogEnter?: boolean;\n /**\n * If true, shows the dialog when the component mounts.\n */\n shouldShowOnMount?: boolean;\n /**\n * If true, disables opening the dialog.\n */\n disable?: boolean;\n /**\n * Controls the open state of the dialog.\n */\n open?: boolean;\n /**\n * Derived state control for managing dialog visibility.\n */\n isOpen?: boolean;\n /**\n * Classes that prevent showing the dialog when present.\n */\n showTriggerIgnoreClass?: string | Array<string>;\n /**\n * Classes that prevent hiding the dialog when present.\n */\n hideTriggerIgnoreClass?: string | Array<string>;\n /**\n * The animation type used for the dialog.\n */\n animationType?: DialogAnimationType;\n /**\n * Class name applied to the dialog content container.\n */\n wrapperClassName?: string;\n /**\n * If true, prevents animation when mounting.\n */\n preventAnimationOnMount?: boolean;\n /**\n * The CSS selector of the container where the dialog is rendered.\n */\n containerSelector?: string;\n /**\n * If true, positions the tooltip element.\n */\n tooltip?: boolean;\n /**\n * Class name applied to the tooltip element.\n */\n tooltipClassName?: string;\n /**\n * Callback fired when the dialog is shown.\n */\n onDialogDidShow?: (event?: DialogEvent, eventName?: DialogTriggerEvent | string) => void;\n /**\n * Callback fired when the dialog is hidden.\n */\n onDialogDidHide?: (event: DialogEvent, eventName: DialogTriggerEvent | string) => void;\n /**\n * Callback fired when clicking outside the dialog.\n */\n onClickOutside?: (event: React.MouseEvent) => void;\n /**\n * Callback fired when clicking inside the dialog content.\n */\n onContentClick?: (event: React.MouseEvent) => void;\n /**\n * The z-index applied to the dialog.\n */\n zIndex?: number;\n /**\n * If true, uses derived state from props.\n */\n useDerivedStateFromProps?: boolean;\n /**\n * If true, makes the dialog disappear when the reference element is hidden.\n */\n hideWhenReferenceHidden?: boolean;\n /**\n * If true, triggers the callback when the dialog mounts.\n */\n shouldCallbackOnMount?: boolean;\n /**\n * If true, instantly shows and hides the dialog without delay.\n */\n instantShowAndHide?: boolean;\n /**\n * Callback to dynamically adjust show delay and animation behavior.\n */\n getDynamicShowDelay?: () => { showDelay: number; preventAnimation: boolean };\n /**\n * The content displayed inside the dialog.\n */\n content?: (() => JSX.Element) | JSX.Element;\n /**\n * The element to position the dialog beside.\n */\n children?: ReactElement | ReactElement[] | string;\n /**\n * If true, keyboard focus/blur events behave like mouse enter/leave.\n */\n addKeyboardHideShowTriggersByDefault?: boolean;\n /**\n * If true, disables scrolling for the container element.\n */\n disableContainerScroll?: boolean | string;\n /**\n * Enables the observation of content resize for the popper element.\n * When set to `true`, a ResizeObserver is attached to the popper content,\n * automatically triggering repositioning when the size of the content changes.\n *\n * This is useful for dialogs, tooltips, or popovers with dynamic content\n * that may grow or shrink without a re-render being triggered.\n */\n observeContentResize?: boolean;\n /**\n * If true, provides a LayerProvider context for nested dialogs to render correctly.\n * This is useful when you have components that use Dialog internally (like Dropdown)\n * inside another Dialog, ensuring proper z-index stacking and click-outside behavior.\n */\n enableNestedDialogLayer?: boolean;\n}\n\nexport interface DialogState {\n /**\n * If true, the dialog is open.\n */\n isOpen?: boolean;\n /**\n * If true, the dialog state is derived from props.\n */\n shouldUseDerivedStateFromProps?: boolean;\n /**\n * If true, prevents animation when opening or closing the dialog.\n */\n preventAnimation?: boolean;\n}\n\nexport default class Dialog extends PureComponent<DialogProps, DialogState> {\n static defaultProps = {\n position: \"top\",\n modifiers: [] as Modifier<any>[],\n moveBy: { main: 0, secondary: 0 },\n showDelay: 100,\n hideDelay: 100,\n showTrigger: \"mouseenter\",\n hideTrigger: \"mouseleave\",\n showOnDialogEnter: false,\n shouldShowOnMount: false,\n disable: false,\n open: false,\n animationType: \"expand\",\n preventAnimationOnMount: false,\n tooltip: false,\n onDialogDidShow: NOOP,\n onDialogDidHide: NOOP,\n onClickOutside: NOOP,\n onContentClick: NOOP,\n useDerivedStateFromProps: false,\n hideWhenReferenceHidden: false,\n shouldCallbackOnMount: false,\n instantShowAndHide: false,\n addKeyboardHideShowTriggersByDefault: false,\n observeContentResize: false,\n enableNestedDialogLayer: false\n };\n private showTimeout: NodeJS.Timeout;\n private hideTimeout: NodeJS.Timeout;\n private containerRef: React.RefObject<HTMLDivElement>;\n context!: React.ContextType<typeof LayerContext>;\n\n constructor(props: DialogProps) {\n super(props);\n this.state = {\n shouldUseDerivedStateFromProps: props.useDerivedStateFromProps,\n isOpen: props.shouldShowOnMount\n };\n\n this.containerRef = React.createRef<HTMLDivElement>();\n\n // Binding section.\n this.onMouseEnter = this.onMouseEnter.bind(this);\n this.onMouseLeave = this.onMouseLeave.bind(this);\n this.onMouseDown = this.onMouseDown.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.isShown = this.isShown.bind(this);\n this.onEsc = this.onEsc.bind(this);\n this.onClickOutside = this.onClickOutside.bind(this);\n this.onDialogEnter = this.onDialogEnter.bind(this);\n this.onDialogLeave = this.onDialogLeave.bind(this);\n this.getContainer = this.getContainer.bind(this);\n this.onContentClick = this.onContentClick.bind(this);\n this.onKeyDown = this.onKeyDown.bind(this);\n this.closeDialogOnEscape = this.closeDialogOnEscape.bind(this);\n this.onContextMenu = this.onContextMenu.bind(this);\n this.getDefaultContainer = this.getDefaultContainer.bind(this);\n\n // Timeouts\n this.hideTimeout = null;\n this.showTimeout = null;\n }\n\n closeDialogOnEscape(event: KeyboardEvent) {\n const { isOpen } = this.state;\n if (!isOpen) {\n return;\n }\n switch (event.key) {\n case \"Escape\":\n this.hideDialogIfNeeded(event, \"esckey\");\n break;\n case \"Tab\":\n this.handleEvent(\"tab\", event.target, event);\n break;\n case \"Enter\":\n this.handleEvent(\"enter\", event.target, event);\n break;\n default:\n break;\n }\n }\n\n componentDidMount() {\n const { shouldCallbackOnMount, onDialogDidShow } = this.props;\n const { isOpen } = this.state;\n if (isClient()) {\n document.addEventListener(\"keyup\", this.closeDialogOnEscape);\n }\n if (shouldCallbackOnMount && isOpen) {\n onDialogDidShow && onDialogDidShow();\n }\n }\n\n componentWillUnmount() {\n if (isClient()) {\n document.removeEventListener(\"keyup\", this.closeDialogOnEscape);\n }\n if (this.showTimeout) {\n clearTimeout(this.showTimeout);\n this.showTimeout = null;\n }\n if (this.hideTimeout) {\n clearTimeout(this.hideTimeout);\n this.hideTimeout = null;\n }\n }\n\n static getDerivedStateFromProps(nextProps: DialogProps, state: DialogState): DialogState {\n if (state.shouldUseDerivedStateFromProps) {\n return { isOpen: nextProps.isOpen };\n }\n return null;\n }\n\n getDefaultContainer() {\n const { layerRef } = this.context;\n if (layerRef?.current) {\n return layerRef.current;\n }\n return document.body;\n }\n\n getContainer() {\n const { containerSelector } = this.props;\n if (!containerSelector) {\n return this.getDefaultContainer();\n }\n\n const containerElement = document.querySelector(containerSelector);\n if (!containerElement || !(containerElement instanceof Element)) {\n return this.getDefaultContainer();\n }\n return containerElement;\n }\n\n showDialog(event: DialogEvent, eventName: DialogTriggerEvent | string, options: { preventAnimation?: boolean } = {}) {\n const { showDelay, instantShowAndHide, getDynamicShowDelay } = this.props;\n let finalShowDelay = showDelay;\n let preventAnimation = options.preventAnimation;\n if (getDynamicShowDelay) {\n const dynamicDelayObj = getDynamicShowDelay();\n finalShowDelay = dynamicDelayObj.showDelay || 0;\n preventAnimation = preventAnimation || dynamicDelayObj.preventAnimation;\n }\n\n if (instantShowAndHide) {\n this.onShowDialog(event, eventName);\n this.setState({ isOpen: true, preventAnimation });\n this.showTimeout = null;\n } else {\n this.showTimeout = setTimeout(() => {\n this.onShowDialog(event, eventName);\n this.showTimeout = null;\n this.setState({ isOpen: true, preventAnimation });\n }, finalShowDelay);\n }\n }\n\n onShowDialog(event: DialogEvent, eventName: DialogTriggerEvent | string) {\n if (this.isShown()) return;\n const { onDialogDidShow } = this.props;\n onDialogDidShow(event, eventName);\n }\n\n showDialogIfNeeded(event: DialogEvent, eventName: DialogTriggerEvent | string, options = {}) {\n const { disable } = this.props;\n if (disable) {\n return;\n }\n\n if (this.hideTimeout) {\n clearTimeout(this.hideTimeout);\n this.hideTimeout = null;\n }\n\n if (!this.showTimeout) {\n this.showDialog(event, eventName, options);\n }\n }\n\n hideDialog(event: DialogEvent, eventName: DialogTriggerEvent | string) {\n const { hideDelay, instantShowAndHide } = this.props;\n if (instantShowAndHide) {\n this.onHideDialog(event, eventName);\n this.setState({ isOpen: false });\n this.hideTimeout = null;\n } else {\n this.hideTimeout = setTimeout(() => {\n this.onHideDialog(event, eventName);\n this.setState({ isOpen: false });\n this.hideTimeout = null;\n }, hideDelay);\n }\n }\n\n onHideDialog(event: DialogEvent, eventName: DialogTriggerEvent | string) {\n const { onDialogDidHide } = this.props;\n if (onDialogDidHide) onDialogDidHide(event, eventName);\n }\n\n hideDialogIfNeeded(event: DialogEvent, eventName: DialogTriggerEvent | string) {\n if (this.showTimeout) {\n clearTimeout(this.showTimeout);\n this.showTimeout = null;\n }\n\n if (this.hideTimeout) {\n return;\n }\n this.hideDialog(event, eventName);\n }\n\n handleEvent(eventName: DialogTriggerEvent, target: EventTarget, event: DialogEvent) {\n const { showTriggerIgnoreClass, hideTriggerIgnoreClass } = this.props;\n if (\n this.isShowTrigger(eventName) &&\n !this.isShown() &&\n !isInsideClass(target as HTMLElement, showTriggerIgnoreClass)\n ) {\n return this.showDialogIfNeeded(event, eventName);\n }\n\n if (this.isHideTrigger(eventName) && !isInsideClass(target as HTMLElement, hideTriggerIgnoreClass)) {\n return this.hideDialogIfNeeded(event, eventName);\n }\n }\n\n isShown() {\n const { isOpen } = this.state;\n const { open } = this.props;\n\n return isOpen || open;\n }\n\n isShowTrigger(eventName: DialogTriggerEvent) {\n const { showTrigger, addKeyboardHideShowTriggersByDefault } = this.props;\n const showTriggersArray = convertToArray(showTrigger);\n\n if (addKeyboardHideShowTriggersByDefault) {\n if (eventName === \"focus\" && showTriggersArray.indexOf(\"mouseenter\") > -1) {\n return true;\n }\n }\n\n return showTriggersArray.indexOf(eventName) > -1;\n }\n\n isHideTrigger(eventName: DialogTriggerEvent) {\n const { hideTrigger, addKeyboardHideShowTriggersByDefault } = this.props;\n const hideTriggersArray = convertToArray(hideTrigger);\n\n if (addKeyboardHideShowTriggersByDefault) {\n if (eventName === \"blur\" && hideTriggersArray.indexOf(\"mouseleave\") > -1) {\n return true;\n }\n }\n\n return hideTriggersArray.indexOf(eventName) > -1;\n }\n\n onMouseEnter(e: React.MouseEvent) {\n this.handleEvent(\"mouseenter\", e.target, e);\n }\n\n onMouseLeave(e: React.MouseEvent) {\n this.handleEvent(\"mouseleave\", e.target, e);\n }\n\n onClick(e: React.MouseEvent) {\n if (e.button) return;\n this.handleEvent(\"click\", e.target, e);\n }\n\n onKeyDown(event: React.KeyboardEvent) {\n if (event.key === \"Enter\") {\n this.handleEvent(\"enter\", event.target, event);\n }\n\n if (event.key === \"Tab\") {\n this.handleEvent(\"tab\", event.target, event);\n }\n }\n\n onMouseDown(e: React.MouseEvent) {\n if (e.button) return;\n this.handleEvent(\"mousedown\", e.target, e);\n }\n\n onFocus(e: React.FocusEvent) {\n this.handleEvent(\"focus\", e.target, e);\n }\n\n onBlur(e: React.FocusEvent) {\n this.handleEvent(\"blur\", e.relatedTarget, e);\n }\n\n onEsc(e: React.KeyboardEvent) {\n this.handleEvent(\"esckey\", e.target, e);\n }\n\n onContextMenu(e: React.MouseEvent) {\n const isShown = this.isShown();\n if ((this.isShowTrigger(\"contextmenu\") && !isShown) || (this.isHideTrigger(\"contextmenu\") && isShown)) {\n e.preventDefault();\n }\n this.handleEvent(\"contextmenu\", e.target, e);\n }\n\n onClickOutside(event: React.MouseEvent) {\n const { onClickOutside } = this.props;\n this.handleEvent(\"clickoutside\", event.target, event);\n onClickOutside(event);\n }\n\n onDialogEnter(event: React.MouseEvent) {\n const { showOnDialogEnter } = this.props;\n if (showOnDialogEnter) this.showDialogIfNeeded(event, \"DialogEnter\");\n }\n\n onDialogLeave(event: React.MouseEvent) {\n const { showOnDialogEnter } = this.props;\n if (showOnDialogEnter) this.hideDialogIfNeeded(event, \"DialogLeave\");\n }\n\n onContentClick(e: React.MouseEvent) {\n const { onContentClick } = this.props;\n this.handleEvent(\"onContentClick\", e.target, e);\n onContentClick(e);\n }\n\n render() {\n const {\n wrapperClassName,\n content,\n startingEdge,\n children,\n preventAnimationOnMount,\n animationType,\n position,\n showDelay,\n moveBy,\n modifiers,\n tooltip,\n tooltipClassName,\n referenceWrapperClassName,\n referenceWrapperElement,\n zIndex,\n hideWhenReferenceHidden,\n disableContainerScroll,\n containerSelector,\n observeContentResize,\n enableNestedDialogLayer,\n id,\n \"data-testid\": dataTestId\n } = this.props;\n const { preventAnimation } = this.state;\n const overrideDataTestId = dataTestId || getTestId(ComponentDefaultTestId.DIALOG, id);\n\n const animationTypeCalculated = preventAnimationOnMount || preventAnimation ? undefined : animationType;\n const contentRendered = isFunction(content) ? content() : content;\n\n if (!contentRendered) {\n return children;\n }\n return (\n <Manager>\n <Reference>\n {({ ref }) => {\n return (\n <Refable\n className={cx(referenceWrapperClassName)}\n wrapperElement={referenceWrapperElement}\n ref={ref}\n onBlur={chainOnPropsAndInstance(\"onBlur\", this, this.props)}\n onKeyDown={chainOnPropsAndInstance(\"onKeyDown\", this, this.props)}\n onClick={chainOnPropsAndInstance(\"onClick\", this, this.props)}\n onFocus={chainOnPropsAndInstance(\"onFocus\", this, this.props)}\n onMouseDown={chainOnPropsAndInstance(\"onMouseDown\", this, this.props)}\n onMouseEnter={chainOnPropsAndInstance(\"onMouseEnter\", this, this.props)}\n onMouseLeave={chainOnPropsAndInstance(\"onMouseLeave\", this, this.props)}\n onContextMenu={chainOnPropsAndInstance(\"onContextMenu\", this, this.props)}\n >\n {children}\n </Refable>\n );\n }}\n </Reference>\n {isClient() &&\n createPortal(\n <Popper\n placement={position as unknown as PopperJS.Placement}\n modifiers={[\n {\n name: \"offset\",\n options: {\n offset: [moveBy.secondary, moveBy.main]\n }\n },\n {\n name: \"zIndex\",\n enabled: true,\n phase: \"write\",\n fn({ state }) {\n if (zIndex) {\n state.styles.popper.zIndex = String(zIndex);\n }\n return state;\n }\n },\n {\n name: \"rotator\",\n enabled: true,\n phase: \"write\",\n fn({ state }) {\n if (!state.styles.arrow) {\n return state;\n }\n // const reg = new RegExp(\n // /translate\\(([0-9].*)px, ([0-9].*)px\\)/\n // );\n // const transform = state.styles.arrow.transform;\n // const res = reg.exec(transform);\n // state.styles.popper.transformOrigin = `${100 -\n // res[1]}% ${100 - res[2]}%`;\n state.styles.arrow.transform = `${state.styles.arrow.transform} rotate(45deg)`;\n return state;\n }\n },\n createObserveContentResizeModifier(observeContentResize),\n ...modifiers\n ]}\n >\n {({ placement, style, ref, arrowProps, isReferenceHidden }) => {\n if (!this.isShown() && placement) {\n return null;\n }\n\n if (hideWhenReferenceHidden && isReferenceHidden) {\n const event = new CustomEvent(\"onReferenceHidden\");\n this.hideDialog(event, \"onReferenceHidden\");\n }\n\n const mergedRef = chainRefFunctions([ref, this.containerRef]);\n\n const dialogContent = (\n <DialogContent\n data-testid={overrideDataTestId}\n isReferenceHidden={hideWhenReferenceHidden && isReferenceHidden}\n onMouseEnter={this.onDialogEnter}\n onMouseLeave={this.onDialogLeave}\n onClickOutside={this.onClickOutside}\n onContextMenu={this.onContextMenu}\n onEsc={this.onEsc}\n animationType={animationTypeCalculated}\n position={placement}\n wrapperClassName={wrapperClassName}\n startingEdge={startingEdge}\n isOpen={this.isShown()}\n showDelay={showDelay}\n styleObject={style}\n ref={mergedRef}\n onClick={this.onContentClick}\n hasTooltip={!!tooltip}\n containerSelector={containerSelector}\n disableContainerScroll={disableContainerScroll}\n >\n {contentRendered}\n {tooltip && (\n <div\n style={arrowProps.style}\n ref={arrowProps.ref}\n className={cx(styles.arrow, tooltipClassName)}\n data-placement={placement}\n />\n )}\n </DialogContent>\n );\n\n return enableNestedDialogLayer ? (\n <LayerProvider layerRef={this.containerRef}>{dialogContent}</LayerProvider>\n ) : (\n dialogContent\n );\n }}\n </Popper>,\n this.getContainer()\n )}\n </Manager>\n );\n }\n}\n\nfunction chainOnPropsAndInstance(name: string, instance: Dialog, props: DialogProps) {\n // @ts-ignore\n return chainFunctions([props[name], instance[name]], true);\n}\n\nDialog.contextType = LayerContext;\n"],"names":["Dialog","PureComponent","constructor","props","super","this","state","shouldUseDerivedStateFromProps","useDerivedStateFromProps","isOpen","shouldShowOnMount","containerRef","React","createRef","onMouseEnter","bind","onMouseLeave","onMouseDown","onClick","onFocus","onBlur","isShown","onEsc","onClickOutside","onDialogEnter","onDialogLeave","getContainer","onContentClick","onKeyDown","closeDialogOnEscape","onContextMenu","getDefaultContainer","hideTimeout","showTimeout","event","key","hideDialogIfNeeded","handleEvent","target","componentDidMount","shouldCallbackOnMount","onDialogDidShow","isClient","document","addEventListener","componentWillUnmount","removeEventListener","clearTimeout","getDerivedStateFromProps","nextProps","layerRef","context","current","body","containerSelector","containerElement","querySelector","Element","showDialog","eventName","options","showDelay","instantShowAndHide","getDynamicShowDelay","finalShowDelay","preventAnimation","dynamicDelayObj","onShowDialog","setState","setTimeout","showDialogIfNeeded","disable","hideDialog","hideDelay","onHideDialog","onDialogDidHide","showTriggerIgnoreClass","hideTriggerIgnoreClass","isShowTrigger","isInsideClass","isHideTrigger","open","showTrigger","addKeyboardHideShowTriggersByDefault","showTriggersArray","convertToArray","indexOf","hideTrigger","hideTriggersArray","e","button","relatedTarget","preventDefault","showOnDialogEnter","render","wrapperClassName","content","startingEdge","children","preventAnimationOnMount","animationType","position","moveBy","modifiers","tooltip","tooltipClassName","referenceWrapperClassName","referenceWrapperElement","zIndex","hideWhenReferenceHidden","disableContainerScroll","observeContentResize","enableNestedDialogLayer","id","dataTestId","overrideDataTestId","getTestId","ComponentDefaultTestId","DIALOG","animationTypeCalculated","undefined","contentRendered","isFunction","Manager","createElement","Reference","ref","Refable","className","cx","wrapperElement","chainOnPropsAndInstance","createPortal","Popper","placement","name","offset","secondary","main","enabled","phase","fn","styles","popper","String","arrow","transform","createObserveContentResizeModifier","style","arrowProps","isReferenceHidden","CustomEvent","mergedRef","chainRefFunctions","dialogContent","DialogContent","styleObject","hasTooltip","LayerProvider","instance","chainFunctions","defaultProps","NOOP","contextType","LayerContext"],"mappings":"2qBAqNqB,MAAAA,UAAeC,EAiClCC,WAAAA,CAAYC,GACVC,MAAMD,GACNE,KAAKC,MAAQ,CACXC,+BAAgCJ,EAAMK,yBACtCC,OAAQN,EAAMO,mBAGhBL,KAAKM,aAAeC,EAAMC,YAG1BR,KAAKS,aAAeT,KAAKS,aAAaC,KAAKV,MAC3CA,KAAKW,aAAeX,KAAKW,aAAaD,KAAKV,MAC3CA,KAAKY,YAAcZ,KAAKY,YAAYF,KAAKV,MACzCA,KAAKa,QAAUb,KAAKa,QAAQH,KAAKV,MACjCA,KAAKc,QAAUd,KAAKc,QAAQJ,KAAKV,MACjCA,KAAKe,OAASf,KAAKe,OAAOL,KAAKV,MAC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MACZ8E,cAAemB,EACflB,SAAUiC,EACVvC,iBAAkBA,EAClBE,aAAcA,EACdxF,OAAQJ,KAAKgB,UACbwC,UAAWA,EACX+F,YAAaR,EACbtB,IAAK0B,EACLtI,QAASb,KAAKsB,eACdkI,aAAcrD,EACdlD,kBAAmBA,EACnBwD,uBAAwBA,GAEvBW,EACAjB,GACC5F,EACEgH,cAAA,MAAA,CAAAwB,MAAOC,EAAWD,MAClBtB,IAAKuB,EAAWvB,IAChBE,UAAWC,EAAGa,EAAOG,MAAOxC,GAAiB,iBAC7B6B,KAMxB,OAAOtB,EACLpG,EAACgH,cAAAkC,EAAc,CAAA5G,SAAU7C,KAAKM,cAAe+I,GAE7CA,CACD,IAGLrJ,KAAKqB,iBA3HJwE,CA+HX,EAGF,SAASiC,EAAwBI,EAAcwB,EAAkB5J,GAE/D,OAAO6J,EAAe,CAAC7J,EAAMoI,GAAOwB,EAASxB,KAAQ,EACvD,CAlfSvI,EAAAiK,aAAe,CACpB5D,SAAU,MACVE,UAAW,GACXD,OAAQ,CAAEoC,KAAM,EAAGD,UAAW,GAC9B5E,UAAW,IACXY,UAAW,IACXS,YAAa,aACbK,YAAa,aACbM,mBAAmB,EACnBnF,mBAAmB,EACnB6D,SAAS,EACTU,MAAM,EACNmB,cAAe,SACfD,yBAAyB,EACzBK,SAAS,EACT/D,gBAAiByH,EACjBvF,gBAAiBuF,EACjB3I,eAAgB2I,EAChBvI,eAAgBuI,EAChB1J,0BAA0B,EAC1BqG,yBAAyB,EACzBrE,uBAAuB,EACvBsB,oBAAoB,EACpBqB,sCAAsC,EACtC4B,sBAAsB,EACtBC,yBAAyB,GA2d7BhH,EAAOmK,YAAcC"}
1
+ {"version":3,"file":"Dialog.js","sources":["../../src/Dialog/Dialog.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { useState, useEffect, useRef, useContext, useCallback, useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {\n useFloating,\n offset,\n flip,\n shift,\n hide,\n arrow as arrowMiddleware,\n autoUpdate,\n type Placement,\n type Middleware\n} from \"@floating-ui/react-dom\";\nimport { isFunction } from \"es-toolkit\";\nimport {\n chainFunctions,\n chainRefFunctions,\n convertToArray,\n NOOP,\n isInsideClass,\n ComponentDefaultTestId,\n getTestId,\n isClient\n} from \"@vibe/shared\";\nimport DialogContent from \"./components/DialogContent/DialogContent\";\nimport { Refable } from \"./components/Refable/Refable\";\nimport styles from \"./Dialog.module.scss\";\nimport { type DialogTriggerEvent, type DialogEvent, type DialogProps } from \"./Dialog.types\";\nimport { LayerContext, LayerProvider } from \"@vibe/layer\";\n\nfunction Dialog({\n // Core props\n id,\n \"data-testid\": dataTestId,\n children,\n content,\n position = \"top\",\n moveBy = { main: 0, secondary: 0 },\n middleware: middlewareProp = [],\n startingEdge,\n showDelay = 100,\n hideDelay = 100,\n instantShowAndHide = false,\n getDynamicShowDelay,\n showTrigger = \"mouseenter\",\n hideTrigger = \"mouseleave\",\n showOnDialogEnter = false,\n showTriggerIgnoreClass,\n hideTriggerIgnoreClass,\n addKeyboardHideShowTriggersByDefault = true,\n shouldShowOnMount = false,\n disable = false,\n open = false,\n isOpen: isOpenProp,\n useDerivedStateFromProps = false,\n animationType = \"expand\",\n preventAnimationOnMount = false,\n tooltip = false,\n tooltipClassName,\n containerSelector,\n disableContainerScroll,\n zIndex,\n wrapperClassName,\n referenceWrapperClassName,\n referenceWrapperElement,\n onBlur: onBlurProp,\n onKeyDown: onKeyDownProp,\n onClick: onClickProp,\n onFocus: onFocusProp,\n onMouseDown: onMouseDownProp,\n onMouseEnter: onMouseEnterProp,\n onMouseLeave: onMouseLeaveProp,\n onContextMenu: onContextMenuProp,\n onDialogDidShow = NOOP,\n onDialogDidHide = NOOP,\n onClickOutside: onClickOutsideProp = NOOP,\n onContentClick: onContentClickProp = NOOP,\n hideWhenReferenceHidden = false,\n shouldCallbackOnMount = false,\n observeContentResize = false\n}: DialogProps) {\n const [isOpenState, setIsOpenState] = useState(shouldShowOnMount);\n const [preventAnimation, setPreventAnimation] = useState(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const arrowRef = useRef<HTMLDivElement>(null);\n\n // Check if children are valid React elements (Refable returns null for non-elements)\n const hasValidChildren = React.Children.toArray(children).some(child => React.isValidElement(child));\n\n const { layerRef } = useContext(LayerContext);\n\n // Derived state\n const isOpenInternal = useDerivedStateFromProps ? isOpenProp : isOpenState;\n const isShown = isOpenInternal || open;\n\n // Build middleware array for Floating UI\n const floatingMiddleware = useMemo<Middleware[]>(() => {\n const middlewareList: Middleware[] = [];\n\n // Get user-provided middleware (filter out invalid ones)\n const validMiddleware = middlewareProp.filter(\n (m): m is Middleware => m != null && typeof m === \"object\" && typeof m.fn === \"function\"\n );\n\n // Check if user provided their own middleware to override defaults\n const hasCustomOffset = validMiddleware.some(m => m.name === \"offset\");\n const hasCustomFlip = validMiddleware.some(m => m.name === \"flip\");\n const hasCustomShift = validMiddleware.some(m => m.name === \"shift\");\n\n // Offset middleware - skip if user provided their own\n if (!hasCustomOffset && (moveBy.main !== 0 || moveBy.secondary !== 0)) {\n middlewareList.push(offset({ mainAxis: moveBy.main || 0, crossAxis: moveBy.secondary || 0 }));\n }\n\n // Core positioning middleware - skip if user provided their own\n if (!hasCustomFlip) {\n middlewareList.push(flip());\n }\n if (!hasCustomShift) {\n middlewareList.push(shift());\n }\n\n // Add user-provided middleware\n middlewareList.push(...validMiddleware);\n\n // Arrow middleware - pass ref directly, Floating UI handles null refs\n if (tooltip) {\n middlewareList.push(arrowMiddleware({ element: arrowRef }));\n }\n\n // Hide middleware for detecting when reference is hidden\n if (hideWhenReferenceHidden) {\n middlewareList.push(hide());\n }\n\n return middlewareList;\n }, [moveBy.main, moveBy.secondary, tooltip, hideWhenReferenceHidden, middlewareProp]);\n\n // Configure autoUpdate for position tracking\n const whileElementsMounted = useCallback(\n (reference: HTMLElement, floating: HTMLElement, update: () => void) => {\n return autoUpdate(reference, floating, update, {\n elementResize: observeContentResize,\n layoutShift: false\n });\n },\n [observeContentResize]\n );\n\n // Use Floating UI hook\n const { refs, floatingStyles, placement, middlewareData } = useFloating({\n placement: position as Placement,\n middleware: floatingMiddleware,\n whileElementsMounted,\n elements: {\n reference: referenceElement\n }\n });\n\n // Check if reference is hidden (from hide middleware)\n const isReferenceHidden = middlewareData.hide?.referenceHidden ?? false;\n\n const isShowTrigger = useCallback(\n (eventName: DialogTriggerEvent) => {\n const showTriggersArray = convertToArray(showTrigger);\n if (addKeyboardHideShowTriggersByDefault && eventName === \"focus\" && showTriggersArray.includes(\"mouseenter\")) {\n return true;\n }\n return showTriggersArray.includes(eventName);\n },\n [showTrigger, addKeyboardHideShowTriggersByDefault]\n );\n\n const isHideTrigger = useCallback(\n (eventName: DialogTriggerEvent) => {\n const hideTriggersArray = convertToArray(hideTrigger);\n if (addKeyboardHideShowTriggersByDefault && eventName === \"blur\" && hideTriggersArray.includes(\"mouseleave\")) {\n return true;\n }\n return hideTriggersArray.includes(eventName);\n },\n [hideTrigger, addKeyboardHideShowTriggersByDefault]\n );\n\n const showDialog = useCallback(\n (event: DialogEvent, eventName: DialogTriggerEvent | string, options: { preventAnimation?: boolean } = {}) => {\n let finalShowDelay = showDelay;\n let preventAnimationValue = options.preventAnimation;\n if (getDynamicShowDelay) {\n const dynamicDelayObj = getDynamicShowDelay();\n finalShowDelay = dynamicDelayObj.showDelay || 0;\n preventAnimationValue = preventAnimationValue ?? dynamicDelayObj.preventAnimation;\n }\n\n if (instantShowAndHide) {\n onDialogDidShow(event, eventName);\n setIsOpenState(true);\n setPreventAnimation(!!preventAnimationValue);\n showTimeoutRef.current = null;\n } else {\n showTimeoutRef.current = setTimeout(() => {\n onDialogDidShow(event, eventName);\n showTimeoutRef.current = null;\n setIsOpenState(true);\n setPreventAnimation(!!preventAnimationValue);\n }, finalShowDelay);\n }\n },\n [showDelay, getDynamicShowDelay, instantShowAndHide, onDialogDidShow]\n );\n\n const hideDialog = useCallback(\n (event: DialogEvent, eventName: DialogTriggerEvent | string) => {\n if (instantShowAndHide) {\n onDialogDidHide(event, eventName);\n setIsOpenState(false);\n hideTimeoutRef.current = null;\n } else {\n hideTimeoutRef.current = setTimeout(() => {\n onDialogDidHide(event, eventName);\n setIsOpenState(false);\n hideTimeoutRef.current = null;\n }, hideDelay);\n }\n },\n [hideDelay, instantShowAndHide, onDialogDidHide]\n );\n\n const showDialogIfNeeded = useCallback(\n (event: DialogEvent, eventName: DialogTriggerEvent | string, options = {}) => {\n if (disable) {\n return;\n }\n\n if (hideTimeoutRef.current) {\n clearTimeout(hideTimeoutRef.current);\n hideTimeoutRef.current = null;\n }\n\n if (!showTimeoutRef.current) {\n showDialog(event, eventName, options);\n }\n },\n [disable, showDialog]\n );\n\n const hideDialogIfNeeded = useCallback(\n (event: DialogEvent, eventName: DialogTriggerEvent | string) => {\n if (showTimeoutRef.current) {\n clearTimeout(showTimeoutRef.current);\n showTimeoutRef.current = null;\n }\n\n if (!hideTimeoutRef.current) {\n hideDialog(event, eventName);\n }\n },\n [hideDialog]\n );\n\n // Event handling\n const handleEvent = useCallback(\n (eventName: DialogTriggerEvent, target: EventTarget | null, event: DialogEvent) => {\n if (!target) return; // Guard against null targets (e.g., when focus leaves the document)\n if (isShowTrigger(eventName) && !isShown && !isInsideClass(target as HTMLElement, showTriggerIgnoreClass)) {\n return showDialogIfNeeded(event, eventName);\n }\n\n if (isHideTrigger(eventName) && !isInsideClass(target as HTMLElement, hideTriggerIgnoreClass)) {\n return hideDialogIfNeeded(event, eventName);\n }\n },\n [\n isShowTrigger,\n isHideTrigger,\n isShown,\n showTriggerIgnoreClass,\n hideTriggerIgnoreClass,\n showDialogIfNeeded,\n hideDialogIfNeeded\n ]\n );\n\n const getContainer = useCallback(() => {\n if (containerSelector) {\n const containerElement = document.querySelector(containerSelector);\n if (containerElement instanceof Element) {\n return containerElement;\n }\n }\n return layerRef?.current || document.body;\n }, [containerSelector, layerRef]);\n\n // Memoized event handlers to prevent unnecessary re-renders\n const onMouseEnter = useCallback((e: React.MouseEvent) => handleEvent(\"mouseenter\", e.target, e), [handleEvent]);\n const onMouseLeave = useCallback((e: React.MouseEvent) => handleEvent(\"mouseleave\", e.target, e), [handleEvent]);\n const onClick = useCallback(\n (e: React.MouseEvent) => {\n if (e.button) return;\n handleEvent(\"click\", e.target, e);\n },\n [handleEvent]\n );\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n // Handle element-level keyboard events for triggers\n if (event.key === \"Enter\") handleEvent(\"enter\", event.target, event);\n if (event.key === \"Tab\") handleEvent(\"tab\", event.target, event);\n },\n [handleEvent]\n );\n\n const onMouseDown = useCallback(\n (e: React.MouseEvent) => {\n if (e.button) return;\n handleEvent(\"mousedown\", e.target, e);\n },\n [handleEvent]\n );\n const onFocus = useCallback((e: React.FocusEvent) => handleEvent(\"focus\", e.target, e), [handleEvent]);\n const onBlur = useCallback(\n (e: React.FocusEvent) => {\n const target = e.relatedTarget || e.target;\n handleEvent(\"blur\", target, e);\n },\n [handleEvent]\n );\n const onEsc = useCallback((e: React.KeyboardEvent) => handleEvent(\"esckey\", e.target, e), [handleEvent]);\n const onContextMenu = useCallback(\n (e: React.MouseEvent) => {\n if ((isShowTrigger(\"contextmenu\") && !isShown) || (isHideTrigger(\"contextmenu\") && isShown)) {\n e.preventDefault();\n }\n handleEvent(\"contextmenu\", e.target, e);\n },\n [isShown, isShowTrigger, isHideTrigger, handleEvent]\n );\n\n const onClickOutside = useCallback(\n (event: React.MouseEvent) => {\n handleEvent(\"clickoutside\", event.target, event);\n onClickOutsideProp(event);\n },\n [handleEvent, onClickOutsideProp]\n );\n\n const onDialogEnter = useCallback(\n (event: React.MouseEvent) => {\n if (showOnDialogEnter) showDialogIfNeeded(event, \"DialogEnter\");\n },\n [showOnDialogEnter, showDialogIfNeeded]\n );\n\n const onDialogLeave = useCallback(\n (event: React.MouseEvent) => {\n if (showOnDialogEnter) hideDialogIfNeeded(event, \"DialogLeave\");\n },\n [showOnDialogEnter, hideDialogIfNeeded]\n );\n\n const onContentClick = useCallback(\n (e: React.MouseEvent) => {\n handleEvent(\"onContentClick\", e.target, e);\n onContentClickProp(e);\n },\n [handleEvent, onContentClickProp]\n );\n\n // Memoized chained event handlers to prevent Refable children re-renders\n const chainedOnBlur = useMemo(() => chainFunctions([onBlurProp, onBlur], true), [onBlurProp, onBlur]);\n const chainedOnKeyDown = useMemo(() => chainFunctions([onKeyDownProp, onKeyDown], true), [onKeyDownProp, onKeyDown]);\n const chainedOnClick = useMemo(() => chainFunctions([onClickProp, onClick], true), [onClickProp, onClick]);\n const chainedOnFocus = useMemo(() => chainFunctions([onFocusProp, onFocus], true), [onFocusProp, onFocus]);\n const chainedOnMouseDown = useMemo(\n () => chainFunctions([onMouseDownProp, onMouseDown], true),\n [onMouseDownProp, onMouseDown]\n );\n const chainedOnMouseEnter = useMemo(\n () => chainFunctions([onMouseEnterProp, onMouseEnter], true),\n [onMouseEnterProp, onMouseEnter]\n );\n const chainedOnMouseLeave = useMemo(\n () => chainFunctions([onMouseLeaveProp, onMouseLeave], true),\n [onMouseLeaveProp, onMouseLeave]\n );\n const chainedOnContextMenu = useMemo(\n () => chainFunctions([onContextMenuProp, onContextMenu], true),\n [onContextMenuProp, onContextMenu]\n );\n\n // Document-level keyboard handler using stable ref pattern\n // Must handle Escape, Tab, and Enter at document level to match old behavior\n const closeDialogOnEscapeRef = useRef<(event: KeyboardEvent) => void>();\n closeDialogOnEscapeRef.current = (event: KeyboardEvent) => {\n if (!isShown) return;\n\n switch (event.key) {\n case \"Escape\":\n hideDialogIfNeeded(event, \"esckey\");\n break;\n case \"Tab\":\n handleEvent(\"tab\", event.target, event);\n break;\n case \"Enter\":\n handleEvent(\"enter\", event.target, event);\n break;\n }\n };\n\n // Effects\n\n // Callback on mount\n useEffect(() => {\n if (shouldCallbackOnMount && shouldShowOnMount) {\n onDialogDidShow();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Cleanup timeouts on unmount\n useEffect(() => {\n return () => {\n if (showTimeoutRef.current) clearTimeout(showTimeoutRef.current);\n if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);\n };\n }, []);\n\n // Document keyboard listener (stable reference via ref)\n useEffect(() => {\n if (!isClient()) return;\n\n const handler = (event: KeyboardEvent) => closeDialogOnEscapeRef.current?.(event);\n document.addEventListener(\"keyup\", handler);\n return () => document.removeEventListener(\"keyup\", handler);\n }, []);\n\n // Handle reference hidden state\n useEffect(() => {\n if (hideWhenReferenceHidden && isReferenceHidden && isShown) {\n const event = new CustomEvent(\"onReferenceHidden\");\n hideDialog(event, \"onReferenceHidden\");\n }\n }, [hideWhenReferenceHidden, isReferenceHidden, isShown, hideDialog]);\n\n // Computed values\n const overrideDataTestId = dataTestId || getTestId(ComponentDefaultTestId.DIALOG, id);\n\n const arrowStyles = useMemo<React.CSSProperties>(() => {\n if (!middlewareData.arrow) return {};\n const { x, y } = middlewareData.arrow;\n return {\n left: x != null ? `${x}px` : \"\",\n top: y != null ? `${y}px` : \"\",\n transform: \"rotate(45deg)\"\n };\n }, [middlewareData.arrow]);\n\n // Skip Floating UI positioning when no children (e.g. floating Tipseen) — let CSS handle it\n const finalFloatingStyles = useMemo<React.CSSProperties>(\n () =>\n hasValidChildren\n ? { ...floatingStyles, ...(zIndex !== undefined && { zIndex }) }\n : { ...(zIndex !== undefined && { zIndex }) },\n [floatingStyles, zIndex, hasValidChildren]\n );\n\n const animationTypeCalculated = preventAnimationOnMount || preventAnimation ? undefined : animationType;\n const contentRendered = isFunction(content) ? content() : content;\n\n // Early return if no content - wrap in fragment for type safety\n if (!contentRendered) {\n return <>{children}</>;\n }\n\n const mergedFloatingRef = chainRefFunctions([refs.setFloating, containerRef]);\n\n const dialogContent = (\n <DialogContent\n data-testid={overrideDataTestId}\n isReferenceHidden={hideWhenReferenceHidden && isReferenceHidden}\n onMouseEnter={onDialogEnter}\n onMouseLeave={onDialogLeave}\n onClickOutside={onClickOutside}\n onContextMenu={onContextMenu}\n onEsc={onEsc}\n animationType={animationTypeCalculated}\n position={placement}\n wrapperClassName={wrapperClassName}\n startingEdge={startingEdge}\n isOpen={isShown}\n showDelay={showDelay}\n styleObject={finalFloatingStyles}\n ref={mergedFloatingRef}\n onClick={onContentClick}\n hasTooltip={!!tooltip}\n containerSelector={containerSelector}\n disableContainerScroll={disableContainerScroll}\n >\n {contentRendered}\n {tooltip && (\n <div\n style={arrowStyles}\n ref={arrowRef}\n className={cx(styles.arrow, tooltipClassName)}\n data-placement={placement}\n />\n )}\n </DialogContent>\n );\n\n return (\n <>\n <Refable\n className={cx(referenceWrapperClassName)}\n wrapperElement={referenceWrapperElement}\n ref={setReferenceElement}\n onBlur={chainedOnBlur}\n onKeyDown={chainedOnKeyDown}\n onClick={chainedOnClick}\n onFocus={chainedOnFocus}\n onMouseDown={chainedOnMouseDown}\n onMouseEnter={chainedOnMouseEnter}\n onMouseLeave={chainedOnMouseLeave}\n onContextMenu={chainedOnContextMenu}\n >\n {children}\n </Refable>\n {isClient() &&\n isShown &&\n createPortal(<LayerProvider layerRef={containerRef}>{dialogContent}</LayerProvider>, getContainer())}\n </>\n );\n}\n\nexport default Dialog;\n"],"names":["Dialog","id","dataTestId","children","content","position","moveBy","main","secondary","middleware","middlewareProp","startingEdge","showDelay","hideDelay","instantShowAndHide","getDynamicShowDelay","showTrigger","hideTrigger","showOnDialogEnter","showTriggerIgnoreClass","hideTriggerIgnoreClass","addKeyboardHideShowTriggersByDefault","shouldShowOnMount","disable","open","isOpen","isOpenProp","useDerivedStateFromProps","animationType","preventAnimationOnMount","tooltip","tooltipClassName","containerSelector","disableContainerScroll","zIndex","wrapperClassName","referenceWrapperClassName","referenceWrapperElement","onBlur","onBlurProp","onKeyDown","onKeyDownProp","onClick","onClickProp","onFocus","onFocusProp","onMouseDown","onMouseDownProp","onMouseEnter","onMouseEnterProp","onMouseLeave","onMouseLeaveProp","onContextMenu","onContextMenuProp","onDialogDidShow","NOOP","onDialogDidHide","onClickOutside","onClickOutsideProp","onContentClick","onContentClickProp","hideWhenReferenceHidden","shouldCallbackOnMount","observeContentResize","isOpenState","setIsOpenState","useState","preventAnimation","setPreventAnimation","referenceElement","setReferenceElement","showTimeoutRef","useRef","hideTimeoutRef","containerRef","arrowRef","hasValidChildren","React","Children","toArray","some","child","isValidElement","layerRef","useContext","LayerContext","isShown","floatingMiddleware","useMemo","middlewareList","validMiddleware","filter","m","fn","hasCustomOffset","name","hasCustomFlip","hasCustomShift","push","offset","mainAxis","crossAxis","flip","shift","arrowMiddleware","element","hide","whileElementsMounted","useCallback","reference","floating","update","autoUpdate","elementResize","layoutShift","refs","floatingStyles","placement","middlewareData","useFloating","elements","isReferenceHidden","_b","_a","referenceHidden","isShowTrigger","eventName","showTriggersArray","convertToArray","includes","isHideTrigger","hideTriggersArray","showDialog","event","options","finalShowDelay","preventAnimationValue","dynamicDelayObj","current","setTimeout","hideDialog","showDialogIfNeeded","clearTimeout","hideDialogIfNeeded","handleEvent","target","isInsideClass","getContainer","containerElement","document","querySelector","Element","body","e","button","key","relatedTarget","onEsc","preventDefault","onDialogEnter","onDialogLeave","chainedOnBlur","chainFunctions","chainedOnKeyDown","chainedOnClick","chainedOnFocus","chainedOnMouseDown","chainedOnMouseEnter","chainedOnMouseLeave","chainedOnContextMenu","closeDialogOnEscapeRef","useEffect","isClient","handler","call","addEventListener","removeEventListener","CustomEvent","overrideDataTestId","getTestId","ComponentDefaultTestId","DIALOG","arrowStyles","arrow","x","y","left","top","transform","finalFloatingStyles","Object","assign","undefined","animationTypeCalculated","contentRendered","isFunction","createElement","Fragment","mergedFloatingRef","chainRefFunctions","setFloating","dialogContent","DialogContent","styleObject","ref","hasTooltip","style","className","cx","styles","Refable","wrapperElement","createPortal","LayerProvider"],"mappings":"4tBA+BA,SAASA,GAAOC,GAEdA,EACA,cAAeC,EAA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6H,EAAYpK,EACpFsK,GAAkBC,EAAW/L,GAAWA,IAAYA,EAG1D,IAAK8L,GACH,OAAOrH,EAAAuH,cAAAvH,EAAAwH,SAAA,KAAGlM,GAGZ,MAAMmM,GAAoBC,EAAkB,CAACpF,GAAKqF,YAAa9H,KAEzD+H,GACJ5H,EAACuH,cAAAM,iBACcxB,GACbzD,kBAAmB5D,IAA2B4D,GAC9CzE,aAAc+G,GACd7G,aAAc8G,GACdvG,eAAgBA,GAChBL,cAAeA,GACfyG,MAAOA,GACPjI,cAAeqK,GACf5L,SAAUgH,GACVlF,iBAAkBA,GAClBxB,aAAcA,EACdc,OAAQ6D,GACR1E,UAAWA,EACX+L,YAAad,GACbe,IAAKN,GACL5J,QAASiB,GACTkJ,aAAc/K,GACdE,kBAAmBA,GACnBC,uBAAwBA,IAEvBiK,GACApK,IACC+C,EAAAuH,cAAA,MAAA,CACEU,MAAOxB,GACPsB,IAAKjI,GACLoI,UAAWC,EAAGC,EAAO1B,MAAOxJ,IACZ,iBAAAsF,MAMxB,OACExC,EAAAuH,cAAAvH,EAAAwH,SAAA,KACExH,EAACuH,cAAAc,GACCH,UAAWC,EAAG5K,IACd+K,eAAgB9K,GAChBuK,IAAKtI,GACLhC,OAAQ2H,GACRzH,UAAW2H,GACXzH,QAAS0H,GACTxH,QAASyH,GACTvH,YAAawH,GACbtH,aAAcuH,GACdrH,aAAcsH,GACdpH,cAAeqH,IAEdtK,GAEFyK,KACCtF,IACA8H,EAAavI,EAACuH,cAAAiB,EAAc,CAAAlI,SAAUT,IAAe+H,IAAgCtD,MAG7F"}
@@ -1,2 +1,2 @@
1
- var a={arrow:"arrow_0b4c7d234a"};!function(a){const e="s_id-3fb64cda561a_3_0_11";if("undefined"!=typeof document){const t=document.head||document.getElementsByTagName("head")[0];if(t.querySelector("#"+e))return;const r=document.createElement("style");r.id=e,t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.appendChild(document.createTextNode(a))}else globalThis.injectedStyles&&(globalThis.injectedStyles[e]=a)}(".arrow_0b4c7d234a {\n width: 12px;\n height: 12px;\n position: absolute;\n border-radius: 2px;\n background-color: var(--secondary-background-color);\n}\n.dark-app-theme .arrow_0b4c7d234a[data-placement*=right], .black-app-theme .arrow_0b4c7d234a[data-placement*=right], .hacker-app-theme .arrow_0b4c7d234a[data-placement*=right] {\n box-shadow: -1px 1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_0b4c7d234a[data-placement*=left], .black-app-theme .arrow_0b4c7d234a[data-placement*=left], .hacker-app-theme .arrow_0b4c7d234a[data-placement*=left] {\n box-shadow: 1px -1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_0b4c7d234a[data-placement*=bottom], .black-app-theme .arrow_0b4c7d234a[data-placement*=bottom], .hacker-app-theme .arrow_0b4c7d234a[data-placement*=bottom] {\n box-shadow: -1px -1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_0b4c7d234a[data-placement*=top], .black-app-theme .arrow_0b4c7d234a[data-placement*=top], .hacker-app-theme .arrow_0b4c7d234a[data-placement*=top] {\n box-shadow: 1px 1px 0px 0px var(--layout-border-color);\n}\n.arrow_0b4c7d234a[data-placement*=bottom] {\n top: 1px;\n}\n.arrow_0b4c7d234a[data-placement*=top] {\n bottom: 1px;\n}\n.arrow_0b4c7d234a[data-placement*=left] {\n right: 1px;\n}\n.arrow_0b4c7d234a[data-placement*=right] {\n left: 1px;\n}");export{a as default};
1
+ var e={arrow:"arrow_e6b32e8572"};!function(e){const a="s_id-3fb64cda561a_4_0_0-alpha_0";if("undefined"!=typeof document){const t=document.head||document.getElementsByTagName("head")[0];if(t.querySelector("#"+a))return;const r=document.createElement("style");r.id=a,t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[a]=e)}(".arrow_e6b32e8572 {\n width: 12px;\n height: 12px;\n position: absolute;\n border-radius: 2px;\n background-color: var(--secondary-background-color);\n}\n.dark-app-theme .arrow_e6b32e8572[data-placement*=right], .black-app-theme .arrow_e6b32e8572[data-placement*=right], .hacker-app-theme .arrow_e6b32e8572[data-placement*=right] {\n box-shadow: -1px 1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_e6b32e8572[data-placement*=left], .black-app-theme .arrow_e6b32e8572[data-placement*=left], .hacker-app-theme .arrow_e6b32e8572[data-placement*=left] {\n box-shadow: 1px -1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_e6b32e8572[data-placement*=bottom], .black-app-theme .arrow_e6b32e8572[data-placement*=bottom], .hacker-app-theme .arrow_e6b32e8572[data-placement*=bottom] {\n box-shadow: -1px -1px 0px 0px var(--layout-border-color);\n}\n.dark-app-theme .arrow_e6b32e8572[data-placement*=top], .black-app-theme .arrow_e6b32e8572[data-placement*=top], .hacker-app-theme .arrow_e6b32e8572[data-placement*=top] {\n box-shadow: 1px 1px 0px 0px var(--layout-border-color);\n}\n.arrow_e6b32e8572[data-placement*=bottom] {\n top: 1px;\n}\n.arrow_e6b32e8572[data-placement*=top] {\n bottom: 1px;\n}\n.arrow_e6b32e8572[data-placement*=left] {\n right: 1px;\n}\n.arrow_e6b32e8572[data-placement*=right] {\n left: 1px;\n}");export{e as default};
2
2
  //# sourceMappingURL=Dialog.module.scss.js.map