@ariakit/core 0.3.10 → 0.4.0
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 +60 -0
- package/cjs/__chunks/{Y6PHIDP6.cjs → 5JEQEZFR.cjs} +12 -12
- package/cjs/__chunks/{YIUPKKEK.cjs → 7DU6YMLQ.cjs} +6 -6
- package/cjs/__chunks/{MWNFQD55.cjs → AETQC2AR.cjs} +17 -16
- package/cjs/__chunks/{5CBCKBZ2.cjs → B4LYZ4EM.cjs} +12 -12
- package/cjs/__chunks/{3UT5FE6K.cjs → EEDWPDM2.cjs} +14 -1
- package/cjs/__chunks/{YLMJBIQM.cjs → FFZYCAXA.cjs} +24 -15
- package/cjs/__chunks/{MFSCSSBJ.cjs → LTLFSC4X.cjs} +2 -2
- package/cjs/__chunks/{CWDUO5EV.cjs → SU2BSHGB.cjs} +7 -7
- package/cjs/__chunks/{HMO4CKUP.cjs → UEZLSKZ4.cjs} +10 -10
- package/cjs/__chunks/{5F4DVUNS.cjs → UKR6TQI3.cjs} +1 -2
- package/cjs/__chunks/{ZXCB7MXN.cjs → Y7KNI5NS.cjs} +17 -17
- package/cjs/checkbox/checkbox-store.cjs +5 -5
- package/cjs/collection/collection-store.cjs +5 -5
- package/cjs/combobox/combobox-store.cjs +35 -35
- package/cjs/composite/composite-overflow-store.cjs +6 -6
- package/cjs/composite/composite-store.cjs +6 -6
- package/cjs/dialog/dialog-store.cjs +5 -5
- package/cjs/disclosure/disclosure-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.d.cts +6 -2
- package/cjs/disclosure/disclosure-store.d.ts +6 -2
- package/cjs/form/form-store.cjs +24 -24
- package/cjs/form/form-store.d.cts +1 -1
- package/cjs/form/form-store.d.ts +1 -1
- package/cjs/hovercard/hovercard-store.cjs +7 -7
- package/cjs/hovercard/hovercard-store.d.cts +14 -7
- package/cjs/hovercard/hovercard-store.d.ts +14 -7
- package/cjs/menu/menu-bar-store.cjs +7 -7
- package/cjs/menu/menu-store.cjs +27 -27
- package/cjs/menu/menu-store.d.cts +16 -7
- package/cjs/menu/menu-store.d.ts +16 -7
- package/cjs/menubar/menubar-store.cjs +7 -7
- package/cjs/popover/popover-store.cjs +6 -6
- package/cjs/popover/popover-store.d.cts +31 -6
- package/cjs/popover/popover-store.d.ts +31 -6
- package/cjs/radio/radio-store.cjs +9 -9
- package/cjs/radio/radio-store.d.cts +2 -1
- package/cjs/radio/radio-store.d.ts +2 -1
- package/cjs/select/select-store.cjs +29 -29
- package/cjs/select/select-store.d.cts +2 -1
- package/cjs/select/select-store.d.ts +2 -1
- package/cjs/tab/tab-store.cjs +21 -21
- package/cjs/tab/tab-store.d.cts +5 -11
- package/cjs/tab/tab-store.d.ts +5 -11
- package/cjs/toolbar/toolbar-store.cjs +8 -8
- package/cjs/toolbar/toolbar-store.d.cts +2 -6
- package/cjs/toolbar/toolbar-store.d.ts +2 -6
- package/cjs/tooltip/tooltip-store.cjs +21 -12
- package/cjs/tooltip/tooltip-store.d.cts +6 -4
- package/cjs/tooltip/tooltip-store.d.ts +6 -4
- package/cjs/utils/dom.cjs +2 -2
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +13 -13
- package/cjs/utils/misc.cjs +4 -2
- package/cjs/utils/misc.d.cts +4 -0
- package/cjs/utils/misc.d.ts +4 -0
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +3 -3
- package/esm/__chunks/{I2VQ3XGR.js → 22HHDS5F.js} +13 -0
- package/esm/__chunks/{VEUNYQYR.js → 2H5K47H4.js} +3 -3
- package/esm/__chunks/{25MEC56I.js → 5RJNXXU2.js} +1 -1
- package/esm/__chunks/{QJ5CUA32.js → BRS7GKWU.js} +3 -3
- package/esm/__chunks/{AKMSZ36N.js → MFZZDIHG.js} +3 -3
- package/esm/__chunks/{UUFF4PQ6.js → PXYVPXSS.js} +3 -3
- package/esm/__chunks/{K6ELJFXN.js → R676XYVY.js} +1 -1
- package/esm/__chunks/{DLOEKDPY.js → RRSZHCH6.js} +1 -2
- package/esm/__chunks/{MYUKSFP5.js → URUD7X4C.js} +14 -5
- package/esm/__chunks/{MHPO2BXA.js → VDNATJW2.js} +1 -1
- package/esm/__chunks/{L5RYKTVQ.js → WCKXDMU7.js} +3 -2
- package/esm/checkbox/checkbox-store.js +2 -2
- package/esm/collection/collection-store.js +4 -4
- package/esm/combobox/combobox-store.js +9 -9
- package/esm/composite/composite-overflow-store.js +5 -5
- package/esm/composite/composite-store.js +5 -5
- package/esm/dialog/dialog-store.js +4 -4
- package/esm/disclosure/disclosure-store.d.ts +6 -2
- package/esm/disclosure/disclosure-store.js +3 -3
- package/esm/form/form-store.d.ts +1 -1
- package/esm/form/form-store.js +4 -4
- package/esm/hovercard/hovercard-store.d.ts +14 -7
- package/esm/hovercard/hovercard-store.js +6 -6
- package/esm/menu/menu-bar-store.js +6 -6
- package/esm/menu/menu-store.d.ts +16 -7
- package/esm/menu/menu-store.js +9 -9
- package/esm/menubar/menubar-store.js +6 -6
- package/esm/popover/popover-store.d.ts +31 -6
- package/esm/popover/popover-store.js +5 -5
- package/esm/radio/radio-store.d.ts +2 -1
- package/esm/radio/radio-store.js +5 -5
- package/esm/select/select-store.d.ts +2 -1
- package/esm/select/select-store.js +8 -8
- package/esm/tab/tab-store.d.ts +5 -11
- package/esm/tab/tab-store.js +5 -5
- package/esm/toolbar/toolbar-store.d.ts +2 -6
- package/esm/toolbar/toolbar-store.js +5 -5
- package/esm/tooltip/tooltip-store.d.ts +6 -4
- package/esm/tooltip/tooltip-store.js +15 -6
- package/esm/utils/dom.js +1 -1
- package/esm/utils/events.js +2 -2
- package/esm/utils/focus.js +1 -1
- package/esm/utils/misc.d.ts +4 -0
- package/esm/utils/misc.js +3 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.js +2 -2
- package/package.json +1 -1
package/cjs/utils/focus.cjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _UKR6TQI3cjs = require('../__chunks/UKR6TQI3.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
|
|
@@ -18,11 +18,11 @@ function hasNegativeTabIndex(element) {
|
|
|
18
18
|
return tabIndex < 0;
|
|
19
19
|
}
|
|
20
20
|
function isFocusable(element) {
|
|
21
|
-
if (!
|
|
21
|
+
if (!_UKR6TQI3cjs.matches.call(void 0, element, selector))
|
|
22
22
|
return false;
|
|
23
|
-
if (!
|
|
23
|
+
if (!_UKR6TQI3cjs.isVisible.call(void 0, element))
|
|
24
24
|
return false;
|
|
25
|
-
if (
|
|
25
|
+
if (_UKR6TQI3cjs.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 = _UKR6TQI3cjs.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 (_UKR6TQI3cjs.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 (_UKR6TQI3cjs.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 = _UKR6TQI3cjs.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 = _UKR6TQI3cjs.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 = _UKR6TQI3cjs.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 = _UKR6TQI3cjs.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 = _UKR6TQI3cjs.getActiveElement.call(void 0, element);
|
|
184
184
|
if (!activeElement)
|
|
185
185
|
return false;
|
|
186
|
-
if (
|
|
186
|
+
if (_UKR6TQI3cjs.contains.call(void 0, element, activeElement))
|
|
187
187
|
return true;
|
|
188
188
|
const activeDescendant = activeElement.getAttribute("aria-activedescendant");
|
|
189
189
|
if (!activeDescendant)
|
package/cjs/utils/misc.cjs
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
|
|
24
25
|
require('../__chunks/AV6KTKLE.cjs');
|
|
25
26
|
|
|
26
27
|
|
|
@@ -43,4 +44,5 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
exports.afterPaint = _EEDWPDM2cjs.afterPaint; exports.applyState = _EEDWPDM2cjs.applyState; exports.beforePaint = _EEDWPDM2cjs.beforePaint; exports.chain = _EEDWPDM2cjs.chain; exports.cx = _EEDWPDM2cjs.cx; exports.defaultValue = _EEDWPDM2cjs.defaultValue; exports.disabledFromProps = _EEDWPDM2cjs.disabledFromProps; exports.getKeys = _EEDWPDM2cjs.getKeys; exports.hasOwnProperty = _EEDWPDM2cjs.hasOwnProperty; exports.identity = _EEDWPDM2cjs.identity; exports.invariant = _EEDWPDM2cjs.invariant; exports.isEmpty = _EEDWPDM2cjs.isEmpty; exports.isFalsyBooleanCallback = _EEDWPDM2cjs.isFalsyBooleanCallback; exports.isInteger = _EEDWPDM2cjs.isInteger; exports.isObject = _EEDWPDM2cjs.isObject; exports.noop = _EEDWPDM2cjs.noop; exports.normalizeString = _EEDWPDM2cjs.normalizeString; exports.omit = _EEDWPDM2cjs.omit; exports.pick = _EEDWPDM2cjs.pick; exports.removeUndefinedValues = _EEDWPDM2cjs.removeUndefinedValues; exports.shallowEqual = _EEDWPDM2cjs.shallowEqual;
|
package/cjs/utils/misc.d.cts
CHANGED
|
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
|
|
|
113
113
|
disabled?: boolean;
|
|
114
114
|
"aria-disabled"?: boolean | "true" | "false";
|
|
115
115
|
}): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Removes undefined values from an object.
|
|
118
|
+
*/
|
|
119
|
+
export declare function removeUndefinedValues<T extends AnyObject>(obj: T): T;
|
|
116
120
|
/**
|
|
117
121
|
* Returns the first value that is not `undefined`.
|
|
118
122
|
*/
|
package/cjs/utils/misc.d.ts
CHANGED
|
@@ -113,6 +113,10 @@ export declare function disabledFromProps(props: {
|
|
|
113
113
|
disabled?: boolean;
|
|
114
114
|
"aria-disabled"?: boolean | "true" | "false";
|
|
115
115
|
}): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Removes undefined values from an object.
|
|
118
|
+
*/
|
|
119
|
+
export declare function removeUndefinedValues<T extends AnyObject>(obj: T): T;
|
|
116
120
|
/**
|
|
117
121
|
* Returns the first value that is not `undefined`.
|
|
118
122
|
*/
|
package/cjs/utils/platform.cjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('../__chunks/
|
|
8
|
+
var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
|
|
9
|
+
require('../__chunks/UKR6TQI3.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
@@ -14,4 +14,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.isApple =
|
|
17
|
+
exports.isApple = _7DU6YMLQcjs.isApple; exports.isFirefox = _7DU6YMLQcjs.isFirefox; exports.isMac = _7DU6YMLQcjs.isMac; exports.isSafari = _7DU6YMLQcjs.isSafari; exports.isTouchDevice = _7DU6YMLQcjs.isTouchDevice;
|
package/cjs/utils/store.cjs
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
require('../__chunks/
|
|
13
|
+
var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
|
|
14
|
+
require('../__chunks/EEDWPDM2.cjs');
|
|
15
15
|
require('../__chunks/AV6KTKLE.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
@@ -24,4 +24,4 @@ require('../__chunks/AV6KTKLE.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.batch =
|
|
27
|
+
exports.batch = _B4LYZ4EMcjs.batch; exports.createStore = _B4LYZ4EMcjs.createStore; exports.init = _B4LYZ4EMcjs.init; exports.mergeStore = _B4LYZ4EMcjs.mergeStore; exports.omit = _B4LYZ4EMcjs.omit; exports.pick = _B4LYZ4EMcjs.pick; exports.setup = _B4LYZ4EMcjs.setup; exports.subscribe = _B4LYZ4EMcjs.subscribe; exports.sync = _B4LYZ4EMcjs.sync; exports.throwOnConflictingProps = _B4LYZ4EMcjs.throwOnConflictingProps;
|
|
@@ -63,6 +63,9 @@ function isInteger(arg) {
|
|
|
63
63
|
return String(Math.floor(Number(arg))) === arg;
|
|
64
64
|
}
|
|
65
65
|
function hasOwnProperty(object, prop) {
|
|
66
|
+
if (typeof Object.hasOwn === "function") {
|
|
67
|
+
return Object.hasOwn(object, prop);
|
|
68
|
+
}
|
|
66
69
|
return Object.prototype.hasOwnProperty.call(object, prop);
|
|
67
70
|
}
|
|
68
71
|
function chain(...fns) {
|
|
@@ -130,6 +133,15 @@ function isFalsyBooleanCallback(booleanOrCallback, ...args) {
|
|
|
130
133
|
function disabledFromProps(props) {
|
|
131
134
|
return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
|
|
132
135
|
}
|
|
136
|
+
function removeUndefinedValues(obj) {
|
|
137
|
+
const result = {};
|
|
138
|
+
for (const key in obj) {
|
|
139
|
+
if (obj[key] !== void 0) {
|
|
140
|
+
result[key] = obj[key];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
133
145
|
function defaultValue(...values) {
|
|
134
146
|
for (const value of values) {
|
|
135
147
|
if (value !== void 0)
|
|
@@ -158,5 +170,6 @@ export {
|
|
|
158
170
|
getKeys,
|
|
159
171
|
isFalsyBooleanCallback,
|
|
160
172
|
disabledFromProps,
|
|
173
|
+
removeUndefinedValues,
|
|
161
174
|
defaultValue
|
|
162
175
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./URUD7X4C.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
setup,
|
|
8
8
|
sync
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./R676XYVY.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./22HHDS5F.js";
|
|
13
13
|
import {
|
|
14
14
|
flatten2DArray,
|
|
15
15
|
reverseArray
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./MFZZDIHG.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./R676XYVY.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./22HHDS5F.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./5RJNXXU2.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
mergeStore,
|
|
8
8
|
omit,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./R676XYVY.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./22HHDS5F.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./2H5K47H4.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./R676XYVY.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultValue
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./22HHDS5F.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadProps,
|
|
13
13
|
__spreadValues
|
|
@@ -102,8 +102,7 @@ function getPopupItemRole(element, fallback) {
|
|
|
102
102
|
const itemRoleByPopupRole = {
|
|
103
103
|
menu: "menuitem",
|
|
104
104
|
listbox: "option",
|
|
105
|
-
tree: "treeitem"
|
|
106
|
-
grid: "gridcell"
|
|
105
|
+
tree: "treeitem"
|
|
107
106
|
};
|
|
108
107
|
const popupRole = getPopupRole(element);
|
|
109
108
|
if (!popupRole)
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
init,
|
|
6
6
|
setup,
|
|
7
7
|
throwOnConflictingProps
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./R676XYVY.js";
|
|
9
9
|
import {
|
|
10
10
|
chain,
|
|
11
11
|
defaultValue
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./22HHDS5F.js";
|
|
13
13
|
import {
|
|
14
14
|
getDocument
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./RRSZHCH6.js";
|
|
16
16
|
import {
|
|
17
17
|
__spreadProps,
|
|
18
18
|
__spreadValues
|
|
@@ -84,7 +84,7 @@ function createCollectionStore(props = {}) {
|
|
|
84
84
|
};
|
|
85
85
|
const syncPrivateStore = getPrivateStore(props.store);
|
|
86
86
|
const privateStore = createStore(
|
|
87
|
-
{ renderedItems: initialState.renderedItems },
|
|
87
|
+
{ items, renderedItems: initialState.renderedItems },
|
|
88
88
|
syncPrivateStore
|
|
89
89
|
);
|
|
90
90
|
const collection = createStore(initialState, props.store);
|
|
@@ -94,6 +94,11 @@ function createCollectionStore(props = {}) {
|
|
|
94
94
|
collection.setState("renderedItems", sortedItems);
|
|
95
95
|
};
|
|
96
96
|
setup(collection, () => init(privateStore));
|
|
97
|
+
setup(privateStore, () => {
|
|
98
|
+
return batch(privateStore, ["items"], (state) => {
|
|
99
|
+
collection.setState("items", state.items);
|
|
100
|
+
});
|
|
101
|
+
});
|
|
97
102
|
setup(privateStore, () => {
|
|
98
103
|
return batch(privateStore, ["renderedItems"], (state) => {
|
|
99
104
|
let firstRun = true;
|
|
@@ -162,7 +167,11 @@ function createCollectionStore(props = {}) {
|
|
|
162
167
|
};
|
|
163
168
|
return unmergeItem;
|
|
164
169
|
};
|
|
165
|
-
const registerItem = (item) => mergeItem(
|
|
170
|
+
const registerItem = (item) => mergeItem(
|
|
171
|
+
item,
|
|
172
|
+
(getItems) => privateStore.setState("items", getItems),
|
|
173
|
+
true
|
|
174
|
+
);
|
|
166
175
|
return __spreadProps(__spreadValues({}, collection), {
|
|
167
176
|
registerItem,
|
|
168
177
|
renderItem: (item) => chain(
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
subscribe,
|
|
8
8
|
sync,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./R676XYVY.js";
|
|
11
11
|
import {
|
|
12
12
|
defaultValue
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./22HHDS5F.js";
|
|
14
14
|
import {
|
|
15
15
|
__spreadProps,
|
|
16
16
|
__spreadValues
|
|
@@ -63,6 +63,7 @@ function createDisclosureStore(props = {}) {
|
|
|
63
63
|
})
|
|
64
64
|
);
|
|
65
65
|
return __spreadProps(__spreadValues({}, disclosure), {
|
|
66
|
+
disclosure: props.disclosure,
|
|
66
67
|
setOpen: (value) => disclosure.setState("open", value),
|
|
67
68
|
show: () => disclosure.setState("open", true),
|
|
68
69
|
hide: () => disclosure.setState("open", false),
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createStore,
|
|
4
4
|
throwOnConflictingProps
|
|
5
|
-
} from "../__chunks/
|
|
5
|
+
} from "../__chunks/R676XYVY.js";
|
|
6
6
|
import {
|
|
7
7
|
defaultValue
|
|
8
|
-
} from "../__chunks/
|
|
8
|
+
} from "../__chunks/22HHDS5F.js";
|
|
9
9
|
import {
|
|
10
10
|
__spreadProps,
|
|
11
11
|
__spreadValues
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/URUD7X4C.js";
|
|
5
|
+
import "../__chunks/R676XYVY.js";
|
|
6
|
+
import "../__chunks/22HHDS5F.js";
|
|
7
|
+
import "../__chunks/RRSZHCH6.js";
|
|
8
8
|
import "../__chunks/4R3V3JGP.js";
|
|
9
9
|
export {
|
|
10
10
|
createCollectionStore
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/MFZZDIHG.js";
|
|
5
|
+
import "../__chunks/5RJNXXU2.js";
|
|
6
|
+
import "../__chunks/WCKXDMU7.js";
|
|
7
7
|
import {
|
|
8
8
|
createCompositeStore
|
|
9
|
-
} from "../__chunks/
|
|
10
|
-
import "../__chunks/
|
|
9
|
+
} from "../__chunks/2H5K47H4.js";
|
|
10
|
+
import "../__chunks/URUD7X4C.js";
|
|
11
11
|
import {
|
|
12
12
|
batch,
|
|
13
13
|
createStore,
|
|
14
14
|
setup,
|
|
15
15
|
sync,
|
|
16
16
|
throwOnConflictingProps
|
|
17
|
-
} from "../__chunks/
|
|
17
|
+
} from "../__chunks/R676XYVY.js";
|
|
18
18
|
import {
|
|
19
19
|
defaultValue
|
|
20
|
-
} from "../__chunks/
|
|
20
|
+
} from "../__chunks/22HHDS5F.js";
|
|
21
21
|
import {
|
|
22
22
|
isSafari,
|
|
23
23
|
isTouchDevice
|
|
24
|
-
} from "../__chunks/
|
|
25
|
-
import "../__chunks/
|
|
24
|
+
} from "../__chunks/VDNATJW2.js";
|
|
25
|
+
import "../__chunks/RRSZHCH6.js";
|
|
26
26
|
import "../__chunks/7PRQYBBV.js";
|
|
27
27
|
import {
|
|
28
28
|
__spreadProps,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/MFZZDIHG.js";
|
|
5
|
+
import "../__chunks/5RJNXXU2.js";
|
|
6
|
+
import "../__chunks/WCKXDMU7.js";
|
|
7
|
+
import "../__chunks/R676XYVY.js";
|
|
8
|
+
import "../__chunks/22HHDS5F.js";
|
|
9
9
|
import "../__chunks/4R3V3JGP.js";
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/2H5K47H4.js";
|
|
5
|
+
import "../__chunks/URUD7X4C.js";
|
|
6
|
+
import "../__chunks/R676XYVY.js";
|
|
7
|
+
import "../__chunks/22HHDS5F.js";
|
|
8
|
+
import "../__chunks/RRSZHCH6.js";
|
|
9
9
|
import "../__chunks/7PRQYBBV.js";
|
|
10
10
|
import "../__chunks/4R3V3JGP.js";
|
|
11
11
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/5RJNXXU2.js";
|
|
5
|
+
import "../__chunks/WCKXDMU7.js";
|
|
6
|
+
import "../__chunks/R676XYVY.js";
|
|
7
|
+
import "../__chunks/22HHDS5F.js";
|
|
8
8
|
import "../__chunks/4R3V3JGP.js";
|
|
9
9
|
export {
|
|
10
10
|
createDialogStore
|
|
@@ -38,7 +38,6 @@ export interface DisclosureStoreState {
|
|
|
38
38
|
* - If it's set to a number, the `animating` state will be `true` when the
|
|
39
39
|
* content is shown or hidden and it will wait for the number of
|
|
40
40
|
* milliseconds to pass before becoming `false`.
|
|
41
|
-
* @default false
|
|
42
41
|
*/
|
|
43
42
|
animated: boolean | number;
|
|
44
43
|
/**
|
|
@@ -54,7 +53,7 @@ export interface DisclosureStoreState {
|
|
|
54
53
|
*/
|
|
55
54
|
disclosureElement: HTMLElement | null;
|
|
56
55
|
}
|
|
57
|
-
export interface DisclosureStoreFunctions {
|
|
56
|
+
export interface DisclosureStoreFunctions extends Pick<DisclosureStoreOptions, "disclosure"> {
|
|
58
57
|
/**
|
|
59
58
|
* Sets the [`open`](https://ariakit.org/reference/disclosure-provider#open)
|
|
60
59
|
* state.
|
|
@@ -115,6 +114,11 @@ export interface DisclosureStoreFunctions {
|
|
|
115
114
|
setDisclosureElement: SetState<DisclosureStoreState["disclosureElement"]>;
|
|
116
115
|
}
|
|
117
116
|
export interface DisclosureStoreOptions extends StoreOptions<DisclosureStoreState, "open" | "animated"> {
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Manually setting the `animated` prop is no longer necessary.
|
|
119
|
+
* This will be removed in a future release.
|
|
120
|
+
*/
|
|
121
|
+
animated?: DisclosureStoreState["animated"];
|
|
118
122
|
/**
|
|
119
123
|
* Whether the content should be visible by default.
|
|
120
124
|
* @default false
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDisclosureStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/WCKXDMU7.js";
|
|
5
|
+
import "../__chunks/R676XYVY.js";
|
|
6
|
+
import "../__chunks/22HHDS5F.js";
|
|
7
7
|
import "../__chunks/4R3V3JGP.js";
|
|
8
8
|
export {
|
|
9
9
|
createDisclosureStore
|
package/esm/form/form-store.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface FormStoreState<T extends FormStoreValues = FormStoreValues> ext
|
|
|
61
61
|
}
|
|
62
62
|
export interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues> extends CollectionStoreFunctions<FormStoreItem> {
|
|
63
63
|
/**
|
|
64
|
-
* An object containing the names of the form fields for type
|
|
64
|
+
* An object containing the names of the form fields for type safety.
|
|
65
65
|
*
|
|
66
66
|
* Live examples:
|
|
67
67
|
* - [FormRadio](https://ariakit.org/examples/form-radio)
|
package/esm/form/form-store.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/URUD7X4C.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
init,
|
|
8
8
|
setup,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/R676XYVY.js";
|
|
11
11
|
import {
|
|
12
12
|
applyState,
|
|
13
13
|
defaultValue,
|
|
14
14
|
isInteger,
|
|
15
15
|
isObject
|
|
16
|
-
} from "../__chunks/
|
|
17
|
-
import "../__chunks/
|
|
16
|
+
} from "../__chunks/22HHDS5F.js";
|
|
17
|
+
import "../__chunks/RRSZHCH6.js";
|
|
18
18
|
import {
|
|
19
19
|
__spreadProps,
|
|
20
20
|
__spreadValues
|
|
@@ -12,14 +12,16 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
12
12
|
placement: PopoverStoreState["placement"];
|
|
13
13
|
/**
|
|
14
14
|
* The amount of time in milliseconds to wait before showing and hiding the
|
|
15
|
-
*
|
|
16
|
-
* `showTimeout`
|
|
15
|
+
* popup. To control the delay for showing and hiding separately, use
|
|
16
|
+
* [`showTimeout`](https://ariakit.org/reference/hovercard-provider#showtimeout)
|
|
17
|
+
* and
|
|
18
|
+
* [`hideTimeout`](https://ariakit.org/reference/hovercard-provider#hidetimeout).
|
|
17
19
|
* @default 500
|
|
18
20
|
*/
|
|
19
21
|
timeout: number;
|
|
20
22
|
/**
|
|
21
|
-
* The amount of time in milliseconds to wait before
|
|
22
|
-
*
|
|
23
|
+
* The amount of time in milliseconds to wait before _showing_ the popup. It
|
|
24
|
+
* defaults to the value passed to
|
|
23
25
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
24
26
|
*
|
|
25
27
|
* Live examples:
|
|
@@ -29,16 +31,18 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
29
31
|
*/
|
|
30
32
|
showTimeout?: number;
|
|
31
33
|
/**
|
|
32
|
-
* The amount of time in milliseconds to wait before
|
|
33
|
-
*
|
|
34
|
+
* The amount of time in milliseconds to wait before _hiding_ the popup. It
|
|
35
|
+
* defaults to the value passed to
|
|
34
36
|
* [`timeout`](https://ariakit.org/reference/hovercard-provider#timeout).
|
|
35
37
|
*
|
|
36
38
|
* Live examples:
|
|
37
39
|
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
40
|
+
* - [Tooltip with Framer
|
|
41
|
+
* Motion](https://ariakit.org/examples/tooltip-framer-motion)
|
|
38
42
|
*/
|
|
39
43
|
hideTimeout?: number;
|
|
40
44
|
/**
|
|
41
|
-
* Whether the
|
|
45
|
+
* Whether the popup or an element inside it should be focused when it is
|
|
42
46
|
* shown.
|
|
43
47
|
* @default false
|
|
44
48
|
*/
|
|
@@ -47,6 +51,9 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
47
51
|
export interface HovercardStoreFunctions extends PopoverStoreFunctions {
|
|
48
52
|
/**
|
|
49
53
|
* Sets the `autoFocusOnShow` state.
|
|
54
|
+
*
|
|
55
|
+
* Live examples:
|
|
56
|
+
* - [Sliding Menu](https://ariakit.org/examples/menu-slide)
|
|
50
57
|
*/
|
|
51
58
|
setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
|
|
52
59
|
}
|