@ariakit/core 0.3.6 → 0.3.8

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 (113) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/cjs/__chunks/{GZDVJEID.cjs → 2LS4JJ4S.cjs} +2 -2
  3. package/cjs/__chunks/{46BH65MC.cjs → 2UK5WUJX.cjs} +15 -7
  4. package/cjs/__chunks/{GXIZMD53.cjs → 3J44Z7YH.cjs} +4 -4
  5. package/cjs/__chunks/{PD7XZBXC.cjs → 5SIVMOID.cjs} +4 -4
  6. package/cjs/__chunks/{7ZUFMSXJ.cjs → EFIT5L4X.cjs} +7 -7
  7. package/cjs/__chunks/{MEHGRTJ3.cjs → GJFZ5ZPP.cjs} +11 -11
  8. package/cjs/__chunks/{6WBY3ZZM.cjs → QAZ4PF7S.cjs} +6 -6
  9. package/cjs/__chunks/{JLC5A6WF.cjs → ZQTYFYRS.cjs} +18 -9
  10. package/cjs/checkbox/checkbox-store.cjs +3 -3
  11. package/cjs/checkbox/checkbox-store.d.cts +9 -9
  12. package/cjs/checkbox/checkbox-store.d.ts +9 -9
  13. package/cjs/collection/collection-store.cjs +3 -3
  14. package/cjs/collection/collection-store.d.cts +18 -12
  15. package/cjs/collection/collection-store.d.ts +18 -12
  16. package/cjs/combobox/combobox-store.cjs +45 -23
  17. package/cjs/combobox/combobox-store.d.cts +66 -23
  18. package/cjs/combobox/combobox-store.d.ts +66 -23
  19. package/cjs/composite/composite-overflow-store.cjs +5 -5
  20. package/cjs/composite/composite-overflow-store.d.cts +13 -7
  21. package/cjs/composite/composite-overflow-store.d.ts +13 -7
  22. package/cjs/composite/composite-store.cjs +4 -4
  23. package/cjs/composite/composite-store.d.cts +24 -16
  24. package/cjs/composite/composite-store.d.ts +24 -16
  25. package/cjs/dialog/dialog-store.cjs +4 -4
  26. package/cjs/dialog/dialog-store.d.cts +12 -6
  27. package/cjs/dialog/dialog-store.d.ts +12 -6
  28. package/cjs/disclosure/disclosure-store.cjs +3 -3
  29. package/cjs/disclosure/disclosure-store.d.cts +6 -2
  30. package/cjs/disclosure/disclosure-store.d.ts +6 -2
  31. package/cjs/form/form-store.cjs +7 -7
  32. package/cjs/form/form-store.d.cts +15 -15
  33. package/cjs/form/form-store.d.ts +15 -15
  34. package/cjs/hovercard/hovercard-store.cjs +6 -6
  35. package/cjs/hovercard/hovercard-store.d.cts +11 -3
  36. package/cjs/hovercard/hovercard-store.d.ts +11 -3
  37. package/cjs/menu/menu-bar-store.cjs +5 -5
  38. package/cjs/menu/menu-bar-store.d.cts +12 -6
  39. package/cjs/menu/menu-bar-store.d.ts +12 -6
  40. package/cjs/menu/menu-store.cjs +18 -18
  41. package/cjs/menu/menu-store.d.cts +8 -8
  42. package/cjs/menu/menu-store.d.ts +8 -8
  43. package/cjs/menubar/menubar-store.cjs +5 -5
  44. package/cjs/menubar/menubar-store.d.cts +1 -1
  45. package/cjs/menubar/menubar-store.d.ts +1 -1
  46. package/cjs/popover/popover-store.cjs +5 -5
  47. package/cjs/popover/popover-store.d.cts +8 -3
  48. package/cjs/popover/popover-store.d.ts +8 -3
  49. package/cjs/radio/radio-store.cjs +5 -5
  50. package/cjs/radio/radio-store.d.cts +5 -3
  51. package/cjs/radio/radio-store.d.ts +5 -3
  52. package/cjs/select/select-store.cjs +18 -18
  53. package/cjs/select/select-store.d.cts +39 -31
  54. package/cjs/select/select-store.d.ts +39 -31
  55. package/cjs/tab/tab-store.cjs +15 -15
  56. package/cjs/tab/tab-store.d.cts +15 -16
  57. package/cjs/tab/tab-store.d.ts +15 -16
  58. package/cjs/toolbar/toolbar-store.cjs +4 -4
  59. package/cjs/toolbar/toolbar-store.d.cts +9 -6
  60. package/cjs/toolbar/toolbar-store.d.ts +9 -6
  61. package/cjs/tooltip/tooltip-store.cjs +7 -7
  62. package/cjs/tooltip/tooltip-store.d.cts +5 -3
  63. package/cjs/tooltip/tooltip-store.d.ts +5 -3
  64. package/cjs/utils/store.cjs +2 -2
  65. package/cjs/utils/store.d.cts +3 -0
  66. package/cjs/utils/store.d.ts +3 -0
  67. package/esm/__chunks/{ANO6WJO4.js → A2AGSVJO.js} +2 -2
  68. package/esm/__chunks/{E7OQVGGY.js → A2J4XZ5T.js} +15 -7
  69. package/esm/__chunks/{OGMLJYDV.js → CTZ2GQIZ.js} +2 -2
  70. package/esm/__chunks/{CCU5UHQ2.js → HMQYEBKF.js} +15 -6
  71. package/esm/__chunks/{WY3EMTH6.js → J6JIOWCS.js} +2 -2
  72. package/esm/__chunks/{CL47ZAPY.js → LT2OYWRD.js} +1 -1
  73. package/esm/__chunks/{DYD4YNLE.js → NKLTHWCR.js} +1 -1
  74. package/esm/__chunks/{BXH3I7ML.js → T3DVYGXI.js} +2 -2
  75. package/esm/checkbox/checkbox-store.d.ts +9 -9
  76. package/esm/checkbox/checkbox-store.js +1 -1
  77. package/esm/collection/collection-store.d.ts +18 -12
  78. package/esm/collection/collection-store.js +2 -2
  79. package/esm/combobox/combobox-store.d.ts +66 -23
  80. package/esm/combobox/combobox-store.js +33 -11
  81. package/esm/composite/composite-overflow-store.d.ts +13 -7
  82. package/esm/composite/composite-overflow-store.js +4 -4
  83. package/esm/composite/composite-store.d.ts +24 -16
  84. package/esm/composite/composite-store.js +3 -3
  85. package/esm/dialog/dialog-store.d.ts +12 -6
  86. package/esm/dialog/dialog-store.js +3 -3
  87. package/esm/disclosure/disclosure-store.d.ts +6 -2
  88. package/esm/disclosure/disclosure-store.js +2 -2
  89. package/esm/form/form-store.d.ts +15 -15
  90. package/esm/form/form-store.js +2 -2
  91. package/esm/hovercard/hovercard-store.d.ts +11 -3
  92. package/esm/hovercard/hovercard-store.js +5 -5
  93. package/esm/menu/menu-bar-store.d.ts +12 -6
  94. package/esm/menu/menu-bar-store.js +4 -4
  95. package/esm/menu/menu-store.d.ts +8 -8
  96. package/esm/menu/menu-store.js +7 -7
  97. package/esm/menubar/menubar-store.d.ts +1 -1
  98. package/esm/menubar/menubar-store.js +4 -4
  99. package/esm/popover/popover-store.d.ts +8 -3
  100. package/esm/popover/popover-store.js +4 -4
  101. package/esm/radio/radio-store.d.ts +5 -3
  102. package/esm/radio/radio-store.js +3 -3
  103. package/esm/select/select-store.d.ts +39 -31
  104. package/esm/select/select-store.js +6 -6
  105. package/esm/tab/tab-store.d.ts +15 -16
  106. package/esm/tab/tab-store.js +3 -3
  107. package/esm/toolbar/toolbar-store.d.ts +9 -6
  108. package/esm/toolbar/toolbar-store.js +3 -3
  109. package/esm/tooltip/tooltip-store.d.ts +5 -3
  110. package/esm/tooltip/tooltip-store.js +5 -5
  111. package/esm/utils/store.d.ts +3 -0
  112. package/esm/utils/store.js +1 -1
  113. package/package.json +1 -1
