@ariakit/core 0.4.9 → 0.4.11

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 (72) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/cjs/__chunks/{3IVNQNIV.cjs → 7EQBAZ46.cjs} +1 -2
  3. package/cjs/__chunks/{3QF3ODTR.cjs → BSLRW6E7.cjs} +15 -16
  4. package/cjs/__chunks/{H6ZQSQQL.cjs → C5P5S22J.cjs} +17 -18
  5. package/cjs/__chunks/{QLWAGBAQ.cjs → G2MFLTB2.cjs} +19 -20
  6. package/cjs/__chunks/{CCI5VM7E.cjs → G2NIRMCL.cjs} +19 -20
  7. package/cjs/__chunks/{ULSPM3Y3.cjs → GDZQUFNP.cjs} +1 -3
  8. package/cjs/__chunks/{N667HVED.cjs → I2G6EN27.cjs} +3 -4
  9. package/cjs/__chunks/LLZO7SOB.cjs +34 -0
  10. package/cjs/__chunks/LSC6QXJ7.cjs +41 -0
  11. package/cjs/__chunks/{BTUHABP4.cjs → MLCPLY2P.cjs} +3 -4
  12. package/cjs/__chunks/{7CES7GVE.cjs → SHOLYDNP.cjs} +1 -3
  13. package/cjs/__chunks/{KCEXELK7.cjs → TEPPO3KC.cjs} +7 -8
  14. package/cjs/__chunks/{PW36G76L.cjs → W3GMUKTU.cjs} +76 -99
  15. package/cjs/__chunks/{7WYII4AN.cjs → WCFMOJKV.cjs} +8 -7
  16. package/cjs/checkbox/checkbox-store.cjs +8 -9
  17. package/cjs/collection/collection-store.cjs +7 -8
  18. package/cjs/combobox/combobox-store.cjs +47 -48
  19. package/cjs/composite/composite-overflow-store.cjs +8 -9
  20. package/cjs/composite/composite-store.cjs +9 -10
  21. package/cjs/composite/composite-store.d.cts +30 -12
  22. package/cjs/composite/composite-store.d.ts +30 -12
  23. package/cjs/dialog/dialog-store.cjs +7 -8
  24. package/cjs/disclosure/disclosure-store.cjs +6 -7
  25. package/cjs/form/form-store.cjs +29 -30
  26. package/cjs/form/types.cjs +1 -1
  27. package/cjs/hovercard/hovercard-store.cjs +9 -10
  28. package/cjs/index.cjs +1 -2
  29. package/cjs/menu/menu-bar-store.cjs +10 -11
  30. package/cjs/menu/menu-store.cjs +34 -35
  31. package/cjs/menubar/menubar-store.cjs +10 -11
  32. package/cjs/popover/popover-store.cjs +8 -9
  33. package/cjs/radio/radio-store.cjs +15 -16
  34. package/cjs/select/select-store.cjs +39 -40
  35. package/cjs/tab/tab-store.cjs +45 -40
  36. package/cjs/tag/tag-store.cjs +21 -22
  37. package/cjs/toolbar/toolbar-store.cjs +11 -12
  38. package/cjs/tooltip/tooltip-store.cjs +16 -17
  39. package/cjs/utils/array.cjs +4 -5
  40. package/cjs/utils/dom.cjs +4 -5
  41. package/cjs/utils/events.cjs +9 -10
  42. package/cjs/utils/focus.cjs +13 -14
  43. package/cjs/utils/misc.cjs +4 -5
  44. package/cjs/utils/platform.cjs +5 -6
  45. package/cjs/utils/store.cjs +5 -6
  46. package/cjs/utils/types.cjs +1 -1
  47. package/cjs/utils/undo.cjs +4 -5
  48. package/esm/__chunks/{US4USQPI.js → 3VBK76MS.js} +1 -1
  49. package/esm/__chunks/{6DHTHWXD.js → 7DTP4AQO.js} +1 -1
  50. package/esm/__chunks/{D7EIQZAU.js → 7IJEP35G.js} +53 -75
  51. package/esm/__chunks/{HWOIWM4O.js → PQP5VPTV.js} +7 -4
  52. package/esm/__chunks/{PIWLWQMB.js → YKFX5MNB.js} +1 -1
  53. package/esm/collection/collection-store.js +2 -2
  54. package/esm/combobox/combobox-store.js +6 -6
  55. package/esm/composite/composite-store.d.ts +30 -12
  56. package/esm/composite/composite-store.js +3 -3
  57. package/esm/form/form-store.js +2 -2
  58. package/esm/menu/menu-bar-store.js +4 -4
  59. package/esm/menu/menu-store.js +3 -3
  60. package/esm/menubar/menubar-store.js +4 -4
  61. package/esm/radio/radio-store.js +3 -3
  62. package/esm/select/select-store.js +3 -3
  63. package/esm/tab/tab-store.js +11 -5
  64. package/esm/tag/tag-store.js +3 -3
  65. package/esm/toolbar/toolbar-store.js +3 -3
  66. package/esm/utils/dom.js +1 -1
  67. package/esm/utils/events.js +2 -2
  68. package/esm/utils/focus.js +1 -1
  69. package/esm/utils/platform.js +2 -2
  70. package/package.json +1 -1
  71. package/cjs/__chunks/VJAE2Y4T.cjs +0 -35
  72. package/cjs/__chunks/XIZWLBI2.cjs +0 -42
@@ -1,23 +1,22 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _G2NIRMCLcjs = require('./G2NIRMCL.cjs');
3
4
 
4
- var _CCI5VM7Ecjs = require('./CCI5VM7E.cjs');
5
5
 
6
6
 
7
+ var _GDZQUFNPcjs = require('./GDZQUFNP.cjs');
7
8
 
8
- var _ULSPM3Y3cjs = require('./ULSPM3Y3.cjs');
9
9
 
10
10
 
11
11
 
12
+ var _BSLRW6E7cjs = require('./BSLRW6E7.cjs');
12
13
 
13
- var _3QF3ODTRcjs = require('./3QF3ODTR.cjs');
14
14
 
15
+ var _MLCPLY2Pcjs = require('./MLCPLY2P.cjs');
15
16
 
16
- var _BTUHABP4cjs = require('./BTUHABP4.cjs');
17
17
 
18
18
 
19
-
20
- var _3IVNQNIVcjs = require('./3IVNQNIV.cjs');
19
+ var _7EQBAZ46cjs = require('./7EQBAZ46.cjs');
21
20
 
22
21
  // src/composite/composite-store.ts
23
22
  var NULL_ITEM = { id: null };
@@ -37,11 +36,6 @@ function getEnabledItems(items, excludeId) {
37
36
  return !item.disabled;
38
37
  });
39
38
  }
40
- function getOppositeOrientation(orientation) {
41
- if (orientation === "vertical") return "horizontal";
42
- if (orientation === "horizontal") return "vertical";
43
- return;
44
- }
45
39
  function getItemsInRow(items, rowId) {
46
40
  return items.filter((item) => item.rowId === rowId);
47
41
  }
@@ -106,7 +100,7 @@ function verticalizeItems(items) {
106
100
  for (const row of rows) {
107
101
  const item = row[i];
108
102
  if (item) {
109
- verticalized.push(_3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, item), {
103
+ verticalized.push(_7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, item), {
110
104
  // If there's no rowId, it means that it's not a grid composite, but
111
105
  // a single row instead. So, instead of verticalizing it, that is,
112
106
  // assigning a different rowId based on the column index, we keep it
@@ -122,40 +116,40 @@ function verticalizeItems(items) {
122
116
  function createCompositeStore(props = {}) {
123
117
  var _a;
124
118
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
125
- const collection = _CCI5VM7Ecjs.createCollectionStore.call(void 0, props);
126
- const activeId = _BTUHABP4cjs.defaultValue.call(void 0,
119
+ const collection = _G2NIRMCLcjs.createCollectionStore.call(void 0, props);
120
+ const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
127
121
  props.activeId,
128
122
  syncState == null ? void 0 : syncState.activeId,
129
123
  props.defaultActiveId
130
124
  );
131
- const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, collection.getState()), {
125
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection.getState()), {
132
126
  activeId,
133
- baseElement: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
134
- includesBaseElement: _BTUHABP4cjs.defaultValue.call(void 0,
127
+ baseElement: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.baseElement, null),
128
+ includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
135
129
  props.includesBaseElement,
136
130
  syncState == null ? void 0 : syncState.includesBaseElement,
137
131
  activeId === null
138
132
  ),
139
- moves: _BTUHABP4cjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
140
- orientation: _BTUHABP4cjs.defaultValue.call(void 0,
133
+ moves: _MLCPLY2Pcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.moves, 0),
134
+ orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
141
135
  props.orientation,
142
136
  syncState == null ? void 0 : syncState.orientation,
143
137
  "both"
144
138
  ),
145
- rtl: _BTUHABP4cjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
146
- virtualFocus: _BTUHABP4cjs.defaultValue.call(void 0,
139
+ rtl: _MLCPLY2Pcjs.defaultValue.call(void 0, props.rtl, syncState == null ? void 0 : syncState.rtl, false),
140
+ virtualFocus: _MLCPLY2Pcjs.defaultValue.call(void 0,
147
141
  props.virtualFocus,
148
142
  syncState == null ? void 0 : syncState.virtualFocus,
149
143
  false
150
144
  ),
151
- focusLoop: _BTUHABP4cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
152
- focusWrap: _BTUHABP4cjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
153
- focusShift: _BTUHABP4cjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
145
+ focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
146
+ focusWrap: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
147
+ focusShift: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
154
148
  });
155
- const composite = _3QF3ODTRcjs.createStore.call(void 0, initialState, collection, props.store);
156
- _3QF3ODTRcjs.setup.call(void 0,
149
+ const composite = _BSLRW6E7cjs.createStore.call(void 0, initialState, collection, props.store);
150
+ _BSLRW6E7cjs.setup.call(void 0,
157
151
  composite,
158
- () => _3QF3ODTRcjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
152
+ () => _BSLRW6E7cjs.sync.call(void 0, composite, ["renderedItems", "activeId"], (state) => {
159
153
  composite.setState("activeId", (activeId2) => {
160
154
  var _a2;
161
155
  if (activeId2 !== void 0) return activeId2;
@@ -163,40 +157,50 @@ function createCompositeStore(props = {}) {
163
157
  });
164
158
  })
165
159
  );
166
- const getNextId = (items, orientation, hasNullItem, skip) => {
160
+ const getNextId = (direction = "next", options = {}) => {
167
161
  var _a2, _b;
168
- const { activeId: activeId2, rtl, focusLoop, focusWrap, includesBaseElement } = composite.getState();
169
- const isHorizontal = orientation !== "vertical";
170
- const isRTL = rtl && isHorizontal;
171
- const allItems = isRTL ? _ULSPM3Y3cjs.reverseArray.call(void 0, items) : items;
162
+ const defaultState = composite.getState();
163
+ const {
164
+ skip = 0,
165
+ activeId: activeId2 = defaultState.activeId,
166
+ focusShift = defaultState.focusShift,
167
+ focusLoop = defaultState.focusLoop,
168
+ focusWrap = defaultState.focusWrap,
169
+ includesBaseElement = defaultState.includesBaseElement,
170
+ renderedItems = defaultState.renderedItems,
171
+ rtl = defaultState.rtl
172
+ } = options;
173
+ const isVerticalDirection = direction === "up" || direction === "down";
174
+ const isNextDirection = direction === "next" || direction === "down";
175
+ const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
176
+ const canShift = focusShift && !skip;
177
+ let items = !isVerticalDirection ? renderedItems : _GDZQUFNPcjs.flatten2DArray.call(void 0,
178
+ normalizeRows(groupItemsByRows(renderedItems), activeId2, canShift)
179
+ );
180
+ items = canReverse ? _GDZQUFNPcjs.reverseArray.call(void 0, renderedItems) : renderedItems;
181
+ items = isVerticalDirection ? verticalizeItems(items) : items;
172
182
  if (activeId2 == null) {
173
- return (_a2 = findFirstEnabledItem(allItems)) == null ? void 0 : _a2.id;
183
+ return (_a2 = findFirstEnabledItem(items)) == null ? void 0 : _a2.id;
174
184
  }
175
- const activeItem = allItems.find((item) => item.id === activeId2);
185
+ const activeItem = items.find((item) => item.id === activeId2);
176
186
  if (!activeItem) {
177
- return (_b = findFirstEnabledItem(allItems)) == null ? void 0 : _b.id;
187
+ return (_b = findFirstEnabledItem(items)) == null ? void 0 : _b.id;
178
188
  }
179
- const isGrid = !!activeItem.rowId;
180
- const activeIndex = allItems.indexOf(activeItem);
181
- const nextItems = allItems.slice(activeIndex + 1);
189
+ const isGrid = items.some((item) => item.rowId);
190
+ const activeIndex = items.indexOf(activeItem);
191
+ const nextItems = items.slice(activeIndex + 1);
182
192
  const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
183
- if (skip !== void 0) {
193
+ if (skip) {
184
194
  const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
185
195
  const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
186
196
  nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
187
197
  return nextItem2 == null ? void 0 : nextItem2.id;
188
198
  }
189
- const oppositeOrientation = getOppositeOrientation(
190
- // If it's a grid and orientation is not set, it's a next/previous call,
191
- // which is inherently horizontal. up/down will call next with orientation
192
- // set to vertical by default (see below on up/down methods).
193
- isGrid ? orientation || "horizontal" : orientation
194
- );
195
- const canLoop = focusLoop && focusLoop !== oppositeOrientation;
196
- const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation;
197
- hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement;
199
+ const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
200
+ const canWrap = isGrid && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
201
+ const hasNullItem = isNextDirection ? (!isGrid || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
198
202
  if (canLoop) {
199
- const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId);
203
+ const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
200
204
  const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
201
205
  const nextItem2 = findFirstEnabledItem(sortedItems, activeId2);
202
206
  return nextItem2 == null ? void 0 : nextItem2.id;
@@ -221,7 +225,7 @@ function createCompositeStore(props = {}) {
221
225
  }
222
226
  return nextItem == null ? void 0 : nextItem.id;
223
227
  };
224
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, collection), composite), {
228
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, collection), composite), {
225
229
  setBaseElement: (element) => composite.setState("baseElement", element),
226
230
  setActiveId: (id) => composite.setState("activeId", id),
227
231
  move: (id) => {
@@ -235,58 +239,31 @@ function createCompositeStore(props = {}) {
235
239
  },
236
240
  last: () => {
237
241
  var _a2;
238
- return (_a2 = findFirstEnabledItem(_ULSPM3Y3cjs.reverseArray.call(void 0, composite.getState().renderedItems))) == null ? void 0 : _a2.id;
242
+ return (_a2 = findFirstEnabledItem(_GDZQUFNPcjs.reverseArray.call(void 0, composite.getState().renderedItems))) == null ? void 0 : _a2.id;
239
243
  },
240
- next: (skip) => {
241
- const { renderedItems, orientation } = composite.getState();
242
- return getNextId(renderedItems, orientation, false, skip);
244
+ next: (options) => {
245
+ if (options !== void 0 && typeof options === "number") {
246
+ options = { skip: options };
247
+ }
248
+ return getNextId("next", options);
243
249
  },
244
- previous: (skip) => {
245
- var _a2;
246
- const { renderedItems, orientation, includesBaseElement } = composite.getState();
247
- const isGrid = !!((_a2 = findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId);
248
- const hasNullItem = !isGrid && includesBaseElement;
249
- return getNextId(
250
- _ULSPM3Y3cjs.reverseArray.call(void 0, renderedItems),
251
- orientation,
252
- hasNullItem,
253
- skip
254
- );
250
+ previous: (options) => {
251
+ if (options !== void 0 && typeof options === "number") {
252
+ options = { skip: options };
253
+ }
254
+ return getNextId("previous", options);
255
255
  },
256
- down: (skip) => {
257
- const {
258
- activeId: activeId2,
259
- renderedItems,
260
- focusShift,
261
- focusLoop,
262
- includesBaseElement
263
- } = composite.getState();
264
- const shouldShift = focusShift && !skip;
265
- const verticalItems = verticalizeItems(
266
- _ULSPM3Y3cjs.flatten2DArray.call(void 0,
267
- normalizeRows(groupItemsByRows(renderedItems), activeId2, shouldShift)
268
- )
269
- );
270
- const canLoop = focusLoop && focusLoop !== "horizontal";
271
- const hasNullItem = canLoop && includesBaseElement;
272
- return getNextId(verticalItems, "vertical", hasNullItem, skip);
256
+ down: (options) => {
257
+ if (options !== void 0 && typeof options === "number") {
258
+ options = { skip: options };
259
+ }
260
+ return getNextId("down", options);
273
261
  },
274
- up: (skip) => {
275
- const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState();
276
- const shouldShift = focusShift && !skip;
277
- const verticalItems = verticalizeItems(
278
- _ULSPM3Y3cjs.reverseArray.call(void 0,
279
- _ULSPM3Y3cjs.flatten2DArray.call(void 0,
280
- normalizeRows(
281
- groupItemsByRows(renderedItems),
282
- activeId2,
283
- shouldShift
284
- )
285
- )
286
- )
287
- );
288
- const hasNullItem = includesBaseElement;
289
- return getNextId(verticalItems, "vertical", hasNullItem, skip);
262
+ up: (options) => {
263
+ if (options !== void 0 && typeof options === "number") {
264
+ options = { skip: options };
265
+ }
266
+ return getNextId("up", options);
290
267
  }
291
268
  });
292
269
  }
@@ -1,6 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
- // src/utils/dom.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/dom.ts
4
2
  var canUseDOM = checkIsBrowser();
5
3
  function checkIsBrowser() {
6
4
  var _a;
@@ -133,14 +131,17 @@ function scrollIntoViewIfNeeded(element, arg) {
133
131
  }
134
132
  function getScrollingElement(element) {
135
133
  if (!element) return null;
134
+ const isScrollableOverflow = (overflow) => {
135
+ if (overflow === "auto") return true;
136
+ if (overflow === "scroll") return true;
137
+ return false;
138
+ };
136
139
  if (element.clientHeight && element.scrollHeight > element.clientHeight) {
137
140
  const { overflowY } = getComputedStyle(element);
138
- const isScrollable = overflowY !== "visible" && overflowY !== "hidden";
139
- if (isScrollable) return element;
141
+ if (isScrollableOverflow(overflowY)) return element;
140
142
  } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
141
143
  const { overflowX } = getComputedStyle(element);
142
- const isScrollable = overflowX !== "visible" && overflowX !== "hidden";
143
- if (isScrollable) return element;
144
+ if (isScrollableOverflow(overflowX)) return element;
144
145
  }
145
146
  return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
146
147
  }
@@ -1,31 +1,30 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
4
5
 
5
- var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
6
6
 
7
+ var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
7
8
 
8
- var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
9
9
 
10
10
 
11
-
12
- var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
11
+ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
13
12
 
14
13
  // src/checkbox/checkbox-store.ts
15
14
  function createCheckboxStore(props = {}) {
16
15
  var _a;
17
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, props.store);
16
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, props.store);
18
17
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
19
18
  const initialState = {
20
- value: _BTUHABP4cjs.defaultValue.call(void 0,
19
+ value: _MLCPLY2Pcjs.defaultValue.call(void 0,
21
20
  props.value,
22
21
  syncState == null ? void 0 : syncState.value,
23
22
  props.defaultValue,
24
23
  false
25
24
  )
26
25
  };
27
- const checkbox = _3QF3ODTRcjs.createStore.call(void 0, initialState, props.store);
28
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, checkbox), {
26
+ const checkbox = _BSLRW6E7cjs.createStore.call(void 0, initialState, props.store);
27
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, checkbox), {
29
28
  setValue: (value) => checkbox.setState("value", value)
30
29
  });
31
30
  }
@@ -1,11 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _G2NIRMCLcjs = require('../__chunks/G2NIRMCL.cjs');
4
+ require('../__chunks/BSLRW6E7.cjs');
5
+ require('../__chunks/MLCPLY2P.cjs');
6
+ require('../__chunks/WCFMOJKV.cjs');
7
+ require('../__chunks/7EQBAZ46.cjs');
3
8
 
4
- var _CCI5VM7Ecjs = require('../__chunks/CCI5VM7E.cjs');
5
- require('../__chunks/3QF3ODTR.cjs');
6
- require('../__chunks/BTUHABP4.cjs');
7
- require('../__chunks/7WYII4AN.cjs');
8
- require('../__chunks/3IVNQNIV.cjs');
9
9
 
10
-
11
- exports.createCollectionStore = _CCI5VM7Ecjs.createCollectionStore;
10
+ exports.createCollectionStore = _G2NIRMCLcjs.createCollectionStore;
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _W3GMUKTUcjs = require('../__chunks/W3GMUKTU.cjs');
4
+ require('../__chunks/G2NIRMCL.cjs');
5
+ require('../__chunks/GDZQUFNP.cjs');
3
6
 
4
- var _PW36G76Lcjs = require('../__chunks/PW36G76L.cjs');
5
- require('../__chunks/CCI5VM7E.cjs');
6
- require('../__chunks/ULSPM3Y3.cjs');
7
7
 
8
+ var _C5P5S22Jcjs = require('../__chunks/C5P5S22J.cjs');
9
+ require('../__chunks/I2G6EN27.cjs');
10
+ require('../__chunks/G2MFLTB2.cjs');
8
11
 
9
- var _H6ZQSQQLcjs = require('../__chunks/H6ZQSQQL.cjs');
10
- require('../__chunks/N667HVED.cjs');
11
- require('../__chunks/QLWAGBAQ.cjs');
12
12
 
13
13
 
14
14
 
@@ -16,75 +16,74 @@ require('../__chunks/QLWAGBAQ.cjs');
16
16
 
17
17
 
18
18
 
19
+ var _BSLRW6E7cjs = require('../__chunks/BSLRW6E7.cjs');
19
20
 
20
- var _3QF3ODTRcjs = require('../__chunks/3QF3ODTR.cjs');
21
21
 
22
22
 
23
+ var _MLCPLY2Pcjs = require('../__chunks/MLCPLY2P.cjs');
23
24
 
24
- var _BTUHABP4cjs = require('../__chunks/BTUHABP4.cjs');
25
25
 
26
26
 
27
+ var _TEPPO3KCcjs = require('../__chunks/TEPPO3KC.cjs');
28
+ require('../__chunks/WCFMOJKV.cjs');
27
29
 
28
- var _KCEXELK7cjs = require('../__chunks/KCEXELK7.cjs');
29
- require('../__chunks/7WYII4AN.cjs');
30
30
 
31
31
 
32
32
 
33
-
34
- var _3IVNQNIVcjs = require('../__chunks/3IVNQNIV.cjs');
33
+ var _7EQBAZ46cjs = require('../__chunks/7EQBAZ46.cjs');
35
34
 
36
35
  // src/combobox/combobox-store.ts
37
- var isTouchSafari = _KCEXELK7cjs.isSafari.call(void 0, ) && _KCEXELK7cjs.isTouchDevice.call(void 0, );
36
+ var isTouchSafari = _TEPPO3KCcjs.isSafari.call(void 0, ) && _TEPPO3KCcjs.isTouchDevice.call(void 0, );
38
37
  function createComboboxStore(_a = {}) {
39
38
  var _b = _a, {
40
39
  tag
41
- } = _b, props = _3IVNQNIVcjs.__objRest.call(void 0, _b, [
40
+ } = _b, props = _7EQBAZ46cjs.__objRest.call(void 0, _b, [
42
41
  "tag"
43
42
  ]);
44
- const store = _3QF3ODTRcjs.mergeStore.call(void 0, props.store, _3QF3ODTRcjs.pick.call(void 0, tag, ["value", "rtl"]));
45
- _3QF3ODTRcjs.throwOnConflictingProps.call(void 0, props, store);
43
+ const store = _BSLRW6E7cjs.mergeStore.call(void 0, props.store, _BSLRW6E7cjs.pick.call(void 0, tag, ["value", "rtl"]));
44
+ _BSLRW6E7cjs.throwOnConflictingProps.call(void 0, props, store);
46
45
  const tagState = tag == null ? void 0 : tag.getState();
47
46
  const syncState = store == null ? void 0 : store.getState();
48
- const activeId = _BTUHABP4cjs.defaultValue.call(void 0,
47
+ const activeId = _MLCPLY2Pcjs.defaultValue.call(void 0,
49
48
  props.activeId,
50
49
  syncState == null ? void 0 : syncState.activeId,
51
50
  props.defaultActiveId,
52
51
  null
53
52
  );
54
- const composite = _PW36G76Lcjs.createCompositeStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
53
+ const composite = _W3GMUKTUcjs.createCompositeStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
55
54
  activeId,
56
- includesBaseElement: _BTUHABP4cjs.defaultValue.call(void 0,
55
+ includesBaseElement: _MLCPLY2Pcjs.defaultValue.call(void 0,
57
56
  props.includesBaseElement,
58
57
  syncState == null ? void 0 : syncState.includesBaseElement,
59
58
  true
60
59
  ),
61
- orientation: _BTUHABP4cjs.defaultValue.call(void 0,
60
+ orientation: _MLCPLY2Pcjs.defaultValue.call(void 0,
62
61
  props.orientation,
63
62
  syncState == null ? void 0 : syncState.orientation,
64
63
  "vertical"
65
64
  ),
66
- focusLoop: _BTUHABP4cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
67
- focusWrap: _BTUHABP4cjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
68
- virtualFocus: _BTUHABP4cjs.defaultValue.call(void 0,
65
+ focusLoop: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
66
+ focusWrap: _MLCPLY2Pcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
67
+ virtualFocus: _MLCPLY2Pcjs.defaultValue.call(void 0,
69
68
  props.virtualFocus,
70
69
  syncState == null ? void 0 : syncState.virtualFocus,
71
70
  true
72
71
  )
73
72
  }));
74
- const popover = _H6ZQSQQLcjs.createPopoverStore.call(void 0, _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, props), {
75
- placement: _BTUHABP4cjs.defaultValue.call(void 0,
73
+ const popover = _C5P5S22Jcjs.createPopoverStore.call(void 0, _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, props), {
74
+ placement: _MLCPLY2Pcjs.defaultValue.call(void 0,
76
75
  props.placement,
77
76
  syncState == null ? void 0 : syncState.placement,
78
77
  "bottom-start"
79
78
  )
80
79
  }));
81
- const value = _BTUHABP4cjs.defaultValue.call(void 0,
80
+ const value = _MLCPLY2Pcjs.defaultValue.call(void 0,
82
81
  props.value,
83
82
  syncState == null ? void 0 : syncState.value,
84
83
  props.defaultValue,
85
84
  ""
86
85
  );
87
- const selectedValue = _BTUHABP4cjs.defaultValue.call(void 0,
86
+ const selectedValue = _MLCPLY2Pcjs.defaultValue.call(void 0,
88
87
  props.selectedValue,
89
88
  syncState == null ? void 0 : syncState.selectedValue,
90
89
  tagState == null ? void 0 : tagState.values,
@@ -92,76 +91,76 @@ function createComboboxStore(_a = {}) {
92
91
  ""
93
92
  );
94
93
  const multiSelectable = Array.isArray(selectedValue);
95
- const initialState = _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
94
+ const initialState = _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
96
95
  value,
97
96
  selectedValue,
98
- resetValueOnSelect: _BTUHABP4cjs.defaultValue.call(void 0,
97
+ resetValueOnSelect: _MLCPLY2Pcjs.defaultValue.call(void 0,
99
98
  props.resetValueOnSelect,
100
99
  syncState == null ? void 0 : syncState.resetValueOnSelect,
101
100
  multiSelectable
102
101
  ),
103
- resetValueOnHide: _BTUHABP4cjs.defaultValue.call(void 0,
102
+ resetValueOnHide: _MLCPLY2Pcjs.defaultValue.call(void 0,
104
103
  props.resetValueOnHide,
105
104
  syncState == null ? void 0 : syncState.resetValueOnHide,
106
105
  multiSelectable && !tag
107
106
  ),
108
107
  activeValue: syncState == null ? void 0 : syncState.activeValue
109
108
  });
110
- const combobox = _3QF3ODTRcjs.createStore.call(void 0, initialState, composite, popover, store);
109
+ const combobox = _BSLRW6E7cjs.createStore.call(void 0, initialState, composite, popover, store);
111
110
  if (isTouchSafari) {
112
- _3QF3ODTRcjs.setup.call(void 0,
111
+ _BSLRW6E7cjs.setup.call(void 0,
113
112
  combobox,
114
- () => _3QF3ODTRcjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
113
+ () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["virtualFocus"], () => {
115
114
  combobox.setState("virtualFocus", false);
116
115
  })
117
116
  );
118
117
  }
119
- _3QF3ODTRcjs.setup.call(void 0, combobox, () => {
118
+ _BSLRW6E7cjs.setup.call(void 0, combobox, () => {
120
119
  if (!tag) return;
121
- return _BTUHABP4cjs.chain.call(void 0,
122
- _3QF3ODTRcjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
120
+ return _MLCPLY2Pcjs.chain.call(void 0,
121
+ _BSLRW6E7cjs.sync.call(void 0, combobox, ["selectedValue"], (state) => {
123
122
  if (!Array.isArray(state.selectedValue)) return;
124
123
  tag.setValues(state.selectedValue);
125
124
  }),
126
- _3QF3ODTRcjs.sync.call(void 0, tag, ["values"], (state) => {
125
+ _BSLRW6E7cjs.sync.call(void 0, tag, ["values"], (state) => {
127
126
  combobox.setState("selectedValue", state.values);
128
127
  })
129
128
  );
130
129
  });
131
- _3QF3ODTRcjs.setup.call(void 0,
130
+ _BSLRW6E7cjs.setup.call(void 0,
132
131
  combobox,
133
- () => _3QF3ODTRcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
132
+ () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
134
133
  if (!state.resetValueOnHide) return;
135
134
  if (state.mounted) return;
136
135
  combobox.setState("value", value);
137
136
  })
138
137
  );
139
- _3QF3ODTRcjs.setup.call(void 0,
138
+ _BSLRW6E7cjs.setup.call(void 0,
140
139
  combobox,
141
- () => _3QF3ODTRcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
142
- if (state.mounted) return;
140
+ () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["open"], (state) => {
141
+ if (state.open) return;
143
142
  combobox.setState("activeId", activeId);
144
143
  combobox.setState("moves", 0);
145
144
  })
146
145
  );
147
- _3QF3ODTRcjs.setup.call(void 0,
146
+ _BSLRW6E7cjs.setup.call(void 0,
148
147
  combobox,
149
- () => _3QF3ODTRcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
148
+ () => _BSLRW6E7cjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
150
149
  if (state.moves === prevState.moves) {
151
150
  combobox.setState("activeValue", void 0);
152
151
  }
153
152
  })
154
153
  );
155
- _3QF3ODTRcjs.setup.call(void 0,
154
+ _BSLRW6E7cjs.setup.call(void 0,
156
155
  combobox,
157
- () => _3QF3ODTRcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
156
+ () => _BSLRW6E7cjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
158
157
  if (state.moves === prev.moves) return;
159
158
  const { activeId: activeId2 } = combobox.getState();
160
159
  const activeItem = composite.item(activeId2);
161
160
  combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
162
161
  })
163
162
  );
164
- return _3IVNQNIVcjs.__spreadProps.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, _3IVNQNIVcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
163
+ return _7EQBAZ46cjs.__spreadProps.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, _7EQBAZ46cjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
165
164
  tag,
166
165
  setValue: (value2) => combobox.setState("value", value2),
167
166
  resetValue: () => combobox.setState("value", initialState.value),
@@ -1,16 +1,15 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
- var _H6ZQSQQLcjs = require('../__chunks/H6ZQSQQL.cjs');
5
- require('../__chunks/N667HVED.cjs');
6
- require('../__chunks/QLWAGBAQ.cjs');
7
- require('../__chunks/3QF3ODTR.cjs');
8
- require('../__chunks/BTUHABP4.cjs');
9
- require('../__chunks/3IVNQNIV.cjs');
3
+ var _C5P5S22Jcjs = require('../__chunks/C5P5S22J.cjs');
4
+ require('../__chunks/I2G6EN27.cjs');
5
+ require('../__chunks/G2MFLTB2.cjs');
6
+ require('../__chunks/BSLRW6E7.cjs');
7
+ require('../__chunks/MLCPLY2P.cjs');
8
+ require('../__chunks/7EQBAZ46.cjs');
10
9
 
11
10
  // src/composite/composite-overflow-store.ts
12
11
  function createCompositeOverflowStore(props = {}) {
13
- return _H6ZQSQQLcjs.createPopoverStore.call(void 0, props);
12
+ return _C5P5S22Jcjs.createPopoverStore.call(void 0, props);
14
13
  }
15
14
 
16
15
 
@@ -1,13 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _W3GMUKTUcjs = require('../__chunks/W3GMUKTU.cjs');
4
+ require('../__chunks/G2NIRMCL.cjs');
5
+ require('../__chunks/GDZQUFNP.cjs');
6
+ require('../__chunks/BSLRW6E7.cjs');
7
+ require('../__chunks/MLCPLY2P.cjs');
8
+ require('../__chunks/WCFMOJKV.cjs');
9
+ require('../__chunks/7EQBAZ46.cjs');
3
10
 
4
- var _PW36G76Lcjs = require('../__chunks/PW36G76L.cjs');
5
- require('../__chunks/CCI5VM7E.cjs');
6
- require('../__chunks/ULSPM3Y3.cjs');
7
- require('../__chunks/3QF3ODTR.cjs');
8
- require('../__chunks/BTUHABP4.cjs');
9
- require('../__chunks/7WYII4AN.cjs');
10
- require('../__chunks/3IVNQNIV.cjs');
11
11
 
12
-
13
- exports.createCompositeStore = _PW36G76Lcjs.createCompositeStore;
12
+ exports.createCompositeStore = _W3GMUKTUcjs.createCompositeStore;