@ariakit/core 0.3.5 → 0.3.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.
- package/CHANGELOG.md +18 -0
- package/cjs/__chunks/{FJSZTIOU.cjs → 46BH65MC.cjs} +4 -6
- package/cjs/__chunks/{FTB5CXVB.cjs → 5F4DVUNS.cjs} +7 -1
- package/cjs/__chunks/{AR2VJ37F.cjs → 6WBY3ZZM.cjs} +6 -6
- package/cjs/__chunks/{HOEZKRUM.cjs → 7ZUFMSXJ.cjs} +7 -7
- package/cjs/__chunks/{F5YZIIEA.cjs → GXIZMD53.cjs} +8 -2
- package/cjs/__chunks/{MYTMMWXI.cjs → GZDVJEID.cjs} +2 -2
- package/cjs/__chunks/{FFY2GSOG.cjs → JLC5A6WF.cjs} +8 -8
- package/cjs/__chunks/{F6Q5QSXF.cjs → MEHGRTJ3.cjs} +11 -11
- package/cjs/__chunks/{XVR5QRC3.cjs → PD7XZBXC.cjs} +4 -4
- package/cjs/__chunks/{G5EW4WED.cjs → YIUPKKEK.cjs} +6 -6
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +6 -4
- package/cjs/collection/collection-store.d.ts +6 -4
- package/cjs/combobox/combobox-store.cjs +48 -26
- package/cjs/combobox/combobox-store.d.cts +69 -21
- package/cjs/combobox/combobox-store.d.ts +69 -21
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +6 -8
- package/cjs/composite/composite-store.d.ts +6 -8
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +2 -0
- package/cjs/disclosure/disclosure-store.d.ts +2 -0
- package/cjs/form/form-store.cjs +8 -8
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard-store.d.cts +6 -0
- package/cjs/hovercard/hovercard-store.d.ts +6 -0
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-store.cjs +19 -19
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/menubar/menubar-store.d.cts +12 -6
- package/cjs/menubar/menubar-store.d.ts +12 -6
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover-store.d.cts +3 -0
- package/cjs/popover/popover-store.d.ts +3 -0
- package/cjs/radio/radio-store.cjs +6 -6
- package/cjs/select/select-store.cjs +19 -19
- package/cjs/select/select-store.d.cts +28 -18
- package/cjs/select/select-store.d.ts +28 -18
- package/cjs/tab/tab-store.cjs +16 -16
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/utils/dom.cjs +4 -2
- package/cjs/utils/dom.d.cts +9 -0
- package/cjs/utils/dom.d.ts +9 -0
- package/cjs/utils/events.cjs +5 -5
- package/cjs/utils/focus.cjs +13 -13
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/store.d.cts +3 -0
- package/cjs/utils/store.d.ts +3 -0
- package/esm/__chunks/{6LSGADQM.js → ANO6WJO4.js} +8 -2
- package/esm/__chunks/{EIFVU736.js → BXH3I7ML.js} +2 -2
- package/esm/__chunks/{6EMNXRG3.js → CCU5UHQ2.js} +2 -2
- package/esm/__chunks/{DREIYIMP.js → CL47ZAPY.js} +1 -1
- package/esm/__chunks/{NIF7E7VE.js → DLOEKDPY.js} +7 -1
- package/esm/__chunks/{PCA5ARZU.js → DYD4YNLE.js} +1 -1
- package/esm/__chunks/{HJS6GJT4.js → E7OQVGGY.js} +4 -6
- package/esm/__chunks/{5UJPJ37G.js → MHPO2BXA.js} +1 -1
- package/esm/__chunks/{5BWT4GY2.js → OGMLJYDV.js} +2 -2
- package/esm/__chunks/{MRBDYBGO.js → WY3EMTH6.js} +2 -2
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +6 -4
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +69 -21
- package/esm/combobox/combobox-store.js +35 -13
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +6 -8
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +2 -0
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.js +3 -3
- package/esm/hovercard/hovercard-store.d.ts +6 -0
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.d.ts +12 -6
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.d.ts +3 -0
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +28 -18
- package/esm/select/select-store.js +7 -7
- package/esm/tab/tab-store.js +4 -4
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/dom.d.ts +9 -0
- package/esm/utils/dom.js +5 -3
- package/esm/utils/events.js +2 -2
- package/esm/utils/focus.js +1 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +3 -0
- package/esm/utils/store.js +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
2
2
|
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
3
3
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
4
|
-
import type { SetState } from "../utils/types.js";
|
|
5
|
-
type
|
|
4
|
+
import type { PickRequired, SetState } from "../utils/types.js";
|
|
5
|
+
type Value = string | string[];
|
|
6
|
+
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
7
|
+
interface Item extends CompositeStoreItem {
|
|
6
8
|
value?: string;
|
|
7
|
-
}
|
|
9
|
+
}
|
|
8
10
|
/**
|
|
9
11
|
* Creates a combobox store.
|
|
10
12
|
*/
|
|
13
|
+
export declare function createComboboxStore<T extends Value = Value>(props: PickRequired<ComboboxStoreProps<T>, "selectedValue" | "defaultSelectedValue">): ComboboxStore<T>;
|
|
11
14
|
export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
|
|
12
15
|
export type ComboboxStoreItem = Item;
|
|
13
|
-
export
|
|
16
|
+
export type ComboboxStoreSelectedValue = Value;
|
|
17
|
+
export interface ComboboxStoreState<T extends Value = Value> extends CompositeStoreState<Item>, PopoverStoreState {
|
|
14
18
|
/**
|
|
15
19
|
* @default true
|
|
16
20
|
*/
|
|
17
21
|
includesBaseElement: boolean;
|
|
18
22
|
/**
|
|
19
|
-
* The input value.
|
|
23
|
+
* The combobox input value.
|
|
20
24
|
*
|
|
21
25
|
* Live examples:
|
|
22
|
-
* - [
|
|
26
|
+
* - [Combobox with integrated
|
|
27
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
23
28
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
24
29
|
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
25
30
|
* - [Multi-selectable
|
|
@@ -33,45 +38,88 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
33
38
|
*/
|
|
34
39
|
activeValue: string | undefined;
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
41
|
+
* The value(s) of the currently selected item(s). This can be a string or an
|
|
42
|
+
* array of strings. If it's an array, the combobox is considered
|
|
43
|
+
* [multi-selectable](https://ariakit.org/examples/combobox-multiple).
|
|
44
|
+
*
|
|
45
|
+
* Live examples:
|
|
46
|
+
* - [Multi-selectable
|
|
47
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
48
|
+
*/
|
|
49
|
+
selectedValue: MutableValue<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to reset the value when the combobox popover closes. This prop is
|
|
52
|
+
* automatically set to `true` by default if the combobox supports multiple
|
|
53
|
+
* selections. In other words, if the
|
|
54
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
55
|
+
* or
|
|
56
|
+
* [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
|
|
57
|
+
* props are arrays.
|
|
37
58
|
*
|
|
38
59
|
* Live examples:
|
|
39
60
|
* - [Multi-selectable
|
|
40
61
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
41
|
-
*
|
|
62
|
+
* - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
|
|
63
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
42
64
|
*/
|
|
43
65
|
resetValueOnHide: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface ComboboxStoreFunctions extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
46
66
|
/**
|
|
47
|
-
*
|
|
67
|
+
* Whether to reset the value when an item is selected. This prop is
|
|
68
|
+
* automatically set to `true` by default if the combobox supports multiple
|
|
69
|
+
* selections. In other words, if the
|
|
70
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
71
|
+
* or
|
|
72
|
+
* [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
|
|
73
|
+
* props are arrays.
|
|
48
74
|
*
|
|
49
75
|
* Live examples:
|
|
50
76
|
* - [Multi-selectable
|
|
51
77
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
78
|
+
*/
|
|
79
|
+
resetValueOnSelect: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface ComboboxStoreFunctions<T extends Value = Value> extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
82
|
+
/**
|
|
83
|
+
* Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
|
|
84
|
+
* state.
|
|
85
|
+
*
|
|
86
|
+
* Live examples:
|
|
52
87
|
* - [Textarea with inline
|
|
53
88
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
54
89
|
* @example
|
|
55
90
|
* store.setValue("Hello world");
|
|
56
91
|
* store.setValue((value) => value + "!");
|
|
57
92
|
*/
|
|
58
|
-
setValue: SetState<ComboboxStoreState["value"]>;
|
|
93
|
+
setValue: SetState<ComboboxStoreState<T>["value"]>;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the
|
|
96
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
97
|
+
* state.
|
|
98
|
+
*/
|
|
99
|
+
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
59
100
|
}
|
|
60
|
-
export interface ComboboxStoreOptions extends StoreOptions<ComboboxStoreState
|
|
101
|
+
export interface ComboboxStoreOptions<T extends Value = Value> extends StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect">, CompositeStoreOptions<Item>, PopoverStoreOptions {
|
|
61
102
|
/**
|
|
62
103
|
* @default null
|
|
63
104
|
*/
|
|
64
105
|
defaultActiveId?: CompositeStoreOptions<Item>["activeId"];
|
|
65
106
|
/**
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
107
|
+
* The initial value of the combobox input.
|
|
108
|
+
* @default ""
|
|
109
|
+
*/
|
|
110
|
+
defaultValue?: ComboboxStoreState<T>["value"];
|
|
111
|
+
/**
|
|
112
|
+
* The initial value of the
|
|
113
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
114
|
+
* state. This can be a string or an array of strings. If it's an array, the
|
|
115
|
+
* combobox is considered
|
|
116
|
+
* [multi-selectable](https://ariakit.org/examples/combobox-multiple).
|
|
71
117
|
* @default ""
|
|
72
118
|
*/
|
|
73
|
-
|
|
119
|
+
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
120
|
+
}
|
|
121
|
+
export interface ComboboxStoreProps<T extends Value = Value> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
|
|
122
|
+
}
|
|
123
|
+
export interface ComboboxStore<T extends Value = Value> extends ComboboxStoreFunctions<T>, Store<ComboboxStoreState<T>> {
|
|
74
124
|
}
|
|
75
|
-
export type ComboboxStoreProps = ComboboxStoreOptions & StoreProps<ComboboxStoreState>;
|
|
76
|
-
export type ComboboxStore = ComboboxStoreFunctions & Store<ComboboxStoreState>;
|
|
77
125
|
export {};
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.js";
|
|
2
2
|
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.js";
|
|
3
3
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
4
|
-
import type { SetState } from "../utils/types.js";
|
|
5
|
-
type
|
|
4
|
+
import type { PickRequired, SetState } from "../utils/types.js";
|
|
5
|
+
type Value = string | string[];
|
|
6
|
+
type MutableValue<T extends Value = Value> = T extends string ? string : T;
|
|
7
|
+
interface Item extends CompositeStoreItem {
|
|
6
8
|
value?: string;
|
|
7
|
-
}
|
|
9
|
+
}
|
|
8
10
|
/**
|
|
9
11
|
* Creates a combobox store.
|
|
10
12
|
*/
|
|
13
|
+
export declare function createComboboxStore<T extends Value = Value>(props: PickRequired<ComboboxStoreProps<T>, "selectedValue" | "defaultSelectedValue">): ComboboxStore<T>;
|
|
11
14
|
export declare function createComboboxStore(props?: ComboboxStoreProps): ComboboxStore;
|
|
12
15
|
export type ComboboxStoreItem = Item;
|
|
13
|
-
export
|
|
16
|
+
export type ComboboxStoreSelectedValue = Value;
|
|
17
|
+
export interface ComboboxStoreState<T extends Value = Value> extends CompositeStoreState<Item>, PopoverStoreState {
|
|
14
18
|
/**
|
|
15
19
|
* @default true
|
|
16
20
|
*/
|
|
17
21
|
includesBaseElement: boolean;
|
|
18
22
|
/**
|
|
19
|
-
* The input value.
|
|
23
|
+
* The combobox input value.
|
|
20
24
|
*
|
|
21
25
|
* Live examples:
|
|
22
|
-
* - [
|
|
26
|
+
* - [Combobox with integrated
|
|
27
|
+
* filter](https://ariakit.org/examples/combobox-filtering-integrated)
|
|
23
28
|
* - [Combobox with links](https://ariakit.org/examples/combobox-links)
|
|
24
29
|
* - [Combobox filtering](https://ariakit.org/examples/combobox-filtering)
|
|
25
30
|
* - [Multi-selectable
|
|
@@ -33,45 +38,88 @@ export interface ComboboxStoreState extends CompositeStoreState<Item>, PopoverSt
|
|
|
33
38
|
*/
|
|
34
39
|
activeValue: string | undefined;
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
41
|
+
* The value(s) of the currently selected item(s). This can be a string or an
|
|
42
|
+
* array of strings. If it's an array, the combobox is considered
|
|
43
|
+
* [multi-selectable](https://ariakit.org/examples/combobox-multiple).
|
|
44
|
+
*
|
|
45
|
+
* Live examples:
|
|
46
|
+
* - [Multi-selectable
|
|
47
|
+
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
48
|
+
*/
|
|
49
|
+
selectedValue: MutableValue<T>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to reset the value when the combobox popover closes. This prop is
|
|
52
|
+
* automatically set to `true` by default if the combobox supports multiple
|
|
53
|
+
* selections. In other words, if the
|
|
54
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
55
|
+
* or
|
|
56
|
+
* [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
|
|
57
|
+
* props are arrays.
|
|
37
58
|
*
|
|
38
59
|
* Live examples:
|
|
39
60
|
* - [Multi-selectable
|
|
40
61
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
41
|
-
*
|
|
62
|
+
* - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
|
|
63
|
+
* - [Select with Combobox](https://ariakit.org/examples/select-combobox)
|
|
42
64
|
*/
|
|
43
65
|
resetValueOnHide: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface ComboboxStoreFunctions extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
46
66
|
/**
|
|
47
|
-
*
|
|
67
|
+
* Whether to reset the value when an item is selected. This prop is
|
|
68
|
+
* automatically set to `true` by default if the combobox supports multiple
|
|
69
|
+
* selections. In other words, if the
|
|
70
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
71
|
+
* or
|
|
72
|
+
* [`defaultSelectedValue`](https://ariakit.org/reference/combobox-provider#defaultselectedvalue)
|
|
73
|
+
* props are arrays.
|
|
48
74
|
*
|
|
49
75
|
* Live examples:
|
|
50
76
|
* - [Multi-selectable
|
|
51
77
|
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
78
|
+
*/
|
|
79
|
+
resetValueOnSelect: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface ComboboxStoreFunctions<T extends Value = Value> extends CompositeStoreFunctions<Item>, PopoverStoreFunctions {
|
|
82
|
+
/**
|
|
83
|
+
* Sets the [`value`](https://ariakit.org/reference/combobox-provider#value)
|
|
84
|
+
* state.
|
|
85
|
+
*
|
|
86
|
+
* Live examples:
|
|
52
87
|
* - [Textarea with inline
|
|
53
88
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
54
89
|
* @example
|
|
55
90
|
* store.setValue("Hello world");
|
|
56
91
|
* store.setValue((value) => value + "!");
|
|
57
92
|
*/
|
|
58
|
-
setValue: SetState<ComboboxStoreState["value"]>;
|
|
93
|
+
setValue: SetState<ComboboxStoreState<T>["value"]>;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the
|
|
96
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
97
|
+
* state.
|
|
98
|
+
*/
|
|
99
|
+
setSelectedValue: SetState<ComboboxStoreState<T>["selectedValue"]>;
|
|
59
100
|
}
|
|
60
|
-
export interface ComboboxStoreOptions extends StoreOptions<ComboboxStoreState
|
|
101
|
+
export interface ComboboxStoreOptions<T extends Value = Value> extends StoreOptions<ComboboxStoreState<T>, "includesBaseElement" | "value" | "selectedValue" | "resetValueOnHide" | "resetValueOnSelect">, CompositeStoreOptions<Item>, PopoverStoreOptions {
|
|
61
102
|
/**
|
|
62
103
|
* @default null
|
|
63
104
|
*/
|
|
64
105
|
defaultActiveId?: CompositeStoreOptions<Item>["activeId"];
|
|
65
106
|
/**
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
107
|
+
* The initial value of the combobox input.
|
|
108
|
+
* @default ""
|
|
109
|
+
*/
|
|
110
|
+
defaultValue?: ComboboxStoreState<T>["value"];
|
|
111
|
+
/**
|
|
112
|
+
* The initial value of the
|
|
113
|
+
* [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
|
|
114
|
+
* state. This can be a string or an array of strings. If it's an array, the
|
|
115
|
+
* combobox is considered
|
|
116
|
+
* [multi-selectable](https://ariakit.org/examples/combobox-multiple).
|
|
71
117
|
* @default ""
|
|
72
118
|
*/
|
|
73
|
-
|
|
119
|
+
defaultSelectedValue?: ComboboxStoreState<T>["selectedValue"];
|
|
120
|
+
}
|
|
121
|
+
export interface ComboboxStoreProps<T extends Value = Value> extends ComboboxStoreOptions<T>, StoreProps<ComboboxStoreState<T>> {
|
|
122
|
+
}
|
|
123
|
+
export interface ComboboxStore<T extends Value = Value> extends ComboboxStoreFunctions<T>, Store<ComboboxStoreState<T>> {
|
|
74
124
|
}
|
|
75
|
-
export type ComboboxStoreProps = ComboboxStoreOptions & StoreProps<ComboboxStoreState>;
|
|
76
|
-
export type ComboboxStore = ComboboxStoreFunctions & Store<ComboboxStoreState>;
|
|
77
125
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _7ZUFMSXJcjs = require('../__chunks/7ZUFMSXJ.cjs');
|
|
5
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
6
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
8
|
require('../__chunks/3UT5FE6K.cjs');
|
|
9
9
|
require('../__chunks/AV6KTKLE.cjs');
|
|
10
10
|
|
|
11
11
|
// src/composite/composite-overflow-store.ts
|
|
12
12
|
function createCompositeOverflowStore(props = {}) {
|
|
13
|
-
return
|
|
13
|
+
return _7ZUFMSXJcjs.createPopoverStore.call(void 0, props);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _6WBY3ZZMcjs = require('../__chunks/6WBY3ZZM.cjs');
|
|
5
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
6
|
+
require('../__chunks/46BH65MC.cjs');
|
|
7
7
|
require('../__chunks/3UT5FE6K.cjs');
|
|
8
|
-
require('../__chunks/
|
|
8
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
9
9
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createCompositeStore =
|
|
13
|
+
exports.createCompositeStore = _6WBY3ZZMcjs.createCompositeStore;
|
|
@@ -2,11 +2,11 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
|
|
|
2
2
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
3
3
|
import type { SetState } from "../utils/types.js";
|
|
4
4
|
type Orientation = "horizontal" | "vertical" | "both";
|
|
5
|
-
|
|
5
|
+
interface Item extends CollectionStoreItem {
|
|
6
6
|
rowId?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
children?: string;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
/**
|
|
11
11
|
* Creates a composite store.
|
|
12
12
|
*/
|
|
@@ -25,10 +25,6 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
25
25
|
* tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).
|
|
26
26
|
* DOM focus will remain on the composite element while its items receive
|
|
27
27
|
* virtual focus.
|
|
28
|
-
*
|
|
29
|
-
* Live examples:
|
|
30
|
-
* - [Multi-selectable
|
|
31
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
32
28
|
* @default false
|
|
33
29
|
*/
|
|
34
30
|
virtualFocus: boolean;
|
|
@@ -201,6 +197,8 @@ export interface CompositeStoreOptions<T extends Item = Item> extends StoreOptio
|
|
|
201
197
|
*/
|
|
202
198
|
defaultActiveId?: CompositeStoreState<T>["activeId"];
|
|
203
199
|
}
|
|
204
|
-
export
|
|
205
|
-
|
|
200
|
+
export interface CompositeStoreProps<T extends Item = Item> extends CompositeStoreOptions<T>, StoreProps<CompositeStoreState<T>> {
|
|
201
|
+
}
|
|
202
|
+
export interface CompositeStore<T extends Item = Item> extends CompositeStoreFunctions<T>, Store<CompositeStoreState<T>> {
|
|
203
|
+
}
|
|
206
204
|
export {};
|
|
@@ -2,11 +2,11 @@ import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOpti
|
|
|
2
2
|
import type { Store, StoreOptions, StoreProps } from "../utils/store.js";
|
|
3
3
|
import type { SetState } from "../utils/types.js";
|
|
4
4
|
type Orientation = "horizontal" | "vertical" | "both";
|
|
5
|
-
|
|
5
|
+
interface Item extends CollectionStoreItem {
|
|
6
6
|
rowId?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
children?: string;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
/**
|
|
11
11
|
* Creates a composite store.
|
|
12
12
|
*/
|
|
@@ -25,10 +25,6 @@ export interface CompositeStoreState<T extends Item = Item> extends CollectionSt
|
|
|
25
25
|
* tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex).
|
|
26
26
|
* DOM focus will remain on the composite element while its items receive
|
|
27
27
|
* virtual focus.
|
|
28
|
-
*
|
|
29
|
-
* Live examples:
|
|
30
|
-
* - [Multi-selectable
|
|
31
|
-
* Combobox](https://ariakit.org/examples/combobox-multiple)
|
|
32
28
|
* @default false
|
|
33
29
|
*/
|
|
34
30
|
virtualFocus: boolean;
|
|
@@ -201,6 +197,8 @@ export interface CompositeStoreOptions<T extends Item = Item> extends StoreOptio
|
|
|
201
197
|
*/
|
|
202
198
|
defaultActiveId?: CompositeStoreState<T>["activeId"];
|
|
203
199
|
}
|
|
204
|
-
export
|
|
205
|
-
|
|
200
|
+
export interface CompositeStoreProps<T extends Item = Item> extends CompositeStoreOptions<T>, StoreProps<CompositeStoreState<T>> {
|
|
201
|
+
}
|
|
202
|
+
export interface CompositeStore<T extends Item = Item> extends CompositeStoreFunctions<T>, Store<CompositeStoreState<T>> {
|
|
203
|
+
}
|
|
206
204
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
4
|
+
var _GZDVJEIDcjs = require('../__chunks/GZDVJEID.cjs');
|
|
5
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
6
|
+
require('../__chunks/46BH65MC.cjs');
|
|
7
7
|
require('../__chunks/3UT5FE6K.cjs');
|
|
8
8
|
require('../__chunks/AV6KTKLE.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.createDialogStore =
|
|
11
|
+
exports.createDialogStore = _GZDVJEIDcjs.createDialogStore;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _MEHGRTJ3cjs = require('../__chunks/MEHGRTJ3.cjs');
|
|
5
|
+
require('../__chunks/46BH65MC.cjs');
|
|
6
6
|
require('../__chunks/3UT5FE6K.cjs');
|
|
7
7
|
require('../__chunks/AV6KTKLE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.createDisclosureStore =
|
|
10
|
+
exports.createDisclosureStore = _MEHGRTJ3cjs.createDisclosureStore;
|
|
@@ -36,6 +36,7 @@ export interface DisclosureStoreState {
|
|
|
36
36
|
* milliseconds to pass before becoming `false`.
|
|
37
37
|
*
|
|
38
38
|
* Live examples:
|
|
39
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
39
40
|
* - [Animated Combobox](https://ariakit.org/examples/combobox-animated)
|
|
40
41
|
* - [Animated Dialog](https://ariakit.org/examples/dialog-animated)
|
|
41
42
|
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
|
@@ -73,6 +74,7 @@ export interface DisclosureStoreFunctions {
|
|
|
73
74
|
* Sets the `open` state to `true`.
|
|
74
75
|
*
|
|
75
76
|
* Live examples:
|
|
77
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
76
78
|
* - [Textarea with inline
|
|
77
79
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
78
80
|
*/
|
|
@@ -36,6 +36,7 @@ export interface DisclosureStoreState {
|
|
|
36
36
|
* milliseconds to pass before becoming `false`.
|
|
37
37
|
*
|
|
38
38
|
* Live examples:
|
|
39
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
39
40
|
* - [Animated Combobox](https://ariakit.org/examples/combobox-animated)
|
|
40
41
|
* - [Animated Dialog](https://ariakit.org/examples/dialog-animated)
|
|
41
42
|
* - [Animated Select](https://ariakit.org/examples/select-animated)
|
|
@@ -73,6 +74,7 @@ export interface DisclosureStoreFunctions {
|
|
|
73
74
|
* Sets the `open` state to `true`.
|
|
74
75
|
*
|
|
75
76
|
* Live examples:
|
|
77
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
76
78
|
* - [Textarea with inline
|
|
77
79
|
* Combobox](https://ariakit.org/examples/combobox-textarea)
|
|
78
80
|
*/
|
package/cjs/form/form-store.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _JLC5A6WFcjs = require('../__chunks/JLC5A6WF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _46BH65MCcjs = require('../__chunks/46BH65MC.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _3UT5FE6Kcjs = require('../__chunks/3UT5FE6K.cjs');
|
|
17
|
-
require('../__chunks/
|
|
17
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
@@ -114,9 +114,9 @@ function createNames() {
|
|
|
114
114
|
}
|
|
115
115
|
function createFormStore(props = {}) {
|
|
116
116
|
var _a;
|
|
117
|
-
|
|
117
|
+
_46BH65MCcjs.throwOnConflictingProps.call(void 0, props, props.store);
|
|
118
118
|
const syncState = (_a = props.store) == null ? void 0 : _a.getState();
|
|
119
|
-
const collection =
|
|
119
|
+
const collection = _JLC5A6WFcjs.createCollectionStore.call(void 0, props);
|
|
120
120
|
const values = _3UT5FE6Kcjs.defaultValue.call(void 0,
|
|
121
121
|
props.values,
|
|
122
122
|
syncState == null ? void 0 : syncState.values,
|
|
@@ -145,15 +145,15 @@ function createFormStore(props = {}) {
|
|
|
145
145
|
submitFailed: _3UT5FE6Kcjs.defaultValue.call(void 0, syncState == null ? void 0 : syncState.submitFailed, 0),
|
|
146
146
|
valid: !hasMessages(errors)
|
|
147
147
|
});
|
|
148
|
-
const form =
|
|
148
|
+
const form = _46BH65MCcjs.createStore.call(void 0, initialState, collection, props.store);
|
|
149
149
|
const syncCallbacks = getStoreCallbacks(props.store);
|
|
150
150
|
const syncCallbacksState = syncCallbacks == null ? void 0 : syncCallbacks.getState();
|
|
151
151
|
const callbacksInitialState = {
|
|
152
152
|
validate: (syncCallbacksState == null ? void 0 : syncCallbacksState.validate) || [],
|
|
153
153
|
submit: (syncCallbacksState == null ? void 0 : syncCallbacksState.submit) || []
|
|
154
154
|
};
|
|
155
|
-
const callbacks =
|
|
156
|
-
|
|
155
|
+
const callbacks = _46BH65MCcjs.createStore.call(void 0, callbacksInitialState, syncCallbacks);
|
|
156
|
+
_46BH65MCcjs.setup.call(void 0, form, () => _46BH65MCcjs.init.call(void 0, callbacks));
|
|
157
157
|
const validate = async () => {
|
|
158
158
|
form.setState("validating", true);
|
|
159
159
|
form.setState("errors", {});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
8
|
-
require('../__chunks/
|
|
4
|
+
var _PD7XZBXCcjs = require('../__chunks/PD7XZBXC.cjs');
|
|
5
|
+
require('../__chunks/7ZUFMSXJ.cjs');
|
|
6
|
+
require('../__chunks/GZDVJEID.cjs');
|
|
7
|
+
require('../__chunks/MEHGRTJ3.cjs');
|
|
8
|
+
require('../__chunks/46BH65MC.cjs');
|
|
9
9
|
require('../__chunks/3UT5FE6K.cjs');
|
|
10
10
|
require('../__chunks/AV6KTKLE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.createHovercardStore =
|
|
13
|
+
exports.createHovercardStore = _PD7XZBXCcjs.createHovercardStore;
|
|
@@ -20,11 +20,17 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
20
20
|
/**
|
|
21
21
|
* The amount of time in milliseconds to wait before **showing** the popover.
|
|
22
22
|
* It defaults to the value passed to `timeout`.
|
|
23
|
+
*
|
|
24
|
+
* Live examples:
|
|
25
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
23
26
|
*/
|
|
24
27
|
showTimeout?: number;
|
|
25
28
|
/**
|
|
26
29
|
* The amount of time in milliseconds to wait before **hiding** the popover.
|
|
27
30
|
* It defaults to the value passed to `timeout`.
|
|
31
|
+
*
|
|
32
|
+
* Live examples:
|
|
33
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
28
34
|
*/
|
|
29
35
|
hideTimeout?: number;
|
|
30
36
|
/**
|
|
@@ -20,11 +20,17 @@ export interface HovercardStoreState extends PopoverStoreState {
|
|
|
20
20
|
/**
|
|
21
21
|
* The amount of time in milliseconds to wait before **showing** the popover.
|
|
22
22
|
* It defaults to the value passed to `timeout`.
|
|
23
|
+
*
|
|
24
|
+
* Live examples:
|
|
25
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
23
26
|
*/
|
|
24
27
|
showTimeout?: number;
|
|
25
28
|
/**
|
|
26
29
|
* The amount of time in milliseconds to wait before **hiding** the popover.
|
|
27
30
|
* It defaults to the value passed to `timeout`.
|
|
31
|
+
*
|
|
32
|
+
* Live examples:
|
|
33
|
+
* - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
|
|
28
34
|
*/
|
|
29
35
|
hideTimeout?: number;
|
|
30
36
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
6
|
-
require('../__chunks/
|
|
7
|
-
require('../__chunks/
|
|
4
|
+
var _GXIZMD53cjs = require('../__chunks/GXIZMD53.cjs');
|
|
5
|
+
require('../__chunks/6WBY3ZZM.cjs');
|
|
6
|
+
require('../__chunks/JLC5A6WF.cjs');
|
|
7
|
+
require('../__chunks/46BH65MC.cjs');
|
|
8
8
|
require('../__chunks/3UT5FE6K.cjs');
|
|
9
|
-
require('../__chunks/
|
|
9
|
+
require('../__chunks/5F4DVUNS.cjs');
|
|
10
10
|
require('../__chunks/ULSPM3Y3.cjs');
|
|
11
11
|
require('../__chunks/AV6KTKLE.cjs');
|
|
12
12
|
|
|
13
13
|
// src/menu/menu-bar-store.ts
|
|
14
14
|
function createMenuBarStore(props = {}) {
|
|
15
|
-
return
|
|
15
|
+
return _GXIZMD53cjs.createMenubarStore.call(void 0, props);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|