@hanzogui/dismissable 8.3.0 → 8.3.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 (67) hide show
  1. package/dist/cjs/Dismissable.js +413 -0
  2. package/dist/cjs/Dismissable.js.map +1 -0
  3. package/dist/cjs/DismissableProps.js +3 -0
  4. package/dist/cjs/DismissableProps.js.map +1 -0
  5. package/dist/cjs/index.js +5 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/package.json +1 -0
  8. package/dist/esm/Dismissable.js +402 -0
  9. package/dist/esm/Dismissable.js.map +1 -0
  10. package/dist/esm/DismissableProps.js +2 -0
  11. package/dist/esm/DismissableProps.js.map +1 -0
  12. package/dist/esm/index.js +2 -2
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/native/Dismissable.js +22 -0
  15. package/dist/native/Dismissable.js.map +1 -0
  16. package/dist/native/DismissableProps.js +2 -0
  17. package/dist/native/DismissableProps.js.map +1 -0
  18. package/dist/native/index.js +2 -0
  19. package/dist/native/index.js.map +1 -0
  20. package/package.json +19 -19
  21. package/src/Dismissable.native.tsx +1 -1
  22. package/src/Dismissable.tsx +1 -1
  23. package/src/DismissableProps.tsx +1 -1
  24. package/src/index.ts +1 -1
  25. package/types/Dismissable.d.ts +1 -1
  26. package/types/Dismissable.d.ts.map +1 -1
  27. package/types/Dismissable.native.d.ts +1 -1
  28. package/types/Dismissable.native.d.ts.map +1 -1
  29. package/types/DismissableProps.d.ts +1 -1
  30. package/types/DismissableProps.d.ts.map +1 -1
  31. package/types/index.d.ts +1 -1
  32. package/types/index.d.ts.map +1 -1
  33. package/dist/cjs/Dismissable.cjs +0 -383
  34. package/dist/cjs/Dismissable.native.js +0 -67
  35. package/dist/cjs/Dismissable.native.js.map +0 -1
  36. package/dist/cjs/DismissableProps.cjs +0 -18
  37. package/dist/cjs/DismissableProps.native.js +0 -21
  38. package/dist/cjs/DismissableProps.native.js.map +0 -1
  39. package/dist/cjs/index.cjs +0 -20
  40. package/dist/cjs/index.native.js +0 -23
  41. package/dist/cjs/index.native.js.map +0 -1
  42. package/dist/esm/Dismissable.mjs +0 -340
  43. package/dist/esm/Dismissable.mjs.map +0 -1
  44. package/dist/esm/Dismissable.native.js +0 -22
  45. package/dist/esm/Dismissable.native.js.map +0 -1
  46. package/dist/esm/DismissableProps.mjs +0 -2
  47. package/dist/esm/DismissableProps.mjs.map +0 -1
  48. package/dist/esm/DismissableProps.native.js +0 -2
  49. package/dist/esm/DismissableProps.native.js.map +0 -1
  50. package/dist/esm/index.mjs +0 -2
  51. package/dist/esm/index.mjs.map +0 -1
  52. package/dist/esm/index.native.js +0 -2
  53. package/dist/esm/index.native.js.map +0 -1
  54. package/dist/jsx/Dismissable.mjs +0 -340
  55. package/dist/jsx/Dismissable.mjs.map +0 -1
  56. package/dist/jsx/Dismissable.native.js +0 -67
  57. package/dist/jsx/Dismissable.native.js.map +0 -1
  58. package/dist/jsx/DismissableProps.mjs +0 -2
  59. package/dist/jsx/DismissableProps.mjs.map +0 -1
  60. package/dist/jsx/DismissableProps.native.js +0 -21
  61. package/dist/jsx/DismissableProps.native.js.map +0 -1
  62. package/dist/jsx/index.js +0 -2
  63. package/dist/jsx/index.js.map +0 -1
  64. package/dist/jsx/index.mjs +0 -2
  65. package/dist/jsx/index.mjs.map +0 -1
  66. package/dist/jsx/index.native.js +0 -23
  67. package/dist/jsx/index.native.js.map +0 -1
