@ariakit/core 0.4.6 → 0.4.8
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 +9 -0
- package/cjs/__chunks/{B4LYZ4EM.cjs → 3QF3ODTR.cjs} +44 -61
- package/cjs/__chunks/{LPDHSEHU.cjs → 7CES7GVE.cjs} +4 -8
- package/cjs/__chunks/{Q2WCPTYS.cjs → 7WYII4AN.cjs} +6 -12
- package/cjs/__chunks/{EEDWPDM2.cjs → BTUHABP4.cjs} +16 -30
- package/cjs/__chunks/{4W3OYRR3.cjs → CCI5VM7E.cjs} +24 -30
- package/cjs/__chunks/{5JEQEZFR.cjs → H6ZQSQQL.cjs} +16 -16
- package/cjs/__chunks/{D7M2PCAQ.cjs → KCEXELK7.cjs} +6 -7
- package/cjs/__chunks/{LTLFSC4X.cjs → N667HVED.cjs} +2 -2
- package/cjs/__chunks/{3HYNC3XA.cjs → PW36G76L.cjs} +25 -29
- package/cjs/__chunks/{AETQC2AR.cjs → QLWAGBAQ.cjs} +20 -22
- package/cjs/__chunks/{B4AKUC4S.cjs → VJAE2Y4T.cjs} +10 -10
- package/cjs/__chunks/XIZWLBI2.cjs +42 -0
- package/cjs/checkbox/checkbox-store.cjs +7 -7
- package/cjs/collection/collection-store.cjs +6 -6
- package/cjs/combobox/combobox-store.cjs +50 -56
- package/cjs/combobox/combobox-store.d.cts +2 -0
- package/cjs/combobox/combobox-store.d.ts +2 -0
- package/cjs/composite/composite-overflow-store.cjs +7 -7
- package/cjs/composite/composite-store.cjs +7 -7
- package/cjs/composite/composite-store.d.cts +5 -1
- package/cjs/composite/composite-store.d.ts +5 -1
- package/cjs/dialog/dialog-store.cjs +6 -6
- package/cjs/disclosure/disclosure-store.cjs +5 -5
- package/cjs/form/form-store.cjs +32 -36
- package/cjs/hovercard/hovercard-store.cjs +8 -8
- package/cjs/index.cjs +1 -1
- package/cjs/menu/menu-bar-store.cjs +8 -8
- package/cjs/menu/menu-store.cjs +37 -42
- package/cjs/menubar/menubar-store.cjs +8 -8
- package/cjs/popover/popover-store.cjs +7 -7
- package/cjs/radio/radio-store.cjs +13 -13
- package/cjs/select/select-store.cjs +49 -62
- package/cjs/select/select-store.d.cts +2 -0
- package/cjs/select/select-store.d.ts +2 -0
- package/cjs/tab/tab-store.cjs +49 -61
- package/cjs/tab/tab-store.d.cts +10 -4
- package/cjs/tab/tab-store.d.ts +10 -4
- package/cjs/tag/tag-store.cjs +23 -27
- 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 +3 -3
- package/cjs/utils/events.cjs +25 -37
- package/cjs/utils/focus.cjs +41 -61
- package/cjs/utils/misc.cjs +3 -3
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +4 -4
- package/cjs/utils/store.cjs +4 -4
- package/cjs/utils/undo.cjs +3 -3
- package/esm/__chunks/{MFZZDIHG.js → 3UYWTADI.js} +4 -4
- package/esm/__chunks/{EQPTKGFA.js → 6DHTHWXD.js} +10 -16
- package/esm/__chunks/{WCKXDMU7.js → 6E4KKOSB.js} +5 -7
- package/esm/__chunks/{EKIWAN6A.js → 7LM4Q2XB.js} +4 -8
- package/esm/__chunks/{PBSSD2DM.js → D7EIQZAU.js} +8 -12
- package/esm/__chunks/{BRS7GKWU.js → EACLTACN.js} +4 -4
- package/esm/__chunks/{R676XYVY.js → EQQLU3CG.js} +34 -51
- package/esm/__chunks/{I2NJJ3XW.js → HWOIWM4O.js} +6 -12
- package/esm/__chunks/{22HHDS5F.js → PBFD2E7P.js} +15 -29
- package/esm/__chunks/{P3MTNH46.js → PIWLWQMB.js} +4 -4
- package/esm/__chunks/{CLSHHUGK.js → US4USQPI.js} +2 -3
- package/esm/__chunks/{5RJNXXU2.js → YOHCVXJB.js} +1 -1
- package/esm/checkbox/checkbox-store.js +3 -3
- package/esm/collection/collection-store.js +5 -5
- package/esm/combobox/combobox-store.d.ts +2 -0
- package/esm/combobox/combobox-store.js +16 -22
- package/esm/composite/composite-overflow-store.js +6 -6
- package/esm/composite/composite-store.d.ts +5 -1
- 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 +9 -13
- package/esm/hovercard/hovercard-store.js +7 -7
- package/esm/index.js +1 -1
- package/esm/menu/menu-bar-store.js +7 -7
- package/esm/menu/menu-store.js +15 -20
- package/esm/menubar/menubar-store.js +7 -7
- package/esm/popover/popover-store.js +6 -6
- package/esm/radio/radio-store.js +6 -6
- package/esm/select/select-store.d.ts +2 -0
- package/esm/select/select-store.js +22 -35
- package/esm/tab/tab-store.d.ts +10 -4
- package/esm/tab/tab-store.js +18 -30
- package/esm/tag/tag-store.js +11 -15
- 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.js +2 -2
- package/esm/utils/events.js +20 -32
- package/esm/utils/focus.js +33 -53
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/misc.js +2 -2
- package/esm/utils/platform.js +3 -3
- package/esm/utils/store.js +3 -3
- package/esm/utils/undo.js +2 -2
- package/package.json +2 -2
- package/readme.md +18 -0
- package/.eslintignore +0 -6
- package/cjs/__chunks/UEZLSKZ4.cjs +0 -42
- /package/cjs/__chunks/{AV6KTKLE.cjs → 3IVNQNIV.cjs} +0 -0
- /package/esm/__chunks/{4R3V3JGP.js → 3YLGPPWQ.js} +0 -0
package/esm/tag/tag-store.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
7
|
import {
|
|
8
8
|
UndoManager
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/7LM4Q2XB.js";
|
|
10
10
|
import {
|
|
11
11
|
createStore,
|
|
12
12
|
setup,
|
|
13
13
|
sync
|
|
14
|
-
} from "../__chunks/
|
|
14
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
15
15
|
import {
|
|
16
16
|
applyState,
|
|
17
17
|
defaultValue
|
|
18
|
-
} from "../__chunks/
|
|
19
|
-
import "../__chunks/
|
|
18
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
19
|
+
import "../__chunks/HWOIWM4O.js";
|
|
20
20
|
import {
|
|
21
21
|
__spreadProps,
|
|
22
22
|
__spreadValues
|
|
23
|
-
} from "../__chunks/
|
|
23
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
24
24
|
|
|
25
25
|
// src/tag/tag-store.ts
|
|
26
26
|
function createTagStore(props = {}) {
|
|
@@ -42,10 +42,8 @@ function createTagStore(props = {}) {
|
|
|
42
42
|
setup(
|
|
43
43
|
tag,
|
|
44
44
|
() => sync(tag, ["inputElement", "activeId"], (state) => {
|
|
45
|
-
if (!state.inputElement)
|
|
46
|
-
|
|
47
|
-
if (state.activeId !== void 0)
|
|
48
|
-
return;
|
|
45
|
+
if (!state.inputElement) return;
|
|
46
|
+
if (state.activeId !== void 0) return;
|
|
49
47
|
tag.setState("activeId", state.inputElement.id);
|
|
50
48
|
})
|
|
51
49
|
);
|
|
@@ -60,8 +58,7 @@ function createTagStore(props = {}) {
|
|
|
60
58
|
}
|
|
61
59
|
return next;
|
|
62
60
|
});
|
|
63
|
-
if (!changed)
|
|
64
|
-
return;
|
|
61
|
+
if (!changed) return;
|
|
65
62
|
return () => {
|
|
66
63
|
var _a2;
|
|
67
64
|
tag.setState("values", previousValues);
|
|
@@ -77,8 +74,7 @@ function createTagStore(props = {}) {
|
|
|
77
74
|
setValues,
|
|
78
75
|
addValue: (value) => {
|
|
79
76
|
setValues((values) => {
|
|
80
|
-
if (values.includes(value))
|
|
81
|
-
return values;
|
|
77
|
+
if (values.includes(value)) return values;
|
|
82
78
|
return [...values, value];
|
|
83
79
|
});
|
|
84
80
|
},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/D7EIQZAU.js";
|
|
5
|
+
import "../__chunks/6DHTHWXD.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
|
-
import "../__chunks/
|
|
7
|
+
import "../__chunks/EQQLU3CG.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
10
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
11
|
+
import "../__chunks/HWOIWM4O.js";
|
|
12
12
|
import {
|
|
13
13
|
__spreadProps,
|
|
14
14
|
__spreadValues
|
|
15
|
-
} from "../__chunks/
|
|
15
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
16
16
|
|
|
17
17
|
// src/toolbar/toolbar-store.ts
|
|
18
18
|
function createToolbarStore(props = {}) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/EACLTACN.js";
|
|
5
|
+
import "../__chunks/3UYWTADI.js";
|
|
6
|
+
import "../__chunks/YOHCVXJB.js";
|
|
7
|
+
import "../__chunks/6E4KKOSB.js";
|
|
8
8
|
import {
|
|
9
9
|
createStore
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "../__chunks/
|
|
13
|
+
} from "../__chunks/PBFD2E7P.js";
|
|
14
14
|
import {
|
|
15
15
|
__spreadProps,
|
|
16
16
|
__spreadValues
|
|
17
|
-
} from "../__chunks/
|
|
17
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
18
18
|
|
|
19
19
|
// src/tooltip/tooltip-store.ts
|
|
20
20
|
function createTooltipStore(props = {}) {
|
package/esm/utils/array.js
CHANGED
package/esm/utils/dom.js
CHANGED
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
isVisible,
|
|
19
19
|
scrollIntoViewIfNeeded,
|
|
20
20
|
setSelectionRange
|
|
21
|
-
} from "../__chunks/
|
|
22
|
-
import "../__chunks/
|
|
21
|
+
} from "../__chunks/HWOIWM4O.js";
|
|
22
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
23
23
|
export {
|
|
24
24
|
canUseDOM,
|
|
25
25
|
contains,
|
package/esm/utils/events.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
isApple
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/US4USQPI.js";
|
|
5
5
|
import {
|
|
6
6
|
contains
|
|
7
|
-
} from "../__chunks/
|
|
7
|
+
} from "../__chunks/HWOIWM4O.js";
|
|
8
8
|
import {
|
|
9
9
|
__spreadProps,
|
|
10
10
|
__spreadValues
|
|
11
|
-
} from "../__chunks/
|
|
11
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
12
12
|
|
|
13
13
|
// src/utils/events.ts
|
|
14
14
|
function isPortalEvent(event) {
|
|
@@ -21,35 +21,24 @@ function isSelfTarget(event) {
|
|
|
21
21
|
}
|
|
22
22
|
function isOpeningInNewTab(event) {
|
|
23
23
|
const element = event.currentTarget;
|
|
24
|
-
if (!element)
|
|
25
|
-
return false;
|
|
24
|
+
if (!element) return false;
|
|
26
25
|
const isAppleDevice = isApple();
|
|
27
|
-
if (isAppleDevice && !event.metaKey)
|
|
28
|
-
|
|
29
|
-
if (!isAppleDevice && !event.ctrlKey)
|
|
30
|
-
return false;
|
|
26
|
+
if (isAppleDevice && !event.metaKey) return false;
|
|
27
|
+
if (!isAppleDevice && !event.ctrlKey) return false;
|
|
31
28
|
const tagName = element.tagName.toLowerCase();
|
|
32
|
-
if (tagName === "a")
|
|
33
|
-
|
|
34
|
-
if (tagName === "
|
|
35
|
-
return true;
|
|
36
|
-
if (tagName === "input" && element.type === "submit")
|
|
37
|
-
return true;
|
|
29
|
+
if (tagName === "a") return true;
|
|
30
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
31
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
38
32
|
return false;
|
|
39
33
|
}
|
|
40
34
|
function isDownloading(event) {
|
|
41
35
|
const element = event.currentTarget;
|
|
42
|
-
if (!element)
|
|
43
|
-
return false;
|
|
36
|
+
if (!element) return false;
|
|
44
37
|
const tagName = element.tagName.toLowerCase();
|
|
45
|
-
if (!event.altKey)
|
|
46
|
-
|
|
47
|
-
if (tagName === "
|
|
48
|
-
|
|
49
|
-
if (tagName === "button" && element.type === "submit")
|
|
50
|
-
return true;
|
|
51
|
-
if (tagName === "input" && element.type === "submit")
|
|
52
|
-
return true;
|
|
38
|
+
if (!event.altKey) return false;
|
|
39
|
+
if (tagName === "a") return true;
|
|
40
|
+
if (tagName === "button" && element.type === "submit") return true;
|
|
41
|
+
if (tagName === "input" && element.type === "submit") return true;
|
|
53
42
|
return false;
|
|
54
43
|
}
|
|
55
44
|
function fireEvent(element, type, eventInit) {
|
|
@@ -85,12 +74,9 @@ function isFocusEventOutside(event, container) {
|
|
|
85
74
|
}
|
|
86
75
|
function getInputType(event) {
|
|
87
76
|
const nativeEvent = "nativeEvent" in event ? event.nativeEvent : event;
|
|
88
|
-
if (!nativeEvent)
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
return;
|
|
92
|
-
if (typeof nativeEvent.inputType !== "string")
|
|
93
|
-
return;
|
|
77
|
+
if (!nativeEvent) return;
|
|
78
|
+
if (!("inputType" in nativeEvent)) return;
|
|
79
|
+
if (typeof nativeEvent.inputType !== "string") return;
|
|
94
80
|
return nativeEvent.inputType;
|
|
95
81
|
}
|
|
96
82
|
function queueBeforeEvent(element, type, callback, timeout) {
|
|
@@ -127,7 +113,9 @@ function addGlobalEventListener(type, listener, options, scope = window) {
|
|
|
127
113
|
scope.document.removeEventListener(type, listener, options);
|
|
128
114
|
} catch (e) {
|
|
129
115
|
}
|
|
130
|
-
|
|
116
|
+
for (const remove of children) {
|
|
117
|
+
remove();
|
|
118
|
+
}
|
|
131
119
|
};
|
|
132
120
|
return removeEventListener;
|
|
133
121
|
}
|
package/esm/utils/focus.js
CHANGED
|
@@ -4,55 +4,39 @@ import {
|
|
|
4
4
|
getActiveElement,
|
|
5
5
|
isFrame,
|
|
6
6
|
isVisible
|
|
7
|
-
} from "../__chunks/
|
|
7
|
+
} from "../__chunks/HWOIWM4O.js";
|
|
8
8
|
import {
|
|
9
9
|
__spreadValues
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/3YLGPPWQ.js";
|
|
11
11
|
|
|
12
12
|
// src/utils/focus.ts
|
|
13
13
|
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
|
|
14
14
|
function hasNegativeTabIndex(element) {
|
|
15
|
-
const tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10);
|
|
15
|
+
const tabIndex = Number.parseInt(element.getAttribute("tabindex") || "0", 10);
|
|
16
16
|
return tabIndex < 0;
|
|
17
17
|
}
|
|
18
18
|
function isFocusable(element) {
|
|
19
|
-
if (!element.matches(selector))
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
return false;
|
|
23
|
-
if (element.closest("[inert]"))
|
|
24
|
-
return false;
|
|
19
|
+
if (!element.matches(selector)) return false;
|
|
20
|
+
if (!isVisible(element)) return false;
|
|
21
|
+
if (element.closest("[inert]")) return false;
|
|
25
22
|
return true;
|
|
26
23
|
}
|
|
27
24
|
function isTabbable(element) {
|
|
28
|
-
if (!isFocusable(element))
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
if (!element.form)
|
|
35
|
-
return true;
|
|
36
|
-
if (element.checked)
|
|
37
|
-
return true;
|
|
38
|
-
if (element.type !== "radio")
|
|
39
|
-
return true;
|
|
25
|
+
if (!isFocusable(element)) return false;
|
|
26
|
+
if (hasNegativeTabIndex(element)) return false;
|
|
27
|
+
if (!("form" in element)) return true;
|
|
28
|
+
if (!element.form) return true;
|
|
29
|
+
if (element.checked) return true;
|
|
30
|
+
if (element.type !== "radio") return true;
|
|
40
31
|
const radioGroup = element.form.elements.namedItem(element.name);
|
|
41
|
-
if (!radioGroup)
|
|
42
|
-
|
|
43
|
-
if (!("length" in radioGroup))
|
|
44
|
-
return true;
|
|
32
|
+
if (!radioGroup) return true;
|
|
33
|
+
if (!("length" in radioGroup)) return true;
|
|
45
34
|
const activeElement = getActiveElement(element);
|
|
46
|
-
if (!activeElement)
|
|
47
|
-
|
|
48
|
-
if (activeElement
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
return true;
|
|
52
|
-
if (activeElement.form !== element.form)
|
|
53
|
-
return true;
|
|
54
|
-
if (activeElement.name !== element.name)
|
|
55
|
-
return true;
|
|
35
|
+
if (!activeElement) return true;
|
|
36
|
+
if (activeElement === element) return true;
|
|
37
|
+
if (!("form" in activeElement)) return true;
|
|
38
|
+
if (activeElement.form !== element.form) return true;
|
|
39
|
+
if (activeElement.name !== element.name) return true;
|
|
56
40
|
return false;
|
|
57
41
|
}
|
|
58
42
|
function getAllFocusableIn(container, includeContainer) {
|
|
@@ -168,28 +152,20 @@ function getClosestFocusable(element) {
|
|
|
168
152
|
}
|
|
169
153
|
function hasFocus(element) {
|
|
170
154
|
const activeElement = getActiveElement(element);
|
|
171
|
-
if (!activeElement)
|
|
172
|
-
|
|
173
|
-
if (activeElement === element)
|
|
174
|
-
return true;
|
|
155
|
+
if (!activeElement) return false;
|
|
156
|
+
if (activeElement === element) return true;
|
|
175
157
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
176
|
-
if (!activeDescendant)
|
|
177
|
-
return false;
|
|
158
|
+
if (!activeDescendant) return false;
|
|
178
159
|
return activeDescendant === element.id;
|
|
179
160
|
}
|
|
180
161
|
function hasFocusWithin(element) {
|
|
181
162
|
const activeElement = getActiveElement(element);
|
|
182
|
-
if (!activeElement)
|
|
183
|
-
|
|
184
|
-
if (contains(element, activeElement))
|
|
185
|
-
return true;
|
|
163
|
+
if (!activeElement) return false;
|
|
164
|
+
if (contains(element, activeElement)) return true;
|
|
186
165
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
187
|
-
if (!activeDescendant)
|
|
188
|
-
|
|
189
|
-
if (
|
|
190
|
-
return false;
|
|
191
|
-
if (activeDescendant === element.id)
|
|
192
|
-
return true;
|
|
166
|
+
if (!activeDescendant) return false;
|
|
167
|
+
if (!("id" in element)) return false;
|
|
168
|
+
if (activeDescendant === element.id) return true;
|
|
193
169
|
return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
|
|
194
170
|
}
|
|
195
171
|
function focusIfNeeded(element) {
|
|
@@ -205,7 +181,9 @@ function disableFocus(element) {
|
|
|
205
181
|
}
|
|
206
182
|
function disableFocusIn(container, includeContainer) {
|
|
207
183
|
const tabbableElements = getAllTabbableIn(container, includeContainer);
|
|
208
|
-
tabbableElements
|
|
184
|
+
for (const element of tabbableElements) {
|
|
185
|
+
disableFocus(element);
|
|
186
|
+
}
|
|
209
187
|
}
|
|
210
188
|
function restoreFocusIn(container) {
|
|
211
189
|
const elements = container.querySelectorAll("[data-tabindex]");
|
|
@@ -221,7 +199,9 @@ function restoreFocusIn(container) {
|
|
|
221
199
|
if (container.hasAttribute("data-tabindex")) {
|
|
222
200
|
restoreTabIndex(container);
|
|
223
201
|
}
|
|
224
|
-
elements
|
|
202
|
+
for (const element of elements) {
|
|
203
|
+
restoreTabIndex(element);
|
|
204
|
+
}
|
|
225
205
|
}
|
|
226
206
|
function focusIntoView(element, options) {
|
|
227
207
|
if (!("scrollIntoView" in element)) {
|
package/esm/utils/misc.d.ts
CHANGED
|
@@ -99,7 +99,7 @@ export declare function invariant(condition: any, message?: string | boolean): a
|
|
|
99
99
|
/**
|
|
100
100
|
* Similar to `Object.keys` but returns a type-safe array of keys.
|
|
101
101
|
*/
|
|
102
|
-
export declare function getKeys<T extends object>(obj: T):
|
|
102
|
+
export declare function getKeys<T extends object>(obj: T): Array<keyof T>;
|
|
103
103
|
/**
|
|
104
104
|
* Checks whether a boolean event prop (e.g., hideOnInteractOutside) was
|
|
105
105
|
* intentionally set to false, either with a boolean value or a callback that
|
package/esm/utils/misc.js
CHANGED
package/esm/utils/platform.js
CHANGED
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
isMac,
|
|
6
6
|
isSafari,
|
|
7
7
|
isTouchDevice
|
|
8
|
-
} from "../__chunks/
|
|
9
|
-
import "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
8
|
+
} from "../__chunks/US4USQPI.js";
|
|
9
|
+
import "../__chunks/HWOIWM4O.js";
|
|
10
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
11
11
|
export {
|
|
12
12
|
isApple,
|
|
13
13
|
isFirefox,
|
package/esm/utils/store.js
CHANGED
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
subscribe,
|
|
11
11
|
sync,
|
|
12
12
|
throwOnConflictingProps
|
|
13
|
-
} from "../__chunks/
|
|
14
|
-
import "../__chunks/
|
|
15
|
-
import "../__chunks/
|
|
13
|
+
} from "../__chunks/EQQLU3CG.js";
|
|
14
|
+
import "../__chunks/PBFD2E7P.js";
|
|
15
|
+
import "../__chunks/3YLGPPWQ.js";
|
|
16
16
|
export {
|
|
17
17
|
batch,
|
|
18
18
|
createStore,
|
package/esm/utils/undo.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariakit/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "Ariakit core",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "https://github.com/diegohaz"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
-
"lint": "
|
|
23
|
+
"lint": "biome check .",
|
|
24
24
|
"build": "node ../../scripts/build/build.js",
|
|
25
25
|
"clean": "node ../../scripts/build/clean.js"
|
|
26
26
|
},
|
package/readme.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Ariakit Core
|
|
2
|
+
|
|
3
|
+
**Important:** This package is an internal dependency of Ariakit and does not follow semantic versioning, meaning breaking changes may occur in patch and minor versions. You probably want to use [`@ariakit/react`](https://npmjs.org/package/@ariakit/react) instead.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm i @ariakit/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Core Team
|
|
12
|
+
|
|
13
|
+
- [Diego Haz](https://x.com/diegohaz)
|
|
14
|
+
- [Ben Rodri](https://x.com/benrodrs)
|
|
15
|
+
|
|
16
|
+
## Contributing
|
|
17
|
+
|
|
18
|
+
Follow the instructions on the [contributing guide](https://github.com/ariakit/ariakit/blob/main/contributing.md).
|
package/.eslintignore
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _5JEQEZFRcjs = require('./5JEQEZFR.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
|
|
15
|
-
|
|
16
|
-
// src/hovercard/hovercard-store.ts
|
|
17
|
-
function createHovercardStore(props = {}) {
|
|
18
|
-
var _a;
|
|
19
|
-
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
20
|
-
const popover = _5JEQEZFRcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
|
|
21
|
-
placement: _EEDWPDM2cjs.defaultValue.call(void 0,
|
|
22
|
-
props.placement,
|
|
23
|
-
syncState == null ? void 0 : syncState.placement,
|
|
24
|
-
"bottom"
|
|
25
|
-
)
|
|
26
|
-
}));
|
|
27
|
-
const timeout = _EEDWPDM2cjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
|
|
28
|
-
const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
|
|
29
|
-
timeout,
|
|
30
|
-
showTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
|
|
31
|
-
hideTimeout: _EEDWPDM2cjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
|
|
32
|
-
autoFocusOnShow: _EEDWPDM2cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
|
|
33
|
-
});
|
|
34
|
-
const hovercard = _B4LYZ4EMcjs.createStore.call(void 0, initialState, popover, props.store);
|
|
35
|
-
return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
|
|
36
|
-
setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
exports.createHovercardStore = createHovercardStore;
|
|
File without changes
|
|
File without changes
|