@ariakit/react-core 0.2.1 → 0.2.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 (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/cjs/__chunks/{TUFFT567.cjs → 3PYHURJV.cjs} +14 -13
  3. package/cjs/__chunks/{O4HKL5U2.cjs → 6ZHI7XFH.cjs} +11 -5
  4. package/cjs/__chunks/{XUWGEELZ.cjs → HRJZKMQQ.cjs} +6 -4
  5. package/cjs/__chunks/{BICG74YF.cjs → JPNLVNZZ.cjs} +9 -7
  6. package/cjs/__chunks/{GF4T7RQS.cjs → KEDMIM4S.cjs} +2 -2
  7. package/cjs/__chunks/{YEPQHTB5.cjs → MEVO6SEA.cjs} +7 -3
  8. package/cjs/__chunks/{VGBJOLSN.cjs → MXZHML62.cjs} +2 -2
  9. package/cjs/__chunks/{27JG67F3.cjs → PX5ZR4IF.cjs} +6 -1
  10. package/cjs/__chunks/{6TNK3LOZ.cjs → SW4NPZER.cjs} +7 -3
  11. package/cjs/__chunks/{CKE57WQN.cjs → YTRQSQYO.cjs} +5 -5
  12. package/cjs/combobox/combobox-list.cjs +3 -2
  13. package/cjs/combobox/combobox-list.d.ts +2 -1
  14. package/cjs/combobox/combobox-popover.cjs +19 -8
  15. package/cjs/composite/composite-overflow.cjs +5 -5
  16. package/cjs/dialog/dialog-backdrop.cjs +3 -3
  17. package/cjs/dialog/dialog-backdrop.d.ts +2 -2
  18. package/cjs/dialog/dialog.cjs +4 -4
  19. package/cjs/disclosure/disclosure-content.cjs +4 -2
  20. package/cjs/disclosure/disclosure-content.d.ts +23 -0
  21. package/cjs/hovercard/hovercard-anchor.cjs +2 -2
  22. package/cjs/hovercard/hovercard-store.cjs +2 -2
  23. package/cjs/hovercard/hovercard.cjs +6 -6
  24. package/cjs/menu/menu-button.cjs +2 -2
  25. package/cjs/menu/menu-list.cjs +3 -2
  26. package/cjs/menu/menu-list.d.ts +2 -1
  27. package/cjs/menu/menu-store.cjs +3 -3
  28. package/cjs/menu/menu.cjs +14 -11
  29. package/cjs/popover/popover.cjs +5 -5
  30. package/cjs/select/select-list.cjs +3 -2
  31. package/cjs/select/select-list.d.ts +2 -1
  32. package/cjs/select/select-popover.cjs +8 -8
  33. package/cjs/tab/tab-panel.cjs +2 -2
  34. package/cjs/tooltip/tooltip-anchor.cjs +2 -3
  35. package/cjs/tooltip/tooltip-store.cjs +7 -3
  36. package/cjs/tooltip/tooltip.cjs +6 -6
  37. package/cjs/tsconfig.build.tsbuildinfo +1 -1
  38. package/esm/__chunks/{BRUBRRXY.js → 5SUMII6J.js} +11 -5
  39. package/esm/__chunks/{VWIWDDTJ.js → BMIMIX2N.js} +4 -4
  40. package/esm/__chunks/{44D6W47E.js → EC5UVTWD.js} +5 -3
  41. package/esm/__chunks/{4GZHHNFX.js → K35D42HN.js} +7 -3
  42. package/esm/__chunks/{UJIZKMKY.js → K4BVBSSF.js} +1 -1
  43. package/esm/__chunks/{HJ244IIK.js → NC4VIH2L.js} +2 -2
  44. package/esm/__chunks/{WYKPGIVG.js → NRBO7PPT.js} +8 -6
  45. package/esm/__chunks/{VQ223ROI.js → Q4774GYW.js} +12 -11
  46. package/esm/__chunks/{K5R24MFH.js → QRJCFBOI.js} +7 -2
  47. package/esm/__chunks/{6JQLJMUQ.js → U5AZX35N.js} +7 -3
  48. package/esm/combobox/combobox-list.d.ts +2 -1
  49. package/esm/combobox/combobox-list.js +2 -1
  50. package/esm/combobox/combobox-popover.js +18 -7
  51. package/esm/composite/composite-overflow.js +4 -4
  52. package/esm/dialog/dialog-backdrop.d.ts +2 -2
  53. package/esm/dialog/dialog-backdrop.js +2 -2
  54. package/esm/dialog/dialog.js +3 -3
  55. package/esm/disclosure/disclosure-content.d.ts +23 -0
  56. package/esm/disclosure/disclosure-content.js +3 -1
  57. package/esm/hovercard/hovercard-anchor.js +1 -1
  58. package/esm/hovercard/hovercard-store.js +1 -1
  59. package/esm/hovercard/hovercard.js +5 -5
  60. package/esm/menu/menu-button.js +1 -1
  61. package/esm/menu/menu-list.d.ts +2 -1
  62. package/esm/menu/menu-list.js +2 -1
  63. package/esm/menu/menu-store.js +1 -1
  64. package/esm/menu/menu.js +12 -9
  65. package/esm/popover/popover.js +4 -4
  66. package/esm/select/select-list.d.ts +2 -1
  67. package/esm/select/select-list.js +2 -1
  68. package/esm/select/select-popover.js +8 -8
  69. package/esm/tab/tab-panel.js +1 -1
  70. package/esm/tooltip/tooltip-anchor.js +1 -2
  71. package/esm/tooltip/tooltip-store.js +7 -3
  72. package/esm/tooltip/tooltip.js +5 -5
  73. package/esm/tsconfig.build.tsbuildinfo +1 -1
  74. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ariakit/react-core
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Added `alwaysVisible` prop to `DisclosureContent` and derived components to allow the content to be visible even when the `open` state is `false`. ([#2438](https://github.com/ariakit/ariakit/pull/2438))
8
+
9
+ - Fixed `useHovercardStore` and `useTooltipStore` not updating the state when the `timeout`, `showTimeout` or `hideTimeout` props changed. ([#2421](https://github.com/ariakit/ariakit/pull/2421))
10
+
11
+ - Fixed `useTooltipStore` not updating the state when the `type` or `skipTimeout` props changed. ([#2421](https://github.com/ariakit/ariakit/pull/2421))
12
+
13
+ - Fixed `Dialog` moving focus on show and hide too early. ([#2421](https://github.com/ariakit/ariakit/pull/2421))
14
+
15
+ - Fixed `Hovercard` and `Tooltip` hiding too early when pressing the `Escape` key. ([#2421](https://github.com/ariakit/ariakit/pull/2421))
16
+
17
+ - Removed unnecessary `tabIndex={0}` prop from `TooltipAnchor`. ([#2421](https://github.com/ariakit/ariakit/pull/2421))
18
+
19
+ - Updated dependencies: `@ariakit/core@0.2.1`.
20
+
3
21
  ## 0.2.1
4
22
 
5
23
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _XUWGEELZcjs = require('./XUWGEELZ.cjs');
3
+ var _HRJZKMQQcjs = require('./HRJZKMQQ.cjs');
4
4
 
5
5
 
6
6
  var _O45IXGJWcjs = require('./O45IXGJW.cjs');
@@ -38,7 +38,8 @@ var _UVIQSLIVcjs = require('./UVIQSLIV.cjs');
38
38
  var _N2VCZZLPcjs = require('./N2VCZZLP.cjs');
39
39
 
40
40
 
41
- var _BICG74YFcjs = require('./BICG74YF.cjs');
41
+
42
+ var _JPNLVNZZcjs = require('./JPNLVNZZ.cjs');
42
43
 
43
44
 
44
45
  var _FXWXPSLIcjs = require('./FXWXPSLI.cjs');
@@ -152,11 +153,8 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
152
153
  const open = store.useState("open");
153
154
  const mounted = store.useState("mounted");
154
155
  const contentElement = store.useState("contentElement");
155
- const hiddenProp = props.hidden;
156
- _QRAQT522cjs.usePreventBodyScroll.call(void 0,
157
- store,
158
- (mounted || hiddenProp === false) && preventBodyScroll
159
- );
156
+ const hidden = _JPNLVNZZcjs.isHidden.call(void 0, mounted, props.hidden, props.alwaysVisible);
157
+ _QRAQT522cjs.usePreventBodyScroll.call(void 0, store, preventBodyScroll && !hidden);
160
158
  _E5VOJWDRcjs.useHideOnInteractOutside.call(void 0, store, hideOnInteractOutside);
161
159
  const { wrapElement, nestedDialogs } = _NZYGNCZLcjs.useNestedDialogs.call(void 0, store);
162
160
  props = _NREUHWTUcjs.useWrapElement.call(void 0, props, wrapElement, [wrapElement]);
@@ -285,7 +283,7 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
285
283
  if (!autoFocusOnShowProp(isElementFocusable ? element : null))
286
284
  return;
287
285
  setAutoFocusEnabled(true);
288
- element.focus();
286
+ queueMicrotask(() => element.focus());
289
287
  }, [
290
288
  open,
291
289
  mayAutoFocusOnShow,
@@ -346,7 +344,7 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
346
344
  return;
347
345
  if (!isElementFocusable)
348
346
  return;
349
- element == null ? void 0 : element.focus();
347
+ queueMicrotask(() => element == null ? void 0 : element.focus());
350
348
  };
351
349
  if (!open) {
352
350
  return focusOnHide();
@@ -396,18 +394,21 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
396
394
  (element) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SOPRUU56cjs.HeadingLevel, { level: modal ? 1 : void 0, children: element }),
397
395
  [modal]
398
396
  );
397
+ const hiddenProp = props.hidden;
398
+ const alwaysVisible = props.alwaysVisible;
399
399
  props = _NREUHWTUcjs.useWrapElement.call(void 0,
400
400
  props,
401
401
  (element) => {
402
402
  if (backdrop) {
403
403
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
404
404
  backdrop && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
405
- _XUWGEELZcjs.DialogBackdrop,
405
+ _HRJZKMQQcjs.DialogBackdrop,
406
406
  {
407
407
  store,
408
408
  backdrop,
409
409
  backdropProps,
410
- hidden: hiddenProp
410
+ hidden: hiddenProp,
411
+ alwaysVisible
411
412
  }
412
413
  ),
413
414
  element
@@ -415,7 +416,7 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
415
416
  }
416
417
  return element;
417
418
  },
418
- [store, backdrop, backdropProps, hiddenProp]
419
+ [store, backdrop, backdropProps, hiddenProp, alwaysVisible]
419
420
  );
420
421
  const [headingId, setHeadingId] = _react.useState.call(void 0, );
421
422
  const [descriptionId, setDescriptionId] = _react.useState.call(void 0, );
@@ -437,7 +438,7 @@ var useDialog = _5U7AP6Y2cjs.createHook.call(void 0,
437
438
  props = _4OQMTZXWcjs.useFocusableContainer.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props), {
438
439
  autoFocusOnShow: autoFocusEnabled
439
440
  }));
440
- props = _BICG74YFcjs.useDisclosureContent.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, { store }, props));
441
+ props = _JPNLVNZZcjs.useDisclosureContent.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, { store }, props));
441
442
  props = _FXWXPSLIcjs.useFocusable.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props), { focusable }));
442
443
  props = _UVIQSLIVcjs.usePortal.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, { portal }, props), { portalRef, preserveTabOrder }));