@@ -0,0 +1,402 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // forked from radix-ui
3
+ // https://github.com/radix-ui/primitives/blob/cfd8dcba5fa6a0e751486af418d05a7b88a7f541/packages/react/dismissable-layer/src/DismissableLayer.tsx#L324
4
+ import { useComposedRefs } from '@hanzogui/compose-refs';
5
+ import { Slot, View, composeEventHandlers } from '@hanzogui/core';
6
+ import { useEscapeKeydown } from '@hanzogui/use-escape-keydown';
7
+ import { useEvent } from '@hanzogui/use-event';
8
+ import * as React from 'react';
9
+ import * as ReactDOM from 'react-dom';
10
+ export function dispatchDiscreteCustomEvent(target, event) {
11
+ if (target)
12
+ ReactDOM.flushSync(() => target.dispatchEvent(event));
13
+ }
14
+ /* -------------------------------------------------------------------------------------------------
15
+ * Dismissable
16
+ * -----------------------------------------------------------------------------------------------*/
17
+ const DISMISSABLE_LAYER_NAME = 'Dismissable';
18
+ const CONTEXT_UPDATE = 'dismissable.update';
19
+ const POINTER_DOWN_OUTSIDE = 'dismissable.pointerDownOutside';
20
+ const FOCUS_OUTSIDE = 'dismissable.focusOutside';
21
+ let originalBodyPointerEvents;
22
+ // global layer tracking
23
+ const globalLayers = new Set();
24
+ const layerChangeListeners = new Set();
25
+ // track if any layer has disableOutsidePointerEvents - only then do we need position updates
26
+ let layersWithPointerEventsDisabledCount = 0;
27
+ function notifyLayerChange() {
28
+ for (const listener of layerChangeListeners) {
29
+ listener();
30
+ }
31
+ }
32
+ /**
33
+ * returns the number of active dismissable layers
34
+ * useful for non-React contexts (e.g. escape key handlers)
35
+ */
36
+ export function getDismissableLayerCount() {
37
+ return globalLayers.size;
38
+ }
39
+ /**
40
+ * debug helper - logs what elements are registered as dismissable layers
41
+ */
42
+ export function debugDismissableLayers() {
43
+ const layers = Array.from(globalLayers);
44
+ console.log('[Dismissable] Active layers:', layers.length, layers);
45
+ return layers;
46
+ }
47
+ /**
48
+ * hook that returns true when any dismissable layer is active
49
+ * re-renders when the state changes
50
+ * uses module-level globals, not React context, so works anywhere in tree
51
+ */
52
+ export function useHasDismissableLayers() {
53
+ const [count, setCount] = React.useState(() => globalLayers.size);
54
+ React.useEffect(() => {
55
+ setCount(globalLayers.size);
56
+ const update = () => setCount(globalLayers.size);
57
+ layerChangeListeners.add(update);
58
+ return () => {
59
+ layerChangeListeners.delete(update);
60
+ };
61
+ }, []);
62
+ return count > 0;
63
+ }
64
+ const DismissableContext = React.createContext({
65
+ layers: new Set(),
66
+ layersWithOutsidePointerEventsDisabled: new Set(),
67
+ branches: new Set(),
68
+ });
69
+ /**
70
+ * hook to check if a DOM element is inside an active dismissable layer
71
+ * useful for custom escape handling - if inside a dismissable, you may want to defer
72
+ */
73
+ export function useIsInsideDismissable(ref) {
74
+ const context = React.useContext(DismissableContext);
75
+ const [isInside, setIsInside] = React.useState(false);
76
+ React.useEffect(() => {
77
+ const check = () => {
78
+ const el = ref.current;
79
+ if (!el) {
80
+ setIsInside(false);
81
+ return;
82
+ }
83
+ for (const layer of context.layers) {
84
+ if (layer.contains(el)) {
85
+ setIsInside(true);
86
+ return;
87
+ }
88
+ }
89
+ setIsInside(false);
90
+ };
91
+ check();
92
+ document.addEventListener(CONTEXT_UPDATE, check);
93
+ return () => document.removeEventListener(CONTEXT_UPDATE, check);
94
+ }, [context.layers, ref]);
95
+ return isInside;
96
+ }
97
+ /**
98
+ * hook to check if there are dismissable layers above a given element
99
+ * returns the count of layers that are ancestors of the element
100
+ */
101
+ export function useDismissableLayersAbove(ref) {
102
+ const context = React.useContext(DismissableContext);
103
+ const [count, setCount] = React.useState(0);
104
+ React.useEffect(() => {
105
+ const check = () => {
106
+ const el = ref.current;
107
+ if (!el) {
108
+ setCount(0);
109
+ return;
110
+ }
111
+ let above = 0;
112
+ for (const layer of context.layers) {
113
+ if (layer.contains(el)) {
114
+ above++;
115
+ }
116
+ }
117
+ setCount(above);
118
+ };
119
+ check();
120
+ document.addEventListener(CONTEXT_UPDATE, check);
121
+ return () => document.removeEventListener(CONTEXT_UPDATE, check);
122
+ }, [context.layers, ref]);
123
+ return count;
124
+ }
125
+ const Dismissable = React.forwardRef((props, forwardedRef) => {
126
+ const { disableOutsidePointerEvents = false, forceUnmount, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, asChild, children, branches: branchesProp, ...layerProps } = props;
127
+ const Comp = asChild ? Slot : View;
128
+ const context = React.useContext(DismissableContext);
129
+ const [node, setNode] = React.useState(null);
130
+ const [, force] = React.useState({});
131
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setNode(node));
132
+ const layers = Array.from(context.layers);
133
+ const [highestLayerWithOutsidePointerEventsDisabled] = [
134
+ ...context.layersWithOutsidePointerEventsDisabled,
135
+ ].slice(-1);
136
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
137
+ const index = node ? layers.indexOf(node) : -1;
138
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
139
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
140
+ const pointerDownOutside = usePointerDownOutside((event) => {
141
+ const target = event.target;
142
+ // check prop-based branches first (scoped to this dismissable), then global branches
143
+ const branches = branchesProp || context.branches;
144
+ const isPointerDownOnBranch = [...branches].some((branch) => branch.contains(target));
145
+ if (!isPointerEventsEnabled || isPointerDownOnBranch)
146
+ return;
147
+ onPointerDownOutside?.(event);
148
+ onInteractOutside?.(event);
149
+ if (!event.defaultPrevented)
150
+ onDismiss?.();
151
+ });
152
+ const focusOutside = useFocusOutside((event) => {
153
+ const target = event.target;
154
+ // check prop-based branches first (scoped to this dismissable), then global branches
155
+ const branches = branchesProp || context.branches;
156
+ const isFocusInBranch = [...branches].some((branch) => branch.contains(target));
157
+ if (isFocusInBranch)
158
+ return;
159
+ onFocusOutside?.(event);
160
+ onInteractOutside?.(event);
161
+ if (!event.defaultPrevented)
162
+ onDismiss?.();
163
+ });
164
+ // track forceUnmount in a ref so escape handler can check it
165
+ const forceUnmountRef = React.useRef(forceUnmount);
166
+ React.useEffect(() => {
167
+ forceUnmountRef.current = forceUnmount;
168
+ }, [forceUnmount]);
169
+ useEscapeKeydown((event) => {
170
+ // skip if this layer is force-unmounted (e.g. dialog closed but still mounted)
171
+ if (forceUnmountRef.current)
172
+ return;
173
+ // Check layers at callback time, not render time, to avoid stale closures
174
+ const currentLayers = Array.from(context.layers);
175
+ const currentIndex = node ? currentLayers.indexOf(node) : -1;
176
+ const isHighestLayer = currentIndex === currentLayers.length - 1;
177
+ if (!isHighestLayer)
178
+ return;
179
+ onEscapeKeyDown?.(event);
180
+ if (!event.defaultPrevented && onDismiss) {
181
+ event.preventDefault();
182
+ onDismiss();
183
+ }
184
+ });
185
+ React.useEffect(() => {
186
+ if (!node)
187
+ return;
188
+ // don't add to layers when force-unmounted (dialog closed but still mounted)
189
+ if (forceUnmount)
190
+ return;
191
+ if (disableOutsidePointerEvents) {
192
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
193
+ originalBodyPointerEvents = document.body.style.pointerEvents;
194
+ document.body.style.pointerEvents = 'none';
195
+ }
196
+ context.layersWithOutsidePointerEventsDisabled.add(node);
197
+ layersWithPointerEventsDisabledCount++;
198
+ }
199
+ context.layers.add(node);
200
+ globalLayers.add(node);
201
+ // only dispatch position update when pointer-events tracking is active
202
+ if (disableOutsidePointerEvents || layersWithPointerEventsDisabledCount > 0) {
203
+ dispatchUpdate();
204
+ }
205
+ notifyLayerChange();
206
+ return () => {
207
+ if (disableOutsidePointerEvents) {
208
+ if (context.layersWithOutsidePointerEventsDisabled.size === 1) {
209
+ document.body.style.pointerEvents = originalBodyPointerEvents;
210
+ }
211
+ // decrement AFTER dispatch so other layers still re-render
212
+ }
213
+ };
214
+ }, [node, disableOutsidePointerEvents, forceUnmount, context]);
215
+ /**
216
+ * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
217
+ * because a change to `disableOutsidePointerEvents` would remove this layer from the stack
218
+ * and add it to the end again so the layering order wouldn't be _creation order_.
219
+ * We only want them to be removed from context stacks when unmounted.
220
+ */
221
+ React.useEffect(() => {
222
+ if (forceUnmount)
223
+ return;
224
+ return () => {
225
+ if (!node)
226
+ return;
227
+ const hadPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.has(node);
228
+ context.layers.delete(node);
229
+ context.layersWithOutsidePointerEventsDisabled.delete(node);
230
+ globalLayers.delete(node);
231
+ // only dispatch position update when pointer-events tracking is active
232
+ if (layersWithPointerEventsDisabledCount > 0) {
233
+ dispatchUpdate();
234
+ }
235
+ notifyLayerChange();
236
+ // decrement count AFTER dispatch so other layers see count > 0 and re-render
237
+ if (hadPointerEventsDisabled) {
238
+ layersWithPointerEventsDisabledCount--;
239
+ }
240
+ };
241
+ }, [node, context, forceUnmount]);
242
+ React.useEffect(() => {
243
+ const handleUpdate = () => {
244
+ // only force re-render if we need to track layer positions for pointer-events
245
+ // this avoids N^2 re-renders when multiple dismissables mount/unmount
246
+ if (layersWithPointerEventsDisabledCount > 0) {
247
+ force({});
248
+ }
249
+ };
250
+ document.addEventListener(CONTEXT_UPDATE, handleUpdate);
251
+ return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
252
+ }, []);
253
+ return (_jsx(Comp, { ...layerProps,
254
+ // @ts-ignore
255
+ ref: composedRefs, ...(!asChild && {
256
+ display: 'contents',
257
+ }), pointerEvents: isBodyPointerEventsDisabled
258
+ ? isPointerEventsEnabled
259
+ ? 'auto'
260
+ : 'none'
261
+ : undefined, onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture), children: children }));
262
+ });
263
+ Dismissable.displayName = DISMISSABLE_LAYER_NAME;
264
+ /* -------------------------------------------------------------------------------------------------
265
+ * DismissableBranch
266
+ * -----------------------------------------------------------------------------------------------*/
267
+ const BRANCH_NAME = 'DismissableBranch';
268
+ const DismissableBranch = React.forwardRef((props, forwardedRef) => {
269
+ const { branches: branchesProp, ...rest } = props;
270
+ const context = React.useContext(DismissableContext);
271
+ const ref = React.useRef(null);
272
+ const composedRefs = useComposedRefs(forwardedRef, ref);
273
+ React.useEffect(() => {
274
+ const node = ref.current;
275
+ if (!(node instanceof HTMLElement))
276
+ return;
277
+ // use prop-based branches if provided, otherwise fall back to global context
278
+ const branches = branchesProp || context.branches;
279
+ if (node && branches) {
280
+ branches.add(node);
281
+ return () => {
282
+ branches.delete(node);
283
+ };
284
+ }
285
+ }, [branchesProp, context.branches]);
286
+ return _jsx(View, { asChild: "except-style", ...rest, ref: composedRefs });
287
+ });
288
+ DismissableBranch.displayName = BRANCH_NAME;
289
+ /**
290
+ * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
291
+ * to mimic layer dismissing behaviour present in OS.
292
+ * Returns props to pass to the node we want to check for outside events.
293
+ */
294
+ function usePointerDownOutside(onPointerDownOutside) {
295
+ const handlePointerDownOutside = useEvent(onPointerDownOutside);
296
+ const isPointerInsideReactTreeRef = React.useRef(false);
297
+ const handleClickRef = React.useRef(() => { });
298
+ React.useEffect(() => {
299
+ const handlePointerDown = (event) => {
300
+ if (event.target && !isPointerInsideReactTreeRef.current) {
301
+ const eventDetail = { originalEvent: event };
302
+ function handleAndDispatchPointerDownOutsideEvent() {
303
+ handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true });
304
+ }
305
+ /**
306
+ * On touch devices, we need to wait for a click event because browsers implement
307
+ * a ~350ms delay between the time the user stops touching the display and when the
308
+ * browser executres events. We need to ensure we don't reactivate pointer-events within
309
+ * this timeframe otherwise the browser may execute events that should have been prevented.
310
+ *
311
+ * Additionally, this also lets us deal automatically with cancellations when a click event
312
+ * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
313
+ *
314
+ * This is why we also continuously remove the previous listener, because we cannot be
315
+ * certain that it was raised, and therefore cleaned-up.
316
+ */
317
+ if (event.pointerType === 'touch') {
318
+ document.removeEventListener('click', handleClickRef.current);
319
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
320
+ document.addEventListener('click', handleClickRef.current, { once: true });
321
+ }
322
+ else {
323
+ handleAndDispatchPointerDownOutsideEvent();
324
+ }
325
+ }
326
+ isPointerInsideReactTreeRef.current = false;
327
+ };
328
+ /**
329
+ * if this hook executes in a component that mounts via a `pointerdown` event, the event
330
+ * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
331
+ * this by delaying the event listener registration on the document.
332
+ * This is not React specific, but rather how the DOM works, ie:
333
+ * ```
334
+ * button.addEventListener('pointerdown', () => {
335
+ * console.log('I will log');
336
+ * document.addEventListener('pointerdown', () => {
337
+ * console.log('I will also log');
338
+ * })
339
+ * });
340
+ */
341
+ const timerId = setTimeout(() => {
342
+ document.addEventListener('pointerdown', handlePointerDown);
343
+ }, 0);
344
+ return () => {
345
+ window.clearTimeout(timerId);
346
+ document.removeEventListener('pointerdown', handlePointerDown);
347
+ document.removeEventListener('click', handleClickRef.current);
348
+ };
349
+ }, [handlePointerDownOutside]);
350
+ return {
351
+ // ensures we check React component tree (not just DOM tree)
352
+ onPointerDownCapture: () => {
353
+ isPointerInsideReactTreeRef.current = true;
354
+ },
355
+ };
356
+ }
357
+ /**
358
+ * Listens for when focus happens outside a react subtree.
359
+ * Returns props to pass to the root (node) of the subtree we want to check.
360
+ */
361
+ function useFocusOutside(onFocusOutside) {
362
+ const handleFocusOutside = useEvent(onFocusOutside);
363
+ const isFocusInsideReactTreeRef = React.useRef(false);
364
+ React.useEffect(() => {
365
+ const handleFocus = (event) => {
366
+ if (event.target && !isFocusInsideReactTreeRef.current) {
367
+ const eventDetail = { originalEvent: event };
368
+ handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
369
+ discrete: false,
370
+ });
371
+ }
372
+ };
373
+ document.addEventListener('focusin', handleFocus);
374
+ return () => document.removeEventListener('focusin', handleFocus);
375
+ }, [handleFocusOutside]);
376
+ return {
377
+ onFocusCapture: () => {
378
+ isFocusInsideReactTreeRef.current = true;
379
+ },
380
+ onBlurCapture: () => {
381
+ isFocusInsideReactTreeRef.current = false;
382
+ },
383
+ };
384
+ }
385
+ function dispatchUpdate() {
386
+ const event = new CustomEvent(CONTEXT_UPDATE);
387
+ document.dispatchEvent(event);
388
+ }
389
+ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
390
+ const target = detail.originalEvent.target;
391
+ const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
392
+ if (handler)
393
+ target.addEventListener(name, handler, { once: true });
394
+ if (discrete) {
395
+ dispatchDiscreteCustomEvent(target, event);
396
+ }
397
+ else {
398
+ target.dispatchEvent(event);
399
+ }
400
+ }
401
+ export { Dismissable, DismissableBranch };
402
+ //# sourceMappingURL=Dismissable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dismissable.js","sourceRoot":"","sources":["../../src/Dismissable.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,sJAAsJ;AAEtJ,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAc,IAAI,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAA;AAIrC,MAAM,UAAU,2BAA2B,CACzC,MAAmB,EACnB,KAAQ;IAER,IAAI,MAAM;QAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;AACnE,CAAC;AAED;;oGAEoG;AAEpG,MAAM,sBAAsB,GAAG,aAAa,CAAA;AAC5C,MAAM,cAAc,GAAG,oBAAoB,CAAA;AAC3C,MAAM,oBAAoB,GAAG,gCAAgC,CAAA;AAC7D,MAAM,aAAa,GAAG,0BAA0B,CAAA;AAEhD,IAAI,yBAAiC,CAAA;AAErC,wBAAwB;AACxB,MAAM,YAAY,GAAG,IAAI,GAAG,EAAe,CAAA;AAC3C,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAc,CAAA;AAElD,6FAA6F;AAC7F,IAAI,oCAAoC,GAAG,CAAC,CAAA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,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DismissableProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissableProps.js","sourceRoot":"","sources":["../../src/DismissableProps.tsx"],"names":[],"mappings":""}
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./Dismissable.mjs";
2
- //# sourceMappingURL=index.js.map
1
+ export * from './Dismissable.js';
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAmB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ // stubs for native - dismissable is a web-only concept
3
+ export function dispatchDiscreteCustomEvent(_target, _event) { }
4
+ export function getDismissableLayerCount() {
5
+ return 0;
6
+ }
7
+ export function useHasDismissableLayers() {
8
+ return false;
9
+ }
10
+ export function useIsInsideDismissable(_ref) {
11
+ return false;
12
+ }
13
+ export function useDismissableLayersAbove(_ref) {
14
+ return 0;
15
+ }
16
+ export const Dismissable = React.forwardRef((props, _ref) => {
17
+ return props.children;
18
+ });
19
+ export const DismissableBranch = React.forwardRef((props, _ref) => {
20
+ return props.children;
21
+ });
22
+ //# sourceMappingURL=Dismissable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dismissable.native.js","sourceRoot":"","sources":["../../src/Dismissable.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,uDAAuD;AACvD,MAAM,UAAU,2BAA2B,CACzC,OAAoB,EACpB,MAAS,IACR,CAAC;AAEJ,MAAM,UAAU,wBAAwB;IACtC,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,IAAyC;IAEzC,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,IAAyC;IAEzC,OAAO,CAAC,CAAA;AACV,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAuB,EAAE,IAAI,EAAE,EAAE;IAC5E,OAAO,KAAK,CAAC,QAAe,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CAC/C,CAAC,KAA6B,EAAE,IAAI,EAAE,EAAE;IACtC,OAAO,KAAK,CAAC,QAAe,CAAA;AAC9B,CAAC,CACF,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DismissableProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissableProps.js","sourceRoot":"","sources":["../../src/DismissableProps.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './Dismissable.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzogui/dismissable",
3
- "version": "8.3.0",
3
+ "version": "8.3.2",
4
4
  "source": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -9,19 +9,19 @@
