@ariakit/core 0.4.4 → 0.4.6

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 (128) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/cjs/__chunks/{Y7KNI5NS.cjs → 3HYNC3XA.cjs} +5 -5
  3. package/cjs/__chunks/{FFZYCAXA.cjs → 4W3OYRR3.cjs} +2 -2
  4. package/cjs/__chunks/{SU2BSHGB.cjs → B4AKUC4S.cjs} +2 -2
  5. package/cjs/__chunks/{7DU6YMLQ.cjs → D7M2PCAQ.cjs} +6 -6
  6. package/cjs/__chunks/LPDHSEHU.cjs +71 -0
  7. package/cjs/__chunks/{UKR6TQI3.cjs → Q2WCPTYS.cjs} +37 -39
  8. package/cjs/checkbox/checkbox-store.d.cts +2 -2
  9. package/cjs/checkbox/checkbox-store.d.ts +2 -2
  10. package/cjs/collection/collection-store.cjs +3 -3
  11. package/cjs/collection/collection-store.d.cts +2 -2
  12. package/cjs/collection/collection-store.d.ts +2 -2
  13. package/cjs/combobox/combobox-store.cjs +50 -22
  14. package/cjs/combobox/combobox-store.d.cts +20 -9
  15. package/cjs/combobox/combobox-store.d.ts +20 -9
  16. package/cjs/composite/composite-overflow-store.d.cts +2 -2
  17. package/cjs/composite/composite-overflow-store.d.ts +2 -2
  18. package/cjs/composite/composite-store.cjs +5 -5
  19. package/cjs/composite/composite-store.d.cts +3 -3
  20. package/cjs/composite/composite-store.d.ts +3 -3
  21. package/cjs/dialog/dialog-store.d.cts +2 -2
  22. package/cjs/dialog/dialog-store.d.ts +2 -2
  23. package/cjs/disclosure/disclosure-store.d.cts +2 -2
  24. package/cjs/disclosure/disclosure-store.d.ts +2 -2
  25. package/cjs/form/form-store.cjs +3 -3
  26. package/cjs/form/form-store.d.cts +4 -4
  27. package/cjs/form/form-store.d.ts +4 -4
  28. package/cjs/form/types.d.cts +3 -3
  29. package/cjs/form/types.d.ts +3 -3
  30. package/cjs/hovercard/hovercard-store.d.cts +3 -3
  31. package/cjs/hovercard/hovercard-store.d.ts +3 -3
  32. package/cjs/menu/menu-bar-store.cjs +6 -6
  33. package/cjs/menu/menu-bar-store.d.cts +2 -2
  34. package/cjs/menu/menu-bar-store.d.ts +2 -2
  35. package/cjs/menu/menu-store.cjs +7 -7
  36. package/cjs/menu/menu-store.d.cts +6 -6
  37. package/cjs/menu/menu-store.d.ts +6 -6
  38. package/cjs/menubar/menubar-store.cjs +6 -6
  39. package/cjs/menubar/menubar-store.d.cts +2 -2
  40. package/cjs/menubar/menubar-store.d.ts +2 -2
  41. package/cjs/popover/popover-store.d.cts +3 -3
  42. package/cjs/popover/popover-store.d.ts +3 -3
  43. package/cjs/radio/radio-store.cjs +5 -5
  44. package/cjs/radio/radio-store.d.cts +3 -3
  45. package/cjs/radio/radio-store.d.ts +3 -3
  46. package/cjs/select/select-store.cjs +21 -11
  47. package/cjs/select/select-store.d.cts +17 -9
  48. package/cjs/select/select-store.d.ts +17 -9
  49. package/cjs/tab/tab-store.cjs +46 -13
  50. package/cjs/tab/tab-store.d.cts +7 -6
  51. package/cjs/tab/tab-store.d.ts +7 -6
  52. package/cjs/tag/tag-store.cjs +90 -0
  53. package/cjs/tag/tag-store.d.cts +80 -0
  54. package/cjs/tag/tag-store.d.ts +80 -0
  55. package/cjs/toolbar/toolbar-store.cjs +5 -5
  56. package/cjs/toolbar/toolbar-store.d.cts +2 -2
  57. package/cjs/toolbar/toolbar-store.d.ts +2 -2
  58. package/cjs/tooltip/tooltip-store.d.cts +2 -2
  59. package/cjs/tooltip/tooltip-store.d.ts +2 -2
  60. package/cjs/utils/dom.cjs +2 -2
  61. package/cjs/utils/dom.d.cts +15 -22
  62. package/cjs/utils/dom.d.ts +15 -22
  63. package/cjs/utils/events.cjs +32 -16
  64. package/cjs/utils/events.d.cts +7 -1
  65. package/cjs/utils/events.d.ts +7 -1
  66. package/cjs/utils/focus.cjs +13 -15
  67. package/cjs/utils/focus.d.cts +1 -1
  68. package/cjs/utils/focus.d.ts +1 -1
  69. package/cjs/utils/misc.d.cts +1 -1
  70. package/cjs/utils/misc.d.ts +1 -1
  71. package/cjs/utils/platform.cjs +3 -3
  72. package/cjs/utils/store.d.cts +3 -3
  73. package/cjs/utils/store.d.ts +3 -3
  74. package/cjs/utils/undo.cjs +10 -0
  75. package/cjs/utils/undo.d.cts +19 -0
  76. package/cjs/utils/undo.d.ts +19 -0
  77. package/esm/__chunks/{VDNATJW2.js → CLSHHUGK.js} +1 -1
  78. package/esm/__chunks/EKIWAN6A.js +71 -0
  79. package/esm/__chunks/{URUD7X4C.js → EQPTKGFA.js} +1 -1
  80. package/esm/__chunks/{RRSZHCH6.js → I2NJJ3XW.js} +39 -41
  81. package/esm/__chunks/{PXYVPXSS.js → P3MTNH46.js} +1 -1
  82. package/esm/__chunks/{2H5K47H4.js → PBSSD2DM.js} +5 -5
  83. package/esm/checkbox/checkbox-store.d.ts +2 -2
  84. package/esm/collection/collection-store.d.ts +2 -2
  85. package/esm/collection/collection-store.js +2 -2
  86. package/esm/combobox/combobox-store.d.ts +20 -9
  87. package/esm/combobox/combobox-store.js +52 -24
  88. package/esm/composite/composite-overflow-store.d.ts +2 -2
  89. package/esm/composite/composite-store.d.ts +3 -3
  90. package/esm/composite/composite-store.js +4 -4
  91. package/esm/dialog/dialog-store.d.ts +2 -2
  92. package/esm/disclosure/disclosure-store.d.ts +2 -2
  93. package/esm/form/form-store.d.ts +4 -4
  94. package/esm/form/form-store.js +2 -2
  95. package/esm/form/types.d.ts +3 -3
  96. package/esm/hovercard/hovercard-store.d.ts +3 -3
  97. package/esm/menu/menu-bar-store.d.ts +2 -2
  98. package/esm/menu/menu-bar-store.js +5 -5
  99. package/esm/menu/menu-store.d.ts +6 -6
  100. package/esm/menu/menu-store.js +6 -6
  101. package/esm/menubar/menubar-store.d.ts +2 -2
  102. package/esm/menubar/menubar-store.js +5 -5
  103. package/esm/popover/popover-store.d.ts +3 -3
  104. package/esm/radio/radio-store.d.ts +3 -3
  105. package/esm/radio/radio-store.js +4 -4
  106. package/esm/select/select-store.d.ts +17 -9
  107. package/esm/select/select-store.js +20 -10
  108. package/esm/tab/tab-store.d.ts +7 -6
  109. package/esm/tab/tab-store.js +44 -11
  110. package/esm/tag/tag-store.d.ts +80 -0
  111. package/esm/tag/tag-store.js +90 -0
  112. package/esm/toolbar/toolbar-store.d.ts +2 -2
  113. package/esm/toolbar/toolbar-store.js +4 -4
  114. package/esm/tooltip/tooltip-store.d.ts +2 -2
  115. package/esm/utils/dom.d.ts +15 -22
  116. package/esm/utils/dom.js +5 -5
  117. package/esm/utils/events.d.ts +7 -1
  118. package/esm/utils/events.js +28 -12
  119. package/esm/utils/focus.d.ts +1 -1
  120. package/esm/utils/focus.js +5 -7
  121. package/esm/utils/misc.d.ts +1 -1
  122. package/esm/utils/platform.js +2 -2
  123. package/esm/utils/store.d.ts +3 -3
  124. package/esm/utils/undo.d.ts +19 -0
  125. package/esm/utils/undo.js +10 -0
  126. package/package.json +15 -1
  127. package/tag/tag-store/package.json +8 -0
  128. package/utils/undo/package.json +8 -0
