@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.
- package/CHANGELOG.md +42 -0
- package/cjs/__chunks/{GYHP7IYG.cjs → 4XVTH6OR.cjs} +2 -2
- package/cjs/__chunks/{IHFGURUM.cjs → 54YZYOPA.cjs} +2 -2
- package/cjs/__chunks/{DCTXNU2X.cjs → COWKMNMZ.cjs} +3 -3
- package/cjs/__chunks/{HFNM6QV4.cjs → DAOFDKV2.cjs} +1 -1
- package/cjs/__chunks/{3C4RFBCG.cjs → EYZZO5IT.cjs} +1 -1
- package/cjs/__chunks/{3MKOUH5M.cjs → HPNCFYQJ.cjs} +4 -4
- package/cjs/__chunks/{A356CGND.cjs → JDCTLYQ4.cjs} +1 -1
- package/cjs/__chunks/{T5BWR4CB.cjs → KDTFHBKU.cjs} +2 -2
- package/cjs/__chunks/{NZSB7HSZ.cjs → LY4LCJM6.cjs} +2 -2
- package/cjs/__chunks/{7DQ2LBH2.cjs → QUHFOHHT.cjs} +35 -0
- package/cjs/__chunks/{AJF5DT5A.cjs → YO7LLGVA.cjs} +2 -2
- package/cjs/__chunks/{3XXW4Y4D.cjs → Z2VL7JHX.cjs} +2 -2
- package/cjs/__chunks/{CWS5RZSU.cjs → ZTAE5B6W.cjs} +9 -1
- package/cjs/checkbox/checkbox-check.cjs +2 -2
- package/cjs/collection/collection-renderer.d.cts +0 -2
- package/cjs/collection/collection-renderer.d.ts +0 -2
- package/cjs/combobox/combobox-cancel.cjs +1 -1
- package/cjs/combobox/combobox-disclosure.cjs +1 -1
- package/cjs/combobox/combobox-item-check.cjs +2 -2
- package/cjs/combobox/combobox-item.cjs +2 -2
- package/cjs/combobox/combobox-popover.cjs +23 -5
- package/cjs/combobox/combobox.cjs +14 -11
- package/cjs/combobox/combobox.d.cts +20 -0
- package/cjs/combobox/combobox.d.ts +20 -0
- package/cjs/composite/composite-input.cjs +91 -6
- package/cjs/composite/composite-input.d.cts +2 -0
- package/cjs/composite/composite-input.d.ts +2 -0
- package/cjs/composite/composite-item.cjs +2 -2
- package/cjs/composite/composite-overflow-disclosure.cjs +2 -2
- package/cjs/composite/composite-overflow.cjs +3 -3
- package/cjs/composite/composite-renderer.d.cts +0 -2
- package/cjs/composite/composite-renderer.d.ts +0 -2
- package/cjs/dialog/dialog-dismiss.cjs +2 -2
- package/cjs/dialog/dialog.cjs +2 -2
- package/cjs/form/form-radio.cjs +3 -3
- package/cjs/hovercard/hovercard-disclosure.cjs +1 -1
- package/cjs/hovercard/hovercard-dismiss.cjs +4 -4
- package/cjs/hovercard/hovercard.cjs +4 -4
- package/cjs/menu/menu-button-arrow.cjs +2 -2
- package/cjs/menu/menu-dismiss.cjs +4 -4
- package/cjs/menu/menu-item-check.cjs +2 -2
- package/cjs/menu/menu-item-checkbox.cjs +3 -3
- package/cjs/menu/menu-item-radio.cjs +5 -5
- package/cjs/menu/menu-item.cjs +3 -3
- package/cjs/menu/menu.cjs +5 -5
- package/cjs/popover/popover-disclosure-arrow.cjs +2 -2
- package/cjs/popover/popover-dismiss.cjs +3 -3
- package/cjs/popover/popover.cjs +3 -3
- package/cjs/radio/radio.cjs +3 -3
- package/cjs/select/select-arrow.cjs +3 -3
- package/cjs/select/select-item-check.cjs +2 -2
- package/cjs/select/select-item.cjs +2 -2
- package/cjs/select/select-popover.cjs +4 -4
- package/cjs/select/select.cjs +3 -3
- package/cjs/tab/tab.cjs +4 -4
- package/cjs/toolbar/toolbar-container.cjs +3 -3
- package/cjs/toolbar/toolbar-input.cjs +3 -7
- package/cjs/toolbar/toolbar-input.d.cts +3 -2
- package/cjs/toolbar/toolbar-input.d.ts +3 -2
- package/cjs/toolbar/toolbar-item.cjs +3 -3
- package/cjs/tooltip/tooltip.cjs +5 -5
- package/esm/__chunks/{LABIXQLW.js → 44PDY2W5.js} +1 -1
- package/esm/__chunks/{FYNSL2D5.js → 5H3YXAUC.js} +1 -1
- package/esm/__chunks/{JCOBPKEI.js → BY6P32UK.js} +1 -1
- package/esm/__chunks/{C5HA76JU.js → DSUHLHLE.js} +1 -1
- package/esm/__chunks/{NN4HLGKS.js → F2RFUFO2.js} +1 -1
- package/esm/__chunks/{2VWKZYYT.js → H5N72W37.js} +1 -1
- package/esm/__chunks/{NQ4PTILT.js → IOUGWXY5.js} +9 -1
- package/esm/__chunks/{X3V2DT2U.js → LTYEFENI.js} +1 -1
- package/esm/__chunks/{HW63KLP5.js → NFPDVAAW.js} +1 -1
- package/esm/__chunks/{XK6CE2M5.js → NHVUMSP7.js} +1 -1
- package/esm/__chunks/{RAKW656I.js → Q4PZFBSW.js} +1 -1
- package/esm/__chunks/{ONUY4D7O.js → R33ISPJY.js} +36 -1
- package/esm/__chunks/{6VDNHSLX.js → XEJ23EM6.js} +2 -2
- package/esm/checkbox/checkbox-check.js +1 -1
- package/esm/collection/collection-renderer.d.ts +0 -2
- package/esm/combobox/combobox-cancel.js +1 -1
- package/esm/combobox/combobox-disclosure.js +1 -1
- package/esm/combobox/combobox-item-check.js +1 -1
- package/esm/combobox/combobox-item.js +1 -1
- package/esm/combobox/combobox-popover.js +22 -4
- package/esm/combobox/combobox.d.ts +20 -0
- package/esm/combobox/combobox.js +14 -11
- package/esm/composite/composite-input.d.ts +2 -0
- package/esm/composite/composite-input.js +92 -7
- package/esm/composite/composite-item.js +1 -1
- package/esm/composite/composite-overflow-disclosure.js +1 -1
- package/esm/composite/composite-overflow.js +2 -2
- package/esm/composite/composite-renderer.d.ts +0 -2
- package/esm/dialog/dialog-dismiss.js +1 -1
- package/esm/dialog/dialog.js +1 -1
- package/esm/form/form-radio.js +2 -2
- package/esm/hovercard/hovercard-disclosure.js +1 -1
- package/esm/hovercard/hovercard-dismiss.js +3 -3
- package/esm/hovercard/hovercard.js +3 -3
- package/esm/menu/menu-button-arrow.js +1 -1
- package/esm/menu/menu-dismiss.js +3 -3
- package/esm/menu/menu-item-check.js +1 -1
- package/esm/menu/menu-item-checkbox.js +2 -2
- package/esm/menu/menu-item-radio.js +3 -3
- package/esm/menu/menu-item.js +2 -2
- package/esm/menu/menu.js +3 -3
- package/esm/popover/popover-disclosure-arrow.js +1 -1
- package/esm/popover/popover-dismiss.js +2 -2
- package/esm/popover/popover.js +2 -2
- package/esm/radio/radio.js +2 -2
- package/esm/select/select-arrow.js +2 -2
- package/esm/select/select-item-check.js +1 -1
- package/esm/select/select-item.js +1 -1
- package/esm/select/select-popover.js +2 -2
- package/esm/select/select.js +2 -2
- package/esm/tab/tab.js +1 -1
- package/esm/toolbar/toolbar-container.js +2 -2
- package/esm/toolbar/toolbar-input.d.ts +3 -2
- package/esm/toolbar/toolbar-input.js +2 -6
- package/esm/toolbar/toolbar-item.js +2 -2
- package/esm/tooltip/tooltip.js +3 -3
- package/package.json +2 -2
- package/cjs/__chunks/WGZQRLXV.cjs +0 -84
- 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
|
|
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 =
|
|
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
|
|
15
|
+
var _COWKMNMZcjs = require('../__chunks/COWKMNMZ.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
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 =
|
|
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 =
|
|
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);
|
package/cjs/select/select.cjs
CHANGED
|
@@ -8,8 +8,8 @@ require('../__chunks/YH42XRHR.cjs');
|
|
|
8
8
|
require('../__chunks/IXJIFLOA.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('../__chunks/
|
|
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,
|
|
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
|
|
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
|
-
|
|
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,
|
|
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 =
|
|
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
|
|
8
|
-
require('../__chunks/
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
6
|
-
require('../__chunks/
|
|
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 =
|
|
23
|
+
exports.ToolbarItem = _YO7LLGVAcjs.ToolbarItem; exports.useToolbarItem = _YO7LLGVAcjs.useToolbarItem;
|
package/cjs/tooltip/tooltip.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _HPNCFYQJcjs = require('../__chunks/HPNCFYQJ.cjs');
|
|
5
5
|
require('../__chunks/KXQOQQ5B.cjs');
|
|
6
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/COWKMNMZ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
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 =
|
|
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 =
|
|
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);
|
|
@@ -44,7 +44,7 @@ var usePopoverDisclosureArrow = createHook(function usePopoverDisclosureArrow2(_
|
|
|
44
44
|
stroke: "currentColor",
|
|
45
45
|
strokeLinecap: "round",
|
|
46
46
|
strokeLinejoin: "round",
|
|
47
|
-
strokeWidth:
|
|
47
|
+
strokeWidth: 1.5,
|
|
48
48
|
viewBox: "0 0 16 16",
|
|
49
49
|
height: "1em",
|
|
50
50
|
width: "1em",
|
|
@@ -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 () =>
|
|
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(() => {
|
|
@@ -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 "./
|
|
9
|
+
} from "./LTYEFENI.js";
|
|
10
10
|
import {
|
|
11
11
|
createDialogComponent
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./IOUGWXY5.js";
|
|
13
13
|
import {
|
|
14
14
|
HovercardScopedContextProvider,
|
|
15
15
|
useHovercardProviderContext
|
|
@@ -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;
|
|
@@ -9,10 +9,10 @@ import "../__chunks/QFI3MCMR.js";
|
|
|
9
9
|
import "../__chunks/6LTHW2TQ.js";
|
|
10
10
|
import {
|
|
11
11
|
usePopover
|
|
12
|
-
} from "../__chunks/
|
|
12
|
+
} from "../__chunks/LTYEFENI.js";
|
|
13
13
|
import {
|
|
14
14
|
createDialogComponent
|
|
15
|
-
} from "../__chunks/
|
|
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)
|