443
444
  return props;
@@ -9,6 +9,9 @@ var _RCGSDYWJcjs = require('./RCGSDYWJ.cjs');
9
9
  var _7OTXWQQXcjs = require('./7OTXWQQX.cjs');
10
10
 
11
11
 
12
+ var _JPNLVNZZcjs = require('./JPNLVNZZ.cjs');
13
+
14
+
12
15
 
13
16
 
14
17
  var _5U7AP6Y2cjs = require('./5U7AP6Y2.cjs');
@@ -36,13 +39,15 @@ var useSelectList = _5U7AP6Y2cjs.createHook.call(void 0,
36
39
  resetOnEscape = true,
37
40
  hideOnEnter = true,
38
41
  focusOnMove = true,
39
- composite = true
42
+ composite = true,
43
+ alwaysVisible
40
44
  } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, [
41
45
  "store",
42
46
  "resetOnEscape",
43
47
  "hideOnEnter",
44
48
  "focusOnMove",
45
- "composite"
49
+ "composite",
50
+ "alwaysVisible"
46
51
  ]);
47
52
  const ref = _react.useRef.call(void 0, null);
48
53
  const id = _NREUHWTUcjs.useId.call(void 0, props.id);
@@ -82,7 +87,8 @@ var useSelectList = _5U7AP6Y2cjs.createHook.call(void 0,
82
87
  var _a2;
83
88
  return (_a2 = state.labelElement) == null ? void 0 : _a2.id;
84
89
  });