@@ -1,6 +1,6 @@
1
- import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  type Orientation = "horizontal" | "vertical" | "both";
5
5
  /**
6
6
  * Creates a composite store.
@@ -1,6 +1,6 @@
1
- import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  type Orientation = "horizontal" | "vertical" | "both";
5
5
  /**
6
6
  * Creates a composite store.
@@ -1,5 +1,5 @@
1
- import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a dialog store.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a dialog store.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
2
- import type { SetState } from "../utils/types.js";
1
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
2
+ import type { SetState } from "../utils/types.ts";
3
3
  /**
4
4
  * Creates a disclosure store.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
2
- import type { SetState } from "../utils/types.js";
1
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
2
+ import type { SetState } from "../utils/types.ts";
3
3
  /**
4
4
  * Creates a disclosure store.
5
5
  */
@@ -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 _4W3OYRR3cjs = require('../__chunks/4W3OYRR3.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/Q2WCPTYS.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 = _4W3OYRR3cjs.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,7 +1,7 @@
1
- import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.js";
4
- import type { DeepMap, DeepPartial, Names, StringLike } from "./types.js";
1
+ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
4
+ import type { DeepMap, DeepPartial, Names, StringLike } from "./types.ts";
5
5
  type ErrorMessage = string | undefined | null;
6
6
  export declare function hasMessages(object: FormStoreValues): boolean;
7
7
  export declare function get<T>(values: FormStoreValues, path: StringLike | string[], defaultValue?: T): T;
@@ -1,7 +1,7 @@
1
- import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.js";
4
- import type { DeepMap, DeepPartial, Names, StringLike } from "./types.js";
1
+ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
4
+ import type { DeepMap, DeepPartial, Names, StringLike } from "./types.ts";
5
5
  type ErrorMessage = string | undefined | null;
6
6
  export declare function hasMessages(object: FormStoreValues): boolean;
7
7
  export declare function get<T>(values: FormStoreValues, path: StringLike | string[], defaultValue?: T): T;
@@ -1,11 +1,11 @@
1
- import type { AnyObject } from "../utils/types.js";
1
+ import type { AnyObject } from "../utils/types.ts";
2
2
  /**
3
3
  * An object or primitive value that can be converted to a string.
4
4
  */
5
- export type StringLike = {
5
+ export interface StringLike {
6
6
  toString: () => string;
7
7
  valueOf: () => string;
8
- };
8
+ }
9
9
  /**
10
10
  * Maps through an object `T` or array and defines the leaf values to the given
11
11
  * type `V`.
@@ -1,11 +1,11 @@
1
- import type { AnyObject } from "../utils/types.js";
1
+ import type { AnyObject } from "../utils/types.ts";
2
2
  /**
3
3
  * An object or primitive value that can be converted to a string.
4
4
  */
5
- export type StringLike = {
5
+ export interface StringLike {
6
6
  toString: () => string;
7
7
  valueOf: () => string;
8
- };
8
+ }
9
9
  /**
10
10
  * Maps through an object `T` or array and defines the leaf values to the given
11
11
  * type `V`.
@@ -1,6 +1,6 @@
1
- import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  /**
5
5
  * Creates a hovercard store.
6
6
  */
@@ -1,6 +1,6 @@
1
- import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  /**
5
5
  * Creates a hovercard store.
6
6
  */
@@ -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 _B4AKUC4Scjs = require('../__chunks/B4AKUC4S.cjs');
5
+ require('../__chunks/3HYNC3XA.cjs');
6
+ require('../__chunks/4W3OYRR3.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/Q2WCPTYS.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 _B4AKUC4Scjs.createMenubarStore.call(void 0, props);
16
16
  }
17
17
 
18
18
 
@@ -1,5 +1,5 @@
1
- import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a menu bar store.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a menu bar store.
5
5
  */
@@ -2,15 +2,16 @@
2
2
 
3
3
 
4
4
  var _UEZLSKZ4cjs = require('../__chunks/UEZLSKZ4.cjs');
5
+
6
+
7
+ var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
8
+ require('../__chunks/4W3OYRR3.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/Q2WCPTYS.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 = _3HYNC3XAcjs.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,9 +1,9 @@
1
- import type { ComboboxStore } from "../combobox/combobox-store.js";
2
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
3
- import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.js";
4
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
- import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.js";
6
- import type { MenuBarStore } from "./menu-bar-store.js";
1
+ import type { ComboboxStore } from "../combobox/combobox-store.ts";
2
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
3
+ import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.ts";
4
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
5
+ import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
6
+ import type { MenuBarStore } from "./menu-bar-store.ts";
7
7
  export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
8
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
9
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
@@ -1,9 +1,9 @@
1
- import type { ComboboxStore } from "../combobox/combobox-store.js";
2
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
3
- import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.js";
4
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
- import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.js";
6
- import type { MenuBarStore } from "./menu-bar-store.js";
1
+ import type { ComboboxStore } from "../combobox/combobox-store.ts";
2
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
3
+ import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.ts";
4
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
5
+ import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
6
+ import type { MenuBarStore } from "./menu-bar-store.ts";
7
7
  export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
8
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
9
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
@@ -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 _B4AKUC4Scjs = require('../__chunks/B4AKUC4S.cjs');
5
+ require('../__chunks/3HYNC3XA.cjs');
6
+ require('../__chunks/4W3OYRR3.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/Q2WCPTYS.cjs');
11
11
  require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
 
14
- exports.createMenubarStore = _SU2BSHGBcjs.createMenubarStore;
14
+ exports.createMenubarStore = _B4AKUC4Scjs.createMenubarStore;
@@ -1,5 +1,5 @@
1
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a menubar store.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
- import type { Store, StoreProps } from "../utils/store.js";
1
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
2
+ import type { Store, StoreProps } from "../utils/store.ts";
3
3
  /**
4
4
  * Creates a menubar store.
5
5
  */
@@ -1,6 +1,6 @@
1
- import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  type BasePlacement = "top" | "bottom" | "left" | "right";
5
5
  type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
6
6
  /**
@@ -1,6 +1,6 @@
1
- import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  type BasePlacement = "top" | "bottom" | "left" | "right";
5
5
  type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
6
6
  /**
@@ -1,16 +1,16 @@
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 _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
5
+ require('../__chunks/4W3OYRR3.cjs');
6
+ require('../__chunks/ULSPM3Y3.cjs');
6
7
 
7
8
 
8
9
  var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
9
10
 
10
11
 
11
12
  var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
12
- require('../__chunks/UKR6TQI3.cjs');
13
- require('../__chunks/ULSPM3Y3.cjs');
13
+ require('../__chunks/Q2WCPTYS.cjs');
14
14
 
15
15
 
16
16
 
@@ -22,7 +22,7 @@ function createRadioStore(_a = {}) {
22
22
  var props = _AV6KTKLEcjs.__objRest.call(void 0, _a, []);
23
23
  var _a2;
24
24
  const syncState = (_a2 = props.store) == null ? void 0 : _a2.getState();
25
- const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
25
+ const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
26
26
  focusLoop: _EEDWPDM2cjs.defaultValue.call(void 0, props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true)
27
27
  }));
28
28
  const initialState = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite.getState()), {
@@ -1,6 +1,6 @@
1
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  /**
5
5
  * Creates a radio store.
6
6
  */
@@ -1,6 +1,6 @@
1
- import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
3
- import type { SetState } from "../utils/types.js";
1
+ import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
2
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
3
+ import type { SetState } from "../utils/types.ts";
4
4
  /**
5
5
  * Creates a radio store.
6
6
  */
@@ -1,15 +1,18 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
+ var _3HYNC3XAcjs = require('../__chunks/3HYNC3XA.cjs');
5
+ require('../__chunks/4W3OYRR3.cjs');
6
+
7
+
8
+ var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
9
+
10
+
4
11
  var _5JEQEZFRcjs = require('../__chunks/5JEQEZFR.cjs');
5
12
  require('../__chunks/LTLFSC4X.cjs');
6
13
  require('../__chunks/AETQC2AR.cjs');
7
14
 
8
15
 
9
- var _Y7KNI5NScjs = require('../__chunks/Y7KNI5NS.cjs');
10
- require('../__chunks/FFZYCAXA.cjs');
11
-
12
-
13
16
 
14
17
 
15
18
 
@@ -20,10 +23,7 @@ var _B4LYZ4EMcjs = require('../__chunks/B4LYZ4EM.cjs');
20
23
 
21
24
 
22
25
  var _EEDWPDM2cjs = require('../__chunks/EEDWPDM2.cjs');
23
- require('../__chunks/UKR6TQI3.cjs');
24
-
25
-
26
- var _ULSPM3Y3cjs = require('../__chunks/ULSPM3Y3.cjs');
26
+ require('../__chunks/Q2WCPTYS.cjs');
27
27
 
28
28
 
29
29
 
@@ -53,7 +53,7 @@ function createSelectStore(_a = {}) {
53
53
  );
54
54
  _B4LYZ4EMcjs.throwOnConflictingProps.call(void 0, props, store);
55
55
  const syncState = store.getState();
56
- const composite = _Y7KNI5NScjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
56
+ const composite = _3HYNC3XAcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
57
57
  store,
58
58
  virtualFocus: _EEDWPDM2cjs.defaultValue.call(void 0,
59
59
  props.virtualFocus,
@@ -98,8 +98,9 @@ function createSelectStore(_a = {}) {
98
98
  syncState.setValueOnMove,
99
99
  false
100
100
  ),
101
+ labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.labelElement, null),
101
102
  selectElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.selectElement, null),
102
- labelElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.labelElement, null)
103
+ listElement: _EEDWPDM2cjs.defaultValue.call(void 0, syncState.listElement, null)
103
104
  });
