@ariakit/core 0.4.0 → 0.4.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # @ariakit/core
2
2
 
3
+ ## 0.4.1
4
+
5
+ - Added [`disclosure`](https://ariakit.org/reference/use-disclosure-store#disclosure-1) property to disclosure stores.
6
+ - Improved JSDocs.
7
+
3
8
  ## 0.4.0
4
9
 
5
10
  ### Improved animation support
@@ -13,10 +13,16 @@ export interface ComboboxStoreItem extends CompositeStoreItem {
13
13
  value?: string;
14
14
  }
15
15
  export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreState<ComboboxStoreItem>, PopoverStoreState {
16
- /**
17
- * @default true
18
- */
19
- includesBaseElement: boolean;
16
+ /** @default true */
17
+ includesBaseElement: CompositeStoreState<ComboboxStoreItem>["includesBaseElement"];
18
+ /** @default true */
19
+ focusLoop: CompositeStoreState<ComboboxStoreItem>["focusLoop"];
20
+ /** @default true */
21
+ focusWrap: CompositeStoreState<ComboboxStoreItem>["focusWrap"];
22
+ /** @default "vertical" */
23
+ orientation: CompositeStoreState<ComboboxStoreItem>["orientation"];
24
+ /** @default true */
25
+ virtualFocus: CompositeStoreState<ComboboxStoreItem>["virtualFocus"];
20
26
  /**
21
27
  * The combobox input value.
22
28
  *
@@ -63,6 +69,7 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
63
69
  * - [Select with Combobox](https://ariakit.org/examples/select-combobox)
64
70
  * - [Submenu with
65
71
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
72
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
66
73
  */
67
74
  resetValueOnHide: boolean;
68
75
  /**
@@ -100,10 +107,8 @@ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = C
100
107
  */
101
108
  setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
102
109
  }
103
- export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions, StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect"> {
104
- /**
105
- * @default null
106
- */
110
+ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "focusLoop" | "focusWrap" | "orientation" | "virtualFocus" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect">, CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions {
111
+ /** @default null */
107
112
  defaultActiveId?: CompositeStoreOptions<ComboboxStoreItem>["activeId"];
108
113
  /**
109
114
  * The initial value of the combobox input.
@@ -13,10 +13,16 @@ export interface ComboboxStoreItem extends CompositeStoreItem {
13
13
  value?: string;
14
14
  }
15
15
  export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreState<ComboboxStoreItem>, PopoverStoreState {
16
- /**
17
- * @default true
18
- */
19
- includesBaseElement: boolean;
16
+ /** @default true */
17
+ includesBaseElement: CompositeStoreState<ComboboxStoreItem>["includesBaseElement"];
18
+ /** @default true */
19
+ focusLoop: CompositeStoreState<ComboboxStoreItem>["focusLoop"];
20
+ /** @default true */
21
+ focusWrap: CompositeStoreState<ComboboxStoreItem>["focusWrap"];
22
+ /** @default "vertical" */
23
+ orientation: CompositeStoreState<ComboboxStoreItem>["orientation"];
24
+ /** @default true */
25
+ virtualFocus: CompositeStoreState<ComboboxStoreItem>["virtualFocus"];
20
26
  /**
21
27
  * The combobox input value.
22
28
  *
@@ -63,6 +69,7 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
63
69
  * - [Select with Combobox](https://ariakit.org/examples/select-combobox)
64
70
  * - [Submenu with
65
71
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
72
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
66
73
  */
67
74
  resetValueOnHide: boolean;
68
75
  /**
@@ -100,10 +107,8 @@ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = C
100
107
  */
101
108
  setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
102
109
  }
103
- export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions, StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect"> {
104
- /**
105
- * @default null
106
- */
110
+ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "focusLoop" | "focusWrap" | "orientation" | "virtualFocus" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect">, CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions {
111
+ /** @default null */
107
112
  defaultActiveId?: CompositeStoreOptions<ComboboxStoreItem>["activeId"];
108
113
  /**
109
114
  * The initial value of the combobox input.
@@ -112,6 +112,9 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
112
112
  * matches the value of `focusLoop`, it'll wrap between the last item in the
113
113
  * last row or column and the first item in the first row or column and
114
114
  * vice-versa.
115
+ *
116
+ * Live examples:
117
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
115
118
  * @default false
116
119
  */