@@ -4,11 +4,10 @@ import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreStat
4
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.js";
6
6
  import type { MenuBarStore } from "./menu-bar-store.js";
7
- type Values = Record<string, string | boolean | number | Array<string | number>>;
8
- export declare function createMenuStore<T extends Values = Values>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
7
+ export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
9
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
10
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
11
- export interface MenuStoreState<T extends Values = Values> extends CompositeStoreState, HovercardStoreState {
10
+ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
12
11
  /**
13
12
  * Determines the element that should be focused when the menu is opened.
14
13
  */
@@ -25,7 +24,7 @@ export interface MenuStoreState<T extends Values = Values> extends CompositeStor
25
24
  /** @default 0 */
26
25
  hideTimeout?: HovercardStoreState["hideTimeout"];
27
26
  }
28
- export interface MenuStoreFunctions<T extends Values = Values> extends Pick<MenuStoreOptions, "combobox" | "parent" | "menubar">, CompositeStoreFunctions, HovercardStoreFunctions {
27
+ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreFunctions, HovercardStoreFunctions, Pick<MenuStoreOptions, "combobox" | "parent" | "menubar"> {
29
28
  /**
30
29
  * Hides the menu and all its parent menus.
31
30
  */
@@ -51,7 +50,7 @@ export interface MenuStoreFunctions<T extends Values = Values> extends Pick<Menu
51
50
  */
52
51
  setValue: BivariantCallback<(name: string, value: SetStateAction<MenuStoreState<T>["values"][string]>) => void>;
53
52
  }
54
- export interface MenuStoreOptions<T extends Values = Values> extends StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values">, CompositeStoreOptions, HovercardStoreOptions {
53
+ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreOptions, HovercardStoreOptions, StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values"> {
55
54
  /**
56
55
  * A reference to a combobox store. This is used when combining the combobox
57
56
  * with a menu (e.g., dropdown menu with a search input). The stores will
@@ -73,6 +72,7 @@ export interface MenuStoreOptions<T extends Values = Values> extends StoreOption
73
72
  */
74
73
  defaultValues?: MenuStoreState<T>["values"];
75
74
  }