85
- const style = mounted ? props.style : _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" });
90
+ const hidden = _JPNLVNZZcjs.isHidden.call(void 0, mounted, props.hidden, alwaysVisible);
91
+ const style = hidden ? _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" }) : props.style;
86
92
  if (composite) {
87
93
  props = _6455U47Tcjs.__spreadValues.call(void 0, {
88
94
  role: "listbox",
@@ -91,8 +97,8 @@ var useSelectList = _5U7AP6Y2cjs.createHook.call(void 0,
91
97
  }
92
98
  props = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
93
99
  id,
94
- hidden: !mounted,
95
- "aria-labelledby": labelId
100
+ "aria-labelledby": labelId,
101
+ hidden
96
102
  }, props), {
97
103
  ref: _NREUHWTUcjs.useForkRef.call(void 0, id ? store.setContentElement : null, ref, props.ref),
98
104
  style,
@@ -6,7 +6,7 @@ var _CARNFZQTcjs = require('./CARNFZQT.cjs');
6
6
  var _245ESIYYcjs = require('./245ESIYY.cjs');
7
7
 
8
8
 
9
- var _BICG74YFcjs = require('./BICG74YF.cjs');
9
+ var _JPNLVNZZcjs = require('./JPNLVNZZ.cjs');
10
10
 
11
11
 
12
12
 
@@ -24,6 +24,7 @@ function DialogBackdrop({
24
24
  store,
25
25
  backdrop,
26
26
  backdropProps,
27
+ alwaysVisible,
27
28
  hidden
28
29
  }) {
29
30
  const ref = _react.useRef.call(void 0, null);
@@ -57,12 +58,13 @@ function DialogBackdrop({
57
58
  backdropProps = _react.isValidElement.call(void 0, backdrop) ? _6455U47Tcjs.__spreadValues.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
58
59
  ref: "ref" in backdrop ? backdrop.ref : void 0
59
60
  }, backdrop.props), backdropProps) : backdropProps;
60
- const props = _BICG74YFcjs.useDisclosureContent.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
61
+ const props = _JPNLVNZZcjs.useDisclosureContent.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
61
62
  store,
62
63
  id: void 0,
63
64
  role: "presentation",
64
- hidden,
65
- "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || ""
65
+ "data-backdrop": (contentElement == null ? void 0 : contentElement.id) || "",
66
+ alwaysVisible,
67
+ hidden
66
68
  }, backdropProps), {
67
69
  ref: _NREUHWTUcjs.useForkRef.call(void 0, backdropProps == null ? void 0 : backdropProps.ref, ref),
68
70
  style: _6455U47Tcjs.__spreadValues.call(void 0, {
@@ -34,9 +34,12 @@ function parseCSSTime(...times) {
34
34
  return longestTime;
35
35
  }, 0);
36
36
  }
37
+ function isHidden(mounted, hidden, alwaysVisible) {
38
+ return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
39
+ }
37
40
  var useDisclosureContent = _5U7AP6Y2cjs.createHook.call(void 0,
38
41
  (_a) => {
39
- var _b = _a, { store } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store"]);
42
+ var _b = _a, { store, alwaysVisible } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store", "alwaysVisible"]);
40
43
  const id = _NREUHWTUcjs.useId.call(void 0, props.id);
41
44
  const [transition, setTransition] = _react.useState.call(void 0, null);
42
45
  const open = store.useState("open");
@@ -82,15 +85,13 @@ var useDisclosureContent = _5U7AP6Y2cjs.createHook.call(void 0,
82
85
  return;
83
86
  return afterTimeout(timeoutMs, store.stopAnimation);
84
87
  }, [animated, contentElement, open, transition]);
85
- const style = (
86
- // TODO: props.hidden !== true see combobox-textarea example
87
- mounted && props.hidden !== true || props.hidden === false ? props.style : _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" })
88
- );
88
+ const hidden = isHidden(mounted, props.hidden, alwaysVisible);
89
+ const style = hidden ? _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" }) : props.style;
89
90
  props = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
90
91
  id,
91
92
  "data-enter": transition === "enter" ? "" : void 0,
92
93
  "data-leave": transition === "leave" ? "" : void 0,
93
- hidden: !mounted
94
+ hidden
94
95
  }, props), {
95
96
  ref: _NREUHWTUcjs.useForkRef.call(void 0, id ? store.setContentElement : null, props.ref),
96
97
  style
@@ -111,4 +112,5 @@ if (process.env.NODE_ENV !== "production") {
111
112
 
112
113
 
113
114
 
114
- exports.useDisclosureContent = useDisclosureContent; exports.DisclosureContent = DisclosureContent;
115
+
116
+ exports.isHidden = isHidden; exports.useDisclosureContent = useDisclosureContent; exports.DisclosureContent = DisclosureContent;
@@ -56,13 +56,13 @@ var useHovercardAnchor = _5U7AP6Y2cjs.createHook.call(void 0,
56
56
  return;
57
57
  if (!showOnHoverProp(event))
58
58
  return;
59
- const { showTimeout } = store.getState();
59
+ const { showTimeout, timeout } = store.getState();
60
60
  showTimeoutRef.current = window.setTimeout(() => {
61
61
  showTimeoutRef.current = 0;
62
62
  if (!isMouseMoving())
63
63
  return;
64
64
  store.show();
65
- }, showTimeout);
65
+ }, showTimeout != null ? showTimeout : timeout);
66
66
  }