117
120
  focusLoop: boolean | Orientation;
@@ -157,6 +160,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
157
160
  * - [Submenu with
158
161
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
159
162
  * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
163
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
160
164
  * @default false
161
165
  */
162
166
  includesBaseElement: boolean;
@@ -112,6 +112,9 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
112
112
  * matches the value of `focusLoop`, it'll wrap between the last item in the
113
113
  * last row or column and the first item in the first row or column and
114
114
  * vice-versa.
115
+ *
116
+ * Live examples:
117
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
115
118
  * @default false
116
119
  */
117
120
  focusLoop: boolean | Orientation;
@@ -157,6 +160,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
157
160
  * - [Submenu with
158
161
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
159
162
  * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
163
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
160
164
  * @default false
161
165
  */
162
166
  includesBaseElement: boolean;
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createHovercardStore(props?: HovercardStoreProps): HovercardStore;
8
8
  export interface HovercardStoreState extends PopoverStoreState {
9
- /**
10
- * @default "bottom"
11
- */
9
+ /** @default "bottom" */
12
10
  placement: PopoverStoreState["placement"];
13
11
  /**
14
12
  * The amount of time in milliseconds to wait before showing and hiding the
@@ -57,7 +55,7 @@ export interface HovercardStoreFunctions extends PopoverStoreFunctions {
57
55
  */
58
56
  setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
59
57
  }
60
- export interface HovercardStoreOptions extends PopoverStoreOptions, StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout"> {
58
+ export interface HovercardStoreOptions extends StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout">, PopoverStoreOptions {
61
59
  }
62
60
  export interface HovercardStoreProps extends HovercardStoreOptions, StoreProps<HovercardStoreState> {
63
61
  }
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createHovercardStore(props?: HovercardStoreProps): HovercardStore;
8
8
  export interface HovercardStoreState extends PopoverStoreState {
9
- /**
10
- * @default "bottom"
11
- */
9
+ /** @default "bottom" */
12
10
  placement: PopoverStoreState["placement"];
13
11
  /**
14
12
  * The amount of time in milliseconds to wait before showing and hiding the
@@ -57,7 +55,7 @@ export interface HovercardStoreFunctions extends PopoverStoreFunctions {
57
55
  */
58
56
  setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
59
57
  }
60
- export interface HovercardStoreOptions extends PopoverStoreOptions, StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout"> {
58
+ export interface HovercardStoreOptions extends StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout">, PopoverStoreOptions {
61
59
  }
62
60
  export interface HovercardStoreProps extends HovercardStoreOptions, StoreProps<HovercardStoreState> {
63
61
  }
@@ -8,6 +8,12 @@ export declare function createMenuStore<T extends MenuStoreValues = MenuStoreVal
8
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
9
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
10
10
  export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
11
+ /** @default "vertical" */
12
+ orientation: CompositeStoreState["orientation"];
13
+ /** @default "bottom-start" */
14
+ placement: HovercardStoreState["placement"];
15
+ /** @default 0 */
16
+ hideTimeout?: HovercardStoreState["hideTimeout"];
11
17
  /**
12
18
  * Determines the element that should be focused when the menu is opened.
13
19
  */
@@ -24,12 +30,6 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
24
30
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
25
31
  */
26
32
  values: T;
27
- /** @default "vertical" */
28
- orientation: CompositeStoreState["orientation"];
29
- /** @default "bottom-start" */
30
- placement: HovercardStoreState["placement"];
31
- /** @default 0 */
32
- hideTimeout?: HovercardStoreState["hideTimeout"];
33
33
  }
34
34
  export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreFunctions, HovercardStoreFunctions, Pick<MenuStoreOptions, "combobox" | "parent" | "menubar"> {
35
35
  /**
@@ -64,7 +64,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
64
64
  */
65
65
  setValue: BivariantCallback<(name: string, value: SetStateAction<MenuStoreState<T>["values"][string]>) => void>;
66
66
  }