104
105
  const select = _B4LYZ4EMcjs.createStore.call(void 0, initialState, composite, popover, store);
105
106
  _B4LYZ4EMcjs.setup.call(void 0,
@@ -117,6 +118,14 @@ function createSelectStore(_a = {}) {
117
118
  select.setState("value", item.value);
118
119
  })
119
120
  );
121
+ _B4LYZ4EMcjs.setup.call(void 0,
122
+ select,
123
+ () => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted"], (state) => {
124
+ if (state.mounted)
125
+ return;
126
+ select.setState("activeId", initialState.activeId);
127
+ })
128
+ );
120
129
  _B4LYZ4EMcjs.setup.call(void 0,
121
130
  select,
122
131
  () => _B4LYZ4EMcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
@@ -157,8 +166,9 @@ function createSelectStore(_a = {}) {
157
166
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), popover), select), {
158
167
  combobox,
159
168
  setValue: (value) => select.setState("value", value),
169
+ setLabelElement: (element) => select.setState("labelElement", element),
160
170
  setSelectElement: (element) => select.setState("selectElement", element),
161
- setLabelElement: (element) => select.setState("labelElement", element)
171
+ setListElement: (element) => select.setState("listElement", element)
162
172
  });
163
173
  }
164
174
 
@@ -1,8 +1,8 @@
1
- import type { ComboboxStore } from "../combobox/combobox-store.js";
2
- import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
3
- import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
4
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
- import type { PickRequired, SetState } from "../utils/types.js";
1
+ import type { ComboboxStore } from "../combobox/combobox-store.ts";
2
+ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
3
+ import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
4
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
5
+ import type { PickRequired, SetState } from "../utils/types.ts";
6
6
  type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