67
67
  );
68
68
  props = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props), {
@@ -10,6 +10,9 @@ var _NHKHREF4cjs = require('./NHKHREF4.cjs');
10
10
  var _7OTXWQQXcjs = require('./7OTXWQQX.cjs');
11
11
 
12
12
 
13
+ var _JPNLVNZZcjs = require('./JPNLVNZZ.cjs');
14
+
15
+
13
16
 
14
17
 
15
18
  var _5U7AP6Y2cjs = require('./5U7AP6Y2.cjs');
@@ -55,7 +58,7 @@ function useAriaLabelledBy(_a) {
55
58
  }
56
59
  var useMenuList = _5U7AP6Y2cjs.createHook.call(void 0,
57
60
  (_a) => {
58
- var _b = _a, { store, composite = true } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store", "composite"]);
61
+ var _b = _a, { store, alwaysVisible, composite = true } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store", "alwaysVisible", "composite"]);
59
62
  const parentMenu = _react.useContext.call(void 0, _MPFAD3UKcjs.MenuContext);
60
63
  const parentMenuBar = _react.useContext.call(void 0, _MPFAD3UKcjs.MenuBarContext);
61
64
  const hasParentMenu = !!parentMenu;
@@ -129,11 +132,12 @@ var useMenuList = _5U7AP6Y2cjs.createHook.call(void 0,
129
132
  );
130
133
  const ariaLabelledBy = useAriaLabelledBy(_6455U47Tcjs.__spreadValues.call(void 0, { store }, props));
131
134
  const mounted = store.useState("mounted");
132
- const style = mounted && props.hidden !== true || props.hidden === false ? props.style : _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" });
135
+ const hidden = _JPNLVNZZcjs.isHidden.call(void 0, mounted, props.hidden, alwaysVisible);
136
+ const style = hidden ? _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" }) : props.style;
133
137
  props = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
134
138
  id,
135
139
  "aria-labelledby": ariaLabelledBy,
136
- hidden: !mounted
140
+ hidden
137
141
  }, props), {
138
142
  ref: _NREUHWTUcjs.useForkRef.call(void 0, id ? store.setContentElement : null, props.ref),
139
143
  style,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _TUFFT567cjs = require('./TUFFT567.cjs');
3
+ var _3PYHURJVcjs = require('./3PYHURJV.cjs');
4
4
 
5
5
 
6
6
  var _W5PBA4D6cjs = require('./W5PBA4D6.cjs');
@@ -337,7 +337,7 @@ var usePopover = _5U7AP6Y2cjs.createHook.call(void 0,
337
337
  position: "relative"
338
338
  }, props.style)
339
339
  });
340
- props = _TUFFT567cjs.useDialog.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
340
+ props = _3PYHURJVcjs.useDialog.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
341
341
  store,
342
342
  modal,
343
343
  preserveTabOrder,
@@ -4,6 +4,7 @@
4
4
  var _W2XKIB23cjs = require('./W2XKIB23.cjs');
5
5
 
6
6
 
7
+
7
8
  var _F7HVNVHQcjs = require('./F7HVNVHQ.cjs');
8
9
 
9
10
 
@@ -15,7 +16,11 @@ function useHovercardStoreOptions(props) {
15
16
  return _W2XKIB23cjs.usePopoverStoreOptions.call(void 0, props);
16
17
  }
17
18
  function useHovercardStoreProps(store, props) {
18
- return _W2XKIB23cjs.usePopoverStoreProps.call(void 0, store, props);
19
+ store = _W2XKIB23cjs.usePopoverStoreProps.call(void 0, store, props);
20
+ _F7HVNVHQcjs.useStoreProps.call(void 0, store, props, "timeout");
21
+ _F7HVNVHQcjs.useStoreProps.call(void 0, store, props, "showTimeout");
22
+ _F7HVNVHQcjs.useStoreProps.call(void 0, store, props, "hideTimeout");
23
+ return store;
19
24
  }
20
25
  function useHovercardStore(props = {}) {
21
26
  const options = useHovercardStoreOptions(props);
@@ -3,6 +3,9 @@
3
3
  var _2WZVSPAIcjs = require('./2WZVSPAI.cjs');
4
4
 
5
5
 
6
+ var _JPNLVNZZcjs = require('./JPNLVNZZ.cjs');
7
+
8
+
6
9
 
7
10
 
8
11
  var _5U7AP6Y2cjs = require('./5U7AP6Y2.cjs');
@@ -23,7 +26,7 @@ var _react = require('react');
23
26
  var _jsxruntime = require('react/jsx-runtime');
24
27
  var useComboboxList = _5U7AP6Y2cjs.createHook.call(void 0,
25
28
  (_a) => {
26
- var _b = _a, { store } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store"]);
29
+ var _b = _a, { store, alwaysVisible } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store", "alwaysVisible"]);
27
30
  const ref = _react.useRef.call(void 0, null);
28
31
  const id = _NREUHWTUcjs.useId.call(void 0, props.id);
29
32
  const onKeyDownProp = props.onKeyDown;
@@ -41,11 +44,12 @@ var useComboboxList = _5U7AP6Y2cjs.createHook.call(void 0,
41
44
  [store]
42
45
  );
43
46
  const mounted = store.useState("mounted");
44
- const style = mounted ? props.style : _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" });
47
+ const hidden = _JPNLVNZZcjs.isHidden.call(void 0, mounted, props.hidden, alwaysVisible);
48
+ const style = hidden ? _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {}, props.style), { display: "none" }) : props.style;
45
49
  props = _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
46
50
  id,
47
51
  role: "listbox",
48
- hidden: !mounted
52
+ hidden
49
53
  }, props), {
50
54
  ref: _NREUHWTUcjs.useForkRef.call(void 0, id ? store.setContentElement : null, ref, props.ref),
51
55
  style,
@@ -5,7 +5,7 @@
5
5
  var _OLGMV24Ucjs = require('./OLGMV24U.cjs');
6
6
 
7
7
 
8
- var _VGBJOLSNcjs = require('./VGBJOLSN.cjs');
8
+ var _MXZHML62cjs = require('./MXZHML62.cjs');
9
9
 
10
10
 
11
11
 
@@ -147,7 +147,7 @@ var useHovercard = _5U7AP6Y2cjs.createHook.call(void 0,
147
147
  const isEscape = event.key === "Escape" && hideOnEscapeProp(event);
148
148
  const isControl = event.key === "Control" && hideOnControlProp(event);
149
149
  if (isEscape || isControl) {
150
- store.hide();
150
+ requestAnimationFrame(store.hide);
151
151
  }
152
152
  });
153
153
  }, [store, open, hideOnEscapeProp, hideOnControlProp]);