9
9
  ],
10
10
  "type": "module",
11
11
  "sideEffects": false,
12
- "main": "dist/cjs",
13
- "module": "dist/esm",
12
+ "main": "./dist/cjs/index.js",
13
+ "module": "./dist/esm/index.js",
14
14
  "types": "./types/index.d.ts",
15
15
  "exports": {
16
16
  "./package.json": "./package.json",
17
17
  ".": {
18
18
  "types": "./types/index.d.ts",
19
- "react-native": "./dist/esm/index.native.js",
20
- "browser": "./dist/esm/index.mjs",
21
- "module": "./dist/esm/index.mjs",
22
- "import": "./dist/esm/index.mjs",
23
- "require": "./dist/cjs/index.cjs",
24
- "default": "./dist/esm/index.mjs"
19
+ "react-native": "./dist/native/index.js",
20
+ "browser": "./dist/esm/index.js",
21
+ "module": "./dist/esm/index.js",
22
+ "import": "./dist/esm/index.js",
23
+ "require": "./dist/cjs/index.js",
24
+ "default": "./dist/esm/index.js"
25
25
  }
26
26
  },
27
27
  "publishConfig": {
@@ -34,20 +34,20 @@
34
34
  "clean:build": "hanzogui-build clean:build"
35
35
  },
