@ariakit/core 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/cjs/__chunks/{QD2A4YF6.cjs → 3COGJMN3.cjs} +11 -11
- package/cjs/__chunks/{MHZQJPY3.cjs → 5BQ2XS3R.cjs} +4 -4
- package/cjs/__chunks/{2D5LEVE7.cjs → D7M2PCAQ.cjs} +6 -6
- package/cjs/__chunks/{LTLFSC4X.cjs → DIYYVJDK.cjs} +2 -2
- package/cjs/__chunks/{AETQC2AR.cjs → LAYUSNGM.cjs} +11 -11
- package/cjs/__chunks/{KL74MAHB.cjs → LBFF2BBK.cjs} +6 -6
- package/cjs/__chunks/{B4LYZ4EM.cjs → M2NNCFIJ.cjs} +13 -11
- package/cjs/__chunks/{5JEQEZFR.cjs → MB5TLEVH.cjs} +7 -7
- package/cjs/__chunks/{IMYW2UAC.cjs → Q2WCPTYS.cjs} +4 -22
- package/cjs/__chunks/{UEZLSKZ4.cjs → XVL5HZ27.cjs} +4 -4
- package/cjs/checkbox/checkbox-store.cjs +3 -3
- package/cjs/checkbox/checkbox-store.d.cts +2 -2
- package/cjs/checkbox/checkbox-store.d.ts +2 -2
- package/cjs/collection/collection-store.cjs +4 -4
- package/cjs/collection/collection-store.d.cts +2 -2
- package/cjs/collection/collection-store.d.ts +2 -2
- package/cjs/combobox/combobox-store.cjs +35 -26
- package/cjs/combobox/combobox-store.d.cts +7 -5
- package/cjs/combobox/combobox-store.d.ts +7 -5
- package/cjs/composite/composite-overflow-store.cjs +5 -5
- package/cjs/composite/composite-overflow-store.d.cts +2 -2
- package/cjs/composite/composite-overflow-store.d.ts +2 -2
- package/cjs/composite/composite-store.cjs +5 -5
- package/cjs/composite/composite-store.d.cts +8 -4
- package/cjs/composite/composite-store.d.ts +8 -4
- package/cjs/dialog/dialog-store.cjs +4 -4
- package/cjs/dialog/dialog-store.d.cts +2 -2
- package/cjs/dialog/dialog-store.d.ts +2 -2
- package/cjs/disclosure/disclosure-store.cjs +3 -3
- package/cjs/disclosure/disclosure-store.d.cts +2 -2
- package/cjs/disclosure/disclosure-store.d.ts +2 -2
- package/cjs/form/form-store.cjs +8 -8
- package/cjs/form/form-store.d.cts +4 -4
- package/cjs/form/form-store.d.ts +4 -4
- package/cjs/form/types.d.cts +3 -3
- package/cjs/form/types.d.ts +3 -3
- package/cjs/hovercard/hovercard-store.cjs +6 -6
- package/cjs/hovercard/hovercard-store.d.cts +3 -3
- package/cjs/hovercard/hovercard-store.d.ts +3 -3
- package/cjs/menu/menu-bar-store.cjs +6 -6
- package/cjs/menu/menu-bar-store.d.cts +2 -2
- package/cjs/menu/menu-bar-store.d.ts +2 -2
- package/cjs/menu/menu-store.cjs +19 -19
- package/cjs/menu/menu-store.d.cts +6 -6
- package/cjs/menu/menu-store.d.ts +6 -6
- package/cjs/menubar/menubar-store.cjs +6 -6
- package/cjs/menubar/menubar-store.d.cts +2 -2
- package/cjs/menubar/menubar-store.d.ts +2 -2
- package/cjs/popover/popover-store.cjs +5 -5
- package/cjs/popover/popover-store.d.cts +3 -3
- package/cjs/popover/popover-store.d.ts +3 -3
- package/cjs/radio/radio-store.cjs +6 -6
- package/cjs/radio/radio-store.d.cts +3 -3
- package/cjs/radio/radio-store.d.ts +3 -3
- package/cjs/select/select-store.cjs +31 -21
- package/cjs/select/select-store.d.cts +19 -9
- package/cjs/select/select-store.d.ts +19 -9
- package/cjs/tab/tab-store.cjs +58 -25
- package/cjs/tab/tab-store.d.cts +17 -10
- package/cjs/tab/tab-store.d.ts +17 -10
- package/cjs/tag/tag-store.cjs +8 -8
- package/cjs/tag/tag-store.d.cts +3 -3
- package/cjs/tag/tag-store.d.ts +3 -3
- package/cjs/toolbar/toolbar-store.cjs +5 -5
- package/cjs/toolbar/toolbar-store.d.cts +2 -2
- package/cjs/toolbar/toolbar-store.d.ts +2 -2
- package/cjs/tooltip/tooltip-store.cjs +7 -7
- package/cjs/tooltip/tooltip-store.d.cts +2 -2
- package/cjs/tooltip/tooltip-store.d.ts +2 -2
- package/cjs/utils/dom.cjs +2 -6
- package/cjs/utils/dom.d.cts +1 -17
- package/cjs/utils/dom.d.ts +1 -17
- package/cjs/utils/events.cjs +23 -16
- package/cjs/utils/events.d.cts +1 -1
- package/cjs/utils/events.d.ts +1 -1
- package/cjs/utils/focus.cjs +20 -18
- package/cjs/utils/focus.d.cts +1 -1
- package/cjs/utils/focus.d.ts +1 -1
- package/cjs/utils/misc.d.cts +1 -1
- package/cjs/utils/misc.d.ts +1 -1
- package/cjs/utils/platform.cjs +3 -3
- package/cjs/utils/store.cjs +2 -2
- package/cjs/utils/store.d.cts +3 -3
- package/cjs/utils/store.d.ts +3 -3
- package/esm/__chunks/{QAI5BPCY.js → CLSHHUGK.js} +1 -1
- package/esm/__chunks/{BRS7GKWU.js → E4HA32QI.js} +2 -2
- package/esm/__chunks/{IUORCTET.js → I2NJJ3XW.js} +3 -21
- package/esm/__chunks/{ABMC67JW.js → I2WJ7JBQ.js} +2 -2
- package/esm/__chunks/{WCKXDMU7.js → KDSZSVV5.js} +1 -1
- package/esm/__chunks/{R676XYVY.js → KLPDXTDE.js} +13 -11
- package/esm/__chunks/{5RJNXXU2.js → NWACXGIN.js} +1 -1
- package/esm/__chunks/{K7A7LTR3.js → RCLYDUHE.js} +2 -2
- package/esm/__chunks/{MFZZDIHG.js → SAZZJI72.js} +2 -2
- package/esm/__chunks/{YVUNPQHS.js → VH2P7HEP.js} +2 -2
- package/esm/checkbox/checkbox-store.d.ts +2 -2
- package/esm/checkbox/checkbox-store.js +1 -1
- package/esm/collection/collection-store.d.ts +2 -2
- package/esm/collection/collection-store.js +3 -3
- package/esm/combobox/combobox-store.d.ts +7 -5
- package/esm/combobox/combobox-store.js +20 -11
- package/esm/composite/composite-overflow-store.d.ts +2 -2
- package/esm/composite/composite-overflow-store.js +4 -4
- package/esm/composite/composite-store.d.ts +8 -4
- package/esm/composite/composite-store.js +4 -4
- package/esm/dialog/dialog-store.d.ts +2 -2
- package/esm/dialog/dialog-store.js +3 -3
- package/esm/disclosure/disclosure-store.d.ts +2 -2
- package/esm/disclosure/disclosure-store.js +2 -2
- package/esm/form/form-store.d.ts +4 -4
- package/esm/form/form-store.js +3 -3
- package/esm/form/types.d.ts +3 -3
- package/esm/hovercard/hovercard-store.d.ts +3 -3
- package/esm/hovercard/hovercard-store.js +5 -5
- package/esm/menu/menu-bar-store.d.ts +2 -2
- package/esm/menu/menu-bar-store.js +5 -5
- package/esm/menu/menu-store.d.ts +6 -6
- package/esm/menu/menu-store.js +8 -8
- package/esm/menubar/menubar-store.d.ts +2 -2
- package/esm/menubar/menubar-store.js +5 -5
- package/esm/popover/popover-store.d.ts +3 -3
- package/esm/popover/popover-store.js +4 -4
- package/esm/radio/radio-store.d.ts +3 -3
- package/esm/radio/radio-store.js +4 -4
- package/esm/select/select-store.d.ts +19 -9
- package/esm/select/select-store.js +19 -9
- package/esm/tab/tab-store.d.ts +17 -10
- package/esm/tab/tab-store.js +44 -11
- package/esm/tag/tag-store.d.ts +3 -3
- package/esm/tag/tag-store.js +4 -4
- package/esm/toolbar/toolbar-store.d.ts +2 -2
- package/esm/toolbar/toolbar-store.js +4 -4
- package/esm/tooltip/tooltip-store.d.ts +2 -2
- package/esm/tooltip/tooltip-store.js +5 -5
- package/esm/utils/dom.d.ts +1 -17
- package/esm/utils/dom.js +1 -5
- package/esm/utils/events.d.ts +1 -1
- package/esm/utils/events.js +20 -13
- package/esm/utils/focus.d.ts +1 -1
- package/esm/utils/focus.js +12 -10
- package/esm/utils/misc.d.ts +1 -1
- package/esm/utils/platform.js +2 -2
- package/esm/utils/store.d.ts +3 -3
- package/esm/utils/store.js +1 -1
- package/package.json +2 -2
- package/.eslintignore +0 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
type Orientation = "horizontal" | "vertical" | "both";
|
|
5
5
|
/**
|
|
6
6
|
* Creates a composite store.
|
|
@@ -44,6 +44,10 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
44
44
|
* In both scenarios, the item in focus will carry the
|
|
45
45
|
* [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
|
|
46
46
|
* attribute.
|
|
47
|
+
*
|
|
48
|
+
* Live examples:
|
|
49
|
+
* - [Select with Combobox and
|
|
50
|
+
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
47
51
|
* @default false
|
|
48
52
|
*/
|
|
49
53
|
virtualFocus: boolean;
|
|
@@ -178,7 +182,7 @@ export interface CompositeStoreState<T extends CompositeStoreItem = CompositeSto
|
|
|
178
182
|
* arrow keys.
|
|
179
183
|
*
|
|
180
184
|
* Live examples:
|
|
181
|
-
* - [Combobox with
|
|
185
|
+
* - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
|
|
182
186
|
*/
|
|
183
187
|
activeId: string | null | undefined;
|
|
184
188
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/VH2P7HEP.js";
|
|
5
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
|
-
import "../__chunks/
|
|
7
|
+
import "../__chunks/KLPDXTDE.js";
|
|
8
8
|
import "../__chunks/22HHDS5F.js";
|
|
9
|
-
import "../__chunks/
|
|
9
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
10
10
|
import "../__chunks/4R3V3JGP.js";
|
|
11
11
|
export {
|
|
12
12
|
createCompositeStore
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.
|
|
2
|
-
import type { Store, StoreProps } from "../utils/store.
|
|
1
|
+
import type { DisclosureStoreFunctions, DisclosureStoreOptions, DisclosureStoreState } from "../disclosure/disclosure-store.ts";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a dialog store.
|
|
5
5
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDialogStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/NWACXGIN.js";
|
|
5
|
+
import "../__chunks/KDSZSVV5.js";
|
|
6
|
+
import "../__chunks/KLPDXTDE.js";
|
|
7
7
|
import "../__chunks/22HHDS5F.js";
|
|
8
8
|
import "../__chunks/4R3V3JGP.js";
|
|
9
9
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
2
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
2
|
+
import type { SetState } from "../utils/types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a disclosure store.
|
|
5
5
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createDisclosureStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/KDSZSVV5.js";
|
|
5
|
+
import "../__chunks/KLPDXTDE.js";
|
|
6
6
|
import "../__chunks/22HHDS5F.js";
|
|
7
7
|
import "../__chunks/4R3V3JGP.js";
|
|
8
8
|
export {
|
package/esm/form/form-store.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.
|
|
4
|
-
import type { DeepMap, DeepPartial, Names, StringLike } from "./types.
|
|
1
|
+
import type { CollectionStoreFunctions, CollectionStoreItem, CollectionStoreOptions, CollectionStoreState } from "../collection/collection-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { AnyObject, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
|
|
4
|
+
import type { DeepMap, DeepPartial, Names, StringLike } from "./types.ts";
|
|
5
5
|
type ErrorMessage = string | undefined | null;
|
|
6
6
|
export declare function hasMessages(object: FormStoreValues): boolean;
|
|
7
7
|
export declare function get<T>(values: FormStoreValues, path: StringLike | string[], defaultValue?: T): T;
|
package/esm/form/form-store.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCollectionStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/I2WJ7JBQ.js";
|
|
5
5
|
import {
|
|
6
6
|
createStore,
|
|
7
7
|
init,
|
|
8
8
|
setup,
|
|
9
9
|
throwOnConflictingProps
|
|
10
|
-
} from "../__chunks/
|
|
10
|
+
} from "../__chunks/KLPDXTDE.js";
|
|
11
11
|
import {
|
|
12
12
|
applyState,
|
|
13
13
|
defaultValue,
|
|
14
14
|
isInteger,
|
|
15
15
|
isObject
|
|
16
16
|
} from "../__chunks/22HHDS5F.js";
|
|
17
|
-
import "../__chunks/
|
|
17
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
18
18
|
import {
|
|
19
19
|
__spreadProps,
|
|
20
20
|
__spreadValues
|
package/esm/form/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { AnyObject } from "../utils/types.
|
|
1
|
+
import type { AnyObject } from "../utils/types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* An object or primitive value that can be converted to a string.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export interface StringLike {
|
|
6
6
|
toString: () => string;
|
|
7
7
|
valueOf: () => string;
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
/**
|
|
10
10
|
* Maps through an object `T` or array and defines the leaf values to the given
|
|
11
11
|
* type `V`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a hovercard store.
|
|
6
6
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/E4HA32QI.js";
|
|
5
|
+
import "../__chunks/SAZZJI72.js";
|
|
6
|
+
import "../__chunks/NWACXGIN.js";
|
|
7
|
+
import "../__chunks/KDSZSVV5.js";
|
|
8
|
+
import "../__chunks/KLPDXTDE.js";
|
|
9
9
|
import "../__chunks/22HHDS5F.js";
|
|
10
10
|
import "../__chunks/4R3V3JGP.js";
|
|
11
11
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.
|
|
2
|
-
import type { Store, StoreProps } from "../utils/store.
|
|
1
|
+
import type { MenubarStoreFunctions, MenubarStoreOptions, MenubarStoreState } from "../menubar/menubar-store.ts";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a menu bar store.
|
|
5
5
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/RCLYDUHE.js";
|
|
5
|
+
import "../__chunks/VH2P7HEP.js";
|
|
6
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
|
-
import "../__chunks/
|
|
8
|
+
import "../__chunks/KLPDXTDE.js";
|
|
9
9
|
import "../__chunks/22HHDS5F.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
11
11
|
import "../__chunks/4R3V3JGP.js";
|
|
12
12
|
|
|
13
13
|
// src/menu/menu-bar-store.ts
|
package/esm/menu/menu-store.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
3
|
-
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.
|
|
4
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
5
|
-
import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.
|
|
6
|
-
import type { MenuBarStore } from "./menu-bar-store.
|
|
1
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
2
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
3
|
+
import type { HovercardStoreFunctions, HovercardStoreOptions, HovercardStoreState } from "../hovercard/hovercard-store.ts";
|
|
4
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
5
|
+
import type { BivariantCallback, PickRequired, SetState, SetStateAction } from "../utils/types.ts";
|
|
6
|
+
import type { MenuBarStore } from "./menu-bar-store.ts";
|
|
7
7
|
export declare function createMenuStore<T extends MenuStoreValues = MenuStoreValues>(props: PickRequired<MenuStoreProps<T>, "values" | "defaultValues">): MenuStore<T>;
|
|
8
8
|
export declare function createMenuStore(props?: MenuStoreProps): MenuStore;
|
|
9
9
|
export type MenuStoreValues = Record<string, string | boolean | number | Array<string | number>>;
|
package/esm/menu/menu-store.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createHovercardStore
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/E4HA32QI.js";
|
|
5
5
|
import {
|
|
6
6
|
createCompositeStore
|
|
7
|
-
} from "../__chunks/
|
|
8
|
-
import "../__chunks/
|
|
7
|
+
} from "../__chunks/VH2P7HEP.js";
|
|
8
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
9
9
|
import "../__chunks/7PRQYBBV.js";
|
|
10
|
-
import "../__chunks/
|
|
11
|
-
import "../__chunks/
|
|
12
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/SAZZJI72.js";
|
|
11
|
+
import "../__chunks/NWACXGIN.js";
|
|
12
|
+
import "../__chunks/KDSZSVV5.js";
|
|
13
13
|
import {
|
|
14
14
|
createStore,
|
|
15
15
|
mergeStore,
|
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
setup,
|
|
19
19
|
sync,
|
|
20
20
|
throwOnConflictingProps
|
|
21
|
-
} from "../__chunks/
|
|
21
|
+
} from "../__chunks/KLPDXTDE.js";
|
|
22
22
|
import {
|
|
23
23
|
applyState,
|
|
24
24
|
defaultValue
|
|
25
25
|
} from "../__chunks/22HHDS5F.js";
|
|
26
|
-
import "../__chunks/
|
|
26
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
27
27
|
import {
|
|
28
28
|
__objRest,
|
|
29
29
|
__spreadProps,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreProps } from "../utils/store.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreProps } from "../utils/store.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a menubar store.
|
|
5
5
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createMenubarStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/RCLYDUHE.js";
|
|
5
|
+
import "../__chunks/VH2P7HEP.js";
|
|
6
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
7
7
|
import "../__chunks/7PRQYBBV.js";
|
|
8
|
-
import "../__chunks/
|
|
8
|
+
import "../__chunks/KLPDXTDE.js";
|
|
9
9
|
import "../__chunks/22HHDS5F.js";
|
|
10
|
-
import "../__chunks/
|
|
10
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
11
11
|
import "../__chunks/4R3V3JGP.js";
|
|
12
12
|
export {
|
|
13
13
|
createMenubarStore
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { DialogStoreFunctions, DialogStoreOptions, DialogStoreState } from "../dialog/dialog-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
type BasePlacement = "top" | "bottom" | "left" | "right";
|
|
5
5
|
type Placement = BasePlacement | `${BasePlacement}-start` | `${BasePlacement}-end`;
|
|
6
6
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createPopoverStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
6
|
-
import "../__chunks/
|
|
7
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/SAZZJI72.js";
|
|
5
|
+
import "../__chunks/NWACXGIN.js";
|
|
6
|
+
import "../__chunks/KDSZSVV5.js";
|
|
7
|
+
import "../__chunks/KLPDXTDE.js";
|
|
8
8
|
import "../__chunks/22HHDS5F.js";
|
|
9
9
|
import "../__chunks/4R3V3JGP.js";
|
|
10
10
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
2
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
3
|
-
import type { SetState } from "../utils/types.
|
|
1
|
+
import type { CompositeStoreFunctions, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
2
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
3
|
+
import type { SetState } from "../utils/types.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a radio store.
|
|
6
6
|
*/
|
package/esm/radio/radio-store.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/VH2P7HEP.js";
|
|
5
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
6
6
|
import "../__chunks/7PRQYBBV.js";
|
|
7
7
|
import {
|
|
8
8
|
createStore
|
|
9
|
-
} from "../__chunks/
|
|
9
|
+
} from "../__chunks/KLPDXTDE.js";
|
|
10
10
|
import {
|
|
11
11
|
defaultValue
|
|
12
12
|
} from "../__chunks/22HHDS5F.js";
|
|
13
|
-
import "../__chunks/
|
|
13
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
14
14
|
import {
|
|
15
15
|
__objRest,
|
|
16
16
|
__spreadProps,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
2
|
-
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
3
|
-
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.
|
|
4
|
-
import type { Store, StoreOptions, StoreProps } from "../utils/store.
|
|
5
|
-
import type { PickRequired, SetState } from "../utils/types.
|
|
1
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
2
|
+
import type { CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
3
|
+
import type { PopoverStoreFunctions, PopoverStoreOptions, PopoverStoreState } from "../popover/popover-store.ts";
|
|
4
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
5
|
+
import type { PickRequired, SetState } from "../utils/types.ts";
|
|
6
6
|
type MutableValue<T extends SelectStoreValue = SelectStoreValue> = T extends string ? string : T;
|
|
7
7
|
export declare function createSelectStore<T extends SelectStoreValue = SelectStoreValue>(props: PickRequired<SelectStoreProps<T>, "value" | "defaultValue">): SelectStore<T>;
|
|
8
8
|
export declare function createSelectStore(props?: SelectStoreProps): SelectStore;
|
|
@@ -46,6 +46,10 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
46
46
|
* @default false
|
|
47
47
|
*/
|
|
48
48
|
setValueOnMove: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The select label element.
|
|
51
|
+
*/
|
|
52
|
+
labelElement: HTMLElement | null;
|
|
49
53
|
/**
|
|
50
54
|
* The select button element.
|
|
51
55
|
*
|
|
@@ -54,9 +58,9 @@ export interface SelectStoreState<T extends SelectStoreValue = SelectStoreValue>
|
|
|
54
58
|
*/
|
|
55
59
|
selectElement: HTMLElement | null;
|
|
56
60
|
/**
|
|
57
|
-
* The select
|
|
61
|
+
* The select list element.
|
|
58
62
|
*/
|
|
59
|
-
|
|
63
|
+
listElement: HTMLElement | null;
|
|
60
64
|
}
|
|
61
65
|
export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreValue> extends Pick<SelectStoreOptions<T>, "combobox">, CompositeStoreFunctions<SelectStoreItem>, PopoverStoreFunctions {
|
|
62
66
|
/**
|
|
@@ -68,14 +72,18 @@ export interface SelectStoreFunctions<T extends SelectStoreValue = SelectStoreVa
|
|
|
68
72
|
* store.setValue((value) => value === "Apple" ? "Banana" : "Apple"));
|
|
69
73
|
*/
|
|
70
74
|
setValue: SetState<SelectStoreState<T>["value"]>;
|
|
75
|
+
/**
|
|
76
|
+
* Sets the `labelElement` state.
|
|
77
|
+
*/
|
|
78
|
+
setLabelElement: SetState<SelectStoreState<T>["labelElement"]>;
|
|
71
79
|
/**
|
|
72
80
|
* Sets the `selectElement` state.
|
|
73
81
|
*/
|
|
74
82
|
setSelectElement: SetState<SelectStoreState<T>["selectElement"]>;
|
|
75
83
|
/**
|
|
76
|
-
* Sets the `
|
|
84
|
+
* Sets the `listElement` state.
|
|
77
85
|
*/
|
|
78
|
-
|
|
86
|
+
setListElement: SetState<SelectStoreState<T>["listElement"]>;
|
|
79
87
|
}
|
|
80
88
|
export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValue> extends StoreOptions<SelectStoreState<T>, "virtualFocus" | "activeId" | "orientation" | "placement" | "value" | "setValueOnMove">, CompositeStoreOptions<SelectStoreItem>, PopoverStoreOptions {
|
|
81
89
|
/**
|
|
@@ -94,6 +102,8 @@ export interface SelectStoreOptions<T extends SelectStoreValue = SelectStoreValu
|
|
|
94
102
|
* - [SelectGroup](https://ariakit.org/examples/select-group)
|
|
95
103
|
* - [Select with Next.js App
|
|
96
104
|
* Router](https://ariakit.org/examples/select-next-router)
|
|
105
|
+
* - [Select with Combobox and
|
|
106
|
+
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
97
107
|
*/
|
|
98
108
|
defaultValue?: SelectStoreState<T>["value"];
|
|
99
109
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createCompositeStore
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/VH2P7HEP.js";
|
|
5
|
+
import "../__chunks/I2WJ7JBQ.js";
|
|
6
6
|
import {
|
|
7
7
|
toArray
|
|
8
8
|
} from "../__chunks/7PRQYBBV.js";
|
|
9
9
|
import {
|
|
10
10
|
createPopoverStore
|
|
11
|
-
} from "../__chunks/
|
|
12
|
-
import "../__chunks/
|
|
13
|
-
import "../__chunks/
|
|
11
|
+
} from "../__chunks/SAZZJI72.js";
|
|
12
|
+
import "../__chunks/NWACXGIN.js";
|
|
13
|
+
import "../__chunks/KDSZSVV5.js";
|
|
14
14
|
import {
|
|
15
15
|
batch,
|
|
16
16
|
createStore,
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
setup,
|
|
20
20
|
sync,
|
|
21
21
|
throwOnConflictingProps
|
|
22
|
-
} from "../__chunks/
|
|
22
|
+
} from "../__chunks/KLPDXTDE.js";
|
|
23
23
|
import {
|
|
24
24
|
defaultValue
|
|
25
25
|
} from "../__chunks/22HHDS5F.js";
|
|
26
|
-
import "../__chunks/
|
|
26
|
+
import "../__chunks/I2NJJ3XW.js";
|
|
27
27
|
import {
|
|
28
28
|
__objRest,
|
|
29
29
|
__spreadProps,
|
|
@@ -98,8 +98,9 @@ function createSelectStore(_a = {}) {
|
|
|
98
98
|
syncState.setValueOnMove,
|
|
99
99
|
false
|
|
100
100
|
),
|
|
101
|
+
labelElement: defaultValue(syncState.labelElement, null),
|
|
101
102
|
selectElement: defaultValue(syncState.selectElement, null),
|
|
102
|
-
|
|
103
|
+
listElement: defaultValue(syncState.listElement, null)
|
|
103
104
|
});
|
|
104
105
|
const select = createStore(initialState, composite, popover, store);
|
|
105
106
|
setup(
|
|
@@ -117,6 +118,14 @@ function createSelectStore(_a = {}) {
|
|
|
117
118
|
select.setState("value", item.value);
|
|
118
119
|
})
|
|
119
120
|
);
|
|
121
|
+
setup(
|
|
122
|
+
select,
|
|
123
|
+
() => sync(select, ["mounted"], (state) => {
|
|
124
|
+
if (state.mounted)
|
|
125
|
+
return;
|
|
126
|
+
select.setState("activeId", initialState.activeId);
|
|
127
|
+
})
|
|
128
|
+
);
|
|
120
129
|
setup(
|
|
121
130
|
select,
|
|
122
131
|
() => sync(select, ["mounted", "items", "value"], (state) => {
|
|
@@ -157,8 +166,9 @@ function createSelectStore(_a = {}) {
|
|
|
157
166
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, composite), popover), select), {
|
|
158
167
|
combobox,
|
|
159
168
|
setValue: (value) => select.setState("value", value),
|
|
169
|
+
setLabelElement: (element) => select.setState("labelElement", element),
|
|
160
170
|
setSelectElement: (element) => select.setState("selectElement", element),
|
|
161
|
-
|
|
171
|
+
setListElement: (element) => select.setState("listElement", element)
|
|
162
172
|
});
|
|
163
173
|
}
|
|
164
174
|
export {
|
package/esm/tab/tab-store.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.
|
|
2
|
-
import type { ComboboxStore } from "../combobox/combobox-store.
|
|
3
|
-
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
1
|
+
import type { CollectionStore, CollectionStoreItem } from "../collection/collection-store.ts";
|
|
2
|
+
import type { ComboboxStore } from "../combobox/combobox-store.ts";
|
|
3
|
+
import type { CompositeStore, CompositeStoreFunctions, CompositeStoreItem, CompositeStoreOptions, CompositeStoreState } from "../composite/composite-store.ts";
|
|
4
|
+
import type { SelectStore } from "../select/select-store.ts";
|
|
5
|
+
import type { Store, StoreOptions, StoreProps } from "../utils/store.ts";
|
|
6
|
+
import type { SetState } from "../utils/types.ts";
|
|
6
7
|
export declare function createTabStore({ composite: parentComposite, combobox, ...props }?: TabStoreProps): TabStore;
|
|
7
8
|
export interface TabStoreItem extends CompositeStoreItem {
|
|
8
9
|
dimmed?: boolean;
|
|
@@ -21,16 +22,20 @@ export interface TabStoreState extends CompositeStoreState<TabStoreItem> {
|
|
|
21
22
|
*
|
|
22
23
|
* Live examples:
|
|
23
24
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
24
|
-
* - [Combobox with
|
|
25
|
+
* - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
|
|
26
|
+
* - [Select with Combobox and
|
|
27
|
+
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
25
28
|
*/
|
|
26
29
|
selectedId: TabStoreState["activeId"];
|
|
27
30
|
/**
|
|
28
31
|
* Determines if the tab should be selected when it receives focus. If set to
|
|
29
|
-
* `false`, the tab will only be selected upon clicking, not when
|
|
30
|
-
*
|
|
32
|
+
* `false`, the tab will only be selected upon clicking, not when using arrow
|
|
33
|
+
* keys to shift focus.
|
|
31
34
|
*
|
|
32
35
|
* Live examples:
|
|
33
36
|
* - [Tab with React Router](https://ariakit.org/examples/tab-react-router)
|
|
37
|
+
* - [Select with Combobox and
|
|
38
|
+
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
34
39
|
* @default true
|
|
35
40
|
*/
|
|
36
41
|
selectOnMove?: boolean;
|
|
@@ -85,7 +90,7 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
85
90
|
* [Select](https://ariakit.org/components/select). The stores will share the
|
|
86
91
|
* same state.
|
|
87
92
|
*/
|
|
88
|
-
composite?: CompositeStore | null;
|
|
93
|
+
composite?: CompositeStore | SelectStore | null;
|
|
89
94
|
/**
|
|
90
95
|
* A reference to a [combobox
|
|
91
96
|
* store](https://ariakit.org/reference/use-combobox-store). This is used when
|
|
@@ -98,8 +103,10 @@ export interface TabStoreOptions extends StoreOptions<TabStoreState, "orientatio
|
|
|
98
103
|
* will be automatically set to the first enabled tab.
|
|
99
104
|
*
|
|
100
105
|
* Live examples:
|
|
101
|
-
* - [Combobox with
|
|
106
|
+
* - [Combobox with Tabs](https://ariakit.org/examples/combobox-tabs)
|
|
102
107
|
* - [Animated TabPanel](https://ariakit.org/examples/tab-panel-animated)
|
|
108
|
+
* - [Select with Combobox and
|
|
109
|
+
* Tabs](https://ariakit.org/examples/select-combobox-tab)
|
|
103
110
|
*/
|
|
104
111
|
defaultSelectedId?: TabStoreState["selectedId"];
|
|
105
112
|
}
|