67
- export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreOptions, HovercardStoreOptions, StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values"> {
67
+ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values">, CompositeStoreOptions, HovercardStoreOptions {
68
68
  /**
69
69
  * A reference to a combobox store. This is used when combining the combobox
70
70
  * with a menu (e.g., dropdown menu with a search input). The stores will
@@ -8,6 +8,12 @@ export declare function createMenuStore<T extends MenuStoreValues = MenuStoreVal
8
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
9
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
10
10
  export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
11
+ /** @default "vertical" */
12
+ orientation: CompositeStoreState["orientation"];
13
+ /** @default "bottom-start" */
14
+ placement: HovercardStoreState["placement"];
15
+ /** @default 0 */
16
+ hideTimeout?: HovercardStoreState["hideTimeout"];
11
17
  /**
12
18
  * Determines the element that should be focused when the menu is opened.
13
19
  */
@@ -24,12 +30,6 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
24
30
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
25
31
  */
26
32
  values: T;
27
- /** @default "vertical" */
28
- orientation: CompositeStoreState["orientation"];
29
- /** @default "bottom-start" */
30
- placement: HovercardStoreState["placement"];
31
- /** @default 0 */
32
- hideTimeout?: HovercardStoreState["hideTimeout"];
33
33
  }
34
34
  export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreFunctions, HovercardStoreFunctions, Pick<MenuStoreOptions, "combobox" | "parent" | "menubar"> {
35
35
  /**
@@ -64,7 +64,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
64
64
  */
65
65
  setValue: BivariantCallback<(name: string, value: SetStateAction<MenuStoreState<T>["values"][string]>) => void>;
66
66
  }
67
- export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreOptions, HovercardStoreOptions, StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values"> {
67
+ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values">, CompositeStoreOptions, HovercardStoreOptions {
68
68
  /**
69
69
  * A reference to a combobox store. This is used when combining the combobox
70
70
  * with a menu (e.g., dropdown menu with a search input). The stores will
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createRadioStore({ ...props }?: RadioStoreProps): RadioStore;
8
8
  export interface RadioStoreState extends CompositeStoreState {
9
- /**
10
- * @default true
11
- */
9
+ /** @default true */
12
10
  focusLoop: CompositeStoreState["focusLoop"];
13
11
  /**
14
12
  * The value of the radio group.
@@ -26,7 +24,7 @@ export interface RadioStoreFunctions extends CompositeStoreFunctions {
26
24
  */
27
25
  setValue: SetState<RadioStoreState["value"]>;
28
26
  }
