@ariakit/react-core 0.4.3 → 0.4.4

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 (121) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/cjs/__chunks/{GYHP7IYG.cjs → 4XVTH6OR.cjs} +2 -2
  3. package/cjs/__chunks/{IHFGURUM.cjs → 54YZYOPA.cjs} +2 -2
  4. package/cjs/__chunks/{DCTXNU2X.cjs → COWKMNMZ.cjs} +3 -3
  5. package/cjs/__chunks/{HFNM6QV4.cjs → DAOFDKV2.cjs} +1 -1
  6. package/cjs/__chunks/{3C4RFBCG.cjs → EYZZO5IT.cjs} +1 -1
  7. package/cjs/__chunks/{3MKOUH5M.cjs → HPNCFYQJ.cjs} +4 -4
  8. package/cjs/__chunks/{A356CGND.cjs → JDCTLYQ4.cjs} +1 -1
  9. package/cjs/__chunks/{T5BWR4CB.cjs → KDTFHBKU.cjs} +2 -2
  10. package/cjs/__chunks/{NZSB7HSZ.cjs → LY4LCJM6.cjs} +2 -2
  11. package/cjs/__chunks/{7DQ2LBH2.cjs → QUHFOHHT.cjs} +35 -0
  12. package/cjs/__chunks/{AJF5DT5A.cjs → YO7LLGVA.cjs} +2 -2
  13. package/cjs/__chunks/{3XXW4Y4D.cjs → Z2VL7JHX.cjs} +2 -2
  14. package/cjs/__chunks/{CWS5RZSU.cjs → ZTAE5B6W.cjs} +9 -1
  15. package/cjs/checkbox/checkbox-check.cjs +2 -2
  16. package/cjs/collection/collection-renderer.d.cts +0 -2
  17. package/cjs/collection/collection-renderer.d.ts +0 -2
  18. package/cjs/combobox/combobox-cancel.cjs +1 -1
  19. package/cjs/combobox/combobox-disclosure.cjs +1 -1
  20. package/cjs/combobox/combobox-item-check.cjs +2 -2
  21. package/cjs/combobox/combobox-item.cjs +2 -2
  22. package/cjs/combobox/combobox-popover.cjs +23 -5
  23. package/cjs/combobox/combobox.cjs +14 -11
  24. package/cjs/combobox/combobox.d.cts +20 -0
  25. package/cjs/combobox/combobox.d.ts +20 -0
  26. package/cjs/composite/composite-input.cjs +91 -6
  27. package/cjs/composite/composite-input.d.cts +2 -0
  28. package/cjs/composite/composite-input.d.ts +2 -0
  29. package/cjs/composite/composite-item.cjs +2 -2
  30. package/cjs/composite/composite-overflow-disclosure.cjs +2 -2
  31. package/cjs/composite/composite-overflow.cjs +3 -3
  32. package/cjs/composite/composite-renderer.d.cts +0 -2
  33. package/cjs/composite/composite-renderer.d.ts +0 -2
  34. package/cjs/dialog/dialog-dismiss.cjs +2 -2
  35. package/cjs/dialog/dialog.cjs +2 -2
  36. package/cjs/form/form-radio.cjs +3 -3
  37. package/cjs/hovercard/hovercard-disclosure.cjs +1 -1
  38. package/cjs/hovercard/hovercard-dismiss.cjs +4 -4
  39. package/cjs/hovercard/hovercard.cjs +4 -4
  40. package/cjs/menu/menu-button-arrow.cjs +2 -2
  41. package/cjs/menu/menu-dismiss.cjs +4 -4
  42. package/cjs/menu/menu-item-check.cjs +2 -2
  43. package/cjs/menu/menu-item-checkbox.cjs +3 -3
  44. package/cjs/menu/menu-item-radio.cjs +5 -5
  45. package/cjs/menu/menu-item.cjs +3 -3
  46. package/cjs/menu/menu.cjs +5 -5
  47. package/cjs/popover/popover-disclosure-arrow.cjs +2 -2
  48. package/cjs/popover/popover-dismiss.cjs +3 -3
  49. package/cjs/popover/popover.cjs +3 -3
  50. package/cjs/radio/radio.cjs +3 -3
  51. package/cjs/select/select-arrow.cjs +3 -3
  52. package/cjs/select/select-item-check.cjs +2 -2
  53. package/cjs/select/select-item.cjs +2 -2
  54. package/cjs/select/select-popover.cjs +4 -4
  55. package/cjs/select/select.cjs +3 -3
  56. package/cjs/tab/tab.cjs +4 -4
  57. package/cjs/toolbar/toolbar-container.cjs +3 -3
  58. package/cjs/toolbar/toolbar-input.cjs +3 -7
  59. package/cjs/toolbar/toolbar-input.d.cts +3 -2
  60. package/cjs/toolbar/toolbar-input.d.ts +3 -2
  61. package/cjs/toolbar/toolbar-item.cjs +3 -3
  62. package/cjs/tooltip/tooltip.cjs +5 -5
  63. package/esm/__chunks/{LABIXQLW.js → 44PDY2W5.js} +1 -1
  64. package/esm/__chunks/{FYNSL2D5.js → 5H3YXAUC.js} +1 -1
  65. package/esm/__chunks/{JCOBPKEI.js → BY6P32UK.js} +1 -1
  66. package/esm/__chunks/{C5HA76JU.js → DSUHLHLE.js} +1 -1
  67. package/esm/__chunks/{NN4HLGKS.js → F2RFUFO2.js} +1 -1
  68. package/esm/__chunks/{2VWKZYYT.js → H5N72W37.js} +1 -1
  69. package/esm/__chunks/{NQ4PTILT.js → IOUGWXY5.js} +9 -1
  70. package/esm/__chunks/{X3V2DT2U.js → LTYEFENI.js} +1 -1
  71. package/esm/__chunks/{HW63KLP5.js → NFPDVAAW.js} +1 -1
  72. package/esm/__chunks/{XK6CE2M5.js → NHVUMSP7.js} +1 -1
  73. package/esm/__chunks/{RAKW656I.js → Q4PZFBSW.js} +1 -1
  74. package/esm/__chunks/{ONUY4D7O.js → R33ISPJY.js} +36 -1
  75. package/esm/__chunks/{6VDNHSLX.js → XEJ23EM6.js} +2 -2
  76. package/esm/checkbox/checkbox-check.js +1 -1
  77. package/esm/collection/collection-renderer.d.ts +0 -2
  78. package/esm/combobox/combobox-cancel.js +1 -1
  79. package/esm/combobox/combobox-disclosure.js +1 -1
  80. package/esm/combobox/combobox-item-check.js +1 -1
  81. package/esm/combobox/combobox-item.js +1 -1
  82. package/esm/combobox/combobox-popover.js +22 -4
  83. package/esm/combobox/combobox.d.ts +20 -0
  84. package/esm/combobox/combobox.js +14 -11
  85. package/esm/composite/composite-input.d.ts +2 -0
  86. package/esm/composite/composite-input.js +92 -7
  87. package/esm/composite/composite-item.js +1 -1
  88. package/esm/composite/composite-overflow-disclosure.js +1 -1
  89. package/esm/composite/composite-overflow.js +2 -2
  90. package/esm/composite/composite-renderer.d.ts +0 -2
  91. package/esm/dialog/dialog-dismiss.js +1 -1
  92. package/esm/dialog/dialog.js +1 -1
  93. package/esm/form/form-radio.js +2 -2
  94. package/esm/hovercard/hovercard-disclosure.js +1 -1
  95. package/esm/hovercard/hovercard-dismiss.js +3 -3
  96. package/esm/hovercard/hovercard.js +3 -3
  97. package/esm/menu/menu-button-arrow.js +1 -1
  98. package/esm/menu/menu-dismiss.js +3 -3
  99. package/esm/menu/menu-item-check.js +1 -1
  100. package/esm/menu/menu-item-checkbox.js +2 -2
  101. package/esm/menu/menu-item-radio.js +3 -3
  102. package/esm/menu/menu-item.js +2 -2
  103. package/esm/menu/menu.js +3 -3
  104. package/esm/popover/popover-disclosure-arrow.js +1 -1
  105. package/esm/popover/popover-dismiss.js +2 -2
  106. package/esm/popover/popover.js +2 -2
  107. package/esm/radio/radio.js +2 -2
  108. package/esm/select/select-arrow.js +2 -2
  109. package/esm/select/select-item-check.js +1 -1
  110. package/esm/select/select-item.js +1 -1
  111. package/esm/select/select-popover.js +2 -2
  112. package/esm/select/select.js +2 -2
  113. package/esm/tab/tab.js +1 -1
  114. package/esm/toolbar/toolbar-container.js +2 -2
  115. package/esm/toolbar/toolbar-input.d.ts +3 -2
  116. package/esm/toolbar/toolbar-input.js +2 -6
  117. package/esm/toolbar/toolbar-item.js +2 -2
  118. package/esm/tooltip/tooltip.js +3 -3
  119. package/package.json +2 -2
  120. package/cjs/__chunks/WGZQRLXV.cjs +0 -84
  121. package/esm/__chunks/RPGNBKKU.js +0 -84
