@ariakit/core 0.4.5 → 0.4.7

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 (146) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cjs/__chunks/{QD2A4YF6.cjs → 3COGJMN3.cjs} +11 -11
  3. package/cjs/__chunks/{MHZQJPY3.cjs → 5BQ2XS3R.cjs} +4 -4
  4. package/cjs/__chunks/{2D5LEVE7.cjs → D7M2PCAQ.cjs} +6 -6
  5. package/cjs/__chunks/{LTLFSC4X.cjs → DIYYVJDK.cjs} +2 -2
  6. package/cjs/__chunks/{AETQC2AR.cjs → LAYUSNGM.cjs} +11 -11
  7. package/cjs/__chunks/{KL74MAHB.cjs → LBFF2BBK.cjs} +6 -6
  8. package/cjs/__chunks/{B4LYZ4EM.cjs → M2NNCFIJ.cjs} +13 -11
  9. package/cjs/__chunks/{5JEQEZFR.cjs → MB5TLEVH.cjs} +7 -7
  10. package/cjs/__chunks/{IMYW2UAC.cjs → Q2WCPTYS.cjs} +4 -22
  11. package/cjs/__chunks/{UEZLSKZ4.cjs → XVL5HZ27.cjs} +4 -4
  12. package/cjs/checkbox/checkbox-store.cjs +3 -3
  13. package/cjs/checkbox/checkbox-store.d.cts +2 -2
  14. package/cjs/checkbox/checkbox-store.d.ts +2 -2
  15. package/cjs/collection/collection-store.cjs +4 -4
  16. package/cjs/collection/collection-store.d.cts +2 -2
  17. package/cjs/collection/collection-store.d.ts +2 -2
  18. package/cjs/combobox/combobox-store.cjs +35 -26
  19. package/cjs/combobox/combobox-store.d.cts +7 -5
  20. package/cjs/combobox/combobox-store.d.ts +7 -5
  21. package/cjs/composite/composite-overflow-store.cjs +5 -5
  22. package/cjs/composite/composite-overflow-store.d.cts +2 -2
  23. package/cjs/composite/composite-overflow-store.d.ts +2 -2
  24. package/cjs/composite/composite-store.cjs +5 -5
  25. package/cjs/composite/composite-store.d.cts +8 -4
  26. package/cjs/composite/composite-store.d.ts +8 -4
  27. package/cjs/dialog/dialog-store.cjs +4 -4
  28. package/cjs/dialog/dialog-store.d.cts +2 -2
  29. package/cjs/dialog/dialog-store.d.ts +2 -2
  30. package/cjs/disclosure/disclosure-store.cjs +3 -3
  31. package/cjs/disclosure/disclosure-store.d.cts +2 -2
  32. package/cjs/disclosure/disclosure-store.d.ts +2 -2
  33. package/cjs/form/form-store.cjs +8 -8
  34. package/cjs/form/form-store.d.cts +4 -4
  35. package/cjs/form/form-store.d.ts +4 -4
  36. package/cjs/form/types.d.cts +3 -3
  37. package/cjs/form/types.d.ts +3 -3
  38. package/cjs/hovercard/hovercard-store.cjs +6 -6
  39. package/cjs/hovercard/hovercard-store.d.cts +3 -3
  40. package/cjs/hovercard/hovercard-store.d.ts +3 -3
  41. package/cjs/menu/menu-bar-store.cjs +6 -6
  42. package/cjs/menu/menu-bar-store.d.cts +2 -2
  43. package/cjs/menu/menu-bar-store.d.ts +2 -2
  44. package/cjs/menu/menu-store.cjs +19 -19
  45. package/cjs/menu/menu-store.d.cts +6 -6
  46. package/cjs/menu/menu-store.d.ts +6 -6
  47. package/cjs/menubar/menubar-store.cjs +6 -6
  48. package/cjs/menubar/menubar-store.d.cts +2 -2
  49. package/cjs/menubar/menubar-store.d.ts +2 -2
  50. package/cjs/popover/popover-store.cjs +5 -5
  51. package/cjs/popover/popover-store.d.cts +3 -3
  52. package/cjs/popover/popover-store.d.ts +3 -3
  53. package/cjs/radio/radio-store.cjs +6 -6
  54. package/cjs/radio/radio-store.d.cts +3 -3
  55. package/cjs/radio/radio-store.d.ts +3 -3
  56. package/cjs/select/select-store.cjs +31 -21
  57. package/cjs/select/select-store.d.cts +19 -9
  58. package/cjs/select/select-store.d.ts +19 -9
  59. package/cjs/tab/tab-store.cjs +58 -25
  60. package/cjs/tab/tab-store.d.cts +17 -10
  61. package/cjs/tab/tab-store.d.ts +17 -10
  62. package/cjs/tag/tag-store.cjs +8 -8
  63. package/cjs/tag/tag-store.d.cts +3 -3
  64. package/cjs/tag/tag-store.d.ts +3 -3
  65. package/cjs/toolbar/toolbar-store.cjs +5 -5
  66. package/cjs/toolbar/toolbar-store.d.cts +2 -2
  67. package/cjs/toolbar/toolbar-store.d.ts +2 -2
  68. package/cjs/tooltip/tooltip-store.cjs +7 -7
  69. package/cjs/tooltip/tooltip-store.d.cts +2 -2
  70. package/cjs/tooltip/tooltip-store.d.ts +2 -2
  71. package/cjs/utils/dom.cjs +2 -6
  72. package/cjs/utils/dom.d.cts +1 -17
  73. package/cjs/utils/dom.d.ts +1 -17
  74. package/cjs/utils/events.cjs +23 -16
  75. package/cjs/utils/events.d.cts +1 -1
  76. package/cjs/utils/events.d.ts +1 -1
  77. package/cjs/utils/focus.cjs +20 -18
  78. package/cjs/utils/focus.d.cts +1 -1
  79. package/cjs/utils/focus.d.ts +1 -1
  80. package/cjs/utils/misc.d.cts +1 -1
  81. package/cjs/utils/misc.d.ts +1 -1
  82. package/cjs/utils/platform.cjs +3 -3
  83. package/cjs/utils/store.cjs +2 -2
  84. package/cjs/utils/store.d.cts +3 -3
  85. package/cjs/utils/store.d.ts +3 -3
  86. package/esm/__chunks/{QAI5BPCY.js → CLSHHUGK.js} +1 -1
  87. package/esm/__chunks/{BRS7GKWU.js → E4HA32QI.js} +2 -2
  88. package/esm/__chunks/{IUORCTET.js → I2NJJ3XW.js} +3 -21
  89. package/esm/__chunks/{ABMC67JW.js → I2WJ7JBQ.js} +2 -2
  90. package/esm/__chunks/{WCKXDMU7.js → KDSZSVV5.js} +1 -1
  91. package/esm/__chunks/{R676XYVY.js → KLPDXTDE.js} +13 -11
  92. package/esm/__chunks/{5RJNXXU2.js → NWACXGIN.js} +1 -1
  93. package/esm/__chunks/{K7A7LTR3.js → RCLYDUHE.js} +2 -2
  94. package/esm/__chunks/{MFZZDIHG.js → SAZZJI72.js} +2 -2
  95. package/esm/__chunks/{YVUNPQHS.js → VH2P7HEP.js} +2 -2
  96. package/esm/checkbox/checkbox-store.d.ts +2 -2
  97. package/esm/checkbox/checkbox-store.js +1 -1
  98. package/esm/collection/collection-store.d.ts +2 -2
  99. package/esm/collection/collection-store.js +3 -3
  100. package/esm/combobox/combobox-store.d.ts +7 -5
  101. package/esm/combobox/combobox-store.js +20 -11
  102. package/esm/composite/composite-overflow-store.d.ts +2 -2
  103. package/esm/composite/composite-overflow-store.js +4 -4
  104. package/esm/composite/composite-store.d.ts +8 -4
  105. package/esm/composite/composite-store.js +4 -4
  106. package/esm/dialog/dialog-store.d.ts +2 -2
  107. package/esm/dialog/dialog-store.js +3 -3
  108. package/esm/disclosure/disclosure-store.d.ts +2 -2
  109. package/esm/disclosure/disclosure-store.js +2 -2
  110. package/esm/form/form-store.d.ts +4 -4
  111. package/esm/form/form-store.js +3 -3
  112. package/esm/form/types.d.ts +3 -3
  113. package/esm/hovercard/hovercard-store.d.ts +3 -3
  114. package/esm/hovercard/hovercard-store.js +5 -5
  115. package/esm/menu/menu-bar-store.d.ts +2 -2
  116. package/esm/menu/menu-bar-store.js +5 -5
  117. package/esm/menu/menu-store.d.ts +6 -6
  118. package/esm/menu/menu-store.js +8 -8
  119. package/esm/menubar/menubar-store.d.ts +2 -2
  120. package/esm/menubar/menubar-store.js +5 -5
  121. package/esm/popover/popover-store.d.ts +3 -3
  122. package/esm/popover/popover-store.js +4 -4
  123. package/esm/radio/radio-store.d.ts +3 -3
  124. package/esm/radio/radio-store.js +4 -4
  125. package/esm/select/select-store.d.ts +19 -9
  126. package/esm/select/select-store.js +19 -9
  127. package/esm/tab/tab-store.d.ts +17 -10
  128. package/esm/tab/tab-store.js +44 -11
  129. package/esm/tag/tag-store.d.ts +3 -3
  130. package/esm/tag/tag-store.js +4 -4
  131. package/esm/toolbar/toolbar-store.d.ts +2 -2
  132. package/esm/toolbar/toolbar-store.js +4 -4
  133. package/esm/tooltip/tooltip-store.d.ts +2 -2
  134. package/esm/tooltip/tooltip-store.js +5 -5
  135. package/esm/utils/dom.d.ts +1 -17
  136. package/esm/utils/dom.js +1 -5
  137. package/esm/utils/events.d.ts +1 -1
  138. package/esm/utils/events.js +20 -13
  139. package/esm/utils/focus.d.ts +1 -1
  140. package/esm/utils/focus.js +12 -10
  141. package/esm/utils/misc.d.ts +1 -1
  142. package/esm/utils/platform.js +2 -2
  143. package/esm/utils/store.d.ts +3 -3
  144. package/esm/utils/store.js +1 -1
  145. package/package.json +2 -2
  146. package/.eslintignore +0 -6