29
- export interface RadioStoreOptions extends CompositeStoreOptions, StoreOptions<RadioStoreState, "focusLoop" | "value"> {
27
+ export interface RadioStoreOptions extends StoreOptions<RadioStoreState, "focusLoop" | "value">, CompositeStoreOptions {
30
28
  /**
31
29
  * The default value of the radio group.
32
30
  * @default null
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createRadioStore({ ...props }?: RadioStoreProps): RadioStore;
8
8
  export interface RadioStoreState extends CompositeStoreState {
9
- /**
10
- * @default true
11
- */
9
+ /** @default true */
12
10
  focusLoop: CompositeStoreState["focusLoop"];
13
11
  /**
14
12
  * The value of the radio group.
@@ -26,7 +24,7 @@ export interface RadioStoreFunctions extends CompositeStoreFunctions {
26
24
  */
27
25
  setValue: SetState<RadioStoreState["value"]>;
28
26
  }
29
- export interface RadioStoreOptions extends CompositeStoreOptions, StoreOptions<RadioStoreState, "focusLoop" | "value"> {
27
+ export interface RadioStoreOptions extends StoreOptions<RadioStoreState, "focusLoop" | "value">, CompositeStoreOptions {
30
28
  /**
31
29
  * The default value of the radio group.
32
30
  * @default null
@@ -13,8 +13,6 @@ export interface SelectStoreItem extends CompositeStoreItem {
13
13
  export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreState<SelectStoreItem>, PopoverStoreState {
14
14
  /** @default true */
15
15
  virtualFocus: CompositeStoreState<SelectStoreItem>["virtualFocus"];
16
- /** @default false */
17
- includesBaseElement: CompositeStoreState<SelectStoreItem>["includesBaseElement"];
18
16
  /** @default null */
19
17
  activeId: CompositeStoreState<SelectStoreItem>["activeId"];
20
18
  /** @default "vertical" */
@@ -77,7 +75,7 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
77
75
  */
78
76
  setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
79
77
  }
80
- export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions, StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove"> {
78
+ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
81
79
  /**
82
80
  * A reference to a combobox store. This is used when combining the combobox
83
81
  * with a select (e.g., select with a search input). The stores will share the
@@ -13,8 +13,6 @@ export interface SelectStoreItem extends CompositeStoreItem {
13
13
  export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreState<SelectStoreItem>, PopoverStoreState {
14
14
  /** @default true */
15
15
  virtualFocus: CompositeStoreState<SelectStoreItem>["virtualFocus"];
16
- /** @default false */
17
- includesBaseElement: CompositeStoreState<SelectStoreItem>["includesBaseElement"];
18
16
  /** @default null */
19
17
  activeId: CompositeStoreState<SelectStoreItem>["activeId"];
20
18
  /** @default "vertical" */
@@ -77,7 +75,7 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
77
75
  */
78
76
  setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
79
77
  }
80
- export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions, StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove"> {
78
+ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
81
79
  /**
82
80
  * A reference to a combobox store. This is used when combining the combobox
83
81
  * with a select (e.g., select with a search input). The stores will share the
@@ -12,7 +12,7 @@ export interface ToolbarStoreState extends CompositeStoreState {
12
12
  }
13
13
  export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
14
14
  }
15
- export interface ToolbarStoreOptions extends CompositeStoreOptions, StoreOptions<ToolbarStoreState, "orientation" | "focusLoop"> {
15
+ export interface ToolbarStoreOptions extends StoreOptions<ToolbarStoreState, "orientation" | "focusLoop">, CompositeStoreOptions {
16
16
  }
17
17
  export interface ToolbarStoreProps extends ToolbarStoreOptions, StoreProps<ToolbarStoreState> {
18
18
  }
@@ -12,7 +12,7 @@ export interface ToolbarStoreState extends CompositeStoreState {
12
12
  }
13
13
  export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
14
14
  }
15
- export interface ToolbarStoreOptions extends CompositeStoreOptions, StoreOptions<ToolbarStoreState, "orientation" | "focusLoop"> {
15
+ export interface ToolbarStoreOptions extends StoreOptions<ToolbarStoreState, "orientation" | "focusLoop">, CompositeStoreOptions {
16
16
  }
17
17
  export interface ToolbarStoreProps extends ToolbarStoreOptions, StoreProps<ToolbarStoreState> {
18
18
  }
@@ -25,7 +25,7 @@ export interface TooltipStoreState extends HovercardStoreState {
25
25
  skipTimeout: number;
26
26
  }
27
27
  export type TooltipStoreFunctions = HovercardStoreFunctions;
28
- export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
28
+ export interface TooltipStoreOptions extends StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout">, HovercardStoreOptions {
29
29
  }
30
30
  export interface TooltipStoreProps extends TooltipStoreOptions, StoreProps<TooltipStoreState> {
31
31
  }
@@ -25,7 +25,7 @@ export interface TooltipStoreState extends HovercardStoreState {
25
25
  skipTimeout: number;
26
26
  }
27
27
  export type TooltipStoreFunctions = HovercardStoreFunctions;
28
- export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
28
+ export interface TooltipStoreOptions extends StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout">, HovercardStoreOptions {
29
29
  }
30
30
  export interface TooltipStoreProps extends TooltipStoreOptions, StoreProps<TooltipStoreState> {
31
31
  }
@@ -13,10 +13,16 @@ export interface ComboboxStoreItem extends CompositeStoreItem {
13
13
  value?: string;
14
14
  }
15
15
  export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreState<ComboboxStoreItem>, PopoverStoreState {
16
- /**
17
- * @default true
18
- */
19
- includesBaseElement: boolean;
16
+ /** @default true */
17
+ includesBaseElement: CompositeStoreState<ComboboxStoreItem>["includesBaseElement"];
18
+ /** @default true */
19
+ focusLoop: CompositeStoreState<ComboboxStoreItem>["focusLoop"];
20
+ /** @default true */
21
+ focusWrap: CompositeStoreState<ComboboxStoreItem>["focusWrap"];
22
+ /** @default "vertical" */
23
+ orientation: CompositeStoreState<ComboboxStoreItem>["orientation"];
24
+ /** @default true */
25
+ virtualFocus: CompositeStoreState<ComboboxStoreItem>["virtualFocus"];
20
26
  /**
21
27
  * The combobox input value.
22
28
  *
@@ -63,6 +69,7 @@ export interface ComboboxStoreState<T extends ComboboxStoreSelectedValue = Combo
63
69
  * - [Select with Combobox](https://ariakit.org/examples/select-combobox)
64
70
  * - [Submenu with
65
71
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
72
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
66
73
  */
67
74
  resetValueOnHide: boolean;
68
75
  /**
@@ -100,10 +107,8 @@ export interface ComboboxStoreFunctions<T extends ComboboxStoreSelectedValue = C
100
107
  */
101
108
  setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
102
109
  }