@@ -4,7 +4,7 @@
4
4
  var _Q6QJEXBKcjs = require('../__chunks/Q6QJEXBK.cjs');
5
5
 
6
6
 
7
- var _7DQ2LBH2cjs = require('../__chunks/7DQ2LBH2.cjs');
7
+ var _QUHFOHHTcjs = require('../__chunks/QUHFOHHT.cjs');
8
8
  require('../__chunks/U4NXCMZ3.cjs');
9
9
 
10
10
 
@@ -154,7 +154,7 @@ var useSelectItem = _NGD3IQDBcjs.createHook.call(void 0,
154
154
  autoFocus: (_a2 = props.autoFocus) != null ? _a2 : autoFocus,
155
155
  onClick
156
156
  });
157
- props = _7DQ2LBH2cjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
157
+ props = _QUHFOHHTcjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
158
158
  store,
159
159
  getItem,
160
160
  preventScrollOnKeyDown
@@ -12,10 +12,10 @@ require('../__chunks/VPI3EKVY.cjs');
12
12
  require('../__chunks/NEK2UEJN.cjs');
13
13
 
14
14
 
15
- var _DCTXNU2Xcjs = require('../__chunks/DCTXNU2X.cjs');
15
+ var _COWKMNMZcjs = require('../__chunks/COWKMNMZ.cjs');
16
16
 
17
17
 
18
- var _CWS5RZSUcjs = require('../__chunks/CWS5RZSU.cjs');
18
+ var _ZTAE5B6Wcjs = require('../__chunks/ZTAE5B6W.cjs');
19
19
  require('../__chunks/TSEXNK3K.cjs');
20
20
  require('../__chunks/JF225FQ5.cjs');
21
21
  require('../__chunks/37BRXQN7.cjs');
@@ -67,11 +67,11 @@ var useSelectPopover = _NGD3IQDBcjs.createHook.call(void 0,
67
67
  const context = _HZDOLHROcjs.useSelectProviderContext.call(void 0, );
68
68
  store = store || context;
69
69
  props = _KQJLN5EGcjs.useSelectList.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
70
- props = _DCTXNU2Xcjs.usePopover.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
70
+ props = _COWKMNMZcjs.usePopover.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
71
71
  return props;
72
72
  }
73
73
  );
74
- var SelectPopover = _CWS5RZSUcjs.createDialogComponent.call(void 0,
74
+ var SelectPopover = _ZTAE5B6Wcjs.createDialogComponent.call(void 0,
75
75
  _NGD3IQDBcjs.forwardRef.call(void 0, function SelectPopover2(props) {
76
76
  const htmlProps = useSelectPopover(props);
77
77
  return _NGD3IQDBcjs.createElement.call(void 0, TagName, htmlProps);
@@ -8,8 +8,8 @@ require('../__chunks/YH42XRHR.cjs');
8
8
  require('../__chunks/IXJIFLOA.cjs');
9
9
 
10
10
 
11
- var _NZSB7HSZcjs = require('../__chunks/NZSB7HSZ.cjs');
12
- require('../__chunks/3C4RFBCG.cjs');
11
+ var _LY4LCJM6cjs = require('../__chunks/LY4LCJM6.cjs');
12
+ require('../__chunks/EYZZO5IT.cjs');
13
13
 
14
14
 
15
15
  var _4LPJTV22cjs = require('../__chunks/4LPJTV22.cjs');
@@ -267,7 +267,7 @@ var useSelect = _NGD3IQDBcjs.createHook.call(void 0, function useSelect2(_a) {
267
267
  );
268
268
  const children = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
269
269
  value,
270
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _NZSB7HSZcjs.SelectArrow, {})
270
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _LY4LCJM6cjs.SelectArrow, {})
271
271
  ] });
272
272
  const contentElement = store.useState("contentElement");
273
273
  props = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
package/cjs/tab/tab.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _7DQ2LBH2cjs = require('../__chunks/7DQ2LBH2.cjs');
5
+ var _QUHFOHHTcjs = require('../__chunks/QUHFOHHT.cjs');
6
6
  require('../__chunks/U4NXCMZ3.cjs');
7
7
  require('../__chunks/HD5AHCRI.cjs');
8
8
 
@@ -93,9 +93,9 @@ var useTab = _NGD3IQDBcjs.createHook.call(void 0, function useTab2(_a) {
93
93
  render: element
94
94
  };
95
95
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
96
- _7DQ2LBH2cjs.CompositeItem,
96
+ _QUHFOHHTcjs.CompositeItem,
97
97
  _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, defaultProps), {
98
- render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _7DQ2LBH2cjs.CompositeItem, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, defaultProps), { store: store.combobox })) : element
98
+ render: store.combobox && store.composite !== store.combobox ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _QUHFOHHTcjs.CompositeItem, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, defaultProps), { store: store.combobox })) : element
99
99
  })
100
100
  );
101
101
  },
@@ -109,7 +109,7 @@ var useTab = _NGD3IQDBcjs.createHook.call(void 0, function useTab2(_a) {
109
109
  }, props), {
110
110
  onClick
111
111
  });
112
- props = _7DQ2LBH2cjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
112
+ props = _QUHFOHHTcjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
113
113
  store
114
114
  }, props), {
115
115
  accessibleWhenDisabled,
@@ -4,8 +4,8 @@
4
4
  var _MJP4XPFZcjs = require('../__chunks/MJP4XPFZ.cjs');
5
5
 
6
6
 
7
- var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
8
- require('../__chunks/7DQ2LBH2.cjs');
7
+ var _YO7LLGVAcjs = require('../__chunks/YO7LLGVA.cjs');
8
+ require('../__chunks/QUHFOHHT.cjs');
9
9
  require('../__chunks/U4NXCMZ3.cjs');
10
10
  require('../__chunks/HD5AHCRI.cjs');
11
11
  require('../__chunks/6ZZYUFPW.cjs');
@@ -38,7 +38,7 @@ var useToolbarContainer = _NGD3IQDBcjs.createHook.call(void 0,
38
38
  const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
39
39
  store = store || context;
40
40
  props = _MJP4XPFZcjs.useCompositeContainer.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
41
- props = _AJF5DT5Acjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
41
+ props = _YO7LLGVAcjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
42
42
  return props;
43
43
  }
44
44
  );
@@ -1,11 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _WGZQRLXVcjs = require('../__chunks/WGZQRLXV.cjs');
5
-
6
-
7
- var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
8
- require('../__chunks/7DQ2LBH2.cjs');
4
+ var _YO7LLGVAcjs = require('../__chunks/YO7LLGVA.cjs');
5
+ require('../__chunks/QUHFOHHT.cjs');
9
6
  require('../__chunks/U4NXCMZ3.cjs');
10
7
  require('../__chunks/HD5AHCRI.cjs');
11
8
  require('../__chunks/6ZZYUFPW.cjs');
@@ -37,8 +34,7 @@ var useToolbarInput = _NGD3IQDBcjs.createHook.call(void 0,
37
34
  var _b = _a, { store } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, ["store"]);
38
35
  const context = _MVDQWSSVcjs.useToolbarContext.call(void 0, );
39
36
  store = store || context;
40
- props = _WGZQRLXVcjs.useCompositeInput.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
41
- props = _AJF5DT5Acjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
37
+ props = _YO7LLGVAcjs.useToolbarItem.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store }, props));
42
38
  return props;
43
39
  }
44
40
  );
@@ -1,5 +1,4 @@
1
1
  import type { ElementType } from "react";
2
- import type { CompositeInputOptions } from "../composite/composite-input.js";
3
2
  import type { Props } from "../utils/types.js";
4
3
  import type { ToolbarItemOptions } from "./toolbar-item.js";
5
4
  declare const TagName = "input";
@@ -7,6 +6,7 @@ type TagName = typeof TagName;
7
6
  /**
8
7
  * Returns props to create a `ToolbarInput` component.
9
8
  * @see https://ariakit.org/components/toolbar
9
+ * @deprecated Use `useToolbarItem` instead.
10
10
  * @example
11
11
  * ```jsx
12
12
  * const store = useToolbarStore();
@@ -21,6 +21,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
21
21
  * Renders a text input as a toolbar item, maintaining arrow key navigation on
22
22
  * the toolbar.
23
23
  * @see https://ariakit.org/components/toolbar
24
+ * @deprecated Use `<ToolbarItem render={<input />}>` instead.
24
25
  * @example
25
26
  * ```jsx {2}
26
27
  * <Toolbar>
@@ -29,7 +30,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
29
30
  * ```
30
31
  */
31
32
  export declare const ToolbarInput: (props: ToolbarInputProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
32
- export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T>, Omit<CompositeInputOptions<T>, "store"> {
33
+ export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T> {
33
34
  }
34
35
  export type ToolbarInputProps<T extends ElementType = TagName> = Props<T, ToolbarInputOptions<T>>;
35
36
  export {};
@@ -1,5 +1,4 @@
1
1
  import type { ElementType } from "react";
2
- import type { CompositeInputOptions } from "../composite/composite-input.js";
3
2
  import type { Props } from "../utils/types.js";
4
3
  import type { ToolbarItemOptions } from "./toolbar-item.js";
5
4
  declare const TagName = "input";
@@ -7,6 +6,7 @@ type TagName = typeof TagName;
7
6
  /**
8
7
  * Returns props to create a `ToolbarInput` component.
9
8
  * @see https://ariakit.org/components/toolbar
9
+ * @deprecated Use `useToolbarItem` instead.
10
10
  * @example
11
11
  * ```jsx
12
12
  * const store = useToolbarStore();
@@ -21,6 +21,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
21
21
  * Renders a text input as a toolbar item, maintaining arrow key navigation on
22
22
  * the toolbar.
23
23
  * @see https://ariakit.org/components/toolbar
24
+ * @deprecated Use `<ToolbarItem render={<input />}>` instead.
24
25
  * @example
25
26
  * ```jsx {2}
26
27
  * <Toolbar>
@@ -29,7 +30,7 @@ export declare const useToolbarInput: import("../utils/types.js").Hook<"input",
29
30
  * ```
30
31
  */
31
32
  export declare const ToolbarInput: (props: ToolbarInputProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
32
- export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T>, Omit<CompositeInputOptions<T>, "store"> {
33
+ export interface ToolbarInputOptions<T extends ElementType = TagName> extends ToolbarItemOptions<T> {
33
34
  }
34
35
  export type ToolbarInputProps<T extends ElementType = TagName> = Props<T, ToolbarInputOptions<T>>;
35
36
  export {};
@@ -2,8 +2,8 @@
2
2
 
3
3
 
4
4
 
5
- var _AJF5DT5Acjs = require('../__chunks/AJF5DT5A.cjs');
6
- require('../__chunks/7DQ2LBH2.cjs');
5
+ var _YO7LLGVAcjs = require('../__chunks/YO7LLGVA.cjs');
6
+ require('../__chunks/QUHFOHHT.cjs');
7
7
  require('../__chunks/U4NXCMZ3.cjs');
8
8
  require('../__chunks/HD5AHCRI.cjs');
9
9
  require('../__chunks/6ZZYUFPW.cjs');
@@ -20,4 +20,4 @@ require('../__chunks/AV6KTKLE.cjs');
20
20
 
21
21
 
22
22
 
23
- exports.ToolbarItem = _AJF5DT5Acjs.ToolbarItem; exports.useToolbarItem = _AJF5DT5Acjs.useToolbarItem;
23
+ exports.ToolbarItem = _YO7LLGVAcjs.ToolbarItem; exports.useToolbarItem = _YO7LLGVAcjs.useToolbarItem;
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _3MKOUH5Mcjs = require('../__chunks/3MKOUH5M.cjs');
4
+ var _HPNCFYQJcjs = require('../__chunks/HPNCFYQJ.cjs');
5
5
  require('../__chunks/KXQOQQ5B.cjs');
6
- require('../__chunks/DCTXNU2X.cjs');
6
+ require('../__chunks/COWKMNMZ.cjs');
7
7
 
8
8
 
9
- var _CWS5RZSUcjs = require('../__chunks/CWS5RZSU.cjs');
9
+ var _ZTAE5B6Wcjs = require('../__chunks/ZTAE5B6W.cjs');
10
10
  require('../__chunks/TSEXNK3K.cjs');
11
11
  require('../__chunks/JF225FQ5.cjs');
12
12
  require('../__chunks/37BRXQN7.cjs');
@@ -95,7 +95,7 @@ var useTooltip = _NGD3IQDBcjs.createHook.call(void 0,
95
95
  (state) => state.type === "description" ? "tooltip" : "none"
96
96
  );
97
97
  props = _AV6KTKLEcjs.__spreadValues.call(void 0, { role }, props);
98
- props = _3MKOUH5Mcjs.useHovercard.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
98
+ props = _HPNCFYQJcjs.useHovercard.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
99
99
  store,
100
100
  portal,
101
101
  gutter,
@@ -124,7 +124,7 @@ var useTooltip = _NGD3IQDBcjs.createHook.call(void 0,
124
124
  return props;
125
125
  }
126
126
  );
127
- var Tooltip = _CWS5RZSUcjs.createDialogComponent.call(void 0,
127
+ var Tooltip = _ZTAE5B6Wcjs.createDialogComponent.call(void 0,
128
128
  _NGD3IQDBcjs.forwardRef.call(void 0, function Tooltip2(props) {
129
129
  const htmlProps = useTooltip(props);
130
130
  return _NGD3IQDBcjs.createElement.call(void 0, TagName, htmlProps);
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useDialogDismiss
4
- } from "./JCOBPKEI.js";
4
+ } from "./BY6P32UK.js";
5
5
  import {
6
6
  usePopoverScopedContext
7
7
  } from "./5B3U64HV.js";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  usePopoverDisclosureArrow
4
- } from "./NN4HLGKS.js";
4
+ } from "./F2RFUFO2.js";
5
5
  import {
6
6
  useSelectContext
7
7
  } from "./SYZHUNAU.js";
@@ -45,7 +45,7 @@ var useDialogDismiss = createHook(
45
45
  stroke: "currentColor",
46
46
  strokeLinecap: "round",
47
47
  strokeLinejoin: "round",
48
- strokeWidth: "1.5pt",
48
+ strokeWidth: 1.5,
49
49
  viewBox: "0 0 16 16",
50
50
  height: "1em",
51
51
  width: "1em",
@@ -4,7 +4,7 @@ import {
4
4
  } from "./MIIHBIKN.js";
5
5
  import {
6
6
  useCompositeItem
7
- } from "./ONUY4D7O.js";
7
+ } from "./R33ISPJY.js";
8
8
  import {
9
9
  createElement,
10
10
  createHook,
@@ -44,7 +44,7 @@ var usePopoverDisclosureArrow = createHook(function usePopoverDisclosureArrow2(_
44
44
  stroke: "currentColor",
45
45
  strokeLinecap: "round",
46
46
  strokeLinejoin: "round",
47
- strokeWidth: "1.5pt",
47
+ strokeWidth: 1.5,
48
48
  viewBox: "0 0 16 16",
49
49
  height: "1em",
50
50
  width: "1em",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  usePopoverDismiss
4
- } from "./LABIXQLW.js";
4
+ } from "./44PDY2W5.js";
5
5
  import {
6
6
  useHovercardScopedContext
7
7
  } from "./5YBNH7BL.js";
@@ -390,6 +390,7 @@ var useDialog = createHook(function useDialog2(_a) {
390
390
  },
391
391
  [store, finalFocus, autoFocusOnHideProp]
392
392
  );
393
+ const focusedOnHideRef = useRef(false);
393
394
  useSafeLayoutEffect(() => {
394
395
  if (open)
395
396
  return;
@@ -398,6 +399,7 @@ var useDialog = createHook(function useDialog2(_a) {
398
399
  if (!mayAutoFocusOnHide)
399
400
  return;
400
401
  const dialog = ref.current;
402
+ focusedOnHideRef.current = true;
401
403
  focusOnHide(dialog);
402
404
  }, [open, hasOpened, domReady, mayAutoFocusOnHide, focusOnHide]);
403
405
  useEffect(() => {
@@ -406,7 +408,13 @@ var useDialog = createHook(function useDialog2(_a) {
406
408
  if (!mayAutoFocusOnHide)
407
409
  return;
408
410
  const dialog = ref.current;
409
- return () => focusOnHide(dialog);
411
+ return () => {
412
+ if (focusedOnHideRef.current) {
413
+ focusedOnHideRef.current = false;
414
+ return;
415
+ }
416
+ focusOnHide(dialog);
417
+ };
410
418
  }, [hasOpened, mayAutoFocusOnHide, focusOnHide]);
411
419
  const hideOnEscapeProp = useBooleanEvent(hideOnEscape);
412
420
  useEffect(() => {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createDialogComponent,
4
4
  useDialog
5
- } from "./NQ4PTILT.js";
5
+ } from "./IOUGWXY5.js";
6
6
  import {
7
7
  PopoverScopedContextProvider,
8
8
  usePopoverProviderContext
@@ -10,7 +10,7 @@ import {
10
10
  } from "./VXKKJNIF.js";
11
11
  import {
12
12
  useCompositeItem
13
- } from "./ONUY4D7O.js";
13
+ } from "./R33ISPJY.js";
14
14
  import {
15
15
  createElement,
16
16
  createHook,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useCompositeItem
4
- } from "./ONUY4D7O.js";
4
+ } from "./R33ISPJY.js";
5
5
  import {
6
6
  useToolbarContext
7
7
  } from "./766APSLG.js";
@@ -26,7 +26,7 @@ var checkmark = /* @__PURE__ */ jsx(
26
26
  stroke: "currentColor",
27
27
  strokeLinecap: "round",
28
28
  strokeLinejoin: "round",
29
- strokeWidth: "1.5pt",
29
+ strokeWidth: 1.5,
30
30
  viewBox: "0 0 16 16",
31
31
  height: "1em",
32
32
  width: "1em",
@@ -8,7 +8,8 @@ import {
8
8
  import {
9
9
  focusSilently,
10
10
  getEnabledItem,
11
- isItem
11
+ isItem,
12
+ selectTextField
12
13
  } from "./3IEDWLST.js";
13
14
  import {
14
15
  CompositeItemContext,
@@ -41,7 +42,9 @@ import {
41
42
  // src/composite/composite-item.tsx
42
43
  import { useCallback, useContext, useMemo, useRef, useState } from "react";
43
44
  import {
45
+ getDocument,
44
46
  getScrollingElement,
47
+ getTextboxSelection,
45
48
  isButton,
46
49
  isTextField
47
50
  } from "@ariakit/core/utils/dom";
@@ -52,6 +55,9 @@ import {
52
55
  } from "@ariakit/core/utils/misc";
53
56
  import { jsx } from "react/jsx-runtime";
54
57
  var TagName = "button";
58
+ function isTextbox(element) {
59
+ return element.isContentEditable || isTextField(element);
60
+ }
55
61
  function isEditableElement(element) {
56
62
  if (element.isContentEditable)
57
63
  return true;
@@ -59,6 +65,16 @@ function isEditableElement(element) {
59
65
  return true;
60
66
  return element.tagName === "INPUT" && !isButton(element);
61
67
  }
68
+ function getValueLength(element) {
69
+ if (isTextField(element)) {
70
+ return element.value.length;
71
+ } else if (element.isContentEditable) {
72
+ const range = getDocument(element).createRange();
73
+ range.selectNodeContents(element);
74
+ return range.toString().length;
75
+ }
76
+ return 0;
77
+ }
62
78
  function getNextPageOffset(scrollingElement, pageUp = false) {
63
79
  const height = scrollingElement.clientHeight;
64
80
  const { top } = scrollingElement.getBoundingClientRect();
@@ -217,6 +233,9 @@ var useCompositeItem = createHook(
217
233
  return;
218
234
  const { virtualFocus: virtualFocus2, baseElement: baseElement2 } = store.getState();
219
235
  store.setActiveId(id);
236
+ if (isTextbox(event.currentTarget)) {
237
+ selectTextField(event.currentTarget);
238
+ }
220
239
  if (!virtualFocus2)
221
240
  return;
222
241
  if (!isSelfTarget(event))
@@ -303,6 +322,22 @@ var useCompositeItem = createHook(
303
322
  };
304
323
  const action = keyMap[event.key];
305
324
  if (action) {
325
+ if (isTextbox(currentTarget)) {
326
+ const selection = getTextboxSelection(currentTarget);
327
+ const isLeft = isHorizontal && event.key === "ArrowLeft";
328
+ const isRight = isHorizontal && event.key === "ArrowRight";
329
+ const isUp = isVertical && event.key === "ArrowUp";
330
+ const isDown = isVertical && event.key === "ArrowDown";
331
+ if (isRight || isDown) {
332
+ if (selection.end !== getValueLength(currentTarget)) {
333
+ return;
334
+ }
335
+ } else if (isLeft || isUp) {
336
+ if (selection.start !== 0) {
337
+ return;
338
+ }
339
+ }
340
+ }
306
341
  const nextId = action();
307
342
  if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
308
343
  if (!moveOnKeyPressProp(event))
@@ -6,10 +6,10 @@ import {
6
6
  } from "./YMV43K4F.js";
7
7
  import {
8
8
  usePopover
9
- } from "./X3V2DT2U.js";
9
+ } from "./LTYEFENI.js";
10
10
  import {
11
11
  createDialogComponent
12
- } from "./NQ4PTILT.js";
12
+ } from "./IOUGWXY5.js";
13
13
  import {
14
14
  HovercardScopedContextProvider,
15
15
  useHovercardProviderContext
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  CheckboxCheck,
4
4
  useCheckboxCheck
5
- } from "../__chunks/RAKW656I.js";
5
+ } from "../__chunks/Q4PZFBSW.js";
6
6
  import "../__chunks/6XBVQI3K.js";
7
7
  import "../__chunks/GUCZNEAD.js";
8
8
  import "../__chunks/WOWUAP42.js";
@@ -296,9 +296,7 @@ export declare function useCollectionRenderer<T extends Item = any>({ store, ite
296
296
  onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
297
297
  onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
298
298
  onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
299
- onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
300
299
  onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
301
- onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
302
300
  onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
303
301
  onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
304
302
  onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
@@ -44,7 +44,7 @@ var children = /* @__PURE__ */ jsxs(
44
44
  stroke: "currentColor",
45
45
  strokeLinecap: "round",
46
46
  strokeLinejoin: "round",
47
- strokeWidth: "1pt",
47
+ strokeWidth: 1.5,
48
48
  width: "1em",
49
49
  height: "1em",
50
50
  pointerEvents: "none",
@@ -43,7 +43,7 @@ var children = /* @__PURE__ */ jsx(
43
43
  stroke: "currentColor",
44
44
  strokeLinecap: "round",
45
45
  strokeLinejoin: "round",
46
- strokeWidth: "1.5pt",
46
+ strokeWidth: 1.5,
47
47
  viewBox: "0 0 16 16",
48
48
  height: "1em",
49
49
  width: "1em",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useCheckboxCheck
4
- } from "../__chunks/RAKW656I.js";
4
+ } from "../__chunks/Q4PZFBSW.js";
5
5
  import "../__chunks/6XBVQI3K.js";
6
6
  import {
7
7
  ComboboxItemCheckedContext
@@ -4,7 +4,7 @@ import {
4
4
  } from "../__chunks/VXKKJNIF.js";
5
5
  import {
6
6
  useCompositeItem
7
- } from "../__chunks/ONUY4D7O.js";
7
+ } from "../__chunks/R33ISPJY.js";
8
8
  import "../__chunks/PJ7ERAIM.js";
9
9
  import {
10
10
  ComboboxItemCheckedContext,
@@ -9,10 +9,10 @@ import "../__chunks/QFI3MCMR.js";
9
9
  import "../__chunks/6LTHW2TQ.js";
10
10
  import {
11
11
  usePopover
12
- } from "../__chunks/X3V2DT2U.js";
12
+ } from "../__chunks/LTYEFENI.js";
13
13
  import {
14
14
  createDialogComponent
15
- } from "../__chunks/NQ4PTILT.js";
15
+ } from "../__chunks/IOUGWXY5.js";
16
16
  import "../__chunks/GOXKZAQI.js";
17
17
  import "../__chunks/6GXEOXGT.js";
18
18
  import "../__chunks/PTPUIM7N.js";
@@ -58,8 +58,9 @@ import {
58
58
  } from "../__chunks/4R3V3JGP.js";
59
59
 
60
60
  // src/combobox/combobox-popover.tsx
61
+ import { useRef } from "react";
61
62
  import { getDocument, matches } from "@ariakit/core/utils/dom";
62
- import { invariant } from "@ariakit/core/utils/misc";
63
+ import { invariant, isFalsyBooleanCallback } from "@ariakit/core/utils/misc";
63
64
  var TagName = "div";
64
65
  function isController(target, ...ids) {
65
66
  if (!target)
@@ -79,12 +80,14 @@ var useComboboxPopover = createHook(
79
80
  modal,
80
81
  tabIndex,
81
82
  alwaysVisible,
83
+ autoFocusOnHide = true,
82
84
  hideOnInteractOutside = true
83
85
  } = _b, props = __objRest(_b, [
84
86
  "store",
85
87
  "modal",
86
88
  "tabIndex",
87
89
  "alwaysVisible",
90
+ "autoFocusOnHide",
88
91
  "hideOnInteractOutside"
89
92
  ]);
90
93
  const context = useComboboxProviderContext();
@@ -94,6 +97,7 @@ var useComboboxPopover = createHook(
94
97
  process.env.NODE_ENV !== "production" && "ComboboxPopover must receive a `store` prop or be wrapped in a ComboboxProvider component."
95
98
  );
96
99
  const baseElement = store.useState("baseElement");
100
+ const hiddenByClickOutsideRef = useRef(false);
97
101
  props = useComboboxList(__spreadValues({ store, alwaysVisible }, props));
98
102
  props = usePopover(__spreadProps(__spreadValues({
99
103
  store,
@@ -101,7 +105,6 @@ var useComboboxPopover = createHook(
101
105
  alwaysVisible,
102
106
  backdrop: false,
103
107
  autoFocusOnShow: false,
104
- autoFocusOnHide: false,
105
108
  finalFocus: baseElement,
106
109
  preserveTabOrderAnchor: null
107
110
  }, props), {
@@ -133,6 +136,18 @@ var useComboboxPopover = createHook(
133
136
  const controlElements = doc.querySelectorAll(selector);
134
137
  return [...elements, ...controlElements];
135
138
  },
139
+ // The combobox popover should focus on the combobox input when it hides,
140
+ // unless the event was triggered by a click outside the popover, in which
141
+ // case the input shouldn't be re-focused.
142
+ autoFocusOnHide(element) {
143
+ if (isFalsyBooleanCallback(autoFocusOnHide, element))
144
+ return false;
145
+ if (hiddenByClickOutsideRef.current) {
146
+ hiddenByClickOutsideRef.current = false;
147
+ return false;
148
+ }
149
+ return true;
150
+ },
136
151
  // Make sure we don't hide the popover when the user interacts with the
137
152
  // combobox cancel or the combobox disclosure buttons. They will have the
138
153
  // aria-controls attribute pointing to either the combobox input or the
@@ -145,6 +160,9 @@ var useComboboxPopover = createHook(
145
160
  if (isController(event.target, contentId, baseId))
146
161
  return false;
147
162
  const result = typeof hideOnInteractOutside === "function" ? hideOnInteractOutside(event) : hideOnInteractOutside;
163
+ if (result) {
164
+ hiddenByClickOutsideRef.current = event.type === "click";
165
+ }
148
166
  return result;
149
167
  }
150
168
  }));
@@ -143,6 +143,26 @@ export interface ComboboxOptions<T extends ElementType = TagName> extends Compos
143
143
  * value.
144
144
  */
145
145
  blurActiveItemOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
146
+ /**
147
+ * Specifies the minimum character count the input value should have before
148
+ * the [`ComboboxList`](https://ariakit.org/reference/combobox-list) or
149
+ * [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover)
150
+ * components are displayed.
151
+ *
152
+ * The [`showOnChange`](https://ariakit.org/reference/combobox#showonchange),
153
+ * [`showOnClick`](https://ariakit.org/reference/combobox#showonclick), and
154
+ * [`showOnKeyPress`](https://ariakit.org/reference/combobox#showonkeypress)
155
+ * props allow you to tailor the behavior for each unique event.
156
+ * @default 0
157
+ * @example
158
+ * In the following example, the combobox list will be shown when the input
159
+ * value has at least one character. However, if the user presses the arrow
160
+ * keys, the list will be shown regardless of the input value length.
161
+ * ```jsx
162
+ * <Combobox showMinLength={1} showOnKeyPress />
163
+ * ```
164
+ */
165
+ showMinLength?: number;
146
166
  /**
147
167
  * Whether the [`ComboboxList`](https://ariakit.org/reference/combobox-list)
148
168
  * or [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover)