@ariakit/core 0.4.3 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/cjs/__chunks/{7DU6YMLQ.cjs → 2D5LEVE7.cjs} +6 -6
  3. package/cjs/__chunks/{UKR6TQI3.cjs → IMYW2UAC.cjs} +36 -20
  4. package/cjs/__chunks/{Y7KNI5NS.cjs → KL74MAHB.cjs} +5 -5
  5. package/cjs/__chunks/LPDHSEHU.cjs +71 -0
  6. package/cjs/__chunks/{SU2BSHGB.cjs → MHZQJPY3.cjs} +2 -2
  7. package/cjs/__chunks/{FFZYCAXA.cjs → QD2A4YF6.cjs} +2 -2
  8. package/cjs/collection/collection-store.cjs +3 -3
  9. package/cjs/combobox/combobox-store.cjs +39 -21
  10. package/cjs/combobox/combobox-store.d.cts +16 -5
  11. package/cjs/combobox/combobox-store.d.ts +16 -5
  12. package/cjs/composite/composite-store.cjs +5 -5
  13. package/cjs/form/form-store.cjs +3 -3
  14. package/cjs/menu/menu-bar-store.cjs +6 -6
  15. package/cjs/menu/menu-store.cjs +7 -7
  16. package/cjs/menubar/menubar-store.cjs +6 -6
  17. package/cjs/radio/radio-store.cjs +5 -5
  18. package/cjs/select/select-store.cjs +9 -9
  19. package/cjs/tab/tab-store.cjs +6 -6
  20. package/cjs/tag/tag-store.cjs +90 -0
  21. package/cjs/tag/tag-store.d.cts +80 -0
  22. package/cjs/tag/tag-store.d.ts +80 -0
  23. package/cjs/toolbar/toolbar-store.cjs +5 -5
  24. package/cjs/utils/dom.cjs +6 -2
  25. package/cjs/utils/dom.d.cts +14 -5
  26. package/cjs/utils/dom.d.ts +14 -5
  27. package/cjs/utils/events.cjs +17 -6
  28. package/cjs/utils/events.d.cts +6 -0
  29. package/cjs/utils/events.d.ts +6 -0
  30. package/cjs/utils/focus.cjs +13 -13
  31. package/cjs/utils/platform.cjs +3 -3
  32. package/cjs/utils/undo.cjs +10 -0
  33. package/cjs/utils/undo.d.cts +19 -0
  34. package/cjs/utils/undo.d.ts +19 -0
  35. package/esm/__chunks/{URUD7X4C.js → ABMC67JW.js} +1 -1
  36. package/esm/__chunks/EKIWAN6A.js +71 -0
  37. package/esm/__chunks/{RRSZHCH6.js → IUORCTET.js} +36 -20
  38. package/esm/__chunks/{PXYVPXSS.js → K7A7LTR3.js} +1 -1
  39. package/esm/__chunks/{VDNATJW2.js → QAI5BPCY.js} +1 -1
  40. package/esm/__chunks/{2H5K47H4.js → YVUNPQHS.js} +5 -5
  41. package/esm/collection/collection-store.js +2 -2
  42. package/esm/combobox/combobox-store.d.ts +16 -5
  43. package/esm/combobox/combobox-store.js +42 -24
  44. package/esm/composite/composite-store.js +4 -4
  45. package/esm/form/form-store.js +2 -2
  46. package/esm/menu/menu-bar-store.js +5 -5
  47. package/esm/menu/menu-store.js +6 -6
  48. package/esm/menubar/menubar-store.js +5 -5
  49. package/esm/radio/radio-store.js +4 -4
  50. package/esm/select/select-store.js +8 -8
  51. package/esm/tab/tab-store.js +4 -4
  52. package/esm/tag/tag-store.d.ts +80 -0
  53. package/esm/tag/tag-store.js +90 -0
  54. package/esm/toolbar/toolbar-store.js +4 -4
  55. package/esm/utils/dom.d.ts +14 -5
  56. package/esm/utils/dom.js +5 -1
  57. package/esm/utils/events.d.ts +6 -0
  58. package/esm/utils/events.js +13 -2
  59. package/esm/utils/focus.js +1 -1
  60. package/esm/utils/platform.js +2 -2
  61. package/esm/utils/undo.d.ts +19 -0
  62. package/esm/utils/undo.js +10 -0
  63. package/package.json +15 -1
  64. package/tag/tag-store/package.json +8 -0
  65. package/utils/undo/package.json +8 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.5
4
+
5
+ - Added new `undo` utils.
6
+ - Added new experimental Tag components.
7
+ - Added DOM utils: `isTextbox`, `getTextboxValue`.
8
+ - Added event function: `getInputType`.
9
+ - Added new [`resetValue`](https://ariakit.org/reference/use-combobox-store#resetvalue) method to combobox store.
10
+ - Improved JSDocs.
11
+
12
+ ## 0.4.4
13
+
14
+ ### Combobox `autoFocusOnHide` behavior
15
+
16
+ Previously, the [`autoFocusOnHide`](https://ariakit.org/reference/combobox-popover#autofocusonhide) feature on [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover) was turned off by default. Most of the time, this didn't have any practical impact because the combobox input element was already focused when the popover was hidden.
17
+
18
+ Now, this feature is enabled by default and should work consistently even when [`virtualFocus`](https://ariakit.org/reference/combobox-provider#virtualfocus) is set to `false`.
19
+
20
+ ### Other updates
21
+
22
+ - Improved JSDocs.
23
+
3
24
  ## 0.4.3
4
25
 
5
26
  - Fixed regression in `v0.4.2` that caused nested tabs to stop working.
@@ -1,25 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _UKR6TQI3cjs = require('./UKR6TQI3.cjs');
4
+ var _IMYW2UACcjs = require('./IMYW2UAC.cjs');
5
5
 
6
6
  // src/utils/platform.ts
7
7
  function isTouchDevice() {
8
- return _UKR6TQI3cjs.canUseDOM && !!navigator.maxTouchPoints;
8
+ return _IMYW2UACcjs.canUseDOM && !!navigator.maxTouchPoints;
9
9
  }
10
10
  function isApple() {
11
- if (!_UKR6TQI3cjs.canUseDOM)
11
+ if (!_IMYW2UACcjs.canUseDOM)
12
12
  return false;
13
13
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
14
14
  }
15
15
  function isSafari() {
16
- return _UKR6TQI3cjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
16
+ return _IMYW2UACcjs.canUseDOM && isApple() && /apple/i.test(navigator.vendor);
17
17
  }
18
18
  function isFirefox() {
19
- return _UKR6TQI3cjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
19
+ return _IMYW2UACcjs.canUseDOM && /firefox\//i.test(navigator.userAgent);
20
20
  }
21
21
  function isMac() {
22
- return _UKR6TQI3cjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
22
+ return _IMYW2UACcjs.canUseDOM && navigator.platform.startsWith("Mac") && !isTouchDevice();
23
23
  }
24
24
 
25
25
 
@@ -89,26 +89,19 @@ function isTextField(element) {
89
89
  return false;
90
90
  }
91
91
  }
92
- function getPopupRole(element, fallback) {
93
- const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
94
- const role = element == null ? void 0 : element.getAttribute("role");
95
- if (role && allowedPopupRoles.indexOf(role) !== -1) {
96
- return role;
97
- }
98
- return fallback;
92
+ function isTextbox(element) {
93
+ return element.isContentEditable || isTextField(element);
99
94
  }
100
- function getPopupItemRole(element, fallback) {
101
- var _a;
102
- const itemRoleByPopupRole = {
103
- menu: "menuitem",
104
- listbox: "option",
105
- tree: "treeitem"
106
- };
107
- const popupRole = getPopupRole(element);
108
- if (!popupRole)
109
- return fallback;
110
- const key = popupRole;
111
- return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
95
+ function getTextboxValue(element) {
96
+ if (isTextField(element)) {
97
+ return element.value;
98
+ }
99
+ if (element.isContentEditable) {
100
+ const range = getDocument(element).createRange();
101
+ range.selectNodeContents(element);
102
+ return range.toString();
103
+ }
104
+ return "";
112
105
  }
113
106
  function getTextboxSelection(element) {
114
107
  let start = 0;
@@ -130,6 +123,27 @@ function getTextboxSelection(element) {
130
123
  }
131
124
  return { start, end };
132
125
  }
126
+ function getPopupRole(element, fallback) {
127
+ const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
128
+ const role = element == null ? void 0 : element.getAttribute("role");
129
+ if (role && allowedPopupRoles.indexOf(role) !== -1) {
130
+ return role;
131
+ }
132
+ return fallback;
133
+ }
134
+ function getPopupItemRole(element, fallback) {
135
+ var _a;
136
+ const itemRoleByPopupRole = {
137
+ menu: "menuitem",
138
+ listbox: "option",
139
+ tree: "treeitem"
140
+ };
141
+ const popupRole = getPopupRole(element);
142
+ if (!popupRole)
143
+ return fallback;
144
+ const key = popupRole;
145
+ return (_a = itemRoleByPopupRole[key]) != null ? _a : fallback;
146
+ }
133
147
  function scrollIntoViewIfNeeded(element, arg) {
134
148
  if (isPartiallyHidden(element) && "scrollIntoView" in element) {
135
149
  element.scrollIntoView(arg);
@@ -193,4 +207,6 @@ function setSelectionRange(element, ...args) {
193
207
 
194
208
 
195
209
 
196
- exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.matches = matches; exports.isVisible = isVisible; exports.closest = closest; exports.isTextField = isTextField; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.getTextboxSelection = getTextboxSelection; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
210
+
211
+
212
+ exports.canUseDOM = canUseDOM; exports.getDocument = getDocument; exports.getWindow = getWindow; exports.getActiveElement = getActiveElement; exports.contains = contains; exports.isFrame = isFrame; exports.isButton = isButton; exports.matches = matches; exports.isVisible = isVisible; exports.closest = closest; exports.isTextField = isTextField; exports.isTextbox = isTextbox; exports.getTextboxValue = getTextboxValue; exports.getTextboxSelection = getTextboxSelection; exports.getPopupRole = getPopupRole; exports.getPopupItemRole = getPopupItemRole; exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded; exports.getScrollingElement = getScrollingElement; exports.isPartiallyHidden = isPartiallyHidden; exports.setSelectionRange = setSelectionRange;
@@ -1,19 +1,19 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _FFZYCAXAcjs = require('./FFZYCAXA.cjs');
4
+ var _QD2A4YF6cjs = require('./QD2A4YF6.cjs');
5
5
 
6
6
 
7
7
 
8
+ var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
8
9
 
9
- var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
10
10
 
11
11
 
12
- var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
13
12
 
13
+ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
14
14
 
15
15
 
16
- var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
16
+ var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
17
17
 
18
18
 
19
19
 
@@ -124,7 +124,7 @@ function verticalizeItems(items) {
124
124
  function createCompositeStore(props = {}) {
125
125
  var _a;
126
126
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
127
- const collection = _FFZYCAXAcjs.createCollectionStore.call(void 0, props);
127
+ const collection = _QD2A4YF6cjs.createCollectionStore.call(void 0, props);
128
128
  const activeId = _EEDWPDM2cjs.defaultValue.call(void 0,
129
129
  props.activeId,
130
130
  syncState == null ? void 0 : syncState.activeId,
@@ -0,0 +1,71 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+ // src/utils/undo.ts
4
+ function createUndoCallback(callback) {
5
+ return async () => {
6
+ const redo = await (callback == null ? void 0 : callback());
7
+ return createUndoCallback(async () => {
8
+ await (redo == null ? void 0 : redo());
9
+ return callback;
10
+ });
11
+ };
12
+ }
13
+ var UndoManager = createUndoManager();
14
+ function createUndoManager({
15
+ limit = 100
16
+ } = {}) {
17
+ const undoStack = [];
18
+ let redoStack = [];
19
+ let currentGroup = null;
20
+ const canUndo = () => undoStack.length > 0;
21
+ const canRedo = () => redoStack.length > 0;
22
+ const undo = async () => {
23
+ var _a;
24
+ if (!canUndo())
25
+ return;
26
+ currentGroup = null;
27
+ redoStack.push(await ((_a = undoStack.pop()) == null ? void 0 : _a()));
28
+ };
29
+ const redo = async () => {
30
+ var _a;
31
+ if (!canRedo())
32
+ return;
33
+ currentGroup = null;
34
+ undoStack.push(await ((_a = redoStack.pop()) == null ? void 0 : _a()));
35
+ };
36
+ const execute = async (callback, group) => {
37
+ if (!callback)
38
+ return;
39
+ while (undoStack.length > limit) {
40
+ undoStack.shift();
41
+ }
42
+ const sameGroup = group === currentGroup;
43
+ currentGroup = group != null ? group : null;
44
+ const nextIndex = sameGroup ? Math.max(0, undoStack.length - 1) : undoStack.length;
45
+ const undoCallback = await callback();
46
+ if (!undoCallback)
47
+ return;
48
+ redoStack = [];
49
+ const currentUndo = undoStack[nextIndex];
50
+ undoStack[nextIndex] = createUndoCallback(async () => {
51
+ await (undoCallback == null ? void 0 : undoCallback());
52
+ const currentRedo = await (currentUndo == null ? void 0 : currentUndo());
53
+ return async () => {
54
+ await (currentRedo == null ? void 0 : currentRedo());
55
+ await (callback == null ? void 0 : callback());
56
+ };
57
+ });
58
+ };
59
+ return {
60
+ canUndo,
61
+ canRedo,
62
+ undo,
63
+ redo,
64
+ execute
65
+ };
66
+ }
67
+
68
+
69
+
70
+
71
+ exports.UndoManager = UndoManager; exports.createUndoManager = createUndoManager;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _Y7KNI5NScjs = require('./Y7KNI5NS.cjs');
4
+ var _KL74MAHBcjs = require('./KL74MAHB.cjs');
5
5
 
6
6
 
7
7
  var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
@@ -17,7 +17,7 @@ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
17
17
  function createMenubarStore(props = {}) {
18
18
  var _a;
19
19
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
- const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
20
+ const composite = _KL74MAHBcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
21
  orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
22
22
  props.orientation,
23
23
  syncState == null ? void 0 : syncState.orientation,
@@ -12,7 +12,7 @@ var _B4LYZ4EMcjs = require('./B4LYZ4EM.cjs');
12
12
  var _EEDWPDM2cjs = require('./EEDWPDM2.cjs');
13
13
 
14
14
 
15
- var _UKR6TQI3cjs = require('./UKR6TQI3.cjs');
15
+ var _IMYW2UACcjs = require('./IMYW2UAC.cjs');
16
16
 
17
17
 
18
18
 
@@ -62,7 +62,7 @@ function getCommonParent(items) {
62
62
  }
63
63
  parentElement = parentElement.parentElement;
64
64
  }
65
- return _UKR6TQI3cjs.getDocument.call(void 0, parentElement).body;
65
+ return _IMYW2UACcjs.getDocument.call(void 0, parentElement).body;
66
66
  }
67
67
  function getPrivateStore(store) {
68
68
  return store == null ? void 0 : store.__unstablePrivateStore;
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
4
+ var _QD2A4YF6cjs = require('../__chunks/QD2A4YF6.cjs');
5
5
  require('../__chunks/B4LYZ4EM.cjs');
6
6
  require('../__chunks/EEDWPDM2.cjs');
7
- require('../__chunks/UKR6TQI3.cjs');
7
+ require('../__chunks/IMYW2UAC.cjs');
8
8
  require('../__chunks/AV6KTKLE.cjs');
9
9
 
10
10
 
11
- exports.createCollectionStore = _FFZYCAXAcjs.createCollectionStore;
11
+ exports.createCollectionStore = _QD2A4YF6cjs.createCollectionStore;
@@ -1,13 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
+ var _KL74MAHBcjs = require('../__chunks/KL74MAHB.cjs');
5
+ require('../__chunks/QD2A4YF6.cjs');
6
+ require('../__chunks/ULSPM3Y3.cjs');
7
+
8
+
4
9
  var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
5
10
  require('../__chunks/LTLFSC4X.cjs');
6
11
  require('../__chunks/AETQC2AR.cjs');
7
12
 
8
13
 
9
- var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
10
- require('../__chunks/FFZYCAXA.cjs');
11
14
 
12
15
 
13
16
 
@@ -17,31 +20,37 @@ require('../__chunks/FFZYCAXA.cjs');
17
20
  var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
18
21
 
19
22
 
23
+
20
24
  var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
21
25
 
22
26
 
27
+ var _2D5LEVE7cjs = require('../__chunks/2D5LEVE7.cjs');
28
+ require('../__chunks/IMYW2UAC.cjs');
23
29
 
24
- var _7DU6YMLQcjs = require('../__chunks/7DU6YMLQ.cjs');
25
- require('../__chunks/UKR6TQI3.cjs');
26
- require('../__chunks/ULSPM3Y3.cjs');
27
30
 
28
31
 
29
32
 
30
33
  var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
31
34
 
32
35
  // src/combobox/combobox-store.ts
33
- var isSafariOnMobile = _7DU6YMLQcjs.isSafari.call(void 0, ) && _7DU6YMLQcjs.isTouchDevice.call(void 0, );
34
- function createComboboxStore(props = {}) {
35
- var _a;
36
- _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
37
- const syncState = (_a = props.store) == null ? void 0 : _a.getState();
36
+ var isSafariOnMobile = _2D5LEVE7cjs.isSafari.call(void 0, ) && matchMedia("(hover:none)").matches;
37
+ function createComboboxStore(_a = {}) {
38
+ var _b = _a, {
39
+ tag
40
+ } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
41
+ "tag"
42
+ ]);
43
+ const store = _B4LYZ4EMcjs.mergeStore.call(void 0, props.store, _B4LYZ4EMcjs.pick.call(void 0, tag, ["value", "rtl"]));
44
+ _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
45
+ const tagState = tag == null ? void 0 : tag.getState();
46
+ const syncState = store == null ? void 0 : store.getState();
38
47
  const activeId = _EEDWPDM2cjs.defaultValue.call(void 0,
39
48
  props.activeId,
40
49
  syncState == null ? void 0 : syncState.activeId,
41
50
  props.defaultActiveId,
42
51
  null
43
52
  );
44
- const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
53
+ const composite = _KL74MAHBcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
45
54
  activeId,
46
55
  includesBaseElement: _EEDWPDM2cjs.defaultValue.call(void 0,
47
56
  props.includesBaseElement,
@@ -77,6 +86,7 @@ function createComboboxStore(props = {}) {
77
86
  const selectedValue = _EEDWPDM2cjs.defaultValue.call(void 0,
78
87
  props.selectedValue,
79
88
  syncState == null ? void 0 : syncState.selectedValue,
89
+ tagState == null ? void 0 : tagState.values,
80
90
  props.defaultSelectedValue,
81
91
  ""
82
92
  );
@@ -92,11 +102,25 @@ function createComboboxStore(props = {}) {
92
102
  resetValueOnHide: _EEDWPDM2cjs.defaultValue.call(void 0,
93
103
  props.resetValueOnHide,
94
104
  syncState == null ? void 0 : syncState.resetValueOnHide,
95
- multiSelectable
105
+ multiSelectable && !tag
96
106
  ),
97
107
  activeValue: syncState == null ? void 0 : syncState.activeValue
98
108
  });
99
- const combobox = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, props.store);
109
+ const combobox = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, store);
110
+ _B4LYZ4EMcjs.setup.call(void 0, combobox, () => {
111
+ if (!tag)
112
+ return;
113
+ return _EEDWPDM2cjs.chain.call(void 0,
114
+ _B4LYZ4EMcjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
115
+ if (!Array.isArray(state.selectedValue))
116
+ return;
117
+ tag.setValues(state.selectedValue);
118
+ }),
119
+ _B4LYZ4EMcjs.sync.call(void 0, tag, ["values"], (state) => {
120
+ combobox.setState("selectedValue", state.values);
121
+ })
122
+ );
123
+ });
100
124
  _B4LYZ4EMcjs.setup.call(void 0,
101
125
  combobox,
102
126
  () => _B4LYZ4EMcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
@@ -107,14 +131,6 @@ function createComboboxStore(props = {}) {
107
131
  combobox.setState("value", value);
108
132
  })
109
133
  );
110
- _B4LYZ4EMcjs.setup.call(void 0,
111
- combobox,
112
- () => _B4LYZ4EMcjs.sync.call(void 0, combobox, ["resetValueOnSelect", "selectedValue"], (state) => {
113
- if (!state.resetValueOnSelect)
114
- return;
115
- combobox.setState("value", value);
116
- })
117
- );
118
134
  _B4LYZ4EMcjs.setup.call(void 0,
119
135
  combobox,
120
136
  () => _B4LYZ4EMcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
@@ -143,7 +159,9 @@ function createComboboxStore(props = {}) {
143
159
  })
144
160
  );
145
161
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
162
+ tag,
146
163
  setValue: (value2) => combobox.setState("value", value2),
164
+ resetValue: () => combobox.setState("value", initialState.value),
147
165
  setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
148
166
  });
149
167
  }
@@ -1,5 +1,6 @@
1
1
  import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
2
  import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
3
+ import type { TagStore } from "../tag/tag-store.js";
3
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
4
5
  import type { PickRequired, SetState } from "../utils/types.js";
5
6
  type MutableValue<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> = T extends string ? string : T;
@@ -80,14 +81,14 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
80
81
  * or
81
82
  * [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
82
83
  * props are arrays.
83
- *
84
- * Live examples:
85
- * - [Multi-selectable
86
- * Combobox](https://ariakit.org/examples/combobox-multiple)
84
+ * @deprecated Use the
85
+ * [`resetValueOnSelect`](https://ariakit.org/reference/combobox-item#resetvalueonselect)
86
+ * prop on [`ComboboxItem`](https://ariakit.org/reference/combobox-item)
87
+ * instead.
87
88
  */
88
89
  resetValueOnSelect: boolean;
89
90
  }
90
- export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
91
+ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends Pick<ComboboxStoreOptions<T>, "tag">, CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
91
92
  /**
92
93
  * Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
93
94
  * state.
@@ -100,6 +101,11 @@ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = C
100
101
  * store.setValue((value) => value + "!");
101
102
  */
102
103
  setValue: SetState<ComboboxStoreState<T>["value"]>;
104
+ /**
105
+ * Resets the [`value`](https://ariakit.org/reference/combobox-provider#value)
106
+ * state to its initial value.
107
+ */
108
+ resetValue: () => void;
103
109
  /**
104
110
  * Sets the
105
111
  * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
@@ -124,6 +130,11 @@ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = Com
124
130
  * @default ""
125
131
  */
126
132
  defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
133
+ /**
134
+ * A reference to a tag store. This is used when rendering a combobox within a
135
+ * tag list. The stores will share the same state.
136
+ */
137
+ tag?: TagStore | null;
127
138
  }
128
139
  export interface ComboboxStoreProps<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
129
140
  }
@@ -1,5 +1,6 @@
1
1
  import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
2
  import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
3
+ import type { TagStore } from "../tag/tag-store.js";
3
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
4
5
  import type { PickRequired, SetState } from "../utils/types.js";
5
6
  type MutableValue<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> = T extends string ? string : T;
@@ -80,14 +81,14 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
80
81
  * or
81
82
  * [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
82
83
  * props are arrays.
83
- *
84
- * Live examples:
85
- * - [Multi-selectable
86
- * Combobox](https://ariakit.org/examples/combobox-multiple)
84
+ * @deprecated Use the
85
+ * [`resetValueOnSelect`](https://ariakit.org/reference/combobox-item#resetvalueonselect)
86
+ * prop on [`ComboboxItem`](https://ariakit.org/reference/combobox-item)
87
+ * instead.
87
88
  */
88
89
  resetValueOnSelect: boolean;
89
90
  }
90
- export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
91
+ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends Pick<ComboboxStoreOptions<T>, "tag">, CompositeStoreFunctions<ComboboxStoreItem>, PopoverStoreFunctions {
91
92
  /**
92
93
  * Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
93
94
  * state.
@@ -100,6 +101,11 @@ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = C
100
101
  * store.setValue((value) => value + "!");
101
102
  */
102
103
  setValue: SetState<ComboboxStoreState<T>["value"]>;
104
+ /**
105
+ * Resets the [`value`](https://ariakit.org/reference/combobox-provider#value)
106
+ * state to its initial value.
107
+ */
108
+ resetValue: () => void;
103
109
  /**
104
110
  * Sets the
105
111
  * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
@@ -124,6 +130,11 @@ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = Com
124
130
  * @default ""
125
131
  */
126
132
  defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
133
+ /**
134
+ * A reference to a tag store. This is used when rendering a combobox within a
135
+ * tag list. The stores will share the same state.
136
+ */
137
+ tag?: TagStore | null;
127
138
  }
128
139
  export interface ComboboxStoreProps<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
129
140
  }
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
5
- require('../__chunks/FFZYCAXA.cjs');
4
+ var _KL74MAHBcjs = require('../__chunks/KL74MAHB.cjs');
5
+ require('../__chunks/QD2A4YF6.cjs');
6
+ require('../__chunks/ULSPM3Y3.cjs');
6
7
  require('../__chunks/B4LYZ4EM.cjs');
7
8
  require('../__chunks/EEDWPDM2.cjs');
8
- require('../__chunks/UKR6TQI3.cjs');
9
- require('../__chunks/ULSPM3Y3.cjs');
9
+ require('../__chunks/IMYW2UAC.cjs');
10
10
  require('../__chunks/AV6KTKLE.cjs');
11
11
 
12
12
 
13
- exports.createCompositeStore = _Y7KNI5NScjs.createCompositeStore;
13
+ exports.createCompositeStore = _KL74MAHBcjs.createCompositeStore;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _FFZYCAXAcjs = require('../__chunks/FFZYCAXA.cjs');
4
+ var _QD2A4YF6cjs = require('../__chunks/QD2A4YF6.cjs');
5
5
 
6
6
 
7
7
 
@@ -14,7 +14,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
14
14
 
15
15
 
16
16
  var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
17
- require('../__chunks/UKR6TQI3.cjs');
17
+ require('../__chunks/IMYW2UAC.cjs');
18
18
 
19
19
 
20
20
 
@@ -116,7 +116,7 @@ function createFormStore(props = {}) {
116
116
  var _a;
117
117
  _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, props.store);
118
118
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
119
- const collection = _FFZYCAXAcjs.createCollectionStore.call(void 0, props);
119
+ const collection = _QD2A4YF6cjs.createCollectionStore.call(void 0, props);
120
120
  const values = _EEDWPDM2cjs.defaultValue.call(void 0,
121
121
  props.values,
122
122
  syncState == null ? void 0 : syncState.values,
@@ -1,18 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _SU2BSHGBcjs = require('../__chunks/SU2BSHGB.cjs');
5
- require('../__chunks/Y7KNI5NS.cjs');
6
- require('../__chunks/FFZYCAXA.cjs');
4
+ var _MHZQJPY3cjs = require('../__chunks/MHZQJPY3.cjs');
5
+ require('../__chunks/KL74MAHB.cjs');
6
+ require('../__chunks/QD2A4YF6.cjs');
7
+ require('../__chunks/ULSPM3Y3.cjs');
7
8
  require('../__chunks/B4LYZ4EM.cjs');
8
9
  require('../__chunks/EEDWPDM2.cjs');
9
- require('../__chunks/UKR6TQI3.cjs');
10
- require('../__chunks/ULSPM3Y3.cjs');
10
+ require('../__chunks/IMYW2UAC.cjs');
11
11
  require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
  // src/menu/menu-bar-store.ts
14
14
  function createMenuBarStore(props = {}) {
15
- return _SU2BSHGBcjs.createMenubarStore.call(void 0, props);
15
+ return _MHZQJPY3cjs.createMenubarStore.call(void 0, props);
16
16
  }
17
17
 
18
18
 
@@ -2,15 +2,16 @@
2
2
 
3
3
 
4
4
  var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
5
+
6
+
7
+ var _KL74MAHBcjs = require('../__chunks/KL74MAHB.cjs');
8
+ require('../__chunks/QD2A4YF6.cjs');
9
+ require('../__chunks/ULSPM3Y3.cjs');
5
10
  require('../__chunks/5JEQEZFR.cjs');
6
11
  require('../__chunks/LTLFSC4X.cjs');
7
12
  require('../__chunks/AETQC2AR.cjs');
8
13
 
9
14
 
10
- var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
11
- require('../__chunks/FFZYCAXA.cjs');
12
-
13
-
14
15
 
15
16
 
16
17
 
@@ -22,8 +23,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
22
23
 
23
24
 
24
25
  var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
25
- require('../__chunks/UKR6TQI3.cjs');
26
- require('../__chunks/ULSPM3Y3.cjs');
26
+ require('../__chunks/IMYW2UAC.cjs');
27
27
 
28
28
 
29
29
 
@@ -55,7 +55,7 @@ function createMenuStore(_a = {}) {
55
55
  );
56
56
  _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
57
57
  const syncState = store.getState();
58
- const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
58
+ const composite = _KL74MAHBcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
59
59
  store,
60
60
  orientation: _EEDWPDM2cjs.defaultValue.call(void 0,
61
61
  props.orientation,
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _SU2BSHGBcjs = require('../__chunks/SU2BSHGB.cjs');
5
- require('../__chunks/Y7KNI5NS.cjs');
6
- require('../__chunks/FFZYCAXA.cjs');
4
+ var _MHZQJPY3cjs = require('../__chunks/MHZQJPY3.cjs');
5
+ require('../__chunks/KL74MAHB.cjs');
6
+ require('../__chunks/QD2A4YF6.cjs');
7
+ require('../__chunks/ULSPM3Y3.cjs');
7
8
  require('../__chunks/B4LYZ4EM.cjs');
8
9
  require('../__chunks/EEDWPDM2.cjs');
9
- require('../__chunks/UKR6TQI3.cjs');
10
- require('../__chunks/ULSPM3Y3.cjs');
10
+ require('../__chunks/IMYW2UAC.cjs');
11
11
  require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
 
14
- exports.createMenubarStore = _SU2BSHGBcjs.createMenubarStore;
14
+ exports.createMenubarStore = _MHZQJPY3cjs.createMenubarStore;