@ariakit/core 0.3.3 → 0.3.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 (122) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/cjs/__chunks/{RCYVACJO.cjs → 3UT5FE6K.cjs} +9 -4
  3. package/cjs/__chunks/{TTWS4MDC.cjs → AR2VJ37F.cjs} +30 -29
  4. package/cjs/__chunks/{72I2GWXF.cjs → AV6KTKLE.cjs} +2 -1
  5. package/cjs/__chunks/F5YZIIEA.cjs +29 -0
  6. package/cjs/__chunks/{A7K3KZJL.cjs → F6Q5QSXF.cjs} +20 -19
  7. package/cjs/__chunks/{W5IQT6Z2.cjs → FFY2GSOG.cjs} +17 -16
  8. package/cjs/__chunks/{A4GDJCZB.cjs → FJSZTIOU.cjs} +18 -17
  9. package/cjs/__chunks/{EXM2AW52.cjs → FTB5CXVB.cjs} +3 -1
  10. package/cjs/__chunks/{EIRIJC7T.cjs → G5EW4WED.cjs} +8 -7
  11. package/cjs/__chunks/{ZYIEFAMB.cjs → HOEZKRUM.cjs} +18 -17
  12. package/cjs/__chunks/{DFFIYGBS.cjs → MYTMMWXI.cjs} +4 -3
  13. package/cjs/__chunks/{GDZQUFNP.cjs → ULSPM3Y3.cjs} +3 -1
  14. package/cjs/__chunks/XVR5QRC3.cjs +42 -0
  15. package/cjs/checkbox/checkbox-store.cjs +9 -8
  16. package/cjs/checkbox/checkbox-store.d.cts +41 -0
  17. package/cjs/collection/collection-store.cjs +8 -7
  18. package/cjs/collection/collection-store.d.cts +65 -0
  19. package/cjs/combobox/combobox-store.cjs +37 -36
  20. package/cjs/combobox/combobox-store.d.cts +77 -0
  21. package/cjs/composite/composite-overflow-store.cjs +9 -8
  22. package/cjs/composite/composite-overflow-store.d.cts +10 -0
  23. package/cjs/composite/composite-store.cjs +10 -9
  24. package/cjs/composite/composite-store.d.cts +206 -0
  25. package/cjs/dialog/dialog-store.cjs +8 -7
  26. package/cjs/dialog/dialog-store.d.cts +10 -0
  27. package/cjs/disclosure/disclosure-store.cjs +7 -6
  28. package/cjs/disclosure/disclosure-store.d.cts +125 -0
  29. package/cjs/form/form-store.cjs +30 -29
  30. package/cjs/form/form-store.d.cts +236 -0
  31. package/cjs/form/types.cjs +1 -1
  32. package/cjs/form/types.d.cts +38 -0
  33. package/cjs/hovercard/hovercard-store.cjs +10 -9
  34. package/cjs/hovercard/hovercard-store.d.cts +46 -0
  35. package/cjs/index.cjs +2 -1
  36. package/cjs/index.d.cts +2 -0
  37. package/cjs/menu/menu-bar-store.cjs +10 -22
  38. package/cjs/menu/menu-bar-store.d.cts +10 -0
  39. package/cjs/menu/menu-bar-store.d.ts +6 -6
  40. package/cjs/menu/menu-store.cjs +35 -34
  41. package/cjs/menu/menu-store.d.cts +78 -0
  42. package/cjs/menubar/menubar-store.cjs +14 -0
  43. package/cjs/menubar/menubar-store.d.cts +10 -0
  44. package/cjs/menubar/menubar-store.d.ts +10 -0
  45. package/cjs/popover/popover-store.cjs +9 -8
  46. package/cjs/popover/popover-store.d.cts +69 -0
  47. package/cjs/radio/radio-store.cjs +16 -15
  48. package/cjs/radio/radio-store.d.cts +36 -0
  49. package/cjs/select/select-store.cjs +37 -36
  50. package/cjs/select/select-store.d.cts +93 -0
  51. package/cjs/tab/tab-store.cjs +28 -27
  52. package/cjs/tab/tab-store.d.cts +87 -0
  53. package/cjs/toolbar/toolbar-store.cjs +12 -11
  54. package/cjs/toolbar/toolbar-store.d.cts +21 -0
  55. package/cjs/tooltip/tooltip-store.cjs +17 -16
  56. package/cjs/tooltip/tooltip-store.d.cts +29 -0
  57. package/cjs/utils/array.cjs +5 -4
  58. package/cjs/utils/array.d.cts +29 -0
  59. package/cjs/utils/dom.cjs +5 -4
  60. package/cjs/utils/dom.d.cts +105 -0
  61. package/cjs/utils/events.cjs +10 -9
  62. package/cjs/utils/events.d.cts +70 -0
  63. package/cjs/utils/focus.cjs +17 -16
  64. package/cjs/utils/focus.d.cts +117 -0
  65. package/cjs/utils/misc.cjs +7 -4
  66. package/cjs/utils/misc.d.cts +124 -0
  67. package/cjs/utils/misc.d.ts +7 -0
  68. package/cjs/utils/platform.cjs +6 -5
  69. package/cjs/utils/platform.d.cts +20 -0
  70. package/cjs/utils/store.cjs +6 -5
  71. package/cjs/utils/store.d.cts +71 -0
  72. package/cjs/utils/types.cjs +1 -1
  73. package/cjs/utils/types.d.cts +74 -0
  74. package/esm/__chunks/{PNRLI7OV.js → 4R3V3JGP.js} +1 -0
  75. package/esm/__chunks/{E6THWJ7N.js → 5BWT4GY2.js} +6 -5
  76. package/esm/__chunks/{UCFCIHEU.js → 5UJPJ37G.js} +2 -1
  77. package/esm/__chunks/{C57Q2UMF.js → 6EMNXRG3.js} +5 -4
  78. package/esm/__chunks/6LSGADQM.js +29 -0
  79. package/esm/__chunks/{5XEKIOCW.js → 7PRQYBBV.js} +2 -0
  80. package/esm/__chunks/{HN27WCTM.js → DREIYIMP.js} +2 -1
  81. package/esm/__chunks/{L4QLJSLG.js → EIFVU736.js} +5 -4
  82. package/esm/__chunks/{Y5SJEQQJ.js → HJS6GJT4.js} +3 -2
  83. package/esm/__chunks/{WVTCK5PV.js → I2VQ3XGR.js} +6 -1
  84. package/esm/__chunks/{JLNC5RR2.js → MRBDYBGO.js} +5 -4
  85. package/esm/__chunks/{O35LWD4W.js → NIF7E7VE.js} +2 -0
  86. package/esm/__chunks/{A2MHRHOV.js → PCA5ARZU.js} +4 -3
  87. package/esm/checkbox/checkbox-store.js +4 -3
  88. package/esm/collection/collection-store.js +6 -5
  89. package/esm/combobox/combobox-store.js +12 -11
  90. package/esm/composite/composite-overflow-store.js +7 -6
  91. package/esm/composite/composite-store.js +8 -7
  92. package/esm/dialog/dialog-store.js +6 -5
  93. package/esm/disclosure/disclosure-store.js +5 -4
  94. package/esm/form/form-store.js +6 -5
  95. package/esm/form/types.js +1 -0
  96. package/esm/hovercard/hovercard-store.js +8 -7
  97. package/esm/index.js +2 -1
  98. package/esm/menu/menu-bar-store.d.ts +6 -6
  99. package/esm/menu/menu-bar-store.js +11 -23
  100. package/esm/menu/menu-store.js +12 -11
  101. package/esm/menubar/menubar-store.d.ts +10 -0
  102. package/esm/menubar/menubar-store.js +14 -0
  103. package/esm/popover/popover-store.js +7 -6
  104. package/esm/radio/radio-store.js +8 -7
  105. package/esm/select/select-store.js +11 -10
  106. package/esm/tab/tab-store.js +8 -7
  107. package/esm/toolbar/toolbar-store.js +8 -7
  108. package/esm/tooltip/tooltip-store.js +8 -7
  109. package/esm/utils/array.js +3 -2
  110. package/esm/utils/dom.js +3 -2
  111. package/esm/utils/events.js +4 -3
  112. package/esm/utils/focus.js +3 -2
  113. package/esm/utils/misc.d.ts +7 -0
  114. package/esm/utils/misc.js +5 -2
  115. package/esm/utils/platform.js +4 -3
  116. package/esm/utils/store.js +4 -3
  117. package/esm/utils/types.js +1 -0
  118. package/menubar/menubar-store/package.json +8 -0
  119. package/package.json +116 -28
  120. package/cjs/__chunks/NEBQQIUX.cjs +0 -41
  121. package/cjs/tsconfig.build.tsbuildinfo +0 -1
  122. package/esm/tsconfig.build.tsbuildinfo +0 -1
@@ -1,10 +1,11 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
- var _A7K3KZJLcjs = require('./A7K3KZJL.cjs');
3
+
4
+ var _F6Q5QSXFcjs = require('./F6Q5QSXF.cjs');
4
5
 
5
6
  // src/dialog/dialog-store.ts
6
7
  function createDialogStore(props = {}) {
7
- return _A7K3KZJLcjs.createDisclosureStore.call(void 0, props);
8
+ return _F6Q5QSXFcjs.createDisclosureStore.call(void 0, props);
8
9
  }
9
10
 
10
11
 
@@ -1,4 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/array.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+ // src/utils/array.ts
2
4
  function toArray(arg) {
3
5
  if (Array.isArray(arg)) {
4
6
  return arg;
@@ -0,0 +1,42 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+
3
+
4
+ var _HOEZKRUMcjs = require('./HOEZKRUM.cjs');
5
+
6
+
7
+ var _FJSZTIOUcjs = require('./FJSZTIOU.cjs');
8
+
9
+
10
+ var _3UT5FE6Kcjs = require('./3UT5FE6K.cjs');
11
+
12
+
13
+
14
+ var _AV6KTKLEcjs = require('./AV6KTKLE.cjs');
15
+
16
+ // src/hovercard/hovercard-store.ts
17
+ function createHovercardStore(props = {}) {
18
+ var _a;
19
+ const syncState = (_a = props.store) == null ? void 0 : _a.getState();
20
+ const popover = _HOEZKRUMcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
21
+ placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
22
+ props.placement,
23
+ syncState == null ? void 0 : syncState.placement,
24
+ "bottom"
25
+ )
26
+ }));
27
+ const timeout = _3UT5FE6Kcjs.defaultValue.call(void 0, props.timeout, syncState == null ? void 0 : syncState.timeout, 500);
28
+ const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover.getState()), {
29
+ timeout,
30
+ showTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.showTimeout, syncState == null ? void 0 : syncState.showTimeout),
31
+ hideTimeout: _3UT5FE6Kcjs.defaultValue.call(void 0, props.hideTimeout, syncState == null ? void 0 : syncState.hideTimeout),
32
+ autoFocusOnShow: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.autoFocusOnShow, false)
33
+ });
34
+ const hovercard = _FJSZTIOUcjs.createStore.call(void 0, initialState, popover, props.store);
35
+ return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), hovercard), {
36
+ setAutoFocusOnShow: (value) => hovercard.setState("autoFocusOnShow", value)
37
+ });
38
+ }
39
+
40
+
41
+
42
+ exports.createHovercardStore = createHovercardStore;
@@ -1,30 +1,31 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _A4GDJCZBcjs = require('../__chunks/A4GDJCZB.cjs');
5
4
 
5
+ var _FJSZTIOUcjs = require('../__chunks/FJSZTIOU.cjs');
6
6
 
7
- var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
8
7
 
8
+ var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
9
9
 
10
10
 
11
- var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
11
+
12
+ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
12
13
 
13
14
  // src/checkbox/checkbox-store.ts
14
15
  function createCheckboxStore(props = {}) {
15
16
  var _a;
16
- _A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, props.store);
17
+ _FJSZTIOUcjs.throwOnConflictingProps.call(void 0, props, props.store);
17
18
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
18
19
  const initialState = {
19
- value: _RCYVACJOcjs.defaultValue.call(void 0,
20
+ value: _3UT5FE6Kcjs.defaultValue.call(void 0,
20
21
  props.value,
21
22
  syncState == null ? void 0 : syncState.value,
22
23
  props.defaultValue,
23
24
  false
24
25
  )
25
26
  };
26
- const checkbox = _A4GDJCZBcjs.createStore.call(void 0, initialState, props.store);
27
- return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, checkbox), {
27
+ const checkbox = _FJSZTIOUcjs.createStore.call(void 0, initialState, props.store);
28
+ return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, checkbox), {
28
29
  setValue: (value) => checkbox.setState("value", value)
29
30
  });
30
31
  }
@@ -0,0 +1,41 @@
1
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
2
+ import type { PickRequired, SetState, ToPrimitive } from "../utils/types.js";
3
+ type Value = boolean | string | number | Array<string | number>;
4
+ /**
5
+ * Creates a checkbox store.
6
+ */
7
+ export declare function createCheckboxStore<T extends Value = Value>(props: PickRequired<CheckboxStoreProps<T>, "value" | "defaultValue">): CheckboxStore<T>;
8
+ export declare function createCheckboxStore(props?: CheckboxStoreProps): CheckboxStore;
9
+ export type CheckboxStoreValue = Value;
10
+ export interface CheckboxStoreState<T extends Value = Value> {
11
+ /**
12
+ * The checked state of the checkbox.
13
+ *
14
+ * Live examples:
15
+ * - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
16
+ */
17
+ value: ToPrimitive<T>;
18
+ }
19
+ export interface CheckboxStoreFunctions<T extends Value = Value> {
20
+ /**
21
+ * Sets the `value` state.
22
+ * @example
23
+ * store.setValue(true);
24
+ * store.setValue((value) => !value);
25
+ */
26
+ setValue: SetState<CheckboxStoreState<T>["value"]>;
27
+ }
28
+ export interface CheckboxStoreOptions<T extends Value = Value> extends StoreOptions<CheckboxStoreState<T>, "value"> {
29
+ /**
30
+ * The default value of the checkbox.
31
+ *
32
+ * Live examples:
33
+ * - [Custom Checkbox](https://ariakit.org/examples/checkbox-custom)
34
+ * - [Checkbox group](https://ariakit.org/examples/checkbox-group)
35
+ * @default false
36
+ */
37
+ defaultValue?: CheckboxStoreState<T>["value"];
38
+ }
39
+ export type CheckboxStoreProps<T extends Value = Value> = CheckboxStoreOptions<T> & StoreProps<CheckboxStoreState<T>>;
40
+ export type CheckboxStore<T extends Value = Value> = CheckboxStoreFunctions<T> & Store<CheckboxStoreState<T>>;
41
+ export {};
@@ -1,10 +1,11 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
- var _W5IQT6Z2cjs = require('../__chunks/W5IQT6Z2.cjs');
4
- require('../__chunks/A4GDJCZB.cjs');
5
- require('../__chunks/RCYVACJO.cjs');
6
- require('../__chunks/EXM2AW52.cjs');
7
- require('../__chunks/72I2GWXF.cjs');
8
3
 
4
+ var _FFY2GSOGcjs = require('../__chunks/FFY2GSOG.cjs');
5
+ require('../__chunks/FJSZTIOU.cjs');
6
+ require('../__chunks/3UT5FE6K.cjs');
7
+ require('../__chunks/FTB5CXVB.cjs');
8
+ require('../__chunks/AV6KTKLE.cjs');
9
9
 
10
- exports.createCollectionStore = _W5IQT6Z2cjs.createCollectionStore;
10
+
11
+ exports.createCollectionStore = _FFY2GSOGcjs.createCollectionStore;
@@ -0,0 +1,65 @@
1
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
2
+ import type { BivariantCallback } from "../utils/types.js";
3
+ type Item = {
4
+ id: string;
5
+ element?: HTMLElement | null;
6
+ };
7
+ /**
8
+ * Creates a collection store.
9
+ */
10
+ export declare function createCollectionStore<T extends Item = Item>(props?: CollectionStoreProps<T>): CollectionStore<T>;
11
+ export type CollectionStoreItem = Item;
12
+ export interface CollectionStoreState<T extends Item = Item> {
13
+ /**
14
+ * Lists all the items with their meta data. This state is automatically
15
+ * updated when an item is registered or unregistered with the `registerItem`
16
+ * function.
17
+ */
18
+ items: T[];
19
+ /**
20
+ * Lists all the items that are currently rendered. This state is
21
+ * automatically updated when an item is rendered or unrendered with the
22
+ * `renderItem` function. This state is also automatically sorted based on
23
+ * their DOM position.
24
+ */
25
+ renderedItems: T[];
26
+ }
27
+ export interface CollectionStoreFunctions<T extends Item = Item> {
28
+ /**
29
+ * Registers an item in the collection. This function returns a cleanup
30
+ * function that unregisters the item.
31
+ * @param item The item to register.
32
+ * @example
33
+ * const unregisterItem = store.registerItem({ id: "item-1" });
34
+ * // on cleanup
35
+ * unregisterItem();
36
+ */
37
+ registerItem: BivariantCallback<(item: T) => () => void>;
38
+ /**
39
+ * Renders an item in the collection. This function returns a cleanup function
40
+ * that unrenders the item.
41
+ * @param item The item to render.
42
+ * @example
43
+ * const unrenderItem = store.renderItem({ id: "item-1" });
44
+ * // on cleanup
45
+ * unrenderItem();
46
+ */
47
+ renderItem: BivariantCallback<(item: T) => () => void>;
48
+ /**
49
+ * Gets an item by its id.
50
+ * @param id The id of the item.
51
+ * @example
52
+ * const item = store.item("item-1");
53
+ */
54
+ item: (id: string | null | undefined) => T | null;
55
+ }
56
+ export interface CollectionStoreOptions<T extends Item = Item> extends StoreOptions<CollectionStoreState<T>, "items"> {
57
+ /**
58
+ * The defaut value for the `items` state.
59
+ * @default []
60
+ */
61
+ defaultItems?: CollectionStoreState<T>["items"];
62
+ }
63
+ export type CollectionStoreProps<T extends Item = Item> = CollectionStoreOptions<T> & StoreProps<CollectionStoreState<T>>;
64
+ export type CollectionStore<T extends Item = Item> = CollectionStoreFunctions<T> & Store<CollectionStoreState<T>>;
65
+ export {};
@@ -1,91 +1,92 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
- var _ZYIEFAMBcjs = require('../__chunks/ZYIEFAMB.cjs');
4
- require('../__chunks/DFFIYGBS.cjs');
5
- require('../__chunks/A7K3KZJL.cjs');
6
3
 
4
+ var _HOEZKRUMcjs = require('../__chunks/HOEZKRUM.cjs');
5
+ require('../__chunks/MYTMMWXI.cjs');
6
+ require('../__chunks/F6Q5QSXF.cjs');
7
7
 
8
- var _TTWS4MDCcjs = require('../__chunks/TTWS4MDC.cjs');
9
- require('../__chunks/W5IQT6Z2.cjs');
10
8
 
9
+ var _AR2VJ37Fcjs = require('../__chunks/AR2VJ37F.cjs');
10
+ require('../__chunks/FFY2GSOG.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
- var _A4GDJCZBcjs = require('../__chunks/A4GDJCZB.cjs');
17
16
 
17
+ var _FJSZTIOUcjs = require('../__chunks/FJSZTIOU.cjs');
18
18
 
19
- var _RCYVACJOcjs = require('../__chunks/RCYVACJO.cjs');
20
19
 
20
+ var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
21
21
 
22
22
 
23
- var _EIRIJC7Tcjs = require('../__chunks/EIRIJC7T.cjs');
24
- require('../__chunks/EXM2AW52.cjs');
25
- require('../__chunks/GDZQUFNP.cjs');
26
23
 
24
+ var _G5EW4WEDcjs = require('../__chunks/G5EW4WED.cjs');
25
+ require('../__chunks/FTB5CXVB.cjs');
26
+ require('../__chunks/ULSPM3Y3.cjs');
27
27
 
28
28
 
29
- var _72I2GWXFcjs = require('../__chunks/72I2GWXF.cjs');
29
+
30
+ var _AV6KTKLEcjs = require('../__chunks/AV6KTKLE.cjs');
30
31
 
31
32
  // src/combobox/combobox-store.ts
32
- var isSafariOnMobile = _EIRIJC7Tcjs.isSafari.call(void 0, ) && _EIRIJC7Tcjs.isTouchDevice.call(void 0, );
33
+ var isSafariOnMobile = _G5EW4WEDcjs.isSafari.call(void 0, ) && _G5EW4WEDcjs.isTouchDevice.call(void 0, );
33
34
  function createComboboxStore(props = {}) {
34
35
  var _a;
35
- _A4GDJCZBcjs.throwOnConflictingProps.call(void 0, props, props.store);
36
+ _FJSZTIOUcjs.throwOnConflictingProps.call(void 0, props, props.store);
36
37
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
37
- const activeId = _RCYVACJOcjs.defaultValue.call(void 0,
38
+ const activeId = _3UT5FE6Kcjs.defaultValue.call(void 0,
38
39
  props.activeId,
39
40
  syncState == null ? void 0 : syncState.activeId,
40
41
  props.defaultActiveId,
41
42
  null
42
43
  );
43
- const composite = _TTWS4MDCcjs.createCompositeStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
44
+ const composite = _AR2VJ37Fcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
44
45
  activeId,
45
- includesBaseElement: _RCYVACJOcjs.defaultValue.call(void 0,
46
+ includesBaseElement: _3UT5FE6Kcjs.defaultValue.call(void 0,
46
47
  props.includesBaseElement,
47
48
  syncState == null ? void 0 : syncState.includesBaseElement,
48
49
  true
49
50
  ),
50
- orientation: _RCYVACJOcjs.defaultValue.call(void 0,
51
+ orientation: _3UT5FE6Kcjs.defaultValue.call(void 0,
51
52
  props.orientation,
52
53
  syncState == null ? void 0 : syncState.orientation,
53
54
  "vertical"
54
55
  ),
55
- focusLoop: _RCYVACJOcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
56
- focusWrap: _RCYVACJOcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
57
- virtualFocus: _RCYVACJOcjs.defaultValue.call(void 0,
56
+ focusLoop: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
57
+ focusWrap: _3UT5FE6Kcjs.defaultValue.call(void 0, props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
58
+ virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
58
59
  props.virtualFocus,
59
60
  syncState == null ? void 0 : syncState.virtualFocus,
60
61
  !isSafariOnMobile
61
62
  )
62
63
  }));
63
- const popover = _ZYIEFAMBcjs.createPopoverStore.call(void 0, _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, props), {
64
- placement: _RCYVACJOcjs.defaultValue.call(void 0,
64
+ const popover = _HOEZKRUMcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
65
+ placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
65
66
  props.placement,
66
67
  syncState == null ? void 0 : syncState.placement,
67
68
  "bottom-start"
68
69
  )
69
70
  }));
70
- const initialValue = _RCYVACJOcjs.defaultValue.call(void 0,
71
+ const initialValue = _3UT5FE6Kcjs.defaultValue.call(void 0,
71
72
  props.value,
72
73
  syncState == null ? void 0 : syncState.value,
73
74
  props.defaultValue,
74
75
  ""
75
76
  );
76
- const initialState = _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
77
+ const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), popover.getState()), {
77
78
  value: initialValue,
78
- resetValueOnHide: _RCYVACJOcjs.defaultValue.call(void 0,
79
+ resetValueOnHide: _3UT5FE6Kcjs.defaultValue.call(void 0,
79
80
  props.resetValueOnHide,
80
81
  syncState == null ? void 0 : syncState.resetValueOnHide,
81
82
  false
82
83
  ),
83
84
  activeValue: syncState == null ? void 0 : syncState.activeValue
84
85
  });
85
- const combobox = _A4GDJCZBcjs.createStore.call(void 0, initialState, composite, popover, props.store);
86
- _A4GDJCZBcjs.setup.call(void 0,
86
+ const combobox = _FJSZTIOUcjs.createStore.call(void 0, initialState, composite, popover, props.store);
87
+ _FJSZTIOUcjs.setup.call(void 0,
87
88
  combobox,
88
- () => _A4GDJCZBcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
89
+ () => _FJSZTIOUcjs.sync.call(void 0, combobox, ["resetValueOnHide", "mounted"], (state) => {
89
90
  if (!state.resetValueOnHide)
90
91
  return;
91
92
  if (state.mounted)
@@ -93,26 +94,26 @@ function createComboboxStore(props = {}) {
93
94
  combobox.setState("value", initialValue);
94
95
  })
95
96
  );
96
- _A4GDJCZBcjs.setup.call(void 0,
97
+ _FJSZTIOUcjs.setup.call(void 0,
97
98
  combobox,
98
- () => _A4GDJCZBcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
99
+ () => _FJSZTIOUcjs.batch.call(void 0, combobox, ["mounted"], (state) => {
99
100
  if (state.mounted)
100
101
  return;
101
102
  combobox.setState("activeId", activeId);
102
103
  combobox.setState("moves", 0);
103
104
  })
104
105
  );
105
- _A4GDJCZBcjs.setup.call(void 0,
106
+ _FJSZTIOUcjs.setup.call(void 0,
106
107
  combobox,
107
- () => _A4GDJCZBcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
108
+ () => _FJSZTIOUcjs.sync.call(void 0, combobox, ["moves", "activeId"], (state, prevState) => {
108
109
  if (state.moves === prevState.moves) {
109
110
  combobox.setState("activeValue", void 0);
110
111
  }
111
112
  })
112
113
  );
113
- _A4GDJCZBcjs.setup.call(void 0,
114
+ _FJSZTIOUcjs.setup.call(void 0,
114
115
  combobox,
115
- () => _A4GDJCZBcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
116
+ () => _FJSZTIOUcjs.batch.call(void 0, combobox, ["moves", "renderedItems"], (state, prev) => {
116
117
  if (state.moves === prev.moves)
117
118
  return;
118
119
  const { activeId: activeId2 } = combobox.getState();
@@ -120,7 +121,7 @@ function createComboboxStore(props = {}) {
120
121
  combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
121
122
  })
122
123
  );
123
- return _72I2GWXFcjs.__spreadProps.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, _72I2GWXFcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
124
+ return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, popover), composite), combobox), {
124
125
  setValue: (value) => combobox.setState("value", value)
125
126
  });
126
127
  }
@@ -0,0 +1,77 @@
1
+ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
+ import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
3
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
4
+ import type { SetState } from "../utils/types.js";
5
+ type Item = CompositeStoreItem & {
6
+ value?: string;
7
+ };
8
+ /**
9
+ * Creates a combobox store.
10
+ */
11
+ export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
12
+ export type ComboboxStoreItem = Item;
13
+ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverStoreState {
14
+ /**
15
+ * @default true
16
+ */
17
+ includesBaseElement: boolean;
18
+ /**
19
+ * The input value.
20
+ *
21
+ * Live examples:
22
+ * - [ComboboxGroup](https://ariakit.org/examples/combobox-group)
23
+ * - [Combobox with links](https://ariakit.org/examples/combobox-links)
24
+ * - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
25
+ * - [Multi-selectable
26
+ * Combobox](https://ariakit.org/examples/combobox-multiple)
27
+ * - [Textarea with inline
28
+ * Combobox](https://ariakit.org/examples/combobox-textarea)
29
+ */
30
+ value: string;
31
+ /**
32
+ * The value of the current active item.
33
+ */
34
+ activeValue: string | undefined;
35
+ /**
36
+ * Whether to reset the value when the combobox popover is hidden.
37
+ *
38
+ * Live examples:
39
+ * - [Multi-selectable
40
+ * Combobox](https://ariakit.org/examples/combobox-multiple)
41
+ * @default false
42
+ */
43
+ resetValueOnHide: boolean;
44
+ }
45
+ export interface ComboboxStoreFunctions extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
46
+ /**
47
+ * Sets the `value` state.
48
+ *
49
+ * Live examples:
50
+ * - [Multi-selectable
51
+ * Combobox](https://ariakit.org/examples/combobox-multiple)
52
+ * - [Textarea with inline
53
+ * Combobox](https://ariakit.org/examples/combobox-textarea)
54
+ * @example
55
+ * store.setValue("Hello world");
56
+ * store.setValue((value) => value + "!");
57
+ */
58
+ setValue: SetState<ComboboxStoreState["value"]>;
59
+ }
60
+ export interface ComboboxStoreOptions extends StoreOptions<ComboboxStoreState, "includesBaseElement" | "value" | "resetValueOnHide">, CompositeStoreOptions<Item>, PopoverStoreOptions {
61
+ /**
62
+ * @default null
63
+ */
64
+ defaultActiveId?: CompositeStoreOptions<Item>["activeId"];
65
+ /**
66
+ * The combobox initial value.
67
+ *
68
+ * Live examples:
69
+ * - [Multi-selectable
70
+ * Combobox](https://ariakit.org/examples/combobox-multiple)
71
+ * @default ""
72
+ */
73
+ defaultValue?: ComboboxStoreState["value"];
74
+ }
75
+ export type ComboboxStoreProps = ComboboxStoreOptions & StoreProps<ComboboxStoreState>;
76
+ export type ComboboxStore = ComboboxStoreFunctions & Store<ComboboxStoreState>;
77
+ export {};
@@ -1,15 +1,16 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
- var _ZYIEFAMBcjs = require('../__chunks/ZYIEFAMB.cjs');
4
- require('../__chunks/DFFIYGBS.cjs');
5
- require('../__chunks/A7K3KZJL.cjs');
6
- require('../__chunks/A4GDJCZB.cjs');
7
- require('../__chunks/RCYVACJO.cjs');
8
- require('../__chunks/72I2GWXF.cjs');
3
+
4
+ var _HOEZKRUMcjs = require('../__chunks/HOEZKRUM.cjs');
5
+ require('../__chunks/MYTMMWXI.cjs');
6
+ require('../__chunks/F6Q5QSXF.cjs');
7
+ require('../__chunks/FJSZTIOU.cjs');
8
+ require('../__chunks/3UT5FE6K.cjs');
9
+ require('../__chunks/AV6KTKLE.cjs');
9
10
 
10
11
  // src/composite/composite-overflow-store.ts
11
12
  function createCompositeOverflowStore(props = {}) {
12
- return _ZYIEFAMBcjs.createPopoverStore.call(void 0, props);
13
+ return _HOEZKRUMcjs.createPopoverStore.call(void 0, props);
13
14
  }
14
15
 
15
16
 
@@ -0,0 +1,10 @@
1
+ import type { PopoverStore, PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreProps, PopoverStoreState } from "../popover/popover-store.js";
2
+ /**
3
+ * Creates a composite overflow store.
4
+ */
5
+ export declare function createCompositeOverflowStore(props?: CompositeOverflowStoreProps): CompositeOverflowStore;
6
+ export type CompositeOverflowStoreState = PopoverStoreState;
7
+ export type CompositeOverflowStoreFunctions = PopoverStoreFunctions;
8
+ export type CompositeOverflowStoreOptions = PopoverStoreOptions;
9
+ export type CompositeOverflowStoreProps = PopoverStoreProps;
10
+ export type CompositeOverflowStore = PopoverStore;
@@ -1,12 +1,13 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
- var _TTWS4MDCcjs = require('../__chunks/TTWS4MDC.cjs');
4
- require('../__chunks/W5IQT6Z2.cjs');
5
- require('../__chunks/A4GDJCZB.cjs');
6
- require('../__chunks/RCYVACJO.cjs');
7
- require('../__chunks/EXM2AW52.cjs');
8
- require('../__chunks/GDZQUFNP.cjs');
9
- require('../__chunks/72I2GWXF.cjs');
10
3
 
4
+ var _AR2VJ37Fcjs = require('../__chunks/AR2VJ37F.cjs');
5
+ require('../__chunks/FFY2GSOG.cjs');
6
+ require('../__chunks/FJSZTIOU.cjs');
7
+ require('../__chunks/3UT5FE6K.cjs');
8
+ require('../__chunks/FTB5CXVB.cjs');
9
+ require('../__chunks/ULSPM3Y3.cjs');
10
+ require('../__chunks/AV6KTKLE.cjs');
11
11
 
12
- exports.createCompositeStore = _TTWS4MDCcjs.createCompositeStore;
12
+
13
+ exports.createCompositeStore = _AR2VJ37Fcjs.createCompositeStore;