@@ -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.
@@ -44,6 +44,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
44
44
  * In both scenarios, the item in focus will carry the
45
45
  * [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
46
46
  * attribute.
47
+ *
48
+ * Live examples:
49
+ * - [Select with Combobox and
50
+ * Tabs](https://ariakit.org/examples/select-combobox-tab)
47
51
  * @default false
48
52
  */
49
53
  virtualFocus: boolean;
@@ -178,7 +182,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
178
182
  * arrow keys.
179
183
  *
180
184
  * Live examples:
181
- * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
185
+ * - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
182
186
  */
183
187
  activeId: string | null | undefined;
184
188
  }
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/YVUNPQHS.js";
5
- import "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/VH2P7HEP.js";
5
+ import "../__chunks/I2WJ7JBQ.js";
6
6
  import "../__chunks/7PRQYBBV.js";
7
- import "../__chunks/R676XYVY.js";
7
+ import "../__chunks/KLPDXTDE.js";
8
8
  import "../__chunks/22HHDS5F.js";
9
- import "../__chunks/IUORCTET.js";
9
+ import "../__chunks/I2NJJ3XW.js";
10
10
  import "../__chunks/4R3V3JGP.js";
11
11
  export {
12
12
  createCompositeStore
@@ -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,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  createDialogStore
4
- } from "../__chunks/5RJNXXU2.js";
5
- import "../__chunks/WCKXDMU7.js";
6
- import "../__chunks/R676XYVY.js";
4
+ } from "../__chunks/NWACXGIN.js";
5
+ import "../__chunks/KDSZSVV5.js";
6
+ import "../__chunks/KLPDXTDE.js";
7
7
  import "../__chunks/22HHDS5F.js";