36
36
  "dependencies": {
37
- "@hanzogui/compose-refs": "8.3.0",
38
- "@hanzogui/core": "8.3.0",
39
- "@hanzogui/helpers": "8.3.0",
40
- "@hanzogui/use-escape-keydown": "8.3.0",
41
- "@hanzogui/use-event": "8.3.0"
37
+ "@hanzogui/compose-refs": "8.3.2",
38
+ "@hanzogui/core": "8.3.2",
39
+ "@hanzogui/helpers": "8.3.2",
40
+ "@hanzogui/use-escape-keydown": "8.3.2",
41
+ "@hanzogui/use-event": "8.3.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@hanzogui/build": "8.3.0",
45
- "react": ">=19",
46
- "react-dom": ">=19"
44
+ "@hanzogui/build": "8.3.2",
45
+ "react": "19.2.8",
46
+ "react-dom": "19.2.8"
47
47
  },
48
48
  "peerDependencies": {
49
- "react": ">=19",
50
- "react-dom": "*"
49
+ "react": ">=19.2.8",
50
+ "react-dom": ">=19.2.8"
51
51
  },
52
52
  "module:jsx": "dist/jsx",
53
53
  "repository": {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
 
3
- import type { DismissableBranchProps, DismissableProps } from './DismissableProps'
3
+ import type { DismissableBranchProps, DismissableProps } from './DismissableProps.tsx'
4
4
 
5
5
  // stubs for native - dismissable is a web-only concept
6
6
  export function dispatchDiscreteCustomEvent<E extends CustomEvent>(
@@ -8,7 +8,7 @@ import { useEvent } from '@hanzogui/use-event'
8
8
  import * as React from 'react'
9
9
  import * as ReactDOM from 'react-dom'
10
10
 
11
- import type { DismissableBranchProps, DismissableProps } from './DismissableProps'
11
+ import type { DismissableBranchProps, DismissableProps } from './DismissableProps.tsx'
12
12
 
13
13
  export function dispatchDiscreteCustomEvent<E extends CustomEvent>(
14
14
  target: E['target'],
@@ -1,6 +1,6 @@
1
1
  import type React from 'react'
2
2
 
3
- import type { FocusOutsideEvent, PointerDownOutsideEvent } from './Dismissable'
3
+ import type { FocusOutsideEvent, PointerDownOutsideEvent } from './Dismissable.tsx'
4
4
 
5
5
  export interface DismissableProps {
6
6
  /**
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './Dismissable'
1
+ export * from './Dismissable.tsx'
@@ -1,6 +1,6 @@
1
1
  import { GuiElement } from '@hanzogui/core';
2
2
  import * as React from 'react';
3
- import type { DismissableBranchProps, DismissableProps } from './DismissableProps';
3
+ import type { DismissableBranchProps, DismissableProps } from './DismissableProps.tsx';
4
4
  export declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E): void;
5
5
  /**
6
6
  * returns the number of active dismissable layers
@@ -1 +1 @@
1
- {"version":3,"file":"Dismissable.d.ts","sourceRoot":"","sources":["../src/Dismissable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAG7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAElF,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,WAAW,EAC/D,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,EACnB,KAAK,EAAE,CAAC,QAGT;AA0BD;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,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B,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,WA0B9E;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,UA0BjF;AAED,QAAA,MAAM,WAAW;cAEgB,OAAO;qCAmLtC,CAAA;AAUF,QAAA,MAAM,iBAAiB,2FAsBtB,CAAA;AAMD,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC;IAAE,aAAa,EAAE,YAAY,CAAA;CAAE,CAAC,CAAA;AAClF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAAE,aAAa,EAAE,UAAU,CAAA;CAAE,CAAC,CAAA;AAsI1E,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAEzC,YAAY,EAAE,gBAAgB,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { DismissableBranchProps, DismissableProps } from './DismissableProps';
2
+ import type { DismissableBranchProps, DismissableProps } from './DismissableProps.tsx';
3
3
  export declare function dispatchDiscreteCustomEvent<E extends CustomEvent>(_target: E['target'], _event: E): void;
4
4
  export declare function getDismissableLayerCount(): number;
5
5
  export declare function useHasDismissableLayers(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Dismissable.native.d.ts","sourceRoot":"","sources":["../src/Dismissable.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAGlF,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,WAAW,EAC/D,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,EACpB,MAAM,EAAE,CAAC,QACP;AAEJ,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACxC,OAAO,CAET;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACxC,MAAM,CAER;AAED,eAAO,MAAM,WAAW,kFAEtB,CAAA;AAEF,eAAO,MAAM,iBAAiB,wFAI7B,CAAA"}
1
+ {"version":3,"file":"Dismissable.native.d.ts","sourceRoot":"","sources":["../src/Dismissable.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGtF,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,WAAW,EAC/D,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,EACpB,MAAM,EAAE,CAAC,QACP;AAEJ,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACxC,OAAO,CAET;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GACxC,MAAM,CAER;AAED,eAAO,MAAM,WAAW,kFAEtB,CAAA;AAEF,eAAO,MAAM,iBAAiB,wFAI7B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { FocusOutsideEvent, PointerDownOutsideEvent } from './Dismissable';
2
+ import type { FocusOutsideEvent, PointerDownOutsideEvent } from './Dismissable.tsx';
3
3
  export interface DismissableProps {
4
4
  /**
5
5
  * When `true`, hover/focus/click interactions will be disabled on elements outside
@@ -1 +1 @@
1
- {"version":3,"file":"DismissableProps.d.ts","sourceRoot":"","sources":["../src/DismissablePro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AAmB,CAAA;AAEnF,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;IACrC;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAA;IAC5C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC/D;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACnD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,GAAG,iBAAiB,KAAK,IAAI,CAAA;IAEhF;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB,oBAAoB,CAAC,EAAE,GAAG,CAAA;IAC1B,aAAa,CAAC,EAAE,GAAG,CAAA;IACnB,cAAc,CAAC,EAAE,GAAG,CAAA;IAEpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;CAC5B"}
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './Dismissable';
1
+ export * from './Dismissable.tsx';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}