103
- export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions, StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect"> {
104
- /**
105
- * @default null
106
- */
110
+ export interface ComboboxStoreOptions<T extends ComboboxStoreSelectedValue = ComboboxStoreSelectedValue> extends StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "focusLoop" | "focusWrap" | "orientation" | "virtualFocus" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect">, CompositeStoreOptions<ComboboxStoreItem>, PopoverStoreOptions {
111
+ /** @default null */
107
112
  defaultActiveId?: CompositeStoreOptions<ComboboxStoreItem>["activeId"];
108
113
  /**
109
114
  * The initial value of the combobox input.
@@ -112,6 +112,9 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
112
112
  * matches the value of `focusLoop`, it'll wrap between the last item in the
113
113
  * last row or column and the first item in the first row or column and
114
114
  * vice-versa.
115
+ *
116
+ * Live examples:
117
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
115
118
  * @default false
116
119
  */
117
120
  focusLoop: boolean | Orientation;
@@ -157,6 +160,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
157
160
  * - [Submenu with
158
161
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
159
162
  * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
163
+ * - [Command Menu](https://ariakit.org/examples/dialog-combobox-command-menu)
160
164
  * @default false
161
165
  */
162
166
  includesBaseElement: boolean;
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createHovercardStore(props?: HovercardStoreProps): HovercardStore;
8
8
  export interface HovercardStoreState extends PopoverStoreState {
9
- /**
10
- * @default "bottom"
11
- */
9
+ /** @default "bottom" */
12
10
  placement: PopoverStoreState["placement"];
13
11
  /**
14
12
  * The amount of time in milliseconds to wait before showing and hiding the
@@ -57,7 +55,7 @@ export interface HovercardStoreFunctions extends PopoverStoreFunctions {
57
55
  */
58
56
  setAutoFocusOnShow: SetState<HovercardStoreState["autoFocusOnShow"]>;
59
57
  }
60
- export interface HovercardStoreOptions extends PopoverStoreOptions, StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout"> {
58
+ export interface HovercardStoreOptions extends StoreOptions<HovercardStoreState, "placement" | "timeout" | "showTimeout" | "hideTimeout">, PopoverStoreOptions {
61
59
  }
62
60
  export interface HovercardStoreProps extends HovercardStoreOptions, StoreProps<HovercardStoreState> {
63
61
  }
@@ -8,6 +8,12 @@ export declare function createMenuStore<T extends MenuStoreValues = MenuStoreVal
8
8
  export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
9
9
  export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
10
10
  export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreState, HovercardStoreState {
11
+ /** @default "vertical" */
12
+ orientation: CompositeStoreState["orientation"];
13
+ /** @default "bottom-start" */
14
+ placement: HovercardStoreState["placement"];
15
+ /** @default 0 */
16
+ hideTimeout?: HovercardStoreState["hideTimeout"];
11
17
  /**
12
18
  * Determines the element that should be focused when the menu is opened.
13
19
  */
@@ -24,12 +30,6 @@ export interface MenuStoreState<T extends MenuStoreValues = MenuStoreValues> ext
24
30
  * Combobox](https://ariakit.org/examples/menu-nested-combobox)
25
31
  */
26
32
  values: T;
27
- /** @default "vertical" */
28
- orientation: CompositeStoreState["orientation"];
29
- /** @default "bottom-start" */
30
- placement: HovercardStoreState["placement"];
31
- /** @default 0 */
32
- hideTimeout?: HovercardStoreState["hideTimeout"];
33
33
  }
34
34
  export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreFunctions, HovercardStoreFunctions, Pick<MenuStoreOptions, "combobox" | "parent" | "menubar"> {
35
35
  /**
@@ -64,7 +64,7 @@ export interface MenuStoreFunctions<T extends MenuStoreValues = MenuStoreValues>
64
64
  */
65
65
  setValue: BivariantCallback<(name: string, value: SetStateAction<MenuStoreState<T>["values"][string]>) => void>;
66
66
  }
67
- export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends CompositeStoreOptions, HovercardStoreOptions, StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values"> {
67
+ export interface MenuStoreOptions<T extends MenuStoreValues = MenuStoreValues> extends StoreOptions<MenuStoreState<T>, "orientation" | "placement" | "hideTimeout" | "values">, CompositeStoreOptions, HovercardStoreOptions {
68
68
  /**
69
69
  * A reference to a combobox store. This is used when combining the combobox
70
70
  * with a menu (e.g., dropdown menu with a search input). The stores will
@@ -6,9 +6,7 @@ import type { SetState } from "../utils/types.js";
6
6
  */
7
7
  export declare function createRadioStore({ ...props }?: RadioStoreProps): RadioStore;
8
8
  export interface RadioStoreState extends CompositeStoreState {
9
- /**
10
- * @default true
11
- */
9
+ /** @default true */
12
10
  focusLoop: CompositeStoreState["focusLoop"];
13
11
  /**
14
12
  * The value of the radio group.
@@ -26,7 +24,7 @@ export interface RadioStoreFunctions extends CompositeStoreFunctions {
26
24
  */
27
25
  setValue: SetState<RadioStoreState["value"]>;
28
26
  }
29
- export interface RadioStoreOptions extends CompositeStoreOptions, StoreOptions<RadioStoreState, "focusLoop" | "value"> {
27
+ export interface RadioStoreOptions extends StoreOptions<RadioStoreState, "focusLoop" | "value">, CompositeStoreOptions {
30
28
  /**
31
29
  * The default value of the radio group.
32
30
  * @default null
@@ -13,8 +13,6 @@ export interface SelectStoreItem extends CompositeStoreItem {
13
13
  export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreState<SelectStoreItem>, PopoverStoreState {
14
14
  /** @default true */
15
15
  virtualFocus: CompositeStoreState<SelectStoreItem>["virtualFocus"];
16
- /** @default false */
17
- includesBaseElement: CompositeStoreState<SelectStoreItem>["includesBaseElement"];
18
16
  /** @default null */
19
17
  activeId: CompositeStoreState<SelectStoreItem>["activeId"];
20
18
  /** @default "vertical" */
@@ -77,7 +75,7 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
77
75
  */
78
76
  setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
79
77
  }
80
- export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions, StoreOptions<SelectStoreState<T>, "virtualFocus" | "includesBaseElement" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove"> {
78
+ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
81
79
  /**
82
80
  * A reference to a combobox store. This is used when combining the combobox
83
81
  * with a select (e.g., select with a search input). The stores will share the
@@ -12,7 +12,7 @@ export interface ToolbarStoreState extends CompositeStoreState {
12
12
  }
13
13
  export interface ToolbarStoreFunctions extends CompositeStoreFunctions {
14
14
  }
15
- export interface ToolbarStoreOptions extends CompositeStoreOptions, StoreOptions<ToolbarStoreState, "orientation" | "focusLoop"> {
15
+ export interface ToolbarStoreOptions extends StoreOptions<ToolbarStoreState, "orientation" | "focusLoop">, CompositeStoreOptions {
16
16
  }
17
17
  export interface ToolbarStoreProps extends ToolbarStoreOptions, StoreProps<ToolbarStoreState> {
18
18
  }
@@ -25,7 +25,7 @@ export interface TooltipStoreState extends HovercardStoreState {
25
25
  skipTimeout: number;
26
26
  }
27
27
  export type TooltipStoreFunctions = HovercardStoreFunctions;
28
- export interface TooltipStoreOptions extends HovercardStoreOptions, StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout"> {
28
+ export interface TooltipStoreOptions extends StoreOptions<TooltipStoreState, "type" | "placement" | "timeout" | "showTimeout" | "hideTimeout" | "skipTimeout">, HovercardStoreOptions {
29
29
  }
30
30
  export interface TooltipStoreProps extends TooltipStoreOptions, StoreProps<TooltipStoreState> {
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ariakit/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Ariakit core",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",