76
- export type MenuStoreProps<T extends Values = Values> = MenuStoreOptions<T> & StoreProps<MenuStoreState<T>>;
77
- export type MenuStore<T extends Values = Values> = MenuStoreFunctions<T> & Store<MenuStoreState<T>>;
78
- export {};
75
+ export interface MenuStoreProps<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreOptions<T>, StoreProps<MenuStoreState<T>> {
76
+ }
77
+ export interface MenuStore<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreFunctions<T>, Store<MenuStoreState<T>> {
78
+ }
@@ -4,11 +4,10 @@ import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreStat
4
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.js";
6
6
  import type { MenuBarStore } from "./menu-bar-store.js";
7
- type Values = Record<string, string | boolean | number | Array<string | number>>;
8
- export declare function createMenuStore<T extends Values = Values>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
7
+ export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
9
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
10
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
11
- export interface MenuStoreState<T extends Values = Values> extends CompositeStoreState, HovercardStoreState {
10
+ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
12
11
  /**
13
12
  * Determines the element that should be focused when the menu is opened.
14
13
  */
@@ -25,7 +24,7 @@ export interface MenuStoreState<T extends Values = Values> extends CompositeStor
25
24
  /** @default 0 */
26
25
  hideTimeout?: HovercardStoreState["hideTimeout"];
27
26
  }
28
- export interface MenuStoreFunctions<T extends Values = Values> extends Pick<MenuStoreOptions, "combobox" | "parent" | "menubar">, CompositeStoreFunctions, HovercardStoreFunctions {
27
+ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreFunctions, HovercardStoreFunctions, Pick<MenuStoreOptions, "combobox" | "parent" | "menubar"> {
29
28
  /**
30
29
  * Hides the menu and all its parent menus.
31
30
  */
@@ -51,7 +50,7 @@ export interface MenuStoreFunctions<T extends Values = Values> extends Pick<Menu
51
50
  */
52
51
  setValue: BivariantCallback<(name: string, value: SetStateAction<MenuStoreState<T>["values"][string]>) => void>;
53
52
  }
54
- export interface MenuStoreOptions<T extends Values = Values> extends StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values">, CompositeStoreOptions, HovercardStoreOptions {
53
+ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreOptions, HovercardStoreOptions, StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values"> {
55
54
  /**
56
55
  * A reference to a combobox store. This is used when combining the combobox
57
56
  * with a menu (e.g., dropdown menu with a search input). The stores will
@@ -73,6 +72,7 @@ export interface MenuStoreOptions<T extends Values = Values> extends StoreOption
73
72
  */
74
73
  defaultValues?: MenuStoreState<T>["values"];
75
74
  }
76
- export type MenuStoreProps<T extends Values = Values> = MenuStoreOptions<T> & StoreProps<MenuStoreState<T>>;
77
- export type MenuStore<T extends Values = Values> = MenuStoreFunctions<T> & Store<MenuStoreState<T>>;
78
- export {};
75
+ export interface MenuStoreProps<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreOptions<T>, StoreProps<MenuStoreState<T>> {
76
+ }
77
+ export interface MenuStore<T extends MenuStoreValues = MenuStoreValues> extends MenuStoreFunctions<T>, Store<MenuStoreState<T>> {
78
+ }
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _GXIZMD53cjs = require('../__chunks/GXIZMD53.cjs');
5
- require('../__chunks/6WBY3ZZM.cjs');
6
- require('../__chunks/JLC5A6WF.cjs');
7
- require('../__chunks/46BH65MC.cjs');
4
+ var _3J44Z7YHcjs = require('../__chunks/3J44Z7YH.cjs');
5
+ require('../__chunks/QAZ4PF7S.cjs');
6
+ require('../__chunks/ZQTYFYRS.cjs');
7
+ require('../__chunks/2UK5WUJX.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/5F4DVUNS.cjs');
10
10
  require('../__chunks/ULSPM3Y3.cjs');
11
11
  require('../__chunks/AV6KTKLE.cjs');
12
12
 
13
13
 
14
- exports.createMenubarStore = _GXIZMD53cjs.createMenubarStore;
14
+ exports.createMenubarStore = _3J44Z7YHcjs.createMenubarStore;
@@ -1,7 +1,7 @@
1
1
  import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
2
  import type { Store, StoreProps } from "../utils/store.js";
3
3
  /**
4
- * Creates a menu bar store.
4
+ * Creates a menubar store.
5
5
  */
6
6
  export declare function createMenubarStore(props?: MenubarStoreProps): MenubarStore;
7
7
  export interface MenubarStoreState extends CompositeStoreState {
@@ -1,7 +1,7 @@
1
1
  import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
2
2
  import type { Store, StoreProps } from "../utils/store.js";
3
3
  /**
4
- * Creates a menu bar store.
4
+ * Creates a menubar store.
5
5
  */
6
6
  export declare function createMenubarStore(props?: MenubarStoreProps): MenubarStore;
7
7
  export interface MenubarStoreState extends CompositeStoreState {
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
5
- require('../__chunks/GZDVJEID.cjs');
6
- require('../__chunks/MEHGRTJ3.cjs');
7
- require('../__chunks/46BH65MC.cjs');
4
+ var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
5
+ require('../__chunks/2LS4JJ4S.cjs');
6
+ require('../__chunks/GJFZ5ZPP.cjs');
7
+ require('../__chunks/2UK5WUJX.cjs');
8
8
  require('../__chunks/3UT5FE6K.cjs');
9
9
  require('../__chunks/AV6KTKLE.cjs');
10
10
 
11
11
 
12
- exports.createPopoverStore = _7ZUFMSXJcjs.createPopoverStore;
12
+ exports.createPopoverStore = _EFIT5L4Xcjs.createPopoverStore;
@@ -28,6 +28,9 @@ export interface PopoverStoreState extends DialogStoreState {
28
28
  currentPlacement: Placement;
29
29
  /**
30
30
  * The placement of the popover.
31
+ *
32
+ * Live examples:
33
+ * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
31
34
  * @default "bottom"
32
35
  */
33
36
  placement: Placement;
@@ -57,13 +60,15 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
57
60
  */
58
61
  render: () => void;
59
62
  }
60
- export interface PopoverStoreOptions extends StoreOptions<PopoverStoreState, "placement">, DialogStoreOptions {
63
+ export interface PopoverStoreOptions extends DialogStoreOptions, StoreOptions<PopoverStoreState, "placement"> {
61
64
  /**
62
65
  * A reference to another popover store that's controlling another popover to
63
66
  * keep them in sync.
64
67
  */
65
68
  popover?: PopoverStore | null;
66
69
  }
67
- export type PopoverStoreProps = PopoverStoreOptions & StoreProps<PopoverStoreState>;
68
- export type PopoverStore = PopoverStoreFunctions & Store<PopoverStoreState>;
70
+ export interface PopoverStoreProps extends PopoverStoreOptions, StoreProps<PopoverStoreState> {
71
+ }
72
+ export interface PopoverStore extends PopoverStoreFunctions, Store<PopoverStoreState> {
73
+ }
69
74
  export {};
@@ -28,6 +28,9 @@ export interface PopoverStoreState extends DialogStoreState {
28
28
  currentPlacement: Placement;
29
29
  /**
30
30
  * The placement of the popover.
31
+ *
32
+ * Live examples:
33
+ * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
31
34
  * @default "bottom"
32
35
  */
33
36
  placement: Placement;
@@ -57,13 +60,15 @@ export interface PopoverStoreFunctions extends DialogStoreFunctions {
57
60
  */
58
61
  render: () => void;
59
62
  }
60
- export interface PopoverStoreOptions extends StoreOptions<PopoverStoreState, "placement">, DialogStoreOptions {
63
+ export interface PopoverStoreOptions extends DialogStoreOptions, StoreOptions<PopoverStoreState, "placement"> {
61
64
  /**
62
65
  * A reference to another popover store that's controlling another popover to
63
66
  * keep them in sync.
64
67
  */
65
68
  popover?: PopoverStore | null;
66
69
  }
67
- export type PopoverStoreProps = PopoverStoreOptions & StoreProps<PopoverStoreState>;
68
- export type PopoverStore = PopoverStoreFunctions & Store<PopoverStoreState>;
70
+ export interface PopoverStoreProps extends PopoverStoreOptions, StoreProps<PopoverStoreState> {
71
+ }
72
+ export interface PopoverStore extends PopoverStoreFunctions, Store<PopoverStoreState> {
73
+ }
69
74
  export {};
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
5
- require('../__chunks/JLC5A6WF.cjs');
4
+ var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
5
+ require('../__chunks/ZQTYFYRS.cjs');
6
6
 
7
7
 
8
- var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
8
+ var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
9
9
 
10
10
 
11
11
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -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 = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
25
+ const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
26
26
  focusLoop: _3UT5FE6Kcjs.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()), {
@@ -33,7 +33,7 @@ function createRadioStore(_a = {}) {
33
33
  null
34
34
  )
35
35
  });
36
- const radio = _46BH65MCcjs.createStore.call(void 0, initialState, composite, props.store);
36
+ const radio = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, props.store);
37
37
  return _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, composite), radio), {
38
38
  setValue: (value) => radio.setState("value", value)
39
39
  });
@@ -25,12 +25,14 @@ export interface RadioStoreFunctions extends CompositeStoreFunctions {
25
25
  */
26
26
  setValue: SetState<RadioStoreState["value"]>;
27
27
  }
28
- export interface RadioStoreOptions extends StoreOptions<RadioStoreState, "focusLoop" | "value">, CompositeStoreOptions {
28
+ export interface RadioStoreOptions extends CompositeStoreOptions, StoreOptions<RadioStoreState, "focusLoop" | "value"> {
29
29
  /**
30
30
  * The default value of the radio group.
31
31
  * @default null
32
32
  */
33
33
  defaultValue?: RadioStoreState["value"];
34
34
  }
35
- export type RadioStoreProps = RadioStoreOptions & StoreProps<RadioStoreState>;
36
- export type RadioStore = RadioStoreFunctions & Store<RadioStoreState>;
35
+ export interface RadioStoreProps extends RadioStoreOptions, StoreProps<RadioStoreState> {
36
+ }
37
+ export interface RadioStore extends RadioStoreFunctions, Store<RadioStoreState> {
38
+ }
@@ -25,12 +25,14 @@ export interface RadioStoreFunctions extends CompositeStoreFunctions {
25
25
  */
26
26
  setValue: SetState<RadioStoreState["value"]>;
27
27
  }
28
- export interface RadioStoreOptions extends StoreOptions<RadioStoreState, "focusLoop" | "value">, CompositeStoreOptions {
28
+ export interface RadioStoreOptions extends CompositeStoreOptions, StoreOptions<RadioStoreState, "focusLoop" | "value"> {
29
29
  /**
30
30
  * The default value of the radio group.
31
31
  * @default null
32
32
  */
33
33
  defaultValue?: RadioStoreState["value"];
34
34
  }
35
- export type RadioStoreProps = RadioStoreOptions & StoreProps<RadioStoreState>;
36
- export type RadioStore = RadioStoreFunctions & Store<RadioStoreState>;
35
+ export interface RadioStoreProps extends RadioStoreOptions, StoreProps<RadioStoreState> {
36
+ }
37
+ export interface RadioStore extends RadioStoreFunctions, Store<RadioStoreState> {
38
+ }
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
5
- require('../__chunks/GZDVJEID.cjs');
6
- require('../__chunks/MEHGRTJ3.cjs');
4
+ var _EFIT5L4Xcjs = require('../__chunks/EFIT5L4X.cjs');
5
+ require('../__chunks/2LS4JJ4S.cjs');
6
+ require('../__chunks/GJFZ5ZPP.cjs');
7
7
 
8
8
 
9
- var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
10
- require('../__chunks/JLC5A6WF.cjs');
9
+ var _QAZ4PF7Scjs = require('../__chunks/QAZ4PF7S.cjs');
10
+ require('../__chunks/ZQTYFYRS.cjs');
11
11
 
12
12
 
13
13
 
@@ -16,7 +16,7 @@ require('../__chunks/JLC5A6WF.cjs');
16
16
 
17
17
 
18
18
 
19
- var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
19
+ var _2UK5WUJXcjs = require('../__chunks/2UK5WUJX.cjs');
20
20
 
21
21
 
22
22
  var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
@@ -37,9 +37,9 @@ function createSelectStore(_a = {}) {
37
37
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
38
38
  "combobox"
39
39
  ]);
40
- const store = _46BH65MCcjs.mergeStore.call(void 0,
40
+ const store = _2UK5WUJXcjs.mergeStore.call(void 0,
41
41
  props.store,
42
- _46BH65MCcjs.omit.call(void 0, combobox, [
42
+ _2UK5WUJXcjs.omit.call(void 0, combobox, [
43
43
  "value",
44
44
  "items",
45
45
  "renderedItems",
@@ -51,9 +51,9 @@ function createSelectStore(_a = {}) {
51
51
  "disclosureElement"
52
52
  ])
53
53
  );
54
- _46BH65MCcjs.throwOnConflictingProps.call(void 0, props, store);
54
+ _2UK5WUJXcjs.throwOnConflictingProps.call(void 0, props, store);
55
55
  const syncState = store.getState();
56
- const composite = _6WBY3ZZMcjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
56
+ const composite = _QAZ4PF7Scjs.createCompositeStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
57
57
  store,
58
58
  virtualFocus: _3UT5FE6Kcjs.defaultValue.call(void 0,
59
59
  props.virtualFocus,
@@ -77,7 +77,7 @@ function createSelectStore(_a = {}) {
77
77
  "vertical"
78
78
  )
79
79
  }));
80
- const popover = _7ZUFMSXJcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
80
+ const popover = _EFIT5L4Xcjs.createPopoverStore.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {}, props), {
81
81
  store,
82
82
  placement: _3UT5FE6Kcjs.defaultValue.call(void 0,
83
83
  props.placement,
@@ -101,10 +101,10 @@ function createSelectStore(_a = {}) {
101
101
  selectElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.selectElement, null),
102
102
  labelElement: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState.labelElement, null)
103
103
  });
104
- const select = _46BH65MCcjs.createStore.call(void 0, initialState, composite, popover, store);
105
- _46BH65MCcjs.setup.call(void 0,
104
+ const select = _2UK5WUJXcjs.createStore.call(void 0, initialState, composite, popover, store);
105
+ _2UK5WUJXcjs.setup.call(void 0,
106
106
  select,
107
- () => _46BH65MCcjs.sync.call(void 0, select, ["value", "items"], (state) => {
107
+ () => _2UK5WUJXcjs.sync.call(void 0, select, ["value", "items"], (state) => {
108
108
  if (state.value !== initialValue)
109
109
  return;
110
110
  if (!state.items.length)
@@ -117,9 +117,9 @@ function createSelectStore(_a = {}) {
117
117
  select.setState("value", item.value);
118
118
  })
119
119
  );
120
- _46BH65MCcjs.setup.call(void 0,
120
+ _2UK5WUJXcjs.setup.call(void 0,
121
121
  select,
122
- () => _46BH65MCcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
122
+ () => _2UK5WUJXcjs.sync.call(void 0, select, ["mounted", "items", "value"], (state) => {
123
123
  if (combobox)
124
124
  return;
125
125
  if (state.mounted)
@@ -136,9 +136,9 @@ function createSelectStore(_a = {}) {
136
136
  select.setState("activeId", item.id);
137
137
  })
138
138
  );
139
- _46BH65MCcjs.setup.call(void 0,
139
+ _2UK5WUJXcjs.setup.call(void 0,
140
140
  select,
141
- () => _46BH65MCcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
141
+ () => _2UK5WUJXcjs.batch.call(void 0, select, ["setValueOnMove", "moves"], (state) => {
142
142
  const { mounted, value, activeId } = select.getState();
143
143
  if (!state.setValueOnMove && mounted)
144
144
  return;
@@ -3,42 +3,54 @@ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions
3
3
  import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
4
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  import type { PickRequired, SetState } from "../utils/types.js";
6
- type Value = string | string[];
7
- type MutableValue<T extends Value = Value> = T extends string ? string : T;
8
- type Item = CompositeStoreItem & {
9
- value?: string;
10
- };
11
- export declare function createSelectStore<T extends Value = Value>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
6
+ type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
7
+ export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
12
8
  export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
13
- export type SelectStoreItem = Item;
14
- export type SelectStoreValue = Value;
15
- export interface SelectStoreState<T extends Value = Value> extends CompositeStoreState<Item>, PopoverStoreState {
9
+ export type SelectStoreValue = string | string[];
10
+ export interface SelectStoreItem extends CompositeStoreItem {
11
+ value?: string;
12
+ }
13
+ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreState<SelectStoreItem>, PopoverStoreState {
16
14
  /** @default true */
17
- virtualFocus: CompositeStoreState<Item>["virtualFocus"];
15
+ virtualFocus: CompositeStoreState<SelectStoreItem>["virtualFocus"];
18
16
  /** @default false */
19
- includesBaseElement: CompositeStoreState<Item>["includesBaseElement"];
17
+ includesBaseElement: CompositeStoreState<SelectStoreItem>["includesBaseElement"];
20
18
  /** @default null */
21
- activeId: CompositeStoreState<Item>["activeId"];
19
+ activeId: CompositeStoreState<SelectStoreItem>["activeId"];
22
20
  /** @default "vertical" */
23
- orientation: CompositeStoreState<Item>["orientation"];
21
+ orientation: CompositeStoreState<SelectStoreItem>["orientation"];
24
22
  /** @default "bottom-start" */
25
23
  placement: PopoverStoreState["placement"];
26
24
  /**
27
25
  * The select value.
28
26
  *
29
27
  * Live examples:
30
- * - [Multi-selectable
31
- * Combobox](https://ariakit.org/examples/combobox-multiple)
28
+ * - [Form with Select](https://ariakit.org/examples/form-select)
29
+ * - [Select Grid](https://ariakit.org/examples/select-grid)
30
+ * - [Select with custom
31
+ * items](https://ariakit.org/examples/select-item-custom)
32
+ * - [Multi-Select](https://ariakit.org/examples/select-multiple)
33
+ * - [Toolbar with Select](https://ariakit.org/examples/toolbar-select)
32
34
  */
33
35
  value: MutableValue<T>;
34
36
  /**
35
- * Whether the select value should be set when the active item changes by
36
- * moving (which usually happens when moving to an item using the keyboard).
37
+ * Whether the select
38
+ * [`value`](https://ariakit.org/reference/select-provider#value) should be
39
+ * set when the active item changes by moving (which usually happens when
40
+ * moving to an item using the keyboard).
41
+ *
42
+ * Live examples:
43
+ * - [Select Grid](https://ariakit.org/examples/select-grid)
44
+ * - [Select with custom
45
+ * items](https://ariakit.org/examples/select-item-custom)
37
46
  * @default false
38
47
  */
39
48
  setValueOnMove: boolean;
40
49
  /**
41
50
  * The select button element.
51
+ *
52
+ * Live examples:
53
+ * - [Form with Select](https://ariakit.org/examples/form-select)
42
54
  */
43
55
  selectElement: HTMLElement | null;
44
56
  /**
@@ -46,13 +58,9 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
46
58
  */
47
59
  labelElement: HTMLElement | null;
48
60
  }
49
- export interface SelectStoreFunctions<T extends Value = Value> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<Item>, PopoverStoreFunctions {
61
+ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
50
62
  /**
51
63
  * Sets the `value` state.
52
- *
53
- * Live examples:
54
- * - [Multi-selectable
55
- * Combobox](https://ariakit.org/examples/combobox-multiple)
56
64
  * @example
57
65
  * store.setValue("Apple");
58
66
  * store.setValue(["Apple", "Banana"]);
@@ -68,26 +76,26 @@ export interface SelectStoreFunctions<T extends Value = Value> extends Pick<Sele
68
76
  */
69
77
  setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
70
78
  }
71
- export interface SelectStoreOptions<T extends Value = Value> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<Item>, PopoverStoreOptions {
79
+ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions, StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove"> {
72
80
  /**
73
81
  * A reference to a combobox store. This is used when combining the combobox
74
82
  * with a select (e.g., select with a search input). The stores will share the
75
83
  * same state.
76
- *
77
- * Live examples:
78
- * - [Multi-selectable
79
- * Combobox](https://ariakit.org/examples/combobox-multiple)
80
84
  */
81
85
  combobox?: ComboboxStore | null;
82
86
  /**
83
87
  * The default value. If not set, the first non-disabled item will be used.
84
88
  *
85
89
  * Live examples:
86
- * - [Multi-selectable
87
- * Combobox](https://ariakit.org/examples/combobox-multiple)
90
+ * - [Form with Select](https://ariakit.org/examples/form-select)
91
+ * - [Animated Select](https://ariakit.org/examples/select-animated)
92
+ * - [Select with Combobox](https://ariakit.org/examples/select-combobox)
93
+ * - [SelectGroup](https://ariakit.org/examples/select-group)
88
94
  */
89
95
  defaultValue?: SelectStoreState<T>["value"];
90
96
  }
91
- export type SelectStoreProps<T extends Value = Value> = SelectStoreOptions<T> & StoreProps<SelectStoreState<T>>;
92
- export type SelectStore<T extends Value = Value> = SelectStoreFunctions<T> & Store<SelectStoreState<T>>;
97
+ export interface SelectStoreProps<T extends SelectStoreValue = SelectStoreValue> extends SelectStoreOptions<T>, StoreProps<SelectStoreState<T>> {
98
+ }
99
+ export interface SelectStore<T extends SelectStoreValue = SelectStoreValue> extends SelectStoreFunctions<T>, Store<SelectStoreState<T>> {
100
+ }
93
101
  export {};
@@ -3,42 +3,54 @@ import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions
3
3
  import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
4
4
  import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
5
5
  import type { PickRequired, SetState } from "../utils/types.js";
6
- type Value = string | string[];
7
- type MutableValue<T extends Value = Value> = T extends string ? string : T;
8
- type Item = CompositeStoreItem & {
9
- value?: string;
10
- };
11
- export declare function createSelectStore<T extends Value = Value>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
6
+ type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
7
+ export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
12
8
  export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
13
- export type SelectStoreItem = Item;
14
- export type SelectStoreValue = Value;
15
- export interface SelectStoreState<T extends Value = Value> extends CompositeStoreState<Item>, PopoverStoreState {
9
+ export type SelectStoreValue = string | string[];
10
+ export interface SelectStoreItem extends CompositeStoreItem {
11
+ value?: string;
12
+ }
13
+ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreState<SelectStoreItem>, PopoverStoreState {
16
14
  /** @default true */
17
- virtualFocus: CompositeStoreState<Item>["virtualFocus"];
15
+ virtualFocus: CompositeStoreState<SelectStoreItem>["virtualFocus"];
18
16
  /** @default false */
19
- includesBaseElement: CompositeStoreState<Item>["includesBaseElement"];
17
+ includesBaseElement: CompositeStoreState<SelectStoreItem>["includesBaseElement"];
20
18
  /** @default null */
21
- activeId: CompositeStoreState<Item>["activeId"];
19
+ activeId: CompositeStoreState<SelectStoreItem>["activeId"];
22
20
  /** @default "vertical" */
23
- orientation: CompositeStoreState<Item>["orientation"];
21
+ orientation: CompositeStoreState<SelectStoreItem>["orientation"];
24
22
  /** @default "bottom-start" */
25
23
  placement: PopoverStoreState["placement"];
26
24
  /**
27
25
  * The select value.
28
26
  *
29
27
  * Live examples:
30
- * - [Multi-selectable
31
- * Combobox](https://ariakit.org/examples/combobox-multiple)
28
+ * - [Form with Select](https://ariakit.org/examples/form-select)
29
+ * - [Select Grid](https://ariakit.org/examples/select-grid)
30
+ * - [Select with custom
31
+ * items](https://ariakit.org/examples/select-item-custom)
32
+ * - [Multi-Select](https://ariakit.org/examples/select-multiple)
33
+ * - [Toolbar with Select](https://ariakit.org/examples/toolbar-select)
32
34
  */
33
35
  value: MutableValue<T>;
34
36
  /**
35
- * Whether the select value should be set when the active item changes by
36
- * moving (which usually happens when moving to an item using the keyboard).
37
+ * Whether the select
38
+ * [`value`](https://ariakit.org/reference/select-provider#value) should be
39
+ * set when the active item changes by moving (which usually happens when
40
+ * moving to an item using the keyboard).
41
+ *
42
+ * Live examples:
43
+ * - [Select Grid](https://ariakit.org/examples/select-grid)
44
+ * - [Select with custom
45
+ * items](https://ariakit.org/examples/select-item-custom)
37
46
  * @default false
38
47
  */
39
48
  setValueOnMove: boolean;
40
49
  /**
41
50
  * The select button element.
51
+ *
52
+ * Live examples:
53
+ * - [Form with Select](https://ariakit.org/examples/form-select)
42
54
  */
43
55
  selectElement: HTMLElement | null;
44
56
  /**
@@ -46,13 +58,9 @@ export interface SelectStoreState<T extends Value = Value> extends CompositeStor
46
58
  */
47
59
  labelElement: HTMLElement | null;
48
60
  }
49
- export interface SelectStoreFunctions<T extends Value = Value> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<Item>, PopoverStoreFunctions {
61
+ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
50
62
  /**
51
63
  * Sets the `value` state.
52
- *
53
- * Live examples:
54
- * - [Multi-selectable
55
- * Combobox](https://ariakit.org/examples/combobox-multiple)
56
64
  * @example
57
65
  * store.setValue("Apple");
58
66
  * store.setValue(["Apple", "Banana"]);
@@ -68,26 +76,26 @@ export interface SelectStoreFunctions<T extends Value = Value> extends Pick<Sele
68
76
  */
69
77
  setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
70
78
  }
71
- export interface SelectStoreOptions<T extends Value = Value> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<Item>, PopoverStoreOptions {
79
+ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions, StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove"> {
72
80
  /**
73
81
  * A reference to a combobox store. This is used when combining the combobox
74
82
  * with a select (e.g., select with a search input). The stores will share the
75
83
  * same state.
76
- *
77
- * Live examples:
78
- * - [Multi-selectable
79
- * Combobox](https://ariakit.org/examples/combobox-multiple)
80
84
  */
81
85
  combobox?: ComboboxStore | null;
82
86
  /**
83
87
  * The default value. If not set, the first non-disabled item will be used.
84
88
  *
85
89
  * Live examples:
86
- * - [Multi-selectable
87
- * Combobox](https://ariakit.org/examples/combobox-multiple)
90
+ * - [Form with Select](https://ariakit.org/examples/form-select)
91
+ * - [Animated Select](https://ariakit.org/examples/select-animated)
92
+ * - [Select with Combobox](https://ariakit.org/examples/select-combobox)
93
+ * - [SelectGroup](https://ariakit.org/examples/select-group)
88
94
  */
89
95
  defaultValue?: SelectStoreState<T>["value"];
90
96
  }
91
- export type SelectStoreProps<T extends Value = Value> = SelectStoreOptions<T> & StoreProps<SelectStoreState<T>>;
92
- export type SelectStore<T extends Value = Value> = SelectStoreFunctions<T> & Store<SelectStoreState<T>>;
97
+ export interface SelectStoreProps<T extends SelectStoreValue = SelectStoreValue> extends SelectStoreOptions<T>, StoreProps<SelectStoreState<T>> {
98
+ }
99
+ export interface SelectStore<T extends SelectStoreValue = SelectStoreValue> extends SelectStoreFunctions<T>, Store<SelectStoreState<T>> {
100
+ }
93
101
  export {};