@@ -169,7 +169,7 @@ var useHovercard = _5U7AP6Y2cjs.createHook.call(void 0,
169
169
  if (!element)
170
170
  return;
171
171
  const onMouseMove = (event) => {
172
- const { anchorElement, hideTimeout } = store.getState();
172
+ const { anchorElement, hideTimeout, timeout } = store.getState();
173
173
  const enterPoint = enterPointRef.current;
174
174
  const target = event.target;
175
175
  const anchor = anchorElement;
@@ -198,7 +198,7 @@ var useHovercard = _5U7AP6Y2cjs.createHook.call(void 0,
198
198
  hideTimeoutRef.current = window.setTimeout(() => {
199
199
  hideTimeoutRef.current = 0;
200
200
  store.hide();
201
- }, hideTimeout);
201
+ }, hideTimeout != null ? hideTimeout : timeout);
202
202
  };
203
203
  return _misc.chain.call(void 0,
204
204
  _events.addGlobalEventListener.call(void 0, "mousemove", onMouseMove, true),
@@ -282,7 +282,7 @@ var useHovercard = _5U7AP6Y2cjs.createHook.call(void 0,
282
282
  });
283
283
  props = useAutoFocusOnHide(_6455U47Tcjs.__spreadValues.call(void 0, { store }, props));
284
284
  props = useAutoFocusOnShow(_6455U47Tcjs.__spreadValues.call(void 0, { store, modal }, props));
285
- props = _VGBJOLSNcjs.usePopover.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
285
+ props = _MXZHML62cjs.usePopover.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
286
286
  hideOnEscape,
287
287
  store,
288
288
  modal,
@@ -1,8 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _6TNK3LOZcjs = require('../__chunks/6TNK3LOZ.cjs');
4
+ var _SW4NPZERcjs = require('../__chunks/SW4NPZER.cjs');
5
5
  require('../__chunks/2WZVSPAI.cjs');
6
+ require('../__chunks/JPNLVNZZ.cjs');
6
7
  require('../__chunks/5U7AP6Y2.cjs');
7
8
  require('../__chunks/NREUHWTU.cjs');
8
9
  require('../__chunks/2X5K3J7Y.cjs');
@@ -10,4 +11,4 @@ require('../__chunks/6455U47T.cjs');
10
11
 
11
12
 
12
13
 
13
- exports.ComboboxList = _6TNK3LOZcjs.ComboboxList; exports.useComboboxList = _6TNK3LOZcjs.useComboboxList;
14
+ exports.ComboboxList = _SW4NPZERcjs.ComboboxList; exports.useComboboxList = _SW4NPZERcjs.useComboboxList;
@@ -1,3 +1,4 @@
1
+ import type { DisclosureContentOptions } from "../disclosure/disclosure-content.js";
1
2
  import type { As, Options, Props } from "../utils/types.js";
2
3
  import type { ComboboxStore } from "./combobox-store.js";
3
4
  /**
@@ -33,7 +34,7 @@ export declare const useComboboxList: import("../utils/types.js").Hook<ComboboxL
33
34
  * ```
34
35
  */
35
36
  export declare const ComboboxList: import("../utils/types.js").Component<ComboboxListOptions<"div">>;