8
8
  import "../__chunks/4R3V3JGP.js";
9
9
  export {
@@ -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,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  createDisclosureStore
4
- } from "../__chunks/WCKXDMU7.js";
5
- import "../__chunks/R676XYVY.js";
4
+ } from "../__chunks/KDSZSVV5.js";
5
+ import "../__chunks/KLPDXTDE.js";
6
6
  import "../__chunks/22HHDS5F.js";
7
7
  import "../__chunks/4R3V3JGP.js";
8
8
  export {
@@ -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,20 +1,20 @@
1
1
  "use client";
2
2
  import {
3
3
  createCollectionStore
4
- } from "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/I2WJ7JBQ.js";
5
5
  import {
6
6
  createStore,
7
7
  init,
8
8
  setup,
9
9
  throwOnConflictingProps
10
- } from "../__chunks/R676XYVY.js";
10
+ } from "../__chunks/KLPDXTDE.js";
11
11
  import {
12
12
  applyState,
13
13
  defaultValue,
14
14
  isInteger,
15
15
  isObject
16
16
  } from "../__chunks/22HHDS5F.js";
17
- import "../__chunks/IUORCTET.js";
17
+ import "../__chunks/I2NJJ3XW.js";
18
18
  import {
19
19
  __spreadProps,
20
20
  __spreadValues
@@ -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,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  createHovercardStore
4
- } from "../__chunks/BRS7GKWU.js";
5
- import "../__chunks/MFZZDIHG.js";
6
- import "../__chunks/5RJNXXU2.js";
7
- import "../__chunks/WCKXDMU7.js";
8
- import "../__chunks/R676XYVY.js";
4
+ } from "../__chunks/E4HA32QI.js";
5
+ import "../__chunks/SAZZJI72.js";
6
+ import "../__chunks/NWACXGIN.js";
7
+ import "../__chunks/KDSZSVV5.js";
8
+ import "../__chunks/KLPDXTDE.js";
9
9
  import "../__chunks/22HHDS5F.js";
10
10
  import "../__chunks/4R3V3JGP.js";
11
11
  export {
@@ -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,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  createMenubarStore
4
- } from "../__chunks/K7A7LTR3.js";
5
- import "../__chunks/YVUNPQHS.js";
6
- import "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/RCLYDUHE.js";
5
+ import "../__chunks/VH2P7HEP.js";
6
+ import "../__chunks/I2WJ7JBQ.js";
7
7
  import "../__chunks/7PRQYBBV.js";
8
- import "../__chunks/R676XYVY.js";
8
+ import "../__chunks/KLPDXTDE.js";
9
9
  import "../__chunks/22HHDS5F.js";
10
- import "../__chunks/IUORCTET.js";
10
+ import "../__chunks/I2NJJ3XW.js";
11
11
  import "../__chunks/4R3V3JGP.js";
12
12
 
13
13
  // src/menu/menu-bar-store.ts
@@ -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,15 +1,15 @@
1
1
  "use client";
2
2
  import {
3
3
  createHovercardStore
4
- } from "../__chunks/BRS7GKWU.js";
4
+ } from "../__chunks/E4HA32QI.js";
5
5
  import {
6
6
  createCompositeStore
7
- } from "../__chunks/YVUNPQHS.js";
8
- import "../__chunks/ABMC67JW.js";
7
+ } from "../__chunks/VH2P7HEP.js";
8
+ import "../__chunks/I2WJ7JBQ.js";
9
9
  import "../__chunks/7PRQYBBV.js";
10
- import "../__chunks/MFZZDIHG.js";
11
- import "../__chunks/5RJNXXU2.js";
12
- import "../__chunks/WCKXDMU7.js";
10
+ import "../__chunks/SAZZJI72.js";
11
+ import "../__chunks/NWACXGIN.js";
12
+ import "../__chunks/KDSZSVV5.js";
13
13
  import {
14
14
  createStore,
15
15
  mergeStore,
@@ -18,12 +18,12 @@ import {
18
18
  setup,
19
19
  sync,
20
20
  throwOnConflictingProps
21
- } from "../__chunks/R676XYVY.js";
21
+ } from "../__chunks/KLPDXTDE.js";
22
22
  import {
23
23
  applyState,
24
24
  defaultValue
25
25
  } from "../__chunks/22HHDS5F.js";
26
- import "../__chunks/IUORCTET.js";
26
+ import "../__chunks/I2NJJ3XW.js";
27
27
  import {
28
28
  __objRest,
29
29
  __spreadProps,
@@ -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,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  createMenubarStore
4
- } from "../__chunks/K7A7LTR3.js";
5
- import "../__chunks/YVUNPQHS.js";
6
- import "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/RCLYDUHE.js";
5
+ import "../__chunks/VH2P7HEP.js";
6
+ import "../__chunks/I2WJ7JBQ.js";
7
7
  import "../__chunks/7PRQYBBV.js";
8
- import "../__chunks/R676XYVY.js";
8
+ import "../__chunks/KLPDXTDE.js";
9
9
  import "../__chunks/22HHDS5F.js";
10
- import "../__chunks/IUORCTET.js";
10
+ import "../__chunks/I2NJJ3XW.js";
11
11
  import "../__chunks/4R3V3JGP.js";
12
12
  export {
13
13
  createMenubarStore
@@ -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,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  createPopoverStore
4
- } from "../__chunks/MFZZDIHG.js";
5
- import "../__chunks/5RJNXXU2.js";
6
- import "../__chunks/WCKXDMU7.js";
7
- import "../__chunks/R676XYVY.js";
4
+ } from "../__chunks/SAZZJI72.js";
5
+ import "../__chunks/NWACXGIN.js";
6
+ import "../__chunks/KDSZSVV5.js";
7
+ import "../__chunks/KLPDXTDE.js";
8
8
  import "../__chunks/22HHDS5F.js";
9
9
  import "../__chunks/4R3V3JGP.js";
10
10
  export {
@@ -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,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/YVUNPQHS.js";
5
- import "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/VH2P7HEP.js";
5
+ import "../__chunks/I2WJ7JBQ.js";
6
6
  import "../__chunks/7PRQYBBV.js";
7
7
  import {
8
8
  createStore
9
- } from "../__chunks/R676XYVY.js";
9
+ } from "../__chunks/KLPDXTDE.js";
10
10
  import {
11
11
  defaultValue
12
12
  } from "../__chunks/22HHDS5F.js";
13
- import "../__chunks/IUORCTET.js";
13
+ import "../__chunks/I2NJJ3XW.js";
14
14
  import {
15
15
  __objRest,
16
16
  __spreadProps,
@@ -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
  /**
@@ -94,6 +102,8 @@ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValu
94
102
  * - [SelectGroup](https://ariakit.org/examples/select-group)
95
103
  * - [Select with Next.js App
96
104
  * Router](https://ariakit.org/examples/select-next-router)
105
+ * - [Select with Combobox and
106
+ * Tabs](https://ariakit.org/examples/select-combobox-tab)
97
107
  */
98
108
  defaultValue?: SelectStoreState<T>["value"];
99
109
  }
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import {
3
3
  createCompositeStore
4
- } from "../__chunks/YVUNPQHS.js";
5
- import "../__chunks/ABMC67JW.js";
4
+ } from "../__chunks/VH2P7HEP.js";
5
+ import "../__chunks/I2WJ7JBQ.js";
6
6
  import {
7
7
  toArray
8
8
  } from "../__chunks/7PRQYBBV.js";
9
9
  import {
10
10
  createPopoverStore
11
- } from "../__chunks/MFZZDIHG.js";
12
- import "../__chunks/5RJNXXU2.js";
13
- import "../__chunks/WCKXDMU7.js";
11
+ } from "../__chunks/SAZZJI72.js";
12
+ import "../__chunks/NWACXGIN.js";
13
+ import "../__chunks/KDSZSVV5.js";
14
14
  import {
15
15
  batch,
16
16
  createStore,
@@ -19,11 +19,11 @@ import {
19
19
  setup,
20
20
  sync,
21
21
  throwOnConflictingProps
22
- } from "../__chunks/R676XYVY.js";
22
+ } from "../__chunks/KLPDXTDE.js";
23
23
  import {
24
24
  defaultValue
25
25
  } from "../__chunks/22HHDS5F.js";
26
- import "../__chunks/IUORCTET.js";
26
+ import "../__chunks/I2NJJ3XW.js";
27
27
  import {
28
28
  __objRest,
29
29
  __spreadProps,
@@ -98,8 +98,9 @@ function createSelectStore(_a = {}) {
98
98
  syncState.setValueOnMove,
99
99
  false
100
100
  ),
101
+ labelElement: defaultValue(syncState.labelElement, null),
101
102
  selectElement: defaultValue(syncState.selectElement, null),
102
- labelElement: defaultValue(syncState.labelElement, null)
103
+ listElement: defaultValue(syncState.listElement, null)
103
104
  });
104
105
  const select = createStore(initialState, composite, popover, store);
105
106
  setup(
@@ -117,6 +118,14 @@ function createSelectStore(_a = {}) {
117
118
  select.setState("value", item.value);
118
119
  })
119
120
  );
121
+ setup(
122
+ select,
123
+ () => sync(select, ["mounted"], (state) => {
124
+ if (state.mounted)
125
+ return;
126
+ select.setState("activeId", initialState.activeId);
127
+ })
128
+ );
120
129
  setup(
121
130
  select,
122
131
  () => sync(select, ["mounted", "items", "value"], (state) => {
@@ -157,8 +166,9 @@ function createSelectStore(_a = {}) {
157
166
  return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, 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
  export {
@@ -1,8 +1,9 @@
1
- import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.js";
2
- import type { ComboboxStore } from "../combobox/combobox-store.js";
3
- import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
4
- import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
- import type { SetState } from "../utils/types.js";
1
+ import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.ts";
2
+ import type { ComboboxStore } from "../combobox/combobox-store.ts";
3
+ import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
4
+ import type { SelectStore } from "../select/select-store.ts";
5
+ import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
6
+ import type { SetState } from "../utils/types.ts";
6
7
  export declare function createTabStore({ composite: parentComposite, combobox, ...props }?: TabStoreProps): TabStore;
7
8
  export interface TabStoreItem extends CompositeStoreItem {
8
9
  dimmed?: boolean;
@@ -21,16 +22,20 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
21
22
  *
22
23
  * Live examples:
23
24
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
24
- * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
25
+ * - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
26
+ * - [Select with Combobox and
27
+ * Tabs](https://ariakit.org/examples/select-combobox-tab)
25
28
  */
26
29
  selectedId: TabStoreState["activeId"];
27
30
  /**
28
31
  * Determines if the tab should be selected when it receives focus. If set to
29
- * `false`, the tab will only be selected upon clicking, not when
30
- * using arrow keys to shift focus.
32
+ * `false`, the tab will only be selected upon clicking, not when using arrow
33
+ * keys to shift focus.
31
34
  *
32
35
  * Live examples:
33
36
  * - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
37
+ * - [Select with Combobox and
38
+ * Tabs](https://ariakit.org/examples/select-combobox-tab)
34
39
  * @default true
35
40
  */
36
41
  selectOnMove?: boolean;
@@ -85,7 +90,7 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
85
90
  * [Select](https://ariakit.org/components/select). The stores will share the
86
91
  * same state.
87
92
  */
88
- composite?: CompositeStore | null;
93
+ composite?: CompositeStore | SelectStore | null;
89
94
  /**
90
95
  * A reference to a [combobox
91
96
  * store](https://ariakit.org/reference/use-combobox-store). This is used when
@@ -98,8 +103,10 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
98
103
  * will be automatically set to the first enabled tab.
99
104
  *
100
105
  * Live examples:
101
- * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
106
+ * - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
102
107
  * - [Animated TabPanel](https://ariakit.org/examples/tab-panel-animated)
108
+ * - [Select with Combobox and
109
+ * Tabs](https://ariakit.org/examples/select-combobox-tab)
103
110
  */
104
111
  defaultSelectedId?: TabStoreState["selectedId"];
105
112
  }