@ariakit/core 0.3.4 → 0.3.6
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 +8 -0
- package/cjs/__chunks/{LMT335NJ.cjs → 3UT5FE6K.cjs} +2 -2
- package/cjs/__chunks/{OASSVCYR.cjs → 46BH65MC.cjs} +20 -22
- package/cjs/__chunks/{FTB5CXVB.cjs → 5F4DVUNS.cjs} +7 -1
- package/cjs/__chunks/{M44E4T5A.cjs → 6WBY3ZZM.cjs} +21 -21
- package/cjs/__chunks/{ROX3MRGO.cjs → 7ZUFMSXJ.cjs} +16 -16
- package/cjs/__chunks/GXIZMD53.cjs +35 -0
- package/cjs/__chunks/{MLPOXRDT.cjs → GZDVJEID.cjs} +2 -2
- package/cjs/__chunks/{25WWT2VO.cjs → JLC5A6WF.cjs} +15 -15
- package/cjs/__chunks/{YXSGST3H.cjs → MEHGRTJ3.cjs} +18 -18
- package/cjs/__chunks/PD7XZBXC.cjs +42 -0
- package/cjs/__chunks/{G5EW4WED.cjs → YIUPKKEK.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +34 -34
- package/cjs/combobox/combobox-store.d.cts +4 -1
- package/cjs/combobox/combobox-store.d.ts +4 -1
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +28 -28
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -21
- package/cjs/menu/menu-bar-store.d.cts +6 -6
- package/cjs/menu/menu-bar-store.d.ts +6 -6
- package/cjs/menu/menu-store.cjs +32 -32
- package/cjs/menubar/menubar-store.cjs +14 -0
- package/cjs/menubar/menubar-store.d.cts +16 -0
- package/cjs/menubar/menubar-store.d.ts +16 -0
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +33 -33
- package/cjs/tab/tab-store.cjs +25 -25
- package/cjs/toolbar/toolbar-store.cjs +9 -9
- package/cjs/tooltip/tooltip-store.cjs +15 -15
- package/cjs/utils/array.cjs +1 -1
- package/cjs/utils/dom.cjs +5 -3
- package/cjs/utils/dom.d.cts +9 -0
- package/cjs/utils/dom.d.ts +9 -0
- package/cjs/utils/events.cjs +8 -8
- package/cjs/utils/focus.cjs +15 -15
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/esm/__chunks/ANO6WJO4.js +35 -0
- package/esm/__chunks/{LWQU4J4N.js → BXH3I7ML.js} +4 -4
- package/esm/__chunks/{Q332EHXG.js → CCU5UHQ2.js} +4 -4
- package/esm/__chunks/{I7YGHQ4Z.js → CL47ZAPY.js} +1 -1
- package/esm/__chunks/{NIF7E7VE.js → DLOEKDPY.js} +7 -1
- package/esm/__chunks/{TEJLMP2M.js → DYD4YNLE.js} +3 -3
- package/esm/__chunks/{GME4NYXR.js → E7OQVGGY.js} +6 -8
- package/esm/__chunks/{D23ES3Z4.js → I2VQ3XGR.js} +1 -1
- package/esm/__chunks/{5UJPJ37G.js → MHPO2BXA.js} +1 -1
- package/esm/__chunks/{FGW7QUD2.js → OGMLJYDV.js} +4 -4
- package/esm/__chunks/{VEWADM34.js → WY3EMTH6.js} +4 -4
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.d.ts +4 -1
- package/esm/combobox/combobox-store.js +10 -10
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.js +6 -6
- package/esm/dialog/dialog-store.js +5 -5
- package/esm/disclosure/disclosure-store.js +4 -4
- package/esm/form/form-store.js +5 -5
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.d.ts +6 -6
- package/esm/menu/menu-bar-store.js +9 -22
- package/esm/menu/menu-store.js +10 -10
- package/esm/menubar/menubar-store.d.ts +16 -0
- package/esm/menubar/menubar-store.js +14 -0
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.js +9 -9
- package/esm/tab/tab-store.js +6 -6
- package/esm/toolbar/toolbar-store.js +6 -6
- package/esm/tooltip/tooltip-store.js +7 -7
- package/esm/utils/array.js +1 -1
- package/esm/utils/dom.d.ts +9 -0
- package/esm/utils/dom.js +6 -4
- package/esm/utils/events.js +3 -3
- package/esm/utils/focus.js +2 -2
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/menubar/menubar-store/package.json +8 -0
- package/package.json +8 -1
- package/cjs/__chunks/LUOEAZGU.cjs +0 -42
- /package/cjs/__chunks/{WYXAWBLE.cjs → AV6KTKLE.cjs} +0 -0
- /package/esm/__chunks/{2SMRF6AD.js → 4R3V3JGP.js} +0 -0
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _PD7XZBXCcjs = require('../__chunks/PD7XZBXC.cjs');
|
|
5
|
+
require('../__chunks/7ZUFMSXJ.cjs');
|
|
6
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
7
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
18
18
|
|
|
19
19
|
// src/tooltip/tooltip-store.ts
|
|
20
20
|
function createTooltipStore(props = {}) {
|
|
21
21
|
var _a;
|
|
22
22
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
23
|
-
const hovercard =
|
|
24
|
-
placement:
|
|
23
|
+
const hovercard = _PD7XZBXCcjs.createHovercardStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
24
|
+
placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
25
25
|
props.placement,
|
|
26
26
|
syncState == null ? void 0 : syncState.placement,
|
|
27
27
|
"top"
|
|
28
28
|
),
|
|
29
|
-
hideTimeout:
|
|
29
|
+
hideTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout, 0)
|
|
30
30
|
}));
|
|
31
|
-
const initialState =
|
|
32
|
-
type:
|
|
33
|
-
skipTimeout:
|
|
31
|
+
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard.getState()), {
|
|
32
|
+
type: _3UT5FE6Kcjs.defaultValue.call(void 0, props.type, syncState == null ? void 0 : syncState.type, "description"),
|
|
33
|
+
skipTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.skipTimeout, syncState == null ? void 0 : syncState.skipTimeout, 300)
|
|
34
34
|
});
|
|
35
|
-
const tooltip =
|
|
36
|
-
return
|
|
35
|
+
const tooltip = _46BH65MCcjs.createStore.call(void 0, initialState, hovercard, props.store);
|
|
36
|
+
return _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, hovercard), tooltip);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
|
package/cjs/utils/array.cjs
CHANGED
package/cjs/utils/dom.cjs
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var _FTB5CXVBcjs = require('../__chunks/FTB5CXVB.cjs');
|
|
21
|
-
require('../__chunks/WYXAWBLE.cjs');
|
|
22
20
|
|
|
21
|
+
var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
|
|
22
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -37,4 +37,6 @@ require('../__chunks/WYXAWBLE.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
exports.canUseDOM = _5F4DVUNScjs.canUseDOM; exports.closest = _5F4DVUNScjs.closest; exports.contains = _5F4DVUNScjs.contains; exports.getActiveElement = _5F4DVUNScjs.getActiveElement; exports.getDocument = _5F4DVUNScjs.getDocument; exports.getPopupItemRole = _5F4DVUNScjs.getPopupItemRole; exports.getPopupRole = _5F4DVUNScjs.getPopupRole; exports.getScrollingElement = _5F4DVUNScjs.getScrollingElement; exports.getTextboxSelection = _5F4DVUNScjs.getTextboxSelection; exports.getWindow = _5F4DVUNScjs.getWindow; exports.isButton = _5F4DVUNScjs.isButton; exports.isFrame = _5F4DVUNScjs.isFrame; exports.isPartiallyHidden = _5F4DVUNScjs.isPartiallyHidden; exports.isTextField = _5F4DVUNScjs.isTextField; exports.isVisible = _5F4DVUNScjs.isVisible; exports.matches = _5F4DVUNScjs.matches; exports.scrollIntoViewIfNeeded = _5F4DVUNScjs.scrollIntoViewIfNeeded; exports.setSelectionRange = _5F4DVUNScjs.setSelectionRange;
|
package/cjs/utils/dom.d.cts
CHANGED
|
@@ -103,3 +103,12 @@ export declare function getScrollingElement(element?: Element | null): HTMLEleme
|
|
|
103
103
|
* Determines whether an element is hidden or partially hidden in the viewport.
|
|
104
104
|
*/
|
|
105
105
|
export declare function isPartiallyHidden(element: Element): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* SelectionRange only works on a few types of input.
|
|
108
|
+
* Calling `setSelectionRange` on a unsupported input type may throw an error on certain browsers.
|
|
109
|
+
* To avoid it, we check if its type supports SelectionRange first.
|
|
110
|
+
* It will be a noop to non-supported types until we find a workaround.
|
|
111
|
+
*
|
|
112
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
|
|
113
|
+
*/
|
|
114
|
+
export declare function setSelectionRange(element: HTMLInputElement, ...args: Parameters<typeof HTMLInputElement.prototype.setSelectionRange>): void;
|
package/cjs/utils/dom.d.ts
CHANGED
|
@@ -103,3 +103,12 @@ export declare function getScrollingElement(element?: Element | null): HTMLEleme
|
|
|
103
103
|
* Determines whether an element is hidden or partially hidden in the viewport.
|
|
104
104
|
*/
|
|
105
105
|
export declare function isPartiallyHidden(element: Element): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* SelectionRange only works on a few types of input.
|
|
108
|
+
* Calling `setSelectionRange` on a unsupported input type may throw an error on certain browsers.
|
|
109
|
+
* To avoid it, we check if its type supports SelectionRange first.
|
|
110
|
+
* It will be a noop to non-supported types until we find a workaround.
|
|
111
|
+
*
|
|
112
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
|
|
113
|
+
*/
|
|
114
|
+
export declare function setSelectionRange(element: HTMLInputElement, ...args: Parameters<typeof HTMLInputElement.prototype.setSelectionRange>): void;
|
package/cjs/utils/events.cjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _YIUPKKEKcjs = require('../__chunks/YIUPKKEK.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
// src/utils/events.ts
|
|
14
14
|
function isPortalEvent(event) {
|
|
15
15
|
return Boolean(
|
|
16
|
-
event.currentTarget && !
|
|
16
|
+
event.currentTarget && !_5F4DVUNScjs.contains.call(void 0, event.currentTarget, event.target)
|
|
17
17
|
);
|
|
18
18
|
}
|
|
19
19
|
function isSelfTarget(event) {
|
|
@@ -23,7 +23,7 @@ function isOpeningInNewTab(event) {
|
|
|
23
23
|
const element = event.currentTarget;
|
|
24
24
|
if (!element)
|
|
25
25
|
return false;
|
|
26
|
-
const isAppleDevice =
|
|
26
|
+
const isAppleDevice = _YIUPKKEKcjs.isApple.call(void 0, );
|
|
27
27
|
if (isAppleDevice && !event.metaKey)
|
|
28
28
|
return false;
|
|
29
29
|
if (!isAppleDevice && !event.ctrlKey)
|
|
@@ -59,14 +59,14 @@ function fireEvent(element, type, eventInit) {
|
|
|
59
59
|
function fireBlurEvent(element, eventInit) {
|
|
60
60
|
const event = new FocusEvent("blur", eventInit);
|
|
61
61
|
const defaultAllowed = element.dispatchEvent(event);
|
|
62
|
-
const bubbleInit =
|
|
62
|
+
const bubbleInit = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
|
|
63
63
|
element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
|
|
64
64
|
return defaultAllowed;
|
|
65
65
|
}
|
|
66
66
|
function fireFocusEvent(element, eventInit) {
|
|
67
67
|
const event = new FocusEvent("focus", eventInit);
|
|
68
68
|
const defaultAllowed = element.dispatchEvent(event);
|
|
69
|
-
const bubbleInit =
|
|
69
|
+
const bubbleInit = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, eventInit), { bubbles: true });
|
|
70
70
|
element.dispatchEvent(new FocusEvent("focusin", bubbleInit));
|
|
71
71
|
return defaultAllowed;
|
|
72
72
|
}
|
|
@@ -81,7 +81,7 @@ function fireClickEvent(element, eventInit) {
|
|
|
81
81
|
function isFocusEventOutside(event, container) {
|
|
82
82
|
const containerElement = container || event.currentTarget;
|
|
83
83
|
const relatedTarget = event.relatedTarget;
|
|
84
|
-
return !relatedTarget || !
|
|
84
|
+
return !relatedTarget || !_5F4DVUNScjs.contains.call(void 0, containerElement, relatedTarget);
|
|
85
85
|
}
|
|
86
86
|
function queueBeforeEvent(element, type, callback) {
|
|
87
87
|
const raf = requestAnimationFrame(() => {
|
package/cjs/utils/focus.cjs
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _5F4DVUNScjs = require('../__chunks/5F4DVUNS.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
13
13
|
|
|
14
14
|
// src/utils/focus.ts
|
|
15
15
|
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
@@ -18,11 +18,11 @@ function hasNegativeTabIndex(element) {
|
|
|
18
18
|
return tabIndex < 0;
|
|
19
19
|
}
|
|
20
20
|
function isFocusable(element) {
|
|
21
|
-
if (!
|
|
21
|
+
if (!_5F4DVUNScjs.matches.call(void 0, element, selector))
|
|
22
22
|
return false;
|
|
23
|
-
if (!
|
|
23
|
+
if (!_5F4DVUNScjs.isVisible.call(void 0, element))
|
|
24
24
|
return false;
|
|
25
|
-
if (
|
|
25
|
+
if (_5F4DVUNScjs.closest.call(void 0, element, "[inert]"))
|
|
26
26
|
return false;
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
@@ -44,7 +44,7 @@ function isTabbable(element) {
|
|
|
44
44
|
return true;
|
|
45
45
|
if (!("length" in radioGroup))
|
|
46
46
|
return true;
|
|
47
|
-
const activeElement =
|
|
47
|
+
const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
|
|
48
48
|
if (!activeElement)
|
|
49
49
|
return true;
|
|
50
50
|
if (activeElement === element)
|
|
@@ -66,7 +66,7 @@ function getAllFocusableIn(container, includeContainer) {
|
|
|
66
66
|
}
|
|
67
67
|
const focusableElements = elements.filter(isFocusable);
|
|
68
68
|
focusableElements.forEach((element, i) => {
|
|
69
|
-
if (
|
|
69
|
+
if (_5F4DVUNScjs.isFrame.call(void 0, element) && element.contentDocument) {
|
|
70
70
|
const frameBody = element.contentDocument.body;
|
|
71
71
|
focusableElements.splice(i, 1, ...getAllFocusableIn(frameBody));
|
|
72
72
|
}
|
|
@@ -92,7 +92,7 @@ function getAllTabbableIn(container, includeContainer, fallbackToFocusable) {
|
|
|
92
92
|
tabbableElements.unshift(container);
|
|
93
93
|
}
|
|
94
94
|
tabbableElements.forEach((element, i) => {
|
|
95
|
-
if (
|
|
95
|
+
if (_5F4DVUNScjs.isFrame.call(void 0, element) && element.contentDocument) {
|
|
96
96
|
const frameBody = element.contentDocument.body;
|
|
97
97
|
const allFrameTabbable = getAllTabbableIn(
|
|
98
98
|
frameBody,
|
|
@@ -133,7 +133,7 @@ function getLastTabbable(fallbackToFocusable) {
|
|
|
133
133
|
return getLastTabbableIn(document.body, false, fallbackToFocusable);
|
|
134
134
|
}
|
|
135
135
|
function getNextTabbableIn(container, includeContainer, fallbackToFirst, fallbackToFocusable) {
|
|
136
|
-
const activeElement =
|
|
136
|
+
const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, container);
|
|
137
137
|
const allFocusable = getAllFocusableIn(container, includeContainer);
|
|
138
138
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
139
139
|
const nextFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -148,7 +148,7 @@ function getNextTabbable(fallbackToFirst, fallbackToFocusable) {
|
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
150
|
function getPreviousTabbableIn(container, includeContainer, fallbackToLast, fallbackToFocusable) {
|
|
151
|
-
const activeElement =
|
|
151
|
+
const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, container);
|
|
152
152
|
const allFocusable = getAllFocusableIn(container, includeContainer).reverse();
|
|
153
153
|
const activeIndex = allFocusable.indexOf(activeElement);
|
|
154
154
|
const previousFocusableElements = allFocusable.slice(activeIndex + 1);
|
|
@@ -164,12 +164,12 @@ function getPreviousTabbable(fallbackToFirst, fallbackToFocusable) {
|
|
|
164
164
|
}
|
|
165
165
|
function getClosestFocusable(element) {
|
|
166
166
|
while (element && !isFocusable(element)) {
|
|
167
|
-
element =
|
|
167
|
+
element = _5F4DVUNScjs.closest.call(void 0, element, selector);
|
|
168
168
|
}
|
|
169
169
|
return element || null;
|
|
170
170
|
}
|
|
171
171
|
function hasFocus(element) {
|
|
172
|
-
const activeElement =
|
|
172
|
+
const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
|
|
173
173
|
if (!activeElement)
|
|
174
174
|
return false;
|
|
175
175
|
if (activeElement === element)
|
|
@@ -180,10 +180,10 @@ function hasFocus(element) {
|
|
|
180
180
|
return activeDescendant === element.id;
|
|
181
181
|
}
|
|
182
182
|
function hasFocusWithin(element) {
|
|
183
|
-
const activeElement =
|
|
183
|
+
const activeElement = _5F4DVUNScjs.getActiveElement.call(void 0, element);
|
|
184
184
|
if (!activeElement)
|
|
185
185
|
return false;
|
|
186
|
-
if (
|
|
186
|
+
if (_5F4DVUNScjs.contains.call(void 0, element, activeElement))
|
|
187
187
|
return true;
|
|
188
188
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
189
189
|
if (!activeDescendant)
|
|
@@ -230,7 +230,7 @@ function focusIntoView(element, options) {
|
|
|
230
230
|
element.focus();
|
|
231
231
|
} else {
|
|
232
232
|
element.focus({ preventScroll: true });
|
|
233
|
-
element.scrollIntoView(
|
|
233
|
+
element.scrollIntoView(_AV6KTKLEcjs.__spreadValues.call(void 0, { block: "nearest", inline: "nearest" }, options));
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
package/cjs/utils/misc.cjs
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
require('../__chunks/
|
|
23
|
+
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
24
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -43,4 +43,4 @@ require('../__chunks/WYXAWBLE.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
exports.afterPaint =
|
|
46
|
+
exports.afterPaint = _3UT5FE6Kcjs.afterPaint; exports.applyState = _3UT5FE6Kcjs.applyState; exports.beforePaint = _3UT5FE6Kcjs.beforePaint; exports.chain = _3UT5FE6Kcjs.chain; exports.cx = _3UT5FE6Kcjs.cx; exports.defaultValue = _3UT5FE6Kcjs.defaultValue; exports.disabledFromProps = _3UT5FE6Kcjs.disabledFromProps; exports.getKeys = _3UT5FE6Kcjs.getKeys; exports.hasOwnProperty = _3UT5FE6Kcjs.hasOwnProperty; exports.identity = _3UT5FE6Kcjs.identity; exports.invariant = _3UT5FE6Kcjs.invariant; exports.isEmpty = _3UT5FE6Kcjs.isEmpty; exports.isFalsyBooleanCallback = _3UT5FE6Kcjs.isFalsyBooleanCallback; exports.isInteger = _3UT5FE6Kcjs.isInteger; exports.isObject = _3UT5FE6Kcjs.isObject; exports.noop = _3UT5FE6Kcjs.noop; exports.normalizeString = _3UT5FE6Kcjs.normalizeString; exports.omit = _3UT5FE6Kcjs.omit; exports.pick = _3UT5FE6Kcjs.pick; exports.shallowEqual = _3UT5FE6Kcjs.shallowEqual;
|
package/cjs/utils/platform.cjs
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
10
|
-
require('../__chunks/
|
|
8
|
+
var _YIUPKKEKcjs = require('../__chunks/YIUPKKEK.cjs');
|
|
9
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
10
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.isApple =
|
|
17
|
+
exports.isApple = _YIUPKKEKcjs.isApple; exports.isFirefox = _YIUPKKEKcjs.isFirefox; exports.isMac = _YIUPKKEKcjs.isMac; exports.isSafari = _YIUPKKEKcjs.isSafari; exports.isTouchDevice = _YIUPKKEKcjs.isTouchDevice;
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
require('../__chunks/
|
|
15
|
-
require('../__chunks/
|
|
13
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
14
|
+
require('../__chunks/3UT5FE6K.cjs');
|
|
15
|
+
require('../__chunks/AV6KTKLE.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -24,4 +24,4 @@ require('../__chunks/WYXAWBLE.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.batch =
|
|
27
|
+
exports.batch = _46BH65MCcjs.batch; exports.createStore = _46BH65MCcjs.createStore; exports.init = _46BH65MCcjs.init; exports.mergeStore = _46BH65MCcjs.mergeStore; exports.omit = _46BH65MCcjs.omit; exports.pick = _46BH65MCcjs.pick; exports.setup = _46BH65MCcjs.setup; exports.subscribe = _46BH65MCcjs.subscribe; exports.sync = _46BH65MCcjs.sync; exports.throwOnConflictingProps = _46BH65MCcjs.throwOnConflictingProps;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createCompositeStore
|
|
4
|
+
} from "./OGMLJYDV.js";
|
|
5
|
+
import {
|
|
6
|
+
createStore
|
|
7
|
+
} from "./E7OQVGGY.js";
|
|
8
|
+
import {
|
|
9
|
+
defaultValue
|
|
10
|
+
} from "./I2VQ3XGR.js";
|
|
11
|
+
import {
|
|
12
|
+
__spreadProps,
|
|
13
|
+
__spreadValues
|
|
14
|
+
} from "./4R3V3JGP.js";
|
|
15
|
+
|
|
16
|
+
// src/menubar/menubar-store.ts
|
|
17
|
+
function createMenubarStore(props = {}) {
|
|
18
|
+
var _a;
|
|
19
|
+
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
+
const composite = createCompositeStore(__spreadProps(__spreadValues({}, props), {
|
|
21
|
+
orientation: defaultValue(
|
|
22
|
+
props.orientation,
|
|
23
|
+
syncState == null ? void 0 : syncState.orientation,
|
|
24
|
+
"horizontal"
|
|
25
|
+
),
|
|
26
|
+
focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
|
|
27
|
+
}));
|
|
28
|
+
const initialState = __spreadValues({}, composite.getState());
|
|
29
|
+
const menubar = createStore(initialState, composite, props.store);
|
|
30
|
+
return __spreadValues(__spreadValues({}, composite), menubar);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
createMenubarStore
|
|
35
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./WY3EMTH6.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./E7OQVGGY.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./I2VQ3XGR.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./4R3V3JGP.js";
|
|
15
15
|
|
|
16
16
|
// src/hovercard/hovercard-store.ts
|
|
17
17
|
function createHovercardStore(props = {}) {
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
createStore,
|
|
5
5
|
setup,
|
|
6
6
|
throwOnConflictingProps
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./E7OQVGGY.js";
|
|
8
8
|
import {
|
|
9
9
|
chain,
|
|
10
10
|
defaultValue
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./I2VQ3XGR.js";
|
|
12
12
|
import {
|
|
13
13
|
getDocument
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./DLOEKDPY.js";
|
|
15
15
|
import {
|
|
16
16
|
__spreadProps,
|
|
17
17
|
__spreadValues
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./4R3V3JGP.js";
|
|
19
19
|
|
|
20
20
|
// src/collection/collection-store.ts
|
|
21
21
|
function isElementPreceding(a, b) {
|
|
@@ -169,6 +169,11 @@ function isPartiallyHidden(element) {
|
|
|
169
169
|
const right = elementRect.right > scrollerRight;
|
|
170
170
|
return top || left || bottom || right;
|
|
171
171
|
}
|
|
172
|
+
function setSelectionRange(element, ...args) {
|
|
173
|
+
if (/text|search|password|tel|url/i.test(element.type)) {
|
|
174
|
+
element.setSelectionRange(...args);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
172
177
|
|
|
173
178
|
export {
|
|
174
179
|
canUseDOM,
|
|
@@ -187,5 +192,6 @@ export {
|
|
|
187
192
|
getTextboxSelection,
|
|
188
193
|
scrollIntoViewIfNeeded,
|
|
189
194
|
getScrollingElement,
|
|
190
|
-
isPartiallyHidden
|
|
195
|
+
isPartiallyHidden,
|
|
196
|
+
setSelectionRange
|
|
191
197
|
};
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
subscribe,
|
|
8
8
|
sync,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./E7OQVGGY.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./I2VQ3XGR.js";
|
|
14
14
|
import {
|
|
15
15
|
__spreadProps,
|
|
16
16
|
__spreadValues
|
|
17
|
-
} from "./
|
|
17
|
+
} from "./4R3V3JGP.js";
|
|
18
18
|
|
|
19
19
|
// src/disclosure/disclosure-store.ts
|
|
20
20
|
function createDisclosureStore(props = {}) {
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
noop,
|
|
9
9
|
omit,
|
|
10
10
|
pick
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./I2VQ3XGR.js";
|
|
12
12
|
import {
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./4R3V3JGP.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/store.ts
|
|
18
18
|
function getInternal(store, key) {
|
|
@@ -50,17 +50,15 @@ function createStore(initialState, ...stores) {
|
|
|
50
50
|
return;
|
|
51
51
|
if (!hasOwnProperty(storeState, key))
|
|
52
52
|
return;
|
|
53
|
-
return sync(
|
|
54
|
-
|
|
55
|
-
[key],
|
|
56
|
-
(state2) => setState(
|
|
53
|
+
return sync(store, [key], (state2) => {
|
|
54
|
+
setState(
|
|
57
55
|
key,
|
|
58
56
|
state2[key],
|
|
59
57
|
// @ts-expect-error - Not public API. This is just to prevent
|
|
60
58
|
// infinite loops.
|
|
61
59
|
true
|
|
62
|
-
)
|
|
63
|
-
);
|
|
60
|
+
);
|
|
61
|
+
});
|
|
64
62
|
})
|
|
65
63
|
)
|
|
66
64
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./CCU5UHQ2.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
setup,
|
|
8
8
|
sync
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./E7OQVGGY.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./I2VQ3XGR.js";
|
|
13
13
|
import {
|
|
14
14
|
flatten2DArray,
|
|
15
15
|
reverseArray
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
__spreadProps,
|
|
19
19
|
__spreadValues
|
|
20
|
-
} from "./
|
|
20
|
+
} from "./4R3V3JGP.js";
|
|
21
21
|
|
|
22
22
|
// src/composite/composite-store.ts
|
|
23
23
|
var NULL_ITEM = { id: null };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./CL47ZAPY.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
mergeStore,
|
|
8
8
|
omit,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./E7OQVGGY.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./I2VQ3XGR.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
17
17
|
__spreadValues
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./4R3V3JGP.js";
|
|
19
19
|
|
|
20
20
|
// src/popover/popover-store.ts
|
|
21
21
|
function createPopoverStore(_a = {}) {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createStore,
|
|
4
4
|
throwOnConflictingProps
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/E7OQVGGY.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
|
-
} from "../__chunks/
|
|
8
|
+
} from "../__chunks/I2VQ3XGR.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadProps,
|
|
11
11
|
__spreadValues
|
|
12
|
-
} from "../__chunks/
|
|
12
|
+
} from "../__chunks/4R3V3JGP.js";
|
|
13
13
|
|
|
14
14
|
// src/checkbox/checkbox-store.ts
|
|
15
15
|
function createCheckboxStore(props = {}) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/CCU5UHQ2.js";
|
|
5
|
+
import "../__chunks/E7OQVGGY.js";
|
|
6
|
+
import "../__chunks/I2VQ3XGR.js";
|
|
7
|
+
import "../__chunks/DLOEKDPY.js";
|
|
8
|
+
import "../__chunks/4R3V3JGP.js";
|
|
9
9
|
export {
|
|
10
10
|
createCollectionStore
|
|
11
11
|
};
|
|
@@ -19,7 +19,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
19
19
|
* The input value.
|
|
20
20
|
*
|
|
21
21
|
* Live examples:
|
|
22
|
-
* - [
|
|
22
|
+
* - [Combobox with integrated
|
|
23
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
23
24
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
24
25
|
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
25
26
|
* - [Multi-selectable
|
|
@@ -38,6 +39,8 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
38
39
|
* Live examples:
|
|
39
40
|
* - [Multi-selectable
|
|
40
41
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
42
|
+
* - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
|
|
43
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
41
44
|
* @default false
|
|
42
45
|
*/
|
|
43
46
|
resetValueOnHide: boolean;
|