36
- export interface ComboboxListOptions<T extends As = "div"> extends Options<T> {
37
+ export interface ComboboxListOptions<T extends As = "div"> extends Options<T>, Pick<DisclosureContentOptions, "alwaysVisible"> {
37
38
  /**
38
39
  * Object returned by the `useComboboxStore` hook.
39
40
  */
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _6TNK3LOZcjs = require('../__chunks/6TNK3LOZ.cjs');
3
+ var _SW4NPZERcjs = require('../__chunks/SW4NPZER.cjs');
4
4
  require('../__chunks/2WZVSPAI.cjs');
5
5
 
6
6
 
7
- var _VGBJOLSNcjs = require('../__chunks/VGBJOLSN.cjs');
8
- require('../__chunks/TUFFT567.cjs');
9
- require('../__chunks/XUWGEELZ.cjs');
7
+ var _MXZHML62cjs = require('../__chunks/MXZHML62.cjs');
8
+ require('../__chunks/3PYHURJV.cjs');
9
+ require('../__chunks/HRJZKMQQ.cjs');
10
10
  require('../__chunks/O45IXGJW.cjs');
11
11
  require('../__chunks/TVZPJJTX.cjs');
12
12
  require('../__chunks/QRAQT522.cjs');
@@ -26,7 +26,7 @@ require('../__chunks/NS56XHXG.cjs');
26
26
  require('../__chunks/CQSUIL2D.cjs');
27
27
  require('../__chunks/N2VCZZLP.cjs');
28
28
  require('../__chunks/245ESIYY.cjs');
29
- require('../__chunks/BICG74YF.cjs');
29
+ require('../__chunks/JPNLVNZZ.cjs');
30
30
  require('../__chunks/W5PBA4D6.cjs');
31
31
  require('../__chunks/FXWXPSLI.cjs');
32
32
  require('../__chunks/LHHW5ZQP.cjs');
@@ -59,11 +59,22 @@ function isController(target, ...ids) {
59
59
  }
60
60
  var useComboboxPopover = _5U7AP6Y2cjs.createHook.call(void 0,
61
61
  (_a) => {
62
- var _b = _a, { store, tabIndex, hideOnInteractOutside = true } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, ["store", "tabIndex", "hideOnInteractOutside"]);
62
+ var _b = _a, {
63
+ store,
64
+ tabIndex,
65
+ alwaysVisible,
66
+ hideOnInteractOutside = true
67
+ } = _b, props = _6455U47Tcjs.__objRest.call(void 0, _b, [
68
+ "store",
69
+ "tabIndex",
70
+ "alwaysVisible",
71
+ "hideOnInteractOutside"
72
+ ]);
63
73
  const baseElement = store.useState("baseElement");
64
- props = _6TNK3LOZcjs.useComboboxList.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, { store }, props));
65
- props = _VGBJOLSNcjs.usePopover.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
74
+ props = _SW4NPZERcjs.useComboboxList.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
75
+ props = _MXZHML62cjs.usePopover.call(void 0, _6455U47Tcjs.__spreadProps.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
66
76
  store,
77
+ alwaysVisible,
67
78
  autoFocusOnShow: false,
68
79
  autoFocusOnHide: false,
69
80
  finalFocus: baseElement
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _VGBJOLSNcjs = require('../__chunks/VGBJOLSN.cjs');
4
- require('../__chunks/TUFFT567.cjs');
5
- require('../__chunks/XUWGEELZ.cjs');
3
+ var _MXZHML62cjs = require('../__chunks/MXZHML62.cjs');
4
+ require('../__chunks/3PYHURJV.cjs');
5
+ require('../__chunks/HRJZKMQQ.cjs');
6
6
  require('../__chunks/O45IXGJW.cjs');
7
7
  require('../__chunks/TVZPJJTX.cjs');
8
8
  require('../__chunks/QRAQT522.cjs');
@@ -22,7 +22,7 @@ require('../__chunks/NS56XHXG.cjs');
22
22
  require('../__chunks/CQSUIL2D.cjs');
23
23
  require('../__chunks/N2VCZZLP.cjs');
24
24
  require('../__chunks/245ESIYY.cjs');
25
- require('../__chunks/BICG74YF.cjs');
25
+ require('../__chunks/JPNLVNZZ.cjs');
26
26
  require('../__chunks/W5PBA4D6.cjs');
27
27
  require('../__chunks/FXWXPSLI.cjs');
28
28
  require('../__chunks/LHHW5ZQP.cjs');
@@ -84,7 +84,7 @@ var useCompositeOverflow = _5U7AP6Y2cjs.createHook.call(void 0,
84
84
  }, props), {
85
85
  onFocus
86
86
  });
87
- props = _VGBJOLSNcjs.usePopover.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
87
+ props = _MXZHML62cjs.usePopover.call(void 0, _6455U47Tcjs.__spreadValues.call(void 0, {
88
88
  store,
89
89
  backdropProps,
90
90
  wrapperProps,
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _XUWGEELZcjs = require('../__chunks/XUWGEELZ.cjs');
3
+ var _HRJZKMQQcjs = require('../__chunks/HRJZKMQQ.cjs');
4
4
  require('../__chunks/CARNFZQT.cjs');
5
5
  require('../__chunks/NR3SJH64.cjs');
6
6
  require('../__chunks/EE6OIU6X.cjs');
7
7
  require('../__chunks/245ESIYY.cjs');
8
- require('../__chunks/BICG74YF.cjs');
8
+ require('../__chunks/JPNLVNZZ.cjs');
9
9
  require('../__chunks/5U7AP6Y2.cjs');
10
10
  require('../__chunks/NREUHWTU.cjs');
11
11
  require('../__chunks/2X5K3J7Y.cjs');
12
12
  require('../__chunks/6455U47T.cjs');
13
13
 
14
14
 
15
- exports.DialogBackdrop = _XUWGEELZcjs.DialogBackdrop;
15
+ exports.DialogBackdrop = _HRJZKMQQcjs.DialogBackdrop;
@@ -1,4 +1,4 @@
1
1
  import type { DialogProps } from "./dialog.js";
2
- type DialogBackdropProps = Pick<DialogProps, "store" | "backdrop" | "backdropProps" | "hidden">;
3
- export declare function DialogBackdrop({ store, backdrop, backdropProps, hidden, }: DialogBackdropProps): import("react/jsx-runtime").JSX.Element | null;
2
+ type DialogBackdropProps = Pick<DialogProps, "store" | "backdrop" | "backdropProps" | "alwaysVisible" | "hidden">;
3
+ export declare function DialogBackdrop({ store, backdrop, backdropProps, alwaysVisible, hidden, }: DialogBackdropProps): import("react/jsx-runtime").JSX.Element | null;
4
4
  export {};
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _TUFFT567cjs = require('../__chunks/TUFFT567.cjs');
5
- require('../__chunks/XUWGEELZ.cjs');
4
+ var _3PYHURJVcjs = require('../__chunks/3PYHURJV.cjs');
5
+ require('../__chunks/HRJZKMQQ.cjs');
6
6
  require('../__chunks/O45IXGJW.cjs');
7
7
  require('../__chunks/TVZPJJTX.cjs');
8
8
  require('../__chunks/QRAQT522.cjs');
@@ -22,7 +22,7 @@ require('../__chunks/NS56XHXG.cjs');
22
22
  require('../__chunks/CQSUIL2D.cjs');
23
23
  require('../__chunks/N2VCZZLP.cjs');
24
24
  require('../__chunks/245ESIYY.cjs');
25
- require('../__chunks/BICG74YF.cjs');
25
+ require('../__chunks/JPNLVNZZ.cjs');
26
26
  require('../__chunks/FXWXPSLI.cjs');
27
27
  require('../__chunks/LHHW5ZQP.cjs');
28
28
  require('../__chunks/VYKCWICK.cjs');
@@ -33,4 +33,4 @@ require('../__chunks/6455U47T.cjs');
33
33
 
34
34
 
35
35
 
36
- exports.Dialog = _TUFFT567cjs.Dialog; exports.useDialog = _TUFFT567cjs.useDialog;
36
+ exports.Dialog = _3PYHURJVcjs.Dialog; exports.useDialog = _3PYHURJVcjs.useDialog;
@@ -1,7 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _BICG74YFcjs = require('../__chunks/BICG74YF.cjs');
4
+
5
+ var _JPNLVNZZcjs = require('../__chunks/JPNLVNZZ.cjs');
5
6
  require('../__chunks/5U7AP6Y2.cjs');
6
7
  require('../__chunks/NREUHWTU.cjs');
7
8
  require('../__chunks/2X5K3J7Y.cjs');
@@ -9,4 +10,5 @@ require('../__chunks/6455U47T.cjs');
9
10
 
10
11
 
11
12
 
12
- exports.DisclosureContent = _BICG74YFcjs.DisclosureContent; exports.useDisclosureContent = _BICG74YFcjs.useDisclosureContent;
13
+
14
+ exports.DisclosureContent = _JPNLVNZZcjs.DisclosureContent; exports.isHidden = _JPNLVNZZcjs.isHidden; exports.useDisclosureContent = _JPNLVNZZcjs.useDisclosureContent;
@@ -1,5 +1,6 @@
1
1
  import type { As, Options, Props } from "../utils/types.js";
2
2
  import type { DisclosureStore } from "./disclosure-store.js";
3
+ export declare function isHidden(mounted: boolean, hidden?: boolean | null, alwaysVisible?: boolean | null): boolean;
3
4
  /**
4
5
  * Returns props to create a `DislosureContent` component.
5
6
  * @see https://ariakit.org/components/disclosure
@@ -28,5 +29,27 @@ export interface DisclosureContentOptions<T extends As = "div"> extends Options<
28
29
  * Object returned by the `useDisclosureStore` hook.
29
30
  */
30
31
  store: DisclosureStore;
32
+ /**
33
+ * Determines whether the content element should remain visible even when the
34
+ * `open` state is `false`. If this prop is set to `true`, the `hidden` prop
35
+ * and the `display: none` style will not be applied, unless explicitly set
36
+ * otherwise.
37
+ *
38
+ * This prop is particularly useful when using third-party animation libraries
39
+ * such as Framer Motion or React Spring, where the element needs to be
40
+ * visible for exit animations to work.
41
+ *
42
+ * Live examples:
43
+ * - [Dialog with Framer
44
+ * Motion](https://ariakit.org/examples/dialog-framer-motion)
45
+ * - [Menu with Framer
46
+ * Motion](https://ariakit.org/examples/menu-framer-motion)
47
+ * - [Tooltip with Framer
48
+ * Motion](https://ariakit.org/examples/tooltip-framer-motion)
49
+ * - [Dialog with details &
50
+ * summary](https://ariakit.org/examples/dialog-details)
51
+ * @default false
52
+ */
53
+ alwaysVisible?: boolean;
31
54
  }
32
55
  export type DisclosureContentProps<T extends As = "div"> = Props<DisclosureContentOptions<T>>;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _GF4T7RQScjs = require('../__chunks/GF4T7RQS.cjs');
4
+ var _KEDMIM4Scjs = require('../__chunks/KEDMIM4S.cjs');
5
5
  require('../__chunks/FXWXPSLI.cjs');
6
6
  require('../__chunks/LHHW5ZQP.cjs');
7
7
  require('../__chunks/5U7AP6Y2.cjs');
@@ -11,4 +11,4 @@ require('../__chunks/6455U47T.cjs');
11
11
 
12
12
 
13
13
 
14
- exports.HovercardAnchor = _GF4T7RQScjs.HovercardAnchor; exports.useHovercardAnchor = _GF4T7RQScjs.useHovercardAnchor;
14
+ exports.HovercardAnchor = _KEDMIM4Scjs.HovercardAnchor; exports.useHovercardAnchor = _KEDMIM4Scjs.useHovercardAnchor;