7
7
  export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
8
8
  export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
@@ -46,6 +46,10 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
46
46
  * @default false
47
47
  */
48
48
  setValueOnMove: boolean;
49
+ /**
50
+ * The select label element.
51
+ */
52
+ labelElement: HTMLElement | null;
49
53
  /**
50
54
  * The select button element.
51
55
  *
@@ -54,9 +58,9 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
54
58
  */
55
59
  selectElement: HTMLElement | null;
56
60
  /**
57
- * The select label element.
61
+ * The select list element.
58
62
  */
59
- labelElement: HTMLElement | null;
63
+ listElement: HTMLElement | null;
60
64
  }
61
65
  export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
62
66
  /**
@@ -68,14 +72,18 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
68
72
  * store.setValue((value) => value === "Apple" ? "Banana" : "Apple"));
69
73
  */
70
74
  setValue: SetState<SelectStoreState<T>["value"]>;
75
+ /**
76
+ * Sets the `labelElement` state.
77
+ */
78
+ setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
71
79
  /**
72
80
  * Sets the `selectElement` state.
73
81
  */
74
82
  setSelectElement: SetState<SelectStoreState<T>["selectElement"]>;
75
83
  /**
76
- * Sets the `labelElement` state.
84
+ * Sets the `listElement` state.
77
85
  */
78
- setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
86
+ setListElement: SetState<SelectStoreState<T>["listElement"]>;
79
87
  }
80
88
  export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
81
89
  /**
@@ -1,8 +1,8 @@
1
- import type { ComboboxStore } from "../combobox/combobox-store.js";
2
- import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
3
- import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
4
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
- import type { PickRequired, SetState } from "../utils/types.js";
1
+ import type { ComboboxStore } from "../combobox/combobox-store.ts";
2
+ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
3
+ import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
4
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
5
+ import type { PickRequired, SetState } from "../utils/types.ts";
6
6
  type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
7
7
  export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
8
8
  export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
@@ -46,6 +46,10 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
46
46
  * @default false
47
47
  */
48
48
  setValueOnMove: boolean;
49
+ /**
50
+ * The select label element.
51
+ */
52
+ labelElement: HTMLElement | null;
49
53
  /**
50
54
  * The select button element.
51
55
  *
@@ -54,9 +58,9 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
54
58
  */
55
59
  selectElement: HTMLElement | null;
56
60
  /**
57
- * The select label element.
61
+ * The select list element.
58
62
  */
59
- labelElement: HTMLElement | null;
63
+ listElement: HTMLElement | null;
60
64
  }
61
65
  export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
62
66
  /**
@@ -68,14 +72,18 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
68
72
  * store.setValue((value) => value === "Apple" ? "Banana" : "Apple"));
69
73
  */
70
74
  setValue: SetState<SelectStoreState<T>["value"]>;
75
+ /**
76
+ * Sets the `labelElement` state.
77
+ */
78
+ setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
71
79
  /**
72
80
  * Sets the `selectElement` state.
73
81
  */
74
82
  setSelectElement: SetState<SelectStoreState<T>["selectElement"]>;
75
83
  /**
76
- * Sets the `labelElement` state.
84
+ * Sets the `listElement` state.
77
85
  */
78
- setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
86
+ setListElement: SetState<SelectStoreState<T>["listElement"]>;
79
87
  }
80
88
  export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